dolibarr  9.0.0
lines.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
3  * Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@zendsi.com>
4  * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
5  * Copyright (C) 2014-2016 Florian Henry <florian.henry@open-concept.pro>
6  * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
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 
27 require '../../main.inc.php';
28 
29 require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.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 . '/core/lib/accounting.lib.php';
33 require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
34 require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
35 require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
36 
37 // Load translation files required by the page
38 $langs->loadLangs(array("bills","compta","accountancy","productbatch"));
39 
40 $account_parent = GETPOST('account_parent');
41 $changeaccount = GETPOST('changeaccount');
42 // Search Getpost
43 $search_lineid = GETPOST('search_lineid', 'int');
44 $search_ref = GETPOST('search_ref', 'alpha');
45 $search_invoice = GETPOST('search_invoice', 'alpha');
46 $search_label = GETPOST('search_label', 'alpha');
47 $search_desc = GETPOST('search_desc', 'alpha');
48 $search_amount = GETPOST('search_amount', 'alpha');
49 $search_account = GETPOST('search_account', 'alpha');
50 $search_vat = GETPOST('search_vat', 'alpha');
51 $search_day=GETPOST("search_day","int");
52 $search_month=GETPOST("search_month","int");
53 $search_year=GETPOST("search_year","int");
54 $search_country = GETPOST('search_country', 'alpha');
55 $search_tvaintra = GETPOST('search_tvaintra', 'alpha');
56 
57 // Load variable for pagination
58 $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
59 $sortfield = GETPOST('sortfield', 'alpha');
60 $sortorder = GETPOST('sortorder', 'alpha');
61 $page = GETPOST('page', 'int');
62 if (empty($page) || $page < 0) $page = 0;
63 $pageprev = $page - 1;
64 $pagenext = $page + 1;
65 $offset = $limit * $page;
66 if (! $sortfield)
67  $sortfield = "f.datef, f.facnumber, fd.rowid";
68 if (! $sortorder) {
69  if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
70  $sortorder = "DESC";
71  }
72 }
73 
74 // Security check
75 if ($user->societe_id > 0)
77 if (! $user->rights->accounting->bind->write)
79 
80 $formaccounting = new FormAccounting($db);
81 
82 
83 /*
84  * Actions
85  */
86 
87 // Purge search criteria
88 if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
89 {
90  $search_lineid = '';
91  $search_ref = '';
92  $search_invoice = '';
93  $search_label = '';
94  $search_desc = '';
95  $search_amount = '';
96  $search_account = '';
97  $search_vat = '';
98  $search_day = '';
99  $search_month = '';
100  $search_year = '';
101  $search_country = '';
102  $search_tvaintra = '';
103 }
104 
105 if (is_array($changeaccount) && count($changeaccount) > 0) {
106  $error = 0;
107 
108  if (! (GETPOST('account_parent','int') >= 0))
109  {
110  $error++;
111  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
112  }
113 
114  if (! $error)
115  {
116  $db->begin();
117 
118  $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l";
119  $sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
120  $sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
121 
122  dol_syslog('accountancy/customer/lines.php::changeaccount sql= ' . $sql1);
123  $resql1 = $db->query($sql1);
124  if (! $resql1) {
125  $error ++;
126  setEventMessages($db->lasterror(), null, 'errors');
127  }
128  if (! $error) {
129  $db->commit();
130  setEventMessages($langs->trans('Save'), null, 'mesgs');
131  } else {
132  $db->rollback();
133  setEventMessages($db->lasterror(), null, 'errors');
134  }
135 
136  $account_parent = ''; // Protection to avoid to mass apply it a second time
137  }
138 }
139 
140 
141 /*
142  * View
143  */
144 
145 $form = new Form($db);
146 $formother = new FormOther($db);
147 
148 llxHeader('', $langs->trans("CustomersVentilation") . ' - ' . $langs->trans("Dispatched"));
149 
150 print '<script type="text/javascript">
151  $(function () {
152  $(\'#select-all\').click(function(event) {
153  // Iterate each checkbox
154  $(\':checkbox\').each(function() {
155  this.checked = true;
156  });
157  });
158  $(\'#unselect-all\').click(function(event) {
159  // Iterate each checkbox
160  $(\':checkbox\').each(function() {
161  this.checked = false;
162  });
163  });
164  });
165  </script>';
166 
167 /*
168  * Customer Invoice lines
169  */
170 $sql = "SELECT f.rowid as facid, f.facnumber as ref, f.type, f.datef, f.ref_client,";
171 $sql.= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
172 $sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
173 $sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
174 $sql.= " fd.situation_percent,";
175 $sql.= " co.code as country_code, co.label as country,";
176 $sql.= " s.tva_intra";
177 $parameters=array();
178 $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
179 $sql.=$hookmanager->resPrint;
180 $sql.= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
181 $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
182 $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
183 $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
184 $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
185 $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
186 $sql.= " WHERE fd.fk_code_ventilation > 0";
187 $sql.= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
188 $sql.= " AND f.fk_statut > 0";
189 if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
190  $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
191 } else {
192  $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_STANDARD . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
193 }
194 if ($search_lineid) {
195  $sql .= natural_search("fd.rowid", $search_lineid, 1);
196 }
197 if (strlen(trim($search_invoice))) {
198  $sql .= natural_search("f.facnumber", $search_invoice);
199 }
200 if (strlen(trim($search_ref))) {
201  $sql .= natural_search("p.ref", $search_ref);
202 }
203 if (strlen(trim($search_label))) {
204  $sql .= natural_search("p.label", $search_label);
205 }
206 if (strlen(trim($search_desc))) {
207  $sql .= natural_search("fd.description", $search_desc);
208 }
209 if (strlen(trim($search_amount))) {
210  $sql .= natural_search("fd.total_ht", $search_amount, 1);
211 }
212 if (strlen(trim($search_account))) {
213  $sql .= natural_search("aa.account_number", $search_account);
214 }
215 if (strlen(trim($search_vat))) {
216  $sql .= natural_search("fd.tva_tx", price2num($search_vat), 1);
217 }
218 if ($search_month > 0)
219 {
220  if ($search_year > 0 && empty($search_day))
221  $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
222  else if ($search_year > 0 && ! empty($search_day))
223  $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
224  else
225  $sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
226 }
227 else if ($search_year > 0)
228 {
229  $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
230 }
231 if (strlen(trim($search_country))) {
232  $arrayofcode = getCountriesInEEC();
233  $country_code_in_EEC = $country_code_in_EEC_without_me = '';
234  foreach ($arrayofcode as $key => $value)
235  {
236  $country_code_in_EEC.=($country_code_in_EEC ? "," : "")."'".$value."'";
237  if ($value != $mysoc->country_code) $country_code_in_EEC_without_me.=($country_code_in_EEC_without_me ? "," : "")."'".$value."'";
238  }
239  if ($search_country == 'special_allnotme') $sql .= " AND co.code <> '".$db->escape($mysoc->country_code)."'";
240  elseif ($search_country == 'special_eec') $sql .= " AND co.code IN (".$country_code_in_EEC.")";
241  elseif ($search_country == 'special_eecnotme') $sql .= " AND co.code IN (".$country_code_in_EEC_without_me.")";
242  elseif ($search_country == 'special_noteec') $sql .= " AND co.code NOT IN (".$country_code_in_EEC.")";
243  else $sql .= natural_search(array("co.code","co.label"), $search_country);
244 }
245 if (strlen(trim($search_tvaintra))) {
246  $sql .= natural_search("s.tva_intra", $search_tvaintra);
247 }
248 $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
249 $sql .= $db->order($sortfield, $sortorder);
250 
251 // Count total nb of records
252 $nbtotalofrecords = '';
253 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
254 {
255  $result = $db->query($sql);
256  $nbtotalofrecords = $db->num_rows($result);
257  if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
258  {
259  $page = 0;
260  $offset = 0;
261  }
262 }
263 
264 $sql .= $db->plimit($limit + 1, $offset);
265 
266 dol_syslog("/accountancy/customer/lines.php", LOG_DEBUG);
267 $result = $db->query($sql);
268 if ($result) {
269  $num_lines = $db->num_rows($result);
270  $i = 0;
271 
272  $param='';
273  if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
274  if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
275  if ($search_invoice) $param .= "&search_invoice=" . urlencode($search_invoice);
276  if ($search_ref) $param .= "&search_ref=" . urlencode($search_ref);
277  if ($search_label) $param .= "&search_label=" . urlencode($search_label);
278  if ($search_desc) $param .= "&search_desc=" . urlencode($search_desc);
279  if ($search_account) $param .= "&search_account=" . urlencode($search_account);
280  if ($search_vat) $param .= "&search_vat=" . urlencode($search_vat);
281  if ($search_day) $param .= '&search_day='.urlencode($search_day);
282  if ($search_month) $param .= '&search_month='.urlencode($search_month);
283  if ($search_year) $param .= '&search_year='.urlencode($search_year);
284  if ($search_country) $param .= "&search_country=" . urlencode($search_country);
285  if ($search_tvaintra) $param .= "&search_tvaintra=" . urlencode($search_tvaintra);
286 
287  print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
288  print '<input type="hidden" name="action" value="ventil">';
289  if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
290  print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
291  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
292  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
293  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
294  print '<input type="hidden" name="page" value="'.$page.'">';
295 
296  print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
297  print $langs->trans("DescVentilDoneCustomer") . '<br>';
298 
299  print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
300  print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
301  print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("ChangeBinding") . '"/></div>';
302 
303  $moreforfilter = '';
304 
305  print '<div class="div-table-responsive">';
306  print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
307 
308  print '<tr class="liste_titre_filter">';
309  print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
310  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
311  print '<td class="liste_titre center nowraponall">';
312  if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">';
313  print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
314  $formother->select_year($search_year,'search_year',1, 20, 5);
315  print '</td>';
316  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
317  //print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
318  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
319  print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
320  print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" placeholder="%" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
321  print '<td class="liste_titre">';
322  print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1);
323  //print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
324  print '</td>';
325  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' . dol_escape_htmltag($search_tvaintra) . '"></td>';
326  print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
327  print '<td class="liste_titre" align="center">';
328  $searchpicto=$form->showFilterButtons();
329  print $searchpicto;
330  print "</td></tr>\n";
331 
332  print '<tr class="liste_titre">';
333  print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "fd.rowid", "", $param, '', $sortfield, $sortorder);
334  print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
335  print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.facnumber, fd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
336  print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
337  //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
338  print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
339  print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
340  print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
341  print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
342  print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
343  print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
344  $clickpicto=$form->showCheckAddButtons();
345  print_liste_field_titre($clickpicto, '', '', '', '', 'align="center"');
346  print "</tr>\n";
347 
348  $facture_static = new Facture($db);
349  $product_static = new Product($db);
350 
351  while ( $objp = $db->fetch_object($result) ) {
352  $codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte;
353 
354  $facture_static->ref = $objp->ref;
355  $facture_static->id = $objp->facid;
356  $facture_static->type = $objp->ftype;
357 
358  $product_static->ref = $objp->product_ref;
359  $product_static->id = $objp->product_id;
360  $product_static->label = $objp->product_label;
361  $product_static->type = $objp->line_type;
362 
363  print '<tr class="oddeven">';
364 
365  // Line id
366  print '<td>' . $objp->rowid . '</td>';
367 
368  // Ref Invoice
369  print '<td class="nowraponall">' . $facture_static->getNomUrl(1) . '</td>';
370 
371  print '<td align="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';
372 
373  // Ref Product
374  print '<td>';
375  if ($product_static->id)
376  print $product_static->getNomUrl(1);
377  if ($objp->product_label) print '<br>'.$objp->product_label;
378  print '</td>';
379 
380  print '<td class="tdoverflowonsmartphone">';
381  $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
382  $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
383  print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description);
384  print '</td>';
385 
386  print '<td align="right">' . price($objp->total_ht) . '</td>';
387 
388  print '<td align="right">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';
389 
390  print '<td>' . $langs->trans("Country".$objp->country_code) .' ('.$objp->country_code.')</td>';
391 
392  print '<td>' . $objp->tva_intra . '</td>';
393 
394  print '<td align="center">';
395  print $codecompta . ' <a href="./card.php?id=' . $objp->rowid . '&backtopage='.urlencode($_SERVER["PHP_SELF"].($param?'?'.$param:'')).'">';
396  print img_edit();
397  print '</a>';
398  print '</td>';
399 
400  print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="' . $objp->rowid . '"/></td>';
401 
402  print "</tr>";
403  $i ++;
404  }
405 
406  print "</table>";
407  print "</div>";
408 
409  if ($nbtotalofrecords > $limit) {
410  print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1);
411  }
412 
413  print '</form>';
414 } else {
415  print $db->lasterror();
416 }
417 
418 // End of page
419 llxFooter();
420 $db->close();
print $object label
hash of file content (md5_file(dol_osencode($destfull))
Definition: edit.php:153
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.
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.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding &#39;...&#39; if string larger than length.
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...
img_edit($titlealt='default', $float=0, $other='class="pictoedit"')
Show logo editer/modifier fiche.
Class to manage products or services.
getCountriesInEEC()
Return list of countries that are inside the EEC (European Economic Community) TODO Add a field into ...
const TYPE_REPLACEMENT
Replacement invoice.
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
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
const TYPE_SITUATION
Situation invoice.
const TYPE_CREDIT_NOTE
Credit note invoice.
if(! GETPOST('transkey', 'alphanohtml') &&! GETPOST('transphrase', 'alphanohtml')) else
View.
Definition: notice.php:43
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage generation of HTML components Only common components must be here.
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.
Classe permettant la generation de composants html autre Only common components are here...
llxHeader()
Empty header.
Definition: wrapper.php:44
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dolGetFirstLineOfText($text, $nboflines=1)
Return first line of text.
if(GETPOST('cancel', 'alpha')) if(! GETPOST( 'confirmmassaction', 'alpha') &&$massaction !='presend' &&$massaction !='confirm_presend')
Draft customers invoices.
Definition: list.php:156
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0)
Clean a string from all HTML tags and entities.
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_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
Class to manage generation of HTML components for accounting management.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="")
Show title line of an array.
Class to manage invoices.
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;...