dolibarr  7.0.0-beta
ligne.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2003 Xavier DUTOIT <doli@sydesy.com>
4  * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
5  * Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
6  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
7  * Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@zendsi.com>
8  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
9  * Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program. If not, see <http://www.gnu.org/licenses/>.
23  */
24 
31 require('../../main.inc.php');
32 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
34 
35 $langs->load("banks");
36 $langs->load("categories");
37 $langs->load("compta");
38 $langs->load("bills");
39 if (! empty($conf->adherent->enabled)) $langs->load("members");
40 if (! empty($conf->don->enabled)) $langs->load("donations");
41 if (! empty($conf->loan->enabled)) $langs->load("loan");
42 if (! empty($conf->salaries->enabled)) $langs->load("salaries");
43 
44 
45 $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int'));
46 $ref = GETPOST('ref','alpha');
47 $action=GETPOST('action','alpha');
48 $confirm=GETPOST('confirm','alpha');
49 $rowid=GETPOST("rowid",'int');
50 $orig_account=GETPOST("orig_account");
51 $backtopage=GETPOST('backtopage','alpha');
52 $cancel=GETPOST('cancel','alpha');
53 
54 // Security check
55 $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref :''));
56 $fieldtype = (! empty($ref) ? 'ref' :'rowid');
57 if ($user->societe_id) $socid=$user->societe_id;
58 $result=restrictedArea($user,'banque',$fieldvalue,'bank_account','','',$fieldtype);
59 if (! $user->rights->banque->lire && ! $user->rights->banque->consolidate) accessforbidden();
60 
61 
62 /*
63  * Actions
64  */
65 if ($cancel)
66 {
67  if ($backtopage)
68  {
69  header("Location: ".$backtopage);
70  exit;
71  }
72 }
73 
74 
75 if ($user->rights->banque->consolidate && $action == 'donext')
76 {
77  $al = new AccountLine($db);
78  $al->dateo_next($_GET["rowid"]);
79 }elseif ($user->rights->banque->consolidate && $action == 'doprev')
80 {
81  $al = new AccountLine($db);
82  $al->dateo_previous($_GET["rowid"]);
83 }elseif ($user->rights->banque->consolidate && $action == 'dvnext')
84 {
85  $al = new AccountLine($db);
86  $al->datev_next($_GET["rowid"]);
87 }elseif ($user->rights->banque->consolidate && $action == 'dvprev')
88 {
89  $al = new AccountLine($db);
90  $al->datev_previous($_GET["rowid"]);
91 }
92 
93 if ($action == 'confirm_delete_categ' && $confirm == "yes" && $user->rights->banque->modifier)
94 {
95  $cat1=GETPOST("cat1",'int');
96  if (!empty($rowid) && !empty($cat1)) {
97  $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = ".$rowid." AND fk_categ = ".$cat1;
98  if (! $db->query($sql))
99  {
100  dol_print_error($db);
101  }
102  } else {
103  setEventMessage('Missing ids','errors');
104  }
105 }
106 
107 if ($user->rights->banque->modifier && $action == "update")
108 {
109  $error=0;
110 
111  $ac = new Account($db);
112  $ac->fetch($id);
113 
114  if ($ac->courant == Account::TYPE_CASH && $_POST['value'] != 'LIQ')
115  {
116  setEventMessages($langs->trans("ErrorCashAccountAcceptsOnlyCashMoney"), null, 'errors');
117  $error++;
118  }
119 
120  if (! $error)
121  {
122  // Avant de modifier la date ou le montant, on controle si ce n'est pas encore rapproche
123  $conciliated=0;
124  $sql = "SELECT b.rappro FROM ".MAIN_DB_PREFIX."bank as b WHERE rowid=".$rowid;
125  $result = $db->query($sql);
126  if ($result)
127  {
128  $objp = $db->fetch_object($result);
129  $conciliated=$objp->rappro;
130  }
131 
132  $db->begin();
133 
134  $amount = price2num($_POST['amount']);
135  $dateop = dol_mktime(12,0,0,$_POST["dateomonth"],$_POST["dateoday"],$_POST["dateoyear"]);
136  $dateval= dol_mktime(12,0,0,$_POST["datevmonth"],$_POST["datevday"],$_POST["datevyear"]);
137  $sql = "UPDATE ".MAIN_DB_PREFIX."bank";
138  $sql.= " SET ";
139  // Always opened
140  if (isset($_POST['value'])) $sql.=" fk_type='".$db->escape($_POST['value'])."',";
141  if (isset($_POST['num_chq'])) $sql.=" num_chq='".$db->escape($_POST["num_chq"])."',";
142  if (isset($_POST['banque'])) $sql.=" banque='".$db->escape($_POST["banque"])."',";
143  if (isset($_POST['emetteur'])) $sql.=" emetteur='".$db->escape($_POST["emetteur"])."',";
144  // Blocked when conciliated
145  if (! $conciliated)
146  {
147  if (isset($_POST['label'])) $sql.=" label='".$db->escape($_POST["label"])."',";
148  if (isset($_POST['amount'])) $sql.=" amount='".$amount."',";
149  if (isset($_POST['dateomonth'])) $sql.=" dateo = '".$db->idate($dateop)."',";
150  if (isset($_POST['datevmonth'])) $sql.=" datev = '".$db->idate($dateval)."',";
151  }
152  $sql.= " fk_account = ".$id;
153  $sql.= " WHERE rowid = ".$rowid;
154 
155  $result = $db->query($sql);
156  if (! $result)
157  {
158  $error++;
159  }
160 
161  if (! $error)
162  {
163  $arrayofcategs=GETPOST('custcats', 'array');
164  $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = ".$rowid;
165  if (! $db->query($sql))
166  {
167  $error++;
168  dol_print_error($db);
169  }
170  if (count($arrayofcategs))
171  {
172  foreach($arrayofcategs as $val)
173  {
174  $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_class (lineid, fk_categ) VALUES (".$rowid.", ".$val.")";
175  if (! $db->query($sql))
176  {
177  $error++;
178  dol_print_error($db);
179  }
180  }
181  // $arrayselected will be loaded after in page output
182  }
183  }
184 
185  if (! $error)
186  {
187  setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
188  $db->commit();
189  }
190  else
191  {
192  $db->rollback();
193  dol_print_error($db);
194  }
195  }
196 }
197 
198 // Reconcile
199 if ($user->rights->banque->consolidate && ($action == 'num_releve' || $action == 'setreconcile'))
200 {
201  $num_rel=trim($_POST["num_rel"]);
202  $rappro=$_POST['reconciled']?1:0;
203 
204  // Check parameters
205  if ($rappro && empty($num_rel))
206  {
207  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountStatement")), null, 'errors');
208  $error++;
209  }
210 
211  if (! $error)
212  {
213  $db->begin();
214 
215  $sql = "UPDATE ".MAIN_DB_PREFIX."bank";
216  $sql.= " SET num_releve=".($num_rel?"'".$num_rel."'":"null");
217  if (empty($num_rel)) $sql.= ", rappro = 0";
218  else $sql.=", rappro = ".$rappro;
219  $sql.= " WHERE rowid = ".$rowid;
220 
221  dol_syslog("ligne.php", LOG_DEBUG);
222  $result = $db->query($sql);
223  if ($result)
224  {
225  setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
226  $db->commit();
227  }
228  else
229  {
230  $db->rollback();
231  dol_print_error($db);
232  }
233  }
234 }
235 
236 
237 
238 /*
239  * View
240  */
241 
242 $form = new Form($db);
243 
244 llxHeader('', $langs->trans("BankTransaction"));
245 
246 $c = new Categorie($db);
247 $cats = $c->containing($rowid, Categorie::TYPE_BANK_LINE);
248 foreach ($cats as $cat) {
249  $arrayselected[] = $cat->id;
250 }
251 
252 $tabs = array(
253  array(
254  DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$rowid,
255  $langs->trans('Card')
256  ),
257  array(
258  DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$rowid,
259  $langs->trans('Info')
260  )
261 );
262 
263 
264 $sql = "SELECT b.rowid,b.dateo as do,b.datev as dv, b.amount, b.label, b.rappro,";
265 $sql.= " b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, b.fk_account, b.fk_bordereau as receiptid,";
266 $sql.= " b.emetteur,b.banque";
267 $sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
268 $sql.= " WHERE rowid=".$rowid;
269 $sql.= " ORDER BY dateo ASC";
270 $result = $db->query($sql);
271 if ($result)
272 {
273  $i = 0; $total = 0;
274  if ($db->num_rows($result))
275  {
276  $objp = $db->fetch_object($result);
277 
278  $total = $total + $objp->amount;
279 
280  $acct=new Account($db);
281  $acct->fetch($objp->fk_account);
282  $account = $acct->id;
283 
284  $bankline = new AccountLine($db);
285  $bankline->fetch($rowid,$ref);
286 
287  $links=$acct->get_url($rowid);
288  $bankline->load_previous_next_ref('','rowid');
289 
290  // Confirmations
291  if ($action == 'delete_categ')
292  {
293  print $form->formconfirm($_SERVER['PHP_SELF']."?rowid=".$rowid."&cat1=".GETPOST("fk_categ")."&orig_account=".$orig_account, $langs->trans("RemoveFromRubrique"), $langs->trans("RemoveFromRubriqueConfirm"), "confirm_delete_categ", '', 'yes', 1);
294 
295  }
296 
297  print '<form name="update" method="POST" action="'.$_SERVER['PHP_SELF'].'?rowid='.$rowid.'">';
298  print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
299  print '<input type="hidden" name="action" value="update">';
300  print '<input type="hidden" name="orig_account" value="'.$orig_account.'">';
301  print '<input type="hidden" name="id" value="'.$acct->id.'">';
302 
303  dol_fiche_head($tabs, 0, $langs->trans('LineRecord'), 0, 'account');
304 
305  $linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
306 
307 
308  dol_banner_tab($bankline, 'rowid', $linkback);
309 
310 
311  print '<div class="underbanner clearboth"></div>';
312  print '<table class="border" width="100%">';
313 
314  // Ref
315  /*
316  print '<tr><td class="titlefield">'.$langs->trans("Ref")."</td>";
317  print '<td>';
318  print $form->showrefnav($bankline, 'rowid', $linkback, 1, 'rowid', 'rowid');
319  print '</td>';
320  print '</tr>';
321  */
322 
323  $i++;
324 
325  // Bank account
326  print '<tr><td class="titlefield">'.$langs->trans("Account").'</td>';
327  print '<td>';
328  print $acct->getNomUrl(1,'transactions','reflabel');
329  print '</td>';
330  print '</tr>';
331 
332  // Show links of bank transactions
333  if (count($links))
334  {
335  print '<tr><td class="tdtop">'.$langs->trans("Links").'</td>';
336  print '<td>';
337  foreach($links as $key=>$val)
338  {
339  if ($key) print '<br>';
340  if ($links[$key]['type']=='payment') {
341  print '<a href="'.DOL_URL_ROOT.'/compta/paiement/card.php?id='.$links[$key]['url_id'].'">';
342  print img_object($langs->trans('ShowPayment'),'payment').' ';
343  print $langs->trans("Payment");
344  print '</a>';
345  }
346  else if ($links[$key]['type']=='payment_supplier') {
347  print '<a href="'.DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$links[$key]['url_id'].'">';
348  print img_object($langs->trans('ShowPayment'),'payment').' ';
349  print $langs->trans("Payment");
350  print '</a>';
351  }
352  else if ($links[$key]['type']=='company') {
353  $societe=new Societe($db);
354  $societe->fetch($links[$key]['url_id']);
355  print $societe->getNomUrl(1);
356  }
357  else if ($links[$key]['type']=='sc') {
358  print '<a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$links[$key]['url_id'].'">';
359  print img_object($langs->trans('ShowSocialContribution'),'bill').' ';
360  print $langs->trans("SocialContribution").($links[$key]['label']?' - '.$links[$key]['label']:'');
361  print '</a>';
362  }
363  else if ($links[$key]['type']=='payment_sc') {
364  print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$links[$key]['url_id'].'">';
365  print img_object($langs->trans('ShowPayment'),'payment').' ';
366  print $langs->trans("SocialContributionPayment");
367  print '</a>';
368  }
369  else if ($links[$key]['type']=='payment_vat') {
370  print '<a href="'.DOL_URL_ROOT.'/compta/tva/card.php?id='.$links[$key]['url_id'].'">';
371  print img_object($langs->trans('ShowVAT'),'payment').' ';
372  print $langs->trans("VATPayment");
373  print '</a>';
374  }
375  else if ($links[$key]['type']=='payment_salary') {
376  print '<a href="'.DOL_URL_ROOT.'/compta/salaries/card.php?id='.$links[$key]['url_id'].'">';
377  print img_object($langs->trans('ShowPaymentSalary'),'payment').' ';
378  print $langs->trans("SalaryPayment");
379  print '</a>';
380  }
381  else if ($links[$key]['type']=='payment_loan') {
382  print '<a href="'.DOL_URL_ROOT.'/loan/payment/card.php?id='.$links[$key]['url_id'].'">';
383  print img_object($langs->trans('ShowLoanPayment'),'payment').' ';
384  print $langs->trans("PaymentLoan");
385  print '</a>';
386  }
387  else if ($links[$key]['type']=='loan') {
388  print '<a href="'.DOL_URL_ROOT.'/loan/card.php?id='.$links[$key]['url_id'].'">';
389  print img_object($langs->trans('ShowLoan'),'bill').' ';
390  print $langs->trans("Loan");
391  print '</a>';
392  }
393  else if ($links[$key]['type']=='member') {
394  print '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$links[$key]['url_id'].'">';
395  print img_object($langs->trans('ShowMember'),'user').' ';
396  print $links[$key]['label'];
397  print '</a>';
398  }
399  else if ($links[$key]['type']=='payment_donation') {
400  print '<a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$links[$key]['url_id'].'">';
401  print img_object($langs->trans('ShowDonation'),'payment').' ';
402  print $langs->trans("DonationPayment");
403  print '</a>';
404  }
405  else if ($links[$key]['type']=='banktransfert') {
406  print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$links[$key]['url_id'].'">';
407  print img_object($langs->trans('ShowTransaction'),'payment').' ';
408  print $langs->trans("TransactionOnTheOtherAccount");
409  print '</a>';
410  }
411  else if ($links[$key]['type']=='user') {
412  print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$links[$key]['url_id'].'">';
413  print img_object($langs->trans('ShowUser'),'user').' ';
414  print $langs->trans("User");
415  print '</a>';
416  }
417  else if ($links[$key]['type']=='payment_various') {
418  print '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$links[$key]['url_id'].'">';
419  print img_object($langs->trans('ShowVariousPayment'),'payment').' ';
420  print $langs->trans("VariousPayment");
421  print '</a>';
422  }
423  else {
424  print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
425  print img_object('','generic').' ';
426  print $links[$key]['label'];
427  print '</a>';
428  }
429  }
430  print '</td></tr>';
431  }
432 
433  //$user->rights->banque->modifier=false;
434  //$user->rights->banque->consolidate=true;
435 
436  // Type of payment / Number
437  print "<tr><td>".$langs->trans("Type")." / ".$langs->trans("Numero");
438  print "</td>";
439  if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
440  {
441  print '<td>';
442  $form->select_types_paiements($objp->fk_type,"value",'',2);
443  print '<input type="text" class="flat" name="num_chq" value="'.(empty($objp->num_chq) ? '' : $objp->num_chq).'">';
444  if ($objp->receiptid)
445  {
446  include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
447  $receipt=new RemiseCheque($db);
448  $receipt->fetch($objp->receiptid);
449  print ' &nbsp; &nbsp; '.$langs->trans("CheckReceipt").': '.$receipt->getNomUrl(2);
450 
451  }
452  print '</td>';
453  }
454  else
455  {
456  print '<td>'.$objp->fk_type.' '.$objp->num_chq.'</td>';
457  }
458  print "</tr>";
459 
460  // Bank of cheque
461  print "<tr><td>".$langs->trans("Bank")."</td>";
462  if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
463  {
464  print '<td>';
465  print '<input type="text" class="flat minwidth200" name="banque" value="'.(empty($objp->banque) ? '' : $objp->banque).'">';
466  print '</td>';
467  }
468  else
469  {
470  print '<td>'.$objp->banque.'</td>';
471  }
472  print "</tr>";
473 
474  // Transmitter
475  print "<tr><td>".$langs->trans("CheckTransmitter")."</td>";
476  if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
477  {
478  print '<td>';
479  print '<input type="text" class="flat minwidth200" name="emetteur" value="'.(empty($objp->emetteur) ? '' : stripslashes($objp->emetteur)).'">';
480  print '</td>';
481  }
482  else
483  {
484  print '<td>'.$objp->emetteur.'</td>';
485  }
486  print "</tr>";
487 
488  // Date ope
489  print '<tr><td>'.$langs->trans("DateOperation").'</td>';
490  if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
491  {
492  print '<td>';
493  print $form->select_date($db->jdate($objp->do),'dateo','','','','update',1,0,1,$objp->rappro);
494  if (! $objp->rappro)
495  {
496  print ' &nbsp; ';
497  print '<a href="'.$_SERVER['PHP_SELF'].'?action=doprev&amp;id='.$id.'&amp;rowid='.$objp->rowid.'">';
498  print img_edit_remove() . "</a> ";
499  print '<a href="'.$_SERVER['PHP_SELF'].'?action=donext&amp;id='.$id.'&amp;rowid='.$objp->rowid.'">';
500  print img_edit_add() ."</a>";
501  }
502  print '</td>';
503  }
504  else
505  {
506  print '<td>';
507  print dol_print_date($db->jdate($objp->do),"day");
508  print '</td>';
509  }
510  print '</tr>';
511 
512  // Value date
513  print "<tr><td>".$langs->trans("DateValue")."</td>";
514  if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
515  {
516  print '<td>';
517  print $form->select_date($db->jdate($objp->dv),'datev','','','','update',1,0,1,$objp->rappro);
518  if (! $objp->rappro)
519  {
520  print ' &nbsp; ';
521  print '<a href="'.$_SERVER['PHP_SELF'].'?action=dvprev&amp;id='.$id.'&amp;rowid='.$objp->rowid.'">';
522  print img_edit_remove() . "</a> ";
523  print '<a href="'.$_SERVER['PHP_SELF'].'?action=dvnext&amp;id='.$id.'&amp;rowid='.$objp->rowid.'">';
524  print img_edit_add() ."</a>";
525  }
526  print '</td>';
527  }
528  else
529  {
530  print '<td>';
531  print dol_print_date($db->jdate($objp->dv),"day");
532  print '</td>';
533  }
534  print "</tr>";
535 
536  // Description
537  print "<tr><td>".$langs->trans("Label")."</td>";
538  if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
539  {
540  print '<td>';
541  print '<input name="label" class="flat minwidth300" '.($objp->rappro?' disabled':'').' value="';
542  if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
543  {
544  // Label generique car entre parentheses. On l'affiche en le traduisant
545  print $langs->trans($reg[1]);
546  }
547  else
548  {
549  print $objp->label;
550  }
551  print '">';
552  print '</td>';
553  }
554  else
555  {
556  print '<td>';
557  if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
558  {
559  // Label generique car entre parentheses. On l'affiche en le traduisant
560  print $langs->trans($reg[1]);
561  }
562  else
563  {
564  print $objp->label;
565  }
566  print '</td>';
567  }
568  print '</tr>';
569 
570  // Amount
571  print "<tr><td>".$langs->trans("Amount")."</td>";
572  if ($user->rights->banque->modifier)
573  {
574  print '<td>';
575  print '<input name="amount" class="flat maxwidth100" '.($objp->rappro?' disabled':'').' value="'.price($objp->amount).'"> '.$langs->trans("Currency".$acct->currency_code);
576  print '</td>';
577  }
578  else
579  {
580  print '<td>';
581  print price($objp->amount);
582  print '</td>';
583  }
584  print "</tr>";
585 
586  // Categories
587  if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
588  {
589  $langs->load('categories');
590 
591  // Bank line
592  print '<tr><td class="toptd">' . fieldLabel('RubriquesTransactions', 'custcats') . '</td><td>';
593  $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, null, 'parent', null, null, 1);
594  print $form->multiselectarray('custcats', $cate_arbo, $arrayselected, null, null, null, null, "90%");
595  print "</td></tr>";
596  }
597 
598  print "</table>";
599 
600  dol_fiche_end();
601 
602 
603  print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Update").'"></div><br>';
604 
605  print "</form>";
606 
607 
608 
609  // Releve rappro
610  if ($acct->canBeConciliated() > 0) // Si compte rapprochable
611  {
612  print load_fiche_titre($langs->trans("Reconciliation"), '', 'title_bank.png');
613  print '<hr>'."\n";
614 
615  print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?rowid='.$objp->rowid.'">';
616  print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
617  print '<input type="hidden" name="action" value="setreconcile">';
618  print '<input type="hidden" name="orig_account" value="'.$orig_account.'">';
619  print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
620 
621  print '<table class="border" width="100%">';
622 
623  print '<tr><td class="titlefield">'.$langs->trans("Conciliation")."</td>";
624  if ($user->rights->banque->consolidate)
625  {
626  print '<td>';
627  if ($objp->rappro)
628  {
629  print $langs->trans("AccountStatement").' <input name="num_rel_bis" class="flat" value="'.$objp->num_releve.'"'.($objp->rappro?' disabled':'').'>';
630  print '<input name="num_rel" type="hidden" value="'.$objp->num_releve.'">';
631  }
632  else
633  {
634  print $langs->trans("AccountStatement").' <input name="num_rel" class="flat" value="'.$objp->num_releve.'"'.($objp->rappro?' disabled':'').'>';
635  }
636  if ($objp->num_releve) print ' &nbsp; (<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?num='.$objp->num_releve.'&account='.$acct->id.'">'.$langs->trans("AccountStatement").' '.$objp->num_releve.')</a>';
637  print '</td>';
638  }
639  else
640  {
641  print '<td>'.$objp->num_releve.'&nbsp;</td>';
642  }
643  print '</tr>';
644 
645  print "<tr><td>".$langs->trans("BankLineConciliated")."</td>";
646  if ($user->rights->banque->consolidate)
647  {
648  print '<td>';
649  print '<input type="checkbox" name="reconciled" class="flat" '.(isset($_POST["reconciled"])?($_POST["reconciled"]?' checked="checked"':''):($objp->rappro?' checked="checked"':'')).'">';
650  print '</td>';
651  }
652  else
653  {
654  print '<td>'.yn($objp->rappro).'</td>';
655  }
656  print '</tr>';
657  print '</table>';
658 
659  print '<div class="center">';
660 
661  print '<input type="submit" class="button" value="'.$langs->trans("Update").'">';
662  if ($backtopage)
663  {
664  print ' &nbsp; ';
665  print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
666  }
667  print '</div>';
668 
669  print '</form>';
670  }
671 
672  }
673 
674  $db->free($result);
675 }
676 else dol_print_error($db);
677 
678 llxFooter();
679 
680 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
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...
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
Show tab header of a card.
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.
Class to manage bank transaction lines.
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
if(empty($reshook)) $form
View.
Definition: perms.php:103
Class to manage bank accounts.
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage categories.
dol_fiche_end($notab=0)
Show tab footer of a card.
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
Load a title with picto.
llxHeader()
Empty header.
Definition: wrapper.php:46
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
const TYPE_CASH
Cash account.
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).
img_edit_add($titlealt= 'default', $other= '')
Show logo +.
print
Draft customers invoices.
Definition: index.php:91
setEventMessage($mesgs, $style='mesgs')
Set event message in dol_events session object.
fieldLabel($langkey, $fieldkey, $fieldrequired=0)
Show a string with the label tag dedicated to the HTML edit field.
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is '...
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $objcanvas=null)
Check permissions of a user to show a page and an object.
Class to manage cheque delivery receipts.
img_edit_remove($titlealt= 'default', $other='')
Show logo -.