31require
'../../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/lettering.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
52$langs->loadLangs(array(
"accountancy",
"categories",
"compta"));
54$journal_code =
GETPOST(
'code_journal',
'alpha');
55$account =
GETPOST(
"account",
'int');
58$action =
GETPOST(
'action',
'aZ09');
60$mode = (
GETPOST(
'mode',
'alpha') ?
GETPOST(
'mode',
'alpha') :
'customer');
61$massaction =
GETPOST(
'massaction',
'alpha');
62$confirm =
GETPOST(
'confirm',
'alpha');
63$toselect =
GETPOST(
'toselect',
'array');
64$type =
GETPOST(
'type',
'alpha');
66 $context_default =
'bookkeepingbysubaccountlist';
68 $context_default =
'bookkeepingbyaccountlist';
70$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : $context_default;
72$search_doc_date =
GETPOSTDATE(
'doc_date',
'getpost');
74$search_date_startyear =
GETPOSTINT(
'search_date_startyear');
75$search_date_startmonth =
GETPOSTINT(
'search_date_startmonth');
76$search_date_startday =
GETPOSTINT(
'search_date_startday');
77$search_date_start =
GETPOSTDATE(
'search_date_start',
'getpost',
'auto',
'search_date_start_accountancy');
79$search_date_endyear =
GETPOSTINT(
'search_date_endyear');
80$search_date_endmonth =
GETPOSTINT(
'search_date_endmonth');
81$search_date_endday =
GETPOSTINT(
'search_date_endday');
82$search_date_end =
GETPOSTDATE(
'search_date_end',
'getpostend',
'auto',
'search_date_end_accountancy');
84$search_date_export_startyear =
GETPOSTINT(
'search_date_export_startyear');
85$search_date_export_startmonth =
GETPOSTINT(
'search_date_export_startmonth');
86$search_date_export_startday =
GETPOSTINT(
'search_date_export_startday');
87$search_date_export_start =
GETPOSTDATE(
'search_date_export_start',
'getpost');
89$search_date_export_endyear =
GETPOSTINT(
'search_date_export_endyear');
90$search_date_export_endmonth =
GETPOSTINT(
'search_date_export_endmonth');
91$search_date_export_endday =
GETPOSTINT(
'search_date_export_endday');
92$search_date_export_end =
GETPOSTDATE(
'search_date_export_start',
'getpostend');
94$search_date_validation_startyear =
GETPOSTINT(
'search_date_validation_startyear');
95$search_date_validation_startmonth =
GETPOSTINT(
'search_date_validation_startmonth');
96$search_date_validation_startday =
GETPOSTINT(
'search_date_validation_startday');
97$search_date_validation_start =
GETPOSTDATE(
'search_date_validation_start',
'getpost');
99$search_date_validation_endyear =
GETPOSTINT(
'search_date_validation_endyear');
100$search_date_validation_endmonth =
GETPOSTINT(
'search_date_validation_endmonth');
101$search_date_validation_endday =
GETPOSTINT(
'search_date_validation_endday');
102$search_date_validation_end =
GETPOSTDATE(
'search_date_validation_end',
'getpostend');
105$search_date_due_start_day =
GETPOSTINT(
'search_date_due_start_day');
106$search_date_due_start_month =
GETPOSTINT(
'search_date_due_start_month');
107$search_date_due_start_year =
GETPOSTINT(
'search_date_due_start_year');
108$search_date_due_start =
GETPOSTDATE(
'search_date_due_start_',
'getpost');
111$search_date_due_end_day =
GETPOSTINT(
'search_date_due_end_day');
112$search_date_due_end_month =
GETPOSTINT(
'search_date_due_end_month');
113$search_date_due_end_year =
GETPOSTINT(
'search_date_due_end_year');
114$search_date_due_end =
GETPOSTDATE(
'search_date_due_end_',
'getpostend');
116$search_import_key =
GETPOST(
"search_import_key",
'alpha');
118$search_account_category =
GETPOSTINT(
'search_account_category');
120$search_accountancy_code_start =
GETPOST(
'search_accountancy_code_start',
'alpha');
121if ($search_accountancy_code_start == - 1) {
122 $search_accountancy_code_start =
'';
124$search_accountancy_code_end =
GETPOST(
'search_accountancy_code_end',
'alpha');
125if ($search_accountancy_code_end == - 1) {
126 $search_accountancy_code_end =
'';
128$search_doc_ref =
GETPOST(
'search_doc_ref',
'alpha');
129$search_label_operation =
GETPOST(
'search_label_operation',
'alpha');
130$search_mvt_num =
GETPOST(
'search_mvt_num',
'alpha');
131$search_direction =
GETPOST(
'search_direction',
'alpha');
132$search_ledger_code =
GETPOST(
'search_ledger_code',
'array');
133$search_debit =
GETPOST(
'search_debit',
'alpha');
134$search_credit =
GETPOST(
'search_credit',
'alpha');
135$search_lettering_code =
GETPOST(
'search_lettering_code',
'alpha');
136$search_not_reconciled =
GETPOST(
'search_not_reconciled',
'alpha');
139 $action =
'delbookkeepingyear';
144$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
145$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
146$optioncss =
GETPOST(
'optioncss',
'alpha');
148if (empty($page) || $page < 0) {
151$offset = $limit * $page;
152$pageprev = $page - 1;
153$pagenext = $page + 1;
154if ($sortorder ==
"") {
157if ($sortfield ==
"") {
158 $sortfield =
"t.doc_date,t.rowid";
164$hookmanager->initHooks(array($context_default));
167$form =
new Form($db);
169if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET(
'search_date_startday') && !GETPOSTISSET(
'search_date_startmonth') && !GETPOSTISSET(
'search_date_starthour')) {
170 $sql =
"SELECT date_start, date_end";
171 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_fiscalyear ";
173 $sql .=
" WHERE rowid = " .
getDolGlobalInt(
'ACCOUNTANCY_FISCALYEAR_DEFAULT');
175 $sql .=
" WHERE date_start < '" . $db->idate(
dol_now()) .
"' and date_end > '" . $db->idate(
dol_now()) .
"'";
177 $sql .= $db->plimit(1);
178 $res = $db->query($sql);
180 if ($res !==
false && $db->num_rows($res) > 0) {
181 $fiscalYear = $db->fetch_object($res);
182 $search_date_start = strtotime($fiscalYear->date_start);
183 $search_date_end = strtotime($fiscalYear->date_end);
190 $year_end = $year_start + 1;
191 $month_end = $month_start - 1;
192 if ($month_end < 1) {
196 $search_date_start =
dol_mktime(0, 0, 0, $month_start, 1, $year_start);
203 't.piece_num' => array(
'label' =>
"TransactionNumShort",
'checked' =>
'1'),
204 't.code_journal' => array(
'label' =>
"Codejournal",
'checked' =>
'1'),
205 't.doc_date' => array(
'label' =>
"Docdate",
'checked' =>
'1'),
206 't.doc_ref' => array(
'label' =>
"Piece",
'checked' =>
'1'),
207 't.label_operation' => array(
'label' =>
"Label",
'checked' =>
'1'),
208 't.lettering_code' => array(
'label' =>
"Lettering",
'checked' =>
'1'),
209 't.debit' => array(
'label' =>
"AccountingDebit",
'checked' =>
'1'),
210 't.credit' => array(
'label' =>
"AccountingCredit",
'checked' =>
'1'),
211 't.balance' => array(
'label' =>
"Balance",
'checked' =>
'1'),
212 't.date_export' => array(
'label' =>
"DateExport",
'checked' =>
'-1'),
213 't.date_validated' => array(
'label' =>
"DateValidation",
'checked' =>
'-1',
'enabled' => (
string) (
int) !
getDolGlobalString(
"ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")),
214 't.date_lim_reglement' => array(
'label' =>
"DateDue",
'checked' =>
'0'),
215 't.import_key' => array(
'label' =>
"ImportId",
'checked' =>
'-1',
'position' => 1100),
219 unset($arrayfields[
't.lettering_code']);
222if ($search_date_start && empty($search_date_startyear)) {
224 $search_date_startyear = $tmparray[
'year'];
225 $search_date_startmonth = $tmparray[
'mon'];
226 $search_date_startday = $tmparray[
'mday'];
228if ($search_date_end && empty($search_date_endyear)) {
230 $search_date_endyear = $tmparray[
'year'];
231 $search_date_endmonth = $tmparray[
'mon'];
232 $search_date_endday = $tmparray[
'mday'];
235if (!isModEnabled(
'accounting')) {
238if ($user->socid > 0) {
241if (!$user->hasRight(
'accounting',
'mouvements',
'lire')) {
250$permissiontoread = $user->hasRight(
'accounting',
'mouvements',
'lire');
251$permissiontoadd = $user->hasRight(
'accounting',
'mouvements',
'creer');
252$permissiontodelete = $user->hasRight(
'accounting',
'mouvements',
'supprimer');
253$permissiontoexport = $user->hasRight(
'accounting',
'mouvements',
'export');
264if (
GETPOST(
'cancel',
'alpha')) {
268if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'preunletteringauto' && $massaction !=
'preunletteringmanual' && $massaction !=
'predeletebookkeepingwriting') {
272$parameters = array(
'socid' => $socid);
273$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
278if (empty($reshook)) {
279 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
281 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
282 $search_doc_date =
'';
283 $search_account_category =
'';
284 $search_accountancy_code_start =
'';
285 $search_accountancy_code_end =
'';
286 $search_label_account =
'';
287 $search_doc_ref =
'';
288 $search_label_operation =
'';
289 $search_mvt_num =
'';
290 $search_direction =
'';
291 $search_ledger_code = array();
292 $search_date_start =
'';
293 $search_date_end =
'';
294 $search_date_startyear =
'';
295 $search_date_startmonth =
'';
296 $search_date_startday =
'';
297 $search_date_endyear =
'';
298 $search_date_endmonth =
'';
299 $search_date_endday =
'';
300 $search_date_export_start =
'';
301 $search_date_export_end =
'';
302 $search_date_export_startyear =
'';
303 $search_date_export_startmonth =
'';
304 $search_date_export_startday =
'';
305 $search_date_export_endyear =
'';
306 $search_date_export_endmonth =
'';
307 $search_date_export_endday =
'';
308 $search_date_validation_start =
'';
309 $search_date_validation_end =
'';
310 $search_date_validation_startyear =
'';
311 $search_date_validation_startmonth =
'';
312 $search_date_validation_startday =
'';
313 $search_date_validation_endyear =
'';
314 $search_date_validation_endmonth =
'';
315 $search_date_validation_endday =
'';
317 $search_date_due_start_day =
'';
318 $search_date_due_start_month =
'';
319 $search_date_due_start_year =
'';
320 $search_date_due_start =
'';
322 $search_date_due_end_day =
'';
323 $search_date_due_end_month =
'';
324 $search_date_due_end_year =
'';
325 $search_date_due_end =
'';
326 $search_lettering_code =
'';
329 $search_not_reconciled =
'';
330 $search_import_key =
'';
332 unset($_SESSION[
'DOLDATE_search_date_start_accountancy_day']);
333 unset($_SESSION[
'DOLDATE_search_date_start_accountancy_month']);
334 unset($_SESSION[
'DOLDATE_search_date_start_accountancy_year']);
335 unset($_SESSION[
'DOLDATE_search_date_end_accountancy_day']);
336 unset($_SESSION[
'DOLDATE_search_date_end_accountancy_month']);
337 unset($_SESSION[
'DOLDATE_search_date_end_accountancy_year']);
340 if (!empty($socid)) {
341 $param =
'&socid='.$socid;
343 if (!empty($search_date_start)) {
344 $filter[
't.doc_date>='] = $search_date_start;
345 $param .=
'&search_date_startmonth='.$search_date_startmonth.
'&search_date_startday='.$search_date_startday.
'&search_date_startyear='.$search_date_startyear;
347 if (!empty($search_date_end)) {
348 $filter[
't.doc_date<='] = $search_date_end;
349 $param .=
'&search_date_endmonth='.$search_date_endmonth.
'&search_date_endday='.$search_date_endday.
'&search_date_endyear='.$search_date_endyear;
351 if (!empty($search_doc_date)) {
352 $filter[
't.doc_date'] = $search_doc_date;
353 $param .=
'&doc_datemonth='.GETPOSTINT(
'doc_datemonth').
'&doc_dateday='.
GETPOSTINT(
'doc_dateday').
'&doc_dateyear='.
GETPOSTINT(
'doc_dateyear');
355 if ($search_account_category !=
'-1' && !empty($search_account_category)) {
356 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountancycategory.class.php';
359 $listofaccountsforgroup = $accountingcategory->getCptsCat(0,
'fk_accounting_category = '.((
int) $search_account_category));
360 $listofaccountsforgroup2 = array();
361 if (is_array($listofaccountsforgroup)) {
362 foreach ($listofaccountsforgroup as $tmpval) {
363 $listofaccountsforgroup2[] =
"'".$db->escape((
string) $tmpval[
'account_number']).
"'";
366 if (!empty($listofaccountsforgroup2)) {
367 $filter[
't.search_accounting_code_in'] = implode(
',', $listofaccountsforgroup2);
369 $filter[
't.search_accounting_code_in'] =
"''";
370 setEventMessages($langs->trans(
"ThisCategoryHasNoItems"),
null,
'warnings');
372 $param .=
'&search_account_category='.urlencode((
string) ($search_account_category));
374 if (!empty($search_accountancy_code_start)) {
375 if ($type ==
'sub') {
376 $filter[
't.subledger_account>='] = $search_accountancy_code_start;
378 $filter[
't.numero_compte>='] = $search_accountancy_code_start;
380 $param .=
'&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
382 if (!empty($search_accountancy_code_end)) {
383 if ($type ==
'sub') {
384 $filter[
't.subledger_account<='] = $search_accountancy_code_end;
386 $filter[
't.numero_compte<='] = $search_accountancy_code_end;
388 $param .=
'&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
390 if (!empty($search_label_account)) {
391 $filter[
't.label_compte'] = $search_label_account;
392 $param .=
'&search_label_compte='.urlencode($search_label_account);
394 if (!empty($search_mvt_num)) {
395 $filter[
't.piece_num'] = $search_mvt_num;
396 $param .=
'&search_mvt_num='.urlencode((
string) ($search_mvt_num));
398 if (!empty($search_doc_ref)) {
399 $filter[
't.doc_ref'] = $search_doc_ref;
400 $param .=
'&search_doc_ref='.urlencode($search_doc_ref);
402 if (!empty($search_label_operation)) {
403 $filter[
't.label_operation'] = $search_label_operation;
404 $param .=
'&search_label_operation='.urlencode($search_label_operation);
406 if (!empty($search_direction)) {
407 $filter[
't.sens'] = $search_direction;
408 $param .=
'&search_direction='.urlencode($search_direction);
410 if (!empty($search_ledger_code)) {
411 $filter[
't.code_journal'] = $search_ledger_code;
412 foreach ($search_ledger_code as $code) {
413 $param .=
'&search_ledger_code[]='.urlencode($code);
416 if (!empty($search_lettering_code)) {
417 $filter[
't.lettering_code'] = $search_lettering_code;
418 $param .=
'&search_lettering_code='.urlencode($search_lettering_code);
420 if (!empty($search_debit)) {
421 $filter[
't.debit'] = $search_debit;
422 $param .=
'&search_debit='.urlencode($search_debit);
424 if (!empty($search_credit)) {
425 $filter[
't.credit'] = $search_credit;
426 $param .=
'&search_credit='.urlencode($search_credit);
428 if (!empty($search_not_reconciled)) {
429 $filter[
't.reconciled_option'] = $search_not_reconciled;
430 $param .=
'&search_not_reconciled='.urlencode($search_not_reconciled);
432 if (!empty($search_date_export_start)) {
433 $filter[
't.date_export>='] = $search_date_export_start;
434 $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;
436 if (!empty($search_date_export_end)) {
437 $filter[
't.date_export<='] = $search_date_export_end;
438 $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;
440 if (!empty($search_date_validation_start)) {
441 $filter[
't.date_validated>='] = $search_date_validation_start;
442 $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;
444 if (!empty($search_date_validation_end)) {
445 $filter[
't.date_validated<='] = $search_date_validation_end;
446 $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;
449 if (!empty($search_date_due_start)) {
450 $filter[
't.date_lim_reglement>='] = $search_date_due_start;
451 $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;
454 if (!empty($search_date_due_end)) {
455 $filter[
't.date_lim_reglement<='] = $search_date_due_end;
456 $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;
458 if (!empty($search_import_key)) {
459 $filter[
't.import_key'] = $search_import_key;
460 $param .=
'&search_import_key='.urlencode($search_import_key);
463 $url_param = substr($param, 1);
465 $param =
'&type='.$type.$param;
469 if ($action ===
'exporttopdf' && $permissiontoadd) {
470 if ($type ==
"sub") {
471 $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter,
'AND', 1);
473 $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
475 require_once DOL_DOCUMENT_ROOT .
'/core/modules/accountancy/doc/pdf_ledger.modules.php';
477 $pdf->fromDate = $search_date_start;
478 $pdf->toDate = $search_date_end;
479 $pdf->ledgerType = $type;
481 $result = $pdf->write_file($object, $langs);
492 $objectclass =
'Bookkeeping';
493 $objectlabel =
'Bookkeeping';
494 $uploaddir =
$conf->societe->dir_output;
497 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
499 if (!$error && $action ==
'deletebookkeepingwriting' && $confirm ==
"yes" && $user->hasRight(
'accounting',
'mouvements',
'supprimer')) {
504 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect,
true);
505 if ($nb_lettering < 0) {
513 foreach ($toselect as $toselectid) {
514 $result =
$object->fetch($toselectid);
515 if ($result > 0 && (!isset(
$object->date_validation) ||
$object->date_validation ===
'')) {
524 } elseif ($result < 0) {
528 } elseif (isset(
$object->date_validation) &&
$object->date_validation !=
'') {
529 setEventMessages($langs->trans(
"ValidatedRecordWhereFound"),
null,
'errors');
542 } elseif ($nbok > 0) {
548 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?noreset=1".($param ?
'&'.$param :
''));
556 if (!$error && $action ==
'clonebookkeepingwriting' && $confirm ==
"yes" && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
557 $result =
$object->newCloneMass($toselect, $journal_code, $massdate);
563 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?noreset=1".($param ?
'&'.$param :
''));
571 if (!$error && $action ==
'assignaccountbookkeepingwriting' && $confirm ==
"yes" && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
572 $result =
$object->assignAccountMass($toselect, (
int) $account);
578 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?noreset=1".($param ?
'&'.$param :
''));
586 if (!$error && $action ==
'returnaccountbookkeepingwriting' && $confirm ==
"yes" && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
587 $result =
$object->newReturnAccount($toselect, $journal_code, $massdate);
593 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?noreset=1".($param ?
'&'.$param :
''));
602 if ($massaction ==
'letteringauto' && $permissiontoadd) {
604 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect);
605 if ($nb_lettering < 0) {
608 $nb_lettering = max(0, abs($nb_lettering) - 2);
609 } elseif ($nb_lettering == 0) {
611 setEventMessages($langs->trans(
'AccountancyNoLetteringModified'), array(),
'mesgs');
613 if ($nb_lettering == 1) {
614 setEventMessages($langs->trans(
'AccountancyOneLetteringModifiedSuccessfully'), array(),
'mesgs');
615 } elseif ($nb_lettering > 1) {
616 setEventMessages($langs->trans(
'AccountancyLetteringModifiedSuccessfully', $nb_lettering), array(),
'mesgs');
620 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
623 } elseif ($massaction ==
'letteringmanual' && $permissiontoadd) {
625 $result = $lettering->updateLettering($toselect);
629 setEventMessages($langs->trans($result == 0 ?
'AccountancyNoLetteringModified' :
'AccountancyOneLetteringModifiedSuccessfully'), array(),
'mesgs');
630 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
633 } elseif ($type ==
'sub' && $massaction ==
'letteringpartial') {
635 $result = $lettering->updateLettering($toselect, 0,
true);
639 setEventMessages($langs->trans($result == 0 ?
'AccountancyNoLetteringModified' :
'AccountancyOneLetteringModifiedSuccessfully'), array(),
'mesgs');
640 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
643 } elseif ($action ==
'unletteringauto' && $confirm ==
"yes" && $permissiontoadd) {
645 $nb_lettering = $lettering->bookkeepingLetteringAll($toselect,
true);
646 if ($nb_lettering < 0) {
649 $nb_lettering = max(0, abs($nb_lettering) - 2);
650 } elseif ($nb_lettering == 0) {
652 setEventMessages($langs->trans(
'AccountancyNoUnletteringModified'), array(),
'mesgs');
654 if ($nb_lettering == 1) {
655 setEventMessages($langs->trans(
'AccountancyOneUnletteringModifiedSuccessfully'), array(),
'mesgs');
656 } elseif ($nb_lettering > 1) {
657 setEventMessages($langs->trans(
'AccountancyUnletteringModifiedSuccessfully', $nb_lettering), array(),
'mesgs');
661 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
664 } elseif ($action ==
'unletteringmanual' && $confirm ==
"yes" && $permissiontoadd) {
666 $nb_lettering = $lettering->deleteLettering($toselect);
670 setEventMessages($langs->trans($result == 0 ?
'AccountancyNoUnletteringModified' :
'AccountancyOneUnletteringModifiedSuccessfully'), array(),
'mesgs');
671 header(
'Location: ' . $_SERVER[
'PHP_SELF'] .
'?noreset=1' . $param);
686$form =
new Form($db);
688$title_page = $langs->trans(
"Operations").
' - '.$langs->trans(
"VueByAccountAccounting").
' (';
690 $title_page .= $langs->trans(
"BookkeepingSubAccount");
692 $title_page .= $langs->trans(
"Bookkeeping");
695$help_url =
'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double';
696llxHeader(
'', $title_page, $help_url,
'', 0, 0,
'',
'',
'',
'mod-accountancy accountancy-consultation page-'.(($type ==
'sub') ?
'sub' :
'').
'ledger');
699 $companystatic =
new Societe($db);
700 $res = $companystatic->fetch($socid);
707 print
dol_get_fiche_head($head,
'accounting', $langs->trans(
"ThirdParty"), -1,
'company');
709 $linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
711 dol_banner_tab($companystatic,
'socid', $linkback, ($user->socid ? 0 : 1),
'rowid',
'nom');
713 print
'<div class="fichecenter">';
715 print
'<div class="underbanner clearboth"></div>';
716 print
'<table class="border centpercent tableforfield">';
719 print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
720 print $companystatic->getTypeUrl(1);
724 if ($companystatic->client && !empty($companystatic->code_client)) {
725 print
'<tr><td class="titlefield">';
726 print $langs->trans(
'CustomerCode').
'</td><td>';
728 $tmpcheck = $companystatic->check_codeclient();
729 if ($tmpcheck != 0 && $tmpcheck != -5) {
730 print
' <span class="error">('.$langs->trans(
"WrongCustomerCode").
')</span>';
736 if ($companystatic->fournisseur && !empty($companystatic->code_fournisseur)) {
737 print
'<tr><td class="titlefield">';
738 print $langs->trans(
'SupplierCode').
'</td><td>';
740 $tmpcheck = $companystatic->check_codefournisseur();
741 if ($tmpcheck != 0 && $tmpcheck != -5) {
742 print
' <span class="error">('.$langs->trans(
"WrongSupplierCode").
')</span>';
752 print
info_admin($langs->trans(
"WarningThisPageContainsOnlyEntriesTransferredInAccounting")).
'';
755 if (!empty(
$conf->dol_use_jmobile)) {
756 print
"\n".
'<div class="fichecenter"><div class="nowrap">'.
"\n";
759 if ($companystatic->client && !empty($companystatic->code_compta_client)) {
760 if ($mode !=
'customer') {
761 if (!empty($companystatic->code_compta_client)) {
762 $subledger_start_account = $subledger_end_account = $companystatic->code_compta_client;
764 $subledger_start_account = $subledger_end_account =
'';
766 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.
'">';
768 print
'<span class="a-mesure marginleftonly marginrightonly">';
771 print $langs->trans(
"CustomerAccountancyCodeShort");
772 if ($mode !=
'customer') {
779 if ($companystatic->fournisseur && !empty($companystatic->code_compta_fournisseur)) {
780 if ($mode !=
'supplier') {
781 if (!empty($companystatic->code_compta_fournisseur)) {
782 $subledger_start_account = $subledger_end_account = $companystatic->code_compta_fournisseur;
784 $subledger_start_account = $subledger_end_account =
'';
786 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.
'">';
788 print
'<span class="a-mesure marginleftonly marginrightonly">';
790 print $langs->trans(
"SupplierAccountancyCodeShort");
791 if ($mode !=
'supplier') {
798 if (!empty(
$conf->dol_use_jmobile)) {
799 print
'</div></div>';
808$nbtotalofrecords =
'';
811 if ($type ==
'sub') {
812 $nbtotalofrecords =
$object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter,
'AND', 1, 1);
814 $nbtotalofrecords =
$object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter,
'AND', 0, 1);
817 if ($nbtotalofrecords < 0) {
825 if ($type ==
'sub') {
826 $result =
$object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter,
'AND', 1);
828 $result =
$object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter,
'AND', 0);
838$arrayofselected = is_array($toselect) ? $toselect : array();
845$arrayofmassactions = array();
846if (
getDolGlobalInt(
'ACCOUNTING_ENABLE_LETTERING') && $user->hasRight(
'accounting',
'mouvements',
'creer')) {
847 $arrayofmassactions[
'letteringauto'] =
img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'LetteringAuto');
848 $arrayofmassactions[
'preunletteringauto'] =
img_picto(
'',
'uncheck',
'class="pictofixedwidth"') . $langs->trans(
'UnletteringAuto');
849 $arrayofmassactions[
'letteringmanual'] =
img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'LetteringManual');
850 if ($type ==
'sub') {
851 $arrayofmassactions[
'letteringpartial'] =
img_picto(
'',
'check',
'class="pictofixedwidth"') . $langs->trans(
'LetteringPartial');
853 $arrayofmassactions[
'preunletteringmanual'] =
img_picto(
'',
'uncheck',
'class="pictofixedwidth"') . $langs->trans(
'UnletteringManual');
855if ($user->hasRight(
'accounting',
'mouvements',
'creer')) {
856 $arrayofmassactions[
'preclonebookkeepingwriting'] =
img_picto(
'',
'clone',
'class="pictofixedwidth"').$langs->trans(
"Clone");
858if ($user->hasRight(
'accounting',
'mouvements',
'creer')) {
859 $arrayofmassactions[
'preassignaccountbookkeepingwriting'] =
img_picto(
'',
'fa-exchange-alt',
'class="pictofixedwidth"').$langs->trans(
"AssignAccount");
861if ($user->hasRight(
'accounting',
'mouvements',
'creer')) {
862 $arrayofmassactions[
'prereturnaccountbookkeepingwriting'] =
img_picto(
'',
'undo',
'class="pictofixedwidth"').$langs->trans(
"ReturnAccount");
864if ($user->hasRight(
'accounting',
'mouvements',
'supprimer')) {
865 $arrayofmassactions[
'predeletebookkeepingwriting'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
868if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'preunletteringauto',
'preunletteringmanual',
'predeletebookkeepingwriting',
'preclonebookkeepingwriting',
'preassignaccountbookkeepingwriting',
'prereturnaccountbookkeepingwriting'))) {
869 $arrayofmassactions = array();
871$massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions);
873print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
874print
'<input type="hidden" name="token" value="'.newToken().
'">';
875print
'<input type="hidden" name="action" value="list">';
876if ($optioncss !=
'') {
877 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
879print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
880print
'<input type="hidden" name="type" value="'.$type.
'">';
882 print
'<input type="hidden" name="socid" value="' . $socid .
'">';
884print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
885print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
886print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
888$parameters = array(
'param' => $param);
889$reshook = $hookmanager->executeHooks(
'addMoreActionsButtonsList', $parameters, $object, $action);
894$newcardbutton = empty($hookmanager->resPrint) ?
'' : $hookmanager->resPrint;
896if (empty($reshook)) {
899 $newcardbutton =
dolGetButtonTitle($langs->trans(
'ViewFlatList'),
'',
'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/list.php?' . $param);
900 if ($type ==
'sub') {
901 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly'));
902 $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'));
904 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly btnTitleSelected'));
905 $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'));
908 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'ExportToPdf'),
'',
'fa fa-file-pdf paddingleft', $_SERVER[
'PHP_SELF'] .
'?action=exporttopdf'.(!empty($type) ?
'&type=sub' :
'').
'&' . $url_param,
'', $permissiontoexport, array(
'morecss' =>
'marginleftonly'));
912 $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);
915if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
916 $param .=
'&contextpage='.urlencode($contextpage);
918if ($limit > 0 && $limit !=
$conf->liste_limit) {
919 $param .=
'&limit='.((int) $limit);
922print_barre_liste($title_page, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'title_accountancy', 0, $newcardbutton,
'', $limit, 0, 0, 1);
924if ($massaction ==
'preunletteringauto') {
925 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassUnletteringAuto"), $langs->trans(
"ConfirmMassUnletteringQuestion", count($toselect)),
"unletteringauto",
null,
'', 0, 200, 500, 1);
926} elseif ($massaction ==
'preunletteringmanual') {
927 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassUnletteringManual"), $langs->trans(
"ConfirmMassUnletteringQuestion", count($toselect)),
"unletteringmanual",
null,
'', 0, 200, 500, 1);
928} elseif ($massaction ==
'predeletebookkeepingwriting') {
929 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassDeleteBookkeepingWriting"), $langs->trans(
"ConfirmMassDeleteBookkeepingWritingQuestion", count($toselect)),
"deletebookkeepingwriting",
null,
'', 0, 200, 500, 1);
930} elseif ($massaction ==
'preassignaccountbookkeepingwriting') {
931 $input = $formaccounting->select_account(
'',
'account', 1);
932 $formquestion = array(array(
'type' =>
'other',
'name' =>
'account',
'label' =>
'<span class="fieldrequired">' . $langs->trans(
"AccountAccountingShort") .
'</span>',
'value' => $input),);
933 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"confirmMassAssignAccountBookkeepingWritingConfirm"), $langs->trans(
"ConfirmMassAssignAccountBookkeepingWritingQuestion", count($toselect)),
"assignaccountbookkeepingwriting", $formquestion,
'', 0, 200, 500, 1);
934} elseif ($massaction ==
'preclonebookkeepingwriting') {
935 $input1 = $form->selectDate(
'',
'massdate', 0, 0, 0,
"create_mvt", 1, 1);
936 $input2 = $formaccounting->select_journal($journal_code,
'code_journal', 0, 0, 1, 1).
'</td>';
937 $formquestion = array(
940 'name' =>
'massdate',
941 'label' =>
'<span class="fieldrequired">' . $langs->trans(
"Docdate") .
'</span>',
947 $formquestion[] = array(
949 'name' =>
'code_journal',
950 'label' =>
'<span class="fieldrequired">' . $langs->trans(
"Codejournal") .
'</span>',
955 print $form->formconfirm(
956 $_SERVER[
"PHP_SELF"],
957 $langs->trans(
"ConfirmMassCloneBookkeepingWriting"),
958 $langs->trans(
"ConfirmMassCloneBookkeepingWritingQuestion", count($toselect)),
959 "clonebookkeepingwriting",
963} elseif ($massaction ==
'prereturnaccountbookkeepingwriting') {
964 $input1 = $form->selectDate(
'',
'massdate', 0, 0, 0,
"create_mvt", 1, 1);
965 $formquestion = array(array(
'type' =>
'other',
'name' =>
'massdate',
'label' =>
'<span class="fieldrequired">' . $langs->trans(
"Docdate") .
'</span>',
'value' => $input1));
966 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassReturnAccountBookkeepingWriting"), $langs->trans(
"ConfirmMassReturnAccountBookkeepingWritingQuestion", count($toselect)),
"returnaccountbookkeepingwriting", $formquestion,
'', 0, 200, 500, 1);
969include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
971$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
972$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
973if ($massactionbutton && $contextpage !=
'poslist') {
974 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
978if (preg_match(
'/^asc/i', $sortorder)) {
985if ($type ==
'sub' && !$socid) {
986 print
info_admin($langs->trans(
"WarningRecordWithoutSubledgerAreExcluded"));
993$moreforfilter .=
'<div class="divsearchfield">';
994$moreforfilter .= $langs->trans(
'AccountAccounting').
': ';
995$moreforfilter .=
'<div class="nowrap inline-block">';
998 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'),
'maxwidth200');
1000 $moreforfilter .=
'<input type="text" class="maxwidth150" name="search_accountancy_code_start" value="'.dol_escape_htmltag($search_accountancy_code_start).
'" placeholder="'.$langs->trans(
'From').
'">';
1003 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'), array(), 1, 1,
'maxwidth200');
1005$moreforfilter .=
' ';
1006if ($type ==
'sub') {
1008 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'),
'maxwidth200');
1010 $moreforfilter .=
'<input type="text" class="maxwidth150" name="search_accountancy_code_end" value="'.dol_escape_htmltag($search_accountancy_code_end).
'" placeholder="'.$langs->trans(
'to').
'">';
1013 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'), array(), 1, 1,
'maxwidth200');
1017 $stringforfirstkey = $langs->trans(
"KeyboardShortcut");
1018 if (
$conf->browser->name ==
'chrome') {
1019 $stringforfirstkey .=
' ALT +';
1020 } elseif (
$conf->browser->name ==
'firefox') {
1021 $stringforfirstkey .=
' ALT + SHIFT +';
1023 $stringforfirstkey .=
' CTL +';
1025 $moreforfilter .=
' <a id="previous_account" accesskey="p" title="' . $stringforfirstkey .
' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>';
1026 $moreforfilter .=
' <a id="next_account" accesskey="n" title="' . $stringforfirstkey .
' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>';
1027 $moreforfilter .= <<<SCRIPT
1028<script
type=
"text/javascript">
1029 jQuery(document).ready(
function() {
1030 var searchFormList = $(
'#searchFormList');
1031 var searchAccountancyCodeStart = $(
'#search_accountancy_code_start');
1032 var searchAccountancyCodeEnd = $(
'#search_accountancy_code_end');
1033 jQuery(
'#previous_account').on(
'click',
function() {
1034 var previousOption = searchAccountancyCodeStart.find(
'option:selected').prev(
'option');
1035 if (previousOption.length == 1) searchAccountancyCodeStart.val(previousOption.attr(
'value'));
1036 searchAccountancyCodeEnd.val(searchAccountancyCodeStart.val());
1037 searchFormList.submit();
1039 jQuery(
'#next_account').on(
'click',
function() {
1040 var nextOption = searchAccountancyCodeStart.find(
'option:selected').next(
'option');
1041 if (nextOption.length == 1) searchAccountancyCodeStart.val(nextOption.attr(
'value'));
1042 searchAccountancyCodeEnd.val(searchAccountancyCodeStart.val());
1043 searchFormList.submit();
1045 jQuery(
'input[name="search_mvt_num"]').on(
"keypress",
function(event) {
1052$moreforfilter .=
'</div>';
1053$moreforfilter .=
'</div>';
1056 $moreforfilter .=
'<div class="divsearchfield">';
1057 $moreforfilter .= $langs->trans(
'AccountingCategory') .
': ';
1058 $moreforfilter .=
'<div class="nowrap inline-block">';
1059 $moreforfilter .= $formaccounting->select_accounting_category($search_account_category,
'search_account_category', 1, 0, 0, 0);
1060 $moreforfilter .=
'</div>';
1061 $moreforfilter .=
'</div>';
1064$parameters = array();
1065$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1066if (empty($reshook)) {
1067 $moreforfilter .= $hookmanager->resPrint;
1069 $moreforfilter = $hookmanager->resPrint;
1072print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1073print $moreforfilter;
1076print
'<div class="div-table-responsive">';
1077print
'<table class="tagtable liste centpercent listwithfilterbefore">';
1080print
'<tr class="liste_titre_filter">';
1083 print
'<td class="liste_titre center">';
1084 $searchpicto = $form->showFilterButtons(
'left');
1089if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
1090 print
'<td class="liste_titre"><input type="text" name="search_mvt_num" class="width50" value="'.dol_escape_htmltag($search_mvt_num).
'"></td>';
1093if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
1094 print
'<td class="liste_titre center">';
1095 print $formaccounting->multi_select_journal($search_ledger_code,
'search_ledger_code', 0, 1, 1, 1,
'maxwidth75');
1099if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
1100 print
'<td class="liste_titre center">';
1101 print
'<div class="nowrapfordate">';
1102 print $form->selectDate($search_date_start,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
1104 print
'<div class="nowrapfordate">';
1105 print $form->selectDate($search_date_end,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
1110if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
1111 print
'<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).
'"/></td>';
1114if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
1115 print
'<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="'.dol_escape_htmltag($search_label_operation).
'"/></td>';
1118if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1119 print
'<td class="liste_titre center">';
1120 print
'<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.
'"/>';
1121 print
'<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled ==
'notreconciled' ?
' checked' :
'').
'>'.$langs->trans(
"NotReconciled").
'</span>';
1125if (!empty($arrayfields[
't.debit'][
'checked'])) {
1126 print
'<td class="liste_titre right"><input type="text" class="flat" name="search_debit" size="4" value="'.dol_escape_htmltag($search_debit).
'"></td>';
1129if (!empty($arrayfields[
't.credit'][
'checked'])) {
1130 print
'<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).
'"></td>';
1133if (!empty($arrayfields[
't.balance'][
'checked'])) {
1137if (!empty($arrayfields[
't.date_export'][
'checked'])) {
1138 print
'<td class="liste_titre center">';
1139 print
'<div class="nowrapfordate">';
1140 print $form->selectDate($search_date_export_start,
'search_date_export_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
1142 print
'<div class="nowrapfordate">';
1143 print $form->selectDate($search_date_export_end,
'search_date_export_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
1148if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
1149 print
'<td class="liste_titre center">';
1150 print
'<div class="nowrapfordate">';
1151 print $form->selectDate($search_date_validation_start,
'search_date_validation_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
1153 print
'<div class="nowrapfordate">';
1154 print $form->selectDate($search_date_validation_end,
'search_date_validation_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
1159if (!empty($arrayfields[
't.date_lim_reglement'][
'checked'])) {
1160 print
'<td class="liste_titre center">';
1161 print
'<div class="nowrapfordate">';
1162 print $form->selectDate($search_date_due_start,
'search_date_due_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
1164 print
'<div class="nowrapfordate">';
1165 print $form->selectDate($search_date_due_end,
'search_date_due_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
1169if (!empty($arrayfields[
't.import_key'][
'checked'])) {
1170 print
'<td class="liste_titre center">';
1171 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1176$parameters = array(
'arrayfields' => $arrayfields);
1177$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1178print $hookmanager->resPrint;
1182 print
'<td class="liste_titre center">';
1183 $searchpicto = $form->showFilterButtons();
1189print
'<tr class="liste_titre">';
1191 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1193if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
1194 print_liste_field_titre($arrayfields[
't.piece_num'][
'label'], $_SERVER[
'PHP_SELF'],
"t.piece_num",
"", $param,
'', $sortfield, $sortorder,
'tdoverflowmax80imp ');
1196if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
1197 print_liste_field_titre($arrayfields[
't.code_journal'][
'label'], $_SERVER[
'PHP_SELF'],
"t.code_journal",
"", $param,
'', $sortfield, $sortorder,
'center ');
1199if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
1200 print_liste_field_titre($arrayfields[
't.doc_date'][
'label'], $_SERVER[
'PHP_SELF'],
"t.doc_date",
"", $param,
'', $sortfield, $sortorder,
'center ');
1202if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
1203 print_liste_field_titre($arrayfields[
't.doc_ref'][
'label'], $_SERVER[
'PHP_SELF'],
"t.doc_ref",
"", $param,
"", $sortfield, $sortorder);
1205if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
1206 print_liste_field_titre($arrayfields[
't.label_operation'][
'label'], $_SERVER[
'PHP_SELF'],
"t.label_operation",
"", $param,
"", $sortfield, $sortorder);
1208if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1209 print_liste_field_titre($arrayfields[
't.lettering_code'][
'label'], $_SERVER[
'PHP_SELF'],
"t.lettering_code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1211if (!empty($arrayfields[
't.debit'][
'checked'])) {
1212 print_liste_field_titre($arrayfields[
't.debit'][
'label'], $_SERVER[
'PHP_SELF'],
"t.debit",
"", $param,
'', $sortfield, $sortorder,
'right ');
1214if (!empty($arrayfields[
't.credit'][
'checked'])) {
1215 print_liste_field_titre($arrayfields[
't.credit'][
'label'], $_SERVER[
'PHP_SELF'],
"t.credit",
"", $param,
'', $sortfield, $sortorder,
'right ');
1217if (!empty($arrayfields[
't.balance'][
'checked'])) {
1218 print_liste_field_titre($arrayfields[
't.balance'][
'label'],
"",
"",
"", $param,
'', $sortfield, $sortorder,
'right ');
1220if (!empty($arrayfields[
't.date_export'][
'checked'])) {
1221 print_liste_field_titre($arrayfields[
't.date_export'][
'label'], $_SERVER[
'PHP_SELF'],
"t.date_export",
"", $param,
'', $sortfield, $sortorder,
'center ');
1223if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
1224 print_liste_field_titre($arrayfields[
't.date_validated'][
'label'], $_SERVER[
'PHP_SELF'],
"t.date_validated",
"", $param,
'', $sortfield, $sortorder,
'center ');
1227if (!empty($arrayfields[
't.date_lim_reglement'][
'checked'])) {
1228 print_liste_field_titre($arrayfields[
't.date_lim_reglement'][
'label'], $_SERVER[
'PHP_SELF'],
't.date_lim_reglement',
'', $param,
'', $sortfield, $sortorder,
'center ');
1230if (!empty($arrayfields[
't.import_key'][
'checked'])) {
1231 print_liste_field_titre($arrayfields[
't.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"t.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1234$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
1235$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1236print $hookmanager->resPrint;
1238 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1242$displayed_account_number =
null;
1244$objectstatic =
null;
1254$sous_total_debit = 0;
1255$sous_total_credit = 0;
1268if (!empty($arrayfields[
't.piece_num'][
'checked'])) { $colspan++; }
1269if (!empty($arrayfields[
't.code_journal'][
'checked'])) { $colspan++; }
1270if (!empty($arrayfields[
't.doc_date'][
'checked'])) { $colspan++; }
1271if (!empty($arrayfields[
't.doc_ref'][
'checked'])) { $colspan++; }
1272if (!empty($arrayfields[
't.label_operation'][
'checked'])) { $colspan++; }
1273if (!empty($arrayfields[
't.date_export'][
'checked'])) { $colspanend++; }
1274if (!empty($arrayfields[
't.date_validated'][
'checked'])) { $colspanend++; }
1275if (!empty($arrayfields[
't.lettering_code'][
'checked'])) { $colspanend++; }
1281while ($i < min($num, $limit)) {
1284 if ($type ==
'sub') {
1296 if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
1299 if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
1302 if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
1305 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
1308 if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
1311 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1315 if (!empty($arrayfields[
't.balance'][
'checked'])) {
1318 if (!empty($arrayfields[
't.date_export'][
'checked'])) {
1321 if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
1325 if (!empty($arrayfields[
't.date_lim_reglement'][
'checked'])) {
1328 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1331 if (!empty($arrayfields[
't.import_key'][
'checked'])) {
1340 if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
1342 if (isset($displayed_account_number)) {
1343 print
'<tr class="liste_total">';
1344 if ($type ==
'sub') {
1345 print
'<td class="right" colspan="' . $colspan .
'">' . $langs->trans(
"TotalForAccount") .
' ' .
length_accounta($displayed_account_number) .
':</td>';
1347 print
'<td class="right" colspan="' . $colspan .
'">' . $langs->trans(
"TotalForAccount") .
' ' .
length_accountg($displayed_account_number) .
':</td>';
1349 print
'<td class="nowrap right">'.price(
price2num($sous_total_debit,
'MT')).
'</td>';
1350 print
'<td class="nowrap right">'.price(
price2num($sous_total_credit,
'MT')).
'</td>';
1351 if ($colspanend > 0) {
1352 print
'<td colspan="'.$colspanend.
'"></td>';
1356 $balance = $sous_total_debit - $sous_total_credit;
1357 print
'<tr class="liste_total">';
1358 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"Balance").
':</td>';
1360 print
'<td class="nowraponall right">';
1361 print
price(
price2num($sous_total_debit - $sous_total_credit,
'MT'));
1366 print
'<td class="nowraponall right">';
1367 print
price(
price2num($sous_total_credit - $sous_total_debit,
'MT'));
1370 if ($colspanend > 0) {
1371 print
'<td colspan="'.$colspanend.
'"></td>';
1377 print
'<tr class="trforbreaknobg">';
1378 print
'<td colspan="'.($totalarray[
'nbfield'] ?
$totalarray[
'nbfield'] : count($arrayfields) + 1).
'" class="tdforbreak">';
1379 if ($type ==
'sub') {
1380 if ($line->subledger_account !=
"" && $line->subledger_account !=
'-1') {
1381 print empty($line->subledger_label) ?
'<span class="error">'.$langs->trans(
"Unknown").
'</span>' : $line->subledger_label;
1386 print
'<span class="error">' . $langs->trans(
"Unknown");
1387 if ($line->subledger_label) {
1388 print
' (' . $line->subledger_label .
')';
1389 $htmltext =
'EmptyStringForSubledgerAccountButSubledgerLabelDefined';
1391 $htmltext =
'EmptyStringForSubledgerAccountAndSubledgerLabel';
1393 print $form->textwithpicto(
'', $htmltext);
1397 if ($line->numero_compte !=
"" && $line->numero_compte !=
'-1') {
1400 print
'<span class="error">' . $langs->trans(
"Unknown") .
'</span>';
1406 $displayed_account_number = $accountg;
1408 $sous_total_debit = 0;
1409 $sous_total_credit = 0;
1412 print
'<tr class="oddeven">';
1415 print
'<td class="nowraponall center">';
1416 if (($massactionbutton || $massaction) && $contextpage !=
'poslist') {
1418 if (in_array($line->id, $arrayofselected)) {
1421 print
'<input id="cb' . $line->id .
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id .
'"' . ($selected ?
' checked="checked"' :
'') .
' />';
1429 if (!empty($arrayfields[
't.piece_num'][
'checked'])) {
1432 $object->piece_num = $line->piece_num;
1434 print
$object->getNomUrl(1,
'', 0,
'', 1);
1442 if (!empty($arrayfields[
't.code_journal'][
'checked'])) {
1444 $result = $accountingjournal->fetch(0, $line->code_journal);
1445 $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0,
'', 0) : $line->code_journal);
1446 print
'<td class="center tdoverflowmax80">'.$journaltoshow.
'</td>';
1453 if (!empty($arrayfields[
't.doc_date'][
'checked'])) {
1454 print
'<td class="center">'.dol_print_date($line->doc_date,
'day').
'</td>';
1462 if (!empty($arrayfields[
't.doc_ref'][
'checked'])) {
1463 if ($line->doc_type ==
'customer_invoice') {
1464 $langs->loadLangs(array(
'bills'));
1466 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1467 $objectstatic =
new Facture($db);
1468 $objectstatic->fetch($line->fk_doc);
1473 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$objectstatic->id;
1474 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1475 } elseif ($line->doc_type ==
'supplier_invoice') {
1476 $langs->loadLangs(array(
'bills'));
1478 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1480 $objectstatic->fetch($line->fk_doc);
1482 $modulepart =
'invoice_supplier';
1484 $filedir =
$conf->fournisseur->facture->dir_output.
'/'.
get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
1485 $subdir =
get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
1486 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
1487 } elseif ($line->doc_type ==
'expense_report') {
1488 $langs->loadLangs(array(
'trips'));
1490 require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
1492 $objectstatic->fetch($line->fk_doc);
1497 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$objectstatic->id;
1498 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1499 } elseif ($line->doc_type ==
'bank') {
1500 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1502 $objectstatic->fetch($line->fk_doc);
1507 print
'<td class="tdoverflowmax250">';
1510 if ($line->doc_type ==
'customer_invoice' || $line->doc_type ==
'supplier_invoice' || $line->doc_type ==
'expense_report') {
1511 print $objectstatic->getNomUrl(1,
'', 0, 0,
'', 0, -1, 1);
1512 print $documentlink;
1513 } elseif ($line->doc_type ==
'bank') {
1514 print $objectstatic->getNomUrl(1);
1515 $bank_ref = strstr($line->doc_ref,
'-');
1516 print
" " . $bank_ref;
1518 print $line->doc_ref;
1528 if (!empty($arrayfields[
't.label_operation'][
'checked'])) {
1530 $doc_ref = preg_replace(
'/\(.*\)/',
'', $line->doc_ref);
1532 print
'<td class="small tdoverflowmax350 classfortooltip" title="'.dol_escape_htmltag($line->label_operation).
'">'.
dol_escape_htmltag($line->label_operation).
'</td>';
1534 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>';
1542 if (!empty($arrayfields[
't.lettering_code'][
'checked'])) {
1543 print
'<td class="center">'.dol_escape_htmltag((
string) $line->lettering_code).
'</td>';
1550 if (!empty($arrayfields[
't.debit'][
'checked'])) {
1551 print
'<td class="right nowraponall amount">'.($line->debit != 0 ?
price($line->debit) :
'').
'</td>';
1558 $totalarray[
'val'][
'totaldebit'] += (float) $line->debit;
1562 if (!empty($arrayfields[
't.credit'][
'checked'])) {
1563 print
'<td class="right nowraponall amount">'.($line->credit != 0 ?
price($line->credit) :
'').
'</td>';
1570 $totalarray[
'val'][
'totalcredit'] += (float) $line->credit;
1574 if (!empty($arrayfields[
't.balance'][
'checked'])) {
1575 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_debit + $line->debit - $sous_total_credit - $line->credit,
'MT')).
'</td>';
1582 $totalarray[
'val'][
'totalbalance'] += $line->debit - $line->credit;
1586 if (!empty($arrayfields[
't.date_export'][
'checked'])) {
1587 print
'<td class="center">'.dol_print_date($line->date_export,
'dayhour').
'</td>';
1594 if (!empty($arrayfields[
't.date_validated'][
'checked'])) {
1595 print
'<td class="center">'.dol_print_date($line->date_validation,
'dayhour').
'</td>';
1602 if (!empty($arrayfields[
't.date_lim_reglement'][
'checked'])) {
1603 print
'<td class="center">'.dol_print_date($line->date_lim_reglement,
'day').
'</td>';
1609 if (!empty($arrayfields[
't.import_key'][
'checked'])) {
1610 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($line->import_key).
'">'.
dol_escape_htmltag($line->import_key).
"</td>\n";
1617 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $line);
1618 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1619 print $hookmanager->resPrint;
1623 print
'<td class="nowraponall center">';
1624 if (($massactionbutton || $massaction) && $contextpage !=
'poslist') {
1626 if (in_array($line->id, $arrayofselected)) {
1629 print
'<input id="cb' . $line->id .
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id .
'"' . ($selected ?
' checked="checked"' :
'') .
' />';
1638 $sous_total_debit += $line->debit;
1639 $sous_total_credit += $line->credit;
1646if ($num > 0 && $colspan > 0) {
1647 print
'<tr class="liste_total">';
1648 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"TotalForAccount").
' '.$accountg.
':</td>';
1649 print
'<td class="nowrap right">'.price(
price2num($sous_total_debit,
'MT')).
'</td>';
1650 print
'<td class="nowrap right">'.price(
price2num($sous_total_credit,
'MT')).
'</td>';
1651 if ($colspanend > 0) {
1652 print
'<td colspan="'.$colspanend.
'"></td>';
1657 $balance = $sous_total_debit - $sous_total_credit;
1658 print
'<tr class="liste_total">';
1659 print
'<td class="right" colspan="'.$colspan.
'">'.$langs->trans(
"Balance").
':</td>';
1661 print
'<td class="nowraponall right">';
1662 print
price(
price2num($sous_total_debit - $sous_total_credit,
'MT'));
1667 print
'<td class="nowraponall right">';
1668 print
price(
price2num($sous_total_credit - $sous_total_debit,
'MT'));
1671 if ($colspanend > 0) {
1672 print
'<td colspan="'.$colspanend.
'"></td>';
1679if (!empty($totalarray[
'val'][
'totaldebit'])) {
1682if (!empty($totalarray[
'val'][
'totalcredit'])) {
1683 $totalarray[
'val'][
'totalcredit'] = (float)
price2num($totalarray[
'val'][
'totalcredit'],
'MT');
1685if (!empty($totalarray[
'val'][
'totalbalance'])) {
1686 $totalarray[
'val'][
'totalbalance'] = (float)
price2num($totalarray[
'val'][
'totaldebit'] - $totalarray[
'val'][
'totalcredit'],
'MT');
1691include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1696 foreach ($arrayfields as $key => $val) {
1697 if (!empty($val[
'checked'])) {
1701 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1704$parameters = array(
'arrayfields' => $arrayfields);
1705$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1706print $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.
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)
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_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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTDATE($prefix, $hourTime='', $gm='auto', $saverestore='')
Helper function that combines values of a dolibarr DatePicker (such as Form\selectDate) for year,...
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
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.
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.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_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).
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a 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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
if(preg_match('/(crypted|dolcrypt):/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.