Skip to content
Snippets Groups Projects
Commit 77d5de64 authored by Laurent Destailleur's avatar Laurent Destailleur Committed by GitHub
Browse files

Merge pull request #6466 from laudeco/fix/edition_expense_report_without_tva

fix edition of expense report without vat
parents 69eb64a9 8be9679f
Branches
Tags
No related merge requests found
......@@ -950,7 +950,6 @@ if (empty($reshook))
// if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary.
if (empty($vatrate)) $vatrate = "0.000";
$object_ligne->vatrate = price2num($vatrate);
$object_ligne->fk_projet = $fk_projet;
......@@ -1080,13 +1079,17 @@ if (empty($reshook))
$value_unit = GETPOST('value_unit');
$vatrate = GETPOST('vatrate');
// if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary.
if (empty($vatrate)) $vatrate = "0.000";
$vatrate = price2num($vatrate);
if (! GETPOST('fk_c_type_fees') > 0)
{
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
$action='';
}
if (GETPOST('vatrate') < 0 || GETPOST('vatrate') == '')
if ((int) $vatrate < 0 || $vatrate == '')
{
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment