32require
'../../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/lettering.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
53$langs->loadLangs(array(
"accountancy",
"categories",
"compta",
"other"));
55$journal_code =
GETPOST(
'code_journal',
'alpha');
56$account =
GETPOST(
"account",
'int');
59$action =
GETPOST(
'action',
'aZ09');
61$mode = (
GETPOST(
'mode',
'alpha') ?
GETPOST(
'mode',
'alpha') :
'customer');
62$massaction =
GETPOST(
'massaction',
'alpha');
63$confirm =
GETPOST(
'confirm',
'alpha');
64$toselect =
GETPOST(
'toselect',
'array:int');
65$type =
GETPOST(
'type',
'alpha');
67 $context_default =
'bookkeepingbysubaccountlist';
69 $context_default =
'bookkeepingbyaccountlist';
71$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : $context_default;
73$search_doc_date =
GETPOSTDATE(
'doc_date',
'getpost');
75$search_date_startyear =
GETPOSTINT(
'search_date_startyear');
76$search_date_startmonth =
GETPOSTINT(
'search_date_startmonth');
77$search_date_startday =
GETPOSTINT(
'search_date_startday');
78$search_date_start =
GETPOSTDATE(
'search_date_start',
'getpost',
'auto',
'search_date_start_accountancy');
80$search_date_endyear =
GETPOSTINT(
'search_date_endyear');
81$search_date_endmonth =
GETPOSTINT(
'search_date_endmonth');
82$search_date_endday =
GETPOSTINT(
'search_date_endday');
83$search_date_end =
GETPOSTDATE(
'search_date_end',
'getpostend',
'auto',
'search_date_end_accountancy');
85$search_date_export_startyear =
GETPOSTINT(
'search_date_export_startyear');
86$search_date_export_startmonth =
GETPOSTINT(
'search_date_export_startmonth');
87$search_date_export_startday =
GETPOSTINT(
'search_date_export_startday');
88$search_date_export_start =
GETPOSTDATE(
'search_date_export_start',
'getpost');
90$search_date_export_endyear =
GETPOSTINT(
'search_date_export_endyear');
91$search_date_export_endmonth =
GETPOSTINT(
'search_date_export_endmonth');
92$search_date_export_endday =
GETPOSTINT(
'search_date_export_endday');
93$search_date_export_end =
GETPOSTDATE(
'search_date_export_start',
'getpostend');
95$search_date_validation_startyear =
GETPOSTINT(
'search_date_validation_startyear');
96$search_date_validation_startmonth =
GETPOSTINT(
'search_date_validation_startmonth');
97$search_date_validation_startday =
GETPOSTINT(
'search_date_validation_startday');
98$search_date_validation_start =
GETPOSTDATE(
'search_date_validation_start',
'getpost');
100$search_date_validation_endyear =
GETPOSTINT(
'search_date_validation_endyear');
101$search_date_validation_endmonth =
GETPOSTINT(
'search_date_validation_endmonth');
102$search_date_validation_endday =
GETPOSTINT(
'search_date_validation_endday');
103$search_date_validation_end =
GETPOSTDATE(
'search_date_validation_end',
'getpostend');
106$search_date_due_start_day =
GETPOSTINT(
'search_date_due_start_day');
107$search_date_due_start_month =
GETPOSTINT(
'search_date_due_start_month');
108$search_date_due_start_year =
GETPOSTINT(
'search_date_due_start_year');
109$search_date_due_start =
GETPOSTDATE(
'search_date_due_start_',
'getpost');
112$search_date_due_end_day =
GETPOSTINT(
'search_date_due_end_day');
113$search_date_due_end_month =
GETPOSTINT(
'search_date_due_end_month');
114$search_date_due_end_year =
GETPOSTINT(
'search_date_due_end_year');
115$search_date_due_end =
GETPOSTDATE(
'search_date_due_end_',
'getpostend');
117$search_import_key =
GETPOST(
"search_import_key",
'alpha');
119$search_account_category =
GETPOSTINT(
'search_account_category');
121$search_accountancy_code_start =
GETPOST(
'search_accountancy_code_start',
'alpha');
122if ($search_accountancy_code_start == - 1) {
123 $search_accountancy_code_start =
'';
125$search_accountancy_code_end =
GETPOST(
'search_accountancy_code_end',
'alpha');
126if ($search_accountancy_code_end == - 1) {
127 $search_accountancy_code_end =
'';
129$search_doc_ref =
GETPOST(
'search_doc_ref',
'alpha');
130$search_label_operation =
GETPOST(
'search_label_operation',
'alpha');
131$search_mvt_num =
GETPOST(
'search_mvt_num',
'alpha');
132$search_direction =
GETPOST(
'search_direction',
'alpha');
133$search_ledger_code =
GETPOST(
'search_ledger_code',
'array');
134$search_debit =
GETPOST(
'search_debit',
'alpha');
135$search_credit =
GETPOST(
'search_credit',
'alpha');
136$search_lettering_code =
GETPOST(
'search_lettering_code',
'alpha');
137$search_not_reconciled =
GETPOST(
'search_not_reconciled',
'alpha');
140 $action =
'delbookkeepingyear';
145$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
146$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
147$optioncss =
GETPOST(
'optioncss',
'alpha');
149if (empty($page) || $page < 0) {
152$offset = $limit * $page;
153$pageprev = $page - 1;
154$pagenext = $page + 1;
155if ($sortorder ==
"") {
158if ($sortfield ==
"") {
159 $sortfield =
"t.doc_date,t.rowid";
165$hookmanager->initHooks(array($context_default));
168$form =
new Form($db);
170if (empty($search_date_start) && empty($search_date_end) && !
GETPOSTISSET(
'search_date_startday') && !
GETPOSTISSET(
'search_date_startmonth') && !
GETPOSTISSET(
'search_date_starthour')) {
171 $sql =
"SELECT date_start, date_end";
172 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_fiscalyear ";
174 $sql .=
" WHERE rowid = " .
getDolGlobalInt(
'ACCOUNTANCY_FISCALYEAR_DEFAULT');
176 $sql .=
" WHERE date_start < '" . $db->idate(
dol_now()) .
"' and date_end > '" . $db->idate(
dol_now()) .
"'";
178 $sql .= $db->plimit(1);
179 $res = $db->query($sql);
181 if ($res !==
false && $db->num_rows($res) > 0) {
182 $fiscalYear = $db->fetch_object($res);
183 $search_date_start = strtotime($fiscalYear->date_start);
184 $search_date_end = strtotime($fiscalYear->date_end);
191 $year_end = $year_start + 1;
192 $month_end = $month_start - 1;
193 if ($month_end < 1) {
197 $search_date_start =
dol_mktime(0, 0, 0, $month_start, 1, $year_start);
204 't.piece_num' => array(
'label' =>
"TransactionNumShort",
'checked' =>
'1'),
205 't.code_journal' => array(
'label' =>
"Codejournal",
'checked' =>
'1'),
206 't.doc_date' => array(
'label' =>
"Docdate",
'checked' =>
'1'),
207 't.doc_ref' => array(
'label' =>
"Piece",
'checked' =>
'1'),
208 't.label_operation' => array(
'label' =>
"Label",
'checked' =>
'1'),
209 't.lettering_code' => array(
'label' =>
"Lettering",
'checked' =>
'1'),
210 't.debit' => array(
'label' =>
"AccountingDebit",
'checked' =>
'1'),
211 't.credit' => array(
'label' =>
"AccountingCredit",
'checked' =>
'1'),
212 't.balance' => array(
'label' =>
"Balance",
'checked' =>
'1'),
213 't.date_export' => array(
'label' =>
"DateExport",
'checked' =>
'-1'),
214 't.date_validated' => array(
'label' =>
"DateValidation",
'checked' =>
'-1',
'enabled' => (
string) (
int) !
getDolGlobalString(
"ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")),
215 't.date_lim_reglement' => array(
'label' =>
"DateDue",
'checked' =>
'0'),
216 't.import_key' => array(
'label' =>
"ImportId",
'checked' =>
'-1',
'position' => 1100),
220 unset($arrayfields[
't.lettering_code']);
223if ($search_date_start && empty($search_date_startyear)) {
225 $search_date_startyear = $tmparray[
'year'];
226 $search_date_startmonth = $tmparray[
'mon'];
227 $search_date_startday = $tmparray[
'mday'];
229if ($search_date_end && empty($search_date_endyear)) {
231 $search_date_endyear = $tmparray[
'year'];
232 $search_date_endmonth = $tmparray[
'mon'];
233 $search_date_endday = $tmparray[
'mday'];
239if ($user->socid > 0) {
242if (!$user->hasRight(
'accounting',
'mouvements',
'lire')) {
251$permissiontoread = $user->hasRight(
'accounting',
'mouvements',
'lire');
252$permissiontoadd = $user->hasRight(
'accounting',
'mouvements',
'creer');
253$permissiontodelete = $user->hasRight(
'accounting',
'mouvements',
'supprimer');
254$permissiontoexport = $user->hasRight(
'accounting',
'mouvements',
'export');
265if (
GETPOST(
'cancel',
'alpha')) {
269if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'preunletteringauto' && $massaction !=
'preunletteringmanual' && $massaction !=
'predeletebookkeepingwriting') {
273$parameters = array(
'socid' => $socid);
274$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
276 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
279if (empty($reshook)) {
280 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
282 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
283 $search_doc_date =
'';
284 $search_account_category =
'';
285 $search_accountancy_code_start =
'';
286 $search_accountancy_code_end =
'';
287 $search_label_account =
'';
288 $search_doc_ref =
'';
289 $search_label_operation =
'';
290 $search_mvt_num =
'';
291 $search_direction =
'';
292 $search_ledger_code = array();
293 $search_date_start =
'';
294 $search_date_end =
'';
295 $search_date_startyear =
'';
296 $search_date_startmonth =
'';
297 $search_date_startday =
'';
298 $search_date_endyear =
'';
299 $search_date_endmonth =
'';
300 $search_date_endday =
'';
301 $search_date_export_start =
'';
302 $search_date_export_end =
'';
303 $search_date_export_startyear =
'';
304 $search_date_export_startmonth =
'';
305 $search_date_export_startday =
'';
306 $search_date_export_endyear =
'';
307 $search_date_export_endmonth =
'';
308 $search_date_export_endday =
'';
309 $search_date_validation_start =
'';
310 $search_date_validation_end =
'';
311 $search_date_validation_startyear =
'';
312 $search_date_validation_startmonth =
'';
313 $search_date_validation_startday =
'';
314 $search_date_validation_endyear =
'';
315 $search_date_validation_endmonth =
'';
316 $search_date_validation_endday =
'';
318 $search_date_due_start_day =
'';
319 $search_date_due_start_month =
'';
320 $search_date_due_start_year =
'';
321 $search_date_due_start =
'';
323 $search_date_due_end_day =
'';
324 $search_date_due_end_month =
'';
325 $search_date_due_end_year =
'';
326 $search_date_due_end =
'';
327 $search_lettering_code =
'';
330 $search_not_reconciled =
'';
331 $search_import_key =
'';
333 unset($_SESSION[
'DOLDATE_search_date_start_accountancy_day']);
334 unset($_SESSION[
'DOLDATE_search_date_start_accountancy_month']);
335 unset($_SESSION[
'DOLDATE_search_date_start_accountancy_year']);
336 unset($_SESSION[
'DOLDATE_search_date_end_accountancy_day']);
337 unset($_SESSION[
'DOLDATE_search_date_end_accountancy_month']);
338 unset($_SESSION[
'DOLDATE_search_date_end_accountancy_year']);
341 if (!empty($socid)) {
342 $param =
'&socid='.$socid;
344 if (!empty($search_date_start)) {
345 $filter[
't.doc_date>='] = $search_date_start;
346 $param .=
'&search_date_startmonth='.$search_date_startmonth.
'&search_date_startday='.$search_date_startday.
'&search_date_startyear='.$search_date_startyear;
348 if (!empty($search_date_end)) {
349 $filter[
't.doc_date<='] = $search_date_end;
350 $param .=
'&search_date_endmonth='.$search_date_endmonth.
'&search_date_endday='.$search_date_endday.
'&search_date_endyear='.$search_date_endyear;
352 if (!empty($search_doc_date)) {
353 $filter[
't.doc_date'] = $search_doc_date;
354 $param .=
'&doc_datemonth='.GETPOSTINT(
'doc_datemonth').
'&doc_dateday='.
GETPOSTINT(
'doc_dateday').
'&doc_dateyear='.
GETPOSTINT(
'doc_dateyear');
356 if ($search_account_category !=
'-1' && !empty($search_account_category)) {
357 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountancycategory.class.php';
360 $listofaccountsforgroup = $accountingcategory->getCptsCat(0,
'fk_accounting_category = '.((
int) $search_account_category));
361 $listofaccountsforgroup2 = array();
362 if (is_array($listofaccountsforgroup)) {
363 foreach ($listofaccountsforgroup as $tmpval) {
364 $listofaccountsforgroup2[] =
"'".$db->escape((
string) $tmpval[
'account_number']).
"'";
367 if (!empty($listofaccountsforgroup2)) {
368 $filter[
't.search_accounting_code_in'] = implode(
',', $listofaccountsforgroup2);
370 $filter[
't.search_accounting_code_in'] =
"''";
371 setEventMessages($langs->trans(
"ThisCategoryHasNoItems"),
null,
'warnings');
373 $param .=
'&search_account_category='.urlencode((
string) ($search_account_category));
375 if (!empty($search_accountancy_code_start)) {
376 if ($type ==
'sub') {
377 $filter[
't.subledger_account>='] = $search_accountancy_code_start;
379 $filter[
't.numero_compte>='] = $search_accountancy_code_start;
381 $param .=
'&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
383 if (!empty($search_accountancy_code_end)) {
384 if ($type ==
'sub') {
385 $filter[
't.subledger_account<='] = $search_accountancy_code_end;
387 $filter[
't.numero_compte<='] = $search_accountancy_code_end;
389 $param .=
'&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
391 if (!empty($search_label_account)) {
392 $filter[
't.label_compte'] = $search_label_account;
393 $param .=
'&search_label_compte='.urlencode($search_label_account);
395 if (!empty($search_mvt_num)) {
396 $filter[
't.piece_num'] = $search_mvt_num;
397 $param .=
'&search_mvt_num='.urlencode((
string) ($search_mvt_num));
399 if (!empty($search_doc_ref)) {
400 $filter[
't.doc_ref'] = $search_doc_ref;
401 $param .=
'&search_doc_ref='.urlencode($search_doc_ref);
403 if (!empty($search_label_operation)) {
404 $filter[
't.label_operation'] = $search_label_operation;
405 $param .=
'&search_label_operation='.urlencode($search_label_operation);
407 if (!empty($search_direction)) {
408 $filter[
't.sens'] = $search_direction;
409 $param .=
'&search_direction='.urlencode($search_direction);
411 if (!empty($search_ledger_code)) {
412 $filter[
't.code_journal'] = $search_ledger_code;
413 foreach ($search_ledger_code as $code) {
414 $param .=
'&search_ledger_code[]='.urlencode($code);
417 if (!empty($search_lettering_code)) {
418 $filter[
't.lettering_code'] = $search_lettering_code;
419 $param .=
'&search_lettering_code='.urlencode($search_lettering_code);
421 if (!empty($search_debit)) {
422 $filter[
't.debit'] = $search_debit;
423 $param .=
'&search_debit='.urlencode($search_debit);
425 if (!empty($search_credit)) {
426 $filter[
't.credit'] = $search_credit;
427 $param .=
'&search_credit='.urlencode($search_credit);
429 if (!empty($search_not_reconciled)) {
430 $filter[
't.reconciled_option'] = $search_not_reconciled;
431 $param .=
'&search_not_reconciled='.urlencode($search_not_reconciled);
433 if (!empty($search_date_export_start)) {
434 $filter[
't.date_export>='] = $search_date_export_start;
435 $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;
437 if (!empty($search_date_export_end)) {
438 $filter[
't.date_export<='] = $search_date_export_end;
439 $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;
441 if (!empty($search_date_validation_start)) {
442 $filter[
't.date_validated>='] = $search_date_validation_start;
443 $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;
445 if (!empty($search_date_validation_end)) {
446 $filter[
't.date_validated<='] = $search_date_validation_end;
447 $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;
450 if (!empty($search_date_due_start)) {
451 $filter[
't.date_lim_reglement>='] = $search_date_due_start;
452 $param .=
'&search_date_due_start_day='.$search_date_due_start_day.
'&search_date_due_start_month='.$search_date_due_start_month.
'&search_date_due_start_year='.$search_date_due_start_year;
455 if (!empty($search_date_due_end)) {
456 $filter[
't.date_lim_reglement<='] = $search_date_due_end;
457 $param .=
'&search_date_due_end_day='.$search_date_due_end_day.
'&search_date_due_end_month='.$search_date_due_end_month.
'&search_date_due_end_year='.$search_date_due_end_year;
459 if (!empty($search_import_key)) {
460 $filter[
't.import_key'] = $search_import_key;
461 $param .=
'&search_import_key='.urlencode($search_import_key);
464 $url_param = substr($param, 1);
466 $param =
'&type='.$type.$param;
470 if ($action ===
'exporttopdf' && $permissiontoadd) {
471 if ($type ==
"sub") {
472 $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter,
'AND', 1);
474 $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
476 require_once DOL_DOCUMENT_ROOT .
'/core/modules/accountancy/doc/pdf_ledger.modules.php';
478 $pdf->fromDate = $search_date_start;
479 $pdf->toDate = $search_date_end;
480 $pdf->ledgerType = $type;
482 $result = $pdf->write_file($object, $langs);
485 setEventMessage($pdf->error,
"errors");
493 $objectclass =
'Bookkeeping';
494 $objectlabel =
'Bookkeeping';
495 $uploaddir =
$conf->societe->dir_output;
499 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
501 if (!$error && $action ==
'deletebookkeepingwriting' && $confirm ==
"yes" && $user->hasRight(
'accounting',
'mouvements',
'supprimer')) {
506 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect,
true);
507 if ($nb_lettering < 0) {
508 setEventMessages(
'', $lettering->errors,
'errors');
515 foreach ($toselect as $toselectid) {
516 $result =
$object->fetch($toselectid);
517 if ($result > 0 && (!isset(
$object->date_validation) ||
$object->date_validation ===
'')) {
521 } elseif ($result == 0) {
522 setEventMessages($langs->trans(
"ErrorBookkeepingDocDateNotOnActiveFiscalPeriod"),
null,
'errors');
530 } elseif ($result < 0) {
534 } elseif (isset(
$object->date_validation) &&
$object->date_validation !=
'') {
535 setEventMessages($langs->trans(
"ValidatedRecordWhereFound"),
null,
'errors');
547 setEventMessages($langs->trans(
"RecordsDeleted", $nbok),
null,
'mesgs');
548 } elseif ($nbok > 0) {
549 setEventMessages($langs->trans(
"RecordDeleted", $nbok),
null,
'mesgs');
551 setEventMessages($langs->trans(
"NoRecordDeleted"),
null,
'mesgs');
554 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?noreset=1".($param ?
'&'.$param :
''));
562 if (!$error && $action ==
'clonebookkeepingwriting' && $confirm ==
"yes" && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
563 $result =
$object->newCloneMass($toselect, $journal_code, $massdate);
570 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?noreset=1".($param ?
'&'.$param :
''));
578 if (!$error && $action ==
'assignaccountbookkeepingwriting' && $confirm ==
"yes" && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
579 $result =
$object->assignAccountMass($toselect, (
int) $account);
586 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?noreset=1".($param ?
'&'.$param :
''));
594 if (!$error && $action ==
'returnaccountbookkeepingwriting' && $confirm ==
"yes" && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
595 $result =
$object->newReturnAccount($toselect, $journal_code, $massdate);
602 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?noreset=1".($param ?
'&'.$param :
''));
611 if ($massaction ==
'generalmatchingmanual' && $permissiontoadd) {
613 $result = $lettering->updateGeneralMatching($toselect);
615 setEventMessages(
'', $lettering->errors,
'errors');
617 setEventMessages($langs->trans($result == 0 ?
'AccountancyNoMachingModified' :
'AccountancyOneMatchingModifiedSuccessfully'), array(),
'mesgs');
618 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
621 } elseif ($massaction ==
'generalmatchingpartial' && $permissiontoadd) {
623 $result = $lettering->updateGeneralMatching($toselect,
true);
625 setEventMessages(
'', $lettering->errors,
'errors');
627 setEventMessages($langs->trans($result == 0 ?
'AccountancyNoMachingModified' :
'AccountancyOneMatchingModifiedSuccessfully'), array(),
'mesgs');
628 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
631 } elseif ($action ==
'generalunmatchingmanual' && $confirm ==
'yes' && $permissiontodelete) {
633 $result = $lettering->deleteGeneralMatching($toselect);
635 setEventMessages(
'', $lettering->errors,
'errors');
637 setEventMessages($langs->trans($result == 0 ?
'AccountancyNoUnmatchingModified' :
'AccountancyOneUnmatchingModifiedSuccessfully'), array(),
'mesgs');
638 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
641 } elseif ($type ==
'sub' && $massaction ==
'letteringauto' && $permissiontoadd) {
643 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect);
644 if ($nb_lettering < 0) {
645 setEventMessages(
'', $lettering->errors,
'errors');
647 $nb_lettering = max(0, abs($nb_lettering) - 2);
648 } elseif ($nb_lettering == 0) {
650 setEventMessages($langs->trans(
'AccountancyNoMatchingModified'), array(),
'mesgs');
652 if ($nb_lettering == 1) {
653 setEventMessages($langs->trans(
'AccountancyOneMatchingModifiedSuccessfully'), array(),
'mesgs');
654 } elseif ($nb_lettering > 1) {
655 setEventMessages($langs->trans(
'AccountancyMatchingModifiedSuccessfully', $nb_lettering), array(),
'mesgs');
659 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
662 } elseif ($type ==
'sub' && $massaction ==
'letteringmanual' && $permissiontoadd) {
664 $result = $lettering->updateLettering($toselect);
666 setEventMessages(
'', $lettering->errors,
'errors');
668 setEventMessages($langs->trans($result == 0 ?
'AccountancyNoMatchingModified' :
'AccountancyOneMatchingModifiedSuccessfully'), array(),
'mesgs');
669 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
672 } elseif ($type ==
'sub' && $massaction ==
'letteringpartial' && $permissiontoadd) {
674 $result = $lettering->updateLettering($toselect, 0,
true);
676 setEventMessages(
'', $lettering->errors,
'errors');
678 setEventMessages($langs->trans($result == 0 ?
'AccountancyNoMatchingModified' :
'AccountancyOneMatchingModifiedSuccessfully'), array(),
'mesgs');
679 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
682 } elseif ($type ==
'sub' && $action ==
'unletteringauto' && $confirm ==
"yes" && $permissiontoadd) {
684 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect,
true);
685 if ($nb_lettering < 0) {
686 setEventMessages(
'', $lettering->errors,
'errors');
688 $nb_lettering = max(0, abs($nb_lettering) - 2);
689 } elseif ($nb_lettering == 0) {
691 setEventMessages($langs->trans(
'AccountancyNoUnmatchingModified'), array(),
'mesgs');
693 if ($nb_lettering == 1) {
694 setEventMessages($langs->trans(
'AccountancyOneUnmatchingModifiedSuccessfully'), array(),
'mesgs');
695 } elseif ($nb_lettering > 1) {
696 setEventMessages($langs->trans(
'AccountancyUnmatchingModifiedSuccessfully', $nb_lettering), array(),
'mesgs');
700 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
703 } elseif ($type ==
'sub' && $action ==
'unletteringmanual' && $confirm ==
"yes" && $permissiontoadd) {
705 $nb_lettering = $lettering->deleteLettering($toselect);
707 setEventMessages(
'', $lettering->errors,
'errors');
709 setEventMessages($langs->trans($result == 0 ?
'AccountancyNoUnmatchingModified' :
'AccountancyOneUnmatchingModifiedSuccessfully'), array(),
'mesgs');
710 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
725$form =
new Form($db);
727$title_page = $langs->trans(
"Operations").
' - '.$langs->trans(
"VueByAccountAccounting").
' (';
729 $title_page .= $langs->trans(
"BookkeepingSubAccount");
731 $title_page .= $langs->trans(
"Bookkeeping");
734$help_url =
'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double';
735llxHeader(
'', $title_page, $help_url,
'', 0, 0,
'',
'',
'',
'mod-accountancy accountancy-consultation page-'.(($type ==
'sub') ?
'sub' :
'').
'ledger');
738 $companystatic =
new Societe($db);
739 $res = $companystatic->fetch($socid);
746 print
dol_get_fiche_head($head,
'accounting', $langs->trans(
"ThirdParty"), -1,
'company');
748 $linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
750 dol_banner_tab($companystatic,
'socid', $linkback, ($user->socid ? 0 : 1),
'rowid',
'nom');
752 print
'<div class="fichecenter">';
754 print
'<div class="underbanner clearboth"></div>';
755 print
'<table class="border centpercent tableforfield">';
758 print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
759 print $companystatic->getTypeUrl(1);
763 if ($companystatic->client && !empty($companystatic->code_client)) {
764 print
'<tr><td class="titlefield">';
765 print $langs->trans(
'CustomerCode').
'</td><td>';
767 $tmpcheck = $companystatic->check_codeclient();
768 if ($tmpcheck != 0 && $tmpcheck != -5) {
769 print
' <span class="error">('.$langs->trans(
"WrongCustomerCode").
')</span>';
775 if ($companystatic->fournisseur && !empty($companystatic->code_fournisseur)) {
776 print
'<tr><td class="titlefield">';
777 print $langs->trans(
'SupplierCode').
'</td><td>';
779 $tmpcheck = $companystatic->check_codefournisseur();
780 if ($tmpcheck != 0 && $tmpcheck != -5) {
781 print
' <span class="error">('.$langs->trans(
"WrongSupplierCode").
')</span>';
791 print
info_admin($langs->trans(
"WarningThisPageContainsOnlyEntriesTransferredInAccounting"));
795 if (!empty(
$conf->dol_use_jmobile)) {
796 print
"\n".
'<div class="fichecenter"><div class="nowrap">'.
"\n";
799 if ($companystatic->client && !empty($companystatic->code_compta_client)) {
800 if ($mode !=
'customer') {
801 if (!empty($companystatic->code_compta_client)) {
802 $subledger_start_account = $subledger_end_account = $companystatic->code_compta_client;
804 $subledger_start_account = $subledger_end_account =
'';
806 print
'<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="' . $_SERVER[
"PHP_SELF"] .
'?mode=customer&socid='.$socid.
'&type=sub&search_accountancy_code_start='.$subledger_start_account.
'&search_accountancy_code_end='.$subledger_end_account.
'">';
808 print
'<span class="a-mesure marginleftonly marginrightonly">';
811 print $langs->trans(
"CustomerAccountancyCodeShort");
812 if ($mode !=
'customer') {
819 if ($companystatic->fournisseur && !empty($companystatic->code_compta_fournisseur)) {
820 if ($mode !=
'supplier') {
821 if (!empty($companystatic->code_compta_fournisseur)) {
822 $subledger_start_account = $subledger_end_account = $companystatic->code_compta_fournisseur;
824 $subledger_start_account = $subledger_end_account =
'';
826 print
'<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="' . $_SERVER[
"PHP_SELF"] .
'?mode=supplier&socid='.$socid.
'&type=sub&search_accountancy_code_start='.$subledger_start_account.
'&search_accountancy_code_end='.$subledger_end_account.
'">';
828 print
'<span class="a-mesure marginleftonly marginrightonly">';
830 print $langs->trans(
"SupplierAccountancyCodeShort");
831 if ($mode !=
'supplier') {
838 if (!empty(
$conf->dol_use_jmobile)) {
839 print
'</div></div>';
848$nbtotalofrecords =
'';
851 if ($type ==
'sub') {
852 $nbtotalofrecords =
$object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter,
'AND', 1, 1);
854 $nbtotalofrecords =
$object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter,
'AND', 0, 1);
857 if ($nbtotalofrecords < 0) {
865 if ($type ==
'sub') {
866 $result =
$object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter,
'AND', 1);
868 $result =
$object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter,
'AND', 0);
878$arrayofselected = is_array($toselect) ? $toselect : array();
885$arrayofmassactions = array();
886if (
getDolGlobalInt(
'ACCOUNTING_ENABLE_LETTERING') && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
887 if ($type ==
'sub') {
889 $arrayofmassactions[
'letteringauto'] = img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'LetteringAuto');
890 $arrayofmassactions[
'preunletteringauto'] = img_picto(
'',
'uncheck',
'class="pictofixedwidth"') . $langs->trans(
'UnletteringAuto');
891 $arrayofmassactions[
'letteringmanual'] = img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'LetteringManual');
892 $arrayofmassactions[
'letteringpartial'] = img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'LetteringPartial');
893 $arrayofmassactions[
'preunletteringmanual'] = img_picto(
'',
'uncheck',
'class="pictofixedwidth"') . $langs->trans(
'UnletteringManual');
896 $arrayofmassactions[
'generalmatchingmanual'] = img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'GeneralMatchingManual');
897 $arrayofmassactions[
'generalmatchingpartial'] = img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'GeneralMatchingPartial');
898 $arrayofmassactions[
'pregeneralunmatchingmanual'] = img_picto(
'',
'uncheck',
'class="pictofixedwidth"') . $langs->trans(
'GeneralUnmatchingManual');
901if ($user->hasRight(
'accounting',
'mouvements',
'creer')) {
902 $arrayofmassactions[
'preclonebookkeepingwriting'] = img_picto(
'',
'clone',
'class="pictofixedwidth"').$langs->trans(
"Clone");
904if ($user->hasRight(
'accounting',
'mouvements',
'creer')) {
905 $arrayofmassactions[
'preassignaccountbookkeepingwriting'] = img_picto(
'',
'fa-exchange-alt',
'class="pictofixedwidth"').$langs->trans(
"AssignAccount");
907if ($user->hasRight(
'accounting',
'mouvements',
'creer')) {
908 $arrayofmassactions[
'prereturnaccountbookkeepingwriting'] = img_picto(
'',
'undo',
'class="pictofixedwidth"').$langs->trans(
"ReturnAccount");
910if ($user->hasRight(
'accounting',
'mouvements',
'supprimer')) {
911 $arrayofmassactions[
'predeletebookkeepingwriting'] = img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
914if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'preunletteringauto',
'preunletteringmanual',
'pregeneralunmatchingmanual',
'predeletebookkeepingwriting',
'preclonebookkeepingwriting',
'preassignaccountbookkeepingwriting',
'prereturnaccountbookkeepingwriting'))) {
915 $arrayofmassactions = array();
917$massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions);
919print
'<form method="POST" id="searchFormList" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
920print
'<input type="hidden" name="token" value="'.newToken().
'">';
921print
'<input type="hidden" name="action" value="list">';
922if ($optioncss !=
'') {
923 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
925print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
926print
'<input type="hidden" name="type" value="'.$type.
'">';
928 print
'<input type="hidden" name="socid" value="' . $socid .
'">';
930print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
931print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
932print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
934$parameters = array(
'param' => $param);
935$reshook = $hookmanager->executeHooks(
'addMoreActionsButtonsList', $parameters, $object, $action);
937 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
940$newcardbutton = empty($hookmanager->resPrint) ?
'' : $hookmanager->resPrint;
942if (empty($reshook)) {
945 $newcardbutton =
dolGetButtonTitle($langs->trans(
'ViewFlatList'),
'',
'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/list.php?' . $param);
946 if ($type ==
'sub') {
947 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly'));
948 $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'));
950 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly btnTitleSelected'));
951 $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'));
954 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'ExportToPdf'),
'',
'fa fa-file-pdf paddingleft', $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=exporttopdf'.(!empty($type) ?
'&type=sub' :
'').
'&' . $url_param,
'', $permissiontoexport, array(
'morecss' =>
'marginleftonly'));
958 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewAccountingMvt'),
'',
'fa fa-plus-circle paddingleft', DOL_URL_ROOT.
'/accountancy/bookkeeping/card.php?action=create'.(!empty($type) ?
'&type=sub' :
'').
'&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
961if ($contextpage != $_SERVER[
"PHP_SELF"]) {
962 $param .=
'&contextpage='.urlencode($contextpage);
964if ($limit > 0 && $limit !=
$conf->liste_limit) {
965 $param .=
'&limit='.((int) $limit);
968print_barre_liste($title_page, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'title_accountancy', 0, $newcardbutton,
'', $limit, 0, 0, 1);
970if ($massaction ==
'preunletteringauto') {
971 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassUnletteringAuto"), $langs->trans(
"ConfirmMassUnletteringQuestion", count($toselect)),
"unletteringauto",
null,
'', 0, 200, 500, 1);
972} elseif ($massaction ==
'preunletteringmanual') {
973 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassUnletteringManual"), $langs->trans(
"ConfirmMassUnletteringQuestion", count($toselect)),
"unletteringmanual",
null,
'', 0, 200, 500, 1);
974} elseif ($massaction ==
'pregeneralunmatchingmanual') {
975 print $form->formconfirm($_SERVER[
'PHP_SELF'], $langs->trans(
'ConfirmMassGeneralUnmatchingManual'), $langs->trans(
'ConfirmMassGeneralUnmatchingQuestion', count($toselect)),
'generalunmatchingmanual',
null,
'', 0, 200, 500, 1);
976} elseif ($massaction ==
'predeletebookkeepingwriting') {
977 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassDeleteBookkeepingWriting"), $langs->trans(
"ConfirmMassDeleteBookkeepingWritingQuestion", count($toselect)),
"deletebookkeepingwriting",
null,
'', 0, 200, 500, 1);
978} elseif ($massaction ==
'preassignaccountbookkeepingwriting') {
979 $input = $formaccounting->select_account(
'',
'account', 1);
980 $formquestion = array(array(
'type' =>
'other',
'name' =>
'account',
'label' =>
'<span class="fieldrequired">' . $langs->trans(
"AccountAccountingShort") .
'</span>',
'value' => $input),);
981 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"confirmMassAssignAccountBookkeepingWritingConfirm"), $langs->trans(
"ConfirmMassAssignAccountBookkeepingWritingQuestion", count($toselect)),
"assignaccountbookkeepingwriting", $formquestion,
'', 0, 200, 500, 1);
982} elseif ($massaction ==
'preclonebookkeepingwriting') {
983 $input1 = $form->selectDate(
'',
'massdate', 0, 0, 0,
"create_mvt", 1, 1);
984 $input2 = $formaccounting->select_journal($journal_code,
'code_journal', 0, 0, 1, 1).
'</td>';
985 $formquestion = array(
988 'name' =>
'massdate',
989 'label' =>
'<span class="fieldrequired">' . $langs->trans(
"Docdate") .
'</span>',
995 $formquestion[] = array(
997 'name' =>
'code_journal',
998 'label' =>
'<span class="fieldrequired">' . $langs->trans(
"Codejournal") .
'</span>',
1003 print $form->formconfirm(
1004 $_SERVER[
"PHP_SELF"],
1005 $langs->trans(
"ConfirmMassCloneBookkeepingWriting"),
1006 $langs->trans(
"ConfirmMassCloneBookkeepingWritingQuestion", count($toselect)),
1007 "clonebookkeepingwriting",
1011} elseif ($massaction ==
'prereturnaccountbookkeepingwriting') {
1012 $input1 = $form->selectDate(
'',
'massdate', 0, 0, 0,
"create_mvt", 1, 1);
1013 $formquestion = array(array(
'type' =>
'other',
'name' =>
'massdate',
'label' =>
'<span class="fieldrequired">' . $langs->trans(
"Docdate") .
'</span>',
'value' => $input1));
1014 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassReturnAccountBookkeepingWriting"), $langs->trans(
"ConfirmMassReturnAccountBookkeepingWritingQuestion", count($toselect)),
"returnaccountbookkeepingwriting", $formquestion,
'', 0, 200, 500, 1);
1017include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1019$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1020$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
1021if ($massactionbutton && $contextpage !=
'poslist') {
1022 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
1026if (preg_match(
'/^asc/i', $sortorder)) {
1029 $sortorder =
"desc";
1033if ($type ==
'sub' && !$socid) {
1034 print
info_admin($langs->trans(
"WarningRecordWithoutSubledgerAreExcluded"));
1041$moreforfilter .=
'<div class="divsearchfield">';
1042$moreforfilter .= $langs->trans(
'AccountAccounting').
': ';
1043$moreforfilter .=
'<div class="nowrap inline-block">';
1044if ($type ==
'sub') {
1045 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'),
'maxwidth200');
1047 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'), array(), 1, 1,
'maxwidth200');
1049$moreforfilter .=
' ';
1050if ($type ==
'sub') {
1051 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'),
'maxwidth200');
1053 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'), array(), 1, 1,
'maxwidth200');
1057 $moreforfilter .=
' <a id="previous_account" accesskey="p" title="' .
$conf->browser->stringforfirstkey .
' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>';
1058 $moreforfilter .=
' <a id="next_account" accesskey="n" title="' .
$conf->browser->stringforfirstkey .
' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>';
1059 $moreforfilter .= <<<SCRIPT
1060<script
type=
"text/javascript">
1061 jQuery(document).ready(
function() {
1062 var searchFormList = $(
'#searchFormList');
1063 var searchAccountancyCodeStart = $(
'#search_accountancy_code_start');
1064 var searchAccountancyCodeEnd = $(
'#search_accountancy_code_end');
1065 jQuery(
'#previous_account').on(
'click',
function() {
1066 var previousOption = searchAccountancyCodeStart.find(
'option:selected').prev(
'option');
1067 if (previousOption.length == 1) searchAccountancyCodeStart.val(previousOption.attr(
'value'));
1068 searchAccountancyCodeEnd.val(searchAccountancyCodeStart.val());
1069 searchFormList.submit();
1071 jQuery(
'#next_account').on(
'click',
function() {
1072 var nextOption = searchAccountancyCodeStart.find(
'option:selected').next(
'option');
1073 if (nextOption.length == 1) searchAccountancyCodeStart.val(nextOption.attr(
'value'));
1074 searchAccountancyCodeEnd.val(searchAccountancyCodeStart.val());
1075 searchFormList.submit();
1077 jQuery(
'input[name="search_mvt_num"]').on(
"keypress",
function(event) {
1084$moreforfilter .=
'</div>';
1085$moreforfilter .=
'</div>';
1088 $moreforfilter .=
'<div class="divsearchfield">';
1089 $moreforfilter .= $langs->trans(
'AccountingCategory') .
': ';
1090 $moreforfilter .=
'<div class="nowrap inline-block">';
1091 $moreforfilter .= $formaccounting->select_accounting_category($search_account_category,
'search_account_category', 1, 0, 0, 0);
1092 $moreforfilter .=
'</div>';
1093 $moreforfilter .=
'</div>';
1096$parameters = array();
1097$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1098if (empty($reshook)) {
1099 $moreforfilter .= $hookmanager->resPrint;
1101 $moreforfilter = $hookmanager->resPrint;
1104print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1105print $moreforfilter;
1108print
'<div class="div-table-responsive">';
1109print
'<table class="tagtable liste centpercent listwithfilterbefore">';
1112print
'<tr class="liste_titre_filter">';
1114if (
$conf->main_checkbox_left_column) {
1115 print
'<td class="liste_titre center">';
1116 $searchpicto = $form->showFilterButtons(
'left');
1121if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
1122 print
'<td class="liste_titre"><input type="text" name="search_mvt_num" class="width50" value="'.dol_escape_htmltag($search_mvt_num).
'"></td>';
1125if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
1126 print
'<td class="liste_titre center">';
1127 print $formaccounting->multi_select_journal($search_ledger_code,
'search_ledger_code', 0, 1, 1, 1,
'maxwidth75');
1131if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
1132 print
'<td class="liste_titre center">';
1133 print
'<div class="nowrapfordate">';
1134 print $form->selectDate($search_date_start,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
1136 print
'<div class="nowrapfordate">';
1137 print $form->selectDate($search_date_end,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
1142if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
1143 print
'<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).
'"/></td>';
1146if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
1147 print
'<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="'.dol_escape_htmltag($search_label_operation).
'"/></td>';
1150if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1151 print
'<td class="liste_titre center">';
1152 print
'<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.
'"/>';
1153 print
'<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled ==
'notreconciled' ?
' checked' :
'').
'>'.$langs->trans(
"NotReconciled").
'</span>';
1157if (!empty($arrayfields[
't.debit'][
'checked'])) {
1158 print
'<td class="liste_titre right"><input type="text" class="flat" name="search_debit" size="4" value="'.dol_escape_htmltag($search_debit).
'"></td>';
1161if (!empty($arrayfields[
't.credit'][
'checked'])) {
1162 print
'<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).
'"></td>';
1165if (!empty($arrayfields[
't.balance'][
'checked'])) {
1169if (!empty($arrayfields[
't.date_export'][
'checked'])) {
1170 print
'<td class="liste_titre center">';
1171 print
'<div class="nowrapfordate">';
1172 print $form->selectDate($search_date_export_start,
'search_date_export_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
1174 print
'<div class="nowrapfordate">';
1175 print $form->selectDate($search_date_export_end,
'search_date_export_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
1180if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
1181 print
'<td class="liste_titre center">';
1182 print
'<div class="nowrapfordate">';
1183 print $form->selectDate($search_date_validation_start,
'search_date_validation_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
1185 print
'<div class="nowrapfordate">';
1186 print $form->selectDate($search_date_validation_end,
'search_date_validation_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
1191if (!empty($arrayfields[
't.date_lim_reglement'][
'checked'])) {
1192 print
'<td class="liste_titre center">';
1193 print
'<div class="nowrapfordate">';
1194 print $form->selectDate($search_date_due_start,
'search_date_due_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
1196 print
'<div class="nowrapfordate">';
1197 print $form->selectDate($search_date_due_end,
'search_date_due_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
1201if (!empty($arrayfields[
't.import_key'][
'checked'])) {
1202 print
'<td class="liste_titre center">';
1203 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1208$parameters = array(
'arrayfields' => $arrayfields);
1209$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1210print $hookmanager->resPrint;
1213if (!
$conf->main_checkbox_left_column) {
1214 print
'<td class="liste_titre center">';
1215 $searchpicto = $form->showFilterButtons();
1221print
'<tr class="liste_titre">';
1222if (
$conf->main_checkbox_left_column) {
1223 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1225if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
1226 print_liste_field_titre($arrayfields[
't.piece_num'][
'label'], $_SERVER[
'PHP_SELF'],
"t.piece_num",
"", $param,
'', $sortfield, $sortorder,
'tdoverflowmax80imp ');
1228if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
1229 print_liste_field_titre($arrayfields[
't.code_journal'][
'label'], $_SERVER[
'PHP_SELF'],
"t.code_journal",
"", $param,
'', $sortfield, $sortorder,
'center ');
1231if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
1232 print_liste_field_titre($arrayfields[
't.doc_date'][
'label'], $_SERVER[
'PHP_SELF'],
"t.doc_date",
"", $param,
'', $sortfield, $sortorder,
'center ');
1234if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
1235 print_liste_field_titre($arrayfields[
't.doc_ref'][
'label'], $_SERVER[
'PHP_SELF'],
"t.doc_ref",
"", $param,
"", $sortfield, $sortorder);
1237if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
1238 print_liste_field_titre($arrayfields[
't.label_operation'][
'label'], $_SERVER[
'PHP_SELF'],
"t.label_operation",
"", $param,
"", $sortfield, $sortorder);
1240if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1241 print_liste_field_titre($arrayfields[
't.lettering_code'][
'label'], $_SERVER[
'PHP_SELF'],
"t.lettering_code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1243if (!empty($arrayfields[
't.debit'][
'checked'])) {
1244 print_liste_field_titre($arrayfields[
't.debit'][
'label'], $_SERVER[
'PHP_SELF'],
"t.debit",
"", $param,
'', $sortfield, $sortorder,
'right ');
1246if (!empty($arrayfields[
't.credit'][
'checked'])) {
1247 print_liste_field_titre($arrayfields[
't.credit'][
'label'], $_SERVER[
'PHP_SELF'],
"t.credit",
"", $param,
'', $sortfield, $sortorder,
'right ');
1249if (!empty($arrayfields[
't.balance'][
'checked'])) {
1250 print_liste_field_titre($arrayfields[
't.balance'][
'label'],
"",
"",
"", $param,
'', $sortfield, $sortorder,
'right ');
1252if (!empty($arrayfields[
't.date_export'][
'checked'])) {
1253 print_liste_field_titre($arrayfields[
't.date_export'][
'label'], $_SERVER[
'PHP_SELF'],
"t.date_export",
"", $param,
'', $sortfield, $sortorder,
'center ');
1255if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
1256 print_liste_field_titre($arrayfields[
't.date_validated'][
'label'], $_SERVER[
'PHP_SELF'],
"t.date_validated",
"", $param,
'', $sortfield, $sortorder,
'center ');
1259if (!empty($arrayfields[
't.date_lim_reglement'][
'checked'])) {
1260 print_liste_field_titre($arrayfields[
't.date_lim_reglement'][
'label'], $_SERVER[
'PHP_SELF'],
't.date_lim_reglement',
'', $param,
'', $sortfield, $sortorder,
'center ');
1262if (!empty($arrayfields[
't.import_key'][
'checked'])) {
1263 print_liste_field_titre($arrayfields[
't.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"t.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1266$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
1267$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1268print $hookmanager->resPrint;
1269if (!
$conf->main_checkbox_left_column) {
1270 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1274$displayed_account_number =
null;
1276$objectstatic =
null;
1284$totalarray = array();
1285$totalarray[
'nbfield'] = 0;
1286$sous_total_debit = 0;
1287$sous_total_credit = 0;
1288$totalarray[
'val'] = array();
1289$totalarray[
'val'][
'totaldebit'] = 0;
1290$totalarray[
'val'][
'totalcredit'] = 0;
1291$totalarray[
'val'][
'totalbalance'] = 0;
1300if (!empty($arrayfields[
't.piece_num'][
'checked'])) { $colspan++; }
1301if (!empty($arrayfields[
't.code_journal'][
'checked'])) { $colspan++; }
1302if (!empty($arrayfields[
't.doc_date'][
'checked'])) { $colspan++; }
1303if (!empty($arrayfields[
't.doc_ref'][
'checked'])) { $colspan++; }
1304if (!empty($arrayfields[
't.label_operation'][
'checked'])) { $colspan++; }
1305if (!empty($arrayfields[
't.date_export'][
'checked'])) { $colspanend++; }
1306if (!empty($arrayfields[
't.date_validated'][
'checked'])) { $colspanend++; }
1307if (!empty($arrayfields[
't.lettering_code'][
'checked'])) { $colspanend++; }
1308if (
$conf->main_checkbox_left_column) {
1313while ($i < min($num, $limit)) {
1316 if ($type ==
'sub') {
1325 if (
$conf->main_checkbox_left_column) {
1328 if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
1331 if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
1334 if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
1337 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
1340 if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
1343 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1347 if (!empty($arrayfields[
't.balance'][
'checked'])) {
1350 if (!empty($arrayfields[
't.date_export'][
'checked'])) {
1353 if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
1357 if (!empty($arrayfields[
't.date_lim_reglement'][
'checked'])) {
1360 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1363 if (!empty($arrayfields[
't.import_key'][
'checked'])) {
1366 if (!
$conf->main_checkbox_left_column) {
1372 if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
1374 if (isset($displayed_account_number)) {
1375 print
'<tr class="liste_total">';
1376 if ($type ==
'sub') {
1377 print
'<td class="right" colspan="' . $colspan .
'">' . $langs->trans(
"TotalForAccount") .
' ' .
length_accounta($displayed_account_number) .
':</td>';
1379 print
'<td class="right" colspan="' . $colspan .
'">' . $langs->trans(
"TotalForAccount") .
' ' .
length_accountg($displayed_account_number) .
':</td>';
1381 print
'<td class="nowrap right">'.price(
price2num($sous_total_debit,
'MT')).
'</td>';
1382 print
'<td class="nowrap right">'.price(
price2num($sous_total_credit,
'MT')).
'</td>';
1383 if ($colspanend > 0) {
1384 print
'<td colspan="'.$colspanend.
'"></td>';
1388 $balance = $sous_total_debit - $sous_total_credit;
1389 print
'<tr class="liste_total">';
1390 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"Balance").
':</td>';
1392 print
'<td class="nowraponall right">';
1393 print
price(
price2num($sous_total_debit - $sous_total_credit,
'MT'));
1398 print
'<td class="nowraponall right">';
1399 print
price(
price2num($sous_total_credit - $sous_total_debit,
'MT'));
1402 if ($colspanend > 0) {
1403 print
'<td colspan="'.$colspanend.
'"></td>';
1409 print
'<tr class="trforbreaknobg">';
1410 print
'<td colspan="'.($totalarray[
'nbfield'] ? $totalarray[
'nbfield'] : count($arrayfields) + 1).
'" class="tdforbreak">';
1411 if ($type ==
'sub') {
1412 if ($line->subledger_account !=
"" && $line->subledger_account !=
'-1') {
1413 print empty($line->subledger_label) ?
'<span class="error">'.$langs->trans(
"Unknown").
'</span>' : $line->subledger_label;
1418 print
'<span class="error">' . $langs->trans(
"Unknown");
1419 if ($line->subledger_label) {
1420 print
' (' . $line->subledger_label .
')';
1421 $htmltext =
'EmptyStringForSubledgerAccountButSubledgerLabelDefined';
1423 $htmltext =
'EmptyStringForSubledgerAccountAndSubledgerLabel';
1425 print $form->textwithpicto(
'', $htmltext);
1429 if ($line->numero_compte !=
"" && $line->numero_compte !=
'-1') {
1432 print
'<span class="error">' . $langs->trans(
"Unknown") .
'</span>';
1438 $displayed_account_number = $accountg;
1440 $sous_total_debit = 0;
1441 $sous_total_credit = 0;
1444 print
'<tr class="oddeven">';
1446 if (
$conf->main_checkbox_left_column) {
1447 print
'<td class="nowraponall center">';
1448 if (($massactionbutton || $massaction) && $contextpage !=
'poslist') {
1450 if (in_array($line->id, $arrayofselected)) {
1453 print
'<input id="cb' . $line->id .
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id .
'"' . ($selected ?
' checked="checked"' :
'') .
' />';
1457 $totalarray[
'nbfield']++;
1461 if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
1462 print
'<td class="nowraponall">';
1464 $object->piece_num = $line->piece_num;
1466 print
$object->getNomUrl(1,
'', 0,
'', 1);
1467 print
'<span class="hideonsmartphone">';
1468 if (!empty($line->date_export)) {
1469 print img_picto($langs->trans(
"DateExport").
": ".
dol_print_date($line->date_export,
'dayhour').
" (".$langs->trans(
"TransactionExportDesc").
")",
'fa-file-export',
'class="paddingleft pictofixedwidth opacitymedium"');
1471 if (!empty($line->date_validation)) {
1472 print img_picto($langs->trans(
"DateValidation").
": ".
dol_print_date($line->date_validation,
'dayhour').
" (".$langs->trans(
"TransactionBlockedLockedDesc").
")",
'fa-lock',
'class="paddingleft pictofixedwidth opacitymedium"');
1477 $totalarray[
'nbfield']++;
1482 if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
1484 $result = $accountingjournal->fetch(0, $line->code_journal);
1485 $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0,
'', 0) : $line->code_journal);
1486 print
'<td class="center tdoverflowmax80">'.$journaltoshow.
'</td>';
1488 $totalarray[
'nbfield']++;
1493 if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
1494 print
'<td class="center">'.dol_print_date($line->doc_date,
'day').
'</td>';
1496 $totalarray[
'nbfield']++;
1502 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
1503 if ($line->doc_type ==
'customer_invoice') {
1504 $langs->loadLangs(array(
'bills'));
1506 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1507 $objectstatic =
new Facture($db);
1508 $objectstatic->fetch($line->fk_doc);
1513 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$objectstatic->id;
1514 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1515 } elseif ($line->doc_type ==
'supplier_invoice') {
1516 $langs->loadLangs(array(
'bills'));
1518 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1520 $objectstatic->fetch($line->fk_doc);
1522 $modulepart =
'invoice_supplier';
1524 $filedir =
$conf->fournisseur->facture->dir_output.
'/'.
get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
1525 $subdir =
get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
1526 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
1527 } elseif ($line->doc_type ==
'expense_report') {
1528 $langs->loadLangs(array(
'trips'));
1530 require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
1532 $objectstatic->fetch($line->fk_doc);
1537 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$objectstatic->id;
1538 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1539 } elseif ($line->doc_type ==
'bank') {
1540 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1542 $objectstatic->fetch($line->fk_doc);
1547 print
'<td class="tdoverflowmax250">';
1550 if ($line->doc_type ==
'customer_invoice' || $line->doc_type ==
'supplier_invoice' || $line->doc_type ==
'expense_report') {
1551 print $objectstatic->getNomUrl(1,
'', 0, 0,
'', 0, -1, 1);
1552 print $documentlink;
1553 } elseif ($line->doc_type ==
'bank') {
1554 print $objectstatic->getNomUrl(1);
1555 $bank_ref = strstr($line->doc_ref,
'-');
1556 print
' <span class="classfortooltip" title="'.dol_escape_htmltag($line->doc_ref).
'">'.
dol_escape_htmltag($bank_ref).
'</span>';
1558 print $line->doc_ref;
1563 $totalarray[
'nbfield']++;
1568 if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
1570 $doc_ref = preg_replace(
'/\(.*\)/',
'', $line->doc_ref);
1572 print
'<td class="small tdoverflowmax350 classfortooltip" title="'.dol_escape_htmltag($line->label_operation).
'">'.
dol_escape_htmltag($line->label_operation).
'</td>';
1574 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>';
1577 $totalarray[
'nbfield']++;
1582 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1584 if (!empty($line->matching_general)) {
1585 $tooltipText .= $langs->trans(
'GeneralMatching');
1586 } elseif (empty($line->matching_general) && !empty($line->lettering_code)) {
1587 $tooltipText .= $langs->trans(
'AuxiliaryMatching');
1589 print
'<td class="center classfortooltip" title="'.$tooltipText.
'">';
1590 if ($type ==
'sub') {
1592 if (!empty($line->lettering_code)) {
1594 print
'<span class="badge badge-status1"><i class="fas fa-user fa-xs"></i> ' .
dol_escape_htmltag((
string) $line->lettering_code) .
'</span>';
1596 } elseif (!empty($line->matching_general) && !empty($line->lettering_code)) {
1597 print
'<span class="badge badge-status4"><i class="fas fa-book fa-xs"></i> ' .
dol_escape_htmltag((
string) $line->lettering_code) .
'</span>';
1600 if (!$i) $totalarray[
'nbfield']++;
1604 if (!empty($arrayfields[
't.debit'][
'checked'])) {
1605 print
'<td class="right nowraponall amount">'.($line->debit != 0 ?
price($line->debit) :
'').
'</td>';
1607 $totalarray[
'nbfield']++;
1610 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totaldebit';
1612 $totalarray[
'val'][
'totaldebit'] += (float) $line->debit;
1616 if (!empty($arrayfields[
't.credit'][
'checked'])) {
1617 print
'<td class="right nowraponall amount">'.($line->credit != 0 ?
price($line->credit) :
'').
'</td>';
1619 $totalarray[
'nbfield']++;
1622 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalcredit';
1624 $totalarray[
'val'][
'totalcredit'] += (float) $line->credit;
1628 if (!empty($arrayfields[
't.balance'][
'checked'])) {
1629 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_debit + $line->debit - $sous_total_credit - $line->credit,
'MT')).
'</td>';
1631 $totalarray[
'nbfield']++;
1634 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalbalance';
1636 $totalarray[
'val'][
'totalbalance'] += $line->debit - $line->credit;
1640 if (!empty($arrayfields[
't.date_export'][
'checked'])) {
1641 print
'<td class="center">'.dol_print_date($line->date_export,
'dayhour').
'</td>';
1643 $totalarray[
'nbfield']++;
1648 if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
1649 print
'<td class="center">'.dol_print_date($line->date_validation,
'dayhour').
'</td>';
1651 $totalarray[
'nbfield']++;
1656 if (!empty($arrayfields[
't.date_lim_reglement'][
'checked'])) {
1657 print
'<td class="center">'.dol_print_date($line->date_lim_reglement,
'day').
'</td>';
1659 $totalarray[
'nbfield']++;
1663 if (!empty($arrayfields[
't.import_key'][
'checked'])) {
1664 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($line->import_key).
'">'.
dol_escape_htmltag($line->import_key).
"</td>\n";
1666 $totalarray[
'nbfield']++;
1671 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $line);
1672 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1673 print $hookmanager->resPrint;
1676 if (!
$conf->main_checkbox_left_column) {
1677 print
'<td class="nowraponall center">';
1678 if (($massactionbutton || $massaction) && $contextpage !=
'poslist') {
1680 if (in_array($line->id, $arrayofselected)) {
1683 print
'<input id="cb' . $line->id .
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id .
'"' . ($selected ?
' checked="checked"' :
'') .
' />';
1687 $totalarray[
'nbfield']++;
1692 $sous_total_debit += $line->debit;
1693 $sous_total_credit += $line->credit;
1700if ($num > 0 && $colspan > 0) {
1701 print
'<tr class="liste_total">';
1702 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"TotalForAccount").
' '.$accountg.
':</td>';
1703 print
'<td class="nowrap right">'.price(
price2num($sous_total_debit,
'MT')).
'</td>';
1704 print
'<td class="nowrap right">'.price(
price2num($sous_total_credit,
'MT')).
'</td>';
1705 if ($colspanend > 0) {
1706 print
'<td colspan="'.$colspanend.
'"></td>';
1711 $balance = $sous_total_debit - $sous_total_credit;
1712 print
'<tr class="liste_total">';
1713 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"Balance").
':</td>';
1715 print
'<td class="nowraponall right">';
1716 print
price(
price2num($sous_total_debit - $sous_total_credit,
'MT'));
1721 print
'<td class="nowraponall right">';
1722 print
price(
price2num($sous_total_credit - $sous_total_debit,
'MT'));
1725 if ($colspanend > 0) {
1726 print
'<td colspan="'.$colspanend.
'"></td>';
1733if (!empty($totalarray[
'val'][
'totaldebit'])) {
1734 $totalarray[
'val'][
'totaldebit'] = (float)
price2num($totalarray[
'val'][
'totaldebit'],
'MT');
1736if (!empty($totalarray[
'val'][
'totalcredit'])) {
1737 $totalarray[
'val'][
'totalcredit'] = (float)
price2num($totalarray[
'val'][
'totalcredit'],
'MT');
1739if (!empty($totalarray[
'val'][
'totalbalance'])) {
1740 $totalarray[
'val'][
'totalbalance'] = (float)
price2num($totalarray[
'val'][
'totaldebit'] - $totalarray[
'val'][
'totalcredit'],
'MT');
1745include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1750 foreach ($arrayfields as $key => $val) {
1751 if (!empty($val[
'checked'])) {
1755 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1758$parameters = array(
'arrayfields' => $arrayfields);
1759$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1760print $hookmanager->resPrint;
if(! $sortfield) if(! $sortorder) $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.
$propal type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage bank 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.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to build sending documents with model Espadon.
societe_prepare_head(Societe $object, $subtabs='')
Return array of tabs to used on pages for third parties cards.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
dol_now($mode='gmt')
Return date for now.
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...
GETPOSTDATE($prefix, $hourTime='', $gm='auto', $saverestore='')
Helper function that combines values of a dolibarr DatePicker (such as Form\selectDate) for year,...
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
Show information in HTML for admin users or standard users.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.