30require
'../../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/tva.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
40$langs->loadLangs(array(
'compta',
'bills'));
42$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
43$massaction =
GETPOST(
'massaction',
'alpha');
44$show_files =
GETPOST(
'show_files',
'int');
45$confirm =
GETPOST(
'confirm',
'alpha');
46$cancel =
GETPOST(
'cancel',
'alpha');
47$toselect =
GETPOST(
'toselect',
'array');
48$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'salestaxeslist';
49$backtopage =
GETPOST(
'backtopage',
'alpha');
50$optioncss =
GETPOST(
'optioncss',
'alpha');
51$optioncss =
GETPOST(
'optioncss',
'aZ');
54$search_ref =
GETPOST(
'search_ref',
'alpha');
55$search_label =
GETPOST(
'search_label',
'alpha');
56$search_dateend_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_dateend_startmonth',
'int'),
GETPOST(
'search_dateend_startday',
'int'),
GETPOST(
'search_dateend_startyear',
'int'));
57$search_dateend_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_dateend_endmonth',
'int'),
GETPOST(
'search_dateend_endday',
'int'),
GETPOST(
'search_dateend_endyear',
'int'));
58$search_datepayment_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_datepayment_startmonth',
'int'),
GETPOST(
'search_datepayment_startday',
'int'),
GETPOST(
'search_datepayment_startyear',
'int'));
59$search_datepayment_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_datepayment_endmonth',
'int'),
GETPOST(
'search_datepayment_endday',
'int'),
GETPOST(
'search_datepayment_endyear',
'int'));
60$search_type =
GETPOST(
'search_type',
'int');
61$search_account =
GETPOST(
'search_account',
'int');
62$search_amount =
GETPOST(
'search_amount',
'alpha');
63$search_status =
GETPOST(
'search_status',
'int');
66$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
67$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
68$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
69$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
'page',
'int');
70if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
74$offset = $limit * $page;
79 $sortfield =
't.datev';
86 't.rowid' =>array(
'checked'=>1,
'position'=>10,
'label'=>
"Ref",),
87 't.label' =>array(
'checked'=>1,
'position'=>20,
'label'=>
"Label"),
88 't.datev' =>array(
'checked'=>1,
'position'=>30,
'label'=>
"PeriodEndDate"),
89 't.fk_typepayment' =>array(
'checked'=>1,
'position'=>50,
'label'=>
"DefaultPaymentMode"),
90 't.amount' =>array(
'checked'=>1,
'position'=>90,
'label'=>
"Amount"),
91 't.status' =>array(
'checked'=>1,
'position'=>90,
'label'=>
"Status"),
94if (isModEnabled(
"banque")) {
95 $arrayfields[
't.fk_account'] = array(
'checked'=>1,
'position'=>60,
'label'=>
"DefaultBankAccount");
101$hookmanager->initHooks(array(
'salestaxeslist'));
102$object =
new Tva($db);
104$permissiontoadd = $user->hasRight(
'tax',
'charges',
'creer');
105$permissiontodelete = $user->hasRight(
'tax',
'charges',
'supprimer');
108$socid =
GETPOST(
'socid',
'int');
110 $socid = $user->socid;
119$parameters = array(
'socid'=>$socid);
120$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
126if (empty($reshook)) {
128 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
130 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
133 $search_dateend_start =
'';
134 $search_dateend_end =
'';
135 $search_datepayment_start =
'';
136 $search_datepayment_end =
'';
138 $search_account =
'';
142 $search_array_options = array();
146 $objectclass =
'Tva';
147 $objectlabel =
'Tva';
148 $uploaddir = $conf->tax->dir_output;
149 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
157$form =
new Form($db);
160$tva_static =
new Tva($db);
167$title = $langs->trans(
"VATDeclarations");
174$sql =
'SELECT t.rowid, t.amount, t.label, t.datev, t.datep, t.paye as status, t.fk_typepayment as type, t.fk_account,';
175$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,';
176$sql.=
' t.num_payment, pst.code as payment_code,';
177$sql .=
' SUM(ptva.amount) as alreadypayed';
181$sql .=
' FROM '.MAIN_DB_PREFIX.
'tva as t';
182$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_paiement as pst ON (t.fk_typepayment = pst.id)';
183$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank_account as ba ON (t.fk_account = ba.rowid)';
184$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"payment_vat as ptva ON (ptva.fk_tva = t.rowid)";
185$sql .=
' WHERE t.entity IN ('.getEntity($object->element).
')';
187if (!empty($search_ref)) {
190if (!empty($search_label)) {
193if (!empty($search_dateend_start)) {
194 $sql .=
" AND t.datev >= '".$db->idate($search_dateend_start).
"'";
196if (!empty($search_dateend_end)) {
197 $sql .=
" AND t.datev <= '".$db->idate($search_dateend_end).
"'";
199if (!empty($search_datepayment_start)) {
200 $sql .=
" AND t.datep >= '".$db->idate($search_datepayment_start).
"'";
202if (!empty($search_datepayment_end)) {
203 $sql .=
" AND t.datep <= '".$db->idate($search_datepayment_end).
"'";
205if (!empty($search_type) && $search_type > 0) {
206 $sql .=
' AND t.fk_typepayment = '.((int) $search_type);
208if (!empty($search_account) && $search_account > 0) {
209 $sql .=
' AND t.fk_account = '.((int) $search_account);
211if (!empty($search_amount)) {
214if ($search_status !=
'' && $search_status >= 0) {
215 $sql .=
" AND t.paye = ".((int) $search_status);
218$sql .=
" GROUP BY t.rowid, t.amount, t.label, t.datev, t.datep, t.paye, t.fk_typepayment, t.fk_account, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, t.num_payment, pst.code";
221$nbtotalofrecords =
'';
224 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
225 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
226 $resql = $db->query($sqlforcount);
228 $objforcount = $db->fetch_object($resql);
229 $nbtotalofrecords = $objforcount->nbtotalofrecords;
234 if (($page * $limit) > $nbtotalofrecords) {
242$sql .= $db->order($sortfield, $sortorder);
244 $sql .= $db->plimit($limit + 1, $offset);
247$resql = $db->query($sql);
253$num = $db->num_rows($resql);
261$arrayofselected = is_array($toselect) ? $toselect : array();
265 $param .=
'&mode='.urlencode($mode);
267if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
268 $param .=
'&contextpage='.urlencode($contextpage);
270if ($limit > 0 && $limit != $conf->liste_limit) {
271 $param .=
'&limit='.((int) $limit);
273if ($optioncss !=
'') {
274 $param .=
'&optioncss='.urlencode($optioncss);
277if (!empty($search_ref)) {
278 $param .=
'&search_ref="'.$search_ref.
'"';
280if (!empty($search_label)) {
281 $param .=
'&search_label="'.$search_label.
'"';
283if (!empty($search_dateend_start)) {
284 $param .=
'&search_dateend_startyear='.GETPOST(
'search_dateend_startyear',
'int');
286if (!empty($search_dateend_start)) {
287 $param .=
'&search_dateend_startmonth='.GETPOST(
'search_dateend_startmonth',
'int');
289if (!empty($search_dateend_start)) {
290 $param .=
'&search_dateend_startday='.GETPOST(
'search_dateend_startday',
'int');
292if (!empty($search_dateend_end)) {
293 $param .=
'&search_dateend_endyear='.GETPOST(
'search_dateend_endyear',
'int');
295if (!empty($search_dateend_end)) {
296 $param .=
'&search_dateend_endmonth='.GETPOST(
'search_dateend_endmonth',
'int');
298if (!empty($search_dateend_end)) {
299 $param .=
'&search_dateend_endday='.GETPOST(
'search_dateend_endday',
'int');
301if (!empty($search_datepayment_start)) {
302 $param .=
'&search_datepayment_startyear='.GETPOST(
'search_datepayment_startyear',
'int');
304if (!empty($search_datepayment_start)) {
305 $param .=
'&search_datepayment_startmonth='.GETPOST(
'search_datepayment_startmonth',
'int');
307if (!empty($search_datepayment_start)) {
308 $param .=
'&search_datepayment_startday='.GETPOST(
'search_datepayment_startday',
'int');
310if (!empty($search_datepayment_end)) {
311 $param .=
'&search_datepayment_endyear='.GETPOST(
'search_datepayment_endyear',
'int');
313if (!empty($search_datepayment_end)) {
314 $param .=
'&search_datepayment_endmonth='.GETPOST(
'search_datepayment_endmonth',
'int');
316if (!empty($search_datepayment_end)) {
317 $param .=
'&search_datepayment_endday='.GETPOST(
'search_datepayment_endday',
'int');
319if (!empty($search_type) && $search_type > 0) {
320 $param .=
'&search_type='.$search_type;
322if (!empty($search_account) && $search_account > 0) {
323 $param .=
'&search_account='.$search_account;
325if (!empty($search_amount)) {
326 $param .=
'&search_amount="'.$search_amount.
'"';
328if ($search_status !=
'' && $search_status !=
'-1') {
329 $param .=
'&search_status='.urlencode($search_status);
333$arrayofmassactions = array(
337if (!empty($permissiontodelete)) {
338 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
340$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
344print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
345if ($optioncss !=
'') {
346 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
348print
'<input type="hidden" name="token" value="'.newToken().
'">';
349print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
350print
'<input type="hidden" name="action" value="list">';
351print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
352print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
353print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
354print
'<input type="hidden" name="page" value="'.$page.
'">';
355print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
356print
'<input type="hidden" name="page_y" value="">';
357print
'<input type="hidden" name="mode" value="'.$mode.
'">';
359$url = DOL_URL_ROOT.
'/compta/tva/card.php?action=create';
361 $url .=
'&socid='.$socid;
364$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'));
365$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'));
367$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewVATPayment'),
'',
'fa fa-plus-circle', $url,
'', $permissiontoadd);
369print_barre_liste($title, $page, $_SERVER[
'PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'title_accountancy', 0, $newcardbutton,
'', $limit, 0, 0, 1);
372$topicmail =
"SendVAT";
374$objecttmp =
new Tva($db);
375$trackid =
'vat'.$object->id;
376include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
378$varpage = empty($contextpage) ? $_SERVER[
'PHP_SELF'] : $contextpage;
379$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
380if ($massactionbutton) {
381 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
386$parameters = array();
387$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
388if (empty($reshook)) {
389 $moreforfilter .= $hookmanager->resPrint;
391 $moreforfilter = $hookmanager->resPrint;
394if (!empty($moreforfilter)) {
395 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
396 print $moreforfilter;
397 $parameters = array();
398 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
399 print $hookmanager->resPrint;
403$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
404$selectedfields = ($mode !=
'kanban' ? $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
'')) :
'');
405$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
407print
'<div class="div-table-responsive">';
408print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
412print
'<tr class="liste_titre_filter">';
415 print
'<td class="liste_titre center maxwidthsearch">';
416 $searchpicto = $form->showFilterButtons(
'left');
422if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
423 print
'<td class="liste_titre">';
428if (!empty($arrayfields[
't.rowid'][
'checked'])) {
429 print
'<td class="liste_titre">';
430 print
'<input type="text" class="flat" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
435if (!empty($arrayfields[
't.label'][
'checked'])) {
436 print
'<td class="liste_titre">';
437 print
'<input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
442if (!empty($arrayfields[
't.datev'][
'checked'])) {
443 print
'<td class="liste_titre center">';
444 print
'<div class="nowrap">';
445 print $form->selectDate($search_dateend_start ? $search_dateend_start : -1,
'search_dateend_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
447 print
'<div class="nowrap">';
448 print $form->selectDate($search_dateend_end ? $search_dateend_end : -1,
'search_dateend_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
466if (!empty($arrayfields[
't.fk_typepayment'][
'checked'])) {
467 print
'<td class="liste_titre left">';
468 print $form->select_types_paiements($search_type,
'search_type',
'', 0, 1, 1, 16, 1,
'', 1);
473if (!empty($arrayfields[
't.fk_account'][
'checked'])) {
474 print
'<td class="liste_titre left">';
475 $form->select_comptes($search_account,
'search_account', 0,
'', 1);
480if (!empty($arrayfields[
't.amount'][
'checked'])) {
481 print
'<td class="liste_titre right">';
482 print
'<input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.
'">';
487if (!empty($arrayfields[
't.status'][
'checked'])) {
488 print
'<td class="liste_titre right parentonrightofpage">';
489 $liststatus = array(
'0' => $langs->trans(
"Unpaid"),
'1' => $langs->trans(
"Paid"));
490 print $form->selectarray(
'search_status', $liststatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
495include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
498$parameters = array(
'arrayfields'=>$arrayfields);
499$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
500print $hookmanager->resPrint;
504 print
'<td class="liste_titre center maxwidthsearch">';
505 $searchpicto = $form->showFilterButtons();
511$totalarray = array();
512$totalarray[
'nbfield'] = 0;
516print
'<tr class="liste_titre">';
518 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
519 $totalarray[
'nbfield']++;
521if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
523 $totalarray[
'nbfield']++;
525if (!empty($arrayfields[
't.rowid'][
'checked'])) {
526 print_liste_field_titre($arrayfields[
't.rowid'][
'label'], $_SERVER[
'PHP_SELF'],
't.rowid',
'', $param,
'', $sortfield, $sortorder);
527 $totalarray[
'nbfield']++;
529if (!empty($arrayfields[
't.label'][
'checked'])) {
530 print_liste_field_titre($arrayfields[
't.label'][
'label'], $_SERVER[
'PHP_SELF'],
't.label',
'', $param,
'align="left"', $sortfield, $sortorder);
531 $totalarray[
'nbfield']++;
533if (!empty($arrayfields[
't.datev'][
'checked'])) {
534 print_liste_field_titre($arrayfields[
't.datev'][
'label'], $_SERVER[
'PHP_SELF'],
't.datev',
'', $param,
'align="center"', $sortfield, $sortorder);
535 $totalarray[
'nbfield']++;
537if (!empty($arrayfields[
't.fk_typepayment'][
'checked'])) {
538 print_liste_field_titre($arrayfields[
't.fk_typepayment'][
'label'], $_SERVER[
'PHP_SELF'],
't.fk_typepayment',
'', $param,
'', $sortfield, $sortorder,
'left ');
539 $totalarray[
'nbfield']++;
541if (!empty($arrayfields[
't.fk_account'][
'checked'])) {
542 print_liste_field_titre($arrayfields[
't.fk_account'][
'label'], $_SERVER[
'PHP_SELF'],
't.fk_account',
'', $param,
'', $sortfield, $sortorder,
'left ');
543 $totalarray[
'nbfield']++;
545if (!empty($arrayfields[
't.amount'][
'checked'])) {
546 print_liste_field_titre($arrayfields[
't.amount'][
'label'], $_SERVER[
'PHP_SELF'],
't.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
547 $totalarray[
'nbfield']++;
549if (!empty($arrayfields[
't.status'][
'checked'])) {
550 print_liste_field_titre($arrayfields[
't.status'][
'label'], $_SERVER[
"PHP_SELF"],
"t.paye",
"", $param,
'class="right"', $sortfield, $sortorder);
551 $totalarray[
'nbfield']++;
554include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
556$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
557$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
558print $hookmanager->resPrint;
562 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
563 $totalarray[
'nbfield']++;
570$savnbfield = $totalarray[
'nbfield'];
571$totalarray = array();
572$totalarray[
'nbfield'] = 0;
573$imaxinloop = ($limit ? min($num, $limit) : $num);
574while ($i < $imaxinloop) {
575 $obj = $db->fetch_object($resql);
580 $tva_static->id = $obj->rowid;
581 $tva_static->ref = $obj->rowid;
582 $tva_static->label = $obj->label;
583 $tva_static->type_payment = $obj->payment_code;
584 $tva_static->datev = $obj->datev;
585 $tva_static->amount = $obj->amount;
586 $tva_static->paye = $obj->status;
587 $tva_static->status = $obj->status;
588 $object = $tva_static;
590 if ($mode ==
'kanban') {
592 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
593 print
'<div class="box-flex-container kanban">';
596 if ($massactionbutton || $massaction) {
598 if (in_array($object->id, $arrayofselected)) {
602 print $object->getKanbanView(
'', array(
'selected' => in_array($object->id, $arrayofselected)));
603 if ($i == ($imaxinloop - 1)) {
610 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
613 print
'<td class="nowrap center">';
614 if ($massactionbutton || $massaction) {
616 if (in_array($object->id, $arrayofselected)) {
619 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
623 $totalarray[
'nbfield']++;
628 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
629 print
'<td>'.(($offset * $limit) + $i).
'</td>';
631 $totalarray[
'nbfield']++;
636 if (!empty($arrayfields[
't.rowid'][
'checked'])) {
638 print $tva_static->getNomUrl(1);
641 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$tva_static->id;
642 print $formfile->getDocumentsLink($tva_static->element, $filename, $filedir,
'',
'valignmiddle paddingleft2imp');
645 $totalarray[
'nbfield']++;
650 if (!empty($arrayfields[
't.label'][
'checked'])) {
651 print
'<td>'.dol_trunc($obj->label, 40).
'</td>';
653 $totalarray[
'nbfield']++;
658 if (!empty($arrayfields[
't.datev'][
'checked'])) {
659 print
'<td class="center">'.dol_print_date($db->jdate($obj->datev),
'day').
'</td>';
661 $totalarray[
'nbfield']++;
675 if (!empty($arrayfields[
't.fk_typepayment'][
'checked'])) {
677 if (!empty($obj->payment_code)) print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
680 $totalarray[
'nbfield']++;
685 if (!empty($arrayfields[
't.fk_account'][
'checked'])) {
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[
't.amount'][
'checked'])) {
709 print
'<td class="nowrap right"><span class="amount">' .
price($obj->amount) .
'</span></td>';
711 $totalarray[
'nbfield']++;
713 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'amount';
714 if (empty($totalarray[
'val'][
'amount'])) {
715 $totalarray[
'val'][
'amount'] = $obj->amount;
717 $totalarray[
'val'][
'amount'] += $obj->amount;
721 if (!empty($arrayfields[
't.status'][
'checked'])) {
722 $totalallpayments = $obj->alreadypayed;
723 print
'<td class="nowrap right">' . $tva_static->getLibStatut(5, $totalallpayments) .
'</td>';
725 $totalarray[
'nbfield']++;
727 if (!empty($arrayfields[
't.amount'][
'checked'])) {
728 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'';
734 print
'<td class="nowrap center">';
735 if ($massactionbutton || $massaction) {
737 if (in_array($object->id, $arrayofselected)) {
740 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
744 $totalarray[
'nbfield']++;
755include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
760 foreach ($arrayfields as $key => $val) {
761 if (!empty($val[
'checked'])) {
765 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
770$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
771$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
772print $hookmanager->resPrint;
774print
'</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.
Class to manage bank transaction lines.
Class to manage accounting accounts.
Put here description of your class.
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...
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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...
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 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.
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.
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.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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.