29if ((array_key_exists(
'action', $_GET) && $_GET[
'action'] ==
'dl') || (array_key_exists(
'action', $_POST) && $_POST[
'action'] ==
'dl')) {
30 if (!defined(
'NOTOKENRENEWAL')) {
31 define(
'NOTOKENRENEWAL',
'1');
36require
'../main.inc.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/loan/class/paymentloan.class.php';
52if (isModEnabled(
'project')) {
53 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
54 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
61$langs->loadLangs(array(
"accountancy",
"bills",
"companies",
"salaries",
"compta",
"trips",
"banks",
"loan"));
63$date_start =
GETPOST(
'date_start',
'alpha');
64$date_startDay =
GETPOST(
'date_startday',
'int');
65$date_startMonth =
GETPOST(
'date_startmonth',
'int');
66$date_startYear =
GETPOST(
'date_startyear',
'int');
67$date_start =
dol_mktime(0, 0, 0, $date_startMonth, $date_startDay, $date_startYear,
'tzuserrel');
68$date_stop =
GETPOST(
'date_stop',
'alpha');
69$date_stopDay =
GETPOST(
'date_stopday',
'int');
70$date_stopMonth =
GETPOST(
'date_stopmonth',
'int');
71$date_stopYear =
GETPOST(
'date_stopyear',
'int');
72$date_stop =
dol_mktime(23, 59, 59, $date_stopMonth, $date_stopDay, $date_stopYear,
'tzuserrel');
73$action =
GETPOST(
'action',
'aZ09');
74$projectid = (
GETPOST(
'projectid',
'int') ?
GETPOST(
'projectid',
'int') : 0);
77$hookmanager->initHooks(array(
'comptafileslist',
'globallist'));
80$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
81$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
82$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
83$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
84if (empty($page) || $page == -1) {
87$offset = $limit * $page;
91 $sortfield =
"date,item";
99 'type'=>array(
'label'=>
"Type",
'checked'=>1),
100 'date'=>array(
'label'=>
"Date",
'checked'=>1),
101 'date_due'=>array(
'label'=>
"DateDue",
'checked'=>1),
102 'ref'=>array(
'label'=>
"Ref",
'checked'=>1),
103 'documents'=>array(
'label'=>
"Documents",
'checked'=>1),
104 'paid'=>array(
'label'=>
"Paid",
'checked'=>1),
105 'total_ht'=>array(
'label'=>
"TotalHT",
'checked'=>1),
106 'total_ttc'=>array(
'label'=>
"TotalTTC",
'checked'=>1),
107 'total_vat'=>array(
'label'=>
"TotalVAT",
'checked'=>1),
112if (!isModEnabled(
'comptabilite') && !isModEnabled(
'accounting')) {
115if ($user->socid > 0) {
120$arrayofentities = array();
121if (isModEnabled(
'multicompany') && is_object($mc)) {
122 $arrayofentities = $mc->getEntitiesList();
125$entity = (GETPOSTISSET(
'entity') ?
GETPOST(
'entity',
'int') : (GETPOSTISSET(
'search_entity') ?
GETPOST(
'search_entity',
'int') : $conf->entity));
126if (isModEnabled(
'multicompany') && is_object($mc)) {
127 if (empty($entity) &&
getDolGlobalString(
'MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES')) {
128 $entity =
'0,'.join(
',', array_keys($arrayofentities));
132 $entity = $conf->entity;
137$listofchoices = array(
138 'selectinvoices'=>array(
'label'=>
'Invoices',
'picto'=>
'bill',
'lang'=>
'bills',
'enabled' => isModEnabled(
'facture'),
'perms' => $user->hasRight(
'facture',
'lire')),
139 'selectsupplierinvoices'=>array(
'label'=>
'BillsSuppliers',
'picto'=>
'supplier_invoice',
'lang'=>
'bills',
'enabled' => isModEnabled(
'supplier_invoice'),
'perms' => !empty($user->rights->fournisseur->facture->lire)),
140 'selectexpensereports'=>array(
'label'=>
'ExpenseReports',
'picto'=>
'expensereport',
'lang'=>
'trips',
'enabled' => isModEnabled(
'expensereport'),
'perms' => !empty($user->rights->expensereport->lire)),
141 'selectdonations'=>array(
'label'=>
'Donations',
'picto'=>
'donation',
'lang'=>
'donation',
'enabled' => isModEnabled(
'don'),
'perms' => !empty($user->rights->don->lire)),
142 'selectsocialcontributions'=>array(
'label'=>
'SocialContributions',
'picto'=>
'bill',
'enabled' => isModEnabled(
'tax'),
'perms' => !empty($user->rights->tax->charges->lire)),
143 'selectpaymentsofsalaries'=>array(
'label'=>
'SalariesPayments',
'picto'=>
'salary',
'lang'=>
'salaries',
'enabled' => isModEnabled(
'salaries'),
'perms' => !empty($user->rights->salaries->read)),
144 'selectvariouspayment'=>array(
'label'=>
'VariousPayment',
'picto'=>
'payment',
'enabled' => isModEnabled(
'banque'),
'perms' => !empty($user->rights->banque->lire)),
145 'selectloanspayment'=>array(
'label'=>
'PaymentLoan',
'picto'=>
'loan',
'enabled' => isModEnabled(
'don'),
'perms' => !empty($user->rights->loan->read)),
159$filesarray = array();
161if (($action ==
'searchfiles' || $action ==
'dl')) {
162 if (empty($date_start)) {
163 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"DateStart")),
null,
'errors');
166 if (empty($date_stop)) {
167 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"DateEnd")),
null,
'errors');
174 $wheretail =
" '".$db->idate($date_start).
"' AND '".$db->idate($date_stop).
"'";
177 if (
GETPOST(
'selectinvoices') && !empty($listofchoices[
'selectinvoices'][
'perms'])) {
179 $sql .=
" UNION ALL";
181 $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,";
182 $sql .=
" t.localtax1, t.localtax2, t.revenuestamp,";
183 $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";
184 $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";
185 $sql .=
" WHERE datef between ".$wheretail;
186 $sql .=
" AND t.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
187 $sql .=
" AND t.fk_statut <> ".Facture::STATUS_DRAFT;
188 if (!empty($projectid)) {
189 $sql .=
" AND fk_projet = ".((int) $projectid);
193 if (
GETPOST(
'selectsupplierinvoices') && !empty($listofchoices[
'selectsupplierinvoices'][
'perms'])) {
195 $sql .=
" UNION ALL";
197 $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,";
198 $sql .=
" t.localtax1, t.localtax2, 0 as revenuestamp,";
199 $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";
200 $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";
201 $sql .=
" WHERE datef between ".$wheretail;
202 $sql .=
" AND t.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
203 $sql .=
" AND t.fk_statut <> ".FactureFournisseur::STATUS_DRAFT;
204 if (!empty($projectid)) {
205 $sql .=
" AND fk_projet = ".((int) $projectid);
209 if (
GETPOST(
'selectexpensereports') && !empty($listofchoices[
'selectexpensereports'][
'perms'])) {
211 $sql .=
" UNION ALL";
215 if (!empty($projectid)) {
216 $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,";
217 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
218 $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";
219 $sql .=
" FROM " . MAIN_DB_PREFIX .
"expensereport as t";
220 $sql .=
" LEFT JOIN " . MAIN_DB_PREFIX .
"expensereport_det as td ON t.rowid = td.fk_expensereport";
221 $sql .=
" LEFT JOIN " . MAIN_DB_PREFIX .
"user as u ON u.rowid = t.fk_user_author";
222 $sql .=
" LEFT JOIN " . MAIN_DB_PREFIX .
"c_country as c ON c.rowid = u.fk_country";
223 $sql .=
" WHERE date_fin between " . $wheretail;
224 $sql .=
" AND t.entity IN (" . $db->sanitize($entity == 1 ?
'0,1' : $entity) .
')';
226 $sql .=
" AND fk_projet = ".((int) $projectid);
228 $sql .=
" SELECT t.rowid as id, t.entity, t.ref, t.paid, t.total_ht, t.total_ttc, t.total_tva as total_vat,";
229 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
230 $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";
231 $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";
232 $sql .=
" WHERE date_fin between " . $wheretail;
233 $sql .=
" AND t.entity IN (" . $db->sanitize($entity == 1 ?
'0,1' : $entity) .
')';
238 if (
GETPOST(
'selectdonations') && !empty($listofchoices[
'selectdonations'][
'perms'])) {
240 $sql .=
" UNION ALL";
242 $sql .=
" SELECT t.rowid as id, t.entity, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat,";
243 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
244 $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";
245 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as t LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON c.rowid = t.fk_country";
246 $sql .=
" WHERE datedon between ".$wheretail;
247 $sql .=
" AND t.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
248 $sql .=
" AND t.fk_statut <> ".Don::STATUS_DRAFT;
249 if (!empty($projectid)) {
250 $sql .=
" AND fk_projet = ".((int) $projectid);
254 if (
GETPOST(
'selectpaymentsofsalaries') && !empty($listofchoices[
'selectpaymentsofsalaries'][
'perms'])) {
256 $sql .=
" UNION ALL";
258 $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,";
259 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
260 $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";
261 $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";
262 $sql .=
" WHERE datep between ".$wheretail;
263 $sql .=
" AND t.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
265 if (!empty($projectid)) {
266 $sql .=
" AND fk_projet = ".((int) $projectid);
270 if (
GETPOST(
'selectsocialcontributions') && !empty($listofchoices[
'selectsocialcontributions'][
'perms'])) {
272 $sql .=
" UNION ALL";
274 $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,";
275 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
276 $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";
277 $sql .=
" FROM ".MAIN_DB_PREFIX.
"chargesociales as t";
278 $sql .=
" WHERE t.date_ech between ".$wheretail;
279 $sql .=
" AND t.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
281 if (!empty($projectid)) {
282 $sql .=
" AND fk_projet = ".((int) $projectid);
286 if (
GETPOST(
'selectvariouspayment') && !empty($listofchoices[
'selectvariouspayment'][
'perms'])) {
288 $sql .=
" UNION ALL";
290 $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,";
291 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
292 $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";
293 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_various as t";
294 $sql .=
" WHERE datep between ".$wheretail;
295 $sql .=
" AND t.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
296 if (!empty($projectid)) {
297 $sql .=
" AND fk_projet = ".((int) $projectid);
301 if (
GETPOST(
'selectloanspayment') && !empty($listofchoices[
'selectloanspayment'][
'perms']) && empty($projectid)) {
303 $sql .=
" UNION ALL";
305 $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,";
306 $sql .=
" 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
307 $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";
308 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_loan as t LEFT JOIN ".MAIN_DB_PREFIX.
"loan as l ON l.rowid = t.fk_loan";
309 $sql .=
" WHERE datep between ".$wheretail;
310 $sql .=
" AND l.entity IN (".$db->sanitize($entity == 1 ?
'0,1' : $entity).
')';
314 $sql .= $db->order($sortfield, $sortorder);
317 $resd = $db->query($sql);
322 $numd = $db->num_rows($resd);
324 $tmpinvoice =
new Facture($db);
326 $tmpdonation =
new Don($db);
331 $objd = $db->fetch_object($resd);
333 switch ($objd->item) {
337 $upload_dir = $conf->facture->dir_output.
'/'.$subdir;
338 $link =
"document.php?modulepart=facture&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
339 $modulepart =
"facture";
341 case "SupplierInvoice":
342 $tmpinvoicesupplier->fetch($objd->id);
343 $subdir =
get_exdir($tmpinvoicesupplier->id, 2, 0, 1, $tmpinvoicesupplier,
'invoice_supplier');
345 $upload_dir = $conf->fournisseur->facture->dir_output.
'/'.$subdir;
346 $link =
"document.php?modulepart=facture_fournisseur&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
347 $modulepart =
"facture_fournisseur";
349 case "ExpenseReport":
352 $upload_dir = $conf->expensereport->dir_output.
'/'.$subdir;
353 $link =
"document.php?modulepart=expensereport&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
354 $modulepart =
"expensereport";
356 case "SalaryPayment":
359 $upload_dir = $conf->salaries->dir_output.
'/'.$subdir;
360 $link =
"document.php?modulepart=salaries&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
361 $modulepart =
"salaries";
364 $tmpdonation->fetch($objp->id);
365 $subdir =
get_exdir(0, 0, 0, 0, $tmpdonation,
'donation');
367 $upload_dir = $conf->don->dir_output.
'/'.$subdir;
368 $link =
"document.php?modulepart=don&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
371 case "SocialContributions":
374 $upload_dir = $conf->tax->dir_output.
'/'.$subdir;
375 $link =
"document.php?modulepart=tax&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
378 case "VariousPayment":
381 $upload_dir = $conf->bank->dir_output.
'/'.$subdir;
382 $link =
"document.php?modulepart=banque&file=".str_replace(
'/',
'%2F', $subdir).
'%2F';
383 $modulepart =
"banque";
388 $upload_dir = $conf->loan->dir_output.
'/'.$subdir;
399 if (!empty($upload_dir)) {
402 $files =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$',
'', SORT_ASC, 1);
405 if (count($files) < 1) {
407 $nofile[
'id'] = $objd->id;
408 $nofile[
'entity'] = $objd->entity;
409 $nofile[
'date'] = $db->jdate($objd->date);
410 $nofile[
'date_due'] = $db->jdate($objd->date_due);
411 $nofile[
'paid'] = $objd->paid;
412 $nofile[
'amount_ht'] = $objd->total_ht;
413 $nofile[
'amount_ttc'] = $objd->total_ttc;
414 $nofile[
'amount_vat'] = $objd->total_vat;
415 $nofile[
'amount_localtax1'] = $objd->localtax1;
416 $nofile[
'amount_localtax2'] = $objd->localtax2;
417 $nofile[
'amount_revenuestamp'] = $objd->revenuestamp;
418 $nofile[
'ref'] = ($objd->ref ? $objd->ref : $objd->id);
419 $nofile[
'fk'] = $objd->fk_soc;
420 $nofile[
'item'] = $objd->item;
421 $nofile[
'thirdparty_name'] = $objd->thirdparty_name;
422 $nofile[
'thirdparty_code'] = $objd->thirdparty_code;
423 $nofile[
'country_code'] = $objd->country_code;
424 $nofile[
'vatnum'] = $objd->vatnum;
425 $nofile[
'sens'] = $objd->sens;
426 $nofile[
'currency'] = $objd->currency;
427 $nofile[
'link'] =
'';
428 $nofile[
'name'] =
'';
430 $filesarray[$nofile[
'item'].
'_'.$nofile[
'id']] = $nofile;
432 foreach ($files as $key => $file) {
433 $file[
'id'] = $objd->id;
434 $file[
'entity'] = $objd->entity;
435 $file[
'date'] = $db->jdate($objd->date);
436 $file[
'date_due'] = $db->jdate($objd->date_due);
437 $file[
'paid'] = $objd->paid;
438 $file[
'amount_ht'] = $objd->total_ht;
439 $file[
'amount_ttc'] = $objd->total_ttc;
440 $file[
'amount_vat'] = $objd->total_vat;
441 $file[
'amount_localtax1'] = $objd->localtax1;
442 $file[
'amount_localtax2'] = $objd->localtax2;
443 $file[
'amount_revenuestamp'] = $objd->revenuestamp;
444 $file[
'ref'] = ($objd->ref ? $objd->ref : $objd->id);
445 $file[
'fk'] = $objd->fk_soc;
446 $file[
'item'] = $objd->item;
447 $file[
'thirdparty_name'] = $objd->thirdparty_name;
448 $file[
'thirdparty_code'] = $objd->thirdparty_code;
449 $file[
'country_code'] = $objd->country_code;
450 $file[
'vatnum'] = $objd->vatnum;
451 $file[
'sens'] = $objd->sens;
452 $file[
'currency'] = $objd->currency;
455 if (empty($filesarray[$file[
'item'].
'_'.$file[
'id']])) {
456 $filesarray[$file[
'item'].
'_'.$file[
'id']] = $file;
460 if (empty($filesarray[$file[
'item'].
'_'.$file[
'id']][
'files'])) {
461 $filesarray[$file[
'item'].
'_'.$file[
'id']][
'files'] = array();
463 $filesarray[$file[
'item'].
'_'.$file[
'id']][
'files'][] = array(
464 'link' => $link.urlencode($file[
'name']),
465 'name'=>$file[
'name'],
467 'fullname' => $file[
'fullname'],
468 'relpath' =>
'/'.$file[
'name'],
469 'relpathnamelang' => $langs->trans($file[
'item']).
'/'.$file[
'name'],
470 'modulepart' => $modulepart,
472 'currency' => $file[
'currency']
499$dirfortmpfile = (!empty($conf->accounting->dir_temp) ? $conf->accounting->dir_temp : $conf->comptabilite->dir_temp);
500if (empty($dirfortmpfile)) {
501 setEventMessages($langs->trans(
"ErrorNoAccountingModuleEnabled"),
null,
'errors');
506if ($result && $action ==
"dl" && !$error) {
507 if (!extension_loaded(
'zip')) {
512 $log = $langs->transnoentitiesnoconv(
"Type");
513 if (isModEnabled(
'multicompany') && is_object($mc)) {
514 $log .=
','.$langs->transnoentitiesnoconv(
"Entity");
516 $log .=
','.$langs->transnoentitiesnoconv(
"Date");
517 $log .=
','.$langs->transnoentitiesnoconv(
"DateDue");
518 $log .=
','.$langs->transnoentitiesnoconv(
"Ref");
519 $log .=
','.$langs->transnoentitiesnoconv(
"TotalHT");
520 $log .=
','.$langs->transnoentitiesnoconv(
"TotalTTC");
521 $log .=
','.$langs->transnoentitiesnoconv(
"TotalVAT");
522 $log .=
','.$langs->transcountrynoentities(
"TotalLT1", $mysoc->country_code);
523 $log .=
','.$langs->transcountrynoentities(
"TotalLT2", $mysoc->country_code);
524 $log .=
','.$langs->transnoentitiesnoconv(
"RevenueStamp");
525 $log .=
','.$langs->transnoentitiesnoconv(
"Paid");
526 $log .=
','.$langs->transnoentitiesnoconv(
"Document");
527 $log .=
','.$langs->transnoentitiesnoconv(
"ItemID");
528 $log .=
','.$langs->transnoentitiesnoconv(
"ThirdParty");
529 $log .=
','.$langs->transnoentitiesnoconv(
"Code");
530 $log .=
','.$langs->transnoentitiesnoconv(
"Country");
531 $log .=
','.$langs->transnoentitiesnoconv(
"VATIntra");
532 $log .=
','.$langs->transnoentitiesnoconv(
"Sens").
"\n";
534 if (!empty($projectid)) {
536 $project->fetch($projectid);
538 $zipname .=
'_'.$project->ref;
541 $zipname .=
'_export.zip';
545 $zip =
new ZipArchive();
546 $res = $zip->open($zipname, ZipArchive::OVERWRITE | ZipArchive::CREATE);
548 foreach ($filesarray as $key => $file) {
549 if (!empty($file[
'files'])) {
550 foreach ($file[
'files'] as $filecursor) {
551 if (file_exists($filecursor[
"fullname"])) {
552 $zip->addFile($filecursor[
"fullname"], $filecursor[
"relpathnamelang"]);
557 $log .=
'"'.$langs->transnoentitiesnoconv($file[
'item']).
'"';
558 if (isModEnabled(
'multicompany') && is_object($mc)) {
559 $log .=
',"'.(empty($arrayofentities[$file[
'entity']]) ? $file[
'entity'] : $arrayofentities[$file[
'entity']]).
'"';
561 $log .=
','.dol_print_date($file[
'date'],
'dayrfc');
562 $log .=
','.dol_print_date($file[
'date_due'],
'dayrfc');
563 $log .=
',"'.$file[
'ref'].
'"';
564 $log .=
','.$file[
'amount_ht'];
565 $log .=
','.$file[
'amount_ttc'];
566 $log .=
','.$file[
'amount_vat'];
567 $log .=
','.$file[
'amount_localtax1'];
568 $log .=
','.$file[
'amount_localtax2'];
569 $log .=
','.$file[
'amount_revenuestamp'];
570 $log .=
','.$file[
'paid'];
571 $log .=
',"'.$file[
"name"].
'"';
572 $log .=
','.$file[
'fk'];
573 $log .=
',"'.$file[
'thirdparty_name'].
'"';
574 $log .=
',"'.$file[
'thirdparty_code'].
'"';
575 $log .=
',"'.$file[
'country_code'].
'"';
576 $log .=
',"'.$file[
'vatnum'].
'"';
577 $log .=
',"'.$file[
'sens'].
'"';
580 $zip->addFromString(
'transactions.csv', $log);
584 header(
'Content-Type: application/zip');
585 header(
'Content-disposition: attachment; filename='.basename($zipname));
586 header(
'Content-Length: '.filesize($zipname));
593 setEventMessages($langs->trans(
"FailedToOpenFile", $zipname),
null,
'errors');
603$form =
new Form($db);
605$userstatic =
new User($db);
615$title = $langs->trans(
"ComptaFiles").
' - '.$langs->trans(
"List");
622$head[$h][0] = $_SERVER[
"PHP_SELF"];
623$head[$h][1] = $langs->trans(
"AccountantFiles");
624$head[$h][2] =
'AccountancyFiles';
629print
'<form name="searchfiles" action="?action=searchfiles" method="POST">'.
"\n";
630print
'<input type="hidden" name="token" value="'.newToken().
'">';
632print
'<span class="opacitymedium">'.$langs->trans(
"ExportAccountingSourceDocHelp");
633if (isModEnabled(
'accounting')) {
634 print
' '.$langs->trans(
"ExportAccountingSourceDocHelp2", $langs->transnoentitiesnoconv(
"Accounting"), $langs->transnoentitiesnoconv(
"Journals"));
639print $langs->trans(
"ReportPeriod").
': ';
640print $form->selectDate($date_start,
'date_start', 0, 0, 0,
"", 1, 1, 0,
'',
'',
'',
'', 1,
'',
'',
'tzuserrel');
642print $form->selectDate($date_stop,
'date_stop', 0, 0, 0,
"", 1, 1, 0,
'',
'',
'',
'', 1,
'',
'',
'tzuserrel');
647if (isModEnabled(
'multicompany') && is_object($mc)) {
648 $mc->getInfo($conf->entity);
649 print
' <span class="marginleftonly marginrightonly'.(!
getDolGlobalString(
'MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES') ?
' opacitymedium' :
'').
'">'.$langs->trans(
"Entity").
' : ';
650 if (
getDolGlobalString(
'MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES')) {
652 print $mc->select_entities(GETPOSTISSET(
'search_entity') ?
GETPOST(
'search_entity',
'int') : $mc->id,
'search_entity',
'', false, false, false, false, true);
662if (isModEnabled(
'projet')) {
664 $langs->load(
'projects');
665 print
'<span class="marginrightonly">'.$langs->trans(
'Project').
":</span>";
666 print
img_picto(
'',
'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid,
'projectid', 0, 0, 1, 0, 0, 0, 0,
'', 1, 0,
'');
667 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>';
672foreach ($listofchoices as $choice => $val) {
673 if (empty($val[
'enabled'])) {
677 if (empty($val[
'perms'])) {
678 $disabled =
' disabled';
680 $checked = (((!GETPOSTISSET(
'search') && $action !=
'searchfiles') ||
GETPOST($choice)) ?
' checked="checked"' :
'');
681 print
'<div class="'.($i > 0 ?
'paddingleft marginleftonly' :
'').
' inline-block marginrightonly paddingright"><input type="checkbox" id="'.$choice.
'" name="'.$choice.
'" value="1"'.$checked.$disabled.
'><label for="'.$choice.
'"> ';
682 print
img_picto($langs->trans($val[
'label']), $val[
'picto'],
'class=""').
' '.$langs->trans($val[
'label']);
683 print
'</label></div>';
687print
'<input type="submit" class="button small" name="search" value="'.$langs->trans(
"Search").
'">';
694if (!empty($date_start) && !empty($date_stop)) {
695 $param .=
'&date_startday='.GETPOST(
'date_startday',
'int');
696 $param .=
'&date_startmonth='.GETPOST(
'date_startmonth',
'int');
697 $param .=
'&date_startyear='.GETPOST(
'date_startyear',
'int');
698 $param .=
'&date_stopday='.GETPOST(
'date_stopday',
'int');
699 $param .=
'&date_stopmonth='.GETPOST(
'date_stopmonth',
'int');
700 $param .=
'&date_stopyear='.GETPOST(
'date_stopyear',
'int');
701 foreach ($listofchoices as $choice => $val) {
703 $param .=
'&'.$choice.
'=1';
714 print
'<a class="marginleftonly small'.(empty($TData) ?
' butActionRefused' :
' butAction').
'" href="'.$_SERVER[
"PHP_SELF"].
'?action=dl&token='.
currentToken().
'&projectid='.$projectid.
'&output=file&file='.urlencode($filename).$param.
'"';
719 print $langs->trans(
"Download");
722 $param .=
'&action=searchfiles';
746 print
'<div class="div-table-responsive">';
747 print
'<table class="noborder centpercent">';
748 print
'<tr class="liste_titre">';
749 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
"PHP_SELF"],
"item",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
750 print_liste_field_titre($arrayfields[
'date'][
'label'], $_SERVER[
"PHP_SELF"],
"date",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
751 print_liste_field_titre($arrayfields[
'date_due'][
'label'], $_SERVER[
"PHP_SELF"],
"date_due",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
752 print_liste_field_titre($arrayfields[
'ref'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'nowraponall ');
753 print
'<th>'.$langs->trans(
"Document").
'</th>';
754 print
'<th>'.$langs->trans(
"Paid").
'</th>';
755 print
'<th class="right">'.$langs->trans(
"TotalHT").(isModEnabled(
'multicurrency') ?
' ('.$langs->getCurrencySymbol($conf->currency).
')' :
'').
'</th>';
756 print
'<th class="right">'.$langs->trans(
"TotalTTC").(isModEnabled(
'multicurrency') ?
' ('.$langs->getCurrencySymbol($conf->currency).
')' :
'').
'</th>';
757 print
'<th class="right">'.$langs->trans(
"TotalVAT").(isModEnabled(
'multicurrency') ?
' ('.$langs->getCurrencySymbol($conf->currency).
')' :
'').
'</th>';
759 print
'<th>'.$langs->trans(
"ThirdParty").
'</th>';
760 print
'<th class="center">'.$langs->trans(
"Code").
'</th>';
761 print
'<th class="center">'.$langs->trans(
"Country").
'</th>';
762 print
'<th class="center">'.$langs->trans(
"VATIntra").
'</th>';
763 if (isModEnabled(
'multicurrency')) {
764 print
'<th class="center">'.$langs->trans(
"Currency").
'</th>';
769 print
'<tr class="oddeven"><td colspan="13"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td>';
770 if (isModEnabled(
'multicurrency')) {
782 $totalVAT_credit = 0;
785 foreach ($TData as $data) {
789 print
'<tr class="oddeven '.$html_class.
'">';
792 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans($data[
'item'])).
'">'.$langs->trans($data[
'item']).
'</td>';
795 print
'<td class="center">';
800 print
'<td class="center">';
805 print
'<td class="nowraponall tdoverflowmax150">';
807 if ($data[
'item'] ==
'Invoice') {
808 $invoice->id = $data[
'id'];
809 $invoice->ref = $data[
'ref'];
810 $invoice->total_ht = $data[
'amount_ht'];
811 $invoice->total_ttc = $data[
'amount_ttc'];
812 $invoice->total_tva = $data[
'amount_vat'];
813 $invoice->total_localtax1 = $data[
'amount_localtax1'];
814 $invoice->total_localtax2 = $data[
'amount_localtax2'];
815 $invoice->revenuestamp = $data[
'amount_revenuestamp'];
816 $invoice->multicurrency_code = $data[
'currency'];
817 print $invoice->getNomUrl(1,
'', 0, 0,
'', 0, 0, 0);
818 } elseif ($data[
'item'] ==
'SupplierInvoice') {
819 $supplier_invoice->id = $data[
'id'];
820 $supplier_invoice->ref = $data[
'ref'];
821 $supplier_invoice->total_ht = $data[
'amount_ht'];
822 $supplier_invoice->total_ttc = $data[
'amount_ttc'];
823 $supplier_invoice->total_tva = $data[
'amount_vat'];
824 $supplier_invoice->total_localtax1 = $data[
'amount_localtax1'];
825 $supplier_invoice->total_localtax2 = $data[
'amount_localtax2'];
826 $supplier_invoice->revenuestamp = $data[
'amount_revenuestamp'];
827 $supplier_invoice->multicurrency_code = $data[
'currency'];
828 print $supplier_invoice->getNomUrl(1,
'', 0, 0,
'', 0, 0, 0);
829 } elseif ($data[
'item'] ==
'ExpenseReport') {
830 $expensereport->id = $data[
'id'];
831 $expensereport->ref = $data[
'ref'];
832 print $expensereport->getNomUrl(1, 0, 0,
'', 0, 0);
833 } elseif ($data[
'item'] ==
'SalaryPayment') {
834 $salary_payment->id = $data[
'id'];
835 $salary_payment->ref = $data[
'ref'];
836 print $salary_payment->getNomUrl(1);
837 } elseif ($data[
'item'] ==
'Donation') {
838 $don->id = $data[
'id'];
839 $don->ref = $data[
'ref'];
840 print $don->getNomUrl(1, 0,
'', 0);
841 } elseif ($data[
'item'] ==
'SocialContributions') {
842 $charge_sociales->id = $data[
'id'];
843 $charge_sociales->ref = $data[
'ref'];
844 print $charge_sociales->getNomUrl(1, 0, 0, 0, 0);
845 } elseif ($data[
'item'] ==
'VariousPayment') {
846 $various_payment->id = $data[
'id'];
847 $various_payment->ref = $data[
'ref'];
848 print $various_payment->getNomUrl(1,
'', 0, 0);
849 } elseif ($data[
'item'] ==
'LoanPayment') {
850 $payment_loan->id = $data[
'id'];
851 $payment_loan->ref = $data[
'ref'];
852 print $payment_loan->getNomUrl(1, 0, 0,
'', 0);
859 print
'<td class="tdoverflowmax150">';
860 if (!empty($data[
'files'])) {
861 foreach ($data[
'files'] as $id => $filecursor) {
862 $tmppreview = $formfile->showPreview($filecursor, $filecursor[
'modulepart'], $filecursor[
'subdir'].
'/'.$filecursor[
'name'], 0);
866 $filename = ($filecursor[
'name'] ? $filecursor[
'name'] : $filecursor[
'ref']);
867 print
'<a href='.DOL_URL_ROOT.
'/'.$filecursor[
'link'].
' target="_blank" rel="noopener noreferrer" title="'.
dol_escape_htmltag($filename).
'">';
868 if (empty($tmppreview)) {
869 print
img_picto(
'',
'generic',
'',
false, 0, 0,
'',
'pictonopreview pictofixedwidth paddingright');
878 print
'<td class="center">'.($data[
'paid'] ?
yn($data[
'paid']) :
'').
'</td>';
881 print
'<td class="right"><span class="amount">'.price(
price2num($data[
'sens'] ? $data[
'amount_ht'] : -$data[
'amount_ht'],
'MT')).
"</span></td>\n";
883 print
'<td class="right"><span class="amount">';
884 $tooltip = $langs->trans(
"TotalVAT").
' : '.
price(
price2num($data[
'sens'] ? $data[
'amount_vat'] : -$data[
'amount_vat'],
'MT'));
885 if (!empty($data[
'amount_localtax1'])) {
886 $tooltip .=
'<br>'.$langs->transcountrynoentities(
"TotalLT1", $mysoc->country_code).
' : '.
price(
price2num($data[
'sens'] ? $data[
'amount_localtax1'] : -$data[
'amount_localtax1'],
'MT'));
888 if (!empty($data[
'amount_localtax2'])) {
889 $tooltip .=
'<br>'.$langs->transcountrynoentities(
"TotalLT2", $mysoc->country_code).
' : '.
price(
price2num($data[
'sens'] ? $data[
'amount_localtax2'] : -$data[
'amount_localtax2'],
'MT'));
891 if (!empty($data[
'amount_revenuestamp'])) {
892 $tooltip .=
'<br>'.$langs->trans(
"RevenueStamp").
' : '.
price(
price2num($data[
'sens'] ? $data[
'amount_revenuestamp'] : -$data[
'amount_revenuestamp'],
'MT'));
894 print
'<span class="classfortooltip" title="'.dol_escape_htmltag($tooltip).
'">'.
price(
price2num($data[
'sens'] ? $data[
'amount_ttc'] : -$data[
'amount_ttc'],
'MT')).
'</span>';
895 print
"</span></td>\n";
897 print
'<td class="right"><span class="amount">'.price(
price2num($data[
'sens'] ? $data[
'amount_vat'] : -$data[
'amount_vat'],
'MT')).
"</span></td>\n";
899 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($data[
'thirdparty_name']).
'">'.
dol_escape_htmltag($data[
'thirdparty_name']).
"</td>\n";
901 print
'<td class="center">'.$data[
'thirdparty_code'].
"</td>\n";
903 print
'<td class="center">'.$data[
'country_code'].
"</td>\n";
906 print
'<td class="tdoverflowmax150 right" title="'.dol_escape_htmltag($data[
'vatnum']).
'">'.
dol_escape_htmltag($data[
'vatnum']).
"</td>\n";
909 $totalET_credit += $data[
'amount_ht'];
910 $totalIT_credit += $data[
'amount_ttc'];
911 $totalVAT_credit += $data[
'amount_vat'];
913 $totalET_debit -= $data[
'amount_ht'];
914 $totalIT_debit -= $data[
'amount_ttc'];
915 $totalVAT_debit -= $data[
'amount_vat'];
918 if (isModEnabled(
'multicurrency')) {
919 print
'<td class="center">'.$data[
'currency'].
"</td>\n";
926 print
'<tr class="liste_total">';
927 print
'<td colspan="6" class="right">'.$langs->trans(
'Total').
' '.$langs->trans(
'Income').
'</td>';
928 print
'<td class="right">'.price(
price2num($totalET_credit,
'MT')).
'</td>';
929 print
'<td class="right">'.price(
price2num($totalIT_credit,
'MT')).
'</td>';
930 print
'<td class="right">'.price(
price2num($totalVAT_credit,
'MT')).
'</td>';
931 print
'<td colspan="4"></td>';
932 if (isModEnabled(
'multicurrency')) {
937 print
'<tr class="liste_total">';
938 print
'<td colspan="6" class="right">'.$langs->trans(
'Total').
' '.$langs->trans(
'Outcome').
'</td>';
939 print
'<td class="right">'.price(
price2num($totalET_debit,
'MT')).
'</td>';
940 print
'<td class="right">'.price(
price2num($totalIT_debit,
'MT')).
'</td>';
941 print
'<td class="right">'.price(
price2num($totalVAT_debit,
'MT')).
'</td>';
942 print
'<td colspan="4"></td>';
943 if (isModEnabled(
'multicurrency')) {
948 print
'<tr class="liste_total">';
949 print
'<td colspan="6" class="right">'.$langs->trans(
'Total').
'</td>';
950 print
'<td class="right">'.price(
price2num($totalET_credit + $totalET_debit,
'MT')).
'</td>';
951 print
'<td class="right">'.price(
price2num($totalIT_credit + $totalIT_debit,
'MT')).
'</td>';
952 print
'<td class="right">'.price(
price2num($totalVAT_credit + $totalVAT_debit,
'MT')).
'</td>';
953 print
'<td colspan="4"></td>';
954 if (isModEnabled(
'multicurrency')) {
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Classe permettant la gestion des paiements des charges La tva collectee n'est calculee que sur les fa...
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($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 informations (by default a local PHP server timestamp) Re...
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
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_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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.