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) { diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 29bdd16b21e..1d4d1f8f0ca 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -50,6 +50,7 @@ if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="f.datef"; $object = new Societe($db); +if ($socid > 0) $object->fetch($socid); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('thirdpartymargins','globalcard')); @@ -72,8 +73,10 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e $invoicestatic=new Facture($db); $form = new Form($db); +$title=$langs->trans("ThirdParty").' - '.$langs->trans("Margins"); +if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Files"); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$langs->trans("ThirdParty").' - '.$langs->trans("Margins"),$help_url); +llxHeader('',$title,$help_url); if ($socid > 0) { diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index 156a4620634..5c9bc15328f 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -57,8 +57,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, $form = new Form($db); +$title=$langs->trans("ThirdParty").' - '.$langs->trans("Notes"); +if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Files"); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$langs->trans("ThirdParty").' - '.$langs->trans("Notes"),$help_url); +llxHeader('',$title,$help_url); if ($id > 0) {
'.$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 '