mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
1c52869e3b
|
|
@ -604,7 +604,7 @@ print "</div> <!-- end div fichehalfleft -->\n";
|
|||
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);
|
||||
$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 '</div>';
|
||||
|
|
@ -683,7 +683,7 @@ print '</div>';
|
|||
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);
|
||||
$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 '</div>';
|
||||
|
|
|
|||
|
|
@ -375,6 +375,7 @@ if ($action == 'create') {
|
|||
} elseif (!empty($object->ref)) {
|
||||
$title = $object->ref." - ".$langs->trans("Card");
|
||||
}
|
||||
|
||||
llxHeader("", $title, $help_url);
|
||||
|
||||
// Creation
|
||||
|
|
@ -435,7 +436,7 @@ if ($action == 'create') {
|
|||
// Status
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Status").'</td>';
|
||||
print '<td>';
|
||||
print $form->selectarray("clos", $object->status, (GETPOSTINT('clos') != '' ? GETPOSTINT('clos') : $object->status), 0, 0, 0, '', 0, 0, 0, '', 'maxwidth150onsmartphone');
|
||||
print $form->selectarray("clos", $object->labelStatus, (GETPOSTINT('clos') != '' ? GETPOSTINT('clos') : $object->status), 0, 0, 0, '', 0, 0, 0, '', 'minwidth100 maxwidth150onsmartphone');
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
|
|
|
|||
|
|
@ -181,8 +181,12 @@ if ($action == "importSignature") {
|
|||
$s = $pdf->getTemplatesize($tppl);
|
||||
$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
|
||||
$pdf->useTemplate($tppl);
|
||||
$propalsignonspecificpage = getDolGlobalInt("PROPAL_SIGNATURE_ON_SPECIFIC_PAGE");
|
||||
if ($propalsignonspecificpage < 0) {
|
||||
$propalsignonspecificpage = $pagecount - abs($propalsignonspecificpage);
|
||||
}
|
||||
|
||||
if (getDolGlobalString("PROPAL_SIGNATURE_ON_ALL_PAGES") || getDolGlobalInt("PROPAL_SIGNATURE_ON_SPECIFIC_PAGE") == $i) {
|
||||
if (getDolGlobalString("PROPAL_SIGNATURE_ON_ALL_PAGES") || $propalsignonspecificpage == $i) {
|
||||
// A signature image file is 720 x 180 (ratio 1/4) but we use only the size into PDF
|
||||
// TODO Get position of box from PDF template
|
||||
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ class DolEditor
|
|||
|
||||
$htmlencode_force = preg_match('/_encoded$/', $this->toolbarname) ? 'true' : 'false';
|
||||
|
||||
$out .= '<!-- Output ckeditor $disallowAnyContent='.dol_escape_htmltag($disallowAnyContent).' toolbarname='.dol_escape_htmltag($this->toolbarname).' -->'."\n";
|
||||
$out .= '<!-- Output ckeditor disallowAnyContent='.dol_escape_htmltag($disallowAnyContent).' toolbarname='.dol_escape_htmltag($this->toolbarname).' -->'."\n";
|
||||
$out .= '<script nonce="'.getNonce().'" type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
/* console.log("Run ckeditor"); */
|
||||
|
|
@ -216,8 +216,8 @@ class DolEditor
|
|||
versionCheck: false,
|
||||
readOnly: '.($this->readonly ? 'true' : 'false').',
|
||||
htmlEncodeOutput: '.dol_escape_js($htmlencode_force).',
|
||||
allowedContent: '.($disallowAnyContent ? 'false' : 'true').', /* Advanced Content Filter (ACF) is own when allowedContent is false */
|
||||
extraAllowedContent: \'a[target];div{float,display}\', /* Add the style float and display into div to default other allowed tags */
|
||||
allowedContent: '.($disallowAnyContent ? 'false' : 'true').', /* Advanced Content Filter (ACF) is on when allowedContent is false */
|
||||
extraAllowedContent: \'a[target];section[contenteditable,id];div{float,display}\', /* Allow a tag with attribute target, allow seciont tag and allow the style float and display into div to default other allowed tags */
|
||||
disallowedContent: \'\', /* Tags that are not allowed */
|
||||
fullPage: '.($fullpage ? 'true' : 'false').', /* if true, the html, header and body tags are kept */
|
||||
toolbar: \''.dol_escape_js($this->toolbarname).'\',
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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 '<td class="minwith200 tdoverflowmax500">';
|
||||
print '<td class="minwith200 tdoverflowmax500" title="'.dolPrintHTMLForAttribute($file['name']).'">';
|
||||
|
||||
// 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 '</a>';
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
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>';
|
||||
}
|
||||
|
||||
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 '<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>";
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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 '</td><td class="right">';
|
||||
print $form->textwithpicto($product->stats_bom['nb_toconsume'], $langs->trans("RowMaterial"));
|
||||
print ' ';
|
||||
print $form->textwithpicto($product->stats_bom['nb_toproduce'], $langs->trans("Finished"));
|
||||
print '</td><td class="right">';
|
||||
print $form->textwithpicto($product->stats_bom['qty_toconsume'], $langs->trans("RowMaterial"));
|
||||
print ' ';
|
||||
print $form->textwithpicto($product->stats_bom['qty_toproduce'], $langs->trans("Finished"));
|
||||
print '</td>';
|
||||
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 '</td><td class="right">';
|
||||
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 '</td><td class="right">';
|
||||
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 '</td><td class="right">';
|
||||
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 '</td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -925,8 +925,6 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
// Nothing to do
|
||||
} else {
|
||||
//Local tax 1 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
//{
|
||||
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -945,7 +943,13 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -955,10 +959,8 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Local tax 2 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
//{
|
||||
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -977,7 +979,13 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -987,7 +995,6 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
// VAT
|
||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
||||
|
|
@ -1008,6 +1015,8 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
||||
$totalvat .= $tvaval['vatcode'].$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
||||
}
|
||||
|
|
@ -1041,7 +1050,12 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1076,7 +1090,12 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
|
|||
|
|
@ -1132,8 +1132,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
// Nothing to do
|
||||
} else {
|
||||
//Local tax 1 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
//{
|
||||
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -1151,7 +1149,13 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1161,10 +1165,8 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Local tax 2 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
//{
|
||||
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -1183,7 +1185,13 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1193,7 +1201,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
// VAT
|
||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
||||
|
|
@ -1213,7 +1220,9 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
||||
$totalvat .= ($tvaval['vatcode'] ? $tvaval['vatcode'] : vatrate($tvaval['vatrate'], 1)).$tvacompl;
|
||||
$totalvat .= $tvaval['vatcode'].$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
||||
}
|
||||
|
|
@ -1225,8 +1234,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
|
||||
//Local tax 1 after VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
//{
|
||||
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||
continue;
|
||||
|
|
@ -1246,7 +1253,12 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
|
|
@ -1257,10 +1269,8 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Local tax 2 after VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
//{
|
||||
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('2', '4', '6'))) {
|
||||
continue;
|
||||
|
|
@ -1282,7 +1292,12 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
|
|||
|
|
@ -1402,8 +1402,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||
// Nothing to do
|
||||
} else {
|
||||
//Local tax 1 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
//{
|
||||
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -1424,7 +1422,13 @@ class pdf_crabe extends ModelePDFFactures
|
|||
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1434,10 +1438,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Local tax 2 before VAT
|
||||
//if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
//{
|
||||
foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
|
||||
if (in_array((string) $localtax_type, array('1', '3', '5'))) {
|
||||
continue;
|
||||
|
|
@ -1457,7 +1459,13 @@ class pdf_crabe extends ModelePDFFactures
|
|||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate(abs($tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1468,8 +1476,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||
}
|
||||
}
|
||||
|
||||
//}
|
||||
|
||||
// VAT
|
||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
||||
if ($tvakey != 0) { // On affiche pas taux 0
|
||||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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++;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -2672,7 +2672,7 @@ if ($action == 'create') {
|
|||
|
||||
if ($object->statut == CommandeFournisseur::STATUS_ACCEPTED) {
|
||||
if ($usercanorder) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=createorder#makeorder">'.$langs->trans("MakeOrder").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=createorder&token='.newToken().'#makeorder">'.$langs->trans("MakeOrder").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("MakeOrder").'</a></div>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,9 +158,9 @@ function testSqlAndScriptInject($val, $type)
|
|||
// We check string because some hacks try to obfuscate evil strings by inserting non printable chars. Example: 'java(ascci09)scr(ascii00)ipt' is processed like 'javascript' (whatever is place of evil ascii char)
|
||||
// We should use dol_string_nounprintableascii but function is not yet loaded/available
|
||||
// Example of valid UTF8 chars:
|
||||
// utf8=utf8mb3: '\x09', '\x0A', '\x0D', '\x7E'
|
||||
// utf8=utf8mb3: '\xE0\xA0\x80'
|
||||
// utf8mb4: '\xF0\x9D\x84\x9E' (but this may be refused by the database insert if pagecode is utf8=utf8mb3)
|
||||
// utf8 or utf8mb3: '\x09', '\x0A', '\x0D', '\x7E'
|
||||
// utf8 or utf8mb3: '\xE0\xA0\x80'
|
||||
// utf8mb4: '\xF0\x9D\x84\x9E' (so this may be refused by the database insert if pagecode is utf8=utf8mb3)
|
||||
$newval = preg_replace('/[\x00-\x08\x0B-\x0C\x0E-\x1F\x7F]/u', '', $val); // /u operator makes UTF8 valid characters being ignored so are not included into the replace
|
||||
|
||||
// Note that $newval may also be completely empty '' when non valid UTF8 are found.
|
||||
|
|
|
|||
|
|
@ -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 '<tr class="oddeven">';
|
||||
|
|
|
|||
|
|
@ -158,10 +158,10 @@ if (!defined('NOREQUIREDB')) {
|
|||
print "SorryWebsiteIsCurrentlyOffLine";
|
||||
}
|
||||
print '</div>';
|
||||
exit;
|
||||
exit(1);
|
||||
}
|
||||
dol_print_error($db, "host=".$conf->db->host.", port=".$conf->db->port.", user=".$conf->db->user.", databasename=".$conf->db->name.", ".$db->error);
|
||||
exit;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 '<td class="center">';
|
||||
print dol_print_date($db->jdate($objp->datef), 'dayhour')."</td>";
|
||||
print '<td class="center">'.$objp->qty."</td>\n";
|
||||
print '<td align="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">'.price($objp->total_ht)."</td>\n";
|
||||
print '<td class="right">'.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5, $paiement, $objp->type).'</td>';
|
||||
// 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 '<td colspan="3"></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 "</table>";
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -2475,7 +2475,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)
|
||||
|
|
@ -4739,7 +4741,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) {
|
|||
min-height: 40px;
|
||||
padding-right: 0px;
|
||||
padding-left: 0px;
|
||||
padding-bottom: 10px;
|
||||
/* padding-bottom: 10px; */
|
||||
}
|
||||
.boxstatsborder {
|
||||
/* border: 1px solid #CCC !important; */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user