30require
'../../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/lettering.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
42$langs->loadLangs(array(
"accountancy",
"compta"));
44$action =
GETPOST(
'action',
'aZ09');
46$massaction =
GETPOST(
'massaction',
'alpha');
47$confirm =
GETPOST(
'confirm',
'alpha');
48$toselect =
GETPOST(
'toselect',
'array');
49$type =
GETPOST(
'type',
'alpha');
51 $context_default =
'bookkeepingbysubaccountlist';
53 $context_default =
'bookkeepingbyaccountlist';
55$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : $context_default;
56$search_date_startyear =
GETPOSTINT(
'search_date_startyear');
57$search_date_startmonth =
GETPOSTINT(
'search_date_startmonth');
58$search_date_startday =
GETPOSTINT(
'search_date_startday');
59$search_date_endyear =
GETPOSTINT(
'search_date_endyear');
60$search_date_endmonth =
GETPOSTINT(
'search_date_endmonth');
61$search_date_endday =
GETPOSTINT(
'search_date_endday');
62$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
63$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
65$search_date_export_startyear =
GETPOSTINT(
'search_date_export_startyear');
66$search_date_export_startmonth =
GETPOSTINT(
'search_date_export_startmonth');
67$search_date_export_startday =
GETPOSTINT(
'search_date_export_startday');
68$search_date_export_endyear =
GETPOSTINT(
'search_date_export_endyear');
69$search_date_export_endmonth =
GETPOSTINT(
'search_date_export_endmonth');
70$search_date_export_endday =
GETPOSTINT(
'search_date_export_endday');
71$search_date_export_start =
dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
72$search_date_export_end =
dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
73$search_date_validation_startyear =
GETPOSTINT(
'search_date_validation_startyear');
74$search_date_validation_startmonth =
GETPOSTINT(
'search_date_validation_startmonth');
75$search_date_validation_startday =
GETPOSTINT(
'search_date_validation_startday');
76$search_date_validation_endyear =
GETPOSTINT(
'search_date_validation_endyear');
77$search_date_validation_endmonth =
GETPOSTINT(
'search_date_validation_endmonth');
78$search_date_validation_endday =
GETPOSTINT(
'search_date_validation_endday');
79$search_date_validation_start =
dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
80$search_date_validation_end =
dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
81$search_import_key =
GETPOST(
"search_import_key",
'alpha');
83$search_account_category =
GETPOSTINT(
'search_account_category');
85$search_accountancy_code_start =
GETPOST(
'search_accountancy_code_start',
'alpha');
86if ($search_accountancy_code_start == - 1) {
87 $search_accountancy_code_start =
'';
89$search_accountancy_code_end =
GETPOST(
'search_accountancy_code_end',
'alpha');
90if ($search_accountancy_code_end == - 1) {
91 $search_accountancy_code_end =
'';
93$search_doc_ref =
GETPOST(
'search_doc_ref',
'alpha');
94$search_label_operation =
GETPOST(
'search_label_operation',
'alpha');
95$search_mvt_num =
GETPOST(
'search_mvt_num',
'alpha');
96$search_direction =
GETPOST(
'search_direction',
'alpha');
97$search_ledger_code =
GETPOST(
'search_ledger_code',
'array');
98$search_debit =
GETPOST(
'search_debit',
'alpha');
99$search_credit =
GETPOST(
'search_credit',
'alpha');
100$search_lettering_code =
GETPOST(
'search_lettering_code',
'alpha');
101$search_not_reconciled =
GETPOST(
'search_not_reconciled',
'alpha');
104 $action =
'delbookkeepingyear';
109$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
110$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
111$optioncss =
GETPOST(
'optioncss',
'alpha');
113if (empty($page) || $page < 0) {
116$offset = $limit * $page;
117$pageprev = $page - 1;
118$pagenext = $page + 1;
119if ($sortorder ==
"") {
122if ($sortfield ==
"") {
123 $sortfield =
"t.doc_date,t.rowid";
129$hookmanager->initHooks(array($context_default));
132$form =
new Form($db);
134if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET(
'search_date_startday') && !GETPOSTISSET(
'search_date_startmonth') && !GETPOSTISSET(
'search_date_starthour')) {
135 $sql =
"SELECT date_start, date_end from ".MAIN_DB_PREFIX.
"accounting_fiscalyear ";
136 $sql .=
" where date_start < '".$db->idate(
dol_now()).
"' and date_end > '".$db->idate(
dol_now()).
"'";
137 $sql .= $db->plimit(1);
138 $res = $db->query($sql);
140 if ($res->num_rows > 0) {
141 $fiscalYear = $db->fetch_object($res);
142 $search_date_start = strtotime($fiscalYear->date_start);
143 $search_date_end = strtotime($fiscalYear->date_end);
150 $year_end = $year_start + 1;
151 $month_end = $month_start - 1;
152 if ($month_end < 1) {
156 $search_date_start =
dol_mktime(0, 0, 0, $month_start, 1, $year_start);
163 't.piece_num' => array(
'label' => $langs->trans(
"TransactionNumShort"),
'checked' => 1),
164 't.code_journal' => array(
'label' => $langs->trans(
"Codejournal"),
'checked' => 1),
165 't.doc_date' => array(
'label' => $langs->trans(
"Docdate"),
'checked' => 1),
166 't.doc_ref' => array(
'label' => $langs->trans(
"Piece"),
'checked' => 1),
167 't.label_operation' => array(
'label' => $langs->trans(
"Label"),
'checked' => 1),
168 't.lettering_code' => array(
'label' => $langs->trans(
"Lettering"),
'checked' => 1),
169 't.debit' => array(
'label' => $langs->trans(
"AccountingDebit"),
'checked' => 1),
170 't.credit' => array(
'label' => $langs->trans(
"AccountingCredit"),
'checked' => 1),
171 't.balance' => array(
'label' => $langs->trans(
"Balance"),
'checked' => 1),
172 't.date_export' => array(
'label' => $langs->trans(
"DateExport"),
'checked' => -1),
173 't.date_validated' => array(
'label' => $langs->trans(
"DateValidation"),
'checked' => -1,
'enabled' => !
getDolGlobalString(
"ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")),
174 't.import_key' => array(
'label' => $langs->trans(
"ImportId"),
'checked' => -1,
'position' => 1100),
178 unset($arrayfields[
't.lettering_code']);
181if ($search_date_start && empty($search_date_startyear)) {
183 $search_date_startyear = $tmparray[
'year'];
184 $search_date_startmonth = $tmparray[
'mon'];
185 $search_date_startday = $tmparray[
'mday'];
187if ($search_date_end && empty($search_date_endyear)) {
189 $search_date_endyear = $tmparray[
'year'];
190 $search_date_endmonth = $tmparray[
'mon'];
191 $search_date_endday = $tmparray[
'mday'];
194if (!isModEnabled(
'accounting')) {
197if ($user->socid > 0) {
200if (!$user->hasRight(
'accounting',
'mouvements',
'lire')) {
206$permissiontoadd = $user->hasRight(
'accounting',
'mouvements',
'creer');
215if (
GETPOST(
'cancel',
'alpha')) {
219if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'preunletteringauto' && $massaction !=
'preunletteringmanual' && $massaction !=
'predeletebookkeepingwriting') {
223$parameters = array(
'socid' => $socid);
224$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
229if (empty($reshook)) {
230 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
232 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
233 $search_doc_date =
'';
234 $search_account_category =
'';
235 $search_accountancy_code_start =
'';
236 $search_accountancy_code_end =
'';
237 $search_label_account =
'';
238 $search_doc_ref =
'';
239 $search_label_operation =
'';
240 $search_mvt_num =
'';
241 $search_direction =
'';
242 $search_ledger_code = array();
243 $search_date_start =
'';
244 $search_date_end =
'';
245 $search_date_startyear =
'';
246 $search_date_startmonth =
'';
247 $search_date_startday =
'';
248 $search_date_endyear =
'';
249 $search_date_endmonth =
'';
250 $search_date_endday =
'';
251 $search_date_export_start =
'';
252 $search_date_export_end =
'';
253 $search_date_export_startyear =
'';
254 $search_date_export_startmonth =
'';
255 $search_date_export_startday =
'';
256 $search_date_export_endyear =
'';
257 $search_date_export_endmonth =
'';
258 $search_date_export_endday =
'';
259 $search_date_validation_start =
'';
260 $search_date_validation_end =
'';
261 $search_date_validation_startyear =
'';
262 $search_date_validation_startmonth =
'';
263 $search_date_validation_startday =
'';
264 $search_date_validation_endyear =
'';
265 $search_date_validation_endmonth =
'';
266 $search_date_validation_endday =
'';
267 $search_lettering_code =
'';
270 $search_not_reconciled =
'';
271 $search_import_key =
'';
278 if (!empty($search_date_start)) {
279 $filter[
't.doc_date>='] = $search_date_start;
280 $param .=
'&search_date_startmonth='.$search_date_startmonth.
'&search_date_startday='.$search_date_startday.
'&search_date_startyear='.$search_date_startyear;
282 if (!empty($search_date_end)) {
283 $filter[
't.doc_date<='] = $search_date_end;
284 $param .=
'&search_date_endmonth='.$search_date_endmonth.
'&search_date_endday='.$search_date_endday.
'&search_date_endyear='.$search_date_endyear;
286 if (!empty($search_doc_date)) {
287 $filter[
't.doc_date'] = $search_doc_date;
288 $param .=
'&doc_datemonth='.GETPOSTINT(
'doc_datemonth').
'&doc_dateday='.
GETPOSTINT(
'doc_dateday').
'&doc_dateyear='.
GETPOSTINT(
'doc_dateyear');
290 if ($search_account_category !=
'-1' && !empty($search_account_category)) {
291 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountancycategory.class.php';
294 $listofaccountsforgroup = $accountingcategory->getCptsCat(0,
'fk_accounting_category = '.((
int) $search_account_category));
295 $listofaccountsforgroup2 = array();
296 if (is_array($listofaccountsforgroup)) {
297 foreach ($listofaccountsforgroup as $tmpval) {
298 $listofaccountsforgroup2[] =
"'".$db->escape($tmpval[
'id']).
"'";
301 $filter[
't.search_accounting_code_in'] = implode(
',', $listofaccountsforgroup2);
302 $param .=
'&search_account_category='.urlencode((
string) ($search_account_category));
304 if (!empty($search_accountancy_code_start)) {
305 if ($type ==
'sub') {
306 $filter[
't.subledger_account>='] = $search_accountancy_code_start;
308 $filter[
't.numero_compte>='] = $search_accountancy_code_start;
310 $param .=
'&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
312 if (!empty($search_accountancy_code_end)) {
313 if ($type ==
'sub') {
314 $filter[
't.subledger_account<='] = $search_accountancy_code_end;
316 $filter[
't.numero_compte<='] = $search_accountancy_code_end;
318 $param .=
'&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
320 if (!empty($search_label_account)) {
321 $filter[
't.label_compte'] = $search_label_account;
322 $param .=
'&search_label_compte='.urlencode($search_label_account);
324 if (!empty($search_mvt_num)) {
325 $filter[
't.piece_num'] = $search_mvt_num;
326 $param .=
'&search_mvt_num='.urlencode((
string) ($search_mvt_num));
328 if (!empty($search_doc_ref)) {
329 $filter[
't.doc_ref'] = $search_doc_ref;
330 $param .=
'&search_doc_ref='.urlencode($search_doc_ref);
332 if (!empty($search_label_operation)) {
333 $filter[
't.label_operation'] = $search_label_operation;
334 $param .=
'&search_label_operation='.urlencode($search_label_operation);
336 if (!empty($search_direction)) {
337 $filter[
't.sens'] = $search_direction;
338 $param .=
'&search_direction='.urlencode($search_direction);
340 if (!empty($search_ledger_code)) {
341 $filter[
't.code_journal'] = $search_ledger_code;
342 foreach ($search_ledger_code as $code) {
343 $param .=
'&search_ledger_code[]='.urlencode($code);
346 if (!empty($search_lettering_code)) {
347 $filter[
't.lettering_code'] = $search_lettering_code;
348 $param .=
'&search_lettering_code='.urlencode($search_lettering_code);
350 if (!empty($search_debit)) {
351 $filter[
't.debit'] = $search_debit;
352 $param .=
'&search_debit='.urlencode($search_debit);
354 if (!empty($search_credit)) {
355 $filter[
't.credit'] = $search_credit;
356 $param .=
'&search_credit='.urlencode($search_credit);
358 if (!empty($search_not_reconciled)) {
359 $filter[
't.reconciled_option'] = $search_not_reconciled;
360 $param .=
'&search_not_reconciled='.urlencode($search_not_reconciled);
362 if (!empty($search_date_export_start)) {
363 $filter[
't.date_export>='] = $search_date_export_start;
364 $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;
366 if (!empty($search_date_export_end)) {
367 $filter[
't.date_export<='] = $search_date_export_end;
368 $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;
370 if (!empty($search_date_validation_start)) {
371 $filter[
't.date_validated>='] = $search_date_validation_start;
372 $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;
374 if (!empty($search_date_validation_end)) {
375 $filter[
't.date_validated<='] = $search_date_validation_end;
376 $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;
378 if (!empty($search_import_key)) {
379 $filter[
't.import_key'] = $search_import_key;
380 $param .=
'&search_import_key='.urlencode($search_import_key);
383 $url_param = substr($param, 1);
385 $param =
'&type='.$type.$param;
416 $objectclass =
'Bookkeeping';
417 $objectlabel =
'Bookkeeping';
418 $permissiontoread = $user->hasRight(
'societe',
'lire');
419 $permissiontodelete = $user->hasRight(
'societe',
'supprimer');
420 $permissiontoadd = $user->hasRight(
'societe',
'creer');
421 $uploaddir = $conf->societe->dir_output;
422 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
424 if (!$error && $action ==
'deletebookkeepingwriting' && $confirm ==
"yes" && $user->hasRight(
'accounting',
'mouvements',
'supprimer')) {
429 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect,
true);
430 if ($nb_lettering < 0) {
438 foreach ($toselect as $toselectid) {
439 $result =
$object->fetch($toselectid);
440 if ($result > 0 && (!isset(
$object->date_validation) ||
$object->date_validation ===
'')) {
449 } elseif ($result < 0) {
453 } elseif (isset(
$object->date_validation) &&
$object->date_validation !=
'') {
454 setEventMessages($langs->trans(
"ValidatedRecordWhereFound"),
null,
'errors');
467 } elseif ($nbok > 0) {
473 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?noreset=1".($param ?
'&'.$param :
''));
482 if ($massaction ==
'letteringauto' && $permissiontoadd) {
484 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect);
485 if ($nb_lettering < 0) {
488 $nb_lettering = max(0, abs($nb_lettering) - 2);
489 } elseif ($nb_lettering == 0) {
491 setEventMessages($langs->trans(
'AccountancyNoLetteringModified'), array(),
'mesgs');
493 if ($nb_lettering == 1) {
494 setEventMessages($langs->trans(
'AccountancyOneLetteringModifiedSuccessfully'), array(),
'mesgs');
495 } elseif ($nb_lettering > 1) {
496 setEventMessages($langs->trans(
'AccountancyLetteringModifiedSuccessfully', $nb_lettering), array(),
'mesgs');
500 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
503 } elseif ($massaction ==
'letteringmanual' && $permissiontoadd) {
505 $result = $lettering->updateLettering($toselect);
509 setEventMessages($langs->trans(
'AccountancyOneLetteringModifiedSuccessfully'), array(),
'mesgs');
510 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
513 } elseif ($action ==
'unletteringauto' && $confirm ==
"yes" && $permissiontoadd) {
515 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect,
true);
516 if ($nb_lettering < 0) {
519 $nb_lettering = max(0, abs($nb_lettering) - 2);
520 } elseif ($nb_lettering == 0) {
522 setEventMessages($langs->trans(
'AccountancyNoUnletteringModified'), array(),
'mesgs');
524 if ($nb_lettering == 1) {
525 setEventMessages($langs->trans(
'AccountancyOneUnletteringModifiedSuccessfully'), array(),
'mesgs');
526 } elseif ($nb_lettering > 1) {
527 setEventMessages($langs->trans(
'AccountancyUnletteringModifiedSuccessfully', $nb_lettering), array(),
'mesgs');
531 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
534 } elseif ($action ==
'unletteringmanual' && $confirm ==
"yes" && $permissiontoadd) {
536 $nb_lettering = $lettering->deleteLettering($toselect);
540 setEventMessages($langs->trans(
'AccountancyOneUnletteringModifiedSuccessfully'), array(),
'mesgs');
541 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
556$form =
new Form($db);
558$title_page = $langs->trans(
"Operations").
' - '.$langs->trans(
"VueByAccountAccounting").
' (';
560 $title_page .= $langs->trans(
"BookkeepingSubAccount");
562 $title_page .= $langs->trans(
"Bookkeeping");
565$help_url =
'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double';
566llxHeader(
'', $title_page, $help_url,
'', 0, 0,
'',
'',
'',
'mod-accountancy accountancy-consultation page-'.(($type ==
'sub') ?
'sub' :
'').
'ledger');
569$nbtotalofrecords =
'';
572 if ($type ==
'sub') {
573 $nbtotalofrecords =
$object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter,
'AND', 1, 1);
575 $nbtotalofrecords =
$object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter,
'AND', 0, 1);
578 if ($nbtotalofrecords < 0) {
585 if ($type ==
'sub') {
586 $result =
$object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter,
'AND', 1);
588 $result =
$object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter,
'AND', 0);
596$arrayofselected = is_array($toselect) ? $toselect : array();
646$arrayofmassactions = array();
647if (
getDolGlobalInt(
'ACCOUNTING_ENABLE_LETTERING') && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
648 $arrayofmassactions[
'letteringauto'] =
img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'LetteringAuto');
649 $arrayofmassactions[
'preunletteringauto'] =
img_picto(
'',
'uncheck',
'class="pictofixedwidth"') . $langs->trans(
'UnletteringAuto');
650 $arrayofmassactions[
'letteringmanual'] =
img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'LetteringManual');
651 $arrayofmassactions[
'preunletteringmanual'] =
img_picto(
'',
'uncheck',
'class="pictofixedwidth"') . $langs->trans(
'UnletteringManual');
653if ($user->hasRight(
'accounting',
'mouvements',
'supprimer')) {
654 $arrayofmassactions[
'predeletebookkeepingwriting'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
656if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'preunletteringauto',
'preunletteringmanual',
'predeletebookkeepingwriting'))) {
657 $arrayofmassactions = array();
659$massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions);
661print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
662print
'<input type="hidden" name="token" value="'.newToken().
'">';
663print
'<input type="hidden" name="action" value="list">';
664if ($optioncss !=
'') {
665 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
667print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
668print
'<input type="hidden" name="type" value="'.$type.
'">';
669print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
670print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
671print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
673$parameters = array(
'param' => $param);
674$reshook = $hookmanager->executeHooks(
'addMoreActionsButtonsList', $parameters, $object, $action);
679$newcardbutton = empty($hookmanager->resPrint) ?
'' : $hookmanager->resPrint;
681if (empty($reshook)) {
682 $newcardbutton =
dolGetButtonTitle($langs->trans(
'ViewFlatList'),
'',
'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.
'/accountancy/bookkeeping/list.php?'.$param);
683 if ($type ==
'sub') {
684 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly'));
685 $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'));
687 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly btnTitleSelected'));
688 $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'));
691 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewAccountingMvt'),
'',
'fa fa-plus-circle paddingleft', DOL_URL_ROOT.
'/accountancy/bookkeeping/card.php?action=create');
694if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
695 $param .=
'&contextpage='.urlencode($contextpage);
697if ($limit > 0 && $limit != $conf->liste_limit) {
698 $param .=
'&limit='.((int) $limit);
701print_barre_liste($title_page, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $result, $nbtotalofrecords,
'title_accountancy', 0, $newcardbutton,
'', $limit, 0, 0, 1);
703if ($massaction ==
'preunletteringauto') {
704 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassUnletteringAuto"), $langs->trans(
"ConfirmMassUnletteringQuestion", count($toselect)),
"unletteringauto",
null,
'', 0, 200, 500, 1);
705} elseif ($massaction ==
'preunletteringmanual') {
706 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassUnletteringManual"), $langs->trans(
"ConfirmMassUnletteringQuestion", count($toselect)),
"unletteringmanual",
null,
'', 0, 200, 500, 1);
707} elseif ($massaction ==
'predeletebookkeepingwriting') {
708 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassDeleteBookkeepingWriting"), $langs->trans(
"ConfirmMassDeleteBookkeepingWritingQuestion", count($toselect)),
"deletebookkeepingwriting",
null,
'', 0, 200, 500, 1);
721include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
723$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
724$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
725if ($massactionbutton && $contextpage !=
'poslist') {
726 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
730if (preg_match(
'/^asc/i', $sortorder)) {
738 print
info_admin($langs->trans(
"WarningRecordWithoutSubledgerAreExcluded"));
744$moreforfilter .=
'<div class="divsearchfield">';
745$moreforfilter .= $langs->trans(
'AccountAccounting').
': ';
746$moreforfilter .=
'<div class="nowrap inline-block">';
748 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'),
'maxwidth200');
750 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'), array(), 1, 1,
'maxwidth200');
752$moreforfilter .=
' ';
754 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'),
'maxwidth200');
756 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'), array(), 1, 1,
'maxwidth200');
758$stringforfirstkey = $langs->trans(
"KeyboardShortcut");
759if ($conf->browser->name ==
'chrome') {
760 $stringforfirstkey .=
' ALT +';
761} elseif ($conf->browser->name ==
'firefox') {
762 $stringforfirstkey .=
' ALT + SHIFT +';
764 $stringforfirstkey .=
' CTL +';
766$moreforfilter .=
' <a id="previous_account" accesskey="p" title="' . $stringforfirstkey .
' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>';
767$moreforfilter .=
' <a id="next_account" accesskey="n" title="' . $stringforfirstkey .
' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>';
768$moreforfilter .= <<<SCRIPT
769<script
type=
"text/javascript">
770 jQuery(document).ready(
function() {
771 var searchFormList = $(
'#searchFormList');
772 var searchAccountancyCodeStart = $(
'#search_accountancy_code_start');
773 var searchAccountancyCodeEnd = $(
'#search_accountancy_code_end');
774 jQuery(
'#previous_account').on(
'click',
function() {
775 var previousOption = searchAccountancyCodeStart.find(
'option:selected').prev(
'option');
776 if (previousOption.length == 1) searchAccountancyCodeStart.val(previousOption.attr(
'value'));
777 searchAccountancyCodeEnd.val(searchAccountancyCodeStart.val());
778 searchFormList.submit();
780 jQuery(
'#next_account').on(
'click',
function() {
781 var nextOption = searchAccountancyCodeStart.find(
'option:selected').next(
'option');
782 if (nextOption.length == 1) searchAccountancyCodeStart.val(nextOption.attr(
'value'));
783 searchAccountancyCodeEnd.val(searchAccountancyCodeStart.val());
784 searchFormList.submit();
786 jQuery(
'input[name="search_mvt_num"]').on(
"keypress",
function(event) {
792$moreforfilter .=
'</div>';
793$moreforfilter .=
'</div>';
795$moreforfilter .=
'<div class="divsearchfield">';
796$moreforfilter .= $langs->trans(
'AccountingCategory').
': ';
797$moreforfilter .=
'<div class="nowrap inline-block">';
798$moreforfilter .= $formaccounting->select_accounting_category($search_account_category,
'search_account_category', 1, 0, 0, 0);
799$moreforfilter .=
'</div>';
800$moreforfilter .=
'</div>';
802$parameters = array();
803$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
804if (empty($reshook)) {
805 $moreforfilter .= $hookmanager->resPrint;
807 $moreforfilter = $hookmanager->resPrint;
810print
'<div class="liste_titre liste_titre_bydiv centpercent">';
814print
'<div class="div-table-responsive">';
815print
'<table class="tagtable liste centpercent">';
818print
'<tr class="liste_titre_filter">';
821 print
'<td class="liste_titre center">';
822 $searchpicto = $form->showFilterButtons(
'left');
827if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
828 print
'<td class="liste_titre"><input type="text" name="search_mvt_num" class="width50" value="'.dol_escape_htmltag($search_mvt_num).
'"></td>';
831if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
832 print
'<td class="liste_titre center">';
833 print $formaccounting->multi_select_journal($search_ledger_code,
'search_ledger_code', 0, 1, 1, 1,
'maxwidth75');
837if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
838 print
'<td class="liste_titre center">';
839 print
'<div class="nowrapfordate">';
840 print $form->selectDate($search_date_start,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
842 print
'<div class="nowrapfordate">';
843 print $form->selectDate($search_date_end,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
848if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
849 print
'<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).
'"/></td>';
852if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
853 print
'<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="'.dol_escape_htmltag($search_label_operation).
'"/></td>';
856if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
857 print
'<td class="liste_titre center">';
858 print
'<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.
'"/>';
859 print
'<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled ==
'notreconciled' ?
' checked' :
'').
'>'.$langs->trans(
"NotReconciled").
'</span>';
863if (!empty($arrayfields[
't.debit'][
'checked'])) {
864 print
'<td class="liste_titre right"><input type="text" class="flat" name="search_debit" size="4" value="'.dol_escape_htmltag($search_debit).
'"></td>';
867if (!empty($arrayfields[
't.credit'][
'checked'])) {
868 print
'<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).
'"></td>';
871if (!empty($arrayfields[
't.balance'][
'checked'])) {
875if (!empty($arrayfields[
't.date_export'][
'checked'])) {
876 print
'<td class="liste_titre center">';
877 print
'<div class="nowrapfordate">';
878 print $form->selectDate($search_date_export_start,
'search_date_export_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
880 print
'<div class="nowrapfordate">';
881 print $form->selectDate($search_date_export_end,
'search_date_export_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
886if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
887 print
'<td class="liste_titre center">';
888 print
'<div class="nowrapfordate">';
889 print $form->selectDate($search_date_validation_start,
'search_date_validation_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
891 print
'<div class="nowrapfordate">';
892 print $form->selectDate($search_date_validation_end,
'search_date_validation_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
896if (!empty($arrayfields[
't.import_key'][
'checked'])) {
897 print
'<td class="liste_titre center">';
898 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
903$parameters = array(
'arrayfields' => $arrayfields);
904$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
905print $hookmanager->resPrint;
909 print
'<td class="liste_titre center">';
910 $searchpicto = $form->showFilterButtons();
916print
'<tr class="liste_titre">';
918 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
920if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
921 print_liste_field_titre($arrayfields[
't.piece_num'][
'label'], $_SERVER[
'PHP_SELF'],
"t.piece_num",
"", $param,
'', $sortfield, $sortorder,
'tdoverflowmax80imp ');
923if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
924 print_liste_field_titre($arrayfields[
't.code_journal'][
'label'], $_SERVER[
'PHP_SELF'],
"t.code_journal",
"", $param,
'', $sortfield, $sortorder,
'center ');
926if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
927 print_liste_field_titre($arrayfields[
't.doc_date'][
'label'], $_SERVER[
'PHP_SELF'],
"t.doc_date",
"", $param,
'', $sortfield, $sortorder,
'center ');
929if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
930 print_liste_field_titre($arrayfields[
't.doc_ref'][
'label'], $_SERVER[
'PHP_SELF'],
"t.doc_ref",
"", $param,
"", $sortfield, $sortorder);
932if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
933 print_liste_field_titre($arrayfields[
't.label_operation'][
'label'], $_SERVER[
'PHP_SELF'],
"t.label_operation",
"", $param,
"", $sortfield, $sortorder);
935if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
936 print_liste_field_titre($arrayfields[
't.lettering_code'][
'label'], $_SERVER[
'PHP_SELF'],
"t.lettering_code",
"", $param,
'', $sortfield, $sortorder,
'center ');
938if (!empty($arrayfields[
't.debit'][
'checked'])) {
939 print_liste_field_titre($arrayfields[
't.debit'][
'label'], $_SERVER[
'PHP_SELF'],
"t.debit",
"", $param,
'', $sortfield, $sortorder,
'right ');
941if (!empty($arrayfields[
't.credit'][
'checked'])) {
942 print_liste_field_titre($arrayfields[
't.credit'][
'label'], $_SERVER[
'PHP_SELF'],
"t.credit",
"", $param,
'', $sortfield, $sortorder,
'right ');
944if (!empty($arrayfields[
't.balance'][
'checked'])) {
945 print_liste_field_titre($arrayfields[
't.balance'][
'label'],
"",
"",
"", $param,
'', $sortfield, $sortorder,
'right ');
947if (!empty($arrayfields[
't.date_export'][
'checked'])) {
948 print_liste_field_titre($arrayfields[
't.date_export'][
'label'], $_SERVER[
'PHP_SELF'],
"t.date_export",
"", $param,
'', $sortfield, $sortorder,
'center ');
950if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
951 print_liste_field_titre($arrayfields[
't.date_validated'][
'label'], $_SERVER[
'PHP_SELF'],
"t.date_validated",
"", $param,
'', $sortfield, $sortorder,
'center ');
953if (!empty($arrayfields[
't.import_key'][
'checked'])) {
954 print_liste_field_titre($arrayfields[
't.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"t.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
957$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
958$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
959print $hookmanager->resPrint;
961 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
965$displayed_account_number =
null;
971$totalarray = array();
972$totalarray[
'nbfield'] = 0;
973$sous_total_debit = 0;
974$sous_total_credit = 0;
975$totalarray[
'val'] = array();
976$totalarray[
'val'][
'totaldebit'] = 0;
977$totalarray[
'val'][
'totalcredit'] = 0;
978$totalarray[
'val'][
'totalbalance']=0;
980while ($i < min($num, $limit)) {
983 if ($type ==
'sub') {
995 if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
998 if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
1001 if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
1004 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
1007 if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
1010 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1014 if (!empty($arrayfields[
't.balance'][
'checked'])) {
1017 if (!empty($arrayfields[
't.date_export'][
'checked'])) {
1020 if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
1023 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1026 if (!empty($arrayfields[
't.import_key'][
'checked'])) {
1035 if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
1037 if (isset($displayed_account_number)) {
1038 print
'<tr class="liste_total">';
1039 if ($type ==
'sub') {
1040 print
'<td class="right" colspan="' . $colspan .
'">' . $langs->trans(
"TotalForAccount") .
' ' .
length_accounta($displayed_account_number) .
':</td>';
1042 print
'<td class="right" colspan="' . $colspan .
'">' . $langs->trans(
"TotalForAccount") .
' ' .
length_accountg($displayed_account_number) .
':</td>';
1044 print
'<td class="nowrap right">'.price(
price2num($sous_total_debit,
'MT')).
'</td>';
1045 print
'<td class="nowrap right">'.price(
price2num($sous_total_credit,
'MT')).
'</td>';
1046 if ($colspanend > 0) {
1047 print
'<td colspan="'.$colspanend.
'"></td>';
1051 $balance = $sous_total_debit - $sous_total_credit;
1052 print
'<tr class="liste_total">';
1053 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"Balance").
':</td>';
1055 print
'<td class="nowraponall right">';
1056 print
price(
price2num($sous_total_debit - $sous_total_credit,
'MT'));
1061 print
'<td class="nowraponall right">';
1062 print
price(
price2num($sous_total_credit - $sous_total_debit,
'MT'));
1065 if ($colspanend > 0) {
1066 print
'<td colspan="'.$colspanend.
'"></td>';
1072 print
'<tr class="trforbreak">';
1073 print
'<td colspan="'.($totalarray[
'nbfield'] ? $totalarray[
'nbfield'] : count($arrayfields) + 1).
'" class="tdforbreak">';
1074 if ($type ==
'sub') {
1075 if ($line->subledger_account !=
"" && $line->subledger_account !=
'-1') {
1076 print empty($line->subledger_label) ?
'<span class="error">'.$langs->trans(
"Unknown").
'</span>' : $line->subledger_label;
1081 print
'<span class="error">' . $langs->trans(
"Unknown");
1082 if ($line->subledger_label) {
1083 print
' (' . $line->subledger_label .
')';
1084 $htmltext =
'EmptyStringForSubledgerAccountButSubledgerLabelDefined';
1086 $htmltext =
'EmptyStringForSubledgerAccountAndSubledgerLabel';
1088 print $form->textwithpicto(
'', $htmltext);
1092 if ($line->numero_compte !=
"" && $line->numero_compte !=
'-1') {
1095 print
'<span class="error">' . $langs->trans(
"Unknown") .
'</span>';
1101 $displayed_account_number = $accountg;
1103 $sous_total_debit = 0;
1104 $sous_total_credit = 0;
1109 print
'<tr class="oddeven">';
1112 print
'<td class="nowraponall center">';
1113 if (($massactionbutton || $massaction) && $contextpage !=
'poslist') {
1115 if (in_array($line->id, $arrayofselected)) {
1118 print
'<input id="cb' . $line->id .
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id .
'"' . ($selected ?
' checked="checked"' :
'') .
' />';
1122 $totalarray[
'nbfield']++;
1126 if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
1129 $object->piece_num = $line->piece_num;
1130 print
$object->getNomUrl(1,
'', 0,
'', 1);
1133 $totalarray[
'nbfield']++;
1138 if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
1140 $result = $accountingjournal->fetch(0, $line->code_journal);
1141 $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0,
'', 0) : $line->code_journal);
1142 print
'<td class="center tdoverflowmax80">'.$journaltoshow.
'</td>';
1144 $totalarray[
'nbfield']++;
1149 if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
1150 print
'<td class="center">'.dol_print_date($line->doc_date,
'day').
'</td>';
1152 $totalarray[
'nbfield']++;
1158 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
1159 if ($line->doc_type ==
'customer_invoice') {
1160 $langs->loadLangs(array(
'bills'));
1162 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1163 $objectstatic =
new Facture($db);
1164 $objectstatic->fetch($line->fk_doc);
1169 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$objectstatic->id;
1170 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1171 } elseif ($line->doc_type ==
'supplier_invoice') {
1172 $langs->loadLangs(array(
'bills'));
1174 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1176 $objectstatic->fetch($line->fk_doc);
1178 $modulepart =
'invoice_supplier';
1180 $filedir = $conf->fournisseur->facture->dir_output.
'/'.
get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
1181 $subdir =
get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
1182 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
1183 } elseif ($line->doc_type ==
'expense_report') {
1184 $langs->loadLangs(array(
'trips'));
1186 require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
1188 $objectstatic->fetch($line->fk_doc);
1193 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$objectstatic->id;
1194 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1195 } elseif ($line->doc_type ==
'bank') {
1196 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1198 $objectstatic->fetch($line->fk_doc);
1203 print
'<td class="tdoverflowmax250">';
1206 if ($line->doc_type ==
'customer_invoice' || $line->doc_type ==
'supplier_invoice' || $line->doc_type ==
'expense_report') {
1207 print $objectstatic->getNomUrl(1,
'', 0, 0,
'', 0, -1, 1);
1208 print $documentlink;
1209 } elseif ($line->doc_type ==
'bank') {
1210 print $objectstatic->getNomUrl(1);
1211 $bank_ref = strstr($line->doc_ref,
'-');
1212 print
" " . $bank_ref;
1214 print $line->doc_ref;
1219 $totalarray[
'nbfield']++;
1224 if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
1226 $doc_ref = preg_replace(
'/\(.*\)/',
'', $line->doc_ref);
1228 print
'<td class="small tdoverflowmax350 classfortooltip" title="'.dol_escape_htmltag($line->label_operation).
'">'.
dol_escape_htmltag($line->label_operation).
'</td>';
1230 print
'<td class="small tdoverflowmax350 classfortooltip" title="'.dol_escape_htmltag($line->label_operation.($line->label_operation ?
'<br>' :
'').
'<span style="font-size:0.8em">('.
length_accounta($line->subledger_account).
')').
'">'.
dol_escape_htmltag($line->label_operation).($line->label_operation ?
'<br>' :
'').
'<span style="font-size:0.8em">('.
dol_escape_htmltag(
length_accounta($line->subledger_account)).
')</span></td>';
1233 $totalarray[
'nbfield']++;
1238 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1239 print
'<td class="center">'.dol_escape_htmltag($line->lettering_code).
'</td>';
1241 $totalarray[
'nbfield']++;
1246 if (!empty($arrayfields[
't.debit'][
'checked'])) {
1247 print
'<td class="right nowraponall amount">'.($line->debit != 0 ?
price($line->debit) :
'').
'</td>';
1249 $totalarray[
'nbfield']++;
1252 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totaldebit';
1254 $totalarray[
'val'][
'totaldebit'] += (float) $line->debit;
1258 if (!empty($arrayfields[
't.credit'][
'checked'])) {
1259 print
'<td class="right nowraponall amount">'.($line->credit != 0 ?
price($line->credit) :
'').
'</td>';
1261 $totalarray[
'nbfield']++;
1264 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalcredit';
1266 $totalarray[
'val'][
'totalcredit'] += (float) $line->credit;
1270 if (!empty($arrayfields[
't.balance'][
'checked'])) {
1271 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_debit + $line->debit - $sous_total_credit - $line->credit,
'MT')).
'</td>';
1273 $totalarray[
'nbfield']++;
1276 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalbalance';
1278 $totalarray[
'val'][
'totalbalance'] += $line->debit - $line->credit;
1282 if (!empty($arrayfields[
't.date_export'][
'checked'])) {
1283 print
'<td class="center">'.dol_print_date($line->date_export,
'dayhour').
'</td>';
1285 $totalarray[
'nbfield']++;
1290 if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
1291 print
'<td class="center">'.dol_print_date($line->date_validation,
'dayhour').
'</td>';
1293 $totalarray[
'nbfield']++;
1297 if (!empty($arrayfields[
't.import_key'][
'checked'])) {
1298 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($line->import_key).
'">'.
dol_escape_htmltag($line->import_key).
"</td>\n";
1300 $totalarray[
'nbfield']++;
1305 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $line);
1306 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1307 print $hookmanager->resPrint;
1311 print
'<td class="nowraponall center">';
1312 if (($massactionbutton || $massaction) && $contextpage !=
'poslist') {
1314 if (in_array($line->id, $arrayofselected)) {
1317 print
'<input id="cb' . $line->id .
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id .
'"' . ($selected ?
' checked="checked"' :
'') .
' />';
1321 $totalarray[
'nbfield']++;
1326 $sous_total_debit += $line->debit;
1327 $sous_total_credit += $line->credit;
1334if ($num > 0 && $colspan > 0) {
1335 print
'<tr class="liste_total">';
1336 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"TotalForAccount").
' '.$accountg.
':</td>';
1337 print
'<td class="nowrap right">'.price(
price2num($sous_total_debit,
'MT')).
'</td>';
1338 print
'<td class="nowrap right">'.price(
price2num($sous_total_credit,
'MT')).
'</td>';
1339 if ($colspanend > 0) {
1340 print
'<td colspan="'.$colspanend.
'"></td>';
1344 $balance = $sous_total_debit - $sous_total_credit;
1345 print
'<tr class="liste_total">';
1346 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"Balance").
':</td>';
1348 print
'<td class="nowraponall right">';
1349 print
price(
price2num($sous_total_debit - $sous_total_credit,
'MT'));
1354 print
'<td class="nowraponall right">';
1355 print
price(
price2num($sous_total_credit - $sous_total_debit,
'MT'));
1358 if ($colspanend > 0) {
1359 print
'<td colspan="'.$colspanend.
'"></td>';
1366if (!empty($totalarray[
'val'][
'totaldebit'])) {
1367 $totalarray[
'val'][
'totaldebit'] = (float)
price2num($totalarray[
'val'][
'totaldebit'],
'MT');
1369if (!empty($totalarray[
'val'][
'totalcredit'])) {
1370 $totalarray[
'val'][
'totalcredit'] = (float)
price2num($totalarray[
'val'][
'totalcredit'],
'MT');
1372if (!empty($totalarray[
'val'][
'totalbalance'])) {
1373 $totalarray[
'val'][
'totalbalance'] = (float)
price2num($totalarray[
'val'][
'totaldebit'] - $totalarray[
'val'][
'totalcredit'],
'MT');
1377include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1382 foreach ($arrayfields as $key => $val) {
1383 if (!empty($val[
'checked'])) {
1387 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1390$parameters = array(
'arrayfields' => $arrayfields);
1391$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1392print $hookmanager->resPrint;
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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 categories of an accounting account.
Class to manage accounting journals.
Class to manage Ledger (General Ledger and Subledger)
Class to manage Trips and Expenses.
Class to manage suppliers invoices.
Class to manage invoices.
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 information (by default a local PHP server timestamp) Rep...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $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.
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.
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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
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.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
$formconfirm
if ($action == 'delbookkeepingyear') {
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.