dolibarr  9.0.0
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 <http://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');
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  }
81  else
82  {
83  if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); }
84  if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); }
85  if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); }
86  if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
87  }
88 }
89 
90 // $date_start and $date_end are defined. We force $year_start and $nbofyear
91 $tmps=dol_getdate($date_start);
92 $year_start = $tmps['year'];
93 $tmpe=dol_getdate($date_end);
94 $year_end = $tmpe['year'];
95 
96 $tmp_date_end = dol_time_plus_duree($date_start, 1, 'y') - 1;
97 if ($tmp_date_end < $date_end || $date_end < $date_start) $date_end = $tmp_date_end;
98 
99 $min = price2num(GETPOST("min","alpha"));
100 if (empty($min)) $min = 0;
101 
102 // Define modetax (0 or 1)
103 // 0=normal, 1=option vat for services is on debit, 2=option on payments for products
104 $modetax = $conf->global->TAX_MODE;
105 if (GETPOSTISSET("modetax")) $modetax=GETPOST("modetax",'int');
106 if (empty($modetax)) $modetax=0;
107 
108 // Security check
109 $socid = GETPOST('socid','int');
110 if ($user->societe_id) $socid=$user->societe_id;
111 $result = restrictedArea($user, 'tax', '', '', 'charges');
112 
113 
114 
115 /*
116  * View
117  */
118 
119 $form=new Form($db);
120 $company_static=new Societe($db);
121 $invoice_customer=new Facture($db);
122 $invoice_supplier=new FactureFournisseur($db);
123 $expensereport=new ExpenseReport($db);
124 $product_static=new Product($db);
125 $payment_static=new Paiement($db);
126 $paymentfourn_static=new PaiementFourn($db);
127 $paymentexpensereport_static=new PaymentExpenseReport($db);
128 
129 $morequerystring='';
130 $listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday');
131 foreach ($listofparams as $param)
132 {
133  if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param);
134 }
135 
136 llxHeader('',$langs->trans("TurnoverReport"),'','',0,0,'','',$morequerystring);
137 
138 
139 //print load_fiche_titre($langs->trans("VAT"),"");
140 
141 //$fsearch.='<br>';
142 $fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
143 $fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
144 //$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
145 //$fsearch.=' <input type="text" name="min" value="'.$min.'">';
146 
147 
148 // Show report header
149 $name=$langs->trans("xxx");
150 $calcmode='';
151 if ($modetax == 0) $calcmode=$langs->trans('OptionVATDefault');
152 if ($modetax == 1) $calcmode=$langs->trans('OptionVATDebitOption');
153 if ($modetax == 2) $calcmode=$langs->trans('OptionPaymentForProductAndServices');
154 $calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
155 // Set period
156 $period=$form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
157 $prevyear=$year_start; $prevquarter=$q;
158 if ($prevquarter > 1) {
159  $prevquarter--;
160 } else {
161  $prevquarter=4; $prevyear--;
162 }
163 $nextyear=$year_start; $nextquarter=$q;
164 if ($nextquarter < 4) {
165  $nextquarter++;
166 } else {
167  $nextquarter=1; $nextyear++;
168 }
169 $description.=$fsearch;
170 $builddate=dol_now();
171 
172 if ($conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') $description.=$langs->trans("RulesVATDueProducts");
173 if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') $description.=$langs->trans("RulesVATInProducts");
174 if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') $description.='<br>'.$langs->trans("RulesVATDueServices");
175 if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') $description.='<br>'.$langs->trans("RulesVATInServices");
176 if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
177  $description.='<br>'.$langs->trans("DepositsAreNotIncluded");
178 }
179 if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='<br>'.$langs->trans("ThisIsAnEstimatedValue");
180 
181 // Customers invoices
182 $elementcust=$langs->trans("CustomersInvoices");
183 $productcust=$langs->trans("ProductOrService");
184 $amountcust=$langs->trans("AmountHT");
185 
186 // Suppliers invoices
187 $elementsup=$langs->trans("SuppliersInvoices");
188 $productsup=$productcust;
189 $amountsup=$amountcust;
190 $namesup=$namecust;
191 
192 
193 
194 // TODO Report from bookkeeping not yet available, so we switch on report on business events
195 if ($modecompta=="BOOKKEEPING") $modecompta="CREANCES-DETTES";
196 if ($modecompta=="BOOKKEEPINGCOLLECTED") $modecompta="RECETTES-DEPENSES";
197 
198 // Show report header
199 if ($modecompta=="CREANCES-DETTES") {
200  $name=$langs->trans("Turnover").', '.$langs->trans("ByVatRate");
201  $calcmode=$langs->trans("CalcModeDebt");
202  //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
203 
204  $description=$langs->trans("RulesCADue");
205  if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
206  $description.= $langs->trans("DepositsAreNotIncluded");
207  } else {
208  $description.= $langs->trans("DepositsAreIncluded");
209  }
210 
211  $builddate=dol_now();
212 }
213 else if ($modecompta=="RECETTES-DEPENSES")
214 {
215  $name=$langs->trans("TurnoverCollected").', '.$langs->trans("ByVatRate");
216  $calcmode=$langs->trans("CalcModeEngagement");
217  //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
218 
219  $description=$langs->trans("RulesCAIn");
220  $description.= $langs->trans("DepositsAreIncluded");
221 
222  $builddate=dol_now();
223 }
224 else if ($modecompta=="BOOKKEEPING")
225 {
226 
227 
228 }
229 else if ($modecompta=="BOOKKEEPINGCOLLECTED")
230 {
231 
232 
233 }
234 $period=$form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
235 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>';
236 else $periodlink = '';
237 
238 $description.=' <input type="hidden" name="modecompta" value="'.$modecompta.'">';
239 
240 report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode);
241 
242 if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING')
243 {
244  print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
245 }
246 
247 
248 if ($modecompta == 'CREANCES-DETTES')
249 {
250 
251 print '<table class="noborder" width="100%">';
252 print '<tr class="liste_titre"><td width="6%" class="right">' . $langs->trans("TurnoverbyVatrate") . '</td>';
253 print '<td align="left">' . $langs->trans("ProductOrService") . '</td>';
254 print '<td align="left">' . $langs->trans("Country") . '</td>';
255 $i=0;
256 while($i < 12)
257 {
258  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
259  if ($j > 12) $j -= 12;
260  print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
261  $i++;
262 }
263 print '<td width="60" align="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>';
264 
265 $sql = "SELECT fd.tva_tx AS vatrate,";
266 $sql .= " fd.product_type AS product_type,";
267 $sql .= " cc.label AS country,";
268 for ($i = 1; $i <= 12; $i ++) {
269  $sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
270 }
271 $sql .= " SUM(fd.total_ht) as total";
272 $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
273 $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
274 $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as soc ON soc.rowid = f.fk_soc";
275 $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as cc ON cc.rowid = soc.fk_pays";
276 $sql .= " WHERE f.datef >= '" . $db->idate($date_start) . "'";
277 $sql .= " AND f.datef <= '" . $db->idate($date_end) . "'";
278 $sql.= " AND f.fk_statut in (1,2)";
279 if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
280  $sql.= " AND f.type IN (0,1,2,5)";
281 } else {
282  $sql.= " AND f.type IN (0,1,2,3,5)";
283 }
284 $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")";
285 $sql .= " GROUP BY fd.tva_tx,fd.product_type, cc.label ";
286 
287 dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG);
288 $resql = $db->query($sql);
289 if ($resql) {
290  $num = $db->num_rows($resql);
291  $totalpermonth = array();
292  while ( $obj = $db->fetch_object($resql)) {
293  print '<tr class="oddeven"><td class="right">' . vatrate($obj->vatrate) . '</td>';
294  if ($obj->product_type == 0) {
295  print '<td align="left">'. $langs->trans("Product") . '</td>';
296  } else {
297  print '<td align="left">'. $langs->trans("Service") . '</td>';
298  }
299  print '<td>' .$obj->country . '</td>';
300  for($i = 0; $i < 12; $i++) {
301  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
302  if ($j > 12) $j -= 12;
303  $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
304  print '<td align="right" width="6%">' . price($obj->$monthj) . '</td>';
305  $totalpermonth[$j]=(empty($totalpermonth[$j])?0:$totalpermonth[$j])+$obj->$monthj;
306  }
307  print '<td align="right" width="6%"><b>' . price($obj->total) . '</b></td>';
308  $totalpermonth['total']=(empty($totalpermonth['total'])?0:$totalpermonth['total'])+$obj->total;
309  print '</tr>';
310  }
311  $db->free($resql);
312 
313  // Total
314  print '<tr class="liste_total"><td class="right"></td>';
315  print '<td align="left"></td>';
316  print '<td></td>';
317  for($i = 0; $i < 12; $i++) {
318  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
319  if ($j > 12) $j -= 12;
320  $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
321  print '<td align="right" width="6%">' . price($totalpermonth[$j]) . '</td>';
322  }
323  print '<td align="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>';
324  print '</tr>';
325 } else {
326  print $db->lasterror(); // Show last sql error
327 }
328 
329 
330 print '<tr class="liste_titre"><td width="6%" class="right">' . $langs->trans("PurchasebyVatrate") . '</td>';
331 print '<td align="left">' . $langs->trans("ProductOrService") . '</td>';
332 print '<td align="left">' . $langs->trans("Country") . '</td>';
333 $i=0;
334 while($i < 12)
335 {
336  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
337  if ($j > 12) $j -= 12;
338  print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
339  $i++;
340 }
341 print '<td width="60" align="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>';
342 
343 $sql2 = "SELECT ffd.tva_tx AS vatrate,";
344 $sql2 .= " ffd.product_type AS product_type,";
345 $sql2 .= " cc.label AS country,";
346 for($i = 1; $i <= 12; $i ++) {
347  $sql2 .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
348 }
349 $sql2 .= " SUM(ffd.total_ht) as total";
350 $sql2 .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
351 $sql2 .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
352 $sql2 .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as soc ON soc.rowid = ff.fk_soc";
353 $sql2 .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as cc ON cc.rowid = soc.fk_pays";
354 $sql2 .= " WHERE ff.datef >= '" . $db->idate($date_start) . "'";
355 $sql2 .= " AND ff.datef <= '" . $db->idate($date_end) . "'";
356 $sql.= " AND ff.fk_statut in (1,2)";
357 if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
358  $sql.= " AND ff.type IN (0,1,2,5)";
359 } else {
360  $sql.= " AND ff.type IN (0,1,2,3,5)";
361 }
362 $sql2 .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")";
363 $sql2 .= " GROUP BY ffd.tva_tx, ffd.product_type, cc.label";
364 
365 //print $sql2;
366 dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG);
367 $resql2 = $db->query($sql2);
368 if ($resql2) {
369  $num = $db->num_rows($resql2);
370  $totalpermonth = array();
371  while ( $obj = $db->fetch_object($resql2)) {
372  print '<tr class="oddeven"><td class="right">' . vatrate($obj->vatrate) . '</td>';
373  if ($obj->product_type == 0) {
374  print '<td align="left">'. $langs->trans("Product") . '</td>';
375  } else {
376  print '<td align="left">'. $langs->trans("Service") . '</td>';
377  }
378  print '<td>' . $obj->country . '</td>';
379  for($i = 0; $i < 12; $i++) {
380  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
381  if ($j > 12) $j -= 12;
382  $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
383  print '<td align="right" width="6%">' . price($obj->$monthj) . '</td>';
384  $totalpermonth[$j]=(empty($totalpermonth[$j])?0:$totalpermonth[$j])+$obj->$monthj;
385  }
386  print '<td align="right" width="6%"><b>' . price($obj->total) . '</b></td>';
387  $totalpermonth['total']=(empty($totalpermonth['total'])?0:$totalpermonth['total'])+$obj->total;
388  print '</tr>';
389  }
390  $db->free($resql2);
391 
392  // Total
393  print '<tr class="liste_total"><td class="right"></td>';
394  print '<td align="left"></td>';
395  print '<td></td>';
396  for($i = 0; $i < 12; $i++) {
397  $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
398  if ($j > 12) $j -= 12;
399  $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
400  print '<td align="right" width="6%">' . price($totalpermonth[$j]) . '</td>';
401  }
402  print '<td align="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>';
403  print '</tr>';
404 } else {
405  print $db->lasterror(); // Show last sql error
406 }
407 print "</table>\n";
408 } else {
409  // $modecompta != 'CREANCES-DETTES'
410  // "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
411  // 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 ?
412  // Because there is no way to know this, this report is not relevant.
413  print '<br>'.$langs->trans("TurnoverPerSaleTaxRateInCommitmentAccountingNotRelevant") . '<br>';
414 }
415 
416 // End of page
417 llxFooter();
418 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:56
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
Definition: index.php:91
if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) if(! empty($conf->don->enabled) && $user->rights->societe->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) && $user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1053
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm=false, $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_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:453
img_next($titlealt='default', $moreatt='')
Show next logo.
Class to manage suppliers invoices.
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 a parameter.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
Class to manage third parties objects (customers, suppliers, prospects...)
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='')
Show information for admin users or standard users.
Class to manage payments of customer invoices.
llxHeader()
Empty header.
Definition: wrapper.php:44
dol_now($mode='gmt')
Return date for now.
Class to manage Trips and Expenses.
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0)
Return a string with VAT rate label formated for view output Used into pdf and HTML pages...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition: date.lib.php:467
Class to manage payments of expense report.
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 invoices.
dol_getdate($timestamp, $fast=false)
Return an array with locale date info.
Class to manage payments for supplier invoices.
img_previous($titlealt='default', $moreatt='')
Show previous logo.
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='')
Show header of a report.
Definition: report.lib.php:41
dol_time_plus_duree($time, $duration_value, $duration_unit)
Add a delay to a date.
Definition: date.lib.php:116
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is &#39;...