cabyprodserv.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. <?php
  2. /* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
  3. * Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
  5. * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
  6. * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. */
  21. /**
  22. * \file htdocs/compta/stats/cabyprodserv.php
  23. * \brief Page reporting TO by Products & Services
  24. */
  25. // Load Dolibarr environment
  26. require '../../main.inc.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
  29. require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
  30. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
  31. require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
  32. // Load translation files required by the page
  33. $langs->loadLangs(array("products", "categories", "errors", 'accountancy'));
  34. // Security pack (data & check)
  35. $socid = GETPOST('socid', 'int');
  36. if ($user->socid > 0) {
  37. $socid = $user->socid;
  38. }
  39. if (isModEnabled('comptabilite')) {
  40. $result = restrictedArea($user, 'compta', '', '', 'resultat');
  41. }
  42. if (isModEnabled('accounting')) {
  43. $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
  44. }
  45. // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
  46. $modecompta = $conf->global->ACCOUNTING_MODE;
  47. if (GETPOST("modecompta")) {
  48. $modecompta = GETPOST("modecompta");
  49. }
  50. $sortorder = GETPOST("sortorder", 'aZ09comma');
  51. $sortfield = GETPOST("sortfield", 'aZ09comma');
  52. if (!$sortorder) {
  53. $sortorder = "asc";
  54. }
  55. if (!$sortfield) {
  56. $sortfield = "ref";
  57. }
  58. // Category
  59. $selected_cat = (int) GETPOST('search_categ', 'int');
  60. $selected_soc = (int) GETPOST('search_soc', 'int');
  61. $subcat = false;
  62. if (GETPOST('subcat', 'alpha') === 'yes') {
  63. $subcat = true;
  64. }
  65. $categorie = new Categorie($db);
  66. // product/service
  67. $selected_type = GETPOST('search_type', 'int');
  68. if ($selected_type == '') {
  69. $selected_type = -1;
  70. }
  71. // Hook
  72. $hookmanager->initHooks(array('cabyprodservlist'));
  73. // Date range
  74. $year = GETPOST("year");
  75. $month = GETPOST("month");
  76. $date_startyear = GETPOST("date_startyear");
  77. $date_startmonth = GETPOST("date_startmonth");
  78. $date_startday = GETPOST("date_startday");
  79. $date_endyear = GETPOST("date_endyear");
  80. $date_endmonth = GETPOST("date_endmonth");
  81. $date_endday = GETPOST("date_endday");
  82. if (empty($year)) {
  83. $year_current = dol_print_date(dol_now(), '%Y');
  84. $month_current = dol_print_date(dol_now(), '%m');
  85. $year_start = $year_current;
  86. } else {
  87. $year_current = $year;
  88. $month_current = dol_print_date(dol_now(), '%m');
  89. $year_start = $year;
  90. }
  91. $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
  92. $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
  93. // Quarter
  94. if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
  95. $q = GETPOST("q", "int");
  96. if (empty($q)) {
  97. // We define date_start and date_end
  98. $month_start = GETPOST("month") ?GETPOST("month") : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
  99. $year_end = $year_start;
  100. $month_end = $month_start;
  101. if (!GETPOST("month")) { // If month not forced
  102. if (!GETPOST('year') && $month_start > $month_current) {
  103. $year_start--;
  104. $year_end--;
  105. }
  106. $month_end = $month_start - 1;
  107. if ($month_end < 1) {
  108. $month_end = 12;
  109. } else {
  110. $year_end++;
  111. }
  112. }
  113. $date_start = dol_get_first_day($year_start, $month_start, false);
  114. $date_end = dol_get_last_day($year_end, $month_end, false);
  115. } else {
  116. if ($q == 1) {
  117. $date_start = dol_get_first_day($year_start, 1, false);
  118. $date_end = dol_get_last_day($year_start, 3, false);
  119. }
  120. if ($q == 2) {
  121. $date_start = dol_get_first_day($year_start, 4, false);
  122. $date_end = dol_get_last_day($year_start, 6, false);
  123. }
  124. if ($q == 3) {
  125. $date_start = dol_get_first_day($year_start, 7, false);
  126. $date_end = dol_get_last_day($year_start, 9, false);
  127. }
  128. if ($q == 4) {
  129. $date_start = dol_get_first_day($year_start, 10, false);
  130. $date_end = dol_get_last_day($year_start, 12, false);
  131. }
  132. }
  133. } else {
  134. // TODO We define q
  135. }
  136. // $date_start and $date_end are defined. We force $year_start and $nbofyear
  137. $tmps = dol_getdate($date_start);
  138. $year_start = $tmps['year'];
  139. $tmpe = dol_getdate($date_end);
  140. $year_end = $tmpe['year'];
  141. $nbofyear = ($year_end - $year_start) + 1;
  142. $commonparams = array();
  143. if (!empty($modecompta)) {
  144. $commonparams['modecompta'] = $modecompta;
  145. }
  146. if (!empty($sortorder)) {
  147. $commonparams['sortorder'] = $sortorder;
  148. }
  149. if (!empty($sortfield)) {
  150. $commonparams['sortfield'] = $sortfield;
  151. }
  152. $headerparams = array();
  153. if (!empty($date_startyear)) {
  154. $headerparams['date_startyear'] = $date_startyear;
  155. }
  156. if (!empty($date_startmonth)) {
  157. $headerparams['date_startmonth'] = $date_startmonth;
  158. }
  159. if (!empty($date_startday)) {
  160. $headerparams['date_startday'] = $date_startday;
  161. }
  162. if (!empty($date_endyear)) {
  163. $headerparams['date_endyear'] = $date_endyear;
  164. }
  165. if (!empty($date_endmonth)) {
  166. $headerparams['date_endmonth'] = $date_endmonth;
  167. }
  168. if (!empty($date_endday)) {
  169. $headerparams['date_endday'] = $date_endday;
  170. }
  171. if (!empty($year)) {
  172. $headerparams['year'] = $year;
  173. }
  174. if (!empty($month)) {
  175. $headerparams['month'] = $month;
  176. }
  177. if (!empty($q)) {
  178. $headerparams['q'] = $q;
  179. }
  180. $tableparams = array();
  181. if (!empty($selected_cat)) {
  182. $tableparams['search_categ'] = $selected_cat;
  183. }
  184. if (!empty($selected_soc)) {
  185. $tableparams['search_soc'] = $selected_soc;
  186. }
  187. if (!empty($selected_type)) {
  188. $tableparams['search_type'] = $selected_type;
  189. }
  190. $tableparams['subcat'] = ($subcat === true) ? 'yes' : '';
  191. // Adding common parameters
  192. $allparams = array_merge($commonparams, $headerparams, $tableparams);
  193. $headerparams = array_merge($commonparams, $headerparams);
  194. $tableparams = array_merge($commonparams, $tableparams);
  195. $paramslink="";
  196. foreach ($allparams as $key => $value) {
  197. $paramslink .= '&'.$key.'='.$value;
  198. }
  199. /*
  200. * View
  201. */
  202. llxHeader();
  203. $form = new Form($db);
  204. $formother = new FormOther($db);
  205. // TODO Report from bookkeeping not yet available, so we switch on report on business events
  206. if ($modecompta == "BOOKKEEPING") {
  207. $modecompta = "CREANCES-DETTES";
  208. }
  209. if ($modecompta == "BOOKKEEPINGCOLLECTED") {
  210. $modecompta = "RECETTES-DEPENSES";
  211. }
  212. $exportlink="";
  213. $namelink="";
  214. // Show report header
  215. if ($modecompta == "CREANCES-DETTES") {
  216. $name = $langs->trans("Turnover").', '.$langs->trans("ByProductsAndServices");
  217. $calcmode = $langs->trans("CalcModeDebt");
  218. //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
  219. $description = $langs->trans("RulesCADue");
  220. if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
  221. $description .= $langs->trans("DepositsAreNotIncluded");
  222. } else {
  223. $description .= $langs->trans("DepositsAreIncluded");
  224. }
  225. $builddate = dol_now();
  226. } elseif ($modecompta == "RECETTES-DEPENSES") {
  227. $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByProductsAndServices");
  228. $calcmode = $langs->trans("CalcModeEngagement");
  229. //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
  230. $description = $langs->trans("RulesCAIn");
  231. $description .= $langs->trans("DepositsAreIncluded");
  232. $builddate = dol_now();
  233. } elseif ($modecompta == "BOOKKEEPING") {
  234. } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
  235. }
  236. $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
  237. $period .= ' - ';
  238. $period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
  239. if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
  240. $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>';
  241. } else {
  242. $periodlink = '';
  243. }
  244. report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode);
  245. if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
  246. print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
  247. }
  248. $name = array();
  249. // SQL request
  250. $catotal = 0;
  251. $catotal_ht = 0;
  252. $qtytotal = 0;
  253. if ($modecompta == 'CREANCES-DETTES') {
  254. $sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label, p.fk_product_type as product_type,";
  255. $sql .= " SUM(l.total_ht) as amount, SUM(l.total_ttc) as amount_ttc,";
  256. $sql .= " SUM(CASE WHEN f.type = 2 THEN -l.qty ELSE l.qty END) as qty";
  257. $parameters = array();
  258. $hookmanager->executeHooks('printFieldListSelect', $parameters);
  259. $sql .= $hookmanager->resPrint;
  260. $sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
  261. if ($selected_soc > 0) {
  262. $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc ON (soc.rowid = f.fk_soc)";
  263. }
  264. $sql .= ",".MAIN_DB_PREFIX."facturedet as l";
  265. $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid";
  266. if ($selected_cat === -2) { // Without any category
  267. $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";
  268. }
  269. $parameters = array();
  270. $hookmanager->executeHooks('printFieldListFrom', $parameters);
  271. $sql .= $hookmanager->resPrint;
  272. $sql .= " WHERE l.fk_facture = f.rowid";
  273. $sql .= " AND f.fk_statut in (1,2)";
  274. $sql .= " AND l.product_type in (0,1)";
  275. if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
  276. $sql .= " AND f.type IN (0,1,2,5)";
  277. } else {
  278. $sql .= " AND f.type IN (0,1,2,3,5)";
  279. }
  280. if ($date_start && $date_end) {
  281. $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
  282. }
  283. if ($selected_type >= 0) {
  284. $sql .= " AND l.product_type = ".((int) $selected_type);
  285. }
  286. if ($selected_cat === -2) { // Without any category
  287. $sql .= " AND cp.fk_product is null";
  288. } elseif ($selected_cat > 0) { // Into a specific category
  289. if ($subcat) {
  290. $TListOfCats = $categorie->get_full_arbo('product', $selected_cat, 1);
  291. $listofcatsql = "";
  292. foreach ($TListOfCats as $key => $cat) {
  293. if ($key !== 0) {
  294. $listofcatsql .= ",";
  295. }
  296. $listofcatsql .= $cat['rowid'];
  297. }
  298. }
  299. $sql .= " AND (p.rowid IN ";
  300. $sql .= " (SELECT fk_product FROM ".MAIN_DB_PREFIX."categorie_product cp WHERE ";
  301. if ($subcat) {
  302. $sql .= "cp.fk_categorie IN (".$db->sanitize($listofcatsql).")";
  303. } else {
  304. $sql .= "cp.fk_categorie = ".((int) $selected_cat);
  305. }
  306. $sql .= "))";
  307. }
  308. if ($selected_soc > 0) {
  309. $sql .= " AND soc.rowid=".((int) $selected_soc);
  310. }
  311. $sql .= " AND f.entity IN (".getEntity('invoice').")";
  312. $parameters = array();
  313. $hookmanager->executeHooks('printFieldListWhere', $parameters);
  314. $sql .= $hookmanager->resPrint;
  315. $sql .= " GROUP BY p.rowid, p.ref, p.label, p.fk_product_type";
  316. $sql .= $db->order($sortfield, $sortorder);
  317. dol_syslog("cabyprodserv", LOG_DEBUG);
  318. $result = $db->query($sql);
  319. if ($result) {
  320. $num = $db->num_rows($result);
  321. $i = 0;
  322. while ($i < $num) {
  323. $obj = $db->fetch_object($result);
  324. $amount_ht[$obj->rowid] = $obj->amount;
  325. $amount[$obj->rowid] = $obj->amount_ttc;
  326. $qty[$obj->rowid] = $obj->qty;
  327. $name[$obj->rowid] = $obj->ref.'&nbsp;-&nbsp;'.$obj->label;
  328. $type[$obj->rowid] = $obj->product_type;
  329. $catotal_ht += $obj->amount;
  330. $catotal += $obj->amount_ttc;
  331. $qtytotal += $obj->qty;
  332. $i++;
  333. }
  334. } else {
  335. dol_print_error($db);
  336. }
  337. // Show Array
  338. $i = 0;
  339. print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
  340. print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
  341. // Extra parameters management
  342. foreach ($headerparams as $key => $value) {
  343. print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
  344. }
  345. $moreforfilter = '';
  346. print '<div class="div-table-responsive">';
  347. print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
  348. // Category filter
  349. print '<tr class="liste_titre">';
  350. print '<td>';
  351. print img_picto('', 'category', 'class="paddingrightonly"');
  352. print $formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', 0, $langs->trans("Category"));
  353. print ' ';
  354. print $langs->trans("SubCats").'? ';
  355. print '<input type="checkbox" name="subcat" value="yes"';
  356. if ($subcat) {
  357. print ' checked';
  358. }
  359. print '>';
  360. // type filter (produit/service)
  361. print ' ';
  362. print $langs->trans("Type").': ';
  363. $form->select_type_of_lines(isset($selected_type) ? $selected_type : -1, 'search_type', 1, 1, 1);
  364. //select thirdparty
  365. print '</br>';
  366. print img_picto('', 'company', 'class="paddingrightonly"');
  367. print $form->select_thirdparty_list($selected_soc, 'search_soc', '', $langs->trans("ThirdParty"));
  368. print '</td>';
  369. print '<td colspan="5" class="right">';
  370. print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
  371. $parameters = array();
  372. $reshook = $hookmanager->executeHooks('printFieldListeTitle', $parameters);
  373. print $hookmanager->resPrint;
  374. print '</td></tr>';
  375. // Array header
  376. print "<tr class=\"liste_titre\">";
  377. print_liste_field_titre(
  378. $langs->trans("Product"),
  379. $_SERVER["PHP_SELF"],
  380. "ref",
  381. "",
  382. $paramslink,
  383. "",
  384. $sortfield,
  385. $sortorder
  386. );
  387. print_liste_field_titre(
  388. $langs->trans('Quantity'),
  389. $_SERVER["PHP_SELF"],
  390. "qty",
  391. "",
  392. $paramslink,
  393. 'class="right"',
  394. $sortfield,
  395. $sortorder
  396. );
  397. print_liste_field_titre(
  398. $langs->trans("Percentage"),
  399. $_SERVER["PHP_SELF"],
  400. "qty",
  401. "",
  402. $paramslink,
  403. 'class="right"',
  404. $sortfield,
  405. $sortorder
  406. );
  407. print_liste_field_titre(
  408. $langs->trans('AmountHT'),
  409. $_SERVER["PHP_SELF"],
  410. "amount",
  411. "",
  412. $paramslink,
  413. 'class="right"',
  414. $sortfield,
  415. $sortorder
  416. );
  417. print_liste_field_titre(
  418. $langs->trans("AmountTTC"),
  419. $_SERVER["PHP_SELF"],
  420. "amount_ttc",
  421. "",
  422. $paramslink,
  423. 'class="right"',
  424. $sortfield,
  425. $sortorder
  426. );
  427. print_liste_field_titre(
  428. $langs->trans("Percentage"),
  429. $_SERVER["PHP_SELF"],
  430. "amount_ttc",
  431. "",
  432. $paramslink,
  433. 'class="right"',
  434. $sortfield,
  435. $sortorder
  436. );
  437. print "</tr>\n";
  438. if (count($name)) {
  439. foreach ($name as $key => $value) {
  440. print '<tr class="oddeven">';
  441. // Product
  442. print "<td>";
  443. $fullname = $name[$key];
  444. if ($key > 0) {
  445. $linkname = '<a href="'.DOL_URL_ROOT.'/product/card.php?id='.$key.'">'.img_object($langs->trans("ShowProduct"), $type[$key] == 0 ? 'product' : 'service').' '.$fullname.'</a>';
  446. } else {
  447. $linkname = $langs->trans("PaymentsNotLinkedToProduct");
  448. }
  449. print $linkname;
  450. print "</td>\n";
  451. // Quantity
  452. print '<td class="right">';
  453. print $qty[$key];
  454. print '</td>';
  455. // Percent;
  456. print '<td class="right">'.($qtytotal > 0 ? round(100 * $qty[$key] / $qtytotal, 2).'%' : '&nbsp;').'</td>';
  457. // Amount w/o VAT
  458. print '<td class="right">';
  459. /*if ($key > 0) {
  460. print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?productid='.$key.'">';
  461. } else {
  462. print '<a href="#">';
  463. }*/
  464. print price($amount_ht[$key]);
  465. //print '</a>';
  466. print '</td>';
  467. // Amount with VAT
  468. print '<td class="right">';
  469. /*if ($key > 0) {
  470. print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?productid='.$key.'">';
  471. } else {
  472. print '<a href="#">';
  473. }*/
  474. print price($amount[$key]);
  475. //print '</a>';
  476. print '</td>';
  477. // Percent;
  478. print '<td class="right">'.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : '&nbsp;').'</td>';
  479. // TODO: statistics?
  480. print "</tr>\n";
  481. $i++;
  482. }
  483. // Total
  484. print '<tr class="liste_total">';
  485. print '<td>'.$langs->trans("Total").'</td>';
  486. print '<td class="right">'.$qtytotal.'</td>';
  487. print '<td class="right">100%</td>';
  488. print '<td class="right">'.price($catotal_ht).'</td>';
  489. print '<td class="right">'.price($catotal).'</td>';
  490. print '<td class="right">100%</td>';
  491. print '</tr>';
  492. $db->free($result);
  493. }
  494. print "</table>";
  495. print '</div>';
  496. print '</form>';
  497. } else {
  498. // $modecompta != 'CREANCES-DETTES'
  499. // "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an
  500. // invoice with 2 product (product A for 10 euros and product B for 20 euros), what is part of paiment for product A and part of paiment for product B ?
  501. // Because there is no way to know this, this report is not relevant.
  502. print '<br>'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant").'<br>';
  503. }
  504. // End of page
  505. llxFooter();
  506. $db->close();