Look and feel v14

This commit is contained in:
Laurent Destailleur 2021-04-03 02:11:16 +02:00
parent 858693d631
commit 231f441876
15 changed files with 156 additions and 137 deletions

View File

@ -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') {

View File

@ -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

View File

@ -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');
/*

View File

@ -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
*/

View File

@ -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 '<td>';
$labelpayment = '';
if ($obj->payment_code) {
print $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
$labelpayment = $langs->trans("PaymentTypeShort".$obj->payment_code);
}
print '<td class="tdoverflowmax150" title="'.$labelpayment.'">';
print $labelpayment;
print '</td>';
print '<td>'.$obj->num_payment.'</td>';
@ -311,12 +309,12 @@ while ($i < min($num, $limit)) {
// Account
if (!empty($conf->banque->enabled)) {
// Bank transaction
print '<td>';
print '<td class="nowraponall">';
$accountlinestatic->id = $obj->fk_bank;
print $accountlinestatic->getNomUrl(1);
print '</td>';
print '<td>';
print '<td class="nowraponall">';
if ($obj->bid > 0) {
$accountstatic->id = $obj->bid;
$accountstatic->ref = $obj->bref;
@ -334,12 +332,14 @@ while ($i < min($num, $limit)) {
}
print '</td>';
}
// Expected to pay
print '<td class="right">'.price($obj->total).'</td>';
print '<td class="right"><span class="amount">'.price($obj->total).'</span></td>';
// Paid
print '<td class="right">';
if ($obj->totalpaye) {
print price($obj->totalpaye);
print '<span class="amount">'.price($obj->totalpaye).'</span>';
}
print '</td>';

View File

@ -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 '<tr><td class="fieldrequired" id="label_fk_account">'.$langs->trans("BankAccount").'</td><td>';
print img_picto('', 'bank_account', 'pictofixedwidth');
$form->select_comptes(GETPOST("accountid", 'int'), "accountid", 0, "courant=1", 1); // List of bank account available
print '</td></tr>';
}

View File

@ -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 '<td class="nowrap right">';
print '<td class="nowrap right"><span class="amount">';
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 '</td>';
print '</span></td>';
}
// 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 '<span class="amount">'.price(price2num($fields['payment_amount'], 'MT')).'</span>';
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 '<td class="nowrap right">';
print '<td class="nowrap right"><span class="amount">';
$temp_ht = $fields['totalht'] * $ratiopaymentinvoice;
print price(price2num($temp_ht, 'MT'), 1);
print '</td>';
print '</span></td>';
// VAT
print '<td class="nowrap right">';
print '<td class="nowrap right"><span class="amount">';
$temp_vat = $fields['vat'] * $ratiopaymentinvoice;
print price(price2num($temp_vat, 'MT'), 1);
//print price($fields['vat']);
print '</td>';
print '</span></td>';
print '</tr>';
$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 '<tr class="liste_total">';
print '<td colspan="4"></td>';
@ -686,14 +687,14 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
// Total HT
if ($modetax != 1) {
print '<td class="nowrap right">';
print '<td class="nowrap right"><span class="amount">';
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 '</td>';
print '</span></td>';
}
// 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 '<span class="amount">'.price(price2num($fields['payment_amount'], 'MT')).'</span>';
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 '<td class="nowrap right">';
print '<td class="nowrap right"><span class="amount">';
$temp_ht = $fields['totalht'] * $ratiopaymentinvoice;
print price(price2num($temp_ht, 'MT'), 1);
print '</td>';
print '</span></td>';
// VAT
print '<td class="nowrap right">';
print '<td class="nowrap right"><span class="amount">';
$temp_vat = $fields['vat'] * $ratiopaymentinvoice;
print price(price2num($temp_vat, 'MT'), 1);
//print price($fields['vat']);
print '</td>';
print '</span></td>';
print '</tr>';
$subtot_paye_total_ht += $temp_ht;

View File

@ -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

View File

@ -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 '<tr class="oddeven">';
print '<td class="nowrap">'.$previousmonth."</td>\n";
print '<td class="nowrap right">'.price($amountclaimed)."</td>\n";
print '<td class="nowrap right">'.price($amountpaid)."</td>\n";
print '<td class="nowrap right"><span class="amount">'.price($amountclaimed)."</span></td>\n";
print '<td class="nowrap right"><span class="amount">'.price($amountpaid)."</span></td>\n";
print "</tr>\n";
$amountclaimed = 0;
@ -126,8 +126,8 @@ function pt($db, $sql, $date)
if ($obj->mode == 'paid') {
print '<tr class="oddeven">';
print '<td class="nowrap">'.$obj->dm."</td>\n";
print '<td class="nowrap right">'.price($amountclaimed)."</td>\n";
print '<td class="nowrap right">'.price($amountpaid)."</td>\n";
print '<td class="nowrap right"><span class="amount">'.price($amountclaimed)."</span></td>\n";
print '<td class="nowrap right"><span class="amount">'.price($amountpaid)."</span></td>\n";
print "</tr>\n";
$amountclaimed = 0;
$amountpaid = 0;
@ -438,7 +438,7 @@ if ($refresh === true) {
$x_coll_sum += $temp_vat;
}
}
print '<td class="nowrap right">' . price(price2num($x_coll_sum, 'MT')) . '</td>';
print '<td class="nowrap right"><span class="amount">' . price(price2num($x_coll_sum, 'MT')) . '</span></td>';
$x_paye_sum = 0;
foreach (array_keys($x_paye) as $rate) {
@ -478,7 +478,7 @@ if ($refresh === true) {
$x_paye_sum += $temp_vat;
}
}
print '<td class="nowrap right">' . price(price2num($x_paye_sum, 'MT')) . '</td>';
print '<td class="nowrap right"><span class="amount">' . price(price2num($x_paye_sum, 'MT')) . '</span></td>';
$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 '<td class="nowrap right">' . price(price2num($diff, 'MT')) . '</td>' . "\n";
print '<td class="nowrap right"><span class="amount">' . price(price2num($diff, 'MT')) . '</span></td>' . "\n";
print "<td>&nbsp;</td>\n";
print "</tr>\n";
// Total
$i++;
$m++;
if ($i > 2) {

View File

@ -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');
/*

View File

@ -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 '<td class="nowrap right">' . price($obj->amount) . '</td>';
print '<td class="nowrap right"><span class="amount">' . price($obj->amount) . '</span></td>';
if (!$i) {
$totalarray['nbfield']++;
}

View File

@ -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 '<td class="right"><span class="amount">'.price($obj->total).'</span></td>';
// Paid
print '<td class="right">';
print '<td class="right"><span class="amount">';
if ($obj->totalpaye) {
print price($obj->totalpaye);
}
print '</td>';
print '</span></td>';
print '</tr>';
$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 '<tr class="liste_total"><td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>';
print '<td class="liste_total right"></td>'; // A total here has no sense
print '<td align="center" class="liste_total">&nbsp;</td>';

View File

@ -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');
/*

View File

@ -1042,7 +1042,7 @@ if ($resql) {
}
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="month_lim" value="'.$month_lim.'">';
$formother->select_year($year_lim ? $year_lim : -1, 'year_lim', 1, 20, 5);
print '<br><input type="checkbox" name="option" value="late"'.($option == 'late' ? ' checked' : '').'> '.$langs->trans("Late");
print '<br><input type="checkbox" class="paddingright paddingleft" name="option" id="option" value="late"'.($option == 'late' ? ' checked' : '').'><label for="option">'.$langs->trans("Late").'</label>';
print '</td>';
}
// Project
@ -1541,7 +1541,7 @@ if ($resql) {
// Amount HT
if (!empty($arrayfields['f.total_ht']['checked'])) {
print '<td class="right nowrap">'.price($obj->total_ht)."</td>\n";
print '<td class="right nowrap"><span class="amount">'.price($obj->total_ht)."</span></td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
@ -1552,7 +1552,7 @@ if ($resql) {
}
// Amount VAT
if (!empty($arrayfields['f.total_vat']['checked'])) {
print '<td class="right nowrap">'.price($obj->total_vat)."</td>\n";
print '<td class="right nowrap"><span class="amount">'.price($obj->total_vat)."</span></td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
@ -1563,7 +1563,7 @@ if ($resql) {
}
// Amount LocalTax1
if (!empty($arrayfields['f.total_localtax1']['checked'])) {
print '<td class="right nowrap">'.price($obj->total_localtax1)."</td>\n";
print '<td class="right nowrap"><span class="amount">'.price($obj->total_localtax1)."</span></td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
@ -1574,7 +1574,7 @@ if ($resql) {
}
// Amount LocalTax2
if (!empty($arrayfields['f.total_localtax2']['checked'])) {
print '<td class="right nowrap">'.price($obj->total_localtax2)."</td>\n";
print '<td class="right nowrap"><span class="amount">'.price($obj->total_localtax2)."</span></td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
@ -1585,7 +1585,7 @@ if ($resql) {
}
// Amount TTC
if (!empty($arrayfields['f.total_ttc']['checked'])) {
print '<td class="right nowrap">'.price($obj->total_ttc)."</td>\n";
print '<td class="right nowrap"><span class="amount">'.price($obj->total_ttc)."</span></td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
@ -1612,7 +1612,7 @@ if ($resql) {
}
if (!empty($arrayfields['dynamount_payed']['checked'])) {
print '<td class="right nowrap">'.(!empty($totalpay) ?price($totalpay, 0, $langs) : '&nbsp;').'</td>'; // TODO Use a denormalized field
print '<td class="right nowrap"><span class="amount">'.(!empty($totalpay) ?price($totalpay, 0, $langs) : '').'</span></td>'; // 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 '<td class="right nowrap">'.price($obj->multicurrency_total_ht)."</td>\n";
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht)."</span></td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
}
// Amount VAT
if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) {
print '<td class="right nowrap">'.price($obj->multicurrency_total_vat)."</td>\n";
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_vat)."</span></td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
}
// Amount TTC
if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) {
print '<td class="right nowrap">'.price($obj->multicurrency_total_ttc)."</td>\n";
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc)."</span></td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
}
if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) {
print '<td class="right nowrap">'.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : '&nbsp;').'</td>'; // TODO Use a denormalized field
print '<td class="right nowrap"><span class="amount">'.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : '').'</span></td>'; // TODO Use a denormalized field
if (!$i) {
$totalarray['nbfield']++;
}
@ -1680,9 +1680,9 @@ if ($resql) {
// Pending amount
if (!empty($arrayfields['multicurrency_rtp']['checked'])) {
print '<td class="right nowrap">';
print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : '&nbsp;');
print '</td>'; // TODO Use a denormalized field
print '<td class="right nowrap"><span class="amount">';
print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : '');
print '</span></td>'; // 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 '<td class="center nowrap">';

View File

@ -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 '<td class="right">'.price($objp->pamount).'</td>';
print '<td class="right"><span class="amount">'.price($objp->pamount).'</span></td>';
if (!$i) {
$totalarray['nbfield']++;
}