mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX vat value when code contains number
This commit is contained in:
parent
afeeb40e2e
commit
408aefd46c
|
|
@ -1562,8 +1562,6 @@ class CommandeFournisseur extends CommonOrder
|
|||
{
|
||||
global $langs, $mysoc, $conf;
|
||||
|
||||
$error = 0;
|
||||
|
||||
dol_syslog(get_class($this)."::addline $desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $fk_prod_fourn_price, $ref_supplier, $remise_percent, $price_base_type, $pu_ttc, $type, $info_bits, $notrigger, $date_start, $date_end, $fk_unit, $pu_ht_devise, $origin, $origin_id");
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
|
|
|
|||
|
|
@ -564,7 +564,9 @@ if (empty($reshook))
|
|||
|
||||
$fk_unit = GETPOST('units', 'alpha');
|
||||
|
||||
$tva_tx = price2num($tva_tx); // When vat is text input field
|
||||
if (!preg_match('/\((.*)\)/', $tva_tx)) {
|
||||
$tva_tx = price2num($tva_tx); // When vat is text input field
|
||||
}
|
||||
|
||||
// Local Taxes
|
||||
$localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty);
|
||||
|
|
|
|||
|
|
@ -160,9 +160,13 @@ if (empty($reshook))
|
|||
if (empty($ref_fourn_old)) $ref_fourn_old = $ref_fourn;
|
||||
$quantity = price2num(GETPOST("qty", 'nohtml'), 'MS');
|
||||
$remise_percent = price2num(GETPOST('remise_percent', 'alpha'));
|
||||
|
||||
$npr = preg_match('/\*/', $_POST['tva_tx']) ? 1 : 0;
|
||||
$tva_tx = str_replace('*', '', GETPOST('tva_tx', 'alpha'));
|
||||
$tva_tx = price2num($tva_tx);
|
||||
if (!preg_match('/\((.*)\)/', $tva_tx)) {
|
||||
$tva_tx = price2num($tva_tx);
|
||||
}
|
||||
|
||||
$price_expression = GETPOST('eid', 'int') ? GETPOST('eid', 'int') : ''; // Discard expression if not in expression mode
|
||||
$delivery_time_days = GETPOST('delivery_time_days', 'int') ? GETPOST('delivery_time_days', 'int') : '';
|
||||
$supplier_reputation = GETPOST('supplier_reputation');
|
||||
|
|
|
|||
|
|
@ -1923,7 +1923,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
|||
// Country
|
||||
print '<tr><td>'.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).'</td><td colspan="3">';
|
||||
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
|
||||
print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 widthcentpercentminusx');
|
||||
print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 maxwidth500 widthcentpercentminusx');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -720,7 +720,9 @@ if (empty($reshook))
|
|||
|
||||
$fk_unit = GETPOST('units', 'alpha');
|
||||
|
||||
$tva_tx = price2num($tva_tx); // When vat is text input field
|
||||
if (!preg_match('/\((.*)\)/', $tva_tx)) {
|
||||
$tva_tx = price2num($tva_tx); // When vat is text input field
|
||||
}
|
||||
|
||||
// Local Taxes
|
||||
$localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty);
|
||||
|
|
|
|||
|
|
@ -530,7 +530,9 @@ if ($action == "freezone") {
|
|||
|
||||
$tva_tx = GETPOST('tva_tx', 'alpha');
|
||||
if ($tva_tx != '') {
|
||||
$tva_tx = price2num($tva_tx);
|
||||
if (!preg_match('/\((.*)\)/', $tva_tx)) {
|
||||
$tva_tx = price2num($tva_tx);
|
||||
}
|
||||
} else {
|
||||
$tva_tx = get_default_tva($mysoc, $customer);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user