forked from Wavyzz/dolibarr
Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 20.0
This commit is contained in:
@@ -604,7 +604,7 @@ print "</div> <!-- end div fichehalfleft -->\n";
|
|||||||
print '<div id="backupdatabaseright" class="fichehalfright">';
|
print '<div id="backupdatabaseright" class="fichehalfright">';
|
||||||
|
|
||||||
$filearray = dol_dir_list($conf->admin->dir_output.'/backup', 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ? SORT_ASC : SORT_DESC), 1);
|
$filearray = dol_dir_list($conf->admin->dir_output.'/backup', 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ? SORT_ASC : SORT_DESC), 1);
|
||||||
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'backup/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"), '', 0, -1, '', '', 'ASC', 1, 0, -1, 'style="height:250px; overflow: auto;"');
|
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'backup/', 1, 3, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"), '', 0, -1, '', '', 'ASC', 1, 0, -1, 'style="height:250px; overflow: auto;"');
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@@ -683,7 +683,7 @@ print '</div>';
|
|||||||
print '<div id="backupfileright" class="fichehalfright">';
|
print '<div id="backupfileright" class="fichehalfright">';
|
||||||
|
|
||||||
$filearray = dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ? SORT_ASC : SORT_DESC), 1);
|
$filearray = dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ? SORT_ASC : SORT_DESC), 1);
|
||||||
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousArchiveFiles"), '', 0, -1, '', '', 'ASC', 1, 0, -1, 'style="height:250px; overflow: auto;"');
|
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 3, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousArchiveFiles"), '', 0, -1, '', '', 'ASC', 1, 0, -1, 'style="height:250px; overflow: auto;"');
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@@ -659,11 +659,11 @@ class Form
|
|||||||
$extrastyle = '';
|
$extrastyle = '';
|
||||||
if ($direction < 0) {
|
if ($direction < 0) {
|
||||||
$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
|
$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
|
||||||
$extrastyle = 'padding: 0px; padding-left: 3px;';
|
$extrastyle = 'padding: 0px; padding-left: 2px;';
|
||||||
}
|
}
|
||||||
if ($direction > 0) {
|
if ($direction > 0) {
|
||||||
$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
|
$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
|
||||||
$extrastyle = 'padding: 0px; padding-right: 3px;';
|
$extrastyle = 'padding: 0px; padding-right: 2px;';
|
||||||
}
|
}
|
||||||
|
|
||||||
$classfortooltip = 'classfortooltip';
|
$classfortooltip = 'classfortooltip';
|
||||||
|
|||||||
@@ -1175,12 +1175,11 @@ class FormFile
|
|||||||
* @param int $forcedownload Force to open dialog box "Save As" when clicking on file.
|
* @param int $forcedownload Force to open dialog box "Save As" when clicking on file.
|
||||||
* @param string $relativepath Relative path of docs (autodefined if not provided), relative to module dir, not to MAIN_DATA_ROOT.
|
* @param string $relativepath Relative path of docs (autodefined if not provided), relative to module dir, not to MAIN_DATA_ROOT.
|
||||||
* @param int $permonobject Permission on object (so permission to delete or crop document)
|
* @param int $permonobject Permission on object (so permission to delete or crop document)
|
||||||
* @param int $useinecm Change output for use in ecm module:
|
* @param int $useinecm Change output to add more information:
|
||||||
* 0 or 6: Add a preview column. Show also a rename button. Show also a crop button for some values of $modulepart (must be supported into hard coded list in this function + photos_resize.php + restrictedArea + checkUserAccessToObject)
|
* 0, 4, 5, 6: Add a preview column. Show also a rename button. Show also a crop button for some values of $modulepart (must be supported into hard coded list in this function + photos_resize.php + restrictedArea + checkUserAccessToObject)
|
||||||
* 1: Add link to edit ECM entry
|
* 1: Add link to edit ECM entry
|
||||||
* 2: Add rename and crop link
|
* 2: Add rename and crop link
|
||||||
* 4: Add a preview column
|
* 5: Add link to edit ECM entry and add a preview column
|
||||||
* 5: Add link to edit ECM entry and Add a preview column
|
|
||||||
* @param string $textifempty Text to show if filearray is empty ('NoFileFound' if not defined)
|
* @param string $textifempty Text to show if filearray is empty ('NoFileFound' if not defined)
|
||||||
* @param int $maxlength Maximum length of file name shown.
|
* @param int $maxlength Maximum length of file name shown.
|
||||||
* @param string $title Title before list. Use 'none' to disable title.
|
* @param string $title Title before list. Use 'none' to disable title.
|
||||||
@@ -1287,7 +1286,7 @@ class FormFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show list of existing files
|
// Show list of existing files
|
||||||
if ((empty($useinecm) || $useinecm == 6) && $title != 'none') {
|
if ((empty($useinecm) || $useinecm == 3 || $useinecm == 6) && $title != 'none') {
|
||||||
print load_fiche_titre($title ? $title : $langs->trans("AttachedFiles"), '', 'file-upload', 0, '', 'table-list-of-attached-files');
|
print load_fiche_titre($title ? $title : $langs->trans("AttachedFiles"), '', 'file-upload', 0, '', 'table-list-of-attached-files');
|
||||||
}
|
}
|
||||||
if (empty($url)) {
|
if (empty($url)) {
|
||||||
@@ -1388,7 +1387,7 @@ class FormFile
|
|||||||
|
|
||||||
|
|
||||||
// File name
|
// File name
|
||||||
print '<td class="minwith200 tdoverflowmax500">';
|
print '<td class="minwith200 tdoverflowmax500" title="'.dolPrintHTMLForAttribute($file['name']).'">';
|
||||||
|
|
||||||
// Show file name with link to download
|
// Show file name with link to download
|
||||||
//print "XX".$file['name']; //$file['name'] must be utf8
|
//print "XX".$file['name']; //$file['name'] must be utf8
|
||||||
@@ -1484,8 +1483,6 @@ class FormFile
|
|||||||
}
|
}
|
||||||
print ' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(empty($object->entity) ? $conf->entity : $object->entity).'&file='.urlencode($relativepath.$smallfile).'" title="">';
|
print ' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(empty($object->entity) ? $conf->entity : $object->entity).'&file='.urlencode($relativepath.$smallfile).'" title="">';
|
||||||
print '</a>';
|
print '</a>';
|
||||||
} else {
|
|
||||||
print ' ';
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@@ -1536,7 +1533,7 @@ class FormFile
|
|||||||
print '<a class="editfielda editfilelink" href="'.DOL_URL_ROOT.'/ecm/file_card.php?urlfile='.urlencode($file['name']).$param.'&backtopage='.urlencode($backtopage).'" rel="'.urlencode($file['name']).'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
|
print '<a class="editfielda editfilelink" href="'.DOL_URL_ROOT.'/ecm/file_card.php?urlfile='.urlencode($file['name']).$param.'&backtopage='.urlencode($backtopage).'" rel="'.urlencode($file['name']).'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($useinecm) || $useinecm == 2 || $useinecm == 6) { // 6=Media file manager
|
if (empty($useinecm) || $useinecm == 2 || $useinecm == 3 || $useinecm == 6) { // 6=Media file manager
|
||||||
$newmodulepart = $modulepart;
|
$newmodulepart = $modulepart;
|
||||||
if (in_array($modulepart, array('product', 'produit', 'service'))) {
|
if (in_array($modulepart, array('product', 'produit', 'service'))) {
|
||||||
$newmodulepart = 'produit|service';
|
$newmodulepart = 'produit|service';
|
||||||
@@ -1598,7 +1595,7 @@ class FormFile
|
|||||||
if (getDolGlobalString('MAIN_ECM_DISABLE_JS')) {
|
if (getDolGlobalString('MAIN_ECM_DISABLE_JS')) {
|
||||||
$useajax = 0;
|
$useajax = 0;
|
||||||
}
|
}
|
||||||
print '<a href="'.((($useinecm && $useinecm != 6) && $useajax) ? '#' : ($url.'?action=deletefile&token='.newToken().'&urlfile='.urlencode($filepath).$param)).'" class="reposition deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>';
|
print '<a href="'.((($useinecm && $useinecm != 3 && $useinecm != 6) && $useajax) ? '#' : ($url.'?action=deletefile&token='.newToken().'&urlfile='.urlencode($filepath).$param)).'" class="reposition deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>';
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
|
|||||||
@@ -560,13 +560,13 @@ class Utils
|
|||||||
} elseif ($compression == 'zstd') {
|
} elseif ($compression == 'zstd') {
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
}
|
}
|
||||||
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error
|
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg) || preg_match('/^\/\*!999999/', $errormsg)) { // Start of file is ok, NOT an error
|
||||||
$errormsg = '';
|
$errormsg = '';
|
||||||
} else {
|
} else {
|
||||||
// Renommer fichier sortie en fichier erreur
|
// Rename file out into a file error
|
||||||
//print "$outputfile -> $outputerror";
|
//print "$outputfile -> $outputerror";
|
||||||
@dol_delete_file($outputerror, 1, 0, 0, null, false, 0);
|
@dol_delete_file($outputerror, 1, 0, 0, null, false, 0);
|
||||||
@rename($outputfile, $outputerror);
|
@dol_move($outputfile, $outputerror, '0', 1, 0, 0);
|
||||||
// Si safe_mode on et command hors du parameter exec, on a un fichier out vide donc errormsg vide
|
// Si safe_mode on et command hors du parameter exec, on a un fichier out vide donc errormsg vide
|
||||||
if (!$errormsg) {
|
if (!$errormsg) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ function product_lot_admin_prepare_head()
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show stats for company
|
* Show stats for a product
|
||||||
*
|
*
|
||||||
* @param Product $product Product object
|
* @param Product $product Product object
|
||||||
* @param int $socid Thirdparty id
|
* @param int $socid Thirdparty id
|
||||||
@@ -647,9 +647,11 @@ function show_stats_for_company($product, $socid)
|
|||||||
|
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $form->textwithpicto($product->stats_bom['nb_toconsume'], $langs->trans("RowMaterial"));
|
print $form->textwithpicto($product->stats_bom['nb_toconsume'], $langs->trans("RowMaterial"));
|
||||||
|
print ' ';
|
||||||
print $form->textwithpicto($product->stats_bom['nb_toproduce'], $langs->trans("Finished"));
|
print $form->textwithpicto($product->stats_bom['nb_toproduce'], $langs->trans("Finished"));
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $form->textwithpicto($product->stats_bom['qty_toconsume'], $langs->trans("RowMaterial"));
|
print $form->textwithpicto($product->stats_bom['qty_toconsume'], $langs->trans("RowMaterial"));
|
||||||
|
print ' ';
|
||||||
print $form->textwithpicto($product->stats_bom['qty_toproduce'], $langs->trans("Finished"));
|
print $form->textwithpicto($product->stats_bom['qty_toproduce'], $langs->trans("Finished"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@@ -667,18 +669,27 @@ function show_stats_for_company($product, $socid)
|
|||||||
print '<a href="mo.php?id='.$product->id.'">'.img_object('', 'mrp', 'class="pictofixedwidth"').$langs->trans("MO").'</a>';
|
print '<a href="mo.php?id='.$product->id.'">'.img_object('', 'mrp', 'class="pictofixedwidth"').$langs->trans("MO").'</a>';
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $form->textwithpicto($product->stats_mo['customers_toconsume'], $langs->trans("ToConsume"));
|
print $form->textwithpicto($product->stats_mo['customers_toconsume'], $langs->trans("ToConsume"));
|
||||||
|
print ' ';
|
||||||
print $form->textwithpicto($product->stats_mo['customers_consumed'], $langs->trans("QtyAlreadyConsumed"));
|
print $form->textwithpicto($product->stats_mo['customers_consumed'], $langs->trans("QtyAlreadyConsumed"));
|
||||||
|
print ' ';
|
||||||
print $form->textwithpicto($product->stats_mo['customers_toproduce'], $langs->trans("QtyToProduce"));
|
print $form->textwithpicto($product->stats_mo['customers_toproduce'], $langs->trans("QtyToProduce"));
|
||||||
|
print ' ';
|
||||||
print $form->textwithpicto($product->stats_mo['customers_produced'], $langs->trans("QtyAlreadyProduced"));
|
print $form->textwithpicto($product->stats_mo['customers_produced'], $langs->trans("QtyAlreadyProduced"));
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $form->textwithpicto($product->stats_mo['nb_toconsume'], $langs->trans("ToConsume"));
|
print $form->textwithpicto($product->stats_mo['nb_toconsume'], $langs->trans("ToConsume"));
|
||||||
|
print ' ';
|
||||||
print $form->textwithpicto($product->stats_mo['nb_consumed'], $langs->trans("QtyAlreadyConsumed"));
|
print $form->textwithpicto($product->stats_mo['nb_consumed'], $langs->trans("QtyAlreadyConsumed"));
|
||||||
|
print ' ';
|
||||||
print $form->textwithpicto($product->stats_mo['nb_toproduce'], $langs->trans("QtyToProduce"));
|
print $form->textwithpicto($product->stats_mo['nb_toproduce'], $langs->trans("QtyToProduce"));
|
||||||
|
print ' ';
|
||||||
print $form->textwithpicto($product->stats_mo['nb_produced'], $langs->trans("QtyAlreadyProduced"));
|
print $form->textwithpicto($product->stats_mo['nb_produced'], $langs->trans("QtyAlreadyProduced"));
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $form->textwithpicto($product->stats_mo['qty_toconsume'], $langs->trans("ToConsume"));
|
print $form->textwithpicto($product->stats_mo['qty_toconsume'], $langs->trans("ToConsume"));
|
||||||
|
print ' ';
|
||||||
print $form->textwithpicto($product->stats_mo['qty_consumed'], $langs->trans("QtyAlreadyConsumed"));
|
print $form->textwithpicto($product->stats_mo['qty_consumed'], $langs->trans("QtyAlreadyConsumed"));
|
||||||
|
print ' ';
|
||||||
print $form->textwithpicto($product->stats_mo['qty_toproduce'], $langs->trans("QtyToProduce"));
|
print $form->textwithpicto($product->stats_mo['qty_toproduce'], $langs->trans("QtyToProduce"));
|
||||||
|
print ' ';
|
||||||
print $form->textwithpicto($product->stats_mo['qty_produced'], $langs->trans("QtyAlreadyProduced"));
|
print $form->textwithpicto($product->stats_mo['qty_produced'], $langs->trans("QtyAlreadyProduced"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@@ -925,8 +925,6 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
// Nothing to do
|
// Nothing to do
|
||||||
} else {
|
} else {
|
||||||
//Local tax 1 before VAT
|
//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) {
|
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||||
continue;
|
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 = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$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
|
//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) {
|
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||||
continue;
|
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 = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$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
|
// VAT
|
||||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
foreach ($this->tva_array as $tvakey => $tvaval) {
|
||||||
@@ -1008,6 +1015,8 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
||||||
$totalvat .= $tvaval['vatcode'].$tvacompl;
|
$totalvat .= $tvaval['vatcode'].$tvacompl;
|
||||||
|
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||||
|
$totalvat .= $tvacompl;
|
||||||
} else {
|
} else {
|
||||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
$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 = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$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 = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$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
|
// Nothing to do
|
||||||
} else {
|
} else {
|
||||||
//Local tax 1 before VAT
|
//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) {
|
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||||
continue;
|
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 = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$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
|
//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) {
|
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||||
continue;
|
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 = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$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
|
// VAT
|
||||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
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') {
|
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
|
||||||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
} 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 {
|
} else {
|
||||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
||||||
}
|
}
|
||||||
@@ -1225,8 +1234,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Local tax 1 after VAT
|
//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) {
|
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||||
continue;
|
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 = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@@ -1257,10 +1269,8 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
//Local tax 2 after VAT
|
//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) {
|
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||||
continue;
|
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 = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$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
|
// Nothing to do
|
||||||
} else {
|
} else {
|
||||||
//Local tax 1 before VAT
|
//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) {
|
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||||
continue;
|
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 = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$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
|
//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) {
|
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||||
continue;
|
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 = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$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
|
// VAT
|
||||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
foreach ($this->tva_array as $tvakey => $tvaval) {
|
||||||
if ($tvakey != 0) { // On affiche pas taux 0
|
if ($tvakey != 0) { // On affiche pas taux 0
|
||||||
@@ -1489,6 +1495,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
||||||
$totalvat .= $tvaval['vatcode'].$tvacompl;
|
$totalvat .= $tvaval['vatcode'].$tvacompl;
|
||||||
|
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||||
|
$totalvat .= $tvacompl;
|
||||||
} else {
|
} else {
|
||||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
||||||
}
|
}
|
||||||
@@ -1500,8 +1508,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Local tax 1 after VAT
|
//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) {
|
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1520,7 +1526,12 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
|
$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);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@@ -1531,10 +1542,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
//Local tax 2 after VAT
|
//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) {
|
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1553,7 +1562,12 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
|
$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);
|
$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);
|
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||||
@@ -1562,7 +1576,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
// Revenue stamp
|
// Revenue stamp
|
||||||
if (price2num($object->revenuestamp) != 0) {
|
if (price2num($object->revenuestamp) != 0) {
|
||||||
|
|||||||
@@ -1613,8 +1613,6 @@ class pdf_octopus extends ModelePDFFactures
|
|||||||
// Nothing to do
|
// Nothing to do
|
||||||
} else {
|
} else {
|
||||||
//Local tax 1 before VAT
|
//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) {
|
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||||
continue;
|
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 = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$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
|
//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) {
|
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||||
continue;
|
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 = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$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') {
|
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
|
||||||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
} 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 {
|
} else {
|
||||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
||||||
}
|
}
|
||||||
@@ -1725,8 +1735,6 @@ class pdf_octopus extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Local tax 1 after VAT
|
//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) {
|
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||||
continue;
|
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 = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@@ -1757,10 +1770,8 @@ class pdf_octopus extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
//Local tax 2 after VAT
|
//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) {
|
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||||
continue;
|
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 = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||||
|
|||||||
@@ -1691,8 +1691,6 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
// Nothing to do
|
// Nothing to do
|
||||||
} else {
|
} else {
|
||||||
//Local tax 1 before VAT
|
//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) {
|
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1713,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 = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||||
@@ -1723,10 +1727,8 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
//Local tax 2 before VAT
|
//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) {
|
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1746,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 = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||||
@@ -1756,7 +1764,6 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
// Situations totals might be wrong on huge amounts with old mode 1
|
// Situations totals might be wrong on huge amounts with old mode 1
|
||||||
if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1 && $object->situation_cycle_ref && $object->situation_counter > 1) {
|
if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1 && $object->situation_cycle_ref && $object->situation_counter > 1) {
|
||||||
@@ -1800,7 +1807,9 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
|
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
|
||||||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
} 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 {
|
} else {
|
||||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
||||||
}
|
}
|
||||||
@@ -1812,8 +1821,6 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Local tax 1 after VAT
|
//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) {
|
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1833,7 +1840,12 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@@ -1844,10 +1856,8 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
//Local tax 2 after VAT
|
//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) {
|
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1869,7 +1879,12 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
$totalvat .= ' ';
|
$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);
|
$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);
|
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||||
@@ -1880,7 +1895,6 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Revenue stamp
|
// Revenue stamp
|
||||||
if (price2num($object->revenuestamp) != 0) {
|
if (price2num($object->revenuestamp) != 0) {
|
||||||
$index++;
|
$index++;
|
||||||
|
|||||||
@@ -1110,8 +1110,6 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
// Nothing to do
|
// Nothing to do
|
||||||
} else {
|
} else {
|
||||||
//Local tax 1 before VAT
|
//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) {
|
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1130,7 +1128,13 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
|
$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);
|
$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);
|
$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
|
//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) {
|
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1162,7 +1164,13 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
|
$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);
|
$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);
|
$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
|
// VAT
|
||||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
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') {
|
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
|
||||||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
} 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 {
|
} else {
|
||||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
||||||
}
|
}
|
||||||
@@ -1204,8 +1213,6 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Local tax 1 after VAT
|
//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) {
|
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1225,7 +1232,12 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
|
$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);
|
$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);
|
$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
|
//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) {
|
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1259,7 +1269,12 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
|
$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);
|
$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);
|
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||||
|
|||||||
@@ -303,12 +303,24 @@ if ($result) {
|
|||||||
$pv = $objp->selling_price;
|
$pv = $objp->selling_price;
|
||||||
$marge = $objp->marge;
|
$marge = $objp->marge;
|
||||||
|
|
||||||
if ($marge < 0) {
|
if ($pa != 0) {
|
||||||
$marginRate = ($pa != 0) ? -1 * (100 * $marge / $pa) : '';
|
$marginRate = (100 * $marge / $pa);
|
||||||
$markRate = ($pv != 0) ? -1 * (100 * $marge / $pv) : '';
|
// We invert the sign if the margin is negative, regardless of the sign of the purchase price
|
||||||
|
if ($marge < 0) {
|
||||||
|
$marginRate = -$marginRate;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$marginRate = ($pa != 0) ? (100 * $marge / $pa) : '';
|
$marginRate = '';
|
||||||
$markRate = ($pv != 0) ? (100 * $marge / $pv) : '';
|
}
|
||||||
|
|
||||||
|
if ($pv != 0) {
|
||||||
|
$markRate = (100 * $marge / $pv);
|
||||||
|
// We invert the sign if the margin is negative, as in the original logic
|
||||||
|
if ($marge < 0) {
|
||||||
|
$markRate = -$markRate;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$markRate = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('companies', 'bills', 'products', 'supplier_proposal'));
|
$langs->loadLangs(array('companies', 'bills', 'products', 'supplier_proposal'));
|
||||||
|
|
||||||
|
$action = GETPOST('action', 'aZ');
|
||||||
|
|
||||||
$id = GETPOSTINT('id');
|
$id = GETPOSTINT('id');
|
||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
|
||||||
@@ -359,8 +361,8 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print dol_print_date($db->jdate($objp->datef), 'dayhour')."</td>";
|
print dol_print_date($db->jdate($objp->datef), 'dayhour')."</td>";
|
||||||
print '<td class="center">'.$objp->qty."</td>\n";
|
print '<td class="center">'.$objp->qty."</td>\n";
|
||||||
print '<td align="right">'.price($objp->total_ht)."</td>\n";
|
print '<td class="right">'.price($objp->total_ht)."</td>\n";
|
||||||
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5, $paiement, $objp->type).'</td>';
|
print '<td class="right">'.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5, $paiement, $objp->type).'</td>';
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
@@ -377,7 +379,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
}
|
}
|
||||||
print '<td colspan="3"></td>';
|
print '<td colspan="3"></td>';
|
||||||
print '<td class="center">'.$total_qty.'</td>';
|
print '<td class="center">'.$total_qty.'</td>';
|
||||||
print '<td align="right">'.price($total_ht).'</td>';
|
print '<td class="right">'.price($total_ht).'</td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@@ -2466,7 +2466,9 @@ div.fichehalfright {
|
|||||||
div.secondcolumn div.box {
|
div.secondcolumn div.box {
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
}*/
|
}*/
|
||||||
|
div.firstcolumn > table.noborder, div.secondcolumn > table.noborder, div.firstcolumn > div > table.noborder, div.secondcolumn > div > table.noborder {
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Force values on one column for small screen */
|
/* Force values on one column for small screen */
|
||||||
@media only screen and (max-width: 1024px)
|
@media only screen and (max-width: 1024px)
|
||||||
|
|||||||
Reference in New Issue
Block a user