32require
'../../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsocialcontrib.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
41$langs->loadLangs(array(
'compta',
'banks',
'bills',
'hrm',
'projects'));
43$action =
GETPOST(
'action',
'aZ09');
44$massaction =
GETPOST(
'massaction',
'alpha');
45$confirm =
GETPOST(
'confirm',
'alpha');
46$toselect =
GETPOST(
'toselect',
'array');
47$optioncss =
GETPOST(
'optioncss',
'alpha');
48$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'sclist';
49$mode =
GETPOST(
'mode',
'alpha');
52$search_ref =
GETPOST(
'search_ref',
'int');
53$search_label =
GETPOST(
'search_label',
'alpha');
54$search_typeid =
GETPOST(
'search_typeid',
'int');
55$search_amount =
GETPOST(
'search_amount',
'alpha');
56$search_status =
GETPOST(
'search_status',
'int');
57$search_date_startday =
GETPOST(
'search_date_startday',
'int');
58$search_date_startmonth =
GETPOST(
'search_date_startmonth',
'int');
59$search_date_startyear =
GETPOST(
'search_date_startyear',
'int');
60$search_date_endday =
GETPOST(
'search_date_endday',
'int');
61$search_date_endmonth =
GETPOST(
'search_date_endmonth',
'int');
62$search_date_endyear =
GETPOST(
'search_date_endyear',
'int');
63$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
64$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
65$search_date_limit_startday =
GETPOST(
'search_date_limit_startday',
'int');
66$search_date_limit_startmonth =
GETPOST(
'search_date_limit_startmonth',
'int');
67$search_date_limit_startyear =
GETPOST(
'search_date_limit_startyear',
'int');
68$search_date_limit_endday =
GETPOST(
'search_date_limit_endday',
'int');
69$search_date_limit_endmonth =
GETPOST(
'search_date_limit_endmonth',
'int');
70$search_date_limit_endyear =
GETPOST(
'search_date_limit_endyear',
'int');
71$search_date_limit_start =
dol_mktime(0, 0, 0, $search_date_limit_startmonth, $search_date_limit_startday, $search_date_limit_startyear);
72$search_date_limit_end =
dol_mktime(23, 59, 59, $search_date_limit_endmonth, $search_date_limit_endday, $search_date_limit_endyear);
73$search_project_ref =
GETPOST(
'search_project_ref',
'alpha');
74$search_users =
GETPOST(
'search_users');
75$search_type =
GETPOST(
'search_type',
'int');
76$search_account =
GETPOST(
'search_account',
'int');
78$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
79$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
80$sortorder =
GETPOST(
"sortorder",
'aZ09comma');
81$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
83if (empty($page) || $page == -1) {
86$offset = $limit * $page;
91 $sortfield =
"cs.date_ech";
97$filtre =
GETPOST(
"filtre",
'int');
100 'cs.rowid' =>array(
'label'=>
"Ref",
'checked'=>1,
'position'=>10),
101 'cs.libelle' =>array(
'label'=>
"Label",
'checked'=>1,
'position'=>20),
102 'cs.fk_type' =>array(
'label'=>
"Type",
'checked'=>1,
'position'=>30),
103 'cs.date_ech' =>array(
'label'=>
"Date",
'checked'=>1,
'position'=>40),
104 'cs.periode' =>array(
'label'=>
"PeriodEndDate",
'checked'=>1,
'position'=>50),
105 'p.ref' =>array(
'label'=>
"ProjectRef",
'checked'=>1,
'position'=>60,
'enabled'=>(isModEnabled(
'project'))),
106 'cs.fk_user' =>array(
'label'=>
"Employee",
'checked'=>1,
'position'=>70),
107 'cs.fk_mode_reglement' =>array(
'checked'=>-1,
'position'=>80,
'label'=>
"DefaultPaymentMode"),
108 'cs.amount' =>array(
'label'=>
"Amount",
'checked'=>1,
'position'=>100),
109 'cs.paye' =>array(
'label'=>
"Status",
'checked'=>1,
'position'=>110),
112if (isModEnabled(
"banque")) {
113 $arrayfields[
'cs.fk_account'] = array(
'checked'=>-1,
'position'=>90,
'label'=>
"DefaultBankAccount");
119$hookmanager->initHooks(array(
'sclist'));
123$socid =
GETPOST(
"socid",
'int');
125 $socid = $user->socid;
127$result =
restrictedArea($user,
'tax',
'',
'chargesociales',
'charges');
128$permissiontodelete = $user->rights->tax->charges->supprimer;
135$parameters = array(
'socid'=>$socid);
136$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
142if (empty($reshook)) {
143 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
146 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
152 $search_date_startday =
'';
153 $search_date_startmonth =
'';
154 $search_date_startyear =
'';
155 $search_date_endday =
'';
156 $search_date_endmonth =
'';
157 $search_date_endyear =
'';
158 $search_date_start =
'';
159 $search_date_end =
'';
160 $search_date_limit_startday =
'';
161 $search_date_limit_startmonth =
'';
162 $search_date_limit_startyear =
'';
163 $search_date_limit_endday =
'';
164 $search_date_limit_endmonth =
'';
165 $search_date_limit_endyear =
'';
166 $search_date_limit_start =
'';
167 $search_date_limit_end =
'';
168 $search_project_ref =
'';
171 $search_account =
'';
172 $search_array_options = array();
177 $objectclass =
'ChargeSociales';
178 $objectlabel =
'ChargeSociales';
179 $uploaddir = $conf->tax->dir_output;
180 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
187$form =
new Form($db);
192$projectstatic =
new Project($db);
194llxHeader(
'', $langs->trans(
"SocialContributions"));
196$arrayofselected = is_array($toselect) ? $toselect : array();
198$sql =
"SELECT cs.rowid, cs.fk_type as type, cs.fk_user,";
199$sql .=
" cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,";
200if (isModEnabled(
'project')) {
201 $sql .=
" p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
203$sql .=
" c.libelle as type_label, c.accountancy_code as type_accountancy_code,";
204$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,";
205$sql .=
" pay.code as payment_code";
208$sql .=
", SUM(pc.amount) as alreadypayed";
210$sql .=
" FROM ".MAIN_DB_PREFIX.
"c_chargesociales as c,";
211$sql .=
" ".MAIN_DB_PREFIX.
"chargesociales as cs";
212$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON (cs.fk_account = ba.rowid)";
213$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_paiement as pay ON (cs.fk_mode_reglement = pay.id)';
214if (isModEnabled(
'project')) {
215 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = cs.fk_projet";
217$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementcharge as pc ON pc.fk_charge = cs.rowid";
218$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as u ON (cs.fk_user = u.rowid)";
219$sql .=
" WHERE cs.fk_type = c.id";
220$sql .=
" AND cs.entity = ".((int) $conf->entity);
223 $sql .=
" AND cs.ref = '".$db->escape($search_ref).
"'";
228if (isModEnabled(
'project')) {
229 if ($search_project_ref !=
'') {
233if (!empty($search_users)) {
234 $sql .=
' AND cs.fk_user IN ('.$db->sanitize(implode(
', ', $search_users)).
')';
236if (!empty($search_type) && $search_type > 0) {
237 $sql .=
' AND cs.fk_mode_reglement='.((int) $search_type);
239if (!empty($search_account) && $search_account > 0) {
240 $sql .=
' AND cs.fk_account='.((int) $search_account);
245if ($search_status !=
'' && $search_status >= 0) {
246 $sql .=
" AND cs.paye = ".((int) $search_status);
248if ($search_date_start) {
249 $sql .=
" AND cs.date_ech >= '".$db->idate($search_date_start).
"'";
251if ($search_date_end) {
252 $sql .=
" AND cs.date_ech <= '".$db->idate($search_date_end).
"'";
254if ($search_date_limit_start) {
255 $sql .=
" AND cs.periode >= '".$db->idate($search_date_limit_start).
"'";
257if ($search_date_limit_end) {
258 $sql .=
" AND cs.periode <= '".$db->idate($search_date_limit_end).
"'";
260if ($search_typeid > 0) {
261 $sql .=
" AND cs.fk_type = ".((int) $search_typeid);
263$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";
264if (isModEnabled(
'project')) {
265 $sql .=
", p.rowid, p.ref, p.title";
269$nbtotalofrecords =
'';
272 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(DISTINCT cs.rowid) as nbtotalofrecords', $sql);
273 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
274 $resql = $db->query($sqlforcount);
276 $objforcount = $db->fetch_object($resql);
277 $nbtotalofrecords = $objforcount->nbtotalofrecords;
282 if (($page * $limit) > $nbtotalofrecords) {
290$sql .= $db->order($sortfield, $sortorder);
292 $sql .= $db->plimit($limit + 1, $offset);
295$resql = $db->query($sql);
303$num = $db->num_rows($resql);
308 $param .=
'&mode='.urlencode($mode);
310if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
311 $param .=
'&contextpage='.urlencode($contextpage);
313if ($limit > 0 && $limit != $conf->liste_limit) {
314 $param .=
'&limit='.((int) $limit);
317 $param .=
'&search_ref='.urlencode($search_ref);
320 $param .=
'&search_label='.urlencode($search_label);
322if ($search_project_ref >= 0) {
323 $param .=
"&search_project_ref=".urlencode($search_project_ref);
326 $param .=
'&search_amount='.urlencode($search_amount);
329 $param .=
'&search_typeid='.urlencode($search_typeid);
332 foreach ($search_users as $id_user) {
333 $param .=
'&search_users[]='.urlencode($id_user);
337 $param .=
'&search_type='.urlencode($search_type);
339if ($search_account) {
340 $param .=
'&search_account='.$search_account;
342if ($search_status !=
'' && $search_status !=
'-1') {
343 $param .=
'&search_status='.urlencode($search_status);
345if ($search_date_startday) {
346 $param .=
'&search_date_startday='.urlencode($search_date_startday);
348if ($search_date_startmonth) {
349 $param .=
'&search_date_startmonth='.urlencode($search_date_startmonth);
351if ($search_date_startyear) {
352 $param .=
'&search_date_startyear='.urlencode($search_date_startyear);
354if ($search_date_endday) {
355 $param .=
'&search_date_endday='.urlencode($search_date_endday);
357if ($search_date_endmonth) {
358 $param .=
'&search_date_endmonth='.urlencode($search_date_endmonth);
360if ($search_date_endyear) {
361 $param .=
'&search_date_endyear='.urlencode($search_date_endyear);
363if ($search_date_limit_startday) {
364 $param .=
'&search_date_limit_startday='.urlencode($search_date_limit_startday);
366if ($search_date_limit_startmonth) {
367 $param .=
'&search_date_limit_startmonth='.urlencode($search_date_limit_startmonth);
369if ($search_date_limit_startyear) {
370 $param .=
'&search_date_limit_startyear='.urlencode($search_date_limit_startyear);
372if ($search_date_limit_endday) {
373 $param .=
'&search_date_limit_endday='.urlencode($search_date_limit_endday);
375if ($search_date_limit_endmonth) {
376 $param .=
'&search_date_limit_endmonth='.urlencode($search_date_limit_endmonth);
378if ($search_date_limit_endyear) {
379 $param .=
'&search_date_limit_endyear='.urlencode($search_date_limit_endyear);
383$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss'=>
'reposition'));
384$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss'=>
'reposition'));
385if ($user->rights->tax->charges->creer) {
386 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'MenuNewSocialContribution'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/compta/sociales/card.php?action=create');
391$arrayofmassactions = array();
392if (!empty($permissiontodelete)) {
393 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
395$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
398print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
399if ($optioncss !=
'') {
400 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
402print
'<input type="hidden" name="token" value="'.newToken().
'">';
403print
'<input type="hidden" name="action" value="list">';
404print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
405print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
406print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
407print
'<input type="hidden" name="search_status" value="'.$search_status.
'">';
408print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
409print
'<input type="hidden" name="mode" value="'.$mode.
'">';
412print_barre_liste($langs->trans(
"SocialContributions"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit, 0, 0, 1);
414if (empty($mysoc->country_id) && empty($mysoc->country_code)) {
415 print
'<div class="error">';
416 $langs->load(
"errors");
417 $countrynotdefined = $langs->trans(
"ErrorSetACountryFirst");
418 print $countrynotdefined;
427$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
428$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
429if ($massactionbutton) {
430 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
434$trackid =
'sc'.$object->id;
435include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
437print
'<div class="div-table-responsive">';
438print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
'').
'">'.
"\n";
440print
'<tr class="liste_titre_filter">';
444 print
'<td class="liste_titre maxwidthsearch">';
445 print $form->showFilterAndCheckAddButtons(0);
450if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
451 print
'<td class="liste_titre">';
456if (!empty($arrayfields[
'cs.rowid'][
'checked'])) {
457 print
'<td class="liste_titre">';
458 print
'<input class="flat maxwidth75" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
463if (!empty($arrayfields[
'cs.rowid'][
'checked'])) {
464 print
'<td class="liste_titre">';
465 print
'<input type="text" class="flat maxwidth100" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
470if (!empty($arrayfields[
'cs.fk_type'][
'checked'])) {
471 print
'<td class="liste_titre">';
472 $formsocialcontrib->select_type_socialcontrib($search_typeid,
'search_typeid', 1, 0, 0,
'maxwidth150', 1);
477if (!empty($arrayfields[
'cs.date_ech'][
'checked'])) {
478 print
'<td class="liste_titre center">';
479 print
'<div class="nowrap">';
480 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
482 print
'<div class="nowrap">';
483 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
489if (!empty($arrayfields[
'cs.periode'][
'checked'])) {
490 print
'<td class="liste_titre center">';
491 print
'<div class="nowrap">';
492 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'));
494 print
'<div class="nowrap">';
495 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'));
501if (!empty($arrayfields[
'p.ref'][
'checked'])) {
502 print
'<td class="liste_titre">';
503 print
'<input type="text" class="flat" size="6" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).
'">';
507if (!empty($arrayfields[
'cs.fk_user'][
'checked'])) {
509 print
'<td class="liste_titre">';
510 print $form->select_dolusers($search_users,
'search_users', 1,
null, 0,
'',
'',
'0', 0, 0,
'', 0,
'',
'maxwidth150', 0, 0,
true);
515if (!empty($arrayfields[
'cs.fk_mode_reglement'][
'checked'])) {
516 print
'<td class="liste_titre">';
517 print $form->select_types_paiements($search_type,
'search_type',
'', 0, 1, 1, 0, 1,
'maxwidth150', 1);
522if (!empty($arrayfields[
'cs.fk_account'][
'checked'])) {
523 print
'<td class="liste_titre">';
524 $form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth150');
529if (!empty($arrayfields[
'cs.amount'][
'checked'])) {
530 print
'<td class="liste_titre right">';
531 print
'<input class="flat maxwidth75" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'">';
536if (!empty($arrayfields[
'cs.paye'][
'checked'])) {
537 print
'<td class="liste_titre right parentonrightofpage">';
538 $liststatus = array(
'0'=>$langs->trans(
"Unpaid"),
'1'=>$langs->trans(
"Paid"));
539 print $form->selectarray(
'search_status', $liststatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage', 1);
544$parameters = array(
'arrayfields'=>$arrayfields);
545$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
546print $hookmanager->resPrint;
550 print
'<td class="liste_titre maxwidthsearch">';
551 print $form->showFilterAndCheckAddButtons(0);
557$totalarray = array();
558$totalarray[
'nbfield'] = 0;
562print
'<tr class="liste_titre">';
565 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch ');
566 $totalarray[
'nbfield']++;
569if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
571 $totalarray[
'nbfield']++;
573if (!empty($arrayfields[
'cs.rowid'][
'checked'])) {
574 print_liste_field_titre($arrayfields[
'cs.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.rowid",
'', $param,
'', $sortfield, $sortorder);
575 $totalarray[
'nbfield']++;
577if (!empty($arrayfields[
'cs.libelle'][
'checked'])) {
578 print_liste_field_titre($arrayfields[
'cs.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.libelle,cs.periode",
'', $param,
'', $sortfield, $sortorder);
579 $totalarray[
'nbfield']++;
581if (!empty($arrayfields[
'cs.fk_type'][
'checked'])) {
582 print_liste_field_titre($arrayfields[
'cs.fk_type'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.fk_type,cs.periode",
'', $param,
'', $sortfield, $sortorder);
583 $totalarray[
'nbfield']++;
585if (!empty($arrayfields[
'cs.date_ech'][
'checked'])) {
586 print_liste_field_titre($arrayfields[
'cs.date_ech'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.date_ech,cs.periode",
'', $param,
'', $sortfield, $sortorder,
'center ');
587 $totalarray[
'nbfield']++;
589if (!empty($arrayfields[
'cs.periode'][
'checked'])) {
590 print_liste_field_titre($arrayfields[
'cs.periode'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.periode",
'', $param,
'', $sortfield, $sortorder,
'center ');
591 $totalarray[
'nbfield']++;
593if (!empty($arrayfields[
'p.ref'][
'checked'])) {
594 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
'', $param,
'', $sortfield, $sortorder);
595 $totalarray[
'nbfield']++;
597if (!empty($arrayfields[
'cs.fk_user'][
'checked'])) {
598 print_liste_field_titre(
"Employee", $_SERVER[
"PHP_SELF"],
"u.lastname,cs.periode",
"", $param,
'class="left"', $sortfield, $sortorder);
599 $totalarray[
'nbfield']++;
601if (!empty($arrayfields[
'cs.fk_mode_reglement'][
'checked'])) {
602 print_liste_field_titre($arrayfields[
'cs.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.fk_mode_reglement,cs.periode",
'', $param,
'', $sortfield, $sortorder);
603 $totalarray[
'nbfield']++;
605if (!empty($arrayfields[
'cs.fk_account'][
'checked'])) {
606 print_liste_field_titre($arrayfields[
'cs.fk_account'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.fk_account,cs.periode",
'', $param,
'', $sortfield, $sortorder);
607 $totalarray[
'nbfield']++;
609if (!empty($arrayfields[
'cs.amount'][
'checked'])) {
610 print_liste_field_titre($arrayfields[
'cs.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.amount,cs.periode",
'', $param,
'class="right"', $sortfield, $sortorder);
611 $totalarray[
'nbfield']++;
613if (!empty($arrayfields[
'cs.paye'][
'checked'])) {
614 print_liste_field_titre($arrayfields[
'cs.paye'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.paye,cs.periode",
'', $param,
'class="right"', $sortfield, $sortorder);
615 $totalarray[
'nbfield']++;
619$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
620$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
621print $hookmanager->resPrint;
624 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch ');
625 $totalarray[
'nbfield']++;
632$savnbfield = $totalarray[
'nbfield'];
633$totalarray = array();
634$totalarray[
'nbfield'] = 0;
635$totalarray[
'val'] = array();
636$imaxinloop = ($limit ? min($num, $limit) : $num);
637while ($i < $imaxinloop) {
638 $obj = $db->fetch_object($resql);
640 $chargesociale_static->id = $obj->rowid;
641 $chargesociale_static->ref = $obj->rowid;
642 $chargesociale_static->label = $obj->label;
643 $chargesociale_static->type_label = $obj->type_label;
644 $chargesociale_static->amount = $obj->amount;
645 $chargesociale_static->paye = $obj->paye;
646 $chargesociale_static->date_ech = $obj->date_ech;
648 if (isModEnabled(
'project')) {
649 $projectstatic->id = $obj->project_id;
650 $projectstatic->ref = $obj->project_ref;
651 $projectstatic->title = $obj->project_label;
654 if ($mode ==
'kanban') {
656 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
657 print
'<div class="box-flex-container kanban">';
660 print $chargesociale_static->getKanbanView(
'', array(
'project'=> $projectstatic,
'selected' => in_array($chargesociale_static->id, $arrayofselected)));
661 if ($i == ($imaxinloop - 1)) {
666 print
'<tr class="oddeven">';
671 print
'<td class="center">';
672 if ($massactionbutton || $massaction) {
674 if (in_array($chargesociale_static->id, $arrayofselected)) {
677 print
'<input id="cb'.$chargesociale_static->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$chargesociale_static->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
681 $totalarray[
'nbfield']++;
686 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
687 print
'<td>'.(($offset * $limit) + $i).
'</td>';
689 $totalarray[
'nbfield']++;
694 if (!empty($arrayfields[
'cs.rowid'][
'checked'])) {
695 print
'<td>'.$chargesociale_static->getNomUrl(1,
'20').
'</td>';
697 $totalarray[
'nbfield']++;
702 if (!empty($arrayfields[
'cs.libelle'][
'checked'])) {
703 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->label).
'">'.
dol_escape_htmltag($obj->label).
'</td>';
705 $totalarray[
'nbfield']++;
710 if (!empty($arrayfields[
'cs.fk_type'][
'checked'])) {
711 $typelabeltoshow = $obj->type_label;
712 $typelabelpopup = $obj->type_label;
713 if (isModEnabled(
'accounting')) {
714 $typelabelpopup .=
' - '.$langs->trans(
"AccountancyCode").
': '.$obj->type_accountancy_code;
716 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($typelabelpopup).
'">'.
dol_escape_htmltag($typelabeltoshow).
'</td>';
718 $totalarray[
'nbfield']++;
723 if (!empty($arrayfields[
'cs.date_ech'][
'checked'])) {
724 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->date_ech),
'day').
'</td>';
726 $totalarray[
'nbfield']++;
731 if (!empty($arrayfields[
'cs.periode'][
'checked'])) {
732 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->periode),
'day').
'</td>';
734 $totalarray[
'nbfield']++;
739 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
740 print
'<td class="nowraponall">';
741 if ($obj->project_id > 0) {
742 print $projectstatic->getNomUrl(1);
746 $totalarray[
'nbfield']++;
750 if (!empty($arrayfields[
'cs.fk_user'][
'checked'])) {
752 print
'<td class="tdoverflowmax150">';
753 if (!empty($obj->fk_user)) {
754 if (!empty($TLoadedUsers[$obj->fk_user])) {
755 $ustatic = $TLoadedUsers[$obj->fk_user];
757 $ustatic =
new User($db);
758 $ustatic->fetch($obj->fk_user);
759 $TLoadedUsers[$obj->fk_user] = $ustatic;
761 print $ustatic->getNomUrl(-1);
765 $totalarray[
'nbfield']++;
770 if (!empty($arrayfields[
'cs.fk_mode_reglement'][
'checked'])) {
771 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans(
"PaymentTypeShort".$obj->payment_code)).
'">';
772 if (!empty($obj->payment_code)) {
773 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
777 $totalarray[
'nbfield']++;
782 if (!empty($arrayfields[
'cs.fk_account'][
'checked'])) {
783 print
'<td class="toverflowmax150">';
784 if ($obj->fk_account > 0) {
785 $bankstatic->id = $obj->fk_account;
786 $bankstatic->ref = $obj->bref;
787 $bankstatic->number = $obj->bnumber;
788 $bankstatic->iban = $obj->iban;
789 $bankstatic->bic = $obj->bic;
790 $bankstatic->currency_code = $langs->trans(
"Currency".$obj->currency_code);
791 $bankstatic->account_number = $obj->account_number;
792 $bankstatic->clos = $obj->clos;
797 $bankstatic->label = $obj->blabel;
798 print $bankstatic->getNomUrl(1);
801 if (!$i) $totalarray[
'nbfield']++;
805 if (!empty($arrayfields[
'cs.amount'][
'checked'])) {
806 print
'<td class="nowraponall amount right">'.price($obj->amount).
'</td>';
808 $totalarray[
'nbfield']++;
811 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalttcfield';
813 $totalarray[
'val'][
'totalttcfield'] += $obj->amount;
817 if (!empty($arrayfields[
'cs.paye'][
'checked'])) {
818 print
'<td class="nowraponall right">'.$chargesociale_static->LibStatut($obj->paye, 5, $obj->alreadypayed).
'</td>';
820 $totalarray[
'nbfield']++;
826 print
'<td class="center">';
827 if ($massactionbutton || $massaction) {
829 if (in_array($chargesociale_static->id, $arrayofselected)) {
832 print
'<input id="cb'.$chargesociale_static->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$chargesociale_static->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
836 $totalarray[
'nbfield']++;
846include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
851 foreach ($arrayfields as $key => $val) {
852 if (!empty($val[
'checked'])) {
856 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
861$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
862$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
863print $hookmanager->resPrint;
865print
'</table>'.
"\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.
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_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...
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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.