31if ((array_key_exists(
'action', $_GET) && $_GET[
'action'] ==
'dl') || (array_key_exists(
'action', $_POST) && $_POST[
'action'] ==
'dl')) {
32 if (!defined(
'NOTOKENRENEWAL')) {
33 define(
'NOTOKENRENEWAL',
'1');
38require
'../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/loan/class/paymentloan.class.php';
55 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
56 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
72$langs->loadLangs(array(
"accountancy",
"bills",
"companies",
"salaries",
"compta",
"trips",
"banks",
"loan"));
74$date_start =
GETPOST(
'date_start',
'alpha');
76$date_startMonth =
GETPOSTINT(
'date_startmonth');
78$date_start =
dol_mktime(0, 0, 0, $date_startMonth, $date_startDay, $date_startYear,
'tzuserrel');
79$date_stop =
GETPOST(
'date_stop',
'alpha');
83$date_stop =
dol_mktime(23, 59, 59, $date_stopMonth, $date_stopDay, $date_stopYear,
'tzuserrel');
84$action =
GETPOST(
'action',
'aZ09');
88$hookmanager->initHooks(array(
'comptafileslist',
'globallist'));
92$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
93$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
95if (empty($page) || $page == -1) {
98$offset = $limit * $page;
100$pagenext = $page + 1;
102 $sortfield =
"date,item";
110 'type' => array(
'label' =>
"Type",
'checked' => 1),
111 'date' => array(
'label' =>
"Date",
'checked' => 1),
112 'date_due' => array(
'label' =>
"DateDue",
'checked' => 1),
113 'ref' => array(
'label' =>
"Ref",
'checked' => 1),
114 'documents' => array(
'label' =>
"Documents",
'checked' => 1),
115 'paid' => array(
'label' =>
"Paid",
'checked' => 1),
116 'total_ht' => array(
'label' =>
"TotalHT",
'checked' => 1),
117 'total_ttc' => array(
'label' =>
"TotalTTC",
'checked' => 1),
118 'total_vat' => array(
'label' =>
"TotalVAT",
'checked' => 1),
126if ($user->socid > 0) {
131$arrayofentities = array();
133 $arrayofentities = $mc->getEntitiesList();
136$entity = (GETPOSTISSET(
'entity') ?
GETPOSTINT(
'entity') : (GETPOSTISSET(
'search_entity') ?
GETPOSTINT(
'search_entity') : $conf->entity));
138 if (empty($entity) &&
getDolGlobalString(
'MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES')) {
139 $entity =
'0,'.implode(
',', array_keys($arrayofentities));
143 $entity = $conf->entity;
148$listofchoices = array(
149 'selectinvoices' => array(
'label' =>
'Invoices',
'picto' =>
'bill',
'lang' =>
'bills',
'enabled' =>
isModEnabled(
'invoice'),
'perms' => $user->hasRight(
'facture',
'lire')),
150 'selectsupplierinvoices' => array(
'label' =>
'BillsSuppliers',
'picto' =>
'supplier_invoice',
'lang' =>
'bills',
'enabled' =>
isModEnabled(
'supplier_invoice'),
'perms' => $user->hasRight(
'fournisseur',
'facture',
'lire')),
151 'selectexpensereports' => array(
'label' =>
'ExpenseReports',
'picto' =>
'expensereport',
'lang' =>
'trips',
'enabled' =>
isModEnabled(
'expensereport'),
'perms' => $user->hasRight(
'expensereport',
'lire')),
152 'selectdonations' => array(
'label' =>
'Donations',
'picto' =>
'donation',
'lang' =>
'donation',
'enabled' =>
isModEnabled(
'don'),
'perms' => $user->hasRight(
'don',
'lire')),
153 'selectsocialcontributions' => array(
'label' =>
'SocialContributions',
'picto' =>
'bill',
'enabled' =>
isModEnabled(
'tax'),
'perms' => $user->hasRight(
'tax',
'charges',
'lire')),
154 'selectpaymentsofsalaries' => array(
'label' =>
'SalariesPayments',
'picto' =>
'salary',
'lang' =>
'salaries',
'enabled' =>
isModEnabled(
'salaries'),
'perms' => $user->hasRight(
'salaries',
'read')),
155 'selectvariouspayment' => array(
'label' =>
'VariousPayment',
'picto' =>
'payment',
'enabled' =>
isModEnabled(
'bank'),
'perms' => $user->hasRight(
'banque',
'lire')),
156 'selectloanspayment' => array(
'label' =>
'PaymentLoan',
'picto' =>
'loan',
'enabled' =>
isModEnabled(
'don'),
'perms' => $user->hasRight(
'loan',
'read')),
169$filesarray = array();
171'@phan-var-force array<string,array{id:string,entity:string,date:string,date_due:string,paid:float|int,amount_ht:float|int,amount_ttc:float|int,amount_vat:float|int,amount_localtax1:float|int,amount_localtax2:float|int,amount_revenuestamp:float|int,ref:string,fk:string,item:string,thirdparty_name:string,thirdparty_code:string,country_code:string,vatnum:string,sens:string,currency:string,line?:string,name?:string,files?:mixed}> $filesarray';
174if ($action ==
'searchfiles' || $action ==
'dl') {
175 if (empty($date_start)) {
176 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"DateStart")),
null,
'errors');
179 if (empty($date_stop)) {
180 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"DateEnd")),
null,
'errors');
187 $wheretail =
" '".$db->idate($date_start).
"' AND '".$db->idate($date_stop).
"'";
190 if (
GETPOST(
'selectinvoices') && !empty($listofchoices[
'selectinvoices'][
'perms'])) {
192 $sql .=
" UNION ALL";
194 $sql .=
"SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat,";
195 $sql .=
" t.localtax1, t.localtax2, t.revenuestamp,";
196 $sql .=
" t.multicurrency_code as currency, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_CREDIT.
" as sens";
197 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as t LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON c.rowid = s.fk_pays";
198 $sql .=
" WHERE datef between ".$wheretail;
199 $sql .=
" AND t.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
200 $sql .=
" AND t.fk_statut <> ".Facture::STATUS_DRAFT;
201 if (!empty($projectid)) {
202 $sql .=
" AND fk_projet = ".((int) $projectid);
206 if (
GETPOST(
'selectsupplierinvoices') && !empty($listofchoices[
'selectsupplierinvoices'][
'perms'])) {
208 $sql .=
" UNION ALL";
210 $sql .=
" SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat,";
211 $sql .=
" t.localtax1, t.localtax2, 0 as revenuestamp,";
212 $sql .=
" t.multicurrency_code as currency, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'SupplierInvoice' as item, s.nom as thirdparty_name, s.code_fournisseur as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_DEBIT.
" as sens";
213 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture_fourn as t LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON c.rowid = s.fk_pays";
214 $sql .=
" WHERE datef between ".$wheretail;
215 $sql .=
" AND t.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
216 $sql .=
" AND t.fk_statut <> ".FactureFournisseur::STATUS_DRAFT;
217 if (!empty($projectid)) {
218 $sql .=
" AND fk_projet = ".((int) $projectid);
222 if (
GETPOST(
'selectexpensereports') && !empty($listofchoices[
'selectexpensereports'][
'perms'])) {
224 $sql .=
" UNION ALL";
228 if (!empty($projectid)) {
229 $sql .=
" SELECT t.rowid as id, t.entity, t.ref, t.paid, SUM(td.total_ht) as total_ht, SUM(td.total_ttc) as total_ttc, SUM(td.total_tva) as total_vat,";
230 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
231 $sql .=
" td.multicurrency_code as currency, t.fk_user_author as fk_soc, t.date_fin as date, t.date_fin as date_due, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, " . PAY_DEBIT .
" as sens";
232 $sql .=
" FROM " . MAIN_DB_PREFIX .
"expensereport as t";
233 $sql .=
" LEFT JOIN " . MAIN_DB_PREFIX .
"expensereport_det as td ON t.rowid = td.fk_expensereport";
234 $sql .=
" LEFT JOIN " . MAIN_DB_PREFIX .
"user as u ON u.rowid = t.fk_user_author";
235 $sql .=
" LEFT JOIN " . MAIN_DB_PREFIX .
"c_country as c ON c.rowid = u.fk_country";
236 $sql .=
" WHERE date_fin between " . $wheretail;
237 $sql .=
" AND t.entity IN (" . $db->sanitize($entity == 1 ?
'0,1' : $entity) .
')';
239 $sql .=
" AND fk_projet = ".((int) $projectid);
241 $sql .=
" SELECT t.rowid as id, t.entity, t.ref, t.paid, t.total_ht, t.total_ttc, t.total_tva as total_vat,";
242 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
243 $sql .=
" t.multicurrency_code as currency, t.fk_user_author as fk_soc, t.date_fin as date, t.date_fin as date_due, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, " . PAY_DEBIT .
" as sens";
244 $sql .=
" FROM " . MAIN_DB_PREFIX .
"expensereport as t LEFT JOIN " . MAIN_DB_PREFIX .
"user as u ON u.rowid = t.fk_user_author LEFT JOIN " . MAIN_DB_PREFIX .
"c_country as c ON c.rowid = u.fk_country";
245 $sql .=
" WHERE date_fin between " . $wheretail;
246 $sql .=
" AND t.entity IN (" . $db->sanitize($entity == 1 ?
'0,1' : $entity) .
')';
251 if (
GETPOST(
'selectdonations') && !empty($listofchoices[
'selectdonations'][
'perms'])) {
253 $sql .=
" UNION ALL";
255 $sql .=
" SELECT t.rowid as id, t.entity, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat,";
256 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
257 $sql .=
" '".$db->escape($conf->currency).
"' as currency, 0 as fk_soc, t.datedon as date, t.datedon as date_due, 'Donation' as item, t.societe as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_CREDIT.
" as sens";
258 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as t LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON c.rowid = t.fk_country";
259 $sql .=
" WHERE datedon between ".$wheretail;
260 $sql .=
" AND t.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
261 $sql .=
" AND t.fk_statut <> ".Don::STATUS_DRAFT;
262 if (!empty($projectid)) {
263 $sql .=
" AND fk_projet = ".((int) $projectid);
267 if (
GETPOST(
'selectpaymentsofsalaries') && !empty($listofchoices[
'selectpaymentsofsalaries'][
'perms'])) {
269 $sql .=
" UNION ALL";
271 $sql .=
" SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat,";
272 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
273 $sql .=
" '".$db->escape($conf->currency).
"' as currency, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT.
" as sens";
274 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX.
"user as u ON u.rowid = t.fk_user LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON c.rowid = u.fk_country";
275 $sql .=
" WHERE datep between ".$wheretail;
276 $sql .=
" AND t.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
278 if (!empty($projectid)) {
279 $sql .=
" AND fk_projet = ".((int) $projectid);
283 if (
GETPOST(
'selectsocialcontributions') && !empty($listofchoices[
'selectsocialcontributions'][
'perms'])) {
285 $sql .=
" UNION ALL";
287 $sql .=
" SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_vat,";
288 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
289 $sql .=
" '".$db->escape($conf->currency).
"' as currency, 0 as fk_soc, t.date_ech as date, t.periode as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT.
" as sens";
290 $sql .=
" FROM ".MAIN_DB_PREFIX.
"chargesociales as t";
291 $sql .=
" WHERE t.date_ech between ".$wheretail;
292 $sql .=
" AND t.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
294 if (!empty($projectid)) {
295 $sql .=
" AND fk_projet = ".((int) $projectid);
299 if (
GETPOST(
'selectvariouspayment') && !empty($listofchoices[
'selectvariouspayment'][
'perms'])) {
301 $sql .=
" UNION ALL";
303 $sql .=
" SELECT t.rowid as id, t.entity, t.ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_vat,";
304 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
305 $sql .=
" '".$db->escape($conf->currency).
"' as currency, 0 as fk_soc, t.datep as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, sens";
306 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_various as t";
307 $sql .=
" WHERE datep between ".$wheretail;
308 $sql .=
" AND t.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
309 if (!empty($projectid)) {
310 $sql .=
" AND fk_projet = ".((int) $projectid);
314 if (
GETPOST(
'selectloanspayment') && !empty($listofchoices[
'selectloanspayment'][
'perms']) && empty($projectid)) {
316 $sql .=
" UNION ALL";
318 $sql .=
" SELECT t.rowid as id, l.entity, l.label as ref, 1 as paid, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ht, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ttc, 0 as total_vat,";
319 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
320 $sql .=
" '".$db->escape($conf->currency).
"' as currency, 0 as fk_soc, t.datep as date, t.datep as date_due, 'LoanPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT.
" as sens";
321 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_loan as t LEFT JOIN ".MAIN_DB_PREFIX.
"loan as l ON l.rowid = t.fk_loan";
322 $sql .=
" WHERE datep between ".$wheretail;
323 $sql .=
" AND l.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
327 $sql .= $db->order($sortfield, $sortorder);
330 $resd = $db->query($sql);
335 $numd = $db->num_rows($resd);
337 $tmpinvoice =
new Facture($db);
339 $tmpdonation =
new Don($db);
344 $objd = $db->fetch_object($resd);
346 switch ($objd->item) {
350 $upload_dir = $conf->facture->dir_output.
'/'.$subdir;
351 $link =
"document.php?modulepart=facture&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
352 $modulepart =
"facture";
354 case "SupplierInvoice":
355 $tmpinvoicesupplier->fetch($objd->id);
356 $subdir =
get_exdir($tmpinvoicesupplier->id, 2, 0, 1, $tmpinvoicesupplier,
'invoice_supplier');
358 $upload_dir = $conf->fournisseur->facture->dir_output.
'/'.$subdir;
359 $link =
"document.php?modulepart=facture_fournisseur&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
360 $modulepart =
"facture_fournisseur";
362 case "ExpenseReport":
365 $upload_dir = $conf->expensereport->dir_output.
'/'.$subdir;
366 $link =
"document.php?modulepart=expensereport&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
367 $modulepart =
"expensereport";
369 case "SalaryPayment":
372 $upload_dir = $conf->salaries->dir_output.
'/'.$subdir;
373 $link =
"document.php?modulepart=salaries&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
374 $modulepart =
"salaries";
377 $tmpdonation->fetch($objd->id);
378 $subdir =
get_exdir(0, 0, 0, 0, $tmpdonation,
'donation');
380 $upload_dir = $conf->don->dir_output.
'/'.$subdir;
381 $link =
"document.php?modulepart=don&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
384 case "SocialContributions":
387 $upload_dir = $conf->tax->dir_output.
'/'.$subdir;
388 $link =
"document.php?modulepart=tax&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
391 case "VariousPayment":
394 $upload_dir = $conf->bank->dir_output.
'/'.$subdir;
395 $link =
"document.php?modulepart=banque&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
396 $modulepart =
"banque";
401 $upload_dir = $conf->loan->dir_output.
'/'.$subdir;
412 if (!empty($upload_dir)) {
415 $files =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$',
'', SORT_ASC, 1);
418 if (count($files) < 1) {
420 $nofile[
'id'] = (int) $objd->id;
421 $nofile[
'entity'] = (int) $objd->entity;
422 $nofile[
'date'] = $db->jdate($objd->date);
423 $nofile[
'date_due'] = $db->jdate($objd->date_due);
424 $nofile[
'paid'] = (int) $objd->paid;
425 $nofile[
'amount_ht'] = $objd->total_ht;
426 $nofile[
'amount_ttc'] = $objd->total_ttc;
427 $nofile[
'amount_vat'] = $objd->total_vat;
428 $nofile[
'amount_localtax1'] = $objd->localtax1;
429 $nofile[
'amount_localtax2'] = $objd->localtax2;
430 $nofile[
'amount_revenuestamp'] = $objd->revenuestamp;
431 $nofile[
'ref'] = ($objd->ref ? $objd->ref : $objd->id);
432 $nofile[
'fk'] = $objd->fk_soc;
433 $nofile[
'item'] = $objd->item;
434 $nofile[
'thirdparty_name'] = $objd->thirdparty_name;
435 $nofile[
'thirdparty_code'] = $objd->thirdparty_code;
436 $nofile[
'country_code'] = $objd->country_code;
437 $nofile[
'vatnum'] = $objd->vatnum;
438 $nofile[
'sens'] = $objd->sens;
439 $nofile[
'currency'] = $objd->currency;
440 $nofile[
'link'] =
'';
441 $nofile[
'name'] =
'';
444 $filesarray[$nofile[
'item'].
'_'.$nofile[
'id']] = $nofile;
446 foreach ($files as $key => $file) {
447 $file[
'id'] = (int) $objd->id;
448 $file[
'entity'] = (int) $objd->entity;
449 $file[
'date'] = $db->jdate($objd->date);
450 $file[
'date_due'] = $db->jdate($objd->date_due);
451 $file[
'paid'] = (int) $objd->paid;
452 $file[
'amount_ht'] = $objd->total_ht;
453 $file[
'amount_ttc'] = $objd->total_ttc;
454 $file[
'amount_vat'] = $objd->total_vat;
455 $file[
'amount_localtax1'] = $objd->localtax1;
456 $file[
'amount_localtax2'] = $objd->localtax2;
457 $file[
'amount_revenuestamp'] = $objd->revenuestamp;
458 $file[
'ref'] = ($objd->ref ? $objd->ref : $objd->id);
459 $file[
'fk'] = $objd->fk_soc;
460 $file[
'item'] = $objd->item;
461 $file[
'thirdparty_name'] = $objd->thirdparty_name;
462 $file[
'thirdparty_code'] = $objd->thirdparty_code;
463 $file[
'country_code'] = $objd->country_code;
464 $file[
'vatnum'] = $objd->vatnum;
465 $file[
'sens'] = $objd->sens;
466 $file[
'currency'] = $objd->currency;
469 if (empty($filesarray[$file[
'item'].
'_'.$file[
'id']])) {
470 $filesarray[$file[
'item'].
'_'.$file[
'id']] = $file;
474 if (empty($filesarray[$file[
'item'].
'_'.$file[
'id']][
'files'])) {
475 $filesarray[$file[
'item'].
'_'.$file[
'id']][
'files'] = array();
477 $filesarray[$file[
'item'].
'_'.$file[
'id']][
'files'][] = array(
478 'link' => $link.urlencode($file[
'name']),
479 'name' => $file[
'name'],
480 'ref' => $file[
'ref'],
481 'fullname' => $file[
'fullname'],
482 'relpath' =>
'/'.$file[
'name'],
483 'relpathnamelang' => $langs->trans($file[
'item']).
'/'.$file[
'name'],
484 'modulepart' => $modulepart,
486 'currency' => $file[
'currency']
510$dirfortmpfile = (!empty($conf->accounting->dir_temp) ? $conf->accounting->dir_temp : $conf->comptabilite->dir_temp);
511if (empty($dirfortmpfile)) {
512 setEventMessages($langs->trans(
"ErrorNoAccountingModuleEnabled"),
null,
'errors');
516if ($result && $action ==
"dl" && !$error) {
517 if (!extension_loaded(
'zip')) {
522 $log = $langs->transnoentitiesnoconv(
"Type");
524 $log .=
','.$langs->transnoentitiesnoconv(
"Entity");
526 $log .=
','.$langs->transnoentitiesnoconv(
"Date");
527 $log .=
','.$langs->transnoentitiesnoconv(
"DateDue");
528 $log .=
','.$langs->transnoentitiesnoconv(
"Ref");
529 $log .=
','.$langs->transnoentitiesnoconv(
"TotalHT");
530 $log .=
','.$langs->transnoentitiesnoconv(
"TotalTTC");
531 $log .=
','.$langs->transnoentitiesnoconv(
"TotalVAT");
532 $log .=
','.$langs->transcountrynoentities(
"TotalLT1",
$mysoc->country_code);
533 $log .=
','.$langs->transcountrynoentities(
"TotalLT2",
$mysoc->country_code);
534 $log .=
','.$langs->transnoentitiesnoconv(
"RevenueStamp");
535 $log .=
','.$langs->transnoentitiesnoconv(
"Paid");
536 $log .=
','.$langs->transnoentitiesnoconv(
"Document");
537 $log .=
','.$langs->transnoentitiesnoconv(
"ItemID");
538 $log .=
','.$langs->transnoentitiesnoconv(
"ThirdParty");
539 $log .=
','.$langs->transnoentitiesnoconv(
"Code");
540 $log .=
','.$langs->transnoentitiesnoconv(
"Country");
541 $log .=
','.$langs->transnoentitiesnoconv(
"VATIntra");
542 $log .=
','.$langs->transnoentitiesnoconv(
"Sens").
"\n";
544 if (!empty($projectid)) {
546 $project->fetch($projectid);
548 $zipname .=
'_'.$project->ref;
551 $zipname .=
'_export.zip';
555 $zip =
new ZipArchive();
556 $res = $zip->open($zipname, ZipArchive::OVERWRITE | ZipArchive::CREATE);
558 foreach ($filesarray as $key => $file) {
559 if (!empty($file[
'files'])) {
560 foreach ($file[
'files'] as $filecursor) {
561 if (file_exists($filecursor[
"fullname"])) {
562 $zip->addFile($filecursor[
"fullname"], $filecursor[
"relpathnamelang"]);
567 $log .=
'"'.$langs->transnoentitiesnoconv($file[
'item']).
'"';
569 $log .=
',"'.(empty($arrayofentities[$file[
'entity']]) ? $file[
'entity'] : $arrayofentities[$file[
'entity']]).
'"';
571 $log .=
','.dol_print_date($file[
'date'],
'dayrfc');
572 $log .=
','.dol_print_date($file[
'date_due'],
'dayrfc');
573 $log .=
',"'.$file[
'ref'].
'"';
574 $log .=
','.$file[
'amount_ht'];
575 $log .=
','.$file[
'amount_ttc'];
576 $log .=
','.$file[
'amount_vat'];
577 $log .=
','.$file[
'amount_localtax1'];
578 $log .=
','.$file[
'amount_localtax2'];
579 $log .=
','.$file[
'amount_revenuestamp'];
580 $log .=
','.$file[
'paid'];
581 $log .=
',"'.$file[
"name"].
'"';
582 $log .=
','.$file[
'fk'];
583 $log .=
',"'.$file[
'thirdparty_name'].
'"';
584 $log .=
',"'.$file[
'thirdparty_code'].
'"';
585 $log .=
',"'.$file[
'country_code'].
'"';
586 $log .=
',"'.$file[
'vatnum'].
'"';
587 $log .=
',"'.$file[
'sens'].
'"';
590 $zip->addFromString(
'transactions.csv', $log);
594 header(
'Content-Type: application/zip');
595 header(
'Content-disposition: attachment; filename='.basename($zipname));
596 header(
'Content-Length: '.filesize($zipname));
603 setEventMessages($langs->trans(
"FailedToOpenFile", $zipname),
null,
'errors');
613$form =
new Form($db);
615$userstatic =
new User($db);
625$title = $langs->trans(
"AccountantFiles").
' - '.$langs->trans(
"List");
632$head[$h][0] = $_SERVER[
"PHP_SELF"];
633$head[$h][1] = $langs->trans(
"AccountantFiles");
634$head[$h][2] =
'AccountancyFiles';
639print
'<form name="searchfiles" action="?action=searchfiles" method="POST">'.
"\n";
640print
'<input type="hidden" name="token" value="'.newToken().
'">';
642print
'<span class="opacitymedium">'.$langs->trans(
"ExportAccountingSourceDocHelp");
644 print
' '.$langs->trans(
"ExportAccountingSourceDocHelp2", $langs->transnoentitiesnoconv(
"Accounting"), $langs->transnoentitiesnoconv(
"Journals"));
649print $langs->trans(
"ReportPeriod").
': ';
650print $form->selectDate($date_start,
'date_start', 0, 0, 0,
"", 1, 1, 0,
'',
'',
'',
'', 1,
'',
'',
'tzuserrel');
652print $form->selectDate($date_stop,
'date_stop', 0, 0, 0,
"", 1, 1, 0,
'',
'',
'',
'', 1,
'',
'',
'tzuserrel');
658 $mc->getInfo($conf->entity);
659 print
' <span class="marginleftonly marginrightonly'.(!
getDolGlobalString(
'MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES') ?
' opacitymedium' :
'').
'">'.$langs->trans(
"Entity").
' : ';
660 if (
getDolGlobalString(
'MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES')) {
662 print $mc->select_entities(GETPOSTISSET(
'search_entity') ?
GETPOSTINT(
'search_entity') : $mc->id,
'search_entity',
'', false, false, false, false, true);
674 $langs->load(
'projects');
675 print
'<div class="paddingtop">';
676 print
'<span class="marginrightonly">'.$langs->trans(
'Project').
":</span>";
677 print
img_picto(
'',
'project',
'class="pictofixedwidth"').$formproject->select_projects(($socid > 0 ? $socid : -1), (string) $projectid,
'projectid', 0, 0, 1, 0, 0, 0, 0,
'', 1, 0,
'');
678 print
'<span class="classfortooltip" style="padding: 0px; padding: 0px; padding-right: 3px !important;" title="'.$langs->trans(
'ExportAccountingProjectHelp').
'"><span class="fas fa-info-circle em088 opacityhigh" style=" vertical-align: middle; cursor: help"></span></span>';
684foreach ($listofchoices as $choice => $val) {
685 if (empty($val[
'enabled'])) {
689 if (empty($val[
'perms'])) {
690 $disabled =
' disabled';
692 $checked = (((!GETPOSTISSET(
'search') && $action !=
'searchfiles') ||
GETPOST($choice)) ?
' checked="checked"' :
'');
693 print
'<div class="inline-block marginrightonlylarge paddingright margintoponly"><input type="checkbox" id="'.$choice.
'" name="'.$choice.
'" value="1"'.$checked.$disabled.
'><label for="'.$choice.
'"> ';
694 print
img_picto($langs->trans($val[
'label']), $val[
'picto'],
'class=""').
' '.$langs->trans($val[
'label']);
695 print
'</label></div>';
699print
'<input type="submit" class="button small nomarginleft margintoponly" name="search" value="'.$langs->trans(
"Search").
'">';
706if (!empty($date_start) && !empty($date_stop)) {
707 $param .=
'&date_startday='.GETPOSTINT(
'date_startday');
708 $param .=
'&date_startmonth='.GETPOSTINT(
'date_startmonth');
709 $param .=
'&date_startyear='.GETPOSTINT(
'date_startyear');
710 $param .=
'&date_stopday='.GETPOSTINT(
'date_stopday');
711 $param .=
'&date_stopmonth='.GETPOSTINT(
'date_stopmonth');
712 $param .=
'&date_stopyear='.GETPOSTINT(
'date_stopyear');
713 foreach ($listofchoices as $choice => $val) {
715 $param .=
'&'.$choice.
'=1';
720 '@phan-var-force array<string,array{id:string,entity:string,date:string,date_due:string,paid:float|int,amount_ht:float|int,amount_ttc:float|int,amount_vat:float|int,amount_localtax1:float|int,amount_localtax2:float|int,amount_revenuestamp:float|int,ref:string,fk:string,item:string,thirdparty_name:string,thirdparty_code:string,country_code:string,vatnum:string,sens:string,currency:string,line?:string,name?:string,files?:mixed}> $TData';
727 print
'<a class="marginleftonly small'.(empty($TData) ?
' butActionRefused' :
' butAction').
'" href="'.$_SERVER[
"PHP_SELF"].
'?action=dl&token='.
currentToken().
'&projectid='.((int) $projectid).
'&output=file&file='.urlencode($filename).$param.
'"';
732 print $langs->trans(
"Download");
735 $param .=
'&action=searchfiles';
759 print
'<div class="div-table-responsive">';
760 print
'<table class="noborder centpercent">';
761 print
'<tr class="liste_titre">';
762 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
"PHP_SELF"],
"item",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
763 print_liste_field_titre($arrayfields[
'date'][
'label'], $_SERVER[
"PHP_SELF"],
"date",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
764 print_liste_field_titre($arrayfields[
'date_due'][
'label'], $_SERVER[
"PHP_SELF"],
"date_due",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
765 print_liste_field_titre($arrayfields[
'ref'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'nowraponall ');
766 print
'<th>'.$langs->trans(
"Document").
'</th>';
767 print
'<th>'.$langs->trans(
"Paid").
'</th>';
768 print
'<th class="right">'.$langs->trans(
"TotalHT").(isModEnabled(
'multicurrency') ?
' ('.$langs->getCurrencySymbol($conf->currency).
')' :
'').
'</th>';
769 print
'<th class="right">'.$langs->trans(
"TotalTTC").(isModEnabled(
'multicurrency') ?
' ('.$langs->getCurrencySymbol($conf->currency).
')' :
'').
'</th>';
770 print
'<th class="right">'.$langs->trans(
"TotalVAT").(isModEnabled(
'multicurrency') ?
' ('.$langs->getCurrencySymbol($conf->currency).
')' :
'').
'</th>';
772 print
'<th>'.$langs->trans(
"ThirdParty").
'</th>';
773 print
'<th class="center">'.$langs->trans(
"Code").
'</th>';
774 print
'<th class="center">'.$langs->trans(
"Country").
'</th>';
775 print
'<th class="center">'.$langs->trans(
"VATIntra").
'</th>';
777 print
'<th class="center">'.$langs->trans(
"Currency").
'</th>';
782 print
'<tr class="oddeven"><td colspan="13"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td>';
795 $totalVAT_credit = 0;
798 foreach ($TData as $data) {
802 print
'<tr class="oddeven '.$html_class.
'">';
805 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans($data[
'item'])).
'">'.$langs->trans($data[
'item']).
'</td>';
808 print
'<td class="center">';
813 print
'<td class="center">';
818 print
'<td class="nowraponall tdoverflowmax150">';
820 if ($data[
'item'] ==
'Invoice') {
821 $invoice->id = (int) $data[
'id'];
822 $invoice->ref = $data[
'ref'];
823 $invoice->total_ht = $data[
'amount_ht'];
824 $invoice->total_ttc = $data[
'amount_ttc'];
825 $invoice->total_tva = $data[
'amount_vat'];
826 $invoice->total_localtax1 = $data[
'amount_localtax1'];
827 $invoice->total_localtax2 = $data[
'amount_localtax2'];
828 $invoice->revenuestamp = $data[
'amount_revenuestamp'];
829 $invoice->multicurrency_code = $data[
'currency'];
830 print $invoice->getNomUrl(1,
'', 0, 0,
'', 0, 0, 0);
831 } elseif ($data[
'item'] ==
'SupplierInvoice') {
832 $supplier_invoice->id = (int) $data[
'id'];
833 $supplier_invoice->ref = $data[
'ref'];
834 $supplier_invoice->total_ht = $data[
'amount_ht'];
835 $supplier_invoice->total_ttc = $data[
'amount_ttc'];
836 $supplier_invoice->total_tva = $data[
'amount_vat'];
837 $supplier_invoice->total_localtax1 = $data[
'amount_localtax1'];
838 $supplier_invoice->total_localtax2 = $data[
'amount_localtax2'];
839 $supplier_invoice->revenuestamp = $data[
'amount_revenuestamp'];
840 $supplier_invoice->multicurrency_code = $data[
'currency'];
841 print $supplier_invoice->getNomUrl(1,
'', 0, 0,
'', 0, 0, 0);
842 } elseif ($data[
'item'] ==
'ExpenseReport') {
843 $expensereport->id = (int) $data[
'id'];
844 $expensereport->ref = $data[
'ref'];
845 print $expensereport->getNomUrl(1,
'0', 0, 0,
'0', 0);
846 } elseif ($data[
'item'] ==
'SalaryPayment') {
847 $salary_payment->id = (int) $data[
'id'];
848 $salary_payment->ref = $data[
'ref'];
849 print $salary_payment->getNomUrl(1);
850 } elseif ($data[
'item'] ==
'Donation') {
851 $don->id = (int) $data[
'id'];
852 $don->ref = $data[
'ref'];
853 print $don->getNomUrl(1, 0,
'', 0);
854 } elseif ($data[
'item'] ==
'SocialContributions') {
855 $charge_sociales->id = (int) $data[
'id'];
856 $charge_sociales->ref = $data[
'ref'];
857 print $charge_sociales->getNomUrl(1,
'0', 0, 0, 0);
858 } elseif ($data[
'item'] ==
'VariousPayment') {
859 $various_payment->id = (int) $data[
'id'];
860 $various_payment->ref = $data[
'ref'];
861 print $various_payment->getNomUrl(1,
'', 0, 0);
862 } elseif ($data[
'item'] ==
'LoanPayment') {
863 $payment_loan->id = (int) $data[
'id'];
864 $payment_loan->ref = $data[
'ref'];
865 print $payment_loan->getNomUrl(1, 0, 0,
'', 0);
872 print
'<td class="tdoverflowmax150">';
873 if (!empty($data[
'files'])) {
874 foreach ($data[
'files'] as
$id => $filecursor) {
875 $tmppreview = $formfile->showPreview($filecursor, $filecursor[
'modulepart'], $filecursor[
'subdir'].
'/'.$filecursor[
'name'], 0);
879 $filename = ($filecursor[
'name'] ? $filecursor[
'name'] : $filecursor[
'ref']);
880 print
'<a href='.DOL_URL_ROOT.
'/'.$filecursor[
'link'].
' target="_blank" rel="noopener noreferrer" title="'.
dol_escape_htmltag($filename).
'">';
881 if (empty($tmppreview)) {
882 print
img_picto(
'',
'generic',
'', 0, 0, 0,
'',
'pictonopreview pictofixedwidth paddingright');
891 print
'<td class="center">'.($data[
'paid'] ?
yn($data[
'paid']) :
'').
'</td>';
894 print
'<td class="right"><span class="amount">'.price(
price2num($data[
'sens'] ? $data[
'amount_ht'] : -$data[
'amount_ht'],
'MT')).
"</span></td>\n";
896 print
'<td class="right"><span class="amount">';
897 $tooltip = $langs->trans(
"TotalVAT").
' : '.
price(
price2num($data[
'sens'] ? $data[
'amount_vat'] : -$data[
'amount_vat'],
'MT'));
898 if (!empty($data[
'amount_localtax1'])) {
899 $tooltip .=
'<br>'.$langs->transcountrynoentities(
"TotalLT1",
$mysoc->country_code).
' : '.
price(
price2num($data[
'sens'] ? $data[
'amount_localtax1'] : -$data[
'amount_localtax1'],
'MT'));
901 if (!empty($data[
'amount_localtax2'])) {
902 $tooltip .=
'<br>'.$langs->transcountrynoentities(
"TotalLT2",
$mysoc->country_code).
' : '.
price(
price2num($data[
'sens'] ? $data[
'amount_localtax2'] : -$data[
'amount_localtax2'],
'MT'));
904 if (!empty($data[
'amount_revenuestamp'])) {
905 $tooltip .=
'<br>'.$langs->trans(
"RevenueStamp").
' : '.
price(
price2num($data[
'sens'] ? $data[
'amount_revenuestamp'] : -$data[
'amount_revenuestamp'],
'MT'));
907 print
'<span class="classfortooltip" title="'.dol_escape_htmltag($tooltip).
'">'.
price(
price2num($data[
'sens'] ? $data[
'amount_ttc'] : -$data[
'amount_ttc'],
'MT')).
'</span>';
908 print
"</span></td>\n";
910 print
'<td class="right"><span class="amount">'.price(
price2num($data[
'sens'] ? $data[
'amount_vat'] : -$data[
'amount_vat'],
'MT')).
"</span></td>\n";
912 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($data[
'thirdparty_name']).
'">'.
dol_escape_htmltag($data[
'thirdparty_name']).
"</td>\n";
914 print
'<td class="center">'.$data[
'thirdparty_code'].
"</td>\n";
916 print
'<td class="center">'.$data[
'country_code'].
"</td>\n";
919 print
'<td class="tdoverflowmax150 right" title="'.dol_escape_htmltag($data[
'vatnum']).
'">'.
dol_escape_htmltag($data[
'vatnum']).
"</td>\n";
922 $totalET_credit += $data[
'amount_ht'];
923 $totalIT_credit += $data[
'amount_ttc'];
924 $totalVAT_credit += $data[
'amount_vat'];
926 $totalET_debit -= $data[
'amount_ht'];
927 $totalIT_debit -= $data[
'amount_ttc'];
928 $totalVAT_debit -= $data[
'amount_vat'];
932 print
'<td class="center">'.$data[
'currency'].
"</td>\n";
939 print
'<tr class="liste_total">';
940 print
'<td colspan="6" class="right">'.$langs->trans(
'Total').
' '.$langs->trans(
'Income').
'</td>';
941 print
'<td class="right">'.price(
price2num($totalET_credit,
'MT')).
'</td>';
942 print
'<td class="right">'.price(
price2num($totalIT_credit,
'MT')).
'</td>';
943 print
'<td class="right">'.price(
price2num($totalVAT_credit,
'MT')).
'</td>';
944 print
'<td colspan="4"></td>';
950 print
'<tr class="liste_total">';
951 print
'<td colspan="6" class="right">'.$langs->trans(
'Total').
' '.$langs->trans(
'Outcome').
'</td>';
952 print
'<td class="right">'.price(
price2num($totalET_debit,
'MT')).
'</td>';
953 print
'<td class="right">'.price(
price2num($totalIT_debit,
'MT')).
'</td>';
954 print
'<td class="right">'.price(
price2num($totalVAT_debit,
'MT')).
'</td>';
955 print
'<td colspan="4"></td>';
961 print
'<tr class="liste_total">';
962 print
'<td colspan="6" class="right">'.$langs->trans(
'Total').
'</td>';
963 print
'<td class="right">'.price(
price2num($totalET_credit + $totalET_debit,
'MT')).
'</td>';
964 print
'<td class="right">'.price(
price2num($totalIT_credit + $totalIT_debit,
'MT')).
'</td>';
965 print
'<td class="right">'.price(
price2num($totalVAT_credit + $totalVAT_debit,
'MT')).
'</td>';
966 print
'<td colspan="4"></td>';
$id
Support class for third parties, contacts, members, users or resources.
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 for managing the social charges.
Class to manage donations.
Class to manage Trips and Expenses.
const STATUS_DRAFT
Draft status.
Class to manage suppliers invoices.
Class to manage invoices.
Class to manage payments of loans.
Class to manage payments of salaries.
Class to manage various payments.
Class to manage projects.
Class to manage Dolibarr users.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
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.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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 '.
currentToken()
Return the value of token currently saved into session with name 'token'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
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...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.