dolibarr  18.0.0-alpha
card.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
5  * Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
27 // Load Dolibarr environment
28 require '../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
33 
34 // Load translation files required by the page
35 $langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals'));
36 
37 // Get supervariables
38 $action = GETPOST('action', 'aZ09');
39 $id = GETPOST('id', 'int');
40 $ref = GETPOST('ref', 'alpha');
41 $socid = GETPOST('socid', 'int');
42 $type = GETPOST('type', 'aZ09');
43 
44 // Load variable for pagination
45 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
46 $sortfield = GETPOST('sortfield', 'aZ09comma');
47 $sortorder = GETPOST('sortorder', 'aZ09comma');
48 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
49 if (empty($page) || $page == -1) {
50  $page = 0;
51 } // If $page is not defined, or '' or -1
52 $offset = $limit * $page;
53 $pageprev = $page - 1;
54 $pagenext = $page + 1;
55 
56 if (!$sortfield) {
57  $sortfield = 'pl.rowid';
58 }
59 if (!$sortorder) {
60  $sortorder = 'ASC';
61 }
62 
63 $object = new BonPrelevement($db);
64 
65 // Load object
66 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
67 
68 $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist'));
69 
70 $type = $object->type;
71 
72 if ($type == 'bank-transfer') {
73  $result = restrictedArea($user, 'paymentbybanktransfer', '', '', '');
74 
75  $permissiontoadd = $user->hasRight('paymentbybanktransfer', 'read');
76  $permissiontosend = $user->hasRight('paymentbybanktransfer', 'send');
77  $permissiontocreditdebit = $user->hasRight('paymentbybanktransfer', 'debit');
78  $permissiontodelete = $user->hasRight('paymentbybanktransfer', 'read');
79 } else {
80  $result = restrictedArea($user, 'prelevement', '', '', 'bons');
81 
82  $permissiontoadd = $user->hasRight('prelevement', 'bons', 'read');
83  $permissiontosend = $user->hasRight('prelevement', 'bons', 'send');
84  $permissiontocreditdebit = $user->hasRight('prelevement', 'bons', 'credit');
85  $permissiontodelete = $user->hasRight('prelevement', 'bons', 'read');
86 }
87 
88 
89 
90 /*
91  * Actions
92  */
93 
94 $parameters = array('socid' => $socid);
95 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
96 if ($reshook < 0) {
97  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
98 }
99 
100 if (empty($reshook)) {
101  if ($action == 'setbankaccount' && $permissiontoadd) {
102  $object->oldcopy = dol_clone($object);
103  $object->fk_bank_account = GETPOST('fk_bank_account', 'int');
104  $object->update($user);
105  }
106 
107  if ($action == 'infotrans' && $permissiontosend) {
108  require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
109 
110  $dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
111 
112  /*
113  if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $object->ref)
114  {
115  $dir = $conf->prelevement->dir_output.'/receipts';
116 
117  if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . dol_unescapefile($_FILES['userfile']['name']),1) > 0)
118  {
119  $object->set_infotrans($user, $dt, GETPOST('methode','alpha'));
120  }
121 
122  header("Location: card.php?id=".$id);
123  exit;
124  }
125  else
126  {
127  dol_syslog("Fichier invalide",LOG_WARNING);
128  $mesg='BadFile';
129  }*/
130 
131  $error = $object->set_infotrans($user, $dt, GETPOST('methode', 'alpha'));
132 
133  if ($error) {
134  header("Location: card.php?id=".$id."&error=$error");
135  exit;
136  }
137  }
138 
139  // Set direct debit order to credited, create payment and close invoices
140  if ($action == 'infocredit' && $permissiontocreditdebit) {
141  $dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
142 
143  if (($object->type != 'bank-transfer' && $object->statut == BonPrelevement::STATUS_CREDITED) || ($object->type == 'bank-transfer' && $object->statut == BonPrelevement::STATUS_DEBITED)) {
144  $error = 1;
145  setEventMessages('WithdrawalCantBeCreditedTwice', array(), 'errors');
146  } else {
147  $error = $object->set_infocredit($user, $dt);
148  }
149 
150  if ($error) {
151  setEventMessages($object->error, $object->errors, 'errors');
152  }
153  }
154 
155  if ($action == 'confirm_delete' && $permissiontodelete) {
156  $savtype = $object->type;
157  $res = $object->delete($user);
158  if ($res > 0) {
159  if ($savtype == 'bank-transfer') {
160  header("Location: ".DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php');
161  } else {
162  header("Location: ".DOL_URL_ROOT.'/compta/prelevement/index.php');
163  }
164  exit;
165  }
166  }
167 }
168 
169 
170 
171 /*
172  * View
173  */
174 
175 $form = new Form($db);
176 
177 llxHeader('', $langs->trans("WithdrawalsReceipts"));
178 
179 if ($id > 0 || $ref) {
180  $head = prelevement_prepare_head($object);
181  print dol_get_fiche_head($head, 'prelevement', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
182 
183  if (GETPOST('error', 'alpha') != '') {
184  print '<div class="error">'.$object->getErrorString(GETPOST('error', 'alpha')).'</div>';
185  }
186 
187  $linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/orders_list.php?restore_lastsearch_values=1'.($object->type != 'bank-transfer' ? '' : '&type=bank-transfer').'">'.$langs->trans("BackToList").'</a>';
188 
189  dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
190 
191  print '<div class="fichecenter">';
192  print '<div class="underbanner clearboth"></div>';
193  print '<table class="border centpercent tableforfield">';
194 
195  print '<tr><td class="titlefieldcreate">'.$langs->trans("Date").'</td><td>'.dol_print_date($object->datec, 'day').'</td></tr>';
196 
197  print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount).'</span></td></tr>';
198 
199  if (!empty($object->date_trans)) {
200  $muser = new User($db);
201  $muser->fetch($object->user_trans);
202 
203  print '<tr><td>'.$langs->trans("TransData").'</td><td>';
204  print dol_print_date($object->date_trans, 'day');
205  print ' &nbsp; <span class="opacitymedium">'.$langs->trans("By").'</span> '.$muser->getNomUrl(-1).'</td></tr>';
206  print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
207  print $object->methodes_trans[$object->method_trans];
208  print '</td></tr>';
209  }
210  if (!empty($object->date_credit)) {
211  print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
212  print dol_print_date($object->date_credit, 'day');
213  print '</td></tr>';
214  }
215 
216  print '</table>';
217 
218  print '<br>';
219 
220  print '<div class="underbanner clearboth"></div>';
221  print '<table class="border centpercent tableforfield">';
222 
223  // Get bank account for the payment
224  $acc = new Account($db);
225  $fk_bank_account = $object->fk_bank_account;
226  if (empty($fk_bank_account)) {
227  $fk_bank_account = ($object->type == 'bank-transfer' ? getDolGlobalInt('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT') : getDolGlobalInt('PRELEVEMENT_ID_BANKACCOUNT'));
228  }
229  if ($fk_bank_account > 0) {
230  $result = $acc->fetch($fk_bank_account);
231  }
232 
233  // Bank account
234  $labelofbankfield = "BankToReceiveWithdraw";
235  if ($object->type == 'bank-transfer') {
236  $labelofbankfield = 'BankToPayCreditTransfer';
237  }
238  //print $langs->trans($labelofbankfield);
239  $caneditbank = $permissiontoadd;
240  if ($object->status != $object::STATUS_DRAFT) {
241  $caneditbank = 0;
242  }
243  /*
244  print '<tr><td class="titlefieldcreate">';
245  print $form->editfieldkey($langs->trans($labelofbankfield), 'fk_bank_account', $acc->id, $object, $caneditbank);
246  print '</td>';
247  print '<td>';
248  print $form->editfieldval($langs->trans($labelofbankfield), 'fk_bank_account', $acc->id, $acc, $caneditbank, 'string', '', null, null, '', 1, 'getNomUrl');
249  print '</td>';
250  print '</tr>';
251  */
252  print '<tr><td class="nowrap">';
253  print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
254  print $form->textwithpicto($langs->trans("BankAccount"), $langs->trans($labelofbankfield));
255  print '<td>';
256  if (($action != 'editbankaccount') && $caneditbank) {
257  print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editfkbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
258  }
259  print '</tr></table>';
260  print '</td><td>';
261  if ($action == 'editfkbankaccount') {
262  $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $fk_bank_account, 'fk_bank_account', 0);
263  } else {
264  $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $fk_bank_account, 'none');
265  }
266  print "</td>";
267  print '</tr>';
268 
269  // Donwload file
270  print '<tr><td class="titlefieldcreate">';
271  $labelfororderfield = 'WithdrawalFile';
272  if ($object->type == 'bank-transfer') {
273  $labelfororderfield = 'CreditTransferFile';
274  }
275  print $langs->trans($labelfororderfield).'</td><td>';
276  $relativepath = 'receipts/'.$object->ref.'.xml';
277  $modulepart = 'prelevement';
278  if ($object->type == 'bank-transfer') {
279  $modulepart = 'paymentbybanktransfer';
280  }
281  print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'">'.$relativepath;
282  print img_picto('', 'download', 'class="paddingleft"');
283  print '</a>';
284  print '</td></tr>';
285 
286  // Other attributes
287  $parameters = array();
288  $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
289  print $hookmanager->resPrint;
290 
291  print '</table>';
292 
293  print '</div>';
294 
295  print dol_get_fiche_end();
296 
297 
298  $formconfirm = '';
299 
300  // Confirmation to delete
301  if ($action == 'delete') {
302  $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Delete'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
303  }
304 
305  // Call Hook formConfirm
306  /*$parameters = array('formConfirm' => $formconfirm);
307  $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
308  if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
309  elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;*/
310 
311  // Print form confirm
312  print $formconfirm;
313 
314 
315  if (empty($object->date_trans) && (($user->rights->prelevement->bons->send && $object->type != 'bank-transfer') || ($user->rights->paymentbybanktransfer->send && $object->type == 'bank-transfer')) && $action == 'settransmitted') {
316  print '<form method="post" name="userfile" action="card.php?id='.$object->id.'" enctype="multipart/form-data">';
317  print '<input type="hidden" name="token" value="'.newToken().'">';
318  print '<input type="hidden" name="action" value="infotrans">';
319  print '<table class="noborder centpercent">';
320  print '<tr class="liste_titre">';
321  print '<td colspan="3">'.$langs->trans("NotifyTransmision").'</td></tr>';
322  print '<tr class="oddeven"><td>'.$langs->trans("TransData").'</td><td>';
323  print $form->selectDate('', '', '', '', '', "userfile", 1, 1);
324  print '</td></tr>';
325  print '<tr class="oddeven"><td>'.$langs->trans("TransMetod").'</td><td>';
326  print $form->selectarray("methode", $object->methodes_trans);
327  print '</td></tr>';
328  print '</table>';
329  print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("SetToStatusSent")).'"></div>';
330  print '</form>';
331  print '<br>';
332  }
333 
334  if (!empty($object->date_trans) && empty($object->date_credit) && (($user->rights->prelevement->bons->credit && $object->type != 'bank-transfer') || ($user->rights->paymentbybanktransfer->debit && $object->type == 'bank-transfer')) && $action == 'setcredited') {
335  $btnLabel = ($object->type == 'bank-transfer') ? $langs->trans("ClassDebited") : $langs->trans("ClassCredited");
336  print '<form name="infocredit" method="post" action="card.php?id='.$object->id.'">';
337  print '<input type="hidden" name="token" value="'.newToken().'">';
338  print '<input type="hidden" name="action" value="infocredit">';
339  print '<table class="noborder centpercent">';
340  print '<tr class="liste_titre">';
341  print '<td colspan="3">'.$langs->trans("NotifyCredit").'</td></tr>';
342  print '<tr class="oddeven"><td>'.$langs->trans('CreditDate').'</td><td>';
343  print $form->selectDate(-1, '', '', '', '', "infocredit", 1, 1);
344  print '</td></tr>';
345  print '</table>';
346  print '<br><div class="center"><span class="opacitymedium">'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice").'</span></div>';
347  print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($btnLabel).'"></div>';
348  print '</form>';
349  print '<br>';
350  }
351 
352  // Actions
353  if ($action != 'settransmitted' && $action != 'setcredited') {
354  print "\n".'<div class="tabsAction">'."\n";
355  $parameters = array();
356  $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
357  if (empty($reshook)) {
358  if (empty($object->date_trans)) {
359  if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->send);
360  else print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->send);
361  }
362  if (!empty($object->date_trans) && empty($object->date_credit)) {
363  if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("ClassDebited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->debit);
364  else print dolGetButtonAction($langs->trans("ClassCredited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->credit);
365  }
366 
367  if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("Delete"), '', 'delete', 'card.php?action=delete&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->create);
368  else print dolGetButtonAction($langs->trans("Delete"), '', 'delete', 'card.php?action=delete&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->creer);
369  }
370  print '</div>';
371  }
372 
373 
374  $ligne = new LignePrelevement($db);
375 
376  /*
377  * Lines into withdraw request
378  */
379  $sql = "SELECT pl.rowid, pl.statut, pl.amount,";
380  $sql .= " s.rowid as socid, s.nom as name";
381  $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl";
382  $sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb";
383  $sql .= ", ".MAIN_DB_PREFIX."societe as s";
384  $sql .= " WHERE pl.fk_prelevement_bons = ".((int) $id);
385  $sql .= " AND pl.fk_prelevement_bons = pb.rowid";
386  $sql .= " AND pb.entity = ".((int) $conf->entity); // No sharing of entity here
387  $sql .= " AND pl.fk_soc = s.rowid";
388  if ($socid) {
389  $sql .= " AND s.rowid = ".((int) $socid);
390  }
391  $sql .= $db->order($sortfield, $sortorder);
392 
393  // Count total nb of records
394  $nbtotalofrecords = '';
395  if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
396  $result = $db->query($sql);
397  $nbtotalofrecords = $db->num_rows($result);
398  if (($page * $limit) > $nbtotalofrecords) {
399  // if total resultset is smaller then paging size (filtering), goto and load page 0
400  $page = 0;
401  $offset = 0;
402  }
403  }
404 
405  $sql .= $db->plimit($limit + 1, $offset);
406 
407  $result = $db->query($sql);
408 
409  if ($result) {
410  $num = $db->num_rows($result);
411  $i = 0;
412 
413  $urladd = "&id=".urlencode($id);
414  if ($limit > 0 && $limit != $conf->liste_limit) {
415  $urladd .= '&limit='.urlencode($limit);
416  }
417 
418  print '<form method="POST" action="'.$_SERVER ['PHP_SELF'].'" name="search_form">'."\n";
419  print '<input type="hidden" name="token" value="'.newToken().'"/>';
420  print '<input type="hidden" name="id" value="'.$id.'"/>';
421  print '<input type="hidden" name="socid" value="'.$socid.'"/>';
422  if (!empty($page)) {
423  print '<input type="hidden" name="page" value="'.$page.'"/>';
424  }
425  if (!empty($limit)) {
426  print '<input type="hidden" name="limit" value="'.$limit.'"/>';
427  }
428  if (!empty($sortfield)) {
429  print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
430  }
431  if (!empty($sortorder)) {
432  print '<input type="hidden" name="sortorder" value="'.$sortorder.'"/>';
433  }
434  print_barre_liste($langs->trans("Lines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit);
435 
436  print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
437  print '<table class="noborder liste" width="100%" cellpadding="4">';
438  print '<tr class="liste_titre">';
439  print_liste_field_titre("Lines", $_SERVER["PHP_SELF"], "pl.rowid", '', $urladd, '', $sortfield, $sortorder);
440  print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $urladd, '', $sortfield, $sortorder);
441  print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $urladd, 'class="right"', $sortfield, $sortorder);
443  print "</tr>\n";
444 
445  $total = 0;
446 
447  while ($i < min($num, $limit)) {
448  $obj = $db->fetch_object($result);
449 
450  print '<tr class="oddeven">';
451 
452  // Status of line
453  print "<td>";
454  print '<a class="valignmiddle" href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'&type='.$object->type.'&token='.newToken().'">';
455  print $ligne->LibStatut($obj->statut, 2);
456  print '<span class="paddingleft">'.$obj->rowid.'</span>';
457  print '</a></td>';
458 
459  $thirdparty = new Societe($db);
460  $thirdparty->fetch($obj->socid);
461  print '<td>';
462  print $thirdparty->getNomUrl(1);
463  print "</td>\n";
464 
465  print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>\n";
466 
467  print '<td class="right">';
468 
469  if ($obj->statut == 3) {
470  print '<b>'.$langs->trans("StatusRefused").'</b>';
471  } else {
472  if ($object->statut == BonPrelevement::STATUS_CREDITED) {
473  if ($obj->statut == 2) {
474  if ($user->rights->prelevement->bons->credit) {
475  //print '<a class="butActionDelete" href="line.php?action=rejet&id='.$obj->rowid.'">'.$langs->trans("StandingOrderReject").'</a>';
476  print '<a href="line.php?action=rejet&type='.$object->type.'&id='.$obj->rowid.'&token='.newToken().'">'.$langs->trans("StandingOrderReject").'</a>';
477  } else {
478  //print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("StandingOrderReject").'</a>';
479  }
480  }
481  } else {
482  //print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotPossibleForThisStatusOfWithdrawReceiptORLine").'">'.$langs->trans("StandingOrderReject").'</a>';
483  }
484  }
485 
486  print '</td></tr>';
487 
488  $total += $obj->amount;
489 
490  $i++;
491  }
492 
493  if ($num > 0) {
494  $total = price2num($total, 'MT');
495 
496  print '<tr class="liste_total">';
497  print '<td>'.$langs->trans("Total").'</td>';
498  print '<td>&nbsp;</td>';
499  print '<td class="right">';
500  if (empty($offset) && $num <= $limit) {
501  // If we have all record on same page, then the following test/warning can be done
502  if ($total != $object->amount) {
503  print img_warning($langs->trans("TotalAmountOfdirectDebitOrderDiffersFromSumOfLines"));
504  }
505  }
506  print price($total);
507  print "</td>\n";
508  print '<td>&nbsp;</td>';
509  print "</tr>\n";
510  }
511 
512  print "</table>";
513  print '</div>';
514  print '</form>';
515 
516  $db->free($result);
517  } else {
518  dol_print_error($db);
519  }
520 }
521 
522 // End of page
523 llxFooter();
524 $db->close();
Societe
Class to manage third parties objects (customers, suppliers, prospects...)
Definition: societe.class.php:50
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:70
LignePrelevement
Class to manage withdrawals.
Definition: ligneprelevement.class.php:32
$sql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
Definition: index.php:745
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:530
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4994
img_warning
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
Definition: functions.lib.php:4671
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
dol_clone
dol_clone($object, $native=0)
Create a clone of instance of object (new instance with same value for each properties) With native =...
Definition: functions.lib.php:1168
img_edit
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
Definition: functions.lib.php:4539
dol_banner_tab
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
Definition: functions.lib.php:2097
price2num
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
Definition: functions.lib.php:5834
dol_print_date
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Definition: functions.lib.php:2566
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:4025
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
BonPrelevement
Class to manage withdrawal receipts.
Definition: bonprelevement.class.php:43
$formconfirm
$formconfirm
if ($action == 'delbookkeepingyear') {
Definition: listbyaccount.php:634
print_barre_liste
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.
Definition: functions.lib.php:5416
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1873
restrictedArea
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
Definition: security.lib.php:341
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:11317
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2069
User
Class to manage Dolibarr users.
Definition: user.class.php:44
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:431
print_liste_field_titre
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
Definition: functions.lib.php:5181
dolGetButtonAction
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
Definition: functions.lib.php:10880
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
$parameters
$parameters
Actions.
Definition: card.php:79
price
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.
Definition: functions.lib.php:5708
prelevement_prepare_head
prelevement_prepare_head(BonPrelevement $object)
Prepare array with list of tabs.
Definition: prelevement.lib.php:34
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8509
dol_mktime
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
Definition: functions.lib.php:2859
getDolGlobalInt
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
Definition: functions.lib.php:96
$nbtotalofrecords
$nbtotalofrecords
Count total nb of records.
Definition: list.php:329
Account
Class to manage bank accounts.
Definition: account.class.php:39