32require
'../../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/tva.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
50$langs->loadLangs(array(
'compta',
'bills'));
52$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
53$massaction =
GETPOST(
'massaction',
'alpha');
55$confirm =
GETPOST(
'confirm',
'alpha');
56$cancel =
GETPOST(
'cancel',
'alpha');
57$toselect =
GETPOST(
'toselect',
'array');
58$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'salestaxeslist';
59$backtopage =
GETPOST(
'backtopage',
'alpha');
60$optioncss =
GETPOST(
'optioncss',
'alpha');
61$optioncss =
GETPOST(
'optioncss',
'aZ');
64$search_ref =
GETPOST(
'search_ref',
'alpha');
65$search_label =
GETPOST(
'search_label',
'alpha');
70$search_type =
GETPOST(
'search_type',
'intcomma');
71$search_account =
GETPOST(
'search_account',
'alpha');
72$search_amount =
GETPOST(
'search_amount',
'alpha');
73$search_status =
GETPOST(
'search_status',
'intcomma');
76$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
77$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
79if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
83$offset = $limit * $page;
88 $sortfield =
't.datev';
95 't.rowid' => array(
'checked' => 1,
'position' => 10,
'label' =>
"Ref",),
96 't.label' => array(
'checked' => 1,
'position' => 20,
'label' =>
"Label"),
97 't.datev' => array(
'checked' => 1,
'position' => 30,
'label' =>
"PeriodEndDate"),
98 't.fk_typepayment' => array(
'checked' => 1,
'position' => 50,
'label' =>
"DefaultPaymentMode"),
99 't.amount' => array(
'checked' => 1,
'position' => 90,
'label' =>
"Amount"),
100 't.datec' => array(
'checked' => 1,
'position' => 91,
'label' =>
"DateCreation"),
101 't.status' => array(
'checked' => 1,
'position' => 92,
'label' =>
"Status"),
104if (isModEnabled(
"bank")) {
105 $arrayfields[
't.fk_account'] = array(
'checked' => 1,
'position' => 60,
'label' =>
"DefaultBankAccount");
109'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
112$hookmanager->initHooks(array(
'salestaxeslist'));
115$permissiontoadd = $user->hasRight(
'tax',
'charges',
'creer');
116$permissiontodelete = $user->hasRight(
'tax',
'charges',
'supprimer');
121 $socid = $user->socid;
130$parameters = array(
'socid' => $socid);
131$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
137if (empty($reshook)) {
139 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
141 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
144 $search_dateend_start =
'';
145 $search_dateend_end =
'';
146 $search_datepayment_start =
'';
147 $search_datepayment_end =
'';
149 $search_account =
'';
153 $search_array_options = array();
157 $objectclass =
'Tva';
158 $objectlabel =
'Tva';
159 $uploaddir =
$conf->tax->dir_output;
160 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
168$form =
new Form($db);
171$tva_static =
new Tva($db);
178$title = $langs->trans(
"VATDeclarations");
185$sql =
'SELECT t.rowid, t.amount, t.label, t.datec, t.datev, t.paye as status, t.fk_typepayment as type, t.fk_account,';
186$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,';
187$sql .=
' t.num_payment, pst.code as payment_code,';
188$sql .=
' SUM(ptva.amount) as alreadypayed';
192$sql .=
' FROM '.MAIN_DB_PREFIX.
'tva as t';
193$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_paiement as pst ON (t.fk_typepayment = pst.id)';
194$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank_account as ba ON (t.fk_account = ba.rowid)';
195$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"payment_vat as ptva ON (ptva.fk_tva = t.rowid)";
196$sql .=
' WHERE t.entity IN ('.getEntity(
$object->element).
')';
198if (!empty($search_ref)) {
201if (!empty($search_label)) {
204if (!empty($search_dateend_start)) {
205 $sql .=
" AND t.datev >= '".$db->idate($search_dateend_start).
"'";
207if (!empty($search_dateend_end)) {
208 $sql .=
" AND t.datev <= '".$db->idate($search_dateend_end).
"'";
210if (!empty($search_datepayment_start)) {
211 $sql .=
" AND t.datep >= '".$db->idate($search_datepayment_start).
"'";
213if (!empty($search_datepayment_end)) {
214 $sql .=
" AND t.datep <= '".$db->idate($search_datepayment_end).
"'";
216if (!empty($search_type) && $search_type > 0) {
217 $sql .=
' AND t.fk_typepayment = '.((int) $search_type);
219if (!empty($search_account) && $search_account > 0) {
220 $sql .=
' AND t.fk_account = '.((int) $search_account);
222if (!empty($search_amount)) {
225if ($search_status !=
'' && $search_status >= 0) {
226 $sql .=
" AND t.paye = ".((int) $search_status);
229$sql .=
" GROUP BY t.rowid, t.amount, t.label, t.datec, t.datev, t.paye, t.fk_typepayment, t.fk_account,";
230$sql .=
" ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, t.num_payment, pst.code";
233$nbtotalofrecords =
'';
236 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
237 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
238 $resql = $db->query($sqlforcount);
240 $objforcount = $db->fetch_object($resql);
241 $nbtotalofrecords = $objforcount->nbtotalofrecords;
246 if (($page * $limit) > $nbtotalofrecords) {
254$sql .= $db->order($sortfield, $sortorder);
256 $sql .= $db->plimit($limit + 1, $offset);
259$resql = $db->query($sql);
265$num = $db->num_rows($resql);
271llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
273$arrayofselected = is_array($toselect) ? $toselect : array();
277 $param .=
'&mode='.urlencode($mode);
279if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
280 $param .=
'&contextpage='.urlencode($contextpage);
282if ($limit > 0 && $limit !=
$conf->liste_limit) {
283 $param .=
'&limit='.((int) $limit);
285if ($optioncss !=
'') {
286 $param .=
'&optioncss='.urlencode($optioncss);
289if (!empty($search_ref)) {
290 $param .=
'&search_ref="'.$search_ref.
'"';
292if (!empty($search_label)) {
293 $param .=
'&search_label="'.$search_label.
'"';
295if (!empty($search_dateend_start)) {
296 $param .=
'&search_dateend_startyear='.GETPOSTINT(
'search_dateend_startyear');
298if (!empty($search_dateend_start)) {
299 $param .=
'&search_dateend_startmonth='.GETPOSTINT(
'search_dateend_startmonth');
301if (!empty($search_dateend_start)) {
302 $param .=
'&search_dateend_startday='.GETPOSTINT(
'search_dateend_startday');
304if (!empty($search_dateend_end)) {
305 $param .=
'&search_dateend_endyear='.GETPOSTINT(
'search_dateend_endyear');
307if (!empty($search_dateend_end)) {
308 $param .=
'&search_dateend_endmonth='.GETPOSTINT(
'search_dateend_endmonth');
310if (!empty($search_dateend_end)) {
311 $param .=
'&search_dateend_endday='.GETPOSTINT(
'search_dateend_endday');
313if (!empty($search_datepayment_start)) {
314 $param .=
'&search_datepayment_startyear='.GETPOSTINT(
'search_datepayment_startyear');
316if (!empty($search_datepayment_start)) {
317 $param .=
'&search_datepayment_startmonth='.GETPOSTINT(
'search_datepayment_startmonth');
319if (!empty($search_datepayment_start)) {
320 $param .=
'&search_datepayment_startday='.GETPOSTINT(
'search_datepayment_startday');
322if (!empty($search_datepayment_end)) {
323 $param .=
'&search_datepayment_endyear='.GETPOSTINT(
'search_datepayment_endyear');
325if (!empty($search_datepayment_end)) {
326 $param .=
'&search_datepayment_endmonth='.GETPOSTINT(
'search_datepayment_endmonth');
328if (!empty($search_datepayment_end)) {
329 $param .=
'&search_datepayment_endday='.GETPOSTINT(
'search_datepayment_endday');
331if (!empty($search_type) && $search_type > 0) {
332 $param .=
'&search_type='.$search_type;
334if (!empty($search_account) && $search_account > 0) {
335 $param .=
'&search_account='.$search_account;
337if (!empty($search_amount)) {
338 $param .=
'&search_amount="'.$search_amount.
'"';
340if ($search_status !=
'' && $search_status !=
'-1') {
341 $param .=
'&search_status='.urlencode($search_status);
345$arrayofmassactions = array(
349if (!empty($permissiontodelete)) {
350 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
352$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
356print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
357if ($optioncss !=
'') {
358 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
360print
'<input type="hidden" name="token" value="'.newToken().
'">';
361print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
362print
'<input type="hidden" name="action" value="list">';
363print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
364print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
365print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
366print
'<input type="hidden" name="page" value="'.$page.
'">';
367print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
368print
'<input type="hidden" name="page_y" value="">';
369print
'<input type="hidden" name="mode" value="'.$mode.
'">';
371$url = DOL_URL_ROOT.
'/compta/tva/card.php?action=create';
373 $url .=
'&socid='.$socid;
376$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'));
377$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'));
379$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewVATPayment'),
'',
'fa fa-plus-circle', $url,
'', $permissiontoadd);
381print_barre_liste($title, $page, $_SERVER[
'PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'title_accountancy', 0, $newcardbutton,
'', $limit, 0, 0, 1);
384$topicmail =
"SendVAT";
386$objecttmp =
new Tva($db);
387$trackid =
'vat'.$object->id;
388include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
390$varpage = empty($contextpage) ? $_SERVER[
'PHP_SELF'] : $contextpage;
391$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
392if ($massactionbutton) {
393 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
398$parameters = array();
399$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
400if (empty($reshook)) {
401 $moreforfilter .= $hookmanager->resPrint;
403 $moreforfilter = $hookmanager->resPrint;
406if (!empty($moreforfilter)) {
407 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
408 print $moreforfilter;
412$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
413$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
414$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
415$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
417print
'<div class="div-table-responsive">';
418print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
422print
'<tr class="liste_titre_filter">';
425 print
'<td class="liste_titre center maxwidthsearch">';
426 $searchpicto = $form->showFilterButtons(
'left');
433 print
'<td class="liste_titre">';
438if (!empty($arrayfields[
't.rowid'][
'checked'])) {
439 print
'<td class="liste_titre">';
440 print
'<input type="text" class="flat" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
445if (!empty($arrayfields[
't.label'][
'checked'])) {
446 print
'<td class="liste_titre">';
447 print
'<input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
452if (!empty($arrayfields[
't.datev'][
'checked'])) {
453 print
'<td class="liste_titre center">';
454 print
'<div class="nowrapfordate">';
455 print $form->selectDate($search_dateend_start ? $search_dateend_start : -1,
'search_dateend_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
457 print
'<div class="nowrapfordate">';
458 print $form->selectDate($search_dateend_end ? $search_dateend_end : -1,
'search_dateend_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
476if (!empty($arrayfields[
't.fk_typepayment'][
'checked'])) {
477 print
'<td class="liste_titre left">';
478 print $form->select_types_paiements($search_type,
'search_type',
'', 0, 1, 1, 16, 1,
'', 1);
483if (!empty($arrayfields[
't.fk_account'][
'checked'])) {
484 print
'<td class="liste_titre left">';
485 $form->select_comptes($search_account,
'search_account', 0,
'', 1);
490if (!empty($arrayfields[
't.amount'][
'checked'])) {
491 print
'<td class="liste_titre right">';
492 print
'<input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.
'">';
497if (!empty($arrayfields[
't.datec'][
'checked'])) {
498 print
'<td class="liste_titre right">';
504if (!empty($arrayfields[
't.status'][
'checked'])) {
505 print
'<td class="liste_titre right parentonrightofpage">';
506 $liststatus = array(
'0' => $langs->trans(
"Unpaid"),
'1' => $langs->trans(
"Paid"));
508 print $form->selectarray(
'search_status', $liststatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
513include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
516$parameters = array(
'arrayfields' => $arrayfields);
517$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
518print $hookmanager->resPrint;
522 print
'<td class="liste_titre center maxwidthsearch">';
523 $searchpicto = $form->showFilterButtons();
529$totalarray = array();
530$totalarray[
'nbfield'] = 0;
534print
'<tr class="liste_titre">';
536 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
537 $totalarray[
'nbfield']++;
541 $totalarray[
'nbfield']++;
543if (!empty($arrayfields[
't.rowid'][
'checked'])) {
545 print_liste_field_titre($arrayfields[
't.rowid'][
'label'], $_SERVER[
'PHP_SELF'],
't.rowid',
'', $param,
'', $sortfield, $sortorder);
546 $totalarray[
'nbfield']++;
548if (!empty($arrayfields[
't.label'][
'checked'])) {
549 print_liste_field_titre($arrayfields[
't.label'][
'label'], $_SERVER[
'PHP_SELF'],
't.label',
'', $param,
'', $sortfield, $sortorder);
550 $totalarray[
'nbfield']++;
552if (!empty($arrayfields[
't.datev'][
'checked'])) {
553 print_liste_field_titre($arrayfields[
't.datev'][
'label'], $_SERVER[
'PHP_SELF'],
't.datev',
'', $param,
'', $sortfield, $sortorder,
'center ');
554 $totalarray[
'nbfield']++;
556if (!empty($arrayfields[
't.fk_typepayment'][
'checked'])) {
557 print_liste_field_titre($arrayfields[
't.fk_typepayment'][
'label'], $_SERVER[
'PHP_SELF'],
't.fk_typepayment',
'', $param,
'', $sortfield, $sortorder,
'left ');
558 $totalarray[
'nbfield']++;
560if (!empty($arrayfields[
't.fk_account'][
'checked'])) {
561 print_liste_field_titre($arrayfields[
't.fk_account'][
'label'], $_SERVER[
'PHP_SELF'],
't.fk_account',
'', $param,
'', $sortfield, $sortorder,
'left ');
562 $totalarray[
'nbfield']++;
564if (!empty($arrayfields[
't.amount'][
'checked'])) {
565 print_liste_field_titre($arrayfields[
't.amount'][
'label'], $_SERVER[
'PHP_SELF'],
't.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
566 $totalarray[
'nbfield']++;
568if (!empty($arrayfields[
't.datec'][
'checked'])) {
569 print_liste_field_titre($arrayfields[
't.datec'][
'label'], $_SERVER[
'PHP_SELF'],
't.datec',
'', $param,
'', $sortfield, $sortorder,
'center ');
570 $totalarray[
'nbfield']++;
572if (!empty($arrayfields[
't.status'][
'checked'])) {
573 print_liste_field_titre($arrayfields[
't.status'][
'label'], $_SERVER[
"PHP_SELF"],
"t.paye",
"", $param,
'class="right"', $sortfield, $sortorder);
574 $totalarray[
'nbfield']++;
577include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
579$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
580$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
581print $hookmanager->resPrint;
585 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
586 $totalarray[
'nbfield']++;
593$savnbfield = $totalarray[
'nbfield'];
594$totalarray = array();
595$totalarray[
'nbfield'] = 0;
596$imaxinloop = ($limit ? min($num, $limit) : $num);
597while ($i < $imaxinloop) {
598 $obj = $db->fetch_object($resql);
603 $tva_static->id = $obj->rowid;
604 $tva_static->ref = $obj->rowid;
605 $tva_static->label = $obj->label;
606 $tva_static->type_payment = $obj->payment_code;
607 $tva_static->datev = $obj->datev;
608 $tva_static->date_creation = $obj->datec;
609 $tva_static->amount = $obj->amount;
610 $tva_static->paye = $obj->status;
611 $tva_static->status = $obj->status;
614 if ($mode ==
'kanban') {
616 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
617 print
'<div class="box-flex-container kanban">';
621 if ($massactionbutton || $massaction) {
623 if (in_array(
$object->id, $arrayofselected)) {
627 print
$object->getKanbanView(
'', array(
'selected' => $selected));
628 if ($i == ($imaxinloop - 1)) {
635 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
638 print
'<td class="nowrap center">';
639 if ($massactionbutton || $massaction) {
641 if (in_array(
$object->id, $arrayofselected)) {
644 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
648 $totalarray[
'nbfield']++;
654 print
'<td>'.(($offset * $limit) + $i).
'</td>';
656 $totalarray[
'nbfield']++;
661 if (!empty($arrayfields[
't.rowid'][
'checked'])) {
663 print $tva_static->getNomUrl(1);
666 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$tva_static->id;
667 print $formfile->getDocumentsLink($tva_static->element, $filename, $filedir,
'',
'valignmiddle paddingleft2imp');
670 $totalarray[
'nbfield']++;
675 if (!empty($arrayfields[
't.label'][
'checked'])) {
676 print
'<td>'.dol_trunc($obj->label, 40).
'</td>';
678 $totalarray[
'nbfield']++;
683 if (!empty($arrayfields[
't.datev'][
'checked'])) {
684 print
'<td class="center">'.dol_print_date($db->jdate($obj->datev),
'day').
'</td>';
686 $totalarray[
'nbfield']++;
700 if (!empty($arrayfields[
't.fk_typepayment'][
'checked'])) {
702 if (!empty($obj->payment_code)) {
703 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
707 $totalarray[
'nbfield']++;
712 if (!empty($arrayfields[
't.fk_account'][
'checked'])) {
714 if ($obj->fk_account > 0) {
715 $bankstatic->id = $obj->fk_account;
716 $bankstatic->ref = $obj->bref;
717 $bankstatic->number = $obj->bnumber;
718 $bankstatic->iban = $obj->iban;
719 $bankstatic->bic = $obj->bic;
720 $bankstatic->currency_code = $langs->trans(
"Currency".$obj->currency_code);
721 $bankstatic->account_number = $obj->account_number;
722 $bankstatic->clos = $obj->clos;
727 $bankstatic->label = $obj->blabel;
728 print $bankstatic->getNomUrl(1);
732 $totalarray[
'nbfield']++;
737 if (!empty($arrayfields[
't.amount'][
'checked'])) {
738 print
'<td class="nowrap right"><span class="amount">' .
price($obj->amount) .
'</span></td>';
740 $totalarray[
'nbfield']++;
742 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'amount';
743 if (empty($totalarray[
'val'][
'amount'])) {
744 $totalarray[
'val'][
'amount'] = $obj->amount;
746 $totalarray[
'val'][
'amount'] += $obj->amount;
750 if (!empty($arrayfields[
't.datec'][
'checked'])) {
751 print
'<td class="center">'.dol_print_date($db->jdate($obj->datec),
'day').
'</td>';
753 $totalarray[
'nbfield']++;
757 if (!empty($arrayfields[
't.status'][
'checked'])) {
758 $totalallpayments = $obj->alreadypayed;
761 print
'<td class="nowrap right">' . $tva_static->getLibStatut(5, $totalallpayments) .
'</td>';
763 $totalarray[
'nbfield']++;
765 if (!empty($arrayfields[
't.amount'][
'checked'])) {
766 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'';
772 print
'<td class="nowrap center">';
773 if ($massactionbutton || $massaction) {
775 if (in_array(
$object->id, $arrayofselected)) {
778 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
782 $totalarray[
'nbfield']++;
793include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
798 foreach ($arrayfields as $key => $val) {
799 if (!empty($val[
'checked'])) {
803 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
808$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
809$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
810print $hookmanager->resPrint;
812print
'</table>'.
"\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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 to manage bank transaction lines.
Class to manage accounting journals.
Class to manage VAT - Value-added tax (also known in French as TVA - Taxe sur la valeur ajoutée)
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_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)
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.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_now($mode='auto')
Return date for now.
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...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
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_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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.
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.