27 require
'../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountancyexport.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
39 $langs->loadLangs(array(
"accountancy",
"compta"));
41 $socid =
GETPOST(
'socid',
'int');
43 $action =
GETPOST(
'action',
'aZ09');
44 $search_mvt_num =
GETPOST(
'search_mvt_num',
'int');
45 $search_doc_type =
GETPOST(
"search_doc_type",
'alpha');
46 $search_doc_ref =
GETPOST(
"search_doc_ref",
'alpha');
47 $search_date_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
48 $search_date_end =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
50 $search_date_creation_start =
dol_mktime(0, 0, 0,
GETPOST(
'date_creation_startmonth',
'int'),
GETPOST(
'date_creation_startday',
'int'),
GETPOST(
'date_creation_startyear',
'int'));
51 $search_date_creation_end =
dol_mktime(0, 0, 0,
GETPOST(
'date_creation_endmonth',
'int'),
GETPOST(
'date_creation_endday',
'int'),
GETPOST(
'date_creation_endyear',
'int'));
52 $search_date_modification_start =
dol_mktime(0, 0, 0,
GETPOST(
'date_modification_startmonth',
'int'),
GETPOST(
'date_modification_startday',
'int'),
GETPOST(
'date_modification_startyear',
'int'));
53 $search_date_modification_end =
dol_mktime(0, 0, 0,
GETPOST(
'date_modification_endmonth',
'int'),
GETPOST(
'date_modification_endday',
'int'),
GETPOST(
'date_modification_endyear',
'int'));
54 $search_date_export_start =
dol_mktime(0, 0, 0,
GETPOST(
'date_export_startmonth',
'int'),
GETPOST(
'date_export_startday',
'int'),
GETPOST(
'date_export_startyear',
'int'));
55 $search_date_export_end =
dol_mktime(0, 0, 0,
GETPOST(
'date_export_endmonth',
'int'),
GETPOST(
'date_export_endday',
'int'),
GETPOST(
'date_export_endyear',
'int'));
59 $action =
'delbookkeepingyear';
61 if (
GETPOST(
"button_export_file_x") ||
GETPOST(
"button_export_file.x") ||
GETPOST(
"button_export_file")) {
62 $action =
'export_file';
65 $search_accountancy_code =
GETPOST(
"search_accountancy_code");
66 $search_accountancy_code_start =
GETPOST(
'search_accountancy_code_start',
'alpha');
67 if ($search_accountancy_code_start == - 1) {
68 $search_accountancy_code_start =
'';
70 $search_accountancy_code_end =
GETPOST(
'search_accountancy_code_end',
'alpha');
71 if ($search_accountancy_code_end == - 1) {
72 $search_accountancy_code_end =
'';
75 $search_accountancy_aux_code =
GETPOST(
"search_accountancy_aux_code");
76 $search_accountancy_aux_code_start =
GETPOST(
'search_accountancy_aux_code_start',
'alpha');
77 if ($search_accountancy_aux_code_start == - 1) {
78 $search_accountancy_aux_code_start =
'';
80 $search_accountancy_aux_code_end =
GETPOST(
'search_accountancy_aux_code_end',
'alpha');
81 if ($search_accountancy_aux_code_end == - 1) {
82 $search_accountancy_aux_code_end =
'';
84 $search_mvt_label =
GETPOST(
'search_mvt_label',
'alpha');
85 $search_direction =
GETPOST(
'search_direction',
'alpha');
86 $search_debit =
GETPOST(
'search_debit',
'alpha');
87 $search_credit =
GETPOST(
'search_credit',
'alpha');
88 $search_ledger_code =
GETPOST(
'search_ledger_code',
'alpha');
89 $search_lettering_code =
GETPOST(
'search_lettering_code',
'alpha');
90 $search_not_reconciled =
GETPOST(
'search_not_reconciled',
'alpha');
93 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
94 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
95 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
97 if (empty($page) || $page < 0) { $page = 0; }
98 $offset = $limit * $page;
99 $pageprev = $page - 1;
100 $pagenext = $page + 1;
101 if ($sortorder ==
"") $sortorder =
"ASC";
102 if ($sortfield ==
"") $sortfield =
"t.piece_num,t.rowid";
106 $hookmanager->initHooks(array(
'bookkeepinglist'));
109 $form =
new Form($db);
111 if (!in_array($action, array(
'export_file',
'delmouv',
'delmouvconfirm')) && !
GETPOSTISSET(
'begin') && !
GETPOSTISSET(
'formfilteraction') &&
GETPOST(
'page',
'int') ==
'' && !
GETPOST(
'noreset',
'int') && $user->rights->accounting->mouvements->export)
113 if (empty($search_date_start) && empty($search_date_end) && !
GETPOSTISSET(
'restore_lastsearch_values') && !
GETPOST(
'search_accountancy_code_start'))
115 $query =
"SELECT date_start, date_end from ".MAIN_DB_PREFIX.
"accounting_fiscalyear ";
116 $query .=
" where date_start < '".$db->idate(
dol_now()).
"' and date_end > '".$db->idate(
dol_now()).
"' limit 1";
117 $res = $db->query($query);
119 if ($res->num_rows > 0) {
120 $fiscalYear = $db->fetch_object($res);
121 $search_date_start = strtotime($fiscalYear->date_start);
122 $search_date_end = strtotime($fiscalYear->date_end);
124 $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
127 $year_end = $year_start + 1;
128 $month_end = $month_start - 1;
134 $search_date_start =
dol_mktime(0, 0, 0, $month_start, 1, $year_start);
141 $arrayfields = array(
142 't.piece_num'=>array(
'label'=>$langs->trans(
"TransactionNumShort"),
'checked'=>1),
143 't.code_journal'=>array(
'label'=>$langs->trans(
"Codejournal"),
'checked'=>1),
144 't.doc_date'=>array(
'label'=>$langs->trans(
"Docdate"),
'checked'=>1),
145 't.doc_ref'=>array(
'label'=>$langs->trans(
"Piece"),
'checked'=>1),
146 't.numero_compte'=>array(
'label'=>$langs->trans(
"AccountAccountingShort"),
'checked'=>1),
147 't.subledger_account'=>array(
'label'=>$langs->trans(
"SubledgerAccount"),
'checked'=>1),
148 't.label_operation'=>array(
'label'=>$langs->trans(
"Label"),
'checked'=>1),
149 't.debit'=>array(
'label'=>$langs->trans(
"Debit"),
'checked'=>1),
150 't.credit'=>array(
'label'=>$langs->trans(
"Credit"),
'checked'=>1),
151 't.lettering_code'=>array(
'label'=>$langs->trans(
"LetteringCode"),
'checked'=>1),
152 't.date_creation'=>array(
'label'=>$langs->trans(
"DateCreation"),
'checked'=>0),
153 't.tms'=>array(
'label'=>$langs->trans(
"DateModification"),
'checked'=>0),
154 't.date_export'=>array(
'label'=>$langs->trans(
"DateExport"),
'checked'=>1),
157 if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields[
't.lettering_code']);
160 $formatexportset = $conf->global->ACCOUNTING_EXPORT_MODELCSV;
161 if (empty($listofformat[$formatexportset])) $formatexportset = 1;
170 if (
GETPOST(
'cancel',
'alpha')) { $action =
'list'; $massaction =
''; }
171 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') { $massaction =
''; }
173 $parameters = array(
'socid'=>$socid);
174 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
175 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
179 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
181 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha'))
183 $search_mvt_num =
'';
184 $search_doc_type =
'';
185 $search_doc_ref =
'';
186 $search_doc_date =
'';
187 $search_accountancy_code =
'';
188 $search_accountancy_code_start =
'';
189 $search_accountancy_code_end =
'';
190 $search_accountancy_aux_code =
'';
191 $search_accountancy_aux_code_start =
'';
192 $search_accountancy_aux_code_end =
'';
193 $search_mvt_label =
'';
194 $search_direction =
'';
195 $search_ledger_code =
'';
196 $search_date_start =
'';
197 $search_date_end =
'';
198 $search_date_creation_start =
'';
199 $search_date_creation_end =
'';
200 $search_date_modification_start =
'';
201 $search_date_modification_end =
'';
202 $search_date_export_start =
'';
203 $search_date_export_end =
'';
206 $search_lettering_code =
'';
207 $search_not_reconciled =
'';
213 if (!empty($search_date_start)) {
214 $filter[
't.doc_date>='] = $search_date_start;
216 $param .=
'&search_date_startmonth='.urlencode($tmp[
'mon']).
'&search_date_startday='.urlencode($tmp[
'mday']).
'&search_date_startyear='.urlencode($tmp[
'year']);
218 if (!empty($search_date_end)) {
219 $filter[
't.doc_date<='] = $search_date_end;
221 $param .=
'&search_date_endmonth='.urlencode($tmp[
'mon']).
'&search_date_endday='.urlencode($tmp[
'mday']).
'&search_date_endyear='.urlencode($tmp[
'year']);
223 if (!empty($search_doc_date)) {
224 $filter[
't.doc_date'] = $search_doc_date;
226 $param .=
'&doc_datemonth='.urlencode($tmp[
'mon']).
'&doc_dateday='.urlencode($tmp[
'mday']).
'&doc_dateyear='.urlencode($tmp[
'year']);
228 if (!empty($search_doc_type)) {
229 $filter[
't.doc_type'] = $search_doc_type;
230 $param .=
'&search_doc_type='.urlencode($search_doc_type);
232 if (!empty($search_doc_ref)) {
233 $filter[
't.doc_ref'] = $search_doc_ref;
234 $param .=
'&search_doc_ref='.urlencode($search_doc_ref);
236 if (!empty($search_accountancy_code)) {
237 $filter[
't.numero_compte'] = $search_accountancy_code;
238 $param .=
'&search_accountancy_code='.urlencode($search_accountancy_code);
240 if (!empty($search_accountancy_code_start)) {
241 $filter[
't.numero_compte>='] = $search_accountancy_code_start;
242 $param .=
'&search_accountancy_code_start='.urlencode($search_accountancy_code_start);
244 if (!empty($search_accountancy_code_end)) {
245 $filter[
't.numero_compte<='] = $search_accountancy_code_end;
246 $param .=
'&search_accountancy_code_end='.urlencode($search_accountancy_code_end);
248 if (!empty($search_accountancy_aux_code)) {
249 $filter[
't.subledger_account'] = $search_accountancy_aux_code;
250 $param .=
'&search_accountancy_aux_code='.urlencode($search_accountancy_aux_code);
252 if (!empty($search_accountancy_aux_code_start)) {
253 $filter[
't.subledger_account>='] = $search_accountancy_aux_code_start;
254 $param .=
'&search_accountancy_aux_code_start='.urlencode($search_accountancy_aux_code_start);
256 if (!empty($search_accountancy_aux_code_end)) {
257 $filter[
't.subledger_account<='] = $search_accountancy_aux_code_end;
258 $param .=
'&search_accountancy_aux_code_end='.urlencode($search_accountancy_aux_code_end);
260 if (!empty($search_mvt_label)) {
261 $filter[
't.label_operation'] = $search_mvt_label;
262 $param .=
'&search_mvt_label='.urlencode($search_mvt_label);
264 if (!empty($search_direction)) {
265 $filter[
't.sens'] = $search_direction;
266 $param .=
'&search_direction='.urlencode($search_direction);
268 if (!empty($search_ledger_code)) {
269 $filter[
't.code_journal'] = $search_ledger_code;
270 $param .=
'&search_ledger_code='.urlencode($search_ledger_code);
272 if (!empty($search_mvt_num)) {
273 $filter[
't.piece_num'] = $search_mvt_num;
274 $param .=
'&search_mvt_num='.urlencode($search_mvt_num);
276 if (!empty($search_date_creation_start)) {
277 $filter[
't.date_creation>='] = $search_date_creation_start;
279 $param .=
'&date_creation_startmonth='.urlencode($tmp[
'mon']).
'&date_creation_startday='.urlencode($tmp[
'mday']).
'&date_creation_startyear='.urlencode($tmp[
'year']);
281 if (!empty($search_date_creation_end)) {
282 $filter[
't.date_creation<='] = $search_date_creation_end;
284 $param .=
'&date_creation_endmonth='.urlencode($tmp[
'mon']).
'&date_creation_endday='.urlencode($tmp[
'mday']).
'&date_creation_endyear='.urlencode($tmp[
'year']);
286 if (!empty($search_date_modification_start)) {
287 $filter[
't.tms>='] = $search_date_modification_start;
288 $tmp =
dol_getdate($search_date_modification_start);
289 $param .=
'&date_modification_startmonth='.urlencode($tmp[
'mon']).
'&date_modification_startday='.urlencode($tmp[
'mday']).
'&date_modification_startyear='.urlencode($tmp[
'year']);
291 if (!empty($search_date_modification_end)) {
292 $filter[
't.tms<='] = $search_date_modification_end;
294 $param .=
'&date_modification_endmonth='.urlencode($tmp[
'mon']).
'&date_modification_endday='.urlencode($tmp[
'mday']).
'&date_modification_endyear='.urlencode($tmp[
'year']);
296 if (!empty($search_date_export_start)) {
297 $filter[
't.date_export>='] = $search_date_export_start;
299 $param .=
'&date_export_startmonth='.urlencode($tmp[
'mon']).
'&date_export_startday='.urlencode($tmp[
'mday']).
'&date_export_startyear='.urlencode($tmp[
'year']);
301 if (!empty($search_date_export_end)) {
302 $filter[
't.date_export<='] = $search_date_export_end;
304 $param .=
'&date_export_endmonth='.urlencode($tmp[
'mon']).
'&date_export_endday='.urlencode($tmp[
'mday']).
'&date_export_endyear='.urlencode($tmp[
'year']);
306 if (!empty($search_debit)) {
307 $filter[
't.debit'] = $search_debit;
308 $param .=
'&search_debit='.urlencode($search_debit);
310 if (!empty($search_credit)) {
311 $filter[
't.credit'] = $search_credit;
312 $param .=
'&search_credit='.urlencode($search_credit);
314 if (!empty($search_lettering_code)) {
315 $filter[
't.lettering_code'] = $search_lettering_code;
316 $param .=
'&search_lettering_code='.urlencode($search_lettering_code);
318 if (!empty($search_not_reconciled)) {
319 $filter[
't.reconciled_option'] = $search_not_reconciled;
320 $param .=
'&search_not_reconciled='.urlencode($search_not_reconciled);
324 if ($action ==
'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
325 $import_key =
GETPOST(
'importkey',
'alpha');
327 if (!empty($import_key)) {
328 $result = $object->deleteByImportkey($import_key);
334 header(
"Location: list.php".($param ?
'?'.$param :
''));
338 if ($action ==
'delbookkeepingyearconfirm' && $user->rights->accounting->mouvements->supprimer_tous) {
339 $delmonth =
GETPOST(
'delmonth',
'int');
340 $delyear =
GETPOST(
'delyear',
'int');
341 if ($delyear == -1) {
344 $deljournal =
GETPOST(
'deljournal',
'alpha');
345 if ($deljournal == -1) {
349 if (!empty($delmonth) || !empty($delyear) || !empty($deljournal))
351 $result = $object->deleteByYearAndJournal($delyear, $deljournal,
'', ($delmonth > 0 ? $delmonth : 0));
359 header(
"Location: list.php".($param ?
'?'.$param :
''));
365 if ($action ==
'delmouvconfirm' && $user->rights->accounting->mouvements->supprimer) {
366 $mvt_num =
GETPOST(
'mvt_num',
'int');
368 if (!empty($mvt_num)) {
369 $result = $object->deleteMvtNum($mvt_num);
376 header(
"Location: list.php?noreset=1".($param ?
'&'.$param :
''));
380 if ($action ==
'setreexport') {
381 $setreexport =
GETPOST(
'value',
'int');
382 if (!
dolibarr_set_const($db,
"ACCOUNTING_REEXPORT", $setreexport,
'yesno', 0,
'', $conf->entity)) $error++;
385 if ($conf->global->ACCOUNTING_REEXPORT == 1) {
386 setEventMessages($langs->trans(
"ExportOfPiecesAlreadyExportedIsEnable"), null,
'mesgs');
388 setEventMessages($langs->trans(
"ExportOfPiecesAlreadyExportedIsDisable"), null,
'mesgs');
401 $sql .=
" t.doc_date,";
402 $sql .=
" t.doc_type,";
403 $sql .=
" t.doc_ref,";
404 $sql .=
" t.fk_doc,";
405 $sql .=
" t.fk_docdet,";
406 $sql .=
" t.thirdparty_code,";
407 $sql .=
" t.subledger_account,";
408 $sql .=
" t.subledger_label,";
409 $sql .=
" t.numero_compte,";
410 $sql .=
" t.label_compte,";
411 $sql .=
" t.label_operation,";
413 $sql .=
" t.credit,";
414 $sql .=
" t.lettering_code,";
415 $sql .=
" t.montant as amount,";
417 $sql .=
" t.fk_user_author,";
418 $sql .=
" t.import_key,";
419 $sql .=
" t.code_journal,";
420 $sql .=
" t.journal_label,";
421 $sql .=
" t.piece_num,";
422 $sql .=
" t.date_creation,";
423 $sql .=
" t.tms as date_modification,";
424 $sql .=
" t.date_export";
425 $sql .=
' FROM '.MAIN_DB_PREFIX.$object->table_element.
' as t';
428 if (count($filter) > 0) {
429 foreach ($filter as $key => $value) {
430 if ($key ==
't.doc_date') {
431 $sqlwhere[] = $key.
'=\''.$db->idate($value).
'\'';
432 } elseif ($key ==
't.doc_date>=' || $key ==
't.doc_date<=') {
433 $sqlwhere[] = $key.
'\''.$db->idate($value).
'\'';
434 } elseif ($key ==
't.numero_compte>=' || $key ==
't.numero_compte<=' || $key ==
't.subledger_account>=' || $key ==
't.subledger_account<=') {
435 $sqlwhere[] = $key.
'\''.$db->escape($value).
'\'';
436 } elseif ($key ==
't.fk_doc' || $key ==
't.fk_docdet' || $key ==
't.piece_num') {
437 $sqlwhere[] = $key.
'='.$value;
438 } elseif ($key ==
't.subledger_account' || $key ==
't.numero_compte') {
439 $sqlwhere[] = $key.
' LIKE \''.$db->escape($value).
'%\'';
440 } elseif ($key ==
't.date_creation>=' || $key ==
't.date_creation<=') {
441 $sqlwhere[] = $key.
'\''.$db->idate($value).
'\'';
442 } elseif ($key ==
't.tms>=' || $key ==
't.tms<=') {
443 $sqlwhere[] = $key.
'\''.$db->idate($value).
'\'';
444 } elseif ($key ==
't.date_export>=' || $key ==
't.date_export<=') {
445 $sqlwhere[] = $key.
'\''.$db->idate($value).
'\'';
446 } elseif ($key ==
't.credit' || $key ==
't.debit') {
448 } elseif ($key ==
't.reconciled_option') {
449 $sqlwhere[] =
't.lettering_code IS NULL';
455 $sql .=
' WHERE t.entity IN ('.getEntity(
'accountancy').
')';
456 if ($conf->global->ACCOUNTING_REEXPORT == 0) {
457 $sql .=
" AND t.date_export IS NULL";
459 if (count($sqlwhere) > 0) {
460 $sql .=
' AND '.implode(
' AND ', $sqlwhere);
462 if (!empty($sortfield)) {
463 $sql .= $db->order($sortfield, $sortorder);
470 if ($action ==
'export_file' && $user->rights->accounting->mouvements->export) {
472 $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter,
'AND', $conf->global->ACCOUNTING_REEXPORT);
480 $accountancyexport->export($object->lines, $formatexportset);
482 if (!empty($accountancyexport->errors))
490 if (is_array($object->lines))
492 foreach ($object->lines as $movement)
496 $sql =
" UPDATE ".MAIN_DB_PREFIX.
"accounting_bookkeeping";
497 $sql .=
" SET date_export = '".$db->idate($now).
"'";
498 $sql .=
" WHERE rowid = ".$movement->id;
500 dol_syslog(
"/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
501 $result = $db->query($sql);
517 setEventMessages($langs->trans(
"NotAllExportedMovementsCouldBeRecordedAsExported"), null,
'errors');
532 $title_page = $langs->trans(
"Operations").
' - '.$langs->trans(
"Journals");
535 $nbtotalofrecords =
'';
536 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
538 $resql = $db->query($sql);
539 $nbtotalofrecords = $db->num_rows(
$resql);
540 if (($page * $limit) > $nbtotalofrecords)
547 if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
549 $num = $nbtotalofrecords;
551 $sql .= $db->plimit($limit + 1, $offset);
553 $resql = $db->query($sql);
560 $num = $db->num_rows(
$resql);
570 if ($action ==
'delmouv') {
571 $formconfirm = $form->formconfirm(
$_SERVER[
"PHP_SELF"].
'?mvt_num='.
GETPOST(
'mvt_num').$param, $langs->trans(
'DeleteMvt'), $langs->trans(
'ConfirmDeleteMvtPartial'),
'delmouvconfirm',
'', 0, 1);
574 if ($action ==
'delbookkeepingyear') {
575 $form_question = array();
576 $delyear =
GETPOST(
'delyear',
'int');
577 $deljournal =
GETPOST(
'deljournal',
'alpha');
579 if (empty($delyear)) {
582 $month_array = array();
583 for ($i = 1; $i <= 12; $i++) {
584 $month_array[$i] = $langs->trans(
"Month".sprintf(
"%02d", $i));
586 $year_array = $formaccounting->selectyear_accountancy_bookkepping($delyear,
'delyear', 0,
'array');
587 $journal_array = $formaccounting->select_journal($deljournal,
'deljournal',
'', 1, 1, 1,
'', 0, 1);
589 $form_question[
'delmonth'] = array(
590 'name' =>
'delmonth',
592 'label' => $langs->trans(
'DelMonth'),
593 'values' => $month_array,
596 $form_question[
'delyear'] = array(
599 'label' => $langs->trans(
'DelYear'),
600 'values' => $year_array,
601 'default' => $delyear
603 $form_question[
'deljournal'] = array(
604 'name' =>
'deljournal',
606 'label' => $langs->trans(
'DelJournal'),
607 'value' => $journal_array,
608 'default' => $deljournal
611 $formconfirm = $form->formconfirm(
$_SERVER[
"PHP_SELF"].
'?'.$param, $langs->trans(
'DeleteMvt'), $langs->trans(
'ConfirmDeleteMvt', $langs->transnoentitiesnoconv(
"RegistrationInAccounting")),
'delbookkeepingyearconfirm', $form_question,
'', 1, 300);
616 if (!empty($contextpage) && $contextpage !=
$_SERVER[
"PHP_SELF"]) $param .=
'&contextpage='.urlencode($contextpage);
617 if ($limit > 0 && $limit != $conf->liste_limit) $param .=
'&limit='.urlencode($limit);
619 print '<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
620 print '<input type="hidden" name="token" value="'.newToken().
'">';
621 print '<input type="hidden" name="action" value="list">';
622 if ($optioncss !=
'')
print '<input type="hidden" name="optioncss" value="'.urlencode($optioncss).
'">';
623 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
624 print '<input type="hidden" name="sortfield" value="'.urlencode($sortfield).
'">';
625 print '<input type="hidden" name="sortorder" value="'.urlencode($sortorder).
'">';
627 if (count($filter)) $buttonLabel = $langs->trans(
"ExportFilteredList");
628 else $buttonLabel = $langs->trans(
"ExportList");
630 $parameters = array();
631 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
632 if (empty($reshook)) {
634 if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
635 $newcardbutton =
'<a class="valignmiddle" href="'.$_SERVER[
'PHP_SELF'].
'?action=setreexport&token='.
newToken().
'&value=0'.($param ?
'&'.$param :
'').
'">'.
img_picto($langs->trans(
"Activated"),
'switch_on').
'</a> ';
637 $newcardbutton =
'<a class="valignmiddle" href="'.$_SERVER[
'PHP_SELF'].
'?action=setreexport&token='.
newToken().
'&value=1'.($param ?
'&'.$param :
'').
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a> ';
639 $newcardbutton .=
'<span class="valignmiddle marginrightonly">'.$langs->trans(
"IncludeDocsAlreadyExported").
'</span>';
641 if (!empty($user->rights->accounting->mouvements->export)) $newcardbutton .=
dolGetButtonTitle($buttonLabel, $langs->trans(
"ExportFilteredList").
' ('.$listofformat[$formatexportset].
')',
'fa fa-file-export paddingleft',
$_SERVER[
"PHP_SELF"].
'?action=export_file'.($param ?
'&'.$param :
''), $user->rights->accounting->mouvements->export);
643 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewFlatList'),
'',
'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.
'/accountancy/bookkeeping/list.php?'.$param,
'', 1, array(
'morecss' =>
'marginleftonly btnTitleSelected'));
644 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.
'/accountancy/bookkeeping/listbyaccount.php?'.$param,
'', 1, array(
'morecss' =>
'marginleftonly'));
645 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'GroupBySubAccountAccounting'),
'',
'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.
'/accountancy/bookkeeping/listbysubaccount.php?'.$param,
'', 1, array(
'morecss' =>
'marginleftonly'));
647 $url =
'./card.php?action=create';
648 if (!empty($socid)) $url .=
'&socid='.$socid;
649 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewAccountingMvt'),
'',
'fa fa-plus-circle paddingleft', $url,
'', $user->rights->accounting->mouvements->creer);
652 print_barre_liste($title_page, $page,
$_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'title_accountancy', 0, $newcardbutton,
'', $limit, 0, 0, 1);
654 $varpage = empty($contextpage) ?
$_SERVER[
"PHP_SELF"] : $contextpage;
655 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
656 if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
658 $parameters = array();
659 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
660 if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
661 else $moreforfilter = $hookmanager->resPrint;
663 print '<div class="div-table-responsive">';
664 print '<table class="tagtable liste centpercent">';
667 print '<tr class="liste_titre_filter">';
670 if (!empty($arrayfields[
't.piece_num'][
'checked']))
672 print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="'.dol_escape_htmltag($search_mvt_num).
'"></td>';
675 if (!empty($arrayfields[
't.code_journal'][
'checked']))
677 print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="'.(is_array($search_ledger_code) ? join(
'|', $search_ledger_code) : $search_ledger_code).
'"></td>';
680 if (!empty($arrayfields[
't.doc_date'][
'checked']))
682 print '<td class="liste_titre center">';
683 print '<div class="nowrap">';
684 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
686 print '<div class="nowrap">';
687 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
692 if (!empty($arrayfields[
't.doc_ref'][
'checked']))
694 print '<td class="liste_titre"><input type="text" name="search_doc_ref" size="8" value="'.dol_escape_htmltag($search_doc_ref).
'"></td>';
697 if (!empty($arrayfields[
't.numero_compte'][
'checked']))
699 print '<td class="liste_titre">';
700 print '<div class="nowrap">';
701 print $langs->trans(
'From').
' ';
702 print $formaccounting->select_account($search_accountancy_code_start,
'search_accountancy_code_start', 1, array(), 1, 1,
'maxwidth200');
704 print '<div class="nowrap">';
705 print $langs->trans(
'to').
' ';
706 print $formaccounting->select_account($search_accountancy_code_end,
'search_accountancy_code_end', 1, array(), 1, 1,
'maxwidth200');
711 if (!empty($arrayfields[
't.subledger_account'][
'checked']))
713 print '<td class="liste_titre">';
714 print '<div class="nowrap">';
717 if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
719 print $langs->trans(
'From').
' ';
720 print $formaccounting->select_auxaccount($search_accountancy_aux_code_start,
'search_accountancy_aux_code_start', 1);
722 print '<input type="text" class="maxwidth100" name="search_accountancy_aux_code_start" value="'.$search_accountancy_aux_code_start.
'" placeholder="'.$langs->trans(
"From").
'">';
725 print '<div class="nowrap">';
728 if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
730 print $langs->trans(
'to').
' ';
731 print $formaccounting->select_auxaccount($search_accountancy_aux_code_end,
'search_accountancy_aux_code_end', 1);
733 print '<input type="text" class="maxwidth100" name="search_accountancy_aux_code_end" value="'.$search_accountancy_aux_code_end.
'" placeholder="'.$langs->trans(
"to").
'">';
739 if (!empty($arrayfields[
't.label_operation'][
'checked']))
741 print '<td class="liste_titre">';
742 print '<input type="text" size="7" class="flat" name="search_mvt_label" value="'.$search_mvt_label.
'"/>';
746 if (!empty($arrayfields[
't.debit'][
'checked']))
748 print '<td class="liste_titre right">';
749 print '<input type="text" class="flat" name="search_debit" size="4" value="'.dol_escape_htmltag($search_debit).
'">';
753 if (!empty($arrayfields[
't.credit'][
'checked']))
755 print '<td class="liste_titre right">';
756 print '<input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).
'">';
760 if (!empty($arrayfields[
't.lettering_code'][
'checked']))
762 print '<td class="liste_titre center">';
763 print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.
'"/>';
764 print '<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled ==
'notreconciled' ?
' checked' :
'').
'>'.$langs->trans(
"NotReconciled").
'</span>';
770 $parameters = array(
'arrayfields'=>$arrayfields);
771 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
772 print $hookmanager->resPrint;
775 if (!empty($arrayfields[
't.date_creation'][
'checked']))
777 print '<td class="liste_titre center">';
778 print '<div class="nowrap">';
779 print $form->selectDate($search_date_creation_start,
'date_creation_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
781 print '<div class="nowrap">';
782 print $form->selectDate($search_date_creation_end,
'date_creation_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
787 if (!empty($arrayfields[
't.tms'][
'checked']))
789 print '<td class="liste_titre center">';
790 print '<div class="nowrap">';
791 print $form->selectDate($search_date_modification_start,
'date_modification_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
793 print '<div class="nowrap">';
794 print $form->selectDate($search_date_modification_end,
'date_modification_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
799 if (!empty($arrayfields[
't.date_export'][
'checked']))
801 print '<td class="liste_titre center">';
802 print '<div class="nowrap">';
803 print $form->selectDate($search_date_export_start,
'date_export_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
805 print '<div class="nowrap">';
806 print $form->selectDate($search_date_export_end,
'date_export_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
811 print '<td class="liste_titre center">';
812 $searchpicto = $form->showFilterButtons();
817 print '<tr class="liste_titre">';
818 if (!empty($arrayfields[
't.piece_num'][
'checked']))
print_liste_field_titre($arrayfields[
't.piece_num'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.piece_num",
"", $param,
"", $sortfield, $sortorder);
819 if (!empty($arrayfields[
't.code_journal'][
'checked']))
print_liste_field_titre($arrayfields[
't.code_journal'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.code_journal",
"", $param,
'', $sortfield, $sortorder,
'center ');
820 if (!empty($arrayfields[
't.doc_date'][
'checked']))
print_liste_field_titre($arrayfields[
't.doc_date'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.doc_date",
"", $param,
'', $sortfield, $sortorder,
'center ');
821 if (!empty($arrayfields[
't.doc_ref'][
'checked']))
print_liste_field_titre($arrayfields[
't.doc_ref'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.doc_ref",
"", $param,
"", $sortfield, $sortorder);
822 if (!empty($arrayfields[
't.numero_compte'][
'checked']))
print_liste_field_titre($arrayfields[
't.numero_compte'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.numero_compte",
"", $param,
"", $sortfield, $sortorder);
823 if (!empty($arrayfields[
't.subledger_account'][
'checked']))
print_liste_field_titre($arrayfields[
't.subledger_account'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.subledger_account",
"", $param,
"", $sortfield, $sortorder);
824 if (!empty($arrayfields[
't.label_operation'][
'checked']))
print_liste_field_titre($arrayfields[
't.label_operation'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.label_operation",
"", $param,
"", $sortfield, $sortorder);
825 if (!empty($arrayfields[
't.debit'][
'checked']))
print_liste_field_titre($arrayfields[
't.debit'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.debit",
"", $param,
'', $sortfield, $sortorder,
'right ');
826 if (!empty($arrayfields[
't.credit'][
'checked']))
print_liste_field_titre($arrayfields[
't.credit'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.credit",
"", $param,
'', $sortfield, $sortorder,
'right ');
827 if (!empty($arrayfields[
't.lettering_code'][
'checked']))
print_liste_field_titre($arrayfields[
't.lettering_code'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.lettering_code",
"", $param,
'', $sortfield, $sortorder,
'center ');
829 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
830 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
831 print $hookmanager->resPrint;
832 if (!empty($arrayfields[
't.date_creation'][
'checked']))
print_liste_field_titre($arrayfields[
't.date_creation'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center ');
833 if (!empty($arrayfields[
't.tms'][
'checked']))
print_liste_field_titre($arrayfields[
't.tms'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.tms",
"", $param,
'', $sortfield, $sortorder,
'center ');
834 if (!empty($arrayfields[
't.date_export'][
'checked']))
print_liste_field_titre($arrayfields[
't.date_export'][
'label'],
$_SERVER[
'PHP_SELF'],
"t.date_export",
"", $param,
'', $sortfield, $sortorder,
'center ');
844 $totalarray = array();
845 while ($i < min($num, $limit))
847 $obj = $db->fetch_object(
$resql);
848 if (empty($obj))
break;
850 $line->id = $obj->rowid;
851 $line->doc_date = $db->jdate($obj->doc_date);
852 $line->doc_type = $obj->doc_type;
853 $line->doc_ref = $obj->doc_ref;
854 $line->fk_doc = $obj->fk_doc;
855 $line->fk_docdet = $obj->fk_docdet;
856 $line->thirdparty_code = $obj->thirdparty_code;
857 $line->subledger_account = $obj->subledger_account;
858 $line->subledger_label = $obj->subledger_label;
859 $line->numero_compte = $obj->numero_compte;
860 $line->label_compte = $obj->label_compte;
861 $line->label_operation = $obj->label_operation;
862 $line->debit = $obj->debit;
863 $line->credit = $obj->credit;
864 $line->montant = $obj->amount;
865 $line->amount = $obj->amount;
866 $line->sens = $obj->sens;
867 $line->lettering_code = $obj->lettering_code;
868 $line->fk_user_author = $obj->fk_user_author;
869 $line->import_key = $obj->import_key;
870 $line->code_journal = $obj->code_journal;
871 $line->journal_label = $obj->journal_label;
872 $line->piece_num = $obj->piece_num;
873 $line->date_creation = $db->jdate($obj->date_creation);
874 $line->date_modification = $db->jdate($obj->date_modification);
875 $line->date_export = $db->jdate($obj->date_export);
877 $total_debit += $line->debit;
878 $total_credit += $line->credit;
880 print '<tr class="oddeven">';
883 if (!empty($arrayfields[
't.piece_num'][
'checked']))
886 $object->id = $line->id;
887 $object->piece_num = $line->piece_num;
888 print $object->getNomUrl(1,
'', 0,
'', 1);
890 if (!$i) $totalarray[
'nbfield']++;
894 if (!empty($arrayfields[
't.code_journal'][
'checked']))
897 $result = $accountingjournal->fetch(
'', $line->code_journal);
898 $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0,
'', 0) : $line->code_journal);
899 print '<td class="center">'.$journaltoshow.
'</td>';
900 if (!$i) $totalarray[
'nbfield']++;
904 if (!empty($arrayfields[
't.doc_date'][
'checked']))
906 print '<td class="center">'.dol_print_date($line->doc_date,
'day').
'</td>';
907 if (!$i) $totalarray[
'nbfield']++;
911 if (!empty($arrayfields[
't.doc_ref'][
'checked']))
913 if ($line->doc_type ==
'customer_invoice')
915 $langs->loadLangs(array(
'bills'));
917 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
918 $objectstatic =
new Facture($db);
919 $objectstatic->fetch($line->fk_doc);
924 $urlsource =
$_SERVER[
'PHP_SELF'].
'?id='.$objectstatic->id;
925 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
926 } elseif ($line->doc_type ==
'supplier_invoice')
928 $langs->loadLangs(array(
'bills'));
930 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
932 $objectstatic->fetch($line->fk_doc);
936 $filedir = $conf->fournisseur->facture->dir_output.
'/'.
get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
937 $subdir =
get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
938 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
939 } elseif ($line->doc_type ==
'expense_report')
941 $langs->loadLangs(array(
'trips'));
943 require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
945 $objectstatic->fetch($line->fk_doc);
950 $urlsource =
$_SERVER[
'PHP_SELF'].
'?id='.$objectstatic->id;
951 $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
956 print '<td class="nowrap">';
958 print '<table class="nobordernopadding"><tr class="nocellnopadd">';
960 print '<td class="nobordernopadding nowrap">';
962 if ($line->doc_type ==
'customer_invoice' || $line->doc_type ==
'supplier_invoice' || $line->doc_type ==
'expense_report')
964 print $objectstatic->getNomUrl(1,
'', 0, 0,
'', 0, -1, 1);
967 print $line->doc_ref;
969 print '</td></tr></table>';
972 if (!$i) $totalarray[
'nbfield']++;
976 if (!empty($arrayfields[
't.numero_compte'][
'checked']))
978 print '<td>'.length_accountg($line->numero_compte).
'</td>';
979 if (!$i) $totalarray[
'nbfield']++;
983 if (!empty($arrayfields[
't.subledger_account'][
'checked']))
985 print '<td>'.length_accounta($line->subledger_account).
'</td>';
986 if (!$i) $totalarray[
'nbfield']++;
990 if (!empty($arrayfields[
't.label_operation'][
'checked']))
992 print '<td>'.$line->label_operation.
'</td>';
993 if (!$i) $totalarray[
'nbfield']++;
997 if (!empty($arrayfields[
't.debit'][
'checked']))
999 print '<td class="nowrap right">'.($line->debit != 0 ?
price($line->debit) :
'').
'</td>';
1000 if (!$i) $totalarray[
'nbfield']++;
1001 if (!$i) $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totaldebit';
1002 $totalarray[
'val'][
'totaldebit'] += $line->debit;
1006 if (!empty($arrayfields[
't.credit'][
'checked']))
1008 print '<td class="nowrap right">'.($line->credit != 0 ?
price($line->credit) :
'').
'</td>';
1009 if (!$i) $totalarray[
'nbfield']++;
1010 if (!$i) $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalcredit';
1011 $totalarray[
'val'][
'totalcredit'] += $line->credit;
1015 if (!empty($arrayfields[
't.lettering_code'][
'checked']))
1017 print '<td class="center">'.$line->lettering_code.
'</td>';
1018 if (!$i) $totalarray[
'nbfield']++;
1022 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1023 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1024 print $hookmanager->resPrint;
1027 if (!empty($arrayfields[
't.date_creation'][
'checked']))
1029 print '<td class="center">'.dol_print_date($line->date_creation,
'dayhour').
'</td>';
1030 if (!$i) $totalarray[
'nbfield']++;
1034 if (!empty($arrayfields[
't.tms'][
'checked']))
1036 print '<td class="center">'.dol_print_date($line->date_modification,
'dayhour').
'</td>';
1037 if (!$i) $totalarray[
'nbfield']++;
1041 if (!empty($arrayfields[
't.date_export'][
'checked']))
1043 print '<td class="center">'.dol_print_date($line->date_export,
'dayhour').
'</td>';
1044 if (!$i) $totalarray[
'nbfield']++;
1048 print '<td class="nowraponall center">';
1049 if (empty($line->date_export)) {
1050 if ($user->rights->accounting->mouvements->creer) {
1051 print '<a class="editfielda paddingleft marginrightonly" href="'.DOL_URL_ROOT.
'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.$param.
'&page='.$page.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
'').
'">'.
img_edit().
'</a>';
1053 if ($user->rights->accounting->mouvements->supprimer) {
1054 print '<a class="reposition paddingleft marginrightonly" href="'.$_SERVER[
'PHP_SELF'].
'?action=delmouv&mvt_num='.$line->piece_num.$param.
'&page='.$page.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
'').
'">'.
img_delete().
'</a>';
1059 if (!$i) $totalarray[
'nbfield']++;
1067 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1074 if ($user->rights->accounting->mouvements->supprimer_tous) {
1075 print '<div class="tabsAction tabsActionNoBottom">'.
"\n";
1076 print '<a class="butActionDelete" name="button_delmvt" href="'.$_SERVER[
"PHP_SELF"].
'?action=delbookkeepingyear'.($param ?
'&'.$param :
'').
'">'.$langs->trans(
"DeleteMvt").
'</a>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
img_edit($titlealt= 'default', $float=0, $other= '')
Show logo editer/modifier fiche.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dolGetButtonTitle($label, $helpText= '', $iconClass= 'fa fa-file', $url= '', $id= '', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_now($mode= 'auto')
Return date for now.
dolibarr_set_const($db, $name, $value, $type= 'chaine', $visible=0, $note= '', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Class to manage suppliers invoices.
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...
Class to manage Ledger (General Ledger and Subledger)
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
static getType()
Array with all export type available (key + label)
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
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.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
Class to manage Trips and Expenses.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Manage the different format accountancy export.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Class to manage accounting accounts.
Class to manage invoices.
img_delete($titlealt= 'default', $other= 'class="pictodelete"', $morecss= '')
Show delete logo.