29 require
'../../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/lettering.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
41 $langs->loadLangs(array(
"accountancy",
"compta"));
43 $action =
GETPOST(
'action',
'aZ09');
44 $socid =
GETPOST(
'socid',
'int');
45 $massaction =
GETPOST(
'massaction',
'alpha');
46 $confirm =
GETPOST(
'confirm',
'alpha');
47 $toselect =
GETPOST(
'toselect',
'array');
48 $type =
GETPOST(
'type',
'alpha');
50 $context_default =
'bookkeepingbysubaccountlist';
52 $context_default =
'bookkeepingbyaccountlist';
54 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : $context_default;
55 $search_date_startyear =
GETPOST(
'search_date_startyear',
'int');
56 $search_date_startmonth =
GETPOST(
'search_date_startmonth',
'int');
57 $search_date_startday =
GETPOST(
'search_date_startday',
'int');
58 $search_date_endyear =
GETPOST(
'search_date_endyear',
'int');
59 $search_date_endmonth =
GETPOST(
'search_date_endmonth',
'int');
60 $search_date_endday =
GETPOST(
'search_date_endday',
'int');
61 $search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
62 $search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
64 $search_date_export_startyear =
GETPOST(
'search_date_export_startyear',
'int');
65 $search_date_export_startmonth =
GETPOST(
'search_date_export_startmonth',
'int');
66 $search_date_export_startday =
GETPOST(
'search_date_export_startday',
'int');
67 $search_date_export_endyear =
GETPOST(
'search_date_export_endyear',
'int');
68 $search_date_export_endmonth =
GETPOST(
'search_date_export_endmonth',
'int');
69 $search_date_export_endday =
GETPOST(
'search_date_export_endday',
'int');
70 $search_date_export_start =
dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
71 $search_date_export_end =
dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
72 $search_date_validation_startyear =
GETPOST(
'search_date_validation_startyear',
'int');
73 $search_date_validation_startmonth =
GETPOST(
'search_date_validation_startmonth',
'int');
74 $search_date_validation_startday =
GETPOST(
'search_date_validation_startday',
'int');
75 $search_date_validation_endyear =
GETPOST(
'search_date_validation_endyear',
'int');
76 $search_date_validation_endmonth =
GETPOST(
'search_date_validation_endmonth',
'int');
77 $search_date_validation_endday =
GETPOST(
'search_date_validation_endday',
'int');
78 $search_date_validation_start =
dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
79 $search_date_validation_end =
dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
80 $search_import_key =
GETPOST(
"search_import_key",
'alpha');
82 $search_accountancy_code =
GETPOST(
"search_accountancy_code");
83 $search_accountancy_code_start =
GETPOST(
'search_accountancy_code_start',
'alpha');
84 if ($search_accountancy_code_start == - 1) {
85 $search_accountancy_code_start =
'';
87 $search_accountancy_code_end =
GETPOST(
'search_accountancy_code_end',
'alpha');
88 if ($search_accountancy_code_end == - 1) {
89 $search_accountancy_code_end =
'';
91 $search_doc_ref =
GETPOST(
'search_doc_ref',
'alpha');
92 $search_label_operation =
GETPOST(
'search_label_operation',
'alpha');
93 $search_mvt_num =
GETPOST(
'search_mvt_num',
'int');
94 $search_direction =
GETPOST(
'search_direction',
'alpha');
95 $search_ledger_code =
GETPOST(
'search_ledger_code',
'array');
96 $search_debit =
GETPOST(
'search_debit',
'alpha');
97 $search_credit =
GETPOST(
'search_credit',
'alpha');
98 $search_lettering_code =
GETPOST(
'search_lettering_code',
'alpha');
99 $search_not_reconciled =
GETPOST(
'search_not_reconciled',
'alpha');
102 $action =
'delbookkeepingyear';
106 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
107 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
108 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
109 $optioncss =
GETPOST(
'optioncss',
'alpha');
111 if (empty($page) || $page < 0) {
114 $offset = $limit * $page;
115 $pageprev = $page - 1;
116 $pagenext = $page + 1;
117 if ($sortorder ==
"") {
120 if ($sortfield ==
"") {
121 $sortfield =
"t.doc_date,t.rowid";
127 $hookmanager->initHooks(array($context_default));
132 if (empty($search_date_start) && empty($search_date_end) && !
GETPOSTISSET(
'search_date_startday') && !
GETPOSTISSET(
'search_date_startmonth') && !
GETPOSTISSET(
'search_date_starthour')) {
133 $sql =
"SELECT date_start, date_end from ".MAIN_DB_PREFIX.
"accounting_fiscalyear ";
134 $sql .=
" where date_start < '".$db->idate(
dol_now()).
"' and date_end > '".$db->idate(
dol_now()).
"'";
135 $sql .= $db->plimit(1);
136 $res = $db->query($sql);
138 if ($res->num_rows > 0) {
139 $fiscalYear = $db->fetch_object($res);
140 $search_date_start = strtotime($fiscalYear->date_start);
141 $search_date_end = strtotime($fiscalYear->date_end);
143 $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
148 $year_end = $year_start + 1;
149 $month_end = $month_start - 1;
150 if ($month_end < 1) {
154 $search_date_start =
dol_mktime(0, 0, 0, $month_start, 1, $year_start);
159 $arrayfields = array(
161 't.piece_num'=>array(
'label'=>$langs->trans(
"TransactionNumShort"),
'checked'=>1),
162 't.code_journal'=>array(
'label'=>$langs->trans(
"Codejournal"),
'checked'=>1),
163 't.doc_date'=>array(
'label'=>$langs->trans(
"Docdate"),
'checked'=>1),
164 't.doc_ref'=>array(
'label'=>$langs->trans(
"Piece"),
'checked'=>1),
165 't.label_operation'=>array(
'label'=>$langs->trans(
"Label"),
'checked'=>1),
166 't.debit'=>array(
'label'=>$langs->trans(
"AccountingDebit"),
'checked'=>1),
167 't.credit'=>array(
'label'=>$langs->trans(
"AccountingCredit"),
'checked'=>1),
168 't.lettering_code'=>array(
'label'=>$langs->trans(
"LetteringCode"),
'checked'=>1),
169 't.date_export'=>array(
'label'=>$langs->trans(
"DateExport"),
'checked'=>1),
170 't.date_validated'=>array(
'label'=>$langs->trans(
"DateValidation"),
'checked'=>1,
'enabled'=>!
getDolGlobalString(
"ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")),
171 't.import_key'=>array(
'label'=>$langs->trans(
"ImportId"),
'checked'=>0,
'position'=>1100),
174 if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
175 unset($arrayfields[
't.lettering_code']);
178 if ($search_date_start && empty($search_date_startyear)) {
180 $search_date_startyear = $tmparray[
'year'];
181 $search_date_startmonth = $tmparray[
'mon'];
182 $search_date_startday = $tmparray[
'mday'];
184 if ($search_date_end && empty($search_date_endyear)) {
186 $search_date_endyear = $tmparray[
'year'];
187 $search_date_endmonth = $tmparray[
'mon'];
188 $search_date_endday = $tmparray[
'mday'];
194 if ($user->socid > 0) {
197 if (!$user->hasRight(
'accounting',
'mouvements',
'lire')) {
208 if (
GETPOST(
'cancel',
'alpha')) {
212 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'preunletteringauto' && $massaction !=
'preunletteringmanual' && $massaction !=
'predeletebookkeepingwriting') {
216 $parameters = array(
'socid'=>$socid);
217 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
222 if (empty($reshook)) {
223 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
225 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
226 $search_doc_date =
'';
227 $search_accountancy_code =
'';
228 $search_accountancy_code_start =
'';
229 $search_accountancy_code_end =
'';
230 $search_label_account =
'';
231 $search_doc_ref =
'';
232 $search_label_operation =
'';
233 $search_mvt_num =
'';
234 $search_direction =
'';
235 $search_ledger_code = array();
236 $search_date_start =
'';
237 $search_date_end =
'';
238 $search_date_startyear =
'';
239 $search_date_startmonth =
'';
240 $search_date_startday =
'';
241 $search_date_endyear =
'';
242 $search_date_endmonth =
'';
243 $search_date_endday =
'';
244 $search_date_export_start =
'';
245 $search_date_export_end =
'';
246 $search_date_export_startyear =
'';
247 $search_date_export_startmonth =
'';
248 $search_date_export_startday =
'';
249 $search_date_export_endyear =
'';
250 $search_date_export_endmonth =
'';
251 $search_date_export_endday =
'';
252 $search_date_validation_start =
'';
253 $search_date_validation_end =
'';
254 $search_date_validation_startyear =
'';
255 $search_date_validation_startmonth =
'';
256 $search_date_validation_startday =
'';
257 $search_date_validation_endyear =
'';
258 $search_date_validation_endmonth =
'';
259 $search_date_validation_endday =
'';
262 $search_lettering_code =
'';
263 $search_not_reconciled =
'';
264 $search_import_key =
'';
271 if (!empty($search_date_start)) {
272 $filter[
't.doc_date>='] = $search_date_start;
273 $param .=
'&search_date_startmonth='.$search_date_startmonth.
'&search_date_startday='.$search_date_startday.
'&search_date_startyear='.$search_date_startyear;
275 if (!empty($search_date_end)) {
276 $filter[
't.doc_date<='] = $search_date_end;
277 $param .=
'&search_date_endmonth='.$search_date_endmonth.
'&search_date_endday='.$search_date_endday.
'&search_date_endyear='.$search_date_endyear;
279 if (!empty($search_doc_date)) {
280 $filter[
't.doc_date'] = $search_doc_date;
281 $param .=
'&doc_datemonth='.GETPOST(
'doc_datemonth',
'int').
'&doc_dateday='.
GETPOST(
'doc_dateday',
'int').
'&doc_dateyear='.
GETPOST(
'doc_dateyear',
'int');
283 if (!empty($search_accountancy_code_start)) {
284 if ($type ==
'sub') {
285 $filter[
't.subledger_account>='] = $search_accountancy_code_start;
287 $filter[
't.numero_compte>='] = $search_accountancy_code_start;
289 $param .=
'&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
291 if (!empty($search_accountancy_code_end)) {
292 if ($type ==
'sub') {
293 $filter[
't.subledger_account<='] = $search_accountancy_code_end;
295 $filter[
't.numero_compte<='] = $search_accountancy_code_end;
297 $param .=
'&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
299 if (!empty($search_label_account)) {
300 $filter[
't.label_compte'] = $search_label_account;
301 $param .=
'&search_label_compte='.urlencode($search_label_account);
303 if (!empty($search_mvt_num)) {
304 $filter[
't.piece_num'] = $search_mvt_num;
305 $param .=
'&search_mvt_num='.urlencode($search_mvt_num);
307 if (!empty($search_doc_ref)) {
308 $filter[
't.doc_ref'] = $search_doc_ref;
309 $param .=
'&search_doc_ref='.urlencode($search_doc_ref);
311 if (!empty($search_label_operation)) {
312 $filter[
't.label_operation'] = $search_label_operation;
313 $param .=
'&search_label_operation='.urlencode($search_label_operation);
315 if (!empty($search_direction)) {
316 $filter[
't.sens'] = $search_direction;
317 $param .=
'&search_direction='.urlencode($search_direction);
319 if (!empty($search_ledger_code)) {
320 $filter[
't.code_journal'] = $search_ledger_code;
321 foreach ($search_ledger_code as $code) {
322 $param .=
'&search_ledger_code[]='.urlencode($code);
325 if (!empty($search_debit)) {
326 $filter[
't.debit'] = $search_debit;
327 $param .=
'&search_debit='.urlencode($search_debit);
329 if (!empty($search_credit)) {
330 $filter[
't.credit'] = $search_credit;
331 $param .=
'&search_credit='.urlencode($search_credit);
333 if (!empty($search_lettering_code)) {
334 $filter[
't.lettering_code'] = $search_lettering_code;
335 $param .=
'&search_lettering_code='.urlencode($search_lettering_code);
337 if (!empty($search_not_reconciled)) {
338 $filter[
't.reconciled_option'] = $search_not_reconciled;
339 $param .=
'&search_not_reconciled='.urlencode($search_not_reconciled);
341 if (!empty($search_date_export_start)) {
342 $filter[
't.date_export>='] = $search_date_export_start;
343 $param .=
'&search_date_export_startmonth='.$search_date_export_startmonth.
'&search_date_export_startday='.$search_date_export_startday.
'&search_date_export_startyear='.$search_date_export_startyear;
345 if (!empty($search_date_export_end)) {
346 $filter[
't.date_export<='] = $search_date_export_end;
347 $param .=
'&search_date_export_endmonth='.$search_date_export_endmonth.
'&search_date_export_endday='.$search_date_export_endday.
'&search_date_export_endyear='.$search_date_export_endyear;
349 if (!empty($search_date_validation_start)) {
350 $filter[
't.date_validated>='] = $search_date_validation_start;
351 $param .=
'&search_date_validation_startmonth='.$search_date_validation_startmonth.
'&search_date_validation_startday='.$search_date_validation_startday.
'&search_date_validation_startyear='.$search_date_validation_startyear;
353 if (!empty($search_date_validation_end)) {
354 $filter[
't.date_validated<='] = $search_date_validation_end;
355 $param .=
'&search_date_validation_endmonth='.$search_date_validation_endmonth.
'&search_date_validation_endday='.$search_date_validation_endday.
'&search_date_validation_endyear='.$search_date_validation_endyear;
357 if (!empty($search_import_key)) {
358 $filter[
't.import_key'] = $search_import_key;
359 $param .=
'&search_import_key='.urlencode($search_import_key);
363 $url_param = substr($param, 1);
365 $param =
'&type='.$type.$param;
396 $objectclass =
'Bookkeeping';
397 $objectlabel =
'Bookkeeping';
398 $permissiontoread = $user->hasRight(
'societe',
'lire');
399 $permissiontodelete = $user->hasRight(
'societe',
'supprimer');
400 $permissiontoadd = $user->rights->societe->creer;
401 $uploaddir = $conf->societe->dir_output;
402 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
404 if (!$error && $action ==
'deletebookkeepingwriting' && $confirm ==
"yes" && $user->hasRight(
'accounting',
'mouvements',
'supprimer')) {
409 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect,
true);
410 if ($nb_lettering < 0) {
418 foreach ($toselect as $toselectid) {
419 $result = $object->fetch($toselectid);
420 if ($result > 0 && (!isset($object->date_validation) || $object->date_validation ===
'')) {
421 $result = $object->deleteMvtNum($object->piece_num);
429 } elseif ($result < 0) {
443 } elseif ($nbok > 0) {
449 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?noreset=1".($param ?
'&'.$param :
''));
457 if (!$error &&
getDolGlobalInt(
'ACCOUNTING_ENABLE_LETTERING') && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
458 if ($massaction ==
'letteringauto') {
460 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect);
461 if ($nb_lettering < 0) {
464 $nb_lettering = max(0, abs($nb_lettering) - 2);
465 } elseif ($nb_lettering == 0) {
467 setEventMessages($langs->trans(
'AccountancyNoLetteringModified'), array(),
'mesgs');
469 if ($nb_lettering == 1) {
470 setEventMessages($langs->trans(
'AccountancyOneLetteringModifiedSuccessfully'), array(),
'mesgs');
471 } elseif ($nb_lettering > 1) {
472 setEventMessages($langs->trans(
'AccountancyLetteringModifiedSuccessfully', $nb_lettering), array(),
'mesgs');
476 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
479 } elseif ($massaction ==
'letteringmanual') {
481 $result = $lettering->updateLettering($toselect);
485 setEventMessages($langs->trans(
'AccountancyOneLetteringModifiedSuccessfully'), array(),
'mesgs');
486 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
489 } elseif ($action ==
'unletteringauto' && $confirm ==
"yes") {
491 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect,
true);
492 if ($nb_lettering < 0) {
495 $nb_lettering = max(0, abs($nb_lettering) - 2);
496 } elseif ($nb_lettering == 0) {
498 setEventMessages($langs->trans(
'AccountancyNoUnletteringModified'), array(),
'mesgs');
500 if ($nb_lettering == 1) {
501 setEventMessages($langs->trans(
'AccountancyOneUnletteringModifiedSuccessfully'), array(),
'mesgs');
502 } elseif ($nb_lettering > 1) {
503 setEventMessages($langs->trans(
'AccountancyUnletteringModifiedSuccessfully', $nb_lettering), array(),
'mesgs');
507 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
510 } elseif ($action ==
'unletteringmanual' && $confirm ==
"yes") {
512 $nb_lettering = $lettering->deleteLettering($toselect);
516 setEventMessages($langs->trans(
'AccountancyOneUnletteringModifiedSuccessfully'), array(),
'mesgs');
517 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
534 $title_page = $langs->trans(
"Operations").
' - '.$langs->trans(
"VueByAccountAccounting").
' (';
535 if ($type ==
'sub') {
536 $title_page .= $langs->trans(
"BookkeepingSubAccount");
538 $title_page .= $langs->trans(
"Bookkeeping");
546 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
547 if ($type ==
'sub') {
548 $nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter,
'AND', 1);
550 $nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
558 if ($type ==
'sub') {
559 $result = $object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter,
'AND', 1);
561 $result = $object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter);
568 $arrayofselected = is_array($toselect) ? $toselect : array();
570 $num = count($object->lines);
618 $arrayofmassactions = array();
619 if (
getDolGlobalInt(
'ACCOUNTING_ENABLE_LETTERING') && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
620 $arrayofmassactions[
'letteringauto'] =
img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'LetteringAuto');
621 $arrayofmassactions[
'preunletteringauto'] =
img_picto(
'',
'uncheck',
'class="pictofixedwidth"') . $langs->trans(
'UnletteringAuto');
622 $arrayofmassactions[
'letteringmanual'] =
img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'LetteringManual');
623 $arrayofmassactions[
'preunletteringmanual'] =
img_picto(
'',
'uncheck',
'class="pictofixedwidth"') . $langs->trans(
'UnletteringManual');
625 if ($user->hasRight(
'accounting',
'mouvements',
'supprimer')) {
626 $arrayofmassactions[
'predeletebookkeepingwriting'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
628 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'preunletteringauto',
'preunletteringmanual',
'predeletebookkeepingwriting'))) {
629 $arrayofmassactions = array();
631 $massactionbutton =
$form->selectMassAction($massaction, $arrayofmassactions);
633 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
634 print
'<input type="hidden" name="token" value="'.newToken().
'">';
635 print
'<input type="hidden" name="action" value="list">';
636 if ($optioncss !=
'') {
637 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
639 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
640 print
'<input type="hidden" name="type" value="'.$type.
'">';
641 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
642 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
643 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
645 $parameters = array(
'param' => $param);
646 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtonsList', $parameters, $object, $action);
651 $newcardbutton = empty($hookmanager->resPrint) ?
'' : $hookmanager->resPrint;
653 if (empty($reshook)) {
654 $newcardbutton =
dolGetButtonTitle($langs->trans(
'ViewFlatList'),
'',
'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.
'/accountancy/bookkeeping/list.php?'.$param);
655 if ($type ==
'sub') {
656 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly'));
657 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupBySubAccountAccounting'),
'',
'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly btnTitleSelected'));
659 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly btnTitleSelected'));
660 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupBySubAccountAccounting'),
'',
'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly'));
662 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewAccountingMvt'),
'',
'fa fa-plus-circle paddingleft', DOL_URL_ROOT.
'/accountancy/bookkeeping/card.php?action=create');
665 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
666 $param .=
'&contextpage='.urlencode($contextpage);
668 if ($limit > 0 && $limit != $conf->liste_limit) {
669 $param .=
'&limit='.urlencode($limit);
672 print_barre_liste($title_page, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $result,
$nbtotalofrecords,
'title_accountancy', 0, $newcardbutton,
'', $limit, 0, 0, 1);
674 if ($massaction ==
'preunletteringauto') {
675 print
$form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassUnletteringAuto"), $langs->trans(
"ConfirmMassUnletteringQuestion", count($toselect)),
"unletteringauto",
null,
'', 0, 200, 500, 1);
676 } elseif ($massaction ==
'preunletteringmanual') {
677 print
$form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassUnletteringManual"), $langs->trans(
"ConfirmMassUnletteringQuestion", count($toselect)),
"unletteringmanual",
null,
'', 0, 200, 500, 1);
678 } elseif ($massaction ==
'predeletebookkeepingwriting') {
679 print
$form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassDeleteBookkeepingWriting"), $langs->trans(
"ConfirmMassDeleteBookkeepingWritingQuestion", count($toselect)),
"deletebookkeepingwriting",
null,
'', 0, 200, 500, 1);
692 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
694 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
695 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
696 if ($massactionbutton && $contextpage !=
'poslist') {
697 $selectedfields .=
$form->showCheckAddButtons(
'checkforselect', 1);
701 if (preg_match(
'/^asc/i', $sortorder)) {
708 if ($type ==
'sub') {
709 print
info_admin($langs->trans(
"WarningRecordWithoutSubledgerAreExcluded"));
715 $moreforfilter .=
'<div class="divsearchfield">';
716 $moreforfilter .= $langs->trans(
'AccountAccounting').
': ';
717 $moreforfilter .=
'<div class="nowrap inline-block">';
718 if ($type ==
'sub') {
719 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'),
'maxwidth200');
721 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'), array(), 1, 1,
'maxwidth200');
723 $moreforfilter .=
' ';
724 if ($type ==
'sub') {
725 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'),
'maxwidth200');
727 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'), array(), 1, 1,
'maxwidth200');
729 $moreforfilter .=
'</div>';
730 $moreforfilter .=
'</div>';
732 $parameters = array();
733 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
734 if (empty($reshook)) {
735 $moreforfilter .= $hookmanager->resPrint;
737 $moreforfilter = $hookmanager->resPrint;
740 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
741 print $moreforfilter;
744 print
'<div class="div-table-responsive">';
745 print
'<table class="tagtable liste centpercent">';
748 print
'<tr class="liste_titre_filter">';
751 print
'<td class="liste_titre center">';
752 $searchpicto =
$form->showFilterButtons(
'left');
757 if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
758 print
'<td class="liste_titre"><input type="text" name="search_mvt_num" class="width50" value="'.dol_escape_htmltag($search_mvt_num).
'"></td>';
761 if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
762 print
'<td class="liste_titre center">';
763 print $formaccounting->multi_select_journal($search_ledger_code,
'search_ledger_code', 0, 1, 1, 1,
'maxwidth75');
767 if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
768 print
'<td class="liste_titre center">';
769 print
'<div class="nowrap">';
770 print
$form->selectDate($search_date_start,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
772 print
'<div class="nowrap">';
773 print
$form->selectDate($search_date_end,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
778 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
779 print
'<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).
'"/></td>';
782 if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
783 print
'<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="'.dol_escape_htmltag($search_label_operation).
'"/></td>';
786 if (!empty($arrayfields[
't.debit'][
'checked'])) {
787 print
'<td class="liste_titre right"><input type="text" class="flat" name="search_debit" size="4" value="'.dol_escape_htmltag($search_debit).
'"></td>';
790 if (!empty($arrayfields[
't.credit'][
'checked'])) {
791 print
'<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).
'"></td>';
794 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
795 print
'<td class="liste_titre center">';
796 print
'<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.
'"/>';
797 print
'<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled ==
'notreconciled' ?
' checked' :
'').
'>'.$langs->trans(
"NotReconciled").
'</span>';
801 if (!empty($arrayfields[
't.date_export'][
'checked'])) {
802 print
'<td class="liste_titre center">';
803 print
'<div class="nowrap">';
804 print
$form->selectDate($search_date_export_start,
'search_date_export_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
806 print
'<div class="nowrap">';
807 print
$form->selectDate($search_date_export_end,
'search_date_export_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
812 if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
813 print
'<td class="liste_titre center">';
814 print
'<div class="nowrap">';
815 print
$form->selectDate($search_date_validation_start,
'search_date_validation_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
817 print
'<div class="nowrap">';
818 print
$form->selectDate($search_date_validation_end,
'search_date_validation_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
822 if (!empty($arrayfields[
't.import_key'][
'checked'])) {
823 print
'<td class="liste_titre center">';
824 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
829 $parameters = array(
'arrayfields'=>$arrayfields);
830 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
831 print $hookmanager->resPrint;
835 print
'<td class="liste_titre center">';
836 $searchpicto =
$form->showFilterButtons();
842 print
'<tr class="liste_titre">';
844 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
846 if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
847 print_liste_field_titre($arrayfields[
't.piece_num'][
'label'], $_SERVER[
'PHP_SELF'],
"t.piece_num",
"", $param,
'', $sortfield, $sortorder,
'tdoverflowmax80imp ');
849 if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
850 print_liste_field_titre($arrayfields[
't.code_journal'][
'label'], $_SERVER[
'PHP_SELF'],
"t.code_journal",
"", $param,
'', $sortfield, $sortorder,
'center ');
852 if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
853 print_liste_field_titre($arrayfields[
't.doc_date'][
'label'], $_SERVER[
'PHP_SELF'],
"t.doc_date",
"", $param,
'', $sortfield, $sortorder,
'center ');
855 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
856 print_liste_field_titre($arrayfields[
't.doc_ref'][
'label'], $_SERVER[
'PHP_SELF'],
"t.doc_ref",
"", $param,
"", $sortfield, $sortorder);
858 if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
859 print_liste_field_titre($arrayfields[
't.label_operation'][
'label'], $_SERVER[
'PHP_SELF'],
"t.label_operation",
"", $param,
"", $sortfield, $sortorder);
861 if (!empty($arrayfields[
't.debit'][
'checked'])) {
862 print_liste_field_titre($arrayfields[
't.debit'][
'label'], $_SERVER[
'PHP_SELF'],
"t.debit",
"", $param,
'', $sortfield, $sortorder,
'right ');
864 if (!empty($arrayfields[
't.credit'][
'checked'])) {
865 print_liste_field_titre($arrayfields[
't.credit'][
'label'], $_SERVER[
'PHP_SELF'],
"t.credit",
"", $param,
'', $sortfield, $sortorder,
'right ');
867 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
868 print_liste_field_titre($arrayfields[
't.lettering_code'][
'label'], $_SERVER[
'PHP_SELF'],
"t.lettering_code",
"", $param,
'', $sortfield, $sortorder,
'center ');
870 if (!empty($arrayfields[
't.date_export'][
'checked'])) {
871 print_liste_field_titre($arrayfields[
't.date_export'][
'label'], $_SERVER[
'PHP_SELF'],
"t.date_export",
"", $param,
'', $sortfield, $sortorder,
'center ');
873 if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
874 print_liste_field_titre($arrayfields[
't.date_validated'][
'label'], $_SERVER[
'PHP_SELF'],
"t.date_validated",
"", $param,
'', $sortfield, $sortorder,
'center ');
876 if (!empty($arrayfields[
't.import_key'][
'checked'])) {
877 print_liste_field_titre($arrayfields[
't.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"t.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
880 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
881 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
882 print $hookmanager->resPrint;
884 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
888 $displayed_account_number =
null;
894 $totalarray = array();
895 $totalarray[
'val'] = array ();
896 $totalarray[
'nbfield'] = 0;
899 $sous_total_debit = 0;
900 $sous_total_credit = 0;
901 $totalarray[
'val'][
'totaldebit'] = 0;
902 $totalarray[
'val'][
'totalcredit'] = 0;
904 while ($i < min($num, $limit)) {
905 $line = $object->lines[$i];
907 $total_debit += $line->debit;
908 $total_credit += $line->credit;
910 if ($type ==
'sub') {
919 if (!empty($arrayfields[
't.piece_num'][
'checked'])) { $colspan++; }
920 if (!empty($arrayfields[
't.code_journal'][
'checked'])) { $colspan++; }
921 if (!empty($arrayfields[
't.doc_date'][
'checked'])) { $colspan++; }
922 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) { $colspan++; }
923 if (!empty($arrayfields[
't.label_operation'][
'checked'])) { $colspan++; }
924 if (!empty($arrayfields[
't.date_export'][
'checked'])) { $colspanend++; }
925 if (!empty($arrayfields[
't.date_validating'][
'checked'])) { $colspanend++; }
926 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) { $colspanend++; }
929 if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
931 if (isset($displayed_account_number)) {
932 print
'<tr class="liste_total">';
933 if ($type ==
'sub') {
934 print
'<td class="right" colspan="' . $colspan .
'">' . $langs->trans(
"TotalForAccount") .
' ' .
length_accounta($displayed_account_number) .
':</td>';
936 print
'<td class="right" colspan="' . $colspan .
'">' . $langs->trans(
"TotalForAccount") .
' ' .
length_accountg($displayed_account_number) .
':</td>';
938 print
'<td class="nowrap right">'.price($sous_total_debit).
'</td>';
939 print
'<td class="nowrap right">'.price($sous_total_credit).
'</td>';
940 print
'<td colspan="'.$colspanend.
'"></td>';
943 $balance = $sous_total_debit - $sous_total_credit;
944 print
'<tr class="liste_total">';
945 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"Balance").
':</td>';
947 print
'<td class="nowraponall right">';
948 print
price($sous_total_debit - $sous_total_credit);
953 print
'<td class="nowraponall right">';
954 print
price($sous_total_credit - $sous_total_debit);
957 print
'<td colspan="'.$colspanend.
'"></td>';
962 print
'<tr class="trforbreak">';
963 print
'<td colspan="'.($totalarray[
'nbfield'] ? $totalarray[
'nbfield'] : count($arrayfields)+1).
'" class="tdforbreak">';
964 if ($type ==
'sub') {
965 if ($line->subledger_account !=
"" && $line->subledger_account !=
'-1') {
966 print $line->subledger_label .
' : ' .
length_accounta($line->subledger_account);
969 print
'<span class="error">' . $langs->trans(
"Unknown");
970 if ($line->subledger_label) {
971 print
' (' . $line->subledger_label .
')';
972 $htmltext =
'EmptyStringForSubledgerAccountButSubledgerLabelDefined';
974 $htmltext =
'EmptyStringForSubledgerAccountAndSubledgerLabel';
976 print
$form->textwithpicto(
'', $htmltext);
980 if ($line->numero_compte !=
"" && $line->numero_compte !=
'-1') {
981 print
length_accountg($line->numero_compte) .
' : ' . $object->get_compte_desc($line->numero_compte);
983 print
'<span class="error">' . $langs->trans(
"Unknown") .
'</span>';
989 $displayed_account_number = $accountg;
991 $sous_total_debit = 0;
992 $sous_total_credit = 0;
997 print
'<tr class="oddeven">';
1000 print
'<td class="nowraponall center">';
1001 if (($massactionbutton || $massaction) && $contextpage !=
'poslist') {
1003 if (in_array($line->id, $arrayofselected)) {
1006 print
'<input id="cb' . $line->id .
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id .
'"' . ($selected ?
' checked="checked"' :
'') .
' />';
1011 if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
1013 $object->id = $line->id;
1014 $object->piece_num = $line->piece_num;
1015 print $object->getNomUrl(1,
'', 0,
'', 1);
1018 $totalarray[
'nbfield']++;
1023 if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
1025 $result = $accountingjournal->fetch(
'', $line->code_journal);
1026 $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0,
'', 0) : $line->code_journal);
1027 print
'<td class="center tdoverflowmax80">'.$journaltoshow.
'</td>';
1029 $totalarray[
'nbfield']++;
1034 if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
1035 print
'<td class="center">'.dol_print_date($line->doc_date,
'day').
'</td>';
1037 $totalarray[
'nbfield']++;
1042 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
1043 if ($line->doc_type ==
'customer_invoice') {
1044 $langs->loadLangs(array(
'bills'));
1046 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1047 $objectstatic =
new Facture($db);
1048 $objectstatic->fetch($line->fk_doc);
1053 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$objectstatic->id;
1054 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1055 } elseif ($line->doc_type ==
'supplier_invoice') {
1056 $langs->loadLangs(array(
'bills'));
1058 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1060 $objectstatic->fetch($line->fk_doc);
1064 $filedir = $conf->fournisseur->facture->dir_output.
'/'.
get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
1065 $subdir =
get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
1066 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
1067 } elseif ($line->doc_type ==
'expense_report') {
1068 $langs->loadLangs(array(
'trips'));
1070 require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
1072 $objectstatic->fetch($line->fk_doc);
1077 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$objectstatic->id;
1078 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1079 } elseif ($line->doc_type ==
'bank') {
1080 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1082 $objectstatic->fetch($line->fk_doc);
1087 print
'<td class="maxwidth400">';
1089 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1091 print
'<td class="nobordernopadding">';
1093 if ($line->doc_type ==
'customer_invoice' || $line->doc_type ==
'supplier_invoice' || $line->doc_type ==
'expense_report') {
1094 print $objectstatic->getNomUrl(1,
'', 0, 0,
'', 0, -1, 1);
1095 print $documentlink;
1096 } elseif ($line->doc_type ==
'bank') {
1097 print $objectstatic->getNomUrl(1);
1098 $bank_ref = strstr($line->doc_ref,
'-');
1099 print
" " . $bank_ref;
1101 print $line->doc_ref;
1103 print
'</td></tr></table>';
1107 $totalarray[
'nbfield']++;
1112 if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
1114 $doc_ref = preg_replace(
'/\(.*\)/',
'', $line->doc_ref);
1115 print strlen(
length_accounta($line->subledger_account)) == 0 ?
'<td>'.$line->label_operation.
'</td>' :
'<td>'.$line->label_operation.
'<br><span style="font-size:0.8em">('.
length_accounta($line->subledger_account).
')</span></td>';
1117 $totalarray[
'nbfield']++;
1122 if (!empty($arrayfields[
't.debit'][
'checked'])) {
1123 print
'<td class="right nowraponall amount">'.($line->debit != 0 ?
price($line->debit) :
'').
'</td>';
1125 $totalarray[
'nbfield']++;
1128 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totaldebit';
1130 $totalarray[
'val'][
'totaldebit'] += $line->debit;
1134 if (!empty($arrayfields[
't.credit'][
'checked'])) {
1135 print
'<td class="right nowraponall amount">'.($line->credit != 0 ?
price($line->credit) :
'').
'</td>';
1137 $totalarray[
'nbfield']++;
1140 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalcredit';
1142 $totalarray[
'val'][
'totalcredit'] += $line->credit;
1146 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1147 print
'<td class="center">'.$line->lettering_code.
'</td>';
1149 $totalarray[
'nbfield']++;
1154 if (!empty($arrayfields[
't.date_export'][
'checked'])) {
1155 print
'<td class="center">'.dol_print_date($line->date_export,
'dayhour').
'</td>';
1157 $totalarray[
'nbfield']++;
1162 if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
1163 print
'<td class="center">'.dol_print_date($line->date_validation,
'dayhour').
'</td>';
1165 $totalarray[
'nbfield']++;
1169 if (!empty($arrayfields[
't.import_key'][
'checked'])) {
1170 print
'<td class="tdoverflowmax100">'.$line->import_key.
"</td>\n";
1172 $totalarray[
'nbfield']++;
1177 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$line);
1178 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1179 print $hookmanager->resPrint;
1183 print
'<td class="nowraponall center">';
1184 if (($massactionbutton || $massaction) && $contextpage !=
'poslist') {
1186 if (in_array($line->id, $arrayofselected)) {
1189 print
'<input id="cb' . $line->id .
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id .
'"' . ($selected ?
' checked="checked"' :
'') .
' />';
1194 $totalarray[
'nbfield']++;
1198 $sous_total_debit += $line->debit;
1199 $sous_total_credit += $line->credit;
1206 if ($num > 0 && $colspan > 0) {
1207 print
'<tr class="liste_total">';
1208 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"TotalForAccount").
' '.$accountg.
':</td>';
1209 print
'<td class="nowrap right">'.price($sous_total_debit).
'</td>';
1210 print
'<td class="nowrap right">'.price($sous_total_credit).
'</td>';
1211 print
'<td colspan="'.$colspanend.
'"></td>';
1214 $balance = $sous_total_debit - $sous_total_credit;
1215 print
'<tr class="liste_total">';
1216 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"Balance").
':</td>';
1218 print
'<td class="nowraponall right">';
1219 print
price($sous_total_debit - $sous_total_credit);
1224 print
'<td class="nowraponall right">';
1225 print
price($sous_total_credit - $sous_total_debit);
1228 print
'<td colspan="'.$colspanend.
'"></td>';
1233 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1238 foreach ($arrayfields as $key => $val) {
1239 if (!empty($val[
'checked'])) {
1243 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1246 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
1247 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1248 print $hookmanager->resPrint;