Fix PDF_LOCALTAXx_LABEL_IS_CODE_OR_RATE
This commit is contained in:
parent
44a00f538e
commit
8b6ef4dfe0
6 changed files with 152 additions and 69 deletions
|
|
@ -925,8 +925,6 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
// Nothing to do
|
||||
} else {
|
||||
//Local tax 1 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
//{
|
||||
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -945,7 +943,13 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -955,10 +959,8 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Local tax 2 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
//{
|
||||
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -977,7 +979,13 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -987,7 +995,6 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
// VAT
|
||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
||||
|
|
@ -1008,6 +1015,8 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
||||
$totalvat .= $tvaval['vatcode'].$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
||||
}
|
||||
|
|
@ -1041,7 +1050,12 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1076,7 +1090,12 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
|
|||
|
|
@ -1132,8 +1132,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
// Nothing to do
|
||||
} else {
|
||||
//Local tax 1 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
//{
|
||||
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -1151,7 +1149,13 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1161,10 +1165,8 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Local tax 2 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
//{
|
||||
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -1183,7 +1185,13 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1193,7 +1201,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
// VAT
|
||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
||||
|
|
@ -1213,7 +1220,9 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
||||
$totalvat .= ($tvaval['vatcode'] ? $tvaval['vatcode'] : vatrate($tvaval['vatrate'], 1)).$tvacompl;
|
||||
$totalvat .= $tvaval['vatcode'].$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
||||
}
|
||||
|
|
@ -1225,8 +1234,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
|
||||
//Local tax 1 after VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
//{
|
||||
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||
continue;
|
||||
|
|
@ -1246,7 +1253,12 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
|
|
@ -1257,10 +1269,8 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Local tax 2 after VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
//{
|
||||
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||
continue;
|
||||
|
|
@ -1282,7 +1292,12 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
|
|||
|
|
@ -1402,8 +1402,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||
// Nothing to do
|
||||
} else {
|
||||
//Local tax 1 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
//{
|
||||
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -1424,7 +1422,13 @@ class pdf_crabe extends ModelePDFFactures
|
|||
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1434,10 +1438,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Local tax 2 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
//{
|
||||
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -1457,7 +1459,13 @@ class pdf_crabe extends ModelePDFFactures
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1468,8 +1476,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||
}
|
||||
}
|
||||
|
||||
//}
|
||||
|
||||
// VAT
|
||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
||||
if ($tvakey != 0) { // On affiche pas taux 0
|
||||
|
|
|
|||
|
|
@ -1613,8 +1613,6 @@ class pdf_octopus extends ModelePDFFactures
|
|||
// Nothing to do
|
||||
} else {
|
||||
//Local tax 1 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
//{
|
||||
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -1635,7 +1633,13 @@ class pdf_octopus extends ModelePDFFactures
|
|||
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1645,10 +1649,8 @@ class pdf_octopus extends ModelePDFFactures
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Local tax 2 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
//{
|
||||
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -1668,7 +1670,13 @@ class pdf_octopus extends ModelePDFFactures
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1713,7 +1721,9 @@ class pdf_octopus extends ModelePDFFactures
|
|||
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
||||
$totalvat .= ($tvaval['vatcode'] ? $tvaval['vatcode'] : vatrate($tvaval['vatrate'], 1)).$tvacompl;
|
||||
$totalvat .= $tvaval['vatcode'].$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
||||
}
|
||||
|
|
@ -1725,8 +1735,6 @@ class pdf_octopus extends ModelePDFFactures
|
|||
}
|
||||
|
||||
//Local tax 1 after VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
//{
|
||||
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||
continue;
|
||||
|
|
@ -1746,7 +1754,12 @@ class pdf_octopus extends ModelePDFFactures
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
|
|
@ -1757,10 +1770,8 @@ class pdf_octopus extends ModelePDFFactures
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Local tax 2 after VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
//{
|
||||
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||
continue;
|
||||
|
|
@ -1782,7 +1793,12 @@ class pdf_octopus extends ModelePDFFactures
|
|||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
|
|||
|
|
@ -1711,7 +1711,13 @@ class pdf_sponge extends ModelePDFFactures
|
|||
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1742,7 +1748,13 @@ class pdf_sponge extends ModelePDFFactures
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1795,7 +1807,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
||||
$totalvat .= ($tvaval['vatcode'] ? $tvaval['vatcode'] : vatrate($tvaval['vatrate'], 1)).$tvacompl;
|
||||
$totalvat .= $tvaval['vatcode'].$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1110,8 +1110,6 @@ class pdf_azur extends ModelePDFPropales
|
|||
// Nothing to do
|
||||
} else {
|
||||
//Local tax 1 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
//{
|
||||
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -1130,7 +1128,13 @@ class pdf_azur extends ModelePDFPropales
|
|||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1140,10 +1144,8 @@ class pdf_azur extends ModelePDFPropales
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Local tax 2 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
//{
|
||||
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -1162,7 +1164,13 @@ class pdf_azur extends ModelePDFPropales
|
|||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1172,7 +1180,6 @@ class pdf_azur extends ModelePDFPropales
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
// VAT
|
||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
||||
|
|
@ -1192,7 +1199,9 @@ class pdf_azur extends ModelePDFPropales
|
|||
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
||||
$totalvat .= ($tvaval['vatcode'] ? $tvaval['vatcode'] : vatrate($tvaval['vatrate'], 1)).$tvacompl;
|
||||
$totalvat .= $tvaval['vatcode'].$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
||||
}
|
||||
|
|
@ -1204,8 +1213,6 @@ class pdf_azur extends ModelePDFPropales
|
|||
}
|
||||
|
||||
//Local tax 1 after VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
//{
|
||||
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||
continue;
|
||||
|
|
@ -1225,7 +1232,12 @@ class pdf_azur extends ModelePDFPropales
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
|
||||
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1235,10 +1247,8 @@ class pdf_azur extends ModelePDFPropales
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Local tax 2 after VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
//{
|
||||
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||
continue;
|
||||
|
|
@ -1259,7 +1269,12 @@ class pdf_azur extends ModelePDFPropales
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
|
||||
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
|
|||
Loading…
Reference in a new issue