33require
'../../main.inc.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/report.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/tax.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
51$langs->loadLangs(array(
'companies',
'categories',
'bills',
'compta'));
56 $modecompta =
GETPOST(
"modecompta");
59$sortorder =
GETPOST(
"sortorder",
'aZ09comma');
60$sortfield =
GETPOST(
"sortfield",
'aZ09comma');
72if ($selected_cat == -1) {
76if (
GETPOST(
'subcat',
'alpha') ===
'yes') {
81if ($user->socid > 0) {
82 $socid = $user->socid;
86$hookmanager->initHooks(array(
'casoclist'));
92 $result =
restrictedArea($user,
'accounting',
'',
'',
'comptarapport');
98$search_societe =
GETPOST(
"search_societe",
'alpha');
99$search_zip =
GETPOST(
"search_zip",
'alpha');
100$search_town =
GETPOST(
"search_town",
'alpha');
101$search_country =
GETPOST(
"search_country",
'aZ09');
102$date_startyear =
GETPOSTINT(
"date_startyear");
103$date_startmonth =
GETPOSTINT(
"date_startmonth");
111 $year_start = $year_current;
113 $year_current = $year;
120if (empty($date_start) || empty($date_end)) {
125 $year_end = $year_start;
126 $month_end = $month_start;
128 if (!
GETPOST(
'year') && $month_start > $month_current) {
132 $month_end = $month_start - 1;
133 if ($month_end < 1) {
165$year_start = $tmps[
'year'];
167$year_end = $tmpe[
'year'];
168$nbofyear = ($year_end - $year_start) + 1;
170$commonparams = array();
171$commonparams[
'modecompta'] = $modecompta;
172$commonparams[
'sortorder'] = $sortorder;
173$commonparams[
'sortfield'] = $sortfield;
175$headerparams = array();
176if (!empty($date_startyear)) {
177 $headerparams[
'date_startyear'] = $date_startyear;
179if (!empty($date_startmonth)) {
180 $headerparams[
'date_startmonth'] = $date_startmonth;
182if (!empty($date_startday)) {
183 $headerparams[
'date_startday'] = $date_startday;
185if (!empty($date_endyear)) {
186 $headerparams[
'date_endyear'] = $date_endyear;
188if (!empty($date_endmonth)) {
189 $headerparams[
'date_endmonth'] = $date_endmonth;
191if (!empty($date_endday)) {
192 $headerparams[
'date_endday'] = $date_endday;
195 $headerparams[
'q'] = $q;
198$tableparams = array();
199$tableparams[
'search_categ'] = $selected_cat;
200$tableparams[
'search_societe'] = $search_societe;
201$tableparams[
'search_zip'] = $search_zip;
202$tableparams[
'search_town'] = $search_town;
203$tableparams[
'search_country'] = $search_country;
204$tableparams[
'subcat'] = $subcat ?
'yes' :
'';
207$allparams = array_merge($commonparams, $headerparams, $tableparams);
208$headerparams = array_merge($commonparams, $headerparams);
209$tableparams = array_merge($commonparams, $tableparams);
212foreach ($allparams as $key => $value) {
213 $paramslink .=
'&'.$key.
'='.$value;
223$form =
new Form($db);
224$thirdparty_static =
new Societe($db);
227if ($modecompta ==
"BOOKKEEPINGCOLLECTED") {
228 $modecompta =
"RECETTES-DEPENSES";
239if ($modecompta ==
"CREANCES-DETTES") {
240 $name = $langs->trans(
"Turnover").
', '.$langs->trans(
"ByThirdParties");
241 $calcmode = $langs->trans(
"CalcModeDebt");
243 $description = $langs->trans(
"RulesCADue");
245 $description .= $langs->trans(
"DepositsAreNotIncluded");
247 $description .= $langs->trans(
"DepositsAreIncluded");
251} elseif ($modecompta ==
"RECETTES-DEPENSES") {
252 $name = $langs->trans(
"TurnoverCollected").
', '.$langs->trans(
"ByThirdParties");
253 $calcmode = $langs->trans(
"CalcModePayment");
255 $description = $langs->trans(
"RulesCAIn");
256 $description .= $langs->trans(
"DepositsAreIncluded");
259} elseif ($modecompta ==
"BOOKKEEPING") {
260 $name = $langs->trans(
"Turnover").
', '.$langs->trans(
"ByThirdParties");
261 $calcmode = $langs->trans(
"CalcModeBookkeeping");
262 $description = $langs->trans(
"RulesCADue");
266$period = $form->selectDate($date_start,
'date_start', 0, 0, 0,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'',
'',
'tzserver');
268$period .= $form->selectDate($date_end,
'date_end', 0, 0, 0,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'',
'',
'tzserver');
270 $periodlink =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?year='.($year_start - 1).
'&modecompta='.$modecompta.
'">'.
img_previous().
'</a> <a href="'.$_SERVER[
"PHP_SELF"].
'?year='.($year_start + 1).
'&modecompta='.$modecompta.
'">'.
img_next().
'</a>';
275report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode);
277if (
isModEnabled(
'accounting') && $modecompta !=
'BOOKKEEPING') {
278 print
info_admin($langs->trans(
"WarningReportNotReliable"), 0, 0,
'1');
289if ($modecompta ==
'CREANCES-DETTES') {
290 $sql =
"SELECT DISTINCT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.fk_pays,";
291 $sql .=
" sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc";
292 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f, ".MAIN_DB_PREFIX.
"societe as s";
293 if ($selected_cat === -2) {
294 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"categorie_societe as cs ON s.rowid = cs.fk_soc";
295 } elseif ($selected_cat) {
296 $sql .=
", ".MAIN_DB_PREFIX.
"categorie as c, ".MAIN_DB_PREFIX.
"categorie_societe as cs";
298 $sql .=
" WHERE f.fk_statut in (1,2)";
300 $sql .=
" AND f.type IN (0,1,2,5)";
302 $sql .=
" AND f.type IN (0,1,2,3,5)";
305 $hookmanager->initHooks(array(
'turnoverreport'));
306 $parameters = array(
'invoicealias' =>
'f',
'issupplier' => 0,
'datefield' =>
'datef');
307 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
308 $sql .= $hookmanager->resPrint;
309 $sql .=
" AND f.fk_soc = s.rowid";
310 if ($date_start && $date_end) {
311 $sql .=
" AND f.datef >= '".$db->idate($date_start).
"' AND f.datef <= '".$db->idate($date_end).
"'";
313 if ($selected_cat === -2) {
314 $sql .=
" AND cs.fk_soc is null";
315 } elseif ($selected_cat) {
316 $sql .=
" AND (c.rowid = ".((int) $selected_cat);
318 $sql .=
" OR c.fk_parent = ".((int) $selected_cat);
321 $sql .=
" AND cs.fk_categorie = c.rowid AND cs.fk_soc = s.rowid";
323} elseif ($modecompta ==
"RECETTES-DEPENSES") {
328 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.fk_pays, sum(pf.amount) as amount_ttc";
329 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
330 $sql .=
", ".MAIN_DB_PREFIX.
"paiement_facture as pf";
331 $sql .=
", ".MAIN_DB_PREFIX.
"paiement as p";
332 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
333 if ($selected_cat === -2) {
334 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"categorie_societe as cs ON s.rowid = cs.fk_soc";
335 } elseif ($selected_cat) {
336 $sql .=
", ".MAIN_DB_PREFIX.
"categorie as c, ".MAIN_DB_PREFIX.
"categorie_societe as cs";
338 $sql .=
" WHERE p.rowid = pf.fk_paiement";
339 $sql .=
" AND pf.fk_facture = f.rowid";
340 $sql .=
" AND f.fk_soc = s.rowid";
341 if ($date_start && $date_end) {
342 $sql .=
" AND p.datep >= '".$db->idate($date_start).
"' AND p.datep <= '".$db->idate($date_end).
"'";
344 if ($selected_cat === -2) {
345 $sql .=
" AND cs.fk_soc is null";
346 } elseif ($selected_cat) {
347 $sql .=
" AND (c.rowid = ".((int) $selected_cat);
349 $sql .=
" OR c.fk_parent = ".((int) $selected_cat);
352 $sql .=
" AND cs.fk_categorie = c.rowid AND cs.fk_soc = s.rowid";
354} elseif ($modecompta ==
"BOOKKEEPING") {
361 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.fk_pays,";
362 $sql .=
" SUM(CASE WHEN b.subledger_account IS NOT NULL AND b.subledger_account != '' THEN b.debit - b.credit ELSE 0 END) as amount_ttc,";
363 $sql .=
" SUM(CASE WHEN aa.pcg_type = 'INCOME' THEN b.credit - b.debit ELSE 0 END) as amount";
364 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_bookkeeping as b";
365 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"accounting_account as aa ON aa.account_number = b.numero_compte AND aa.entity = b.entity AND aa.fk_pcg_version = '".$db->escape($charofaccountstring).
"'";
366 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.code_client = b.thirdparty_code";
367 if ($selected_cat === -2) {
368 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"categorie_societe as cs ON s.rowid = cs.fk_soc";
369 } elseif ($selected_cat) {
370 $sql .=
", ".MAIN_DB_PREFIX.
"categorie as c, ".MAIN_DB_PREFIX.
"categorie_societe as cs";
372 $sql .=
" WHERE b.doc_type = 'customer_invoice'";
373 $sql .=
" AND b.thirdparty_code IS NOT NULL AND b.thirdparty_code != ''";
374 if ($date_start && $date_end) {
375 $sql .=
" AND b.doc_date >= '".$db->idate($date_start).
"' AND b.doc_date <= '".$db->idate($date_end).
"'";
377 if ($selected_cat === -2) {
378 $sql .=
" AND cs.fk_soc is null";
379 } elseif ($selected_cat) {
380 $sql .=
" AND (c.rowid = ".((int) $selected_cat);
382 $sql .=
" OR c.fk_parent = ".((int) $selected_cat);
385 $sql .=
" AND cs.fk_categorie = c.rowid AND cs.fk_soc = s.rowid";
388if (!empty($search_societe)) {
391if (!empty($search_zip)) {
394if (!empty($search_town)) {
397if ($search_country > 0) {
398 $sql .=
' AND s.fk_pays = '.((int) $search_country);
400if ($modecompta ==
'BOOKKEEPING') {
401 $sql .=
" AND b.entity = ".((int)
$conf->entity);
403 $sql .=
" AND s.rowid = ".((int) $socid);
406 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
")";
408 $sql .=
" AND f.fk_soc = ".((int) $socid);
411$sql .=
" GROUP BY s.rowid, s.nom, s.name_alias, s.zip, s.town, s.fk_pays";
412$sql .=
" ORDER BY s.rowid";
417$address_zip = array();
418$address_town = array();
419$address_pays = array();
422$result = $db->query($sql);
424 $num = $db->num_rows($result);
427 $obj = $db->fetch_object($result);
429 $amount_ht[$obj->socid] = (empty($obj->amount) ? 0 : $obj->amount);
430 $amount[$obj->socid] = $obj->amount_ttc;
431 $fullname = $obj->name;
432 if (!empty($obj->name_alias)) {
433 $fullname .=
' ('.$obj->name_alias.
')';
435 $name[$obj->socid] = $fullname;
437 $address_zip[$obj->socid] = $obj->zip;
438 $address_town[$obj->socid] = $obj->town;
439 $address_pays[$obj->socid] =
getCountry($obj->fk_pays);
441 $catotal_ht += (empty($obj->amount) ? 0 : $obj->amount);
442 $catotal += $obj->amount_ttc;
447 dol_print_error($db);
451if ($modecompta ==
"RECETTES-DEPENSES") {
452 $sql =
"SELECT '0' as socid, 'Autres' as name, sum(p.amount) as amount_ttc";
453 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
454 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
455 $sql .=
", ".MAIN_DB_PREFIX.
"paiement as p";
456 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf ON p.rowid = pf.fk_paiement";
457 $sql .=
" WHERE pf.rowid IS NULL";
458 $sql .=
" AND p.fk_bank = b.rowid";
459 $sql .=
" AND b.fk_account = ba.rowid";
460 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
461 if ($date_start && $date_end) {
462 $sql .=
" AND p.datep >= '".$db->idate($date_start).
"' AND p.datep <= '".$db->idate($date_end).
"'";
464 $sql .=
" GROUP BY socid, name";
465 $sql .=
" ORDER BY name";
467 $result = $db->query($sql);
469 $num = $db->num_rows($result);
472 $obj = $db->fetch_object($result);
474 if (empty($amount[$obj->socid])) {
475 $amount[$obj->socid] = $obj->amount_ttc;
477 $amount[$obj->socid] += $obj->amount_ttc;
480 $name[$obj->socid] = $obj->name;
481 $address_zip[$obj->socid] =
'';
482 $address_town[$obj->socid] =
'';
483 $address_pays[$obj->socid] =
'';
485 $catotal += $obj->amount_ttc;
490 dol_print_error($db);
497print
'<form method="POST" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
498print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
500foreach ($headerparams as $key => $value) {
501 print
'<input type="hidden" name="'.$key.
'" value="'.$value.
'">';
506print
'<div class="div-table-responsive">';
507print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
510print
'<tr class="liste_titre">';
511print
'<td class="nowraponall">';
512print img_picto(
'',
'category',
'class="paddingrightonly"');
513print $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat,
'search_categ', 0, $langs->trans(
"Category"));
515print $langs->trans(
"SubCats").
'? ';
516print
'<input type="checkbox" name="subcat" value="yes"';
521print
'<td colspan="7" class="right">';
522print
'<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans(
"Search"),
'search.png',
'', 0, 1).
'" value="'.
dol_escape_htmltag($langs->trans(
"Search")).
'" title="'.
dol_escape_htmltag($langs->trans(
"Search")).
'">';
526print
'<tr class="liste_titre">';
527print
'<td class="liste_titre left">';
528print
'<input class="flat" size="6" type="text" name="search_societe" value="'.dol_escape_htmltag($search_societe).
'">';
530print
'<td class="liste_titre left">';
531print
'<input class="flat" size="6" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'">';
533print
'<td class="liste_titre left">';
534print
'<input class="flat" size="6" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'">';
536print
'<td class="liste_titre left">';
537print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
540print
'<td class="liste_titre"> </td>';
541print
'<td class="liste_titre"> </td>';
542print
'<td class="liste_titre"> </td>';
543print
'<td class="liste_titre"> </td>';
547print
"<tr class='liste_titre'>";
549 $langs->trans(
"Company"),
550 $_SERVER[
"PHP_SELF"],
559 $langs->trans(
"Zip"),
560 $_SERVER[
"PHP_SELF"],
569 $langs->trans(
"Town"),
570 $_SERVER[
"PHP_SELF"],
579 $langs->trans(
"Country"),
580 $_SERVER[
"PHP_SELF"],
588if ($modecompta ==
'CREANCES-DETTES') {
590 $langs->trans(
'AmountHT'),
591 $_SERVER[
"PHP_SELF"],
603 $langs->trans(
"AmountTTC"),
604 $_SERVER[
"PHP_SELF"],
613 $langs->trans(
"Percentage"),
614 $_SERVER[
"PHP_SELF"],
623 $langs->trans(
"OtherStatistics"),
624 $_SERVER[
"PHP_SELF"],
628 'align="center" width="20%"'
634 $arrayforsort = $name;
636 if ($sortfield ==
'nom' && $sortorder ==
'asc') {
638 $arrayforsort = $name;
640 if ($sortfield ==
'nom' && $sortorder ==
'desc') {
642 $arrayforsort = $name;
644 if ($sortfield ==
'amount_ht' && $sortorder ==
'asc') {
646 $arrayforsort = $amount_ht;
648 if ($sortfield ==
'amount_ht' && $sortorder ==
'desc') {
650 $arrayforsort = $amount_ht;
652 if ($sortfield ==
'amount_ttc' && $sortorder ==
'asc') {
654 $arrayforsort = $amount;
656 if ($sortfield ==
'amount_ttc' && $sortorder ==
'desc') {
658 $arrayforsort = $amount;
660 if ($sortfield ==
'zip' && $sortorder ==
'asc') {
662 $arrayforsort = $address_zip;
664 if ($sortfield ==
'zip' && $sortorder ==
'desc') {
665 arsort($address_zip);
666 $arrayforsort = $address_zip;
668 if ($sortfield ==
'town' && $sortorder ==
'asc') {
669 asort($address_town);
670 $arrayforsort = $address_town;
672 if ($sortfield ==
'town' && $sortorder ==
'desc') {
673 arsort($address_town);
674 $arrayforsort = $address_town;
676 if ($sortfield ==
'country' && $sortorder ==
'asc') {
677 asort($address_pays);
678 $arrayforsort = $address_town;
680 if ($sortfield ==
'country' && $sortorder ==
'desc') {
681 arsort($address_pays);
682 $arrayforsort = $address_town;
685 foreach ($arrayforsort as $key => $value) {
686 print
'<tr class="oddeven">';
689 $fullname = $name[$key];
691 $thirdparty_static->id = (int) $key;
692 $thirdparty_static->name = $fullname;
693 $thirdparty_static->client = 1;
694 $linkname = $thirdparty_static->getNomUrl(1,
'customer');
696 $linkname = $langs->trans(
"PaymentsNotLinkedToInvoice");
698 print
'<td class="tdoverflowmax150">'.$linkname.
"</td>\n";
701 print $address_zip[$key];
704 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($address_town[$key]).
'">';
705 print $address_town[$key];
708 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($address_pays[$key]).
'">';
709 print $address_pays[$key];
713 print
'<td class="right">';
714 if ($modecompta ==
'RECETTES-DEPENSES') {
716 print
'<a href="'.DOL_URL_ROOT.
'/compta/paiement/list.php?socid='.$key.
'">';
718 print
'<a href="'.DOL_URL_ROOT.
'/compta/paiement/list.php?socid=-1">';
722 print
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?socid='.$key.
'">';
724 print
'<a href="#">';
726 print
price($amount_ht[$key]);
731 print
'<td class="right">';
732 if ($modecompta !=
'CREANCES-DETTES') {
734 print
'<a href="'.DOL_URL_ROOT.
'/compta/paiement/list.php?socid='.$key.
'">';
736 print
'<a href="'.DOL_URL_ROOT.
'/compta/paiement/list.php?orphelins=1">';
740 print
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?socid='.$key.
'">';
742 print
'<a href="#">';
745 print
price($amount[$key]);
750 print
'<td class="right">'.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).
'%' :
' ').
'</td>';
753 print
'<td class="center">';
755 print
' <a href="'.DOL_URL_ROOT.
'/comm/propal/stats/index.php?socid='.$key.
'">'.img_picto($langs->trans(
"ProposalStats"),
"stats").
'</a> ';
758 print
' <a href="'.DOL_URL_ROOT.
'/commande/stats/index.php?socid='.$key.
'">'.img_picto($langs->trans(
"OrderStats"),
"stats").
'</a> ';
761 print
' <a href="'.DOL_URL_ROOT.
'/compta/facture/stats/index.php?socid='.$key.
'">'.img_picto($langs->trans(
"InvoiceStats"),
"stats").
'</a> ';
769 print
'<tr class="liste_total">';
770 print
'<td>'.$langs->trans(
"Total").
'</td>';
771 print
'<td> </td>';
772 print
'<td> </td>';
773 print
'<td> </td>';
774 if ($modecompta ==
'RECETTES-DEPENSES') {
777 print
'<td class="right">'.price($catotal_ht).
'</td>';
779 print
'<td class="right">'.price($catotal).
'</td>';
780 print
'<td> </td>';
781 print
'<td> </td>';
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage third parties objects (customers, suppliers, prospects...)
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
$date_start
Variables from include:
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='', $useCache=true)
Return an id or code from a code or id.
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.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
img_previous($titlealt='default', $moreatt='')
Show previous logo.
img_next($titlealt='default', $moreatt='')
Show next logo.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
Show information in HTML for admin users or standard users.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='')
Show header of a report.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.