2
0
forked from Wavyzz/dolibarr

Debug modulebuilder

This commit is contained in:
Laurent Destailleur
2020-05-31 23:11:49 +02:00
parent 3349144f5e
commit 28df07225d
3 changed files with 4 additions and 60 deletions

View File

@@ -2311,7 +2311,7 @@ elseif (!empty($module))
print '<span class="opacitymedium">'.$langs->trans("EnterNameOfObjectDesc").'</span><br><br>';
print '<input type="text" name="objectname" value="'.dol_escape_htmltag(GETPOST('objectname', 'alpha') ?GETPOST('objectname', 'alpha') : $modulename).'" placeholder="'.dol_escape_htmltag($langs->trans("ObjectKey")).'"><br>';
print '<input type="text" name="objectname" maxlength="64" value="'.dol_escape_htmltag(GETPOST('objectname', 'alpha') ? GETPOST('objectname', 'alpha') : $modulename).'" placeholder="'.dol_escape_htmltag($langs->trans("ObjectKey")).'"><br>';
print '<input type="checkbox" name="includerefgeneration" value="includerefgeneration"> '.$form->textwithpicto($langs->trans("IncludeRefGeneration"), $langs->trans("IncludeRefGenerationHelp")).'<br>';
print '<input type="checkbox" name="includedocgeneration" value="includedocgeneration"> '.$form->textwithpicto($langs->trans("IncludeDocGeneration"), $langs->trans("IncludeDocGenerationHelp")).'<br>';
print '<input type="submit" class="button" name="create" value="'.dol_escape_htmltag($langs->trans("Generate")).'"'.($dirins ? '' : ' disabled="disabled"').'>';

View File

@@ -1027,7 +1027,7 @@ class MyObject extends CommonObject
$langs->load("mymodule@mymodule");
if (!dol_strlen($modele)) {
$modele = 'standard';
$modele = 'standard_myobject';
if ($this->modelpdf) {
$modele = $this->modelpdf;

View File

@@ -295,10 +295,6 @@ class pdf_standard_myobject extends ModelePDFMyObject
{
$object->fetch_thirdparty();
$deja_regle = $object->getSommePaiement(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
$amount_credit_notes_included = $object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
$amount_deposits_included = $object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
// Definition of $dir and $file
if ($object->specimen)
{
@@ -1076,68 +1072,16 @@ class pdf_standard_myobject extends ModelePDFMyObject
}
}
$objectidnext = $object->getIdReplacingInvoice('validated');
if ($object->type == 0 && $objectidnext)
{
$objectreplacing = new Facture($this->db);
$objectreplacing->fetch($objectidnext);
$posy += 3;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("ReplacementByInvoice").' : '.$outputlangs->convToOutputCharset($objectreplacing->ref), '', 'R');
}
if ($object->type == 1)
{
$objectreplaced = new Facture($this->db);
$objectreplaced->fetch($object->fk_facture_source);
$posy += 4;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("ReplacementInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R');
}
if ($object->type == 2 && !empty($object->fk_facture_source))
{
$objectreplaced = new Facture($this->db);
$objectreplaced->fetch($object->fk_facture_source);
$posy += 3;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("CorrectionInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R');
}
$posy += 4;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$title = $outputlangs->transnoentities("DateInvoice");
$title = $outputlangs->transnoentities("Date");
if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
$title .= ' - '.$outputlangsbis->transnoentities("DateInvoice");
$title .= ' - '.$outputlangsbis->transnoentities("Date");
}
$pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs), '', 'R');
if (!empty($conf->global->INVOICE_POINTOFTAX_DATE))
{
$posy += 4;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("DatePointOfTax")." : ".dol_print_date($object->date_pointoftax, "day", false, $outputlangs), '', 'R');
}
if ($object->type != 2)
{
$posy += 3;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$title = $outputlangs->transnoentities("DateDue");
if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
$title .= ' - '.$outputlangsbis->transnoentities("DateDue");
}
$pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date_lim_reglement, "day", false, $outputlangs, true), '', 'R');
}
if ($object->thirdparty->code_client)
{
$posy += 3;