dolibarr  9.0.0
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
3  * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
4  * Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
5  * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
6  * Copyright (C) 2015 Jean-Fran├žois Ferry <jfefe@aternatik.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
29 require '../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
31 require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
32 require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
33 
34 // Load translation files required by the page
35 $langs->loadLangs(array("compta","bills","other","main","accountancy"));
36 
37 // Security check
38 if (empty($conf->accounting->enabled)) {
40 }
41 if ($user->societe_id > 0)
43 if (! $user->rights->accounting->bind->write)
45 
46 
47 $month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
48 if (GETPOST("year",'int')) $year_start = GETPOST("year",'int');
49 else
50 {
51  $year_start = dol_print_date(dol_now(), '%Y');
52  if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
53 }
54 $year_end = $year_start + 1;
55 $month_end = $month_start - 1;
56 if ($month_end < 1)
57 {
58  $month_end = 12;
59  $year_end--;
60 }
61 $search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
62 $search_date_end = dol_get_last_day($year_end, $month_end);
63 $year_current = $year_start;
64 
65 // Validate History
66 $action = GETPOST('action','aZ09');
67 
68 
69 /*
70  * Actions
71  */
72 
73 if ($action == 'clean' || $action == 'validatehistory')
74 {
75  // Clean database
76  $db->begin();
77  $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
78  $sql1 .= " SET fk_code_ventilation = 0";
79  $sql1 .= ' WHERE fd.fk_code_ventilation NOT IN';
80  $sql1 .= ' (SELECT accnt.rowid ';
81  $sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
82  $sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
83  $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
84  $sql1 .= ' AND fd.fk_facture IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture WHERE entity = '.$conf->entity.')';
85  $sql1 .= ' AND fk_code_ventilation <> 0';
86 
87  dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
88  $resql1 = $db->query($sql1);
89  if (! $resql1) {
90  $error ++;
91  $db->rollback();
92  setEventMessages($db->lasterror(), null, 'errors');
93  } else {
94  $db->commit();
95  }
96  // End clean database
97 }
98 
99 if ($action == 'validatehistory') {
100 
101  $error = 0;
102  $db->begin();
103 
104  // Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
105  if ($db->type == 'pgsql') {
106  $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet";
107  $sql1 .= " SET fk_code_ventilation = accnt.rowid";
108  $sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
109  $sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
110  $sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
111  $sql1 .= " AND " . MAIN_DB_PREFIX . "facturedet.fk_code_ventilation = 0";
112  } else {
113  $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
114  $sql1 .= " SET fk_code_ventilation = accnt.rowid";
115  $sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
116  $sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
117  $sql1 .= " AND fd.fk_code_ventilation = 0";
118  }
119 
120  dol_syslog('htdocs/accountancy/customer/index.php');
121 
122  $resql1 = $db->query($sql1);
123  if (! $resql1) {
124  $error ++;
125  $db->rollback();
126  setEventMessages($db->lasterror(), null, 'errors');
127  } else {
128  $db->commit();
129  setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
130  }
131 }
132 
133 
134 /*
135  * View
136  */
137 
138 llxHeader('', $langs->trans("CustomersVentilation"));
139 
140 $textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
141 $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
142 
143 
144 print load_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy');
145 
146 print $langs->trans("DescVentilCustomer") . '<br>';
147 print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
148 print '<br>';
149 
150 
151 $y = $year_current;
152 
153 $buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
154 
155 print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
156 //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
157 
158 print '<div class="div-table-responsive-no-min">';
159 print '<table class="noborder" width="100%">';
160 print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>';
161 print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
162 for($i = 1; $i <= 12; $i ++) {
163  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
164  if ($j > 12) $j-=12;
165  print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
166 }
167 print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
168 
169 $sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
170 $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
171 for($i = 1; $i <= 12; $i ++) {
172  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
173  if ($j > 12) $j-=12;
174  $sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $j, 'fd.total_ht', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
175 }
176 $sql .= " SUM(fd.total_ht) as total";
177 $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
178 $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
179 $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
180 $sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'";
181 $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'";
182 $sql .= " AND f.fk_statut > 0";
183 $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
184 $sql .= " AND aa.account_number IS NULL";
185 if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
186  $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
187 } else {
188  $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
189 }
190 $sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
191 
192 dol_syslog('htdocs/accountancy/customer/index.php sql=' . $sql, LOG_DEBUG);
193 $resql = $db->query($sql);
194 if ($resql) {
195  $num = $db->num_rows($resql);
196 
197  while ( $row = $db->fetch_row($resql)) {
198 
199  print '<tr class="oddeven"><td>';
200  if ($row[0] == 'tobind')
201  {
202  print $langs->trans("Unknown");
203  }
204  else print length_accountg($row[0]);
205  print '</td>';
206  print '<td align="left">';
207  if ($row[0] == 'tobind')
208  {
209  print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
210  }
211  else print $row[1];
212  print '</td>';
213  for($i = 2; $i <= 12; $i ++) {
214  print '<td align="right">' . price($row[$i]) . '</td>';
215  }
216  print '<td align="right">' . price($row[13]) . '</td>';
217  print '<td align="right"><b>' . price($row[14]) . '</b></td>';
218  print '</tr>';
219  }
220  $db->free($resql);
221 } else {
222  print $db->lasterror(); // Show last sql error
223 }
224 print "</table>\n";
225 print '</div>';
226 
227 
228 print '<br>';
229 
230 
231 print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
232 //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
233 
234 print '<div class="div-table-responsive-no-min">';
235 print '<table class="noborder" width="100%">';
236 print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>';
237 print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
238 for($i = 1; $i <= 12; $i ++) {
239  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
240  if ($j > 12) $j-=12;
241  print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
242 }
243 print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
244 
245 $sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
246 $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
247 for($i = 1; $i <= 12; $i ++) {
248  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
249  if ($j > 12) $j-=12;
250  $sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $j, 'fd.total_ht', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
251 }
252 $sql .= " SUM(fd.total_ht) as total";
253 $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
254 $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
255 $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
256 $sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'";
257 $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'";
258 $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
259 $sql .= " AND f.fk_statut > 0";
260 if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
261  $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
262 } else {
263  $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
264 }
265 $sql .= " AND aa.account_number IS NOT NULL";
266 $sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
267 
268 dol_syslog('htdocs/accountancy/customer/index.php');
269 $resql = $db->query($sql);
270 if ($resql) {
271  $num = $db->num_rows($resql);
272 
273  while ( $row = $db->fetch_row($resql)) {
274 
275  print '<tr class="oddeven"><td>';
276  if ($row[0] == 'tobind')
277  {
278  print $langs->trans("Unknown");
279  }
280  else print length_accountg($row[0]);
281  print '</td>';
282 
283  print '<td align="left">';
284  if ($row[0] == 'tobind')
285  {
286  print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
287  }
288  else print $row[1];
289  print '</td>';
290 
291  for($i = 2; $i <= 12; $i++) {
292  print '<td align="right">' . price($row[$i]) . '</td>';
293  }
294  print '<td align="right">' . price($row[13]) . '</td>';
295  print '<td align="right"><b>' . price($row[14]) . '</b></td>';
296  print '</tr>';
297  }
298  $db->free($resql);
299 } else {
300  print $db->lasterror(); // Show last sql error
301 }
302 print "</table>\n";
303 print '</div>';
304 
305 
306 if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
307 {
308  print '<br>';
309  print '<br>';
310 
311  print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
312  //print load_fiche_titre($langs->trans("OtherInfo"), '', '');
313 
314  print '<div class="div-table-responsive-no-min">';
315  print '<table class="noborder" width="100%">';
316  print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
317  for($i = 1; $i <= 12; $i ++) {
318  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
319  if ($j > 12) $j-=12;
320  print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
321  }
322  print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
323 
324  $sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,";
325  for($i = 1; $i <= 12; $i ++) {
326  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
327  if ($j > 12) $j-=12;
328  $sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $j, 'fd.total_ht', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
329  }
330  $sql .= " SUM(fd.total_ht) as total";
331  $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
332  $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
333  $sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'";
334  $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'";
335  $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
336  $sql .= " AND f.fk_statut > 0";
337  if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
338  $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
339  } else {
340  $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
341  }
342 
343  dol_syslog('htdocs/accountancy/customer/index.php');
344  $resql = $db->query($sql);
345  if ($resql) {
346  $num = $db->num_rows($resql);
347 
348  while ($row = $db->fetch_row($resql)) {
349  print '<tr><td>' . $row[0] . '</td>';
350  for($i = 1; $i <= 12; $i ++) {
351  print '<td align="right">' . price($row[$i]) . '</td>';
352  }
353  print '<td align="right"><b>' . price($row[13]) . '</b></td>';
354  print '</tr>';
355  }
356  $db->free($resql);
357  } else {
358  print $db->lasterror(); // Show last sql error
359  }
360  print "</table>\n";
361  print '</div>';
362 
363 
364  if (! empty($conf->margin->enabled)) {
365  print "<br>\n";
366  print '<div class="div-table-responsive-no-min">';
367  print '<table class="noborder" width="100%">';
368  print '<tr class="liste_titre"><td width="400">' . $langs->trans("TotalMarge") . '</td>';
369  for($i = 1; $i <= 12; $i ++) {
370  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
371  if ($j > 12) $j-=12;
372  print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
373  }
374  print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
375 
376  $sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,";
377  for($i = 1; $i <= 12; $i ++) {
378  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
379  if ($j > 12) $j-=12;
380  $sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $j, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
381  }
382  $sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
383  $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
384  $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
385  $sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'";
386  $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'";
387  $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
388  $sql .= " AND f.fk_statut > 0";
389  if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
390  $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
391  } else {
392  $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
393  }
394 
395  dol_syslog('htdocs/accountancy/customer/index.php');
396  $resql = $db->query($sql);
397  if ($resql) {
398  $num = $db->num_rows($resql);
399 
400  while ($row = $db->fetch_row($resql)) {
401 
402  print '<tr><td>' . $row[0] . '</td>';
403  for($i = 1; $i <= 12; $i ++) {
404  print '<td align="right">' . price(price2num($row[$i])) . '</td>';
405  }
406  print '<td align="right"><b>' . price(price2num($row[13])) . '</b></td>';
407  print '</tr>';
408  }
409  $db->free($resql);
410  } else {
411  print $db->lasterror(); // Show last sql error
412  }
413  print "</table>\n";
414  print '</div>';
415  }
416 }
417 
418 // End of page
419 llxFooter();
420 $db->close();
llxFooter()
Footer empty.
Definition: index.php:44
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
const TYPE_STANDARD
Standard invoice.
print
Draft customers invoices.
Definition: index.php:91
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
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...
const TYPE_REPLACEMENT
Replacement invoice.
img_next($titlealt='default', $moreatt='')
Show next logo.
const TYPE_SITUATION
Situation invoice.
const TYPE_CREDIT_NOTE
Credit note invoice.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0)
Print a title with navigation controls for pagination.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
llxHeader()
Header empty.
Definition: index.php:36
dol_now($mode='gmt')
Return date for now.
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_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
const TYPE_DEPOSIT
Deposit invoice.
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
img_previous($titlealt='default', $moreatt='')
Show previous logo.
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous) ...
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is &#39;...