Skip to content
Snippets Groups Projects
Commit 4e4ad454 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0

parents 5733826a 77d5de64
Branches
Tags
No related merge requests found
...@@ -950,7 +950,6 @@ if (empty($reshook)) ...@@ -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 VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary.
if (empty($vatrate)) $vatrate = "0.000"; if (empty($vatrate)) $vatrate = "0.000";
$object_ligne->vatrate = price2num($vatrate); $object_ligne->vatrate = price2num($vatrate);
$object_ligne->fk_projet = $fk_projet; $object_ligne->fk_projet = $fk_projet;
...@@ -1080,13 +1079,17 @@ if (empty($reshook)) ...@@ -1080,13 +1079,17 @@ if (empty($reshook))
$value_unit = GETPOST('value_unit'); $value_unit = GETPOST('value_unit');
$vatrate = GETPOST('vatrate'); $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) if (! GETPOST('fk_c_type_fees') > 0)
{ {
$error++; $error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
$action=''; $action='';
} }
if (GETPOST('vatrate') < 0 || GETPOST('vatrate') == '') if ((int) $vatrate < 0 || $vatrate == '')
{ {
$error++; $error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors');
...@@ -2092,7 +2095,7 @@ if ($action != 'create' && $action != 'edit') ...@@ -2092,7 +2095,7 @@ if ($action != 'create' && $action != 'edit')
*/ */
if ($user->rights->expensereport->creer && $object->fk_statut==0) if ($user->rights->expensereport->creer && $object->fk_statut==0)
{ {
if (in_array($object->fk_user_author, $user->getAllChildIds(1))) if (in_array($object->fk_user_author, $user->getAllChildIds(1)) || !empty($user->rights->expensereport->writeall_advance))
{ {
// Modify // Modify
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$object->id.'">'.$langs->trans('Modify').'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$object->id.'">'.$langs->trans('Modify').'</a></div>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment