33require
'../../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsocialcontrib.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
50$langs->loadLangs(array(
'compta',
'banks',
'bills',
'hrm',
'projects'));
52$action =
GETPOST(
'action',
'aZ09');
53$massaction =
GETPOST(
'massaction',
'alpha');
54$confirm =
GETPOST(
'confirm',
'alpha');
55$toselect =
GETPOST(
'toselect',
'array');
56$optioncss =
GETPOST(
'optioncss',
'alpha');
57$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'sclist';
58$mode =
GETPOST(
'mode',
'alpha');
61$search_ref =
GETPOST(
'search_ref',
'alpha');
62$search_label =
GETPOST(
'search_label',
'alpha');
63$search_typeid =
GETPOST(
'search_typeid',
'int');
64$search_amount =
GETPOST(
'search_amount',
'alpha');
65$search_status =
GETPOST(
'search_status',
'intcomma');
66$search_date_startday =
GETPOSTINT(
'search_date_startday');
67$search_date_startmonth =
GETPOSTINT(
'search_date_startmonth');
68$search_date_startyear =
GETPOSTINT(
'search_date_startyear');
69$search_date_endday =
GETPOSTINT(
'search_date_endday');
70$search_date_endmonth =
GETPOSTINT(
'search_date_endmonth');
71$search_date_endyear =
GETPOSTINT(
'search_date_endyear');
72$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
73$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
74$search_date_limit_startday =
GETPOSTINT(
'search_date_limit_startday');
75$search_date_limit_startmonth =
GETPOSTINT(
'search_date_limit_startmonth');
76$search_date_limit_startyear =
GETPOSTINT(
'search_date_limit_startyear');
77$search_date_limit_endday =
GETPOSTINT(
'search_date_limit_endday');
78$search_date_limit_endmonth =
GETPOSTINT(
'search_date_limit_endmonth');
79$search_date_limit_endyear =
GETPOSTINT(
'search_date_limit_endyear');
80$search_date_limit_start =
dol_mktime(0, 0, 0, $search_date_limit_startmonth, $search_date_limit_startday, $search_date_limit_startyear);
81$search_date_limit_end =
dol_mktime(23, 59, 59, $search_date_limit_endmonth, $search_date_limit_endday, $search_date_limit_endyear);
82$search_project_ref =
GETPOST(
'search_project_ref',
'alpha');
83$search_users =
GETPOST(
'search_users',
'array:int');
84$search_type =
GETPOST(
'search_type',
'alpha');
85$search_account =
GETPOST(
'search_account',
'alpha');
88$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
89$sortorder =
GETPOST(
"sortorder",
'aZ09comma');
92if (empty($page) || $page == -1) {
95$offset = $limit * $page;
100 $sortfield =
"cs.date_ech";
109 'cs.rowid' => array(
'label' =>
"Ref",
'checked' =>
'1',
'position' => 10),
110 'cs.libelle' => array(
'label' =>
"Label",
'checked' =>
'1',
'position' => 20),
111 'cs.fk_type' => array(
'label' =>
"Type",
'checked' =>
'1',
'position' => 30),
112 'cs.date_ech' => array(
'label' =>
"Date",
'checked' =>
'1',
'position' => 40),
113 'cs.periode' => array(
'label' =>
"PeriodEndDate",
'checked' =>
'1',
'position' => 50),
114 'p.ref' => array(
'label' =>
"ProjectRef",
'checked' =>
'1',
'position' => 60,
'enabled' => (
string) (
int) (isModEnabled(
'project'))),
115 'cs.fk_user' => array(
'label' =>
"Employee",
'checked' =>
'1',
'position' => 70),
116 'cs.fk_mode_reglement' => array(
'checked' =>
'-1',
'position' => 80,
'label' =>
"DefaultPaymentMode"),
117 'cs.amount' => array(
'label' =>
"Amount",
'checked' =>
'1',
'position' => 100),
118 'cs.paye' => array(
'label' =>
"Status",
'checked' =>
'1',
'position' => 110),
121if (isModEnabled(
"bank")) {
122 $arrayfields[
'cs.fk_account'] = array(
'checked' => -1,
'position' => 90,
'label' =>
"DefaultBankAccount");
128$hookmanager->initHooks(array(
'sclist'));
131$permissiontoadd = $user->hasRight(
'tax',
'charges',
'creer');
132$permissiontodelete = $user->hasRight(
'tax',
'charges',
'supprimer');
137 $socid = $user->socid;
139$result =
restrictedArea($user,
'tax',
'',
'chargesociales',
'charges');
146$parameters = array(
'socid' => $socid);
147$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
153if (empty($reshook)) {
154 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
157 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
163 $search_date_startday =
'';
164 $search_date_startmonth =
'';
165 $search_date_startyear =
'';
166 $search_date_endday =
'';
167 $search_date_endmonth =
'';
168 $search_date_endyear =
'';
169 $search_date_start =
'';
170 $search_date_end =
'';
171 $search_date_limit_startday =
'';
172 $search_date_limit_startmonth =
'';
173 $search_date_limit_startyear =
'';
174 $search_date_limit_endday =
'';
175 $search_date_limit_endmonth =
'';
176 $search_date_limit_endyear =
'';
177 $search_date_limit_start =
'';
178 $search_date_limit_end =
'';
179 $search_project_ref =
'';
182 $search_account =
'';
183 $search_array_options = array();
188 $objectclass =
'ChargeSociales';
189 $objectlabel =
'ChargeSociales';
190 $uploaddir =
$conf->tax->dir_output;
191 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
198$form =
new Form($db);
203$projectstatic =
new Project($db);
205$title = $langs->trans(
"SocialContributions");
207llxHeader(
'', $title,
'',
'', 0, 0,
'',
'',
'',
'bodyforlist');
209$arrayofselected = is_array($toselect) ? $toselect : array();
211$sql =
"SELECT cs.rowid, cs.fk_type as type, cs.fk_user,";
212$sql .=
" cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode as period, cs.fk_account, cs.note_public, cs.note_private,";
213if (isModEnabled(
'project')) {
214 $sql .=
" p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
216$sql .=
" c.libelle as type_label, c.accountancy_code as type_accountancy_code,";
217$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 as status,";
218$sql .=
" pay.code as payment_code";
221$sql .=
", SUM(pc.amount) as alreadypayed";
223$sql .=
" FROM ".MAIN_DB_PREFIX.
"c_chargesociales as c,";
224$sql .=
" ".MAIN_DB_PREFIX.
"chargesociales as cs";
225$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON (cs.fk_account = ba.rowid)";
226$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_paiement as pay ON (cs.fk_mode_reglement = pay.id)';
227if (isModEnabled(
'project')) {
228 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = cs.fk_projet";
230$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementcharge as pc ON pc.fk_charge = cs.rowid";
231$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as u ON (cs.fk_user = u.rowid)";
232$sql .=
" WHERE cs.fk_type = c.id";
233$sql .=
" AND cs.entity = ".((int)
$conf->entity);
236 $sql .=
" AND cs.ref = '".$db->escape($search_ref).
"'";
241if (isModEnabled(
'project')) {
242 if ($search_project_ref !=
'') {
246if (!empty($search_users)) {
247 $sql .=
' AND cs.fk_user IN ('.$db->sanitize(implode(
', ', $search_users)).
')';
249if (!empty($search_type) && $search_type > 0) {
250 $sql .=
' AND cs.fk_mode_reglement='.((int) $search_type);
252if (!empty($search_account) && $search_account > 0) {
253 $sql .=
' AND cs.fk_account='.((int) $search_account);
258if ($search_status !=
'' && $search_status >= 0) {
259 $sql .=
" AND cs.paye = ".((int) $search_status);
261if ($search_date_start) {
262 $sql .=
" AND cs.date_ech >= '".$db->idate($search_date_start).
"'";
264if ($search_date_end) {
265 $sql .=
" AND cs.date_ech <= '".$db->idate($search_date_end).
"'";
267if ($search_date_limit_start) {
268 $sql .=
" AND cs.periode >= '".$db->idate($search_date_limit_start).
"'";
270if ($search_date_limit_end) {
271 $sql .=
" AND cs.periode <= '".$db->idate($search_date_limit_end).
"'";
273if ($search_typeid > 0) {
274 $sql .=
" AND cs.fk_type = ".((int) $search_typeid);
276$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";
277if (isModEnabled(
'project')) {
278 $sql .=
", p.rowid, p.ref, p.title";
282$nbtotalofrecords =
'';
285 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(DISTINCT cs.rowid) as nbtotalofrecords', $sql);
286 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
287 $resql = $db->query($sqlforcount);
289 $objforcount = $db->fetch_object($resql);
290 $nbtotalofrecords = $objforcount->nbtotalofrecords;
295 if (($page * $limit) > $nbtotalofrecords) {
303$sql .= $db->order($sortfield, $sortorder);
305 $sql .= $db->plimit($limit + 1, $offset);
308$resql = $db->query($sql);
316$num = $db->num_rows($resql);
321 $param .=
'&mode='.urlencode($mode);
323if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
324 $param .=
'&contextpage='.urlencode($contextpage);
326if ($limit > 0 && $limit !=
$conf->liste_limit) {
327 $param .=
'&limit='.((int) $limit);
330 $param .=
'&search_ref='.urlencode($search_ref);
333 $param .=
'&search_label='.urlencode($search_label);
335if ($search_project_ref >= 0) {
336 $param .=
"&search_project_ref=".urlencode($search_project_ref);
339 $param .=
'&search_amount='.urlencode($search_amount);
342 $param .=
'&search_typeid='.urlencode((
string) ($search_typeid));
345 foreach ($search_users as $id_user) {
346 $param .=
'&search_users[]='.urlencode($id_user);
350 $param .=
'&search_type='.urlencode((
string) ($search_type));
352if ($search_account) {
353 $param .=
'&search_account='.$search_account;
355if ($search_status !=
'' && $search_status !=
'-1') {
356 $param .=
'&search_status='.urlencode($search_status);
358if ($search_date_startday) {
359 $param .=
'&search_date_startday='.urlencode((
string) ($search_date_startday));
361if ($search_date_startmonth) {
362 $param .=
'&search_date_startmonth='.urlencode((
string) ($search_date_startmonth));
364if ($search_date_startyear) {
365 $param .=
'&search_date_startyear='.urlencode((
string) ($search_date_startyear));
367if ($search_date_endday) {
368 $param .=
'&search_date_endday='.urlencode((
string) ($search_date_endday));
370if ($search_date_endmonth) {
371 $param .=
'&search_date_endmonth='.urlencode((
string) ($search_date_endmonth));
373if ($search_date_endyear) {
374 $param .=
'&search_date_endyear='.urlencode((
string) ($search_date_endyear));
376if ($search_date_limit_startday) {
377 $param .=
'&search_date_limit_startday='.urlencode((
string) ($search_date_limit_startday));
379if ($search_date_limit_startmonth) {
380 $param .=
'&search_date_limit_startmonth='.urlencode((
string) ($search_date_limit_startmonth));
382if ($search_date_limit_startyear) {
383 $param .=
'&search_date_limit_startyear='.urlencode((
string) ($search_date_limit_startyear));
385if ($search_date_limit_endday) {
386 $param .=
'&search_date_limit_endday='.urlencode((
string) ($search_date_limit_endday));
388if ($search_date_limit_endmonth) {
389 $param .=
'&search_date_limit_endmonth='.urlencode((
string) ($search_date_limit_endmonth));
391if ($search_date_limit_endyear) {
392 $param .=
'&search_date_limit_endyear='.urlencode((
string) ($search_date_limit_endyear));
395$url = DOL_URL_ROOT.
'/compta/sociales/card.php?action=create';
398$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'));
399$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'));
401$newcardbutton .=
dolGetButtonTitle($langs->trans(
'MenuNewSocialContribution'),
'',
'fa fa-plus-circle', $url,
'', $permissiontoadd);
404$arrayofmassactions = array();
405if (!empty($permissiontodelete)) {
406 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
408$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
411print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
412if ($optioncss !=
'') {
413 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
415print
'<input type="hidden" name="token" value="'.newToken().
'">';
416print
'<input type="hidden" name="action" value="list">';
417print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
418print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
419print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
420print
'<input type="hidden" name="search_status" value="'.$search_status.
'">';
421print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
422print
'<input type="hidden" name="mode" value="'.$mode.
'">';
426print_barre_liste($langs->trans(
"SocialContributions"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit, 0, 0, 1);
428if (empty($mysoc->country_id) && empty($mysoc->country_code)) {
429 print
'<div class="error">';
430 $langs->load(
"errors");
431 $countrynotdefined = $langs->trans(
"ErrorSetACountryFirst");
432 print $countrynotdefined;
441$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
442$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
443if ($massactionbutton) {
444 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
448$trackid =
'sc'.$object->id;
449include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
451print
'<div class="div-table-responsive">';
452print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
'').
'">'.
"\n";
454print
'<tr class="liste_titre_filter">';
458 print
'<td class="liste_titre maxwidthsearch">';
459 print $form->showFilterAndCheckAddButtons(0);
465 print
'<td class="liste_titre">';
470if (!empty($arrayfields[
'cs.rowid'][
'checked'])) {
471 print
'<td class="liste_titre">';
472 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
477if (!empty($arrayfields[
'cs.rowid'][
'checked'])) {
478 print
'<td class="liste_titre">';
479 print
'<input type="text" class="flat maxwidth100" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
484if (!empty($arrayfields[
'cs.fk_type'][
'checked'])) {
485 print
'<td class="liste_titre">';
486 $formsocialcontrib->select_type_socialcontrib((
int) $search_typeid,
'search_typeid', 1, 0, 0,
'maxwidth150', 1);
491if (!empty($arrayfields[
'cs.date_ech'][
'checked'])) {
492 print
'<td class="liste_titre center">';
493 print
'<div class="nowrapfordate">';
494 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
496 print
'<div class="nowrapfordate">';
497 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
503if (!empty($arrayfields[
'cs.periode'][
'checked'])) {
504 print
'<td class="liste_titre center">';
505 print
'<div class="nowrapfordate">';
506 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'));
508 print
'<div class="nowrapfordate">';
509 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'));
515if (!empty($arrayfields[
'p.ref'][
'checked'])) {
516 print
'<td class="liste_titre">';
517 print
'<input type="text" class="flat" size="6" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).
'">';
521if (!empty($arrayfields[
'cs.fk_user'][
'checked'])) {
523 print
'<td class="liste_titre">';
524 print $form->select_dolusers($search_users,
'search_users', 1,
null, 0,
'',
'',
'0', 0, 0,
'', 0,
'',
'maxwidth150', 0, 0,
true);
529if (!empty($arrayfields[
'cs.fk_mode_reglement'][
'checked'])) {
530 print
'<td class="liste_titre">';
531 print $form->select_types_paiements($search_type,
'search_type',
'', 0, 1, 1, 0, 1,
'maxwidth150', 1);
536if (!empty($arrayfields[
'cs.fk_account'][
'checked'])) {
537 print
'<td class="liste_titre">';
538 $form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth150');
543if (!empty($arrayfields[
'cs.amount'][
'checked'])) {
544 print
'<td class="liste_titre right">';
545 print
'<input class="flat maxwidth75" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'">';
550if (!empty($arrayfields[
'cs.paye'][
'checked'])) {
551 print
'<td class="liste_titre right parentonrightofpage">';
552 $liststatus = array(
'0' => $langs->trans(
"Unpaid"),
'1' => $langs->trans(
"Paid"));
554 print $form->selectarray(
'search_status', $liststatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage', 1);
559$parameters = array(
'arrayfields' => $arrayfields);
560$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
561print $hookmanager->resPrint;
565 print
'<td class="liste_titre maxwidthsearch">';
566 print $form->showFilterAndCheckAddButtons(0);
577print
'<tr class="liste_titre">';
580 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch ');
588if (!empty($arrayfields[
'cs.rowid'][
'checked'])) {
590 print_liste_field_titre($arrayfields[
'cs.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.rowid",
'', $param,
'', $sortfield, $sortorder);
593if (!empty($arrayfields[
'cs.libelle'][
'checked'])) {
594 print_liste_field_titre($arrayfields[
'cs.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.libelle,cs.periode",
'', $param,
'', $sortfield, $sortorder);
597if (!empty($arrayfields[
'cs.fk_type'][
'checked'])) {
598 print_liste_field_titre($arrayfields[
'cs.fk_type'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.fk_type,cs.periode",
'', $param,
'', $sortfield, $sortorder);
601if (!empty($arrayfields[
'cs.date_ech'][
'checked'])) {
602 print_liste_field_titre($arrayfields[
'cs.date_ech'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.date_ech,cs.periode",
'', $param,
'', $sortfield, $sortorder,
'center ');
605if (!empty($arrayfields[
'cs.periode'][
'checked'])) {
606 print_liste_field_titre($arrayfields[
'cs.periode'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.periode",
'', $param,
'', $sortfield, $sortorder,
'center ');
609if (!empty($arrayfields[
'p.ref'][
'checked'])) {
610 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
'', $param,
'', $sortfield, $sortorder);
613if (!empty($arrayfields[
'cs.fk_user'][
'checked'])) {
614 print_liste_field_titre(
"Employee", $_SERVER[
"PHP_SELF"],
"u.lastname,cs.periode",
"", $param,
'class="left"', $sortfield, $sortorder);
617if (!empty($arrayfields[
'cs.fk_mode_reglement'][
'checked'])) {
618 print_liste_field_titre($arrayfields[
'cs.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.fk_mode_reglement,cs.periode",
'', $param,
'', $sortfield, $sortorder);
621if (!empty($arrayfields[
'cs.fk_account'][
'checked'])) {
622 print_liste_field_titre($arrayfields[
'cs.fk_account'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.fk_account,cs.periode",
'', $param,
'', $sortfield, $sortorder);
625if (!empty($arrayfields[
'cs.amount'][
'checked'])) {
626 print_liste_field_titre($arrayfields[
'cs.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.amount,cs.periode",
'', $param,
'class="right"', $sortfield, $sortorder);
629if (!empty($arrayfields[
'cs.paye'][
'checked'])) {
630 print_liste_field_titre($arrayfields[
'cs.paye'][
'label'], $_SERVER[
"PHP_SELF"],
"cs.paye,cs.periode",
'', $param,
'class="right"', $sortfield, $sortorder);
635$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
636$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
637print $hookmanager->resPrint;
640 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch ');
652$imaxinloop = ($limit ? min($num, $limit) : $num);
653$TLoadedUsers = array();
655while ($i < $imaxinloop) {
656 $obj = $db->fetch_object($resql);
658 $chargesociale_static->id = $obj->rowid;
659 $chargesociale_static->ref = $obj->rowid;
660 $chargesociale_static->label = $obj->label;
661 $chargesociale_static->type_label = $obj->type_label;
662 $chargesociale_static->amount = $obj->amount;
663 $chargesociale_static->paye = $obj->paye;
664 $chargesociale_static->date_ech = $db->idate($obj->date_ech);
665 $chargesociale_static->period = $db->idate($obj->period,
'gmt');
666 $chargesociale_static->type_accountancy_code = $obj->type_accountancy_code;
667 $chargesociale_static->note_private = $obj->note_private;
668 $chargesociale_static->note_public = $obj->note_public;
670 if (isModEnabled(
'project')) {
671 $projectstatic->id = $obj->project_id;
672 $projectstatic->ref = $obj->project_ref;
673 $projectstatic->title = $obj->project_label;
676 if ($mode ==
'kanban') {
678 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
679 print
'<div class="box-flex-container kanban">';
682 print $chargesociale_static->getKanbanView(
'', array(
'project' => $projectstatic,
'selected' => in_array($chargesociale_static->id, $arrayofselected)));
683 if ($i == ($imaxinloop - 1)) {
688 print
'<tr class="oddeven">';
693 print
'<td class="center">';
694 if ($massactionbutton || $massaction) {
696 if (in_array($chargesociale_static->id, $arrayofselected)) {
699 print
'<input id="cb'.$chargesociale_static->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$chargesociale_static->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
709 print
'<td>'.(($offset * $limit) + $i).
'</td>';
716 if (!empty($arrayfields[
'cs.rowid'][
'checked'])) {
717 print
'<td class="tdoverflowmax125">';
718 print $chargesociale_static->getNomUrl(1,
'', 0, 0, -1, 1);
726 if (!empty($arrayfields[
'cs.libelle'][
'checked'])) {
727 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->label).
'">'.
dol_escape_htmltag($obj->label).
'</td>';
734 if (!empty($arrayfields[
'cs.fk_type'][
'checked'])) {
735 $typelabeltoshow = $obj->type_label;
736 $typelabelpopup = $obj->type_label;
737 if (isModEnabled(
'accounting')) {
738 $typelabelpopup .=
' - '.$langs->trans(
"AccountancyCode").
': '.$obj->type_accountancy_code;
740 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($typelabelpopup).
'">'.
dol_escape_htmltag($typelabeltoshow).
'</td>';
747 if (!empty($arrayfields[
'cs.date_ech'][
'checked'])) {
748 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->date_ech),
'day').
'</td>';
755 if (!empty($arrayfields[
'cs.periode'][
'checked'])) {
756 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->period),
'day').
'</td>';
763 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
764 print
'<td class="nowraponall">';
765 if ($obj->project_id > 0) {
766 print $projectstatic->getNomUrl(1);
774 if (!empty($arrayfields[
'cs.fk_user'][
'checked'])) {
776 print
'<td class="tdoverflowmax150">';
777 if (!empty($obj->fk_user)) {
778 if (!empty($TLoadedUsers[$obj->fk_user])) {
779 $ustatic = $TLoadedUsers[$obj->fk_user];
781 $ustatic =
new User($db);
782 $ustatic->fetch($obj->fk_user);
783 $TLoadedUsers[$obj->fk_user] = $ustatic;
785 print $ustatic->getNomUrl(-1);
794 if (!empty($arrayfields[
'cs.fk_mode_reglement'][
'checked'])) {
795 print
'<td class="tdoverflowmax150" title="'.dolPrintHTMLForAttribute($langs->trans(
"PaymentTypeShort".$obj->payment_code)).
'">';
796 if (!empty($obj->payment_code)) {
797 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
806 if (!empty($arrayfields[
'cs.fk_account'][
'checked'])) {
807 print
'<td class="toverflowmax150">';
808 if ($obj->fk_account > 0) {
809 $bankstatic->id = $obj->fk_account;
810 $bankstatic->ref = $obj->bref;
811 $bankstatic->number = $obj->bnumber;
812 $bankstatic->iban = $obj->iban;
813 $bankstatic->bic = $obj->bic;
814 $bankstatic->currency_code = $langs->trans(
"Currency".$obj->currency_code);
815 $bankstatic->account_number = $obj->account_number;
816 $bankstatic->status = $obj->status;
817 $bankstatic->label = $obj->blabel;
822 print $bankstatic->getNomUrl(1);
831 if (!empty($arrayfields[
'cs.amount'][
'checked'])) {
832 print
'<td class="nowraponall amount right">'.price($obj->amount).
'</td>';
837 $totalarray[
'val'][
'totalttcfield'] += $obj->amount;
841 if (!empty($arrayfields[
'cs.paye'][
'checked'])) {
842 print
'<td class="nowraponall right">'.$chargesociale_static->LibStatut($obj->paye, 5, $obj->alreadypayed).
'</td>';
850 print
'<td class="center">';
851 if ($massactionbutton || $massaction) {
853 if (in_array($chargesociale_static->id, $arrayofselected)) {
856 print
'<input id="cb'.$chargesociale_static->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$chargesociale_static->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
870include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
875 foreach ($arrayfields as $key => $val) {
876 if (!empty($val[
'checked'])) {
880 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
885$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
886$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
887print $hookmanager->resPrint;
889print
'</table>'.
"\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage bank accounts.
Class for managing the social charges.
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 information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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 a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a 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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.