Add more code to help debug

This commit is contained in:
Laurent Destailleur 2024-11-06 13:20:25 +01:00
parent a781211d2f
commit 141755fa17
2 changed files with 19 additions and 1 deletions

View File

@ -234,7 +234,7 @@ if (empty($mysoc->country_code)) {
// Show examples
print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', '');
print '<span class="opacitymedium">'.$langs->trans("Format").':</span> '.price(price2num(1234.56789, 'MT'), 0, $langs, 1, -1, -1, $currencycode)."<br>\n";
print '<span class="opacitymedium">'.$langs->trans("NumberFormatForATotalPrice", '1234.56789').':</span> '.price(price2num(1234.56789, 'MT'), 0, $langs, 1, -1, -1, $currencycode)."<br>\n";
// Always show vat rates with vat 0
$s = 2 / 3;
@ -303,6 +303,23 @@ if (empty($mysoc->country_code)) {
print $tmparray[0].' / '.$tmparray[1].($tmparray[9] ? '+'.$tmparray[9] : '').($tmparray[10] ? '+'.$tmparray[10] : '').' / '.$tmparray[2];
print "<br>\n";
}
if (getDolGlobalString('MAIN_ADD_MORE_EXAMPLE_IN_ACCURANCY_SETUP')) {
$qty = '1.234';
$vattxt = $vat.($vatarray['code'] ? ' ('.$vatarray['code'].')' : '');
$localtax_array = getLocalTaxesFromRate($vattxt, 0, $mysoc, $mysoc);
$s = 10 / 3;
$tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
print ' x <span class="opacitymedium">'.$langs->trans("Quantity").":</span> ".$qty;
print ' - <span class="opacitymedium">'.$langs->trans("VAT").':</span> '.$vat.'%';
print($vatarray['code'] ? ' ('.$vatarray['code'].')' : '');
print ' &nbsp; -> &nbsp; <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ";
print $tmparray[0].' / '.$tmparray[1].($tmparray[9] ? '+'.$tmparray[9] : '').($tmparray[10] ? '+'.$tmparray[10] : '').' / '.$tmparray[2];
print "<br>\n";
}
}
} else {
// More examples if not specific vat rate found

View File

@ -2036,6 +2036,7 @@ Enter0or1=Enter 0 or 1
EnterYesOrNo=Enter Yes or No
UnicodeCurrency=Enter here between braces, list of byte number that represent the currency symbol. For example: for $, enter [36] - for brazil real R$ [82,36] - for €, enter [8364]
ColorFormat=The RGB color is in HEX format, eg: FF0000
NumberFormatForATotalPrice=Number format for the total price %s
PictoHelp=Icon name in format:<br>- image.png for an image file into the current theme directory<br>- image.png@module if file is into the directory /img/ of a module<br>- fa-xxx for a FontAwesome fa-xxx picto<br>- fontawesome_xxx_fa_color_size for a FontAwesome fa-xxx picto (with prefix, color and size set)
PositionIntoComboList=Position of line into combo lists
SellTaxRate=Sales tax rate