diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php
index 7091b350e3a..cd1b780e1a1 100644
--- a/htdocs/admin/tools/dolibarr_export.php
+++ b/htdocs/admin/tools/dolibarr_export.php
@@ -604,7 +604,7 @@ print " \n";
print '
';
$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 '
';
print '
';
@@ -683,7 +683,7 @@ print '';
print '';
$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 '
';
print '
';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index ec51a50d8a5..9a149aa2f0d 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -659,11 +659,11 @@ class Form
$extrastyle = '';
if ($direction < 0) {
$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
- $extrastyle = 'padding: 0px; padding-left: 3px;';
+ $extrastyle = 'padding: 0px; padding-left: 2px;';
}
if ($direction > 0) {
$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
- $extrastyle = 'padding: 0px; padding-right: 3px;';
+ $extrastyle = 'padding: 0px; padding-right: 2px;';
}
$classfortooltip = 'classfortooltip';
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 7e26252380e..760327eb505 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1175,12 +1175,11 @@ class FormFile
* @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 int $permonobject Permission on object (so permission to delete or crop document)
- * @param int $useinecm Change output for use in ecm module:
- * 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)
+ * @param int $useinecm Change output to add more information:
+ * 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
* 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 int $maxlength Maximum length of file name shown.
* @param string $title Title before list. Use 'none' to disable title.
@@ -1287,7 +1286,7 @@ class FormFile
}
// 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');
}
if (empty($url)) {
@@ -1388,7 +1387,7 @@ class FormFile
// File name
- print '';
+ print ' | ';
// Show file name with link to download
//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 '';
- } else {
- print ' ';
}
print ' | ';
}
@@ -1536,7 +1533,7 @@ class FormFile
print ''.img_edit('default', 0, 'class="paddingrightonly"').'';
}
- 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;
if (in_array($modulepart, array('product', 'produit', 'service'))) {
$newmodulepart = 'produit|service';
@@ -1598,7 +1595,7 @@ class FormFile
if (getDolGlobalString('MAIN_ECM_DISABLE_JS')) {
$useajax = 0;
}
- print ''.img_delete().'';
+ print ''.img_delete().'';
}
print "";
diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php
index 7a0a3124ef1..6d346de35c1 100644
--- a/htdocs/core/class/utils.class.php
+++ b/htdocs/core/class/utils.class.php
@@ -560,13 +560,13 @@ class Utils
} elseif ($compression == 'zstd') {
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 = '';
} else {
- // Renommer fichier sortie en fichier erreur
+ // Rename file out into a file error
//print "$outputfile -> $outputerror";
@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
if (!$errormsg) {
$langs->load("errors");
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index 1944a491172..7d1a9471c43 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -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 int $socid Thirdparty id
@@ -647,9 +647,11 @@ function show_stats_for_company($product, $socid)
print '';
print $form->textwithpicto($product->stats_bom['nb_toconsume'], $langs->trans("RowMaterial"));
+ print ' ';
print $form->textwithpicto($product->stats_bom['nb_toproduce'], $langs->trans("Finished"));
print ' | ';
print $form->textwithpicto($product->stats_bom['qty_toconsume'], $langs->trans("RowMaterial"));
+ print ' ';
print $form->textwithpicto($product->stats_bom['qty_toproduce'], $langs->trans("Finished"));
print ' | ';
print '';
@@ -667,18 +669,27 @@ function show_stats_for_company($product, $socid)
print ''.img_object('', 'mrp', 'class="pictofixedwidth"').$langs->trans("MO").'';
print '';
print $form->textwithpicto($product->stats_mo['customers_toconsume'], $langs->trans("ToConsume"));
+ print ' ';
print $form->textwithpicto($product->stats_mo['customers_consumed'], $langs->trans("QtyAlreadyConsumed"));
+ print ' ';
print $form->textwithpicto($product->stats_mo['customers_toproduce'], $langs->trans("QtyToProduce"));
+ print ' ';
print $form->textwithpicto($product->stats_mo['customers_produced'], $langs->trans("QtyAlreadyProduced"));
print ' | ';
print $form->textwithpicto($product->stats_mo['nb_toconsume'], $langs->trans("ToConsume"));
+ print ' ';
print $form->textwithpicto($product->stats_mo['nb_consumed'], $langs->trans("QtyAlreadyConsumed"));
+ print ' ';
print $form->textwithpicto($product->stats_mo['nb_toproduce'], $langs->trans("QtyToProduce"));
+ print ' ';
print $form->textwithpicto($product->stats_mo['nb_produced'], $langs->trans("QtyAlreadyProduced"));
print ' | ';
print $form->textwithpicto($product->stats_mo['qty_toconsume'], $langs->trans("ToConsume"));
+ print ' ';
print $form->textwithpicto($product->stats_mo['qty_consumed'], $langs->trans("QtyAlreadyConsumed"));
+ print ' ';
print $form->textwithpicto($product->stats_mo['qty_toproduce'], $langs->trans("QtyToProduce"));
+ print ' ';
print $form->textwithpicto($product->stats_mo['qty_produced'], $langs->trans("QtyAlreadyProduced"));
print ' | ';
print '';
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index f6ebcdcbe2b..fcbc54c7dab 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -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);
diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
index e44c52b5d7d..ab1a9f5c9c2 100644
--- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
@@ -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);
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index a9a1cdf9ac8..fa415451a37 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -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
@@ -1489,6 +1495,8 @@ class pdf_crabe extends ModelePDFFactures
$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;
}
@@ -1500,8 +1508,6 @@ class pdf_crabe 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;
@@ -1520,7 +1526,12 @@ class pdf_crabe extends ModelePDFFactures
$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);
@@ -1531,10 +1542,8 @@ class pdf_crabe 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;
@@ -1553,7 +1562,12 @@ class pdf_crabe extends ModelePDFFactures
}
$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);
@@ -1562,7 +1576,6 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1);
}
}
- //}
// Revenue stamp
if (price2num($object->revenuestamp) != 0) {
diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php
index 4b4ce446060..8eb5ea95261 100644
--- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php
@@ -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);
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index 5a01ddd0d76..2392f459b49 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -1691,8 +1691,6 @@ class pdf_sponge 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;
@@ -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 .= ' ';
- $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);
@@ -1723,10 +1727,8 @@ class pdf_sponge 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;
@@ -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 .= ' ';
- $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);
@@ -1756,7 +1764,6 @@ class pdf_sponge extends ModelePDFFactures
}
}
}
- //}
// 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) {
@@ -1800,7 +1807,9 @@ 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 {
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
}
@@ -1812,8 +1821,6 @@ class pdf_sponge 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;
@@ -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 .= ' ';
- $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);
@@ -1844,10 +1856,8 @@ class pdf_sponge 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;
@@ -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 .= ' ';
- $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);
@@ -1880,7 +1895,6 @@ class pdf_sponge extends ModelePDFFactures
}
}
-
// Revenue stamp
if (price2num($object->revenuestamp) != 0) {
$index++;
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index bf7cca5ef62..66a4ae61fcb 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -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);
diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php
index ed286d71f22..8d492df6360 100644
--- a/htdocs/margin/productMargins.php
+++ b/htdocs/margin/productMargins.php
@@ -303,12 +303,24 @@ if ($result) {
$pv = $objp->selling_price;
$marge = $objp->marge;
- if ($marge < 0) {
- $marginRate = ($pa != 0) ? -1 * (100 * $marge / $pa) : '';
- $markRate = ($pv != 0) ? -1 * (100 * $marge / $pv) : '';
+ if ($pa != 0) {
+ $marginRate = (100 * $marge / $pa);
+ // We invert the sign if the margin is negative, regardless of the sign of the purchase price
+ if ($marge < 0) {
+ $marginRate = -$marginRate;
+ }
} else {
- $marginRate = ($pa != 0) ? (100 * $marge / $pa) : '';
- $markRate = ($pv != 0) ? (100 * $marge / $pv) : '';
+ $marginRate = '';
+ }
+
+ 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 '';
diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php
index 8a584b73276..3a19836369d 100644
--- a/htdocs/product/stats/facture.php
+++ b/htdocs/product/stats/facture.php
@@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
$langs->loadLangs(array('companies', 'bills', 'products', 'supplier_proposal'));
+$action = GETPOST('action', 'aZ');
+
$id = GETPOSTINT('id');
$ref = GETPOST('ref', 'alpha');
@@ -359,8 +361,8 @@ if ($id > 0 || !empty($ref)) {
print '| ';
print dol_print_date($db->jdate($objp->datef), 'dayhour')." | ";
print ''.$objp->qty." | \n";
- print ''.price($objp->total_ht)." | \n";
- print ''.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5, $paiement, $objp->type).' | ';
+ print ''.price($objp->total_ht)." | \n";
+ print ''.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5, $paiement, $objp->type).' | ';
// Fields from hook
$parameters = array();
$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 ' | ';
print ''.$total_qty.' | ';
- print ''.price($total_ht).' | ';
+ print ''.price($total_ht).' | ';
print ' | ';
print "";
print '';
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index 3cbc1d057a0..657cc4cd171 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -2466,7 +2466,9 @@ div.fichehalfright {
div.secondcolumn div.box {
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 */
@media only screen and (max-width: 1024px)