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