From 231f4418766e017463f8571cff716962328fecf7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Apr 2021 02:11:16 +0200 Subject: [PATCH] Look and feel v14 --- htdocs/compta/sociales/card.php | 17 ++++++----- htdocs/compta/sociales/document.php | 13 ++++----- htdocs/compta/sociales/info.php | 9 ++++-- htdocs/compta/sociales/list.php | 16 +++++------ htdocs/compta/sociales/payments.php | 34 +++++++++++----------- htdocs/compta/tva/card.php | 20 ++++++++----- htdocs/compta/tva/clients.php | 31 ++++++++++---------- htdocs/compta/tva/document.php | 15 +++++----- htdocs/compta/tva/index.php | 17 +++++------ htdocs/compta/tva/info.php | 7 ++--- htdocs/compta/tva/list.php | 16 +++++------ htdocs/compta/tva/payments.php | 21 ++++++++------ htdocs/compta/tva/quadri_detail.php | 4 ++- htdocs/fourn/facture/list.php | 29 ++++++++++--------- htdocs/fourn/paiement/list.php | 44 ++++++++++++++--------------- 15 files changed, 156 insertions(+), 137 deletions(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index e4ac225a624..b2ac294021c 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -56,20 +56,23 @@ $label = GETPOST('label', 'alpha'); $actioncode = GETPOST('actioncode'); $fk_user = GETPOST('userid', 'int'); +$object = new ChargeSociales($db); +if ($id > 0) { + $object->fetch($id); +} + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', $id, 'chargesociales', 'charges'); +$result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges'); -$object = new ChargeSociales($db); -/* *************************************************************************** */ -/* */ -/* Actions */ -/* */ -/* *************************************************************************** */ + +/* + * Actions + */ // Classify paid if ($action == 'confirm_paid' && $user->rights->tax->charges->creer && $confirm == 'yes') { diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 542804b866c..129f7b7d685 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -45,13 +45,6 @@ $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'tax', $id, 'chargesociales', 'charges'); - - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -79,6 +72,12 @@ if ($id > 0) { $upload_dir = $conf->tax->dir_output.'/'.dol_sanitizeFileName($object->ref); $modulepart = 'tax'; +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges'); + /* * Actions diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index 1ab9b9b0ada..eefd667b964 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -36,14 +36,17 @@ $langs->loadLangs(array('compta', 'bills')); $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); +$object = new ChargeSociales($db); +if ($id > 0) { + $object->fetch($id); +} + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', $id, 'chargesociales', 'charges'); - -$object = new ChargeSociales($db); +$result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges'); /* diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 0ecdaee87a5..ffebc7dcc73 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -28,14 +28,6 @@ */ require '../../main.inc.php'; - -// Security check -$socid = isset($_GET["socid"]) ? $_GET["socid"] : ''; -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'tax', '', '', 'charges'); - require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; @@ -125,6 +117,14 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $hookmanager->initHooks(array('sclist')); $object = new ChargeSociales($db); +// Security check +$socid = GETPOST("socid", 'int'); +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'tax', '', 'chargesociales', 'charges'); + + /* * Actions */ diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index e8e4102b5cc..b2ee4ffce5e 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -38,7 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; - $hookmanager = new HookManager($db); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array @@ -47,12 +46,6 @@ $hookmanager->initHooks(array('specialexpensesindex')); // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'hrm')); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'tax|salaries', '', '', 'charges|'); - $year = GETPOST("year", 'int'); $search_sc_type = GETPOST('search_sc_type', 'int'); @@ -60,7 +53,7 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1) { +if (empty($page) || $page < 0) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; @@ -73,9 +66,11 @@ if (!$sortorder) { $sortorder = "DESC"; } -if (empty($conf->tax->enabled) || empty($user->rights->tax->charges->lire)) { - accessforbidden(); +// Security check +if ($user->socid) { + $socid = $user->socid; } +$result = restrictedArea($user, 'tax', '', 'chargesociales', 'charges'); /* @@ -104,8 +99,9 @@ $accountlinestatic = new AccountLine($db); $formsocialcontrib = new FormSocialContrib($db); $title = $langs->trans("SocialContributionsPayments"); +$help_url = ''; -llxHeader('', $title); +llxHeader('', $title, $help_url); $param = ''; @@ -300,10 +296,12 @@ while ($i < min($num, $limit)) { } // Type payment - print ''; + $labelpayment = ''; if ($obj->payment_code) { - print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; + $labelpayment = $langs->trans("PaymentTypeShort".$obj->payment_code); } + print ''; + print $labelpayment; print ''; print ''.$obj->num_payment.''; @@ -311,12 +309,12 @@ while ($i < min($num, $limit)) { // Account if (!empty($conf->banque->enabled)) { // Bank transaction - print ''; + print ''; $accountlinestatic->id = $obj->fk_bank; print $accountlinestatic->getNomUrl(1); print ''; - print ''; + print ''; if ($obj->bid > 0) { $accountstatic->id = $obj->bid; $accountstatic->ref = $obj->bref; @@ -334,12 +332,14 @@ while ($i < min($num, $limit)) { } print ''; } + // Expected to pay - print ''.price($obj->total).''; + print ''.price($obj->total).''; + // Paid print ''; if ($obj->totalpaye) { - print price($obj->totalpaye); + print ''.price($obj->totalpaye).''; } print ''; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index bbf4bc9ac2b..da07472719b 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -57,18 +57,21 @@ if (empty($refund)) { $datev = dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int')); $datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int')); +$object = new Tva($db); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('taxvatcard', 'globalcard')); + +if ($id > 0) { + $object->fetch($id); +} // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', '', '', 'charges'); - -$object = new Tva($db); - -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('taxvatcard', 'globalcard')); +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); /** @@ -330,6 +333,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char } } + /* * View */ @@ -338,7 +342,8 @@ $form = new Form($db); $title = $langs->trans("VAT")." - ".$langs->trans("Card"); $help_url = ''; -llxHeader("", $title, $helpurl); + +llxHeader("", $title, $help_url); if ($id) { @@ -438,6 +443,7 @@ if ($action == 'create') { if (!empty($conf->banque->enabled)) { print ''.$langs->trans("BankAccount").''; + print img_picto('', 'bank_account', 'pictofixedwidth'); $form->select_comptes(GETPOST("accountid", 'int'), "accountid", 0, "courant=1", 1); // List of bank account available print ''; } diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 7860f7e3c02..f7b860cd792 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -65,7 +65,7 @@ $socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', '', '', 'charges'); +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); @@ -496,14 +496,14 @@ if (!is_array($x_coll) || !is_array($x_paye)) { // Total HT if ($modetax != 1) { - print ''; + print ''; print price($fields['totalht']); if (price2num($fields['ftotal_ttc'])) { //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; $ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']); //print ' ('.round($ratiolineinvoice*100,2).'%)'; } - print ''; + print ''; } // Payment @@ -523,7 +523,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) { $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); } - print price(price2num($fields['payment_amount'], 'MT')); + print ''.price(price2num($fields['payment_amount'], 'MT')).''; if (isset($fields['payment_amount'])) { print ' ('.round($ratiopaymentinvoice * 100, 2).'%)'; } @@ -532,17 +532,17 @@ if (!is_array($x_coll) || !is_array($x_paye)) { } // Total collected - print ''; + print ''; $temp_ht = $fields['totalht'] * $ratiopaymentinvoice; print price(price2num($temp_ht, 'MT'), 1); - print ''; + print ''; // VAT - print ''; + print ''; $temp_vat = $fields['vat'] * $ratiopaymentinvoice; print price(price2num($temp_vat, 'MT'), 1); //print price($fields['vat']); - print ''; + print ''; print ''; $subtot_coll_total_ht += $temp_ht; @@ -550,6 +550,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { $x_coll_sum += $temp_vat; } } + // Total customers for this vat rate print ''; print ''; @@ -686,14 +687,14 @@ if (!is_array($x_coll) || !is_array($x_paye)) { // Total HT if ($modetax != 1) { - print ''; + print ''; print price($fields['totalht']); if (price2num($fields['ftotal_ttc'])) { //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; $ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']); //print ' ('.round($ratiolineinvoice*100,2).'%)'; } - print ''; + print ''; } // Payment @@ -713,7 +714,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) { $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); } - print price(price2num($fields['payment_amount'], 'MT')); + print ''.price(price2num($fields['payment_amount'], 'MT')).''; if (isset($fields['payment_amount'])) { print ' ('.round($ratiopaymentinvoice * 100, 2).'%)'; } @@ -722,17 +723,17 @@ if (!is_array($x_coll) || !is_array($x_paye)) { } // VAT paid - print ''; + print ''; $temp_ht = $fields['totalht'] * $ratiopaymentinvoice; print price(price2num($temp_ht, 'MT'), 1); - print ''; + print ''; // VAT - print ''; + print ''; $temp_vat = $fields['vat'] * $ratiopaymentinvoice; print price(price2num($temp_vat, 'MT'), 1); //print price($fields['vat']); - print ''; + print ''; print ''; $subtot_paye_total_ht += $temp_ht; diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index 38d88fb3d12..ea06d0dca06 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -46,13 +46,6 @@ $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'tax', '', 'vat', 'charges'); - - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -71,8 +64,8 @@ if (!$sortfield) { $sortfield = "name"; } - $object = new Tva($db); + if ($id > 0) { $object->fetch($id); } @@ -80,6 +73,12 @@ if ($id > 0) { $upload_dir = $conf->tax->dir_output.'/vat/'.dol_sanitizeFileName($object->ref); $modulepart = 'tax-vat'; +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); + /* * Actions diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 63b834d7821..e1ac3f96a2d 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -62,7 +62,7 @@ $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', '', '', 'charges'); +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); /** @@ -106,8 +106,8 @@ function pt($db, $sql, $date) if ($obj->mode == 'claimed' && !empty($previousmode)) { print ''; print ''.$previousmonth."\n"; - print ''.price($amountclaimed)."\n"; - print ''.price($amountpaid)."\n"; + print ''.price($amountclaimed)."\n"; + print ''.price($amountpaid)."\n"; print "\n"; $amountclaimed = 0; @@ -126,8 +126,8 @@ function pt($db, $sql, $date) if ($obj->mode == 'paid') { print ''; print ''.$obj->dm."\n"; - print ''.price($amountclaimed)."\n"; - print ''.price($amountpaid)."\n"; + print ''.price($amountclaimed)."\n"; + print ''.price($amountpaid)."\n"; print "\n"; $amountclaimed = 0; $amountpaid = 0; @@ -438,7 +438,7 @@ if ($refresh === true) { $x_coll_sum += $temp_vat; } } - print '' . price(price2num($x_coll_sum, 'MT')) . ''; + print '' . price(price2num($x_coll_sum, 'MT')) . ''; $x_paye_sum = 0; foreach (array_keys($x_paye) as $rate) { @@ -478,7 +478,7 @@ if ($refresh === true) { $x_paye_sum += $temp_vat; } } - print '' . price(price2num($x_paye_sum, 'MT')) . ''; + print '' . price(price2num($x_paye_sum, 'MT')) . ''; $subtotalcoll = $subtotalcoll + $x_coll_sum; $subtotalpaye = $subtotalpaye + $x_paye_sum; @@ -487,10 +487,11 @@ if ($refresh === true) { $total = $total + $diff; $subtotal = price2num($subtotal + $diff, 'MT'); - print '' . price(price2num($diff, 'MT')) . '' . "\n"; + print '' . price(price2num($diff, 'MT')) . '' . "\n"; print " \n"; print "\n"; + // Total $i++; $m++; if ($i > 2) { diff --git a/htdocs/compta/tva/info.php b/htdocs/compta/tva/info.php index fb3d0c62d86..96eed7ce20b 100644 --- a/htdocs/compta/tva/info.php +++ b/htdocs/compta/tva/info.php @@ -32,15 +32,14 @@ $langs->loadLangs(array('compta', 'bills')); $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); +$object = new Tva($db); + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', '', '', 'charges'); - -$object = new Tva($db); - +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); /* diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index ac9e7b55ecd..17237732cea 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -28,13 +28,6 @@ require '../../main.inc.php'; -// Security check -$socid = GETPOST('socid', 'int'); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'tax', '', '', 'charges'); - require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -99,6 +92,13 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $hookmanager->initHooks(array('salestaxeslist')); $object = new Tva($db); +// Security check +$socid = GETPOST('socid', 'int'); +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); + /* * Actions @@ -509,7 +509,7 @@ while ($i < min($num, $limit)) { // Amount if (!empty($arrayfields['t.amount']['checked'])) { $total = $total + $obj->amount; - print '' . price($obj->amount) . ''; + print '' . price($obj->amount) . ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index 134f840d196..57e70e70a3d 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -38,12 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills')); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'tax|salaries', '', '', 'charges|'); - $mode = GETPOST("mode", 'alpha'); $year = GETPOST("year", 'int'); $filtre = GETPOST("filtre", 'alpha'); @@ -68,6 +62,15 @@ if (!$sortorder) { $sortorder = "DESC"; } +$object = new Tva($db); + +// Security check +if ($user->socid) { + $socid = $user->socid; +} +//$result = restrictedArea($user, 'tax|salaries', '', '', 'charges|'); +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); + /* * View @@ -233,11 +236,11 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { // Expected to pay print ''.price($obj->total).''; // Paid - print ''; + print ''; if ($obj->totalpaye) { print price($obj->totalpaye); } - print ''; + print ''; print ''; $total = $total + $obj->total; @@ -245,6 +248,8 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { $totalpaye = $totalpaye + $obj->totalpaye; $i++; } + + // Total print ''.$langs->trans("Total").''; print ''; // A total here has no sense print ' '; diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index acf0bec8899..4b44959bc1a 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -66,12 +66,14 @@ if (empty($modetax)) { $modetax = 0; } +$object = new Tva($db); + // Security check $socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', '', '', 'charges'); +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); /* diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 3efc19f86cc..b5b6fc1c783 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1042,7 +1042,7 @@ if ($resql) { } print ''; $formother->select_year($year_lim ? $year_lim : -1, 'year_lim', 1, 20, 5); - print '
'.$langs->trans("Late"); + print '
'; print ''; } // Project @@ -1541,7 +1541,7 @@ if ($resql) { // Amount HT if (!empty($arrayfields['f.total_ht']['checked'])) { - print ''.price($obj->total_ht)."\n"; + print ''.price($obj->total_ht)."\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1552,7 +1552,7 @@ if ($resql) { } // Amount VAT if (!empty($arrayfields['f.total_vat']['checked'])) { - print ''.price($obj->total_vat)."\n"; + print ''.price($obj->total_vat)."\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1563,7 +1563,7 @@ if ($resql) { } // Amount LocalTax1 if (!empty($arrayfields['f.total_localtax1']['checked'])) { - print ''.price($obj->total_localtax1)."\n"; + print ''.price($obj->total_localtax1)."\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1574,7 +1574,7 @@ if ($resql) { } // Amount LocalTax2 if (!empty($arrayfields['f.total_localtax2']['checked'])) { - print ''.price($obj->total_localtax2)."\n"; + print ''.price($obj->total_localtax2)."\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1585,7 +1585,7 @@ if ($resql) { } // Amount TTC if (!empty($arrayfields['f.total_ttc']['checked'])) { - print ''.price($obj->total_ttc)."\n"; + print ''.price($obj->total_ttc)."\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1612,7 +1612,7 @@ if ($resql) { } if (!empty($arrayfields['dynamount_payed']['checked'])) { - print ''.(!empty($totalpay) ?price($totalpay, 0, $langs) : ' ').''; // TODO Use a denormalized field + print ''.(!empty($totalpay) ?price($totalpay, 0, $langs) : '').''; // TODO Use a denormalized field if (!$i) { $totalarray['nbfield']++; } @@ -1652,27 +1652,27 @@ if ($resql) { } // Amount HT if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { - print ''.price($obj->multicurrency_total_ht)."\n"; + print ''.price($obj->multicurrency_total_ht)."\n"; if (!$i) { $totalarray['nbfield']++; } } // Amount VAT if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { - print ''.price($obj->multicurrency_total_vat)."\n"; + print ''.price($obj->multicurrency_total_vat)."\n"; if (!$i) { $totalarray['nbfield']++; } } // Amount TTC if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { - print ''.price($obj->multicurrency_total_ttc)."\n"; + print ''.price($obj->multicurrency_total_ttc)."\n"; if (!$i) { $totalarray['nbfield']++; } } if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { - print ''.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : ' ').''; // TODO Use a denormalized field + print ''.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : '').''; // TODO Use a denormalized field if (!$i) { $totalarray['nbfield']++; } @@ -1680,9 +1680,9 @@ if ($resql) { // Pending amount if (!empty($arrayfields['multicurrency_rtp']['checked'])) { - print ''; - print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : ' '); - print ''; // TODO Use a denormalized field + print ''; + print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : ''); + print ''; // TODO Use a denormalized field if (!$i) { $totalarray['nbfield']++; } @@ -1695,6 +1695,7 @@ if ($resql) { $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; + // Date creation if (!empty($arrayfields['f.datec']['checked'])) { print ''; diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index a876f5753b9..000b5def498 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -34,28 +34,9 @@ */ require '../../main.inc.php'; - -// Security check -if ($user->socid) { - $socid = $user->socid; -} - -// doesn't work :-( -// restrictedArea($user, 'fournisseur'); - -// doesn't work :-( -// require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; -// $object = new PaiementFourn($db); -// restrictedArea($user, $object->element); - -if (!$user->rights->fournisseur->facture->lire) { - accessforbidden(); -} - require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; - // Load translation files required by the page $langs->loadLangs(array('companies', 'bills', 'banks', 'compta')); @@ -120,9 +101,28 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $hookmanager->initHooks(array('paymentsupplierlist')); $object = new PaiementFourn($db); +// Security check +if ($user->socid) { + $socid = $user->socid; +} + +// doesn't work :-( +// restrictedArea($user, 'fournisseur'); +// doesn't work :-( +// require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +// $object = new PaiementFourn($db); +// restrictedArea($user, $object->element); +if (empty($conf->fournisseur->enabled)) { + accessforbidden(); +} +if (!$user->rights->fournisseur->facture->lire) { + accessforbidden(); +} + + /* -* Actions -*/ + * Actions + */ $parameters = array('socid'=>$socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -520,7 +520,7 @@ while ($i < min($num, $limit)) { // Amount if (!empty($arrayfields['p.amount']['checked'])) { - print ''.price($objp->pamount).''; + print ''.price($objp->pamount).''; if (!$i) { $totalarray['nbfield']++; }