Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-08-25 19:33:24 +02:00
commit e5937ef742
4 changed files with 15 additions and 14 deletions

View File

@ -1181,6 +1181,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
$pdf->SetAutoPageBreak(1, 0); // Restore pagebreak
}
if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(0, 0); } // Option for disable auto pagebreak
if ($line) { // Free text
$pdf->SetXY($dims['lm'], -$posy);
if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { // by default
@ -1190,6 +1191,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
}
$posy -= $freetextheight;
}
if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(1, 0); } // Restore pagebreak
$pdf->SetY(-$posy);
@ -1199,16 +1201,15 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
}
// Option for set top margin height of footer after freetext
if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalString('PDF_FOOTER_TOP_MARGIN') === '0') {
// TODO Remove this case. Height should be good automatically, only $posy-- should be required.
$posy -= getDolGlobalInt('PDF_FOOTER_TOP_MARGIN');
if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalInt('PDF_FOOTER_TOP_MARGIN') === 0) {
$posy -= floatval(getDolGlobalString('PDF_FOOTER_TOP_MARGIN'));
} else {
$posy--;
}
if (getDolGlobalString('PDF_FOOTER_DISABLE_PAGEBREAK') === '1') { $pdf->SetAutoPageBreak(0, 0); } // Option for disable auto pagebreak
if (getDolGlobalInt('PDF_FOOTER_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(0, 0); } // Option for disable auto pagebreak
$pdf->writeHTMLCell($pdf->page_largeur - $pdf->margin_left - $pdf->margin_right, $mycustomfooterheight, $dims['lm'], $dims['hk'] - $posy, dol_htmlentitiesbr($mycustomfooter, 1, 'UTF-8', 0));
if (getDolGlobalString('PDF_FOOTER_DISABLE_PAGEBREAK') === '1') { $pdf->SetAutoPageBreak(1, 0); } // Restore pagebreak
if (getDolGlobalInt('PDF_FOOTER_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(1, 0); } // Restore pagebreak
$posy -= $mycustomfooterheight - 3;
} else {
@ -1224,6 +1225,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
$pdf->SetAutoPageBreak(1, 0); // Restore pagebreak
}
if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(0, 0); } // Option for disable auto pagebreak
if ($line) { // Free text
$pdf->SetXY($dims['lm'], -$posy);
if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { // by default
@ -1233,6 +1235,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
}
$posy -= $freetextheight;
}
if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(1, 0); } // Restore pagebreak
$pdf->SetY(-$posy);
@ -1242,9 +1245,8 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
}
// Option for set top margin height of footer after freetext
if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalString('PDF_FOOTER_TOP_MARGIN') === '0') {
// TODO Remove this case. Height should be good automatically, only $posy-- should be required.
$posy -= getDolGlobalString('PDF_FOOTER_TOP_MARGIN');
if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalInt('PDF_FOOTER_TOP_MARGIN') === 0) {
$posy -= floatval(getDolGlobalString('PDF_FOOTER_TOP_MARGIN'));
} else {
$posy--;
}

View File

@ -1959,7 +1959,7 @@ class CommandeFournisseur extends CommonOrder
$this->line->total_localtax2 = $total_localtax2;
$this->line->total_ttc = $total_ttc;
$this->line->product_type = $type;
$this->line->special_code = $special_code;
$this->line->special_code = (!empty($this->special_code) ? $this->special_code : 0);
$this->line->origin = $origin;
$this->line->origin_id = $origin_id;
$this->line->fk_unit = $fk_unit;
@ -2858,7 +2858,7 @@ class CommandeFournisseur extends CommonOrder
$this->line->total_localtax2 = $total_localtax2;
$this->line->total_ttc = $total_ttc;
$this->line->product_type = $type;
$this->line->special_code = $this->special_code;
$this->line->special_code = (!empty($this->special_code) ? $this->special_code : 0);
$this->line->origin = $this->origin;
$this->line->fk_unit = $fk_unit;

View File

@ -669,11 +669,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
if (GETPOST('lang_id', 'aZ09'))
$newlang = GETPOST('lang_id', 'aZ09');
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);

View File

@ -2192,7 +2192,7 @@ class SupplierProposal extends CommonObject
$this->labelStatus[self::STATUS_NOTSIGNED] = $langs->transnoentitiesnoconv("SupplierProposalStatusNotSigned");
$this->labelStatus[self::STATUS_CLOSE] = $langs->transnoentitiesnoconv("SupplierProposalStatusClosed");
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv("SupplierProposalStatusDraftShort");
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv("Opened");
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv("SupplierProposalStatusValidatedShort");
$this->labelStatusShort[self::STATUS_SIGNED] = $langs->transnoentitiesnoconv("SupplierProposalStatusSignedShort");
$this->labelStatusShort[self::STATUS_NOTSIGNED] = $langs->transnoentitiesnoconv("SupplierProposalStatusNotSignedShort");
$this->labelStatusShort[self::STATUS_CLOSE] = $langs->transnoentitiesnoconv("SupplierProposalStatusClosedShort");