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')) {
210 if (
GETPOST(
'cancel',
'alpha')) {
214 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'preunletteringauto' && $massaction !=
'preunletteringmanual' && $massaction !=
'predeletebookkeepingwriting') {
218 $parameters = array(
'socid'=>$socid);
219 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
224 if (empty($reshook)) {
225 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
227 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
228 $search_doc_date =
'';
229 $search_accountancy_code =
'';
230 $search_accountancy_code_start =
'';
231 $search_accountancy_code_end =
'';
232 $search_label_account =
'';
233 $search_doc_ref =
'';
234 $search_label_operation =
'';
235 $search_mvt_num =
'';
236 $search_direction =
'';
237 $search_ledger_code = array();
238 $search_date_start =
'';
239 $search_date_end =
'';
240 $search_date_startyear =
'';
241 $search_date_startmonth =
'';
242 $search_date_startday =
'';
243 $search_date_endyear =
'';
244 $search_date_endmonth =
'';
245 $search_date_endday =
'';
246 $search_date_export_start =
'';
247 $search_date_export_end =
'';
248 $search_date_export_startyear =
'';
249 $search_date_export_startmonth =
'';
250 $search_date_export_startday =
'';
251 $search_date_export_endyear =
'';
252 $search_date_export_endmonth =
'';
253 $search_date_export_endday =
'';
254 $search_date_validation_start =
'';
255 $search_date_validation_end =
'';
256 $search_date_validation_startyear =
'';
257 $search_date_validation_startmonth =
'';
258 $search_date_validation_startday =
'';
259 $search_date_validation_endyear =
'';
260 $search_date_validation_endmonth =
'';
261 $search_date_validation_endday =
'';
264 $search_lettering_code =
'';
265 $search_not_reconciled =
'';
266 $search_import_key =
'';
273 if (!empty($search_date_start)) {
274 $filter[
't.doc_date>='] = $search_date_start;
275 $param .=
'&search_date_startmonth='.$search_date_startmonth.
'&search_date_startday='.$search_date_startday.
'&search_date_startyear='.$search_date_startyear;
277 if (!empty($search_date_end)) {
278 $filter[
't.doc_date<='] = $search_date_end;
279 $param .=
'&search_date_endmonth='.$search_date_endmonth.
'&search_date_endday='.$search_date_endday.
'&search_date_endyear='.$search_date_endyear;
281 if (!empty($search_doc_date)) {
282 $filter[
't.doc_date'] = $search_doc_date;
283 $param .=
'&doc_datemonth='.GETPOST(
'doc_datemonth',
'int').
'&doc_dateday='.
GETPOST(
'doc_dateday',
'int').
'&doc_dateyear='.
GETPOST(
'doc_dateyear',
'int');
285 if (!empty($search_accountancy_code_start)) {
286 if ($type ==
'sub') {
287 $filter[
't.subledger_account>='] = $search_accountancy_code_start;
289 $filter[
't.numero_compte>='] = $search_accountancy_code_start;
291 $param .=
'&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
293 if (!empty($search_accountancy_code_end)) {
294 if ($type ==
'sub') {
295 $filter[
't.subledger_account<='] = $search_accountancy_code_end;
297 $filter[
't.numero_compte<='] = $search_accountancy_code_end;
299 $param .=
'&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
301 if (!empty($search_label_account)) {
302 $filter[
't.label_compte'] = $search_label_account;
303 $param .=
'&search_label_compte='.urlencode($search_label_account);
305 if (!empty($search_mvt_num)) {
306 $filter[
't.piece_num'] = $search_mvt_num;
307 $param .=
'&search_mvt_num='.urlencode($search_mvt_num);
309 if (!empty($search_doc_ref)) {
310 $filter[
't.doc_ref'] = $search_doc_ref;
311 $param .=
'&search_doc_ref='.urlencode($search_doc_ref);
313 if (!empty($search_label_operation)) {
314 $filter[
't.label_operation'] = $search_label_operation;
315 $param .=
'&search_label_operation='.urlencode($search_label_operation);
317 if (!empty($search_direction)) {
318 $filter[
't.sens'] = $search_direction;
319 $param .=
'&search_direction='.urlencode($search_direction);
321 if (!empty($search_ledger_code)) {
322 $filter[
't.code_journal'] = $search_ledger_code;
323 foreach ($search_ledger_code as $code) {
324 $param .=
'&search_ledger_code[]='.urlencode($code);
327 if (!empty($search_debit)) {
328 $filter[
't.debit'] = $search_debit;
329 $param .=
'&search_debit='.urlencode($search_debit);
331 if (!empty($search_credit)) {
332 $filter[
't.credit'] = $search_credit;
333 $param .=
'&search_credit='.urlencode($search_credit);
335 if (!empty($search_lettering_code)) {
336 $filter[
't.lettering_code'] = $search_lettering_code;
337 $param .=
'&search_lettering_code='.urlencode($search_lettering_code);
339 if (!empty($search_not_reconciled)) {
340 $filter[
't.reconciled_option'] = $search_not_reconciled;
341 $param .=
'&search_not_reconciled='.urlencode($search_not_reconciled);
343 if (!empty($search_date_export_start)) {
344 $filter[
't.date_export>='] = $search_date_export_start;
345 $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;
347 if (!empty($search_date_export_end)) {
348 $filter[
't.date_export<='] = $search_date_export_end;
349 $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;
351 if (!empty($search_date_validation_start)) {
352 $filter[
't.date_validated>='] = $search_date_validation_start;
353 $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;
355 if (!empty($search_date_validation_end)) {
356 $filter[
't.date_validated<='] = $search_date_validation_end;
357 $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;
359 if (!empty($search_import_key)) {
360 $filter[
't.import_key'] = $search_import_key;
361 $param .=
'&search_import_key='.urlencode($search_import_key);
365 $url_param = substr($param, 1);
367 $param =
'&type='.$type.$param;
398 $objectclass =
'Bookkeeping';
399 $objectlabel =
'Bookkeeping';
400 $permissiontoread = $user->hasRight(
'societe',
'lire');
401 $permissiontodelete = $user->hasRight(
'societe',
'supprimer');
402 $permissiontoadd = $user->rights->societe->creer;
403 $uploaddir = $conf->societe->dir_output;
404 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
406 if (!$error && $action ==
'deletebookkeepingwriting' && $confirm ==
"yes" && $user->hasRight(
'accounting',
'mouvements',
'supprimer')) {
411 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect,
true);
412 if ($nb_lettering < 0) {
420 foreach ($toselect as $toselectid) {
421 $result = $object->fetch($toselectid);
422 if ($result > 0 && (!isset($object->date_validation) || $object->date_validation ===
'')) {
423 $result = $object->deleteMvtNum($object->piece_num);
431 } elseif ($result < 0) {
435 } elseif (isset($object->date_validation) && $object->date_validation !=
'') {
436 setEventMessages($langs->trans(
"ValidatedRecordWhereFound"),
null,
'errors');
449 } elseif ($nbok > 0) {
455 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?noreset=1".($param ?
'&'.$param :
''));
463 if (!$error &&
getDolGlobalInt(
'ACCOUNTING_ENABLE_LETTERING') && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
464 if ($massaction ==
'letteringauto') {
466 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect);
467 if ($nb_lettering < 0) {
470 $nb_lettering = max(0, abs($nb_lettering) - 2);
471 } elseif ($nb_lettering == 0) {
473 setEventMessages($langs->trans(
'AccountancyNoLetteringModified'), array(),
'mesgs');
475 if ($nb_lettering == 1) {
476 setEventMessages($langs->trans(
'AccountancyOneLetteringModifiedSuccessfully'), array(),
'mesgs');
477 } elseif ($nb_lettering > 1) {
478 setEventMessages($langs->trans(
'AccountancyLetteringModifiedSuccessfully', $nb_lettering), array(),
'mesgs');
482 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
485 } elseif ($massaction ==
'letteringmanual') {
487 $result = $lettering->updateLettering($toselect);
491 setEventMessages($langs->trans(
'AccountancyOneLetteringModifiedSuccessfully'), array(),
'mesgs');
492 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
495 } elseif ($action ==
'unletteringauto' && $confirm ==
"yes") {
497 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect,
true);
498 if ($nb_lettering < 0) {
501 $nb_lettering = max(0, abs($nb_lettering) - 2);
502 } elseif ($nb_lettering == 0) {
504 setEventMessages($langs->trans(
'AccountancyNoUnletteringModified'), array(),
'mesgs');
506 if ($nb_lettering == 1) {
507 setEventMessages($langs->trans(
'AccountancyOneUnletteringModifiedSuccessfully'), array(),
'mesgs');
508 } elseif ($nb_lettering > 1) {
509 setEventMessages($langs->trans(
'AccountancyUnletteringModifiedSuccessfully', $nb_lettering), array(),
'mesgs');
513 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
516 } elseif ($action ==
'unletteringmanual' && $confirm ==
"yes") {
518 $nb_lettering = $lettering->deleteLettering($toselect);
522 setEventMessages($langs->trans(
'AccountancyOneUnletteringModifiedSuccessfully'), array(),
'mesgs');
523 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
540 $title_page = $langs->trans(
"Operations").
' - '.$langs->trans(
"VueByAccountAccounting").
' (';
541 if ($type ==
'sub') {
542 $title_page .= $langs->trans(
"BookkeepingSubAccount");
544 $title_page .= $langs->trans(
"Bookkeeping");
552 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
553 if ($type ==
'sub') {
554 $nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter,
'AND', 1);
556 $nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
564 if ($type ==
'sub') {
565 $result = $object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter,
'AND', 1);
567 $result = $object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter);
574 $arrayofselected = is_array($toselect) ? $toselect : array();
576 $num = count($object->lines);
624 $arrayofmassactions = array();
625 if (
getDolGlobalInt(
'ACCOUNTING_ENABLE_LETTERING') && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
626 $arrayofmassactions[
'letteringauto'] =
img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'LetteringAuto');
627 $arrayofmassactions[
'preunletteringauto'] =
img_picto(
'',
'uncheck',
'class="pictofixedwidth"') . $langs->trans(
'UnletteringAuto');
628 $arrayofmassactions[
'letteringmanual'] =
img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'LetteringManual');
629 $arrayofmassactions[
'preunletteringmanual'] =
img_picto(
'',
'uncheck',
'class="pictofixedwidth"') . $langs->trans(
'UnletteringManual');
631 if ($user->hasRight(
'accounting',
'mouvements',
'supprimer')) {
632 $arrayofmassactions[
'predeletebookkeepingwriting'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
634 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'preunletteringauto',
'preunletteringmanual',
'predeletebookkeepingwriting'))) {
635 $arrayofmassactions = array();
637 $massactionbutton =
$form->selectMassAction($massaction, $arrayofmassactions);
639 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
640 print
'<input type="hidden" name="token" value="'.newToken().
'">';
641 print
'<input type="hidden" name="action" value="list">';
642 if ($optioncss !=
'') {
643 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
645 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
646 print
'<input type="hidden" name="type" value="'.$type.
'">';
647 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
648 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
649 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
651 $parameters = array(
'param' => $param);
652 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtonsList', $parameters, $object, $action);
657 $newcardbutton = empty($hookmanager->resPrint) ?
'' : $hookmanager->resPrint;
659 if (empty($reshook)) {
660 $newcardbutton =
dolGetButtonTitle($langs->trans(
'ViewFlatList'),
'',
'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.
'/accountancy/bookkeeping/list.php?'.$param);
661 if ($type ==
'sub') {
662 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly'));
663 $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'));
665 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly btnTitleSelected'));
666 $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'));
668 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewAccountingMvt'),
'',
'fa fa-plus-circle paddingleft', DOL_URL_ROOT.
'/accountancy/bookkeeping/card.php?action=create');
671 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
672 $param .=
'&contextpage='.urlencode($contextpage);
674 if ($limit > 0 && $limit != $conf->liste_limit) {
675 $param .=
'&limit='.urlencode($limit);
678 print_barre_liste($title_page, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $result,
$nbtotalofrecords,
'title_accountancy', 0, $newcardbutton,
'', $limit, 0, 0, 1);
680 if ($massaction ==
'preunletteringauto') {
681 print
$form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassUnletteringAuto"), $langs->trans(
"ConfirmMassUnletteringQuestion", count($toselect)),
"unletteringauto",
null,
'', 0, 200, 500, 1);
682 } elseif ($massaction ==
'preunletteringmanual') {
683 print
$form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassUnletteringManual"), $langs->trans(
"ConfirmMassUnletteringQuestion", count($toselect)),
"unletteringmanual",
null,
'', 0, 200, 500, 1);
684 } elseif ($massaction ==
'predeletebookkeepingwriting') {
685 print
$form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassDeleteBookkeepingWriting"), $langs->trans(
"ConfirmMassDeleteBookkeepingWritingQuestion", count($toselect)),
"deletebookkeepingwriting",
null,
'', 0, 200, 500, 1);
698 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
700 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
701 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
702 if ($massactionbutton && $contextpage !=
'poslist') {
703 $selectedfields .=
$form->showCheckAddButtons(
'checkforselect', 1);
707 if (preg_match(
'/^asc/i', $sortorder)) {
714 if ($type ==
'sub') {
715 print
info_admin($langs->trans(
"WarningRecordWithoutSubledgerAreExcluded"));
721 $moreforfilter .=
'<div class="divsearchfield">';
722 $moreforfilter .= $langs->trans(
'AccountAccounting').
': ';
723 $moreforfilter .=
'<div class="nowrap inline-block">';
724 if ($type ==
'sub') {
725 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'),
'maxwidth200');
727 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'), array(), 1, 1,
'maxwidth200');
729 $moreforfilter .=
' ';
730 if ($type ==
'sub') {
731 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'),
'maxwidth200');
733 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'), array(), 1, 1,
'maxwidth200');
735 $moreforfilter .=
'</div>';
736 $moreforfilter .=
'</div>';
738 $parameters = array();
739 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
740 if (empty($reshook)) {
741 $moreforfilter .= $hookmanager->resPrint;
743 $moreforfilter = $hookmanager->resPrint;
746 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
747 print $moreforfilter;
750 print
'<div class="div-table-responsive">';
751 print
'<table class="tagtable liste centpercent">';
754 print
'<tr class="liste_titre_filter">';
757 print
'<td class="liste_titre center">';
758 $searchpicto =
$form->showFilterButtons(
'left');
763 if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
764 print
'<td class="liste_titre"><input type="text" name="search_mvt_num" class="width50" value="'.dol_escape_htmltag($search_mvt_num).
'"></td>';
767 if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
768 print
'<td class="liste_titre center">';
769 print $formaccounting->multi_select_journal($search_ledger_code,
'search_ledger_code', 0, 1, 1, 1,
'maxwidth75');
773 if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
774 print
'<td class="liste_titre center">';
775 print
'<div class="nowrap">';
776 print
$form->selectDate($search_date_start,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
778 print
'<div class="nowrap">';
779 print
$form->selectDate($search_date_end,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
784 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
785 print
'<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).
'"/></td>';
788 if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
789 print
'<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="'.dol_escape_htmltag($search_label_operation).
'"/></td>';
792 if (!empty($arrayfields[
't.debit'][
'checked'])) {
793 print
'<td class="liste_titre right"><input type="text" class="flat" name="search_debit" size="4" value="'.dol_escape_htmltag($search_debit).
'"></td>';
796 if (!empty($arrayfields[
't.credit'][
'checked'])) {
797 print
'<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).
'"></td>';
800 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
801 print
'<td class="liste_titre center">';
802 print
'<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.
'"/>';
803 print
'<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled ==
'notreconciled' ?
' checked' :
'').
'>'.$langs->trans(
"NotReconciled").
'</span>';
807 if (!empty($arrayfields[
't.date_export'][
'checked'])) {
808 print
'<td class="liste_titre center">';
809 print
'<div class="nowrap">';
810 print
$form->selectDate($search_date_export_start,
'search_date_export_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
812 print
'<div class="nowrap">';
813 print
$form->selectDate($search_date_export_end,
'search_date_export_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
818 if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
819 print
'<td class="liste_titre center">';
820 print
'<div class="nowrap">';
821 print
$form->selectDate($search_date_validation_start,
'search_date_validation_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
823 print
'<div class="nowrap">';
824 print
$form->selectDate($search_date_validation_end,
'search_date_validation_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
828 if (!empty($arrayfields[
't.import_key'][
'checked'])) {
829 print
'<td class="liste_titre center">';
830 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
835 $parameters = array(
'arrayfields'=>$arrayfields);
836 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
837 print $hookmanager->resPrint;
841 print
'<td class="liste_titre center">';
842 $searchpicto =
$form->showFilterButtons();
848 print
'<tr class="liste_titre">';
850 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
852 if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
853 print_liste_field_titre($arrayfields[
't.piece_num'][
'label'], $_SERVER[
'PHP_SELF'],
"t.piece_num",
"", $param,
'', $sortfield, $sortorder,
'tdoverflowmax80imp ');
855 if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
856 print_liste_field_titre($arrayfields[
't.code_journal'][
'label'], $_SERVER[
'PHP_SELF'],
"t.code_journal",
"", $param,
'', $sortfield, $sortorder,
'center ');
858 if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
859 print_liste_field_titre($arrayfields[
't.doc_date'][
'label'], $_SERVER[
'PHP_SELF'],
"t.doc_date",
"", $param,
'', $sortfield, $sortorder,
'center ');
861 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
862 print_liste_field_titre($arrayfields[
't.doc_ref'][
'label'], $_SERVER[
'PHP_SELF'],
"t.doc_ref",
"", $param,
"", $sortfield, $sortorder);
864 if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
865 print_liste_field_titre($arrayfields[
't.label_operation'][
'label'], $_SERVER[
'PHP_SELF'],
"t.label_operation",
"", $param,
"", $sortfield, $sortorder);
867 if (!empty($arrayfields[
't.debit'][
'checked'])) {
868 print_liste_field_titre($arrayfields[
't.debit'][
'label'], $_SERVER[
'PHP_SELF'],
"t.debit",
"", $param,
'', $sortfield, $sortorder,
'right ');
870 if (!empty($arrayfields[
't.credit'][
'checked'])) {
871 print_liste_field_titre($arrayfields[
't.credit'][
'label'], $_SERVER[
'PHP_SELF'],
"t.credit",
"", $param,
'', $sortfield, $sortorder,
'right ');
873 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
874 print_liste_field_titre($arrayfields[
't.lettering_code'][
'label'], $_SERVER[
'PHP_SELF'],
"t.lettering_code",
"", $param,
'', $sortfield, $sortorder,
'center ');
876 if (!empty($arrayfields[
't.date_export'][
'checked'])) {
877 print_liste_field_titre($arrayfields[
't.date_export'][
'label'], $_SERVER[
'PHP_SELF'],
"t.date_export",
"", $param,
'', $sortfield, $sortorder,
'center ');
879 if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
880 print_liste_field_titre($arrayfields[
't.date_validated'][
'label'], $_SERVER[
'PHP_SELF'],
"t.date_validated",
"", $param,
'', $sortfield, $sortorder,
'center ');
882 if (!empty($arrayfields[
't.import_key'][
'checked'])) {
883 print_liste_field_titre($arrayfields[
't.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"t.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
886 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
887 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
888 print $hookmanager->resPrint;
890 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
894 $displayed_account_number =
null;
900 $totalarray = array();
901 $totalarray[
'val'] = array ();
902 $totalarray[
'nbfield'] = 0;
905 $sous_total_debit = 0;
906 $sous_total_credit = 0;
907 $totalarray[
'val'][
'totaldebit'] = 0;
908 $totalarray[
'val'][
'totalcredit'] = 0;
910 while ($i < min($num, $limit)) {
911 $line = $object->lines[$i];
913 $total_debit += $line->debit;
914 $total_credit += $line->credit;
916 if ($type ==
'sub') {
925 if (!empty($arrayfields[
't.piece_num'][
'checked'])) { $colspan++; }
926 if (!empty($arrayfields[
't.code_journal'][
'checked'])) { $colspan++; }
927 if (!empty($arrayfields[
't.doc_date'][
'checked'])) { $colspan++; }
928 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) { $colspan++; }
929 if (!empty($arrayfields[
't.label_operation'][
'checked'])) { $colspan++; }
930 if (!empty($arrayfields[
't.date_export'][
'checked'])) { $colspanend++; }
931 if (!empty($arrayfields[
't.date_validating'][
'checked'])) { $colspanend++; }
932 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) { $colspanend++; }
935 if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
937 if (isset($displayed_account_number)) {
938 print
'<tr class="liste_total">';
939 if ($type ==
'sub') {
940 print
'<td class="right" colspan="' . $colspan .
'">' . $langs->trans(
"TotalForAccount") .
' ' .
length_accounta($displayed_account_number) .
':</td>';
942 print
'<td class="right" colspan="' . $colspan .
'">' . $langs->trans(
"TotalForAccount") .
' ' .
length_accountg($displayed_account_number) .
':</td>';
944 print
'<td class="nowrap right">'.price($sous_total_debit).
'</td>';
945 print
'<td class="nowrap right">'.price($sous_total_credit).
'</td>';
946 print
'<td colspan="'.$colspanend.
'"></td>';
949 $balance = $sous_total_debit - $sous_total_credit;
950 print
'<tr class="liste_total">';
951 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"Balance").
':</td>';
953 print
'<td class="nowraponall right">';
954 print
price($sous_total_debit - $sous_total_credit);
959 print
'<td class="nowraponall right">';
960 print
price($sous_total_credit - $sous_total_debit);
963 print
'<td colspan="'.$colspanend.
'"></td>';
968 print
'<tr class="trforbreak">';
969 print
'<td colspan="'.($totalarray[
'nbfield'] ? $totalarray[
'nbfield'] : count($arrayfields)+1).
'" class="tdforbreak">';
970 if ($type ==
'sub') {
971 if ($line->subledger_account !=
"" && $line->subledger_account !=
'-1') {
972 print $line->subledger_label .
' : ' .
length_accounta($line->subledger_account);
975 print
'<span class="error">' . $langs->trans(
"Unknown");
976 if ($line->subledger_label) {
977 print
' (' . $line->subledger_label .
')';
978 $htmltext =
'EmptyStringForSubledgerAccountButSubledgerLabelDefined';
980 $htmltext =
'EmptyStringForSubledgerAccountAndSubledgerLabel';
982 print
$form->textwithpicto(
'', $htmltext);
986 if ($line->numero_compte !=
"" && $line->numero_compte !=
'-1') {
987 print
length_accountg($line->numero_compte) .
' : ' . $object->get_compte_desc($line->numero_compte);
989 print
'<span class="error">' . $langs->trans(
"Unknown") .
'</span>';
995 $displayed_account_number = $accountg;
997 $sous_total_debit = 0;
998 $sous_total_credit = 0;
1003 print
'<tr class="oddeven">';
1006 print
'<td class="nowraponall center">';
1007 if (($massactionbutton || $massaction) && $contextpage !=
'poslist') {
1009 if (in_array($line->id, $arrayofselected)) {
1012 print
'<input id="cb' . $line->id .
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id .
'"' . ($selected ?
' checked="checked"' :
'') .
' />';
1017 if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
1019 $object->id = $line->id;
1020 $object->piece_num = $line->piece_num;
1021 print $object->getNomUrl(1,
'', 0,
'', 1);
1024 $totalarray[
'nbfield']++;
1029 if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
1031 $result = $accountingjournal->fetch(
'', $line->code_journal);
1032 $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0,
'', 0) : $line->code_journal);
1033 print
'<td class="center tdoverflowmax80">'.$journaltoshow.
'</td>';
1035 $totalarray[
'nbfield']++;
1040 if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
1041 print
'<td class="center">'.dol_print_date($line->doc_date,
'day').
'</td>';
1043 $totalarray[
'nbfield']++;
1048 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
1049 if ($line->doc_type ==
'customer_invoice') {
1050 $langs->loadLangs(array(
'bills'));
1052 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1053 $objectstatic =
new Facture($db);
1054 $objectstatic->fetch($line->fk_doc);
1059 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$objectstatic->id;
1060 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1061 } elseif ($line->doc_type ==
'supplier_invoice') {
1062 $langs->loadLangs(array(
'bills'));
1064 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1066 $objectstatic->fetch($line->fk_doc);
1070 $filedir = $conf->fournisseur->facture->dir_output.
'/'.
get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
1071 $subdir =
get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
1072 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
1073 } elseif ($line->doc_type ==
'expense_report') {
1074 $langs->loadLangs(array(
'trips'));
1076 require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
1078 $objectstatic->fetch($line->fk_doc);
1083 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$objectstatic->id;
1084 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1085 } elseif ($line->doc_type ==
'bank') {
1086 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1088 $objectstatic->fetch($line->fk_doc);
1093 print
'<td class="maxwidth400">';
1095 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1097 print
'<td class="nobordernopadding">';
1099 if ($line->doc_type ==
'customer_invoice' || $line->doc_type ==
'supplier_invoice' || $line->doc_type ==
'expense_report') {
1100 print $objectstatic->getNomUrl(1,
'', 0, 0,
'', 0, -1, 1);
1101 print $documentlink;
1102 } elseif ($line->doc_type ==
'bank') {
1103 print $objectstatic->getNomUrl(1);
1104 $bank_ref = strstr($line->doc_ref,
'-');
1105 print
" " . $bank_ref;
1107 print $line->doc_ref;
1109 print
'</td></tr></table>';
1113 $totalarray[
'nbfield']++;
1118 if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
1120 $doc_ref = preg_replace(
'/\(.*\)/',
'', $line->doc_ref);
1121 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>';
1123 $totalarray[
'nbfield']++;
1128 if (!empty($arrayfields[
't.debit'][
'checked'])) {
1129 print
'<td class="right nowraponall amount">'.($line->debit != 0 ?
price($line->debit) :
'').
'</td>';
1131 $totalarray[
'nbfield']++;
1134 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totaldebit';
1136 $totalarray[
'val'][
'totaldebit'] += $line->debit;
1140 if (!empty($arrayfields[
't.credit'][
'checked'])) {
1141 print
'<td class="right nowraponall amount">'.($line->credit != 0 ?
price($line->credit) :
'').
'</td>';
1143 $totalarray[
'nbfield']++;
1146 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalcredit';
1148 $totalarray[
'val'][
'totalcredit'] += $line->credit;
1152 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1153 print
'<td class="center">'.$line->lettering_code.
'</td>';
1155 $totalarray[
'nbfield']++;
1160 if (!empty($arrayfields[
't.date_export'][
'checked'])) {
1161 print
'<td class="center">'.dol_print_date($line->date_export,
'dayhour').
'</td>';
1163 $totalarray[
'nbfield']++;
1168 if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
1169 print
'<td class="center">'.dol_print_date($line->date_validation,
'dayhour').
'</td>';
1171 $totalarray[
'nbfield']++;
1175 if (!empty($arrayfields[
't.import_key'][
'checked'])) {
1176 print
'<td class="tdoverflowmax100">'.$line->import_key.
"</td>\n";
1178 $totalarray[
'nbfield']++;
1183 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$line);
1184 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1185 print $hookmanager->resPrint;
1189 print
'<td class="nowraponall center">';
1190 if (($massactionbutton || $massaction) && $contextpage !=
'poslist') {
1192 if (in_array($line->id, $arrayofselected)) {
1195 print
'<input id="cb' . $line->id .
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id .
'"' . ($selected ?
' checked="checked"' :
'') .
' />';
1200 $totalarray[
'nbfield']++;
1204 $sous_total_debit += $line->debit;
1205 $sous_total_credit += $line->credit;
1212 if ($num > 0 && $colspan > 0) {
1213 print
'<tr class="liste_total">';
1214 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"TotalForAccount").
' '.$accountg.
':</td>';
1215 print
'<td class="nowrap right">'.price($sous_total_debit).
'</td>';
1216 print
'<td class="nowrap right">'.price($sous_total_credit).
'</td>';
1217 print
'<td colspan="'.$colspanend.
'"></td>';
1220 $balance = $sous_total_debit - $sous_total_credit;
1221 print
'<tr class="liste_total">';
1222 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"Balance").
':</td>';
1224 print
'<td class="nowraponall right">';
1225 print
price($sous_total_debit - $sous_total_credit);
1230 print
'<td class="nowraponall right">';
1231 print
price($sous_total_credit - $sous_total_debit);
1234 print
'<td colspan="'.$colspanend.
'"></td>';
1239 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1244 foreach ($arrayfields as $key => $val) {
1245 if (!empty($val[
'checked'])) {
1249 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1252 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
1253 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1254 print $hookmanager->resPrint;
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous)
length_accounta($accounta)
Return Auxiliary accounting account of thirdparties with defined length.
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 transaction lines.
Class to manage accounting accounts.
Class to manage Ledger (General Ledger and Subledger)
Class to manage Trips and Expenses.
Class to manage suppliers invoices.
Class to manage invoices.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
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...
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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)
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
$formconfirm
if ($action == 'delbookkeepingyear') {
$nbtotalofrecords
Count total nb of records.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.