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) 2013-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.'/fourn/class/fournisseur.facture.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
35 require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
37 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
38 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
39 
40 // Load translation files required by the page
41 $langs->loadLangs(array("compta", "bills", "other", "accountancy", "productbatch", "products"));
42 
43 $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
44 
45 $account_parent = GETPOST('account_parent');
46 $changeaccount = GETPOST('changeaccount');
47 // Search Getpost
48 $search_societe = GETPOST('search_societe', 'alpha');
49 $search_lineid = GETPOST('search_lineid', 'int');
50 $search_ref = GETPOST('search_ref', 'alpha');
51 $search_invoice = GETPOST('search_invoice', 'alpha');
52 $search_label = GETPOST('search_label', 'alpha');
53 $search_desc = GETPOST('search_desc', 'alpha');
54 $search_amount = GETPOST('search_amount', 'alpha');
55 $search_account = GETPOST('search_account', 'alpha');
56 $search_vat = GETPOST('search_vat', 'alpha');
57 $search_day = GETPOST("search_day", "int");
58 $search_month = GETPOST("search_month", "int");
59 $search_year = GETPOST("search_year", "int");
60 $search_country = GETPOST('search_country', 'alpha');
61 $search_tvaintra = GETPOST('search_tvaintra', 'alpha');
62 
63 // Load variable for pagination
64 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
65 $sortfield = GETPOST('sortfield', 'aZ09comma');
66 $sortorder = GETPOST('sortorder', 'aZ09comma');
67 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
68 if (empty($page) || $page < 0) $page = 0;
69 $offset = $limit * $page;
70 $pageprev = $page - 1;
71 $pagenext = $page + 1;
72 if (!$sortfield)
73  $sortfield = "f.datef, f.ref, l.rowid";
74 if (!$sortorder) {
75  if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
76  $sortorder = "DESC";
77  }
78 }
79 
80 // Security check
81 if ($user->socid > 0)
83 if (!$user->rights->accounting->bind->write)
85 
86 $formaccounting = new FormAccounting($db);
87 
88 
89 /*
90  * Actions
91  */
92 
93 // Purge search criteria
94 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
95 {
96  $search_societe = '';
97  $search_lineid = '';
98  $search_ref = '';
99  $search_invoice = '';
100  $search_label = '';
101  $search_desc = '';
102  $search_amount = '';
103  $search_account = '';
104  $search_vat = '';
105  $search_day = '';
106  $search_month = '';
107  $search_year = '';
108  $search_country = '';
109  $search_tvaintra = '';
110 }
111 
112 if (is_array($changeaccount) && count($changeaccount) > 0) {
113  $error = 0;
114 
115  if (!(GETPOST('account_parent', 'int') >= 0))
116  {
117  $error++;
118  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
119  }
120 
121 
122  if (!$error)
123  {
124  $db->begin();
125 
126  $sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det as l";
127  $sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
128  $sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
129 
130  dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1);
131  $resql1 = $db->query($sql1);
132  if (!$resql1) {
133  $error++;
134  setEventMessages($db->lasterror(), null, 'errors');
135  }
136  if (!$error) {
137  $db->commit();
138  setEventMessages($langs->trans("Save"), null, 'mesgs');
139  } else {
140  $db->rollback();
141  setEventMessages($db->lasterror(), null, 'errors');
142  }
143 
144  $account_parent = ''; // Protection to avoid to mass apply it a second time
145  }
146 }
147 
148 
149 /*
150  * View
151  */
152 
153 $form = new Form($db);
154 $formother = new FormOther($db);
155 
156 llxHeader('', $langs->trans("SuppliersVentilation").' - '.$langs->trans("Dispatched"));
157 
158 print '<script type="text/javascript">
159  $(function () {
160  $(\'#select-all\').click(function(event) {
161  // Iterate each checkbox
162  $(\':checkbox\').each(function() {
163  this.checked = true;
164  });
165  });
166  $(\'#unselect-all\').click(function(event) {
167  // Iterate each checkbox
168  $(\':checkbox\').each(function() {
169  this.checked = false;
170  });
171  });
172  });
173  </script>';
174 
175 /*
176  * Supplier Invoice lines
177  */
178 $sql = "SELECT f.rowid as facid, f.ref as ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.fk_soc,";
179 $sql .= " l.rowid, l.fk_product, l.product_type as line_type, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
180 $sql .= " aa.label, aa.labelshort, aa.account_number,";
181 $sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.tobuy, p.tosell,";
182 $sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,";
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."facture_fourn_det as l";
189 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product";
190 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = l.fk_code_ventilation";
191 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = l.fk_facture_fourn";
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 f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
195 // Add search filter like
196 if ($search_societe) {
197  $sql .= natural_search('s.nom', $search_societe);
198 }
199 if ($search_lineid) {
200  $sql .= natural_search("l.rowid", $search_lineid, 1);
201 }
202 if (strlen(trim($search_invoice))) {
203  $sql .= natural_search("f.ref", $search_invoice);
204 }
205 if (strlen(trim($search_label))) {
206  $sql .= natural_search("f.libelle", $search_label);
207 }
208 if (strlen(trim($search_ref))) {
209  $sql .= natural_search("p.ref", $search_ref);
210 }
211 if (strlen(trim($search_desc))) {
212  $sql .= natural_search("l.description", $search_desc);
213 }
214 if (strlen(trim($search_amount))) {
215  $sql .= natural_search("l.total_ht", $search_amount, 1);
216 }
217 if (strlen(trim($search_account))) {
218  $sql .= natural_search("aa.account_number", $search_account);
219 }
220 if (strlen(trim($search_vat))) {
221  $sql .= natural_search("l.tva_tx", price2num($search_vat), 1);
222 }
223 $sql .= dolSqlDateFilter('f.datef', $search_day, $search_month, $search_year);
224 if (strlen(trim($search_country))) {
225  $arrayofcode = getCountriesInEEC();
226  $country_code_in_EEC = $country_code_in_EEC_without_me = '';
227  foreach ($arrayofcode as $key => $value)
228  {
229  $country_code_in_EEC .= ($country_code_in_EEC ? "," : "")."'".$value."'";
230  if ($value != $mysoc->country_code) $country_code_in_EEC_without_me .= ($country_code_in_EEC_without_me ? "," : "")."'".$value."'";
231  }
232  if ($search_country == 'special_allnotme') $sql .= " AND co.code <> '".$db->escape($mysoc->country_code)."'";
233  elseif ($search_country == 'special_eec') $sql .= " AND co.code IN (".$country_code_in_EEC.")";
234  elseif ($search_country == 'special_eecnotme') $sql .= " AND co.code IN (".$country_code_in_EEC_without_me.")";
235  elseif ($search_country == 'special_noteec') $sql .= " AND co.code NOT IN (".$country_code_in_EEC.")";
236  else $sql .= natural_search("co.code", $search_country);
237 }
238 if (strlen(trim($search_tvaintra))) {
239  $sql .= natural_search("s.tva_intra", $search_tvaintra);
240 }
241 $sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
242 
243 // Add where from hooks
244 $parameters = array();
245 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
246 $sql .= $hookmanager->resPrint;
247 
248 $sql .= $db->order($sortfield, $sortorder);
249 
250 // Count total nb of records
251 $nbtotalofrecords = '';
252 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
253 {
254  $result = $db->query($sql);
255  $nbtotalofrecords = $db->num_rows($result);
256  if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
257  {
258  $page = 0;
259  $offset = 0;
260  }
261 }
262 
263 $sql .= $db->plimit($limit + 1, $offset);
264 
265 dol_syslog("accountancy/supplier/lines.php", LOG_DEBUG);
266 $result = $db->query($sql);
267 if ($result) {
268  $num_lines = $db->num_rows($result);
269  $i = 0;
270 
271  $param = '';
272  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
273  if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
274  if ($search_societe) $param .= "&search_societe=".urlencode($search_societe);
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="'.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, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
297  print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneSupplier").'</span><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  // We add search filter
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"><input type="text" class="flat maxwidth50" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
313  print '<td class="liste_titre center nowraponall">';
314  if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
315  print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
316  $formother->select_year($search_year, 'search_year', 1, 20, 5);
317  print '</td>';
318  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
319  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
320  print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
321  print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
322  print '<td class="liste_titre"><input type="text" class="flat maxwidth75imp" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
323  print '<td class="liste_titre">';
324  print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
325  // print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
326  print '</td>';
327  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></td>';
328  print '<td class="liste_titre center"><input type="text" class="flat maxwidth50" name="search_account" value="'.dol_escape_htmltag($search_account).'"></td>';
329  print '<td class="liste_titre center">';
330  $searchpicto = $form->showFilterButtons();
331  print $searchpicto;
332  print "</td></tr>\n";
333 
334  print '<tr class="liste_titre">';
335  print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
336  print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
337  //print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder);
338  print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
339  print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
340  //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
341  print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
342  print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
343  print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
344  print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
345  print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
346  print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
347  print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
348  $checkpicto = $form->showCheckAddButtons();
349  print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
350  print "</tr>\n";
351 
352  $thirdpartystatic = new Societe($db);
353  $facturefournisseur_static = new FactureFournisseur($db);
354  $productstatic = new ProductFournisseur($db);
355  $accountingaccountstatic = new AccountingAccount($db);
356 
357  $i = 0;
358  while ($i < min($num_lines, $limit))
359  {
360  $objp = $db->fetch_object($result);
361 
362  $facturefournisseur_static->ref = $objp->ref;
363  $facturefournisseur_static->id = $objp->facid;
364 
365  $thirdpartystatic->id = $objp->socid;
366  $thirdpartystatic->name = $objp->name;
367  $thirdpartystatic->client = $objp->client;
368  $thirdpartystatic->fournisseur = $objp->fournisseur;
369  $thirdpartystatic->code_client = $objp->code_client;
370  $thirdpartystatic->code_compta_client = $objp->code_compta_client;
371  $thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
372  $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
373  $thirdpartystatic->email = $objp->email;
374  $thirdpartystatic->country_code = $objp->country_code;
375 
376  $productstatic->ref = $objp->product_ref;
377  $productstatic->id = $objp->product_id;
378  $productstatic->label = $objp->product_label;
379  $productstatic->type = $objp->line_type;
380  $productstatic->status = $objp->tosell;
381  $productstatic->status_buy = $objp->tobuy;
382  $productstatic->accountancy_code_buy = $objp->accountancy_code_buy;
383  $productstatic->accountancy_code_buy_intra = $objp->accountancy_code_sell_buy;
384  $productstatic->accountancy_code_buy_export = $objp->accountancy_code_sell_buy;
385 
386  $accountingaccountstatic->rowid = $objp->fk_compte;
387  $accountingaccountstatic->label = $objp->label;
388  $accountingaccountstatic->labelshort = $objp->labelshort;
389  $accountingaccountstatic->account_number = $objp->account_number;
390 
391  print '<tr class="oddeven">';
392 
393  // Line id
394  print '<td>'.$objp->rowid.'</td>';
395 
396  // Ref Invoice
397  print '<td class="nowraponall">'.$facturefournisseur_static->getNomUrl(1).'</td>';
398 
399  print '<td class="tdoverflowonsmartphone">';
400  print $objp->invoice_label;
401  print '</td>';
402 
403  // Date invoice
404  print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day').'</td>';
405 
406  // Ref Product
407  print '<td class="tdoverflowmax100">';
408  if ($productstatic->id > 0) print $productstatic->getNomUrl(1);
409  if ($productstatic->id > 0 && $objp->product_label) print '<br>';
410  if ($objp->product_label) print '<span class="opacitymedium">'.$objp->product_label.'</span>';
411  print '</td>';
412 
413  print '<td class="tdoverflowonsmartphone">';
414  $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
415  $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
416  print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
417  print '</td>';
418 
419  print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
420 
421  print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
422 
423  // Thirdparty
424  print '<td class="tdoverflowmax100">'.$thirdpartystatic->getNomUrl(1, 'supplier').'</td>';
425 
426  // Country
427  print '<td>';
428  if ($objp->country_code)
429  {
430  print $langs->trans("Country".$objp->country_code).' ('.$objp->country_code.')';
431  }
432  print '</td>';
433 
434  print '<td>'.$objp->tva_intra.'</td>';
435 
436  print '<td class="center">';
437  print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1);
438  print ' <a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
439  print img_edit();
440  print '</a></td>';
441  print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="'.$objp->rowid.'"/></td>';
442 
443  print '</tr>';
444  $i++;
445  }
446  print '</table>';
447  print "</div>";
448 
449  if ($nbtotalofrecords > $limit) {
450  print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1);
451  }
452 
453  print '</form>';
454 } else {
455  print $db->lasterror();
456 }
457 
458 // End of page
459 llxFooter();
460 $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.
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
getCountriesInEEC()
Return list of countries that are inside the EEC (European Economic Community) Note: Try to keep this...
Class to manage suppliers invoices.
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.
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.
llxFooter()
Empty footer.
Definition: wrapper.php:59
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
Class to manage predefined suppliers products.