31require_once DOL_DOCUMENT_ROOT .
'/societe/class/societe.class.php';
32require_once DOL_DOCUMENT_ROOT .
'/core/lib/date.lib.php';
68 "name" =>
"get_thirdparty_transactions",
69 "description" =>
"Generate a list of raw transactions (Invoices, Orders) for a specific thirdparty.",
73 "thirdparty_id" => [
"type" =>
"integer",
"description" =>
"The unique ID of the thirdparty."],
74 "thirdparty_name" => [
"type" =>
"string",
"description" =>
"The name of the thirdparty."],
75 "date_start" => [
"type" =>
"string",
"description" =>
"Start date (YYYY-MM-DD). Compute it from the current date when the user says a relative period like this month."],
76 "date_end" => [
"type" =>
"string",
"description" =>
"End date (YYYY-MM-DD). Compute it from the current date when the user says a relative period."],
77 "transaction_type" => [
79 "enum" => [
"all",
"invoices",
"orders",
"proposals"],
80 "description" =>
"Filter by type.",
85 [
"required" => [
"thirdparty_id"]],
86 [
"required" => [
"thirdparty_name"]]
91 "name" =>
"get_sales_report",
92 "description" =>
"Generate a sales/revenue report. If a Thirdparty is provided, it returns a detailed breakdown for that customer. Otherwise, it returns a global summary.",
98 "description" =>
"Optional: The ID of the customer."
100 "date_start" => [
"type" =>
"string",
"description" =>
"Start date (YYYY-MM-DD). Compute it from the current date when the user says a relative period like this month."],
101 "date_end" => [
"type" =>
"string",
"description" =>
"End date (YYYY-MM-DD). Compute it from the current date when the user says a relative period."],
104 "enum" => [
"thirdparty",
"product",
"month"],
105 "description" =>
"Only used if no Thirdparty is specified. Groups global results.",
106 "default" =>
"thirdparty"
109 "required" => [
"date_start",
"date_end"]
113 "name" =>
"get_purchase_report",
114 "description" =>
"Generate a purchase/expense report. If a Supplier is provided, it returns a detailed breakdown. Otherwise, it returns a global summary.",
120 "description" =>
"Optional: The ID of the supplier."
122 "date_start" => [
"type" =>
"string",
"description" =>
"Start date (YYYY-MM-DD). Compute it from the current date when the user says a relative period like this month."],
123 "date_end" => [
"type" =>
"string",
"description" =>
"End date (YYYY-MM-DD). Compute it from the current date when the user says a relative period."],
126 "enum" => [
"supplier",
"product",
"month"],
127 "description" =>
"Only used if no Supplier is specified. Groups global results.",
128 "default" =>
"supplier"
131 "required" => [
"date_start",
"date_end"]
135 "name" =>
"get_inventory_report",
136 "description" =>
"Generate an inventory report showing current stock levels and valuation.",
140 "category_id" => [
"type" =>
"integer",
"description" =>
"Filter by category ID."],
141 "warehouse_id" => [
"type" =>
"integer",
"description" =>
"Filter by warehouse ID."],
142 "include_zero_stock" => [
"type" =>
"boolean",
"default" =>
false]
147 "name" =>
"get_financial_report",
148 "description" =>
"Generate a summary financial report (Income vs Expense) for a period.",
152 "date_start" => [
"type" =>
"string",
"description" =>
"Start date (YYYY-MM-DD). Compute it from the current date when the user says a relative period like this month."],
153 "date_end" => [
"type" =>
"string",
"description" =>
"End date (YYYY-MM-DD). Compute it from the current date when the user says a relative period."]
155 "required" => [
"date_start",
"date_end"]
170 'get_sales_report' => array(array(
'facture',
'lire')),
171 'get_purchase_report' => array(array(
'fournisseur',
'facture',
'lire')),
172 'get_inventory_report' => array(array(
'produit',
'lire'), array(
'stock',
'lire')),
173 'get_financial_report' => array(array(
'facture',
'lire'), array(
'fournisseur',
'facture',
'lire')),
174 'get_thirdparty_transactions' => array(array(
'societe',
'lire'), array(
'facture',
'lire'))
188 return [
'reporting',
'commercial',
'billing',
'stock'];
198 public function execute(
string $name, array $args)
201 case 'get_thirdparty_transactions':
203 case 'get_sales_report':
205 case 'get_purchase_report':
207 case 'get_inventory_report':
209 case 'get_financial_report':
212 return [
"error" =>
"Tool function '$name' not found."];
230 if (!empty($args[
'thirdparty_id'])) {
231 return (
int) $args[
'thirdparty_id'];
234 if (!empty($args[
'thirdparty_name'])) {
235 $sqlName = $this->db->escape($args[
'thirdparty_name']);
237 $sql =
"SELECT rowid FROM " . MAIN_DB_PREFIX .
"societe
238 WHERE nom LIKE '%" . $sqlName .
"%'
239 AND entity IN (" .
getEntity(
'societe') .
")
242 $resql = $this->db->query($sql);
243 if ($resql && $obj = $this->db->fetch_object($resql)) {
261 $langs->loadLangs(array(
"main",
"bills",
"companies",
"products"));
263 $limit = isset($args[
'limit']) ? (int) $args[
'limit'] : 50;
267 $groupBy = isset($args[
'group_by']) ? (string) $args[
'group_by'] :
'thirdparty';
272 $dateRange =
" AND f.datef >= '" . $this->db->idate($dateStart)
273 .
"' AND f.datef <= '" . $this->db->idate($dateEnd)
274 .
"' AND f.fk_statut IN (1, 2)";
278 $sql =
"SELECT f.rowid, f.ref, f.total_ttc, f.fk_statut, f.paye, f.datef, s.nom FROM "
279 . MAIN_DB_PREFIX .
"facture as f LEFT JOIN "
280 . MAIN_DB_PREFIX .
"societe as s ON f.fk_soc = s.rowid WHERE f.entity IN ("
283 .
" AND f.fk_soc = " . (int) $socid
284 .
" ORDER BY f.datef DESC LIMIT " . ((
int) $limit);
286 $resql = $this->db->query($sql);
288 while ($r = $this->db->fetch_object($resql)) {
289 $totalSum += (float) $r->total_ttc;
291 $statusLabel = $langs->transnoentitiesnoconv(
"Unknown");
292 if ($r->fk_statut == 1 && $r->paye == 0) {
293 $statusLabel = $langs->transnoentitiesnoconv(
"BillStatusNotPaid");
294 } elseif ($r->fk_statut == 1 && $r->paye == 1) {
295 $statusLabel = $langs->transnoentitiesnoconv(
"BillStatusStarted");
296 } elseif ($r->fk_statut == 2) {
297 $statusLabel = $langs->transnoentitiesnoconv(
"BillStatusPaid");
300 $url = DOL_URL_ROOT .
"/compta/facture/card.php?id=" . $r->rowid;
301 $refHtml =
'<a href="' . $url .
'">' . $r->ref .
'</a>';
304 $langs->transnoentitiesnoconv(
"Ref") => $refHtml,
305 $langs->transnoentitiesnoconv(
"Date") =>
dol_print_date($this->db->jdate($r->datef),
'day'),
306 $langs->transnoentitiesnoconv(
"Customer") => $r->nom,
307 $langs->transnoentitiesnoconv(
"Amount") =>
price($r->total_ttc),
308 $langs->transnoentitiesnoconv(
"Status") => $statusLabel
311 $this->db->free($resql);
317 $sanitizedSqlGroup =
'';
319 $sqlJoin =
" LEFT JOIN " . MAIN_DB_PREFIX .
"societe as s ON f.fk_soc = s.rowid";
321 if ($groupBy ===
'month') {
322 $sanitizedSqlGroup =
"DATE_FORMAT(f.datef, '%Y-%m')";
323 $colName = $langs->transnoentitiesnoconv(
"Month");
324 } elseif ($groupBy ===
'product') {
326 $sanitizedSqlGroup =
"COALESCE(p.ref, fd.description, '?')";
327 $colName = $langs->transnoentitiesnoconv(
"Product");
328 $sqlJoin .=
" INNER JOIN " . MAIN_DB_PREFIX .
"facturedet as fd ON fd.fk_facture = f.rowid LEFT JOIN "
329 . MAIN_DB_PREFIX .
"product as p ON fd.fk_product = p.rowid";
332 $sanitizedSqlGroup =
"s.nom";
333 $colName = $langs->transnoentitiesnoconv(
"Customer");
338 $amountExpr = ($groupBy ===
'product') ?
"SUM(fd.total_ttc)" :
"SUM(f.total_ttc)";
339 $countExpr = ($groupBy ===
'product') ?
"COUNT(DISTINCT f.rowid)" :
"COUNT(f.rowid)";
341 $sql =
"SELECT " . $sanitizedSqlGroup .
" as group_key, "
342 . $amountExpr .
" as total_amount, "
343 . $countExpr .
" as count_inv FROM "
344 . MAIN_DB_PREFIX .
"facture as f"
346 .
" WHERE f.entity IN (" .
getEntity(
'facture') .
")"
348 .
" GROUP BY group_key ORDER BY total_amount DESC LIMIT "
349 . ((int) max(1, $limit));
351 $resql = $this->db->query($sql);
353 while ($r = $this->db->fetch_object($resql)) {
354 $totalSum += (float) $r->total_amount;
356 $colName => $r->group_key ? $r->group_key : $langs->transnoentitiesnoconv(
'Unknown'),
357 $langs->transnoentitiesnoconv(
"Number") => (int) $r->count_inv,
358 $langs->transnoentitiesnoconv(
"Amount") =>
price($r->total_amount)
361 $this->db->free($resql);
366 return [[$langs->transnoentitiesnoconv(
"Info") => $langs->transnoentitiesnoconv(
"NoRecordFound")]];
372 $langs->transnoentitiesnoconv(
"Ref") => $langs->transnoentitiesnoconv(
"Total"),
373 $langs->transnoentitiesnoconv(
"Date") =>
"",
374 $langs->transnoentitiesnoconv(
"Customer") =>
"",
375 $langs->transnoentitiesnoconv(
"Amount") =>
price($totalSum),
376 $langs->transnoentitiesnoconv(
"Status") =>
""
380 $langs->transnoentitiesnoconv(
"Total") => $langs->transnoentitiesnoconv(
"Total"),
381 $langs->transnoentitiesnoconv(
"Amount") =>
price($totalSum)
398 $langs->loadLangs(array(
"main",
"bills",
"orders",
"propal"));
402 $type = isset($args[
'transaction_type']) ? (string) $args[
'transaction_type'] :
'all';
406 $langs->load(
"errors");
407 return [[$langs->transnoentitiesnoconv(
"Error") => $langs->transnoentitiesnoconv(
"ErrorThirdPartyNotFound")]];
413 if ($type ==
'all' || $type ==
'invoices') {
414 $sqlQueries[] =
"SELECT 'Invoice' as source_type, rowid, ref, total_ttc as amount, datef as date_entry, fk_statut
415 FROM " . MAIN_DB_PREFIX .
"facture
416 WHERE fk_soc = " . (int) $socid .
" AND entity IN (" .
getEntity(
'facture') .
")
417 AND fk_statut IN (1, 2)";
421 if ($type ==
'all' || $type ==
'orders') {
422 $sqlQueries[] =
"SELECT 'Order' as source_type, rowid, ref, total_ttc as amount, date_commande as date_entry, fk_statut
423 FROM " . MAIN_DB_PREFIX .
"commande
424 WHERE fk_soc = " . (int) $socid .
" AND entity IN (" .
getEntity(
'commande') .
")
429 if ($type ==
'all' || $type ==
'proposals') {
430 $sqlQueries[] =
"SELECT 'Proposal' as source_type, rowid, ref, total_ttc as amount, datep as date_entry, fk_statut
431 FROM " . MAIN_DB_PREFIX .
"propal
432 WHERE fk_soc = " . (int) $socid .
" AND entity IN (" .
getEntity(
'propal') .
")
436 if (empty($sqlQueries)) {
437 return [[$langs->transnoentitiesnoconv(
"Error") =>
"Invalid transaction type"]];
440 $sql =
"SELECT * FROM (";
441 $sql .= implode(
" UNION ", $sqlQueries);
442 $sql .=
") as combined_transactions ";
444 if ($dateStart > 0) {
445 $whereParts[] =
"date_entry >= '" . $this->db->idate($dateStart) .
"'";
448 $whereParts[] =
"date_entry <= '" . $this->db->idate($dateEnd) .
"'";
451 if (!empty($whereParts)) {
452 $sql .=
" WHERE " . implode(
" AND ", $whereParts);
455 $sql .=
" ORDER BY date_entry DESC";
457 $resql = $this->db->query($sql);
462 while ($r = $this->db->fetch_object($resql)) {
463 $totalAmt += (float) $r->amount;
468 if ($r->source_type ===
'Invoice') {
469 $urlPath =
"/compta/facture/card.php?id=" . $r->rowid;
470 if ($r->fk_statut == 2) {
471 $statusTxt = $langs->transnoentitiesnoconv(
"BillStatusPaid");
472 } elseif ($r->fk_statut == 1) {
473 $statusTxt = $langs->transnoentitiesnoconv(
"BillStatusNotPaid");
475 } elseif ($r->source_type ===
'Order') {
476 $urlPath =
"/commande/card.php?id=" . $r->rowid;
477 if ($r->fk_statut == 1) {
478 $statusTxt = $langs->transnoentitiesnoconv(
"StatusOrderValidated");
479 } elseif ($r->fk_statut == 2) {
480 $statusTxt = $langs->transnoentitiesnoconv(
"StatusOrderOnProcess");
481 } elseif ($r->fk_statut == 3) {
482 $statusTxt = $langs->transnoentitiesnoconv(
"StatusOrderDelivered");
484 } elseif ($r->source_type ===
'Proposal') {
485 $urlPath =
"/comm/propal/card.php?id=" . $r->rowid;
486 if ($r->fk_statut == 1) {
487 $statusTxt = $langs->transnoentitiesnoconv(
"PropalStatusValidated");
488 } elseif ($r->fk_statut == 2) {
489 $statusTxt = $langs->transnoentitiesnoconv(
"PropalStatusSigned");
490 } elseif ($r->fk_statut == 3) {
491 $statusTxt = $langs->transnoentitiesnoconv(
"PropalStatusNotSigned");
492 } elseif ($r->fk_statut == 4) {
493 $statusTxt = $langs->transnoentitiesnoconv(
"PropalStatusBilled");
497 $fullUrl = $urlPath ? DOL_URL_ROOT . $urlPath :
"";
498 $refHtml = $fullUrl ?
'<a href="' . $fullUrl .
'">' . $r->ref .
'</a>' : $r->ref;
501 $langs->transnoentitiesnoconv(
"Type") => $langs->transnoentitiesnoconv($r->source_type),
502 $langs->transnoentitiesnoconv(
"Ref") => $refHtml,
503 $langs->transnoentitiesnoconv(
"Date") =>
dol_print_date($this->db->jdate($r->date_entry),
'day'),
504 $langs->transnoentitiesnoconv(
"Amount") =>
price($r->amount),
505 $langs->transnoentitiesnoconv(
"Status") => $statusTxt
508 $this->db->free($resql);
512 return [[$langs->transnoentitiesnoconv(
"Info") => $langs->transnoentitiesnoconv(
"NoRecordFound")]];
517 $langs->transnoentitiesnoconv(
"Type") => $langs->transnoentitiesnoconv(
"Total"),
518 $langs->transnoentitiesnoconv(
"Ref") =>
"",
519 $langs->transnoentitiesnoconv(
"Date") =>
"",
520 $langs->transnoentitiesnoconv(
"Amount") =>
price($totalAmt),
521 $langs->transnoentitiesnoconv(
"Status") =>
""
537 $langs->loadLangs(array(
"main",
"bills",
"companies"));
540 $groupBy = isset($args[
'group_by']) ? (string) $args[
'group_by'] :
'supplier';
548 $sql =
"SELECT f.rowid, f.ref, f.total_ttc, f.datef, s.nom
549 FROM " . MAIN_DB_PREFIX .
"facture_fourn as f
550 LEFT JOIN " . MAIN_DB_PREFIX .
"societe as s ON f.fk_soc = s.rowid
551 WHERE f.entity IN (" .
getEntity(
'facture_fourn') .
")
552 AND f.fk_soc = " . (int) $socid .
"
553 AND f.datef >= '" . $this->db->idate($dateStart) .
"'
554 AND f.datef <= '" . $this->db->idate($dateEnd) .
"'
556 ORDER BY f.datef DESC";
558 $resql = $this->db->query($sql);
560 while ($r = $this->db->fetch_object($resql)) {
561 $totalSum += (float) $r->total_ttc;
563 $url = DOL_URL_ROOT .
"/fourn/facture/card.php?id=" . $r->rowid;
564 $refHtml =
'<a href="' . $url .
'">' . $r->ref .
'</a>';
567 $langs->transnoentitiesnoconv(
"Ref") => $refHtml,
568 $langs->transnoentitiesnoconv(
"Date") =>
dol_print_date($this->db->jdate($r->datef),
'day'),
569 $langs->transnoentitiesnoconv(
"Supplier") => $r->nom,
570 $langs->transnoentitiesnoconv(
"Amount") =>
price($r->total_ttc)
573 $this->db->free($resql);
576 $sanitizedSqlGroup =
"";
579 if ($groupBy ===
'month') {
580 $sanitizedSqlGroup =
"DATE_FORMAT(f.datef, '%Y-%m')";
581 $colName = $langs->transnoentitiesnoconv(
"Month");
583 $sanitizedSqlGroup =
"s.nom";
584 $colName = $langs->transnoentitiesnoconv(
"Supplier");
587 $sql =
"SELECT " . $sanitizedSqlGroup .
" as group_key, SUM(f.total_ttc) as total_amount, COUNT(f.rowid) as count_inv
588 FROM " . MAIN_DB_PREFIX .
"facture_fourn as f
589 LEFT JOIN " . MAIN_DB_PREFIX .
"societe as s ON f.fk_soc = s.rowid
590 WHERE f.entity IN (" .
getEntity(
'facture_fourn') .
")
591 AND f.datef >= '" . $this->db->idate($dateStart) .
"'
592 AND f.datef <= '" . $this->db->idate($dateEnd) .
"'
595 ORDER BY total_amount DESC";
597 $resql = $this->db->query($sql);
599 while ($r = $this->db->fetch_object($resql)) {
600 $totalSum += (float) $r->total_amount;
602 $colName => $r->group_key ? $r->group_key : $langs->transnoentitiesnoconv(
'Unknown'),
603 $langs->transnoentitiesnoconv(
"Number") => $r->count_inv,
604 $langs->transnoentitiesnoconv(
"Amount") =>
price($r->total_amount)
607 $this->db->free($resql);
612 return [[$langs->transnoentitiesnoconv(
"Info") => $langs->transnoentitiesnoconv(
"NoRecordFound")]];
617 $langs->transnoentitiesnoconv(
"Amount") =>
price($totalSum)
621 $summary[$langs->transnoentitiesnoconv(
"Ref")] = $langs->transnoentitiesnoconv(
"Total");
622 $summary[$langs->transnoentitiesnoconv(
"Date")] =
"";
623 $summary[$langs->transnoentitiesnoconv(
"Supplier")] =
"";
625 $summary[($groupBy ===
'month' ? $langs->transnoentitiesnoconv(
"Month") : $langs->transnoentitiesnoconv(
"Supplier"))] = $langs->transnoentitiesnoconv(
"Total");
626 $summary[$langs->transnoentitiesnoconv(
"Number")] =
"";
643 $langs->loadLangs(array(
"products",
"stocks"));
645 $catId = isset($args[
'category_id']) ? (int) $args[
'category_id'] : 0;
646 $warehouseId = isset($args[
'warehouse_id']) ? (int) $args[
'warehouse_id'] : 0;
647 $includeZero = isset($args[
'include_zero_stock']) ? (bool) $args[
'include_zero_stock'] :
false;
649 $sql =
"SELECT p.rowid, p.ref, p.label, p.pmp, ";
651 if ($warehouseId > 0) {
652 $sql .=
" ps.reel as stock_level ";
653 $sql .=
" FROM " . MAIN_DB_PREFIX .
"product as p ";
654 $sql .=
" LEFT JOIN " . MAIN_DB_PREFIX .
"product_stock as ps ON p.rowid = ps.fk_product ";
655 $sql .=
" WHERE ps.fk_entrepot = " . (int) $warehouseId;
657 $sql .=
" p.stock as stock_level ";
658 $sql .=
" FROM " . MAIN_DB_PREFIX .
"product as p ";
659 $sql .=
" WHERE 1=1 ";
662 $sql .=
" AND p.entity IN (" .
getEntity(
'product') .
")";
665 $sql .=
" AND p.rowid IN (SELECT fk_product FROM " . MAIN_DB_PREFIX .
"categorie_product WHERE fk_categorie = " . (int) $catId .
")";
669 if ($warehouseId > 0) {
670 $sql .=
" AND ps.reel > 0";
672 $sql .=
" AND p.stock > 0";
676 $sql .=
" ORDER BY p.ref ASC LIMIT 200";
678 $resql = $this->db->query($sql);
680 $totalValuation = 0.0;
684 while ($r = $this->db->fetch_object($resql)) {
685 $stockVal = $r->stock_level * $r->pmp;
686 $totalValuation += $stockVal;
687 $totalItems += (int) $r->stock_level;
689 $url = DOL_URL_ROOT .
"/product/card.php?id=" . $r->rowid;
690 $refHtml =
'<a href="' . $url .
'">' . $r->ref .
'</a>';
693 $langs->transnoentitiesnoconv(
"Ref") => $refHtml,
694 $langs->transnoentitiesnoconv(
"Label") => $r->label,
695 $langs->transnoentitiesnoconv(
"Stock") => $r->stock_level,
696 $langs->transnoentitiesnoconv(
"PMPValue") =>
price($r->pmp),
697 $langs->transnoentitiesnoconv(
"TotalValue") =>
price($stockVal)
700 $this->db->free($resql);
704 return [[$langs->transnoentitiesnoconv(
"Info") => $langs->transnoentitiesnoconv(
"NoRecordFound")]];
708 $langs->transnoentitiesnoconv(
"Ref") => $langs->transnoentitiesnoconv(
"Total"),
709 $langs->transnoentitiesnoconv(
"Label") =>
"",
710 $langs->transnoentitiesnoconv(
"Stock") => $totalItems,
711 $langs->transnoentitiesnoconv(
"PMPValue") =>
"",
712 $langs->transnoentitiesnoconv(
"TotalValue") =>
price($totalValuation)
728 $langs->loadLangs(array(
"compta",
"bills"));
733 $sqlIncome =
"SELECT SUM(total_ttc) as total FROM " . MAIN_DB_PREFIX .
"facture
734 WHERE entity IN (" .
getEntity(
'facture') .
")
735 AND datef >= '" . $this->db->idate($dateStart) .
"'
736 AND datef <= '" . $this->db->idate($dateEnd) .
"'
737 AND fk_statut IN (1, 2)";
739 $resIncome = $this->db->query($sqlIncome);
740 $objIncome = $this->db->fetch_object($resIncome);
741 $income = $objIncome && $objIncome->total ? (float) $objIncome->total : 0.0;
744 $sqlExpense =
"SELECT SUM(total_ttc) as total FROM " . MAIN_DB_PREFIX .
"facture_fourn
745 WHERE entity IN (" .
getEntity(
'facture_fourn') .
")
746 AND datef >= '" . $this->db->idate($dateStart) .
"'
747 AND datef <= '" . $this->db->idate($dateEnd) .
"'
750 $resExpense = $this->db->query($sqlExpense);
751 $objExpense = $this->db->fetch_object($resExpense);
752 $expense = $objExpense && $objExpense->total ? (float) $objExpense->total : 0.0;
754 $net = $income - $expense;
758 $langs->transnoentitiesnoconv(
"Category") => $langs->transnoentitiesnoconv(
"Income"),
759 $langs->transnoentitiesnoconv(
"Description") => $langs->transnoentitiesnoconv(
"BillsCustomers"),
760 $langs->transnoentitiesnoconv(
"Amount") =>
price($income)
763 $langs->transnoentitiesnoconv(
"Category") => $langs->transnoentitiesnoconv(
"Expenses"),
764 $langs->transnoentitiesnoconv(
"Description") => $langs->transnoentitiesnoconv(
"BillsSuppliers"),
765 $langs->transnoentitiesnoconv(
"Amount") =>
price($expense)
768 $langs->transnoentitiesnoconv(
"Category") => $langs->transnoentitiesnoconv(
"Total"),
769 $langs->transnoentitiesnoconv(
"Description") => $langs->transnoentitiesnoconv(
"Profit"),
770 $langs->transnoentitiesnoconv(
"Amount") =>
price($net)
Class to manage Dolibarr database access.
dol_stringtotime($string, $gm=1, $processnotimeasnoon=0)
Convert a string date into a GM Timestamps date Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not s...
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=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
conf($dolibarr_main_document_root, $realpathconf=null)
Load conf file (file must exists)
$conf db user
Active Directory does not allow anonymous connections.