dolibarr  16.0.1
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 
228 // Customers invoices
229 $elementcust = $langs->trans("CustomersInvoices");
230 $productcust = $langs->trans("ProductOrService");
231 $amountcust = $langs->trans("AmountHT");
232 
233 // Suppliers invoices
234 $elementsup = $langs->trans("SuppliersInvoices");
235 $productsup = $productcust;
236 $amountsup = $amountcust;
237 
238 // TODO Report from bookkeeping not yet available, so we switch on report on business events
239 if ($modecompta == "BOOKKEEPING") {
240  $modecompta = "CREANCES-DETTES";
241 }
242 if ($modecompta == "BOOKKEEPINGCOLLECTED") {
243  $modecompta = "RECETTES-DEPENSES";
244 }
245 
246 // Show report header
247 if ($modecompta == "CREANCES-DETTES") {
248  $name = $langs->trans("Turnover").', '.$langs->trans("ByVatRate");
249  $calcmode = $langs->trans("CalcModeDebt");
250  //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
251 
252  $description .= '<br>'.$langs->trans("RulesCADue");
253  if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
254  $description .= $langs->trans("DepositsAreNotIncluded");
255  } else {
256  $description .= $langs->trans("DepositsAreIncluded");
257  }
258 
259  $builddate = dol_now();
260 } elseif ($modecompta == "RECETTES-DEPENSES") {
261  $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByVatRate");
262  $calcmode = $langs->trans("CalcModeEngagement");
263  //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
264 
265  $description .= $langs->trans("RulesCAIn");
266  $description .= $langs->trans("DepositsAreIncluded");
267 
268  $builddate = dol_now();
269 } elseif ($modecompta == "BOOKKEEPING") {
270 } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
271 }
272 $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0);
273 $period .= ' - ';
274 $period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
275 if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
276  $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>';
277 } else {
278  $periodlink = '';
279 }
280 
281 $description .= ' <input type="hidden" name="modecompta" value="'.$modecompta.'">';
282 
283 report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
284 
285 if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
286  print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
287 }
288 
289 
290 if ($modecompta == 'CREANCES-DETTES') {
291  print '<table class="noborder centpercent">';
292  print '<tr class="liste_titre"><td width="6%" class="right">'.$langs->trans("TurnoverbyVatrate").'</td>';
293  print '<td class="left">'.$langs->trans("ProductOrService").'</td>';
294  print '<td class="left">'.$langs->trans("Country").'</td>';
295  $i = 0;
296  while ($i < 12) {
297  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
298  if ($j > 12) {
299  $j -= 12;
300  }
301  print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
302  $i++;
303  }
304  print '<td width="60" class="right"><b>'.$langs->trans("TotalHT").'</b></td></tr>';
305 
306  // Sales invoices
307  $sql = "SELECT fd.tva_tx AS vatrate,";
308  $sql .= " fd.product_type AS product_type,";
309  $sql .= " cc.code, cc.label AS country,";
310  for ($i = 1; $i <= 12; $i++) {
311  $sql .= " SUM(".$db->ifsql("MONTH(f.datef)=".$i, "fd.total_ht", "0").") AS month".str_pad($i, 2, "0", STR_PAD_LEFT).",";
312  }
313  $sql .= " SUM(fd.total_ht) as total";
314  $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
315  $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
316  $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as soc ON soc.rowid = f.fk_soc";
317  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = soc.fk_pays";
318  $sql .= " WHERE f.datef >= '".$db->idate($date_start)."'";
319  $sql .= " AND f.datef <= '".$db->idate($date_end)."'";
320  $sql .= " AND f.fk_statut in (1,2)";
321  if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
322  $sql .= " AND f.type IN (0,1,2,5)";
323  } else {
324  $sql .= " AND f.type IN (0,1,2,3,5)";
325  }
326  $sql .= " AND f.entity IN (".getEntity('invoice', 0).")";
327  $sql .= " GROUP BY fd.tva_tx,fd.product_type, cc.label, cc.code ";
328  $sql .= " ORDER BY country, product_type, vatrate";
329 
330  dol_syslog("htdocs/compta/tva/index.php", LOG_DEBUG);
331  $resql = $db->query($sql);
332  if ($resql) {
333  $num = $db->num_rows($resql);
334  $totalpermonth = array();
335  while ($obj = $db->fetch_object($resql)) {
336  print '<tr class="oddeven"><td class="right">'.vatrate($obj->vatrate).'</td>';
337  if ($obj->product_type == 0) {
338  print '<td class="left">'.$langs->trans("Product").'</td>';
339  } else {
340  print '<td class="left">'.$langs->trans("Service").'</td>';
341  }
342  // Country
343  print '<td>';
344  print $langs->trans("Country".$obj->code) != "Country".$obj->code ? $langs->trans("Country".$obj->code) : $obj->country;
345  print '</td>';
346  for ($i = 0; $i < 12; $i++) {
347  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
348  if ($j > 12) {
349  $j -= 12;
350  }
351  $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
352  print '<td class="right" width="6%">'.price($obj->$monthj).'</td>';
353  $totalpermonth[$j] = (empty($totalpermonth[$j]) ? 0 : $totalpermonth[$j]) + $obj->$monthj;
354  }
355  print '<td class="right" width="6%"><b>'.price($obj->total).'</b></td>';
356  $totalpermonth['total'] = (empty($totalpermonth['total']) ? 0 : $totalpermonth['total']) + $obj->total;
357  print '</tr>';
358  }
359  $db->free($resql);
360 
361  // Total
362  print '<tr class="liste_total"><td class="right"></td>';
363  print '<td class="left"></td>';
364  print '<td></td>';
365  for ($i = 0; $i < 12; $i++) {
366  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
367  if ($j > 12) {
368  $j -= 12;
369  }
370  $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
371  print '<td class="right" width="6%">'.price($totalpermonth[$j]).'</td>';
372  }
373  print '<td class="right" width="6%"><b>'.price($totalpermonth['total']).'</b></td>';
374  print '</tr>';
375  } else {
376  print $db->lasterror(); // Show last sql error
377  }
378 
379  print '<tr class="liste_titre"><td width="6%" class="right">'.$langs->trans("PurchasebyVatrate").'</td>';
380  print '<td class="left">'.$langs->trans("ProductOrService").'</td>';
381  print '<td class="left">'.$langs->trans("Country").'</td>';
382  $i = 0;
383  while ($i < 12) {
384  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
385  if ($j > 12) {
386  $j -= 12;
387  }
388  print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
389  $i++;
390  }
391  print '<td width="60" class="right"><b>'.$langs->trans("TotalHT").'</b></td></tr>';
392 
393  // Purchase invoices
394  $sql2 = "SELECT ffd.tva_tx AS vatrate,";
395  $sql2 .= " ffd.product_type AS product_type,";
396  $sql2 .= " cc.code, cc.label AS country,";
397  for ($i = 1; $i <= 12; $i++) {
398  $sql2 .= " SUM(".$db->ifsql("MONTH(ff.datef)=".$i, "ffd.total_ht", "0").") AS month".str_pad($i, 2, "0", STR_PAD_LEFT).",";
399  }
400  $sql2 .= " SUM(ffd.total_ht) as total";
401  $sql2 .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as ffd";
402  $sql2 .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
403  $sql2 .= " INNER JOIN ".MAIN_DB_PREFIX."societe as soc ON soc.rowid = ff.fk_soc";
404  $sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = soc.fk_pays";
405  $sql2 .= " WHERE ff.datef >= '".$db->idate($date_start)."'";
406  $sql2 .= " AND ff.datef <= '".$db->idate($date_end)."'";
407  $sql .= " AND ff.fk_statut in (1,2)";
408  if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
409  $sql .= " AND ff.type IN (0,1,2,5)";
410  } else {
411  $sql .= " AND ff.type IN (0,1,2,3,5)";
412  }
413  $sql2 .= " AND ff.entity IN (".getEntity("facture_fourn", 0).")";
414  $sql2 .= " GROUP BY ffd.tva_tx, ffd.product_type, cc.label, cc.code ";
415  $sql2 .= " ORDER BY country, product_type, vatrate";
416 
417  //print $sql2;
418  dol_syslog("htdocs/compta/tva/index.php", LOG_DEBUG);
419  $resql2 = $db->query($sql2);
420  if ($resql2) {
421  $num = $db->num_rows($resql2);
422  $totalpermonth = array();
423  while ($obj = $db->fetch_object($resql2)) {
424  print '<tr class="oddeven"><td class="right">'.vatrate($obj->vatrate).'</td>';
425  if ($obj->product_type == 0) {
426  print '<td class="left">'.$langs->trans("Product").'</td>';
427  } else {
428  print '<td class="left">'.$langs->trans("Service").'</td>';
429  }
430  print '<td>';
431  print $langs->trans("Country".$obj->code) != "Country".$obj->code ? $langs->trans("Country".$obj->code) : $obj->country;
432  print '</td>';
433  for ($i = 0; $i < 12; $i++) {
434  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
435  if ($j > 12) {
436  $j -= 12;
437  }
438  $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
439  print '<td class="right" width="6%">'.price($obj->$monthj).'</td>';
440  $totalpermonth[$j] = (empty($totalpermonth[$j]) ? 0 : $totalpermonth[$j]) + $obj->$monthj;
441  }
442  print '<td class="right" width="6%"><b>'.price($obj->total).'</b></td>';
443  $totalpermonth['total'] = (empty($totalpermonth['total']) ? 0 : $totalpermonth['total']) + $obj->total;
444  print '</tr>';
445  }
446  $db->free($resql2);
447 
448  // Total
449  print '<tr class="liste_total"><td class="right"></td>';
450  print '<td class="left"></td>';
451  print '<td></td>';
452  for ($i = 0; $i < 12; $i++) {
453  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
454  if ($j > 12) {
455  $j -= 12;
456  }
457  $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
458  print '<td class="right" width="6%">'.price($totalpermonth[$j]).'</td>';
459  }
460  print '<td class="right" width="6%"><b>'.price($totalpermonth['total']).'</b></td>';
461  print '</tr>';
462  } else {
463  print $db->lasterror(); // Show last sql error
464  }
465  print "</table>\n";
466 } else {
467  // $modecompta != 'CREANCES-DETTES'
468  // "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
469  // 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 ?
470  // Because there is no way to know this, this report is not relevant.
471  print '<br>'.$langs->trans("TurnoverPerSaleTaxRateInCommitmentAccountingNotRelevant").'<br>';
472 }
473 
474 // End of page
475 llxFooter();
476 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
Definition: card.php:142
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...
Class to manage products or services.
dol_now($mode= 'auto')
Return date for now.
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
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink= '', $moreparam=array(), $calcmode= '', $varlink= '')
Show header of a report.
Definition: report.lib.php:41
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
Class to manage suppliers invoices.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
Definition: date.lib.php:121
Class to manage generation of HTML components Only common components must be here.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form...
Class to manage third parties objects (customers, suppliers, prospects...)
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin= '1', $morecss= 'hideonsmartphone', $textfordropdown= '')
Show information for admin users or standard users.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is &#39;...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
Class to manage payments of customer invoices.
dol_getdate($timestamp, $fast=false, $forcetimezone= '')
Return an array with locale date info.
Class to manage Trips and Expenses.
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.
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
img_next($titlealt= 'default', $moreatt= '')
Show next logo.
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
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_previous($titlealt= 'default', $moreatt= '')
Show previous logo.
Class to manage payments of expense report.
isModEnabled($module)
Is Dolibarr module enabled.
Class to manage invoices.
Class to manage payments for supplier invoices.
llxFooter()
Empty footer.
Definition: wrapper.php:73