diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 25688bf6e6e..df2fe11bfbd 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015-2016 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -831,6 +831,7 @@ if ($action == "addline" && $user->rights->expensereport->creer) $object_ligne = new ExpenseReportLine($db); + $vatrate = GETPOST('vatrate'); $object_ligne->comments = GETPOST('comments'); $qty = GETPOST('qty','int'); if (empty($qty)) $qty=1; @@ -843,10 +844,13 @@ if ($action == "addline" && $user->rights->expensereport->creer) $object_ligne->fk_c_type_fees = GETPOST('fk_c_type_fees'); - $object_ligne->fk_c_tva = GETPOST('fk_c_tva'); + // 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; + if (! GETPOST('fk_c_type_fees') > 0) { @@ -854,10 +858,11 @@ if ($action == "addline" && $user->rights->expensereport->creer) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $action=''; } - if (GETPOST('vatrate') < 0 || GETPOST('vatrate') == '') + + if ($vatrate < 0 || $vatrate == '') { $error++; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("VAT")), null, 'errors'); $action=''; } @@ -1096,7 +1101,7 @@ if ($action == 'create') print ''; print ''; print ''; - print ''; + print ''; print ''; @@ -1211,7 +1216,7 @@ else $linkback = ''.$langs->trans("BackToList").''; // Ref - print ''; @@ -1374,7 +1379,7 @@ else $linkback = ''.$langs->trans("BackToList").''; // Ref - print ''; @@ -1683,7 +1688,8 @@ else } print ''; } - print ''; + // print ''; + print ''; print ''; print ''; print ''; @@ -1789,7 +1795,7 @@ else print ''; if (! empty($conf->projet->enabled)) print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -1807,7 +1813,7 @@ else // Select project if (! empty($conf->projet->enabled)) { - print ''; } @@ -1818,7 +1824,7 @@ else print ''; // Add comments - print ''; diff --git a/htdocs/expensereport/info.php b/htdocs/expensereport/info.php index b4302631c78..a5a3c830975 100644 --- a/htdocs/expensereport/info.php +++ b/htdocs/expensereport/info.php @@ -40,7 +40,7 @@ $result = restrictedArea($user, 'expensereport', $id, ''); * View */ -llxHeader(); +llxHeader('', $langs->trans("ExpenseReport")); if ($id) {
'.$langs->trans("DateStart").''.$langs->trans("DateStart").''; $form->select_date($date_start?$date_start:-1,'date_debut',0,0,0,'',1,1); print '
'.$langs->trans("Ref").''; + print '
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); print '
'.$langs->trans("Ref").''; + print '
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); print '
'.$langs->trans("TF_".strtoupper(empty($objp->type_fees_libelle)?'OTHER':$objp->type_fees_libelle)).''.$langs->trans("TF_".strtoupper(empty($objp->type_fees_libelle)?'OTHER':$objp->type_fees_libelle)).''.($langs->trans(($objp->type_fees_code)) == $objp->type_fees_code ? $objp->type_fees_libelle : $langs->trans(($objp->type_fees_code))).''.$objp->comments.''.vatrate($objp->vatrate,true).''.price($objp->value_unit).''.$langs->trans('Date').''.$langs->trans('Project').''.$langs->trans('Type').''.$langs->trans('Description').''.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUTTC').''.$langs->trans('Qty').''; + print ''; $formproject->select_projects(-1, $fk_projet, 'fk_projet', 0, 0, 1, 1); print ''; + print ''; print ''; print '