dolibarr  16.0.5
byratecountry.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
4  * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
25 require '../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
29 require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
30 require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
35 require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
37 require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.php';
38 
39 // Load translation files required by the page
40 $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin", "accountancy"));
41 
42 $modecompta = (GETPOST('modecompta', 'alpha') ? GETPOST('modecompta', 'alpha') : $conf->global->ACCOUNTING_MODE);
43 
44 // Date range
45 $year = GETPOST("year", 'int');
46 $month = GETPOST("month", 'int');
47 if (empty($year)) {
48  $year_current = dol_print_date(dol_now(), '%Y');
49  $month_current = dol_print_date(dol_now(), '%m');
50  $year_start = $year_current;
51 } else {
52  $year_current = $year;
53  $month_current = dol_print_date(dol_now(), '%m');
54  $year_start = $year;
55 }
56 $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
57 $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
58 
59 // Quarter
60 $q = '';
61 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
62  $q = GETPOST("q", "int");
63  if (empty($q)) {
64  // We define date_start and date_end
65  $month_start = GETPOST("month") ?GETPOST("month") : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
66  $year_end = $year_start;
67  $month_end = $month_start;
68  if (!GETPOST("month")) { // If month not forced
69  if (!GETPOST('year') && $month_start > $month_current) {
70  $year_start--;
71  $year_end--;
72  }
73  $month_end = $month_start - 1;
74  if ($month_end < 1) {
75  $month_end = 12;
76  } else {
77  $year_end++;
78  }
79  }
80  $date_start = dol_get_first_day($year_start, $month_start, false);
81  $date_end = dol_get_last_day($year_end, $month_end, false);
82  } else {
83  if ($q == 1) {
84  $date_start = dol_get_first_day($year_start, 1, false);
85  $date_end = dol_get_last_day($year_start, 3, false);
86  }
87  if ($q == 2) {
88  $date_start = dol_get_first_day($year_start, 4, false);
89  $date_end = dol_get_last_day($year_start, 6, false);
90  }
91  if ($q == 3) {
92  $date_start = dol_get_first_day($year_start, 7, false);
93  $date_end = dol_get_last_day($year_start, 9, false);
94  }
95  if ($q == 4) {
96  $date_start = dol_get_first_day($year_start, 10, false);
97  $date_end = dol_get_last_day($year_start, 12, false);
98  }
99  }
100 }
101 
102 // $date_start and $date_end are defined. We force $year_start and $nbofyear
103 $tmps = dol_getdate($date_start);
104 $year_start = $tmps['year'];
105 $tmpe = dol_getdate($date_end);
106 $year_end = $tmpe['year'];
107 
108 $tmp_date_end = dol_time_plus_duree($date_start, 1, 'y') - 1;
109 if ($tmp_date_end < $date_end || $date_end < $date_start) {
110  $date_end = $tmp_date_end;
111 }
112 
113 $min = price2num(GETPOST("min", "alpha"));
114 if (empty($min)) {
115  $min = 0;
116 }
117 
118 // Define modetax (0 or 1)
119 // 0=normal, 1=option vat for services is on debit, 2=option on payments for products
120 $modetax = empty($conf->global->TAX_MODE) ? 0 : $conf->global->TAX_MODE;
121 if (GETPOSTISSET("modetax")) {
122  $modetax = GETPOST("modetax", 'int');
123 }
124 if (empty($modetax)) {
125  $modetax = 0;
126 }
127 
128 // Security check
129 $socid = GETPOST('socid', 'int');
130 if ($user->socid) {
131  $socid = $user->socid;
132 }
133 $result = restrictedArea($user, 'tax', '', '', 'charges');
134 
135 
136 
137 /*
138  * View
139  */
140 
141 $form = new Form($db);
142 $company_static = new Societe($db);
143 $invoice_customer = new Facture($db);
144 $invoice_supplier = new FactureFournisseur($db);
145 $expensereport = new ExpenseReport($db);
146 $product_static = new Product($db);
147 $payment_static = new Paiement($db);
148 $paymentfourn_static = new PaiementFourn($db);
149 $paymentexpensereport_static = new PaymentExpenseReport($db);
150 
151 $morequerystring = '';
152 $listofparams = array('date_startmonth', 'date_startyear', 'date_startday', 'date_endmonth', 'date_endyear', 'date_endday');
153 foreach ($listofparams as $param) {
154  if (GETPOST($param) != '') {
155  $morequerystring .= ($morequerystring ? '&' : '').$param.'='.GETPOST($param);
156  }
157 }
158 
159 llxHeader('', $langs->trans("TurnoverReport"), '', '', 0, 0, '', '', $morequerystring);
160 
161 $exportlink="";
162 $namelink="";
163 //print load_fiche_titre($langs->trans("VAT"),"");
164 
165 //$fsearch.='<br>';
166 $fsearch = '';
167 $fsearch .= ' <input type="hidden" name="year" value="'.$year.'">';
168 $fsearch .= ' <input type="hidden" name="modetax" value="'.$modetax.'">';
169 //$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
170 //$fsearch.=' <input type="text" name="min" value="'.$min.'">';
171 
172 
173 // Show report header
174 $name = $langs->trans("xxx");
175 $calcmode = '';
176 if ($modetax == 0) {
177  $calcmode = $langs->trans('OptionVATDefault');
178 }
179 if ($modetax == 1) {
180  $calcmode = $langs->trans('OptionVATDebitOption');
181 }
182 if ($modetax == 2) {
183  $calcmode = $langs->trans('OptionPaymentForProductAndServices');
184 }
185 $calcmode .= '<br>('.$langs->trans("TaxModuleSetupToModifyRules", DOL_URL_ROOT.'/admin/taxes.php').')';
186 // Set period
187 $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
188 $period .= ' - ';
189 $period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
190 $prevyear = $year_start;
191 $prevquarter = $q;
192 if ($prevquarter > 1) {
193  $prevquarter--;
194 } else {
195  $prevquarter = 4;
196  $prevyear--;
197 }
198 $nextyear = $year_start;
199 $nextquarter = $q;
200 if ($nextquarter < 4) {
201  $nextquarter++;
202 } else {
203  $nextquarter = 1;
204  $nextyear++;
205 }
206 $description = $fsearch;
207 $builddate = dol_now();
208 
209 if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) {
210  $description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue");
211 }
212 if ($conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') {
213  $description .= '<br>'.$langs->trans("RulesVATDueProducts");
214 }
215 if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') {
216  $description .= '<br>'.$langs->trans("RulesVATInProducts");
217 }
218 if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') {
219  $description .= '<br>'.$langs->trans("RulesVATDueServices");
220 }
221 if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') {
222  $description .= '<br>'.$langs->trans("RulesVATInServices");
223 }
224 if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
225  $description .= '<br>'.$langs->trans("DepositsAreNotIncluded");
226 }
227 if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
228  $description .= $langs->trans("SupplierDepositsAreNotIncluded");
229 }
230 // Customers invoices
231 $elementcust = $langs->trans("CustomersInvoices");
232 $productcust = $langs->trans("ProductOrService");
233 $amountcust = $langs->trans("AmountHT");
234 
235 // Suppliers invoices
236 $elementsup = $langs->trans("SuppliersInvoices");
237 $productsup = $productcust;
238 $amountsup = $amountcust;
239 
240 // TODO Report from bookkeeping not yet available, so we switch on report on business events
241 if ($modecompta == "BOOKKEEPING") {
242  $modecompta = "CREANCES-DETTES";
243 }
244 if ($modecompta == "BOOKKEEPINGCOLLECTED") {
245  $modecompta = "RECETTES-DEPENSES";
246 }
247 
248 // Show report header
249 if ($modecompta == "CREANCES-DETTES") {
250  $name = $langs->trans("Turnover").', '.$langs->trans("ByVatRate");
251  $calcmode = $langs->trans("CalcModeDebt");
252  //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
253 
254  $description .= '<br>'.$langs->trans("RulesCADue");
255  if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
256  $description .= $langs->trans("DepositsAreNotIncluded");
257  } else {
258  $description .= $langs->trans("DepositsAreIncluded");
259  }
260  if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
261  $description .= $langs->trans("SupplierDepositsAreNotIncluded");
262  }
263 
264  $builddate = dol_now();
265 } elseif ($modecompta == "RECETTES-DEPENSES") {
266  $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByVatRate");
267  $calcmode = $langs->trans("CalcModeEngagement");
268  //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
269 
270  $description .= $langs->trans("RulesCAIn");
271  $description .= $langs->trans("DepositsAreIncluded");
272 
273  $builddate = dol_now();
274 } elseif ($modecompta == "BOOKKEEPING") {
275 } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
276 }
277 $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0);
278 $period .= ' - ';
279 $period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
280 if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
281  $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>';
282 } else {
283  $periodlink = '';
284 }
285 
286 $description .= ' <input type="hidden" name="modecompta" value="'.$modecompta.'">';
287 
288 report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
289 
290 if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
291  print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
292 }
293 
294 
295 if ($modecompta == 'CREANCES-DETTES') {
296  print '<table class="noborder centpercent">';
297  print '<tr class="liste_titre"><td width="6%" class="right">'.$langs->trans("TurnoverbyVatrate").'</td>';
298  print '<td class="left">'.$langs->trans("ProductOrService").'</td>';
299  print '<td class="left">'.$langs->trans("Country").'</td>';
300  $i = 0;
301  while ($i < 12) {
302  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
303  if ($j > 12) {
304  $j -= 12;
305  }
306  print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
307  $i++;
308  }
309  print '<td width="60" class="right"><b>'.$langs->trans("TotalHT").'</b></td></tr>';
310 
311  // Sales invoices
312  $sql = "SELECT fd.tva_tx AS vatrate,";
313  $sql .= " fd.product_type AS product_type,";
314  $sql .= " cc.code, cc.label AS country,";
315  for ($i = 1; $i <= 12; $i++) {
316  $sql .= " SUM(".$db->ifsql("MONTH(f.datef)=".$i, "fd.total_ht", "0").") AS month".str_pad($i, 2, "0", STR_PAD_LEFT).",";
317  }
318  $sql .= " SUM(fd.total_ht) as total";
319  $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
320  $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
321  $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as soc ON soc.rowid = f.fk_soc";
322  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = soc.fk_pays";
323  $sql .= " WHERE f.datef >= '".$db->idate($date_start)."'";
324  $sql .= " AND f.datef <= '".$db->idate($date_end)."'";
325  $sql .= " AND f.fk_statut in (1,2)";
326  if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
327  $sql .= " AND f.type IN (0,1,2,5)";
328  } else {
329  $sql .= " AND f.type IN (0,1,2,3,5)";
330  }
331  $sql .= " AND f.entity IN (".getEntity('invoice', 0).")";
332  $sql .= " GROUP BY fd.tva_tx,fd.product_type, cc.label, cc.code ";
333  $sql .= " ORDER BY country, product_type, vatrate";
334 
335  dol_syslog("htdocs/compta/tva/index.php", LOG_DEBUG);
336  $resql = $db->query($sql);
337  if ($resql) {
338  $num = $db->num_rows($resql);
339  $totalpermonth = array();
340  while ($obj = $db->fetch_object($resql)) {
341  print '<tr class="oddeven"><td class="right">'.vatrate($obj->vatrate).'</td>';
342  if ($obj->product_type == 0) {
343  print '<td class="left">'.$langs->trans("Product").'</td>';
344  } else {
345  print '<td class="left">'.$langs->trans("Service").'</td>';
346  }
347  // Country
348  print '<td>';
349  print $langs->trans("Country".$obj->code) != "Country".$obj->code ? $langs->trans("Country".$obj->code) : $obj->country;
350  print '</td>';
351  for ($i = 0; $i < 12; $i++) {
352  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
353  if ($j > 12) {
354  $j -= 12;
355  }
356  $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
357  print '<td class="right" width="6%">'.price($obj->$monthj).'</td>';
358  $totalpermonth[$j] = (empty($totalpermonth[$j]) ? 0 : $totalpermonth[$j]) + $obj->$monthj;
359  }
360  print '<td class="right" width="6%"><b>'.price($obj->total).'</b></td>';
361  $totalpermonth['total'] = (empty($totalpermonth['total']) ? 0 : $totalpermonth['total']) + $obj->total;
362  print '</tr>';
363  }
364  $db->free($resql);
365 
366  // Total
367  print '<tr class="liste_total"><td class="right"></td>';
368  print '<td class="left"></td>';
369  print '<td></td>';
370  for ($i = 0; $i < 12; $i++) {
371  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
372  if ($j > 12) {
373  $j -= 12;
374  }
375  $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
376  print '<td class="right" width="6%">'.price($totalpermonth[$j]).'</td>';
377  }
378  print '<td class="right" width="6%"><b>'.price($totalpermonth['total']).'</b></td>';
379  print '</tr>';
380  } else {
381  print $db->lasterror(); // Show last sql error
382  }
383 
384  print '<tr class="liste_titre"><td width="6%" class="right">'.$langs->trans("PurchasebyVatrate").'</td>';
385  print '<td class="left">'.$langs->trans("ProductOrService").'</td>';
386  print '<td class="left">'.$langs->trans("Country").'</td>';
387  $i = 0;
388  while ($i < 12) {
389  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
390  if ($j > 12) {
391  $j -= 12;
392  }
393  print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
394  $i++;
395  }
396  print '<td width="60" class="right"><b>'.$langs->trans("TotalHT").'</b></td></tr>';
397 
398  // Purchase invoices
399  $sql2 = "SELECT ffd.tva_tx AS vatrate,";
400  $sql2 .= " ffd.product_type AS product_type,";
401  $sql2 .= " cc.code, cc.label AS country,";
402  for ($i = 1; $i <= 12; $i++) {
403  $sql2 .= " SUM(".$db->ifsql("MONTH(ff.datef)=".$i, "ffd.total_ht", "0").") AS month".str_pad($i, 2, "0", STR_PAD_LEFT).",";
404  }
405  $sql2 .= " SUM(ffd.total_ht) as total";
406  $sql2 .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as ffd";
407  $sql2 .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
408  $sql2 .= " INNER JOIN ".MAIN_DB_PREFIX."societe as soc ON soc.rowid = ff.fk_soc";
409  $sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = soc.fk_pays";
410  $sql2 .= " WHERE ff.datef >= '".$db->idate($date_start)."'";
411  $sql2 .= " AND ff.datef <= '".$db->idate($date_end)."'";
412  $sql .= " AND ff.fk_statut in (1,2)";
413  if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
414  $sql .= " AND ff.type IN (0,1,2,5)";
415  } else {
416  $sql .= " AND ff.type IN (0,1,2,3,5)";
417  }
418  $sql2 .= " AND ff.entity IN (".getEntity("facture_fourn", 0).")";
419  $sql2 .= " GROUP BY ffd.tva_tx, ffd.product_type, cc.label, cc.code ";
420  $sql2 .= " ORDER BY country, product_type, vatrate";
421 
422  //print $sql2;
423  dol_syslog("htdocs/compta/tva/index.php", LOG_DEBUG);
424  $resql2 = $db->query($sql2);
425  if ($resql2) {
426  $num = $db->num_rows($resql2);
427  $totalpermonth = array();
428  while ($obj = $db->fetch_object($resql2)) {
429  print '<tr class="oddeven"><td class="right">'.vatrate($obj->vatrate).'</td>';
430  if ($obj->product_type == 0) {
431  print '<td class="left">'.$langs->trans("Product").'</td>';
432  } else {
433  print '<td class="left">'.$langs->trans("Service").'</td>';
434  }
435  print '<td>';
436  print $langs->trans("Country".$obj->code) != "Country".$obj->code ? $langs->trans("Country".$obj->code) : $obj->country;
437  print '</td>';
438  for ($i = 0; $i < 12; $i++) {
439  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
440  if ($j > 12) {
441  $j -= 12;
442  }
443  $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
444  print '<td class="right" width="6%">'.price($obj->$monthj).'</td>';
445  $totalpermonth[$j] = (empty($totalpermonth[$j]) ? 0 : $totalpermonth[$j]) + $obj->$monthj;
446  }
447  print '<td class="right" width="6%"><b>'.price($obj->total).'</b></td>';
448  $totalpermonth['total'] = (empty($totalpermonth['total']) ? 0 : $totalpermonth['total']) + $obj->total;
449  print '</tr>';
450  }
451  $db->free($resql2);
452 
453  // Total
454  print '<tr class="liste_total"><td class="right"></td>';
455  print '<td class="left"></td>';
456  print '<td></td>';
457  for ($i = 0; $i < 12; $i++) {
458  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
459  if ($j > 12) {
460  $j -= 12;
461  }
462  $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
463  print '<td class="right" width="6%">'.price($totalpermonth[$j]).'</td>';
464  }
465  print '<td class="right" width="6%"><b>'.price($totalpermonth['total']).'</b></td>';
466  print '</tr>';
467  } else {
468  print $db->lasterror(); // Show last sql error
469  }
470  print "</table>\n";
471 } else {
472  // $modecompta != 'CREANCES-DETTES'
473  // "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
474  // 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 ?
475  // Because there is no way to know this, this report is not relevant.
476  print '<br>'.$langs->trans("TurnoverPerSaleTaxRateInCommitmentAccountingNotRelevant").'<br>';
477 }
478 
479 // End of page
480 llxFooter();
481 $db->close();
dol_getdate
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
Definition: functions.lib.php:2713
Societe
Class to manage third parties objects (customers, suppliers, prospects...)
Definition: societe.class.php:48
restrictedArea
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
Definition: security.lib.php:234
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
FactureFournisseur
Class to manage suppliers invoices.
Definition: fournisseur.facture.class.php:53
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
Facture
Class to manage invoices.
Definition: facture.class.php:60
price2num
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
Definition: functions.lib.php:5661
dol_print_date
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Definition: functions.lib.php:2514
img_next
img_next($titlealt='default', $moreatt='')
Show next logo.
Definition: functions.lib.php:4557
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1603
PaymentExpenseReport
Class to manage payments of expense report.
Definition: paymentexpensereport.class.php:31
dol_get_first_day
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:551
dol_get_last_day
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition: date.lib.php:570
info_admin
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
Definition: functions.lib.php:4800
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition: functions.lib.php:105
PaiementFourn
Class to manage payments for supplier invoices.
Definition: paiementfourn.class.php:37
dol_time_plus_duree
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
Definition: date.lib.php:121
Paiement
Class to manage payments of customer invoices.
Definition: paiement.class.php:41
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:386
Product
Class to manage products or services.
Definition: product.class.php:46
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
ExpenseReport
Class to manage Trips and Expenses.
Definition: expensereport.class.php:36
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2845
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
dol_mktime
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...
Definition: functions.lib.php:2757
img_previous
img_previous($titlealt='default', $moreatt='')
Show previous logo.
Definition: functions.lib.php:4576
report_header
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='')
Show header of a report.
Definition: report.lib.php:41
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59