dolibarr  13.0.2
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-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
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 <https://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.'/core/class/html.formother.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
36 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
37 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
38 
39 // Load translation files required by the page
40 $langs->loadLangs(array("bills", "compta", "accountancy", "productbatch", "products"));
41 
42 $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
43 
44 $account_parent = GETPOST('account_parent');
45 $changeaccount = GETPOST('changeaccount');
46 // Search Getpost
47 $search_societe = GETPOST('search_societe', 'alpha');
48 $search_lineid = GETPOST('search_lineid', 'int');
49 $search_ref = GETPOST('search_ref', 'alpha');
50 $search_invoice = GETPOST('search_invoice', 'alpha');
51 $search_label = GETPOST('search_label', 'alpha');
52 $search_desc = GETPOST('search_desc', 'alpha');
53 $search_amount = GETPOST('search_amount', 'alpha');
54 $search_account = GETPOST('search_account', 'alpha');
55 $search_vat = GETPOST('search_vat', 'alpha');
56 $search_day = GETPOST("search_day", "int");
57 $search_month = GETPOST("search_month", "int");
58 $search_year = GETPOST("search_year", "int");
59 $search_country = GETPOST('search_country', 'alpha');
60 $search_tvaintra = GETPOST('search_tvaintra', 'alpha');
61 
62 // Load variable for pagination
63 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
64 $sortfield = GETPOST('sortfield', 'aZ09comma');
65 $sortorder = GETPOST('sortorder', 'aZ09comma');
66 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
67 if (empty($page) || $page < 0) $page = 0;
68 $offset = $limit * $page;
69 $pageprev = $page - 1;
70 $pagenext = $page + 1;
71 if (!$sortfield)
72  $sortfield = "f.datef, f.ref, fd.rowid";
73 if (!$sortorder) {
74  if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
75  $sortorder = "DESC";
76  }
77 }
78 
79 // Security check
80 if ($user->socid > 0)
82 if (!$user->rights->accounting->bind->write)
84 
85 $formaccounting = new FormAccounting($db);
86 
87 
88 /*
89  * Actions
90  */
91 
92 // Purge search criteria
93 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
94 {
95  $search_societe = '';
96  $search_lineid = '';
97  $search_ref = '';
98  $search_invoice = '';
99  $search_label = '';
100  $search_desc = '';
101  $search_amount = '';
102  $search_account = '';
103  $search_vat = '';
104  $search_day = '';
105  $search_month = '';
106  $search_year = '';
107  $search_country = '';
108  $search_tvaintra = '';
109 }
110 
111 if (is_array($changeaccount) && count($changeaccount) > 0) {
112  $error = 0;
113 
114  if (!(GETPOST('account_parent', 'int') >= 0))
115  {
116  $error++;
117  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
118  }
119 
120  if (!$error)
121  {
122  $db->begin();
123 
124  $sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as l";
125  $sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
126  $sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
127 
128  dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1);
129  $resql1 = $db->query($sql1);
130  if (!$resql1) {
131  $error++;
132  setEventMessages($db->lasterror(), null, 'errors');
133  }
134  if (!$error) {
135  $db->commit();
136  setEventMessages($langs->trans("Save"), null, 'mesgs');
137  } else {
138  $db->rollback();
139  setEventMessages($db->lasterror(), null, 'errors');
140  }
141 
142  $account_parent = ''; // Protection to avoid to mass apply it a second time
143  }
144 }
145 
146 
147 /*
148  * View
149  */
150 
151 $form = new Form($db);
152 $formother = new FormOther($db);
153 
154 llxHeader('', $langs->trans("CustomersVentilation").' - '.$langs->trans("Dispatched"));
155 
156 print '<script type="text/javascript">
157  $(function () {
158  $(\'#select-all\').click(function(event) {
159  // Iterate each checkbox
160  $(\':checkbox\').each(function() {
161  this.checked = true;
162  });
163  });
164  $(\'#unselect-all\').click(function(event) {
165  // Iterate each checkbox
166  $(\':checkbox\').each(function() {
167  this.checked = false;
168  });
169  });
170  });
171  </script>';
172 
173 /*
174  * Customer Invoice lines
175  */
176 $sql = "SELECT f.rowid as facid, f.ref as ref, f.type, f.datef, f.ref_client,";
177 $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,";
178 $sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
179 $sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.tobuy, p.tosell,";
180 $sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,";
181 $sql .= " aa.rowid as fk_compte, aa.account_number, aa.label, aa.labelshort,";
182 $sql .= " fd.situation_percent,";
183 $sql .= " co.code as country_code, co.label as country,";
184 $sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
185 $parameters = array();
186 $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
187 $sql .= $hookmanager->resPrint;
188 $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
189 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product";
190 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
191 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
192 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
193 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
194 $sql .= " WHERE fd.fk_code_ventilation > 0";
195 $sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
196 $sql .= " AND f.fk_statut > 0";
197 if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
198  $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")";
199 } else {
200  $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
201 }
202 // Add search filter like
203 if ($search_societe) {
204  $sql .= natural_search('s.nom', $search_societe);
205 }
206 if ($search_lineid) {
207  $sql .= natural_search("fd.rowid", $search_lineid, 1);
208 }
209 if (strlen(trim($search_invoice))) {
210  $sql .= natural_search("f.ref", $search_invoice);
211 }
212 if (strlen(trim($search_ref))) {
213  $sql .= natural_search("p.ref", $search_ref);
214 }
215 if (strlen(trim($search_label))) {
216  $sql .= natural_search("p.label", $search_label);
217 }
218 if (strlen(trim($search_desc))) {
219  $sql .= natural_search("fd.description", $search_desc);
220 }
221 if (strlen(trim($search_amount))) {
222  $sql .= natural_search("fd.total_ht", $search_amount, 1);
223 }
224 if (strlen(trim($search_account))) {
225  $sql .= natural_search("aa.account_number", $search_account);
226 }
227 if (strlen(trim($search_vat))) {
228  $sql .= natural_search("fd.tva_tx", price2num($search_vat), 1);
229 }
230 $sql .= dolSqlDateFilter('f.datef', $search_day, $search_month, $search_year);
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("co.code", $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('invoice', 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_societe) $param .= "&search_societe=".urlencode($search_societe);
276  if ($search_invoice) $param .= "&search_invoice=".urlencode($search_invoice);
277  if ($search_ref) $param .= "&search_ref=".urlencode($search_ref);
278  if ($search_label) $param .= "&search_label=".urlencode($search_label);
279  if ($search_desc) $param .= "&search_desc=".urlencode($search_desc);
280  if ($search_account) $param .= "&search_account=".urlencode($search_account);
281  if ($search_vat) $param .= "&search_vat=".urlencode($search_vat);
282  if ($search_day) $param .= '&search_day='.urlencode($search_day);
283  if ($search_month) $param .= '&search_month='.urlencode($search_month);
284  if ($search_year) $param .= '&search_year='.urlencode($search_year);
285  if ($search_country) $param .= "&search_country=".urlencode($search_country);
286  if ($search_tvaintra) $param .= "&search_tvaintra=".urlencode($search_tvaintra);
287 
288  print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'."\n";
289  print '<input type="hidden" name="action" value="ventil">';
290  if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
291  print '<input type="hidden" name="token" value="'.newToken().'">';
292  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
293  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
294  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
295  print '<input type="hidden" name="page" value="'.$page.'">';
296 
297  print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
298  print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneCustomer").'</span><br>';
299 
300  print '<br><div class="inline-block divButAction">'.$langs->trans("ChangeAccount").'<br>';
301  print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
302  print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
303 
304  $moreforfilter = '';
305 
306  print '<div class="div-table-responsive">';
307  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
308 
309  print '<tr class="liste_titre_filter">';
310  print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="'.dol_escape_htmltag($search_lineid).'"></td>';
311  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="'.dol_escape_htmltag($search_invoice).'"></td>';
312  print '<td class="liste_titre center nowraponall">';
313  if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
314  print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">';
315  }
316  print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
317  $formother->select_year($search_year, 'search_year', 1, 20, 5);
318  print '</td>';
319  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
320  //print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
321  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
322  print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
323  print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" placeholder="%" name="search_vat" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
324  print '<td class="liste_titre"><input type="text" class="flat maxwidth75imp" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
325  print '<td class="liste_titre">';
326  print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
327  //print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
328  print '</td>';
329  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></td>';
330  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="'.dol_escape_htmltag($search_account).'"></td>';
331  print '<td class="liste_titre center">';
332  $searchpicto = $form->showFilterButtons();
333  print $searchpicto;
334  print "</td></tr>\n";
335 
336  print '<tr class="liste_titre">';
337  print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "fd.rowid", "", $param, '', $sortfield, $sortorder);
338  print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
339  print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, fd.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
340  print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
341  //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
342  print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
343  print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
344  print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
345  print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
346  print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
347  print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
348  print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
349  $checkpicto = $form->showCheckAddButtons();
350  print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
351  print "</tr>\n";
352 
353  $thirdpartystatic = new Societe($db);
354  $facturestatic = new Facture($db);
355  $productstatic = new Product($db);
356  $accountingaccountstatic = new AccountingAccount($db);
357 
358  $i = 0;
359  while ($i < min($num_lines, $limit)) {
360  $objp = $db->fetch_object($result);
361 
362  $facturestatic->ref = $objp->ref;
363  $facturestatic->id = $objp->facid;
364  $facturestatic->type = $objp->ftype;
365 
366  $thirdpartystatic->id = $objp->socid;
367  $thirdpartystatic->name = $objp->name;
368  $thirdpartystatic->client = $objp->client;
369  $thirdpartystatic->fournisseur = $objp->fournisseur;
370  $thirdpartystatic->code_client = $objp->code_client;
371  $thirdpartystatic->code_compta_client = $objp->code_compta_client;
372  $thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
373  $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
374  $thirdpartystatic->email = $objp->email;
375  $thirdpartystatic->country_code = $objp->country_code;
376 
377  $productstatic->ref = $objp->product_ref;
378  $productstatic->id = $objp->product_id;
379  $productstatic->label = $objp->product_label;
380  $productstatic->type = $objp->line_type;
381  $productstatic->status = $objp->tosell;
382  $productstatic->status_buy = $objp->tobuy;
383  $productstatic->accountancy_code_sell = $objp->accountancy_code_sell;
384  $productstatic->accountancy_code_sell_intra = $objp->accountancy_code_sell_intra;
385  $productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export;
386 
387  $accountingaccountstatic->rowid = $objp->fk_compte;
388  $accountingaccountstatic->label = $objp->label;
389  $accountingaccountstatic->labelshort = $objp->labelshort;
390  $accountingaccountstatic->account_number = $objp->account_number;
391 
392  print '<tr class="oddeven">';
393 
394  // Line id
395  print '<td>'.$objp->rowid.'</td>';
396 
397  // Ref Invoice
398  print '<td class="nowraponall">'.$facturestatic->getNomUrl(1).'</td>';
399 
400  // Date invoice
401  print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day').'</td>';
402 
403  // Ref Product
404  print '<td class="tdoverflowmax100">';
405  if ($productstatic->id > 0) print $productstatic->getNomUrl(1);
406  if ($productstatic->id > 0 && $objp->product_label) print '<br>';
407  if ($objp->product_label) print '<span class="opacitymedium">'.$objp->product_label.'</span>';
408  print '</td>';
409 
410  print '<td class="tdoverflowonsmartphone">';
411  $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
412  $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
413  print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
414  print '</td>';
415 
416  print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
417 
418  print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
419 
420  // Thirdparty
421  print '<td class="tdoverflowmax100">'.$thirdpartystatic->getNomUrl(1, 'customer').'</td>';
422 
423  // Country
424  print '<td>';
425  if ($objp->country_code)
426  {
427  print $langs->trans("Country".$objp->country_code).' ('.$objp->country_code.')';
428  }
429  print '</td>';
430 
431  print '<td>'.$objp->tva_intra.'</td>';
432 
433  print '<td>';
434  print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1);
435  print ' <a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
436  print img_edit();
437  print '</a></td>';
438 
439  print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="'.$objp->rowid.'"/></td>';
440 
441  print '</tr>';
442  $i++;
443  }
444  print '</table>';
445  print "</div>";
446 
447  if ($nbtotalofrecords > $limit) {
448  print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1);
449  }
450 
451  print '</form>';
452 } else {
453  print $db->lasterror();
454 }
455 
456 // End of page
457 llxFooter();
458 $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_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto= 'UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
img_edit($titlealt= 'default', $float=0, $other= '')
Show logo editer/modifier fiche.
const TYPE_STANDARD
Standard invoice.
if(!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'] country if(!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'] typent code
Definition: list.php:566
Class to manage products or services.
getCountriesInEEC()
Return list of countries that are inside the EEC (European Economic Community) Note: Try to keep this...
const TYPE_REPLACEMENT
Replacement invoice.
const TYPE_SITUATION
Situation invoice.
const TYPE_CREDIT_NOTE
Credit note invoice.
llxHeader()
Empty header.
Definition: wrapper.php:45
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
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...)
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.
Classe permettant la generation de composants html autre Only common components are here...
if(!GETPOST('transkey', 'alphanohtml')&&!GETPOST('transphrase', 'alphanohtml')) else
View.
Definition: notice.php:44
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
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...
dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand=0)
Generate a SQL string to make a filter into a range (for second of date until last second of date) ...
Definition: date.lib.php:281
print $_SERVER["PHP_SELF"]
Edit parameters.
const TYPE_DEPOSIT
Deposit invoice.
dolGetFirstLineOfText($text, $nboflines=1, $charset= 'UTF-8')
Return first line of text.
print
Draft customers invoices.
Definition: index.php:89
Class to manage generation of HTML components for accounting management.
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.
Class to manage accounting accounts.
Class to manage invoices.
llxFooter()
Empty footer.
Definition: wrapper.php:59
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.