forked from Wavyzz/dolibarr
Fix option MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT
This commit is contained in:
@@ -1195,6 +1195,14 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
$outputlangsbis = null;
|
||||
if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
|
||||
$outputlangsbis = new Translate('', $conf);
|
||||
$outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
|
||||
$outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
|
||||
$default_font_size--;
|
||||
}
|
||||
|
||||
$tab2_top = $posy;
|
||||
$tab2_hl = 4;
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
@@ -1213,7 +1221,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
// Total HT
|
||||
$pdf->SetFillColor(255, 255, 255);
|
||||
$pdf->SetXY($col1x, $tab2_top + 0);
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total") : ''), 0, 'L', 1);
|
||||
|
||||
$total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
|
||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||
|
||||
@@ -1353,7 +1353,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$posy = $pdf->GetY();
|
||||
}
|
||||
|
||||
// cumul TVA précédent
|
||||
// Cumulate preceding VAT
|
||||
$index++;
|
||||
$pdf->SetFillColor(255, 255, 255);
|
||||
$pdf->SetXY($col1x, $posy);
|
||||
@@ -1427,7 +1427,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
// Total remise
|
||||
$total_line_remise = 0;
|
||||
foreach ($object->lines as $i => $line) {
|
||||
$total_line_remise += pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); // TODO: add this methode to core/lib/pdf.lib
|
||||
$total_line_remise += pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); // TODO: add this method to core/lib/pdf.lib
|
||||
// Gestion remise sous forme de ligne négative
|
||||
if ($line->total_ht < 0) {
|
||||
$total_line_remise += -$line->total_ht;
|
||||
@@ -1458,7 +1458,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
// Total HT
|
||||
$pdf->SetFillColor(255, 255, 255);
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1);
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total") : ''), 0, 'L', 1);
|
||||
|
||||
$total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
|
||||
Reference in New Issue
Block a user