32 require
'../../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsocialcontrib.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
39 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
43 $langs->loadLangs(array(
'compta',
'banks',
'bills',
'hrm',
'projects'));
45 $action =
GETPOST(
'action',
'aZ09');
46 $massaction =
GETPOST(
'massaction',
'alpha');
47 $confirm =
GETPOST(
'confirm',
'alpha');
48 $optioncss =
GETPOST(
'optioncss',
'alpha');
49 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'sclist';
51 $search_ref =
GETPOST(
'search_ref',
'int');
52 $search_label =
GETPOST(
'search_label',
'alpha');
53 $search_typeid =
GETPOST(
'search_typeid',
'int');
54 $search_amount =
GETPOST(
'search_amount',
'alpha');
55 $search_status =
GETPOST(
'search_status',
'int');
56 $search_date_startday =
GETPOST(
'search_date_startday',
'int');
57 $search_date_startmonth =
GETPOST(
'search_date_startmonth',
'int');
58 $search_date_startyear =
GETPOST(
'search_date_startyear',
'int');
59 $search_date_endday =
GETPOST(
'search_date_endday',
'int');
60 $search_date_endmonth =
GETPOST(
'search_date_endmonth',
'int');
61 $search_date_endyear =
GETPOST(
'search_date_endyear',
'int');
62 $search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
63 $search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
64 $search_date_limit_startday =
GETPOST(
'search_date_limit_startday',
'int');
65 $search_date_limit_startmonth =
GETPOST(
'search_date_limit_startmonth',
'int');
66 $search_date_limit_startyear =
GETPOST(
'search_date_limit_startyear',
'int');
67 $search_date_limit_endday =
GETPOST(
'search_date_limit_endday',
'int');
68 $search_date_limit_endmonth =
GETPOST(
'search_date_limit_endmonth',
'int');
69 $search_date_limit_endyear =
GETPOST(
'search_date_limit_endyear',
'int');
70 $search_date_limit_start =
dol_mktime(0, 0, 0, $search_date_limit_startmonth, $search_date_limit_startday, $search_date_limit_startyear);
71 $search_date_limit_end =
dol_mktime(23, 59, 59, $search_date_limit_endmonth, $search_date_limit_endday, $search_date_limit_endyear);
72 $search_project_ref =
GETPOST(
'search_project_ref',
'alpha');
73 $search_users =
GETPOST(
'search_users');
74 $search_type =
GETPOST(
'search_type',
'int');
75 $search_account =
GETPOST(
'search_account',
'int');
77 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
78 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
79 $sortorder =
GETPOST(
"sortorder",
'aZ09comma');
82 if (empty($page) || $page == -1) {
85 $offset = $limit * $page;
86 $pageprev = $page - 1;
87 $pagenext = $page + 1;
90 $sortfield =
"cs.date_ech";
96 $filtre =
GETPOST(
"filtre",
'int');
99 'cs.rowid' =>array(
'label'=>
"Ref",
'checked'=>1,
'position'=>10),
100 'cs.libelle' =>array(
'label'=>
"Label",
'checked'=>1,
'position'=>20),
101 'cs.fk_type' =>array(
'label'=>
"Type",
'checked'=>1,
'position'=>30),
102 'cs.date_ech' =>array(
'label'=>
"Date",
'checked'=>1,
'position'=>40),
103 'cs.periode' =>array(
'label'=>
"PeriodEndDate",
'checked'=>1,
'position'=>50),
104 'p.ref' =>array(
'label'=>
"ProjectRef",
'checked'=>1,
'position'=>60,
'enable'=>(
isModEnabled(
'project'))),
105 'cs.fk_user' =>array(
'label'=>
"Employee",
'checked'=>1,
'position'=>70),
106 'cs.fk_mode_reglement' =>array(
'checked'=>-1,
'position'=>80,
'label'=>
"DefaultPaymentMode"),
107 'cs.amount' =>array(
'label'=>
"Amount",
'checked'=>1,
'position'=>100),
108 'cs.paye' =>array(
'label'=>
"Status",
'checked'=>1,
'position'=>110),
112 $arrayfields[
'cs.fk_account'] = array(
'checked'=>-1,
'position'=>90,
'label'=>
"DefaultBankAccount");
118 $hookmanager->initHooks(array(
'sclist'));
122 $socid =
GETPOST(
"socid",
'int');
124 $socid = $user->socid;
126 $result =
restrictedArea($user,
'tax',
'',
'chargesociales',
'charges');
133 $parameters = array(
'socid'=>$socid);
134 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
140 if (empty($reshook)) {
141 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
144 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
150 $search_date_startday =
'';
151 $search_date_startmonth =
'';
152 $search_date_startyear =
'';
153 $search_date_endday =
'';
154 $search_date_endmonth =
'';
155 $search_date_endyear =
'';
156 $search_date_start =
'';
157 $search_date_end =
'';
158 $search_date_limit_startday =
'';
159 $search_date_limit_startmonth =
'';
160 $search_date_limit_startyear =
'';
161 $search_date_limit_endday =
'';
162 $search_date_limit_endmonth =
'';
163 $search_date_limit_endyear =
'';
164 $search_date_limit_start =
'';
165 $search_date_limit_end =
'';
166 $search_project_ref =
'';
169 $search_account =
'';
170 $search_array_options = array();
180 $bankstatic =
new Account($db);
184 $projectstatic =
new Project($db);
187 llxHeader(
'', $langs->trans(
"SocialContributions"));
189 $sql =
"SELECT cs.rowid, cs.fk_type as type, cs.fk_user,";
190 $sql .=
" cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,";
192 $sql .=
" p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
194 $sql .=
" c.libelle as type_label, c.accountancy_code as type_accountancy_code,";
195 $sql .=
" ba.label as blabel, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,";
196 $sql .=
" SUM(pc.amount) as alreadypayed, pay.code as payment_code";
200 $sql .=
" FROM ".MAIN_DB_PREFIX.
"c_chargesociales as c,";
201 $sql .=
" ".MAIN_DB_PREFIX.
"chargesociales as cs";
202 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON (cs.fk_account = ba.rowid)";
203 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_paiement as pay ON (cs.fk_mode_reglement = pay.id)';
205 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = cs.fk_projet";
207 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementcharge as pc ON pc.fk_charge = cs.rowid";
208 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as u ON (cs.fk_user = u.rowid)";
209 $sql .=
" WHERE cs.fk_type = c.id";
210 $sql .=
" AND cs.entity = ".((int) $conf->entity);
213 $sql .=
" AND cs.ref = '".$db->escape($search_ref).
"'";
219 if ($search_project_ref !=
'') {
223 if (!empty($search_users)) {
224 $sql .=
' AND cs.fk_user IN ('.$db->sanitize(implode(
', ', $search_users)).
')';
226 if (!empty($search_type) && $search_type > 0) {
227 $sql .=
' AND cs.fk_mode_reglement='.((int) $search_type);
229 if (!empty($search_account) && $search_account > 0) {
230 $sql .=
' AND cs.fk_account='.((int) $search_account);
232 if ($search_amount) {
235 if ($search_status !=
'' && $search_status >= 0) {
236 $sql .=
" AND cs.paye = ".((int) $search_status);
238 if ($search_date_start) {
239 $sql .=
" AND cs.date_ech >= '".$db->idate($search_date_start).
"'";
241 if ($search_date_end) {
242 $sql .=
" AND cs.date_ech <= '".$db->idate($search_date_end).
"'";
244 if ($search_date_limit_start) {
245 $sql .=
" AND cs.periode >= '".$db->idate($search_date_limit_start).
"'";
247 if ($search_date_limit_end) {
248 $sql .=
" AND cs.periode <= '".$db->idate($search_date_limit_end).
"'";
250 if ($search_typeid > 0) {
251 $sql .=
" AND cs.fk_type = ".((int) $search_typeid);
253 $sql .=
" GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, cs.fk_account, c.libelle, c.accountancy_code, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code, u.lastname";
255 $sql .=
", p.rowid, p.ref, p.title";
260 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
262 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
263 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
264 $resql = $db->query($sqlforcount);
266 $objforcount = $db->fetch_object(
$resql);
280 $sql .= $db->order($sortfield, $sortorder);
282 $sql .= $db->plimit($limit + 1, $offset);
285 $resql = $db->query($sql);
293 $num = $db->num_rows(
$resql);
297 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
298 $param .=
'&contextpage='.urlencode($contextpage);
300 if ($limit > 0 && $limit != $conf->liste_limit) {
301 $param .=
'&limit='.urlencode($limit);
304 $param .=
'&search_ref='.urlencode($search_ref);
307 $param .=
'&search_label='.urlencode($search_label);
309 if ($search_project_ref >= 0) {
310 $param .=
"&search_project_ref=".urlencode($search_project_ref);
312 if ($search_amount) {
313 $param .=
'&search_amount='.urlencode($search_amount);
315 if ($search_typeid) {
316 $param .=
'&search_typeid='.urlencode($search_typeid);
319 foreach ($search_users as $id_user) {
320 $param .=
'&search_users[]='.urlencode($id_user);
324 $param .=
'&search_type='.urlencode($search_type);
326 if ($search_account) {
327 $param .=
'&search_account='.$search_account;
329 if ($search_status !=
'' && $search_status !=
'-1') {
330 $param .=
'&search_status='.urlencode($search_status);
332 if ($search_date_startday) {
333 $param .=
'&search_date_startday='.urlencode($search_date_startday);
335 if ($search_date_startmonth) {
336 $param .=
'&search_date_startmonth='.urlencode($search_date_startmonth);
338 if ($search_date_startyear) {
339 $param .=
'&search_date_startyear='.urlencode($search_date_startyear);
341 if ($search_date_endday) {
342 $param .=
'&search_date_endday='.urlencode($search_date_endday);
344 if ($search_date_endmonth) {
345 $param .=
'&search_date_endmonth='.urlencode($search_date_endmonth);
347 if ($search_date_endyear) {
348 $param .=
'&search_date_endyear='.urlencode($search_date_endyear);
350 if ($search_date_limit_startday) {
351 $param .=
'&search_date_limit_startday='.urlencode($search_date_limit_startday);
353 if ($search_date_limit_startmonth) {
354 $param .=
'&search_date_limit_startmonth='.urlencode($search_date_limit_startmonth);
356 if ($search_date_limit_startyear) {
357 $param .=
'&search_date_limit_startyear='.urlencode($search_date_limit_startyear);
359 if ($search_date_limit_endday) {
360 $param .=
'&search_date_limit_endday='.urlencode($search_date_limit_endday);
362 if ($search_date_limit_endmonth) {
363 $param .=
'&search_date_limit_endmonth='.urlencode($search_date_limit_endmonth);
365 if ($search_date_limit_endyear) {
366 $param .=
'&search_date_limit_endyear='.urlencode($search_date_limit_endyear);
370 if ($user->rights->tax->charges->creer) {
371 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'MenuNewSocialContribution'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/compta/sociales/card.php?action=create');
374 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
375 if ($optioncss !=
'') {
376 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
378 print
'<input type="hidden" name="token" value="'.newToken().
'">';
379 print
'<input type="hidden" name="action" value="list">';
380 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
381 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
382 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
383 print
'<input type="hidden" name="search_status" value="'.$search_status.
'">';
384 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
388 print_barre_liste($langs->trans(
"SocialContributions"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $center, $num,
$nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit, 0, 0, 1);
390 if (empty($mysoc->country_id) && empty($mysoc->country_code)) {
391 print
'<div class="error">';
392 $langs->load(
"errors");
393 $countrynotdefined = $langs->trans(
"ErrorSetACountryFirst");
394 print $countrynotdefined;
403 $massactionbutton =
'';
405 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
406 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
407 if ($massactionbutton) {
408 $selectedfields .=
$form->showCheckAddButtons(
'checkforselect', 1);
411 print
'<div class="div-table-responsive">';
412 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
'').
'">'.
"\n";
414 print
'<tr class="liste_titre_filter">';
417 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
418 print
'<td class="liste_titre">';
423 if (!empty($arrayfields[
'cs.rowid'][
'checked'])) {
424 print
'<td class="liste_titre">';
425 print
'<input class="flat maxwidth75" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
430 if (!empty($arrayfields[
'cs.rowid'][
'checked'])) {
431 print
'<td class="liste_titre">';
432 print
'<input type="text" class="flat maxwidth100" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
437 if (!empty($arrayfields[
'cs.fk_type'][
'checked'])) {
438 print
'<td class="liste_titre">';
439 $formsocialcontrib->select_type_socialcontrib($search_typeid,
'search_typeid', 1, 0, 0,
'maxwidth150', 1);
444 if (!empty($arrayfields[
'cs.date_ech'][
'checked'])) {
445 print
'<td class="liste_titre center">';
446 print
'<div class="nowrap">';
447 print
$form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
449 print
'<div class="nowrap">';
450 print
$form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
456 if (!empty($arrayfields[
'cs.periode'][
'checked'])) {
457 print
'<td class="liste_titre center">';
458 print
'<div class="nowrap">';
459 print
$form->selectDate($search_date_limit_start ? $search_date_limit_start : -1,
'search_date_limit_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
461 print
'<div class="nowrap">';
462 print
$form->selectDate($search_date_limit_end ? $search_date_limit_end : -1,
'search_date_limit_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
468 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
469 print
'<td class="liste_titre">';
470 print
'<input type="text" class="flat" size="6" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).
'">';
474 if (!empty($arrayfields[
'cs.fk_user'][
'checked'])) {
476 print
'<td class="liste_titre">';
477 print
$form->select_dolusers($search_users,
'search_users', 1,
null, 0,
'',
'',
'0', 0, 0,
'', 0,
'',
'maxwidth150', 0, 0,
true);
482 if (!empty($arrayfields[
'cs.fk_mode_reglement'][
'checked'])) {
483 print
'<td class="liste_titre">';
484 print
$form->select_types_paiements($search_type,
'search_type',
'', 0, 1, 1, 0, 1,
'maxwidth150', 1);
489 if (!empty($arrayfields[
'cs.fk_account'][
'checked'])) {
490 print
'<td class="liste_titre">';
491 $form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth150');
496 if (!empty($arrayfields[
'cs.amount'][
'checked'])) {
497 print
'<td class="liste_titre right">';
498 print
'<input class="flat maxwidth75" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'">';
503 if (!empty($arrayfields[
'cs.paye'][
'checked'])) {
504 print
'<td class="liste_titre maxwidthonsmartphone right">';
505 $liststatus = array(
'0'=>$langs->trans(
"Unpaid"),
'1'=>$langs->trans(
"Paid"));
506 print
$form->selectarray(
'search_status', $liststatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100 onrightofpage', 1);
511 $parameters = array(
'arrayfields'=>$arrayfields);
512 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
513 print $hookmanager->resPrint;
516 print
'<td class="liste_titre maxwidthsearch">';
517 print
$form->showFilterAndCheckAddButtons(0);
522 print
'<tr class="liste_titre">';
523 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
526 if (!empty($arrayfields[
'cs.rowid'][
'checked'])) {
527 print_liste_field_titre($arrayfields[
'cs.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.rowid",
'', $param,
'', $sortfield, $sortorder);
529 if (!empty($arrayfields[
'cs.libelle'][
'checked'])) {
530 print_liste_field_titre($arrayfields[
'cs.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.libelle,cs.periode",
'', $param,
'', $sortfield, $sortorder);
532 if (!empty($arrayfields[
'cs.fk_type'][
'checked'])) {
533 print_liste_field_titre($arrayfields[
'cs.fk_type'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.fk_type,cs.periode",
'', $param,
'', $sortfield, $sortorder);
535 if (!empty($arrayfields[
'cs.date_ech'][
'checked'])) {
536 print_liste_field_titre($arrayfields[
'cs.date_ech'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.date_ech,cs.periode",
'', $param,
'', $sortfield, $sortorder,
'center ');
538 if (!empty($arrayfields[
'cs.periode'][
'checked'])) {
539 print_liste_field_titre($arrayfields[
'cs.periode'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.periode",
'', $param,
'', $sortfield, $sortorder,
'center ');
541 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
542 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
'', $param,
'', $sortfield, $sortorder);
544 if (!empty($arrayfields[
'cs.fk_user'][
'checked'])) {
545 print_liste_field_titre(
"Employee", $_SERVER[
"PHP_SELF"],
"u.lastname,cs.periode",
"", $param,
'class="left"', $sortfield, $sortorder);
547 if (!empty($arrayfields[
'cs.fk_mode_reglement'][
'checked'])) {
548 print_liste_field_titre($arrayfields[
'cs.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.fk_mode_reglement,cs.periode",
'', $param,
'', $sortfield, $sortorder);
550 if (!empty($arrayfields[
'cs.fk_account'][
'checked'])) {
551 print_liste_field_titre($arrayfields[
'cs.fk_account'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.fk_account,cs.periode",
'', $param,
'', $sortfield, $sortorder);
553 if (!empty($arrayfields[
'cs.amount'][
'checked'])) {
554 print_liste_field_titre($arrayfields[
'cs.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.amount,cs.periode",
'', $param,
'class="right"', $sortfield, $sortorder);
556 if (!empty($arrayfields[
'cs.paye'][
'checked'])) {
557 print_liste_field_titre($arrayfields[
'cs.paye'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.paye,cs.periode",
'', $param,
'class="right"', $sortfield, $sortorder);
561 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
562 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
563 print $hookmanager->resPrint;
565 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch ');
569 $totalarray = $TLoadedUsers = array();
570 $totalarray[
'nbfield'] = 0;
571 $totalarray[
'val'][
'totalttcfield'] = 0;
572 while ($i < min($num, $limit)) {
573 $obj = $db->fetch_object(
$resql);
575 $chargesociale_static->id = $obj->rowid;
576 $chargesociale_static->ref = $obj->rowid;
577 $chargesociale_static->label = $obj->label;
578 $chargesociale_static->type_label = $obj->type_label;
581 $projectstatic->id = $obj->project_id;
582 $projectstatic->ref = $obj->project_ref;
583 $projectstatic->title = $obj->project_label;
586 print
'<tr class="oddeven">';
589 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
590 print
'<td>'.(($offset * $limit) + $i).
'</td>';
592 $totalarray[
'nbfield']++;
597 if (!empty($arrayfields[
'cs.rowid'][
'checked'])) {
598 print
'<td>'.$chargesociale_static->getNomUrl(1,
'20').
'</td>';
600 $totalarray[
'nbfield']++;
605 if (!empty($arrayfields[
'cs.libelle'][
'checked'])) {
606 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->label).
'">'.
dol_escape_htmltag($obj->label).
'</td>';
608 $totalarray[
'nbfield']++;
613 if (!empty($arrayfields[
'cs.fk_type'][
'checked'])) {
614 $typelabeltoshow = $obj->type_label;
615 $typelabelpopup = $obj->type_label;
617 $typelabelpopup .=
' - '.$langs->trans(
"AccountancyCode").
': '.$obj->type_accountancy_code;
619 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($typelabelpopup).
'">'.
dol_escape_htmltag($typelabeltoshow).
'</td>';
621 $totalarray[
'nbfield']++;
626 if (!empty($arrayfields[
'cs.date_ech'][
'checked'])) {
627 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->date_ech),
'day').
'</td>';
629 $totalarray[
'nbfield']++;
634 if (!empty($arrayfields[
'cs.periode'][
'checked'])) {
635 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->periode),
'day').
'</td>';
637 $totalarray[
'nbfield']++;
642 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
643 print
'<td class="nowraponall">';
644 if ($obj->project_id > 0) {
645 print $projectstatic->getNomUrl(1);
649 $totalarray[
'nbfield']++;
653 if (!empty($arrayfields[
'cs.fk_user'][
'checked'])) {
655 print
'<td class="tdoverflowmax150">';
656 if (!empty($obj->fk_user)) {
657 if (!empty($TLoadedUsers[$obj->fk_user])) {
658 $ustatic = $TLoadedUsers[$obj->fk_user];
660 $ustatic =
new User($db);
661 $ustatic->fetch($obj->fk_user);
662 $TLoadedUsers[$obj->fk_user] = $ustatic;
664 print $ustatic->getNomUrl(-1);
668 $totalarray[
'nbfield']++;
673 if (!empty($arrayfields[
'cs.fk_mode_reglement'][
'checked'])) {
674 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans(
"PaymentTypeShort".$obj->payment_code)).
'">';
675 if (!empty($obj->payment_code)) {
676 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
680 $totalarray[
'nbfield']++;
685 if (!empty($arrayfields[
'cs.fk_account'][
'checked'])) {
686 print
'<td class="toverflowmax150">';
687 if ($obj->fk_account > 0) {
688 $bankstatic->id = $obj->fk_account;
689 $bankstatic->ref = $obj->bref;
690 $bankstatic->number = $obj->bnumber;
691 $bankstatic->iban = $obj->iban;
692 $bankstatic->bic = $obj->bic;
693 $bankstatic->currency_code = $langs->trans(
"Currency".$obj->currency_code);
694 $bankstatic->account_number = $obj->account_number;
695 $bankstatic->clos = $obj->clos;
700 $bankstatic->label = $obj->blabel;
701 print $bankstatic->getNomUrl(1);
704 if (!$i) $totalarray[
'nbfield']++;
708 if (!empty($arrayfields[
'cs.amount'][
'checked'])) {
709 print
'<td class="nowraponall amount right">'.price($obj->amount).
'</td>';
711 $totalarray[
'nbfield']++;
714 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalttcfield';
716 $totalarray[
'val'][
'totalttcfield'] += $obj->amount;
720 if (!empty($arrayfields[
'cs.paye'][
'checked'])) {
721 print
'<td class="nowraponall right">'.$chargesociale_static->LibStatut($obj->paye, 5, $obj->alreadypayed).
'</td>';
723 $totalarray[
'nbfield']++;
730 $totalarray[
'nbfield']++;
739 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
744 foreach ($arrayfields as $key => $val) {
745 if (!empty($val[
'checked'])) {
749 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
754 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
755 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
756 print $hookmanager->resPrint;
758 print
'</table>'.
"\n";
761 print
'</form>'.
"\n";
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage bank accounts.
Classe permettant la gestion des paiements des charges La tva collectee n'est calculee que sur les fa...
Class to manage projects.
Class to manage Dolibarr users.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
$nbtotalofrecords
Count total nb of records.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.