31require
'../../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/tva.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/fourn/class/paiementfourn.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/don/class/paymentdonation.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/loan/class/paymentloan.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
51$langs->loadLangs(array(
"banks",
"categories",
"companies",
"bills",
"trips",
"donations",
"loan",
"salaries"));
53$action =
GETPOST(
'action',
'aZ09');
56$dvid =
GETPOST(
'dvid',
'alpha');
57$numref =
GETPOST(
'num',
'alpha');
59$brref =
GETPOST(
'brref',
'alpha');
60$oldbankreceipt =
GETPOST(
'oldbankreceipt',
'alpha');
61$newbankreceipt =
GETPOST(
'newbankreceipt',
'alpha');
62$rel =
GETPOST(
"rel",
'alphanohtml');
63$backtopage =
GETPOST(
'backtopage',
'alpha');
66$hookmanager->initHooks(array(
'bankaccountstatement',
'globalcard'));
68if ($user->hasRight(
'banque',
'consolidate') && $action ==
'dvnext' && !empty($dvid)) {
70 $al->datev_next($dvid);
73if ($user->hasRight(
'banque',
'consolidate') && $action ==
'dvprev' && !empty($dvid)) {
75 $al->datev_previous($dvid);
79$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
80$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
81$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
82$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
83$pageplusone =
GETPOST(
"pageplusone",
'int');
85 $page = $pageplusone - 1;
87if (empty($page) || $page == -1) {
90$offset = $limit * $page;
101if ($id > 0 || !empty($ref)) {
102 $result = $object->fetch($id, $ref);
108$contextpage =
'banktransactionlist'.(empty($object->ref) ?
'' :
'-'.$object->id);
111$fieldid = (!empty($ref) ? $ref : $id);
112$fieldname = (!empty($ref) ?
'ref' :
'rowid');
114 $socid = $user->socid;
117$result =
restrictedArea($user,
'banque', $fieldid,
'bank_account',
'',
'', $fieldname);
125$sql =
"SELECT b.num_releve as num";
126$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
127$sql .=
" WHERE b.num_releve < '".$db->escape($numref).
"'";
128$sql .=
" AND b.num_releve <> ''";
129$sql .=
" AND b.fk_account = ".((int) $object->id);
130$sql .=
" ORDER BY b.num_releve DESC";
131$sql .= $db->plimit(1);
133dol_syslog(
"htdocs/compta/bank/releve.php", LOG_DEBUG);
134$resql = $db->query($sql);
136 $numrows = $db->num_rows($resql);
138 $obj = $db->fetch_object($resql);
139 if ($rel ==
'prev') {
142 $foundprevious = $obj->num;
148$sql =
"SELECT b.num_releve as num";
149$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
150$sql .=
" WHERE b.num_releve > '".$db->escape($numref).
"'";
151$sql .=
" AND b.fk_account = ".((int) $object->id);
152$sql .=
" ORDER BY b.num_releve ASC";
153$sql .= $db->plimit(1);
155dol_syslog(
"htdocs/compta/bank/releve.php", LOG_DEBUG);
156$resql = $db->query($sql);
158 $numrows = $db->num_rows($resql);
160 $obj = $db->fetch_object($resql);
161 if ($rel ==
'next') {
164 $foundnext = $obj->num;
170$sql =
"SELECT b.rowid, b.dateo as do, b.datev as dv,";
171$sql .=
" b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,";
172$sql .=
" b.fk_bordereau,";
174$sql .=
" ba.rowid as bankid, ba.ref as bankref, ba.label as banklabel";
175$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account as ba,";
176$sql .=
" ".MAIN_DB_PREFIX.
"bank as b";
177$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bordereau_cheque as bc ON bc.rowid=b.fk_bordereau';
178$sql .=
" WHERE b.num_releve = '".$db->escape($numref).
"'";
180 $sql .=
" OR b.num_releve is null";
182$sql .=
" AND b.fk_account = ".((int) $object->id);
183$sql .=
" AND b.fk_account = ba.rowid";
184$sql .=
" AND ba.entity IN (".getEntity($object->element).
")";
185$sql .= $db->order(
"b.datev, b.datec",
"ASC");
187$sqlrequestforbankline = $sql;
194if ($action ==
'confirm_editbankreceipt' && !empty($oldbankreceipt) && !empty($newbankreceipt)) {
196 $sqltest =
"SELECT b.rowid FROM ".MAIN_DB_PREFIX.
"bank as b, ".MAIN_DB_PREFIX.
"bank_account as ba";
197 $sqltest .=
" WHERE b.fk_account = ba.rowid AND ba.entity = ".((int) $conf->entity);
198 $sqltest .=
" AND num_releve = '".$db->escape($newbankreceipt).
"'";
199 $sqltest .= $db->plimit(1);
201 $resql = $db->query($sqltest);
203 $obj = $db->fetch_object($resql);
204 if ($obj && $obj->rowid) {
214 $sqlupdate =
"UPDATE ".MAIN_DB_PREFIX.
"bank SET num_releve = '".$db->escape($newbankreceipt).
"'";
215 $sqlupdate .=
" WHERE num_releve = '".$db->escape($oldbankreceipt).
"' AND fk_account = ".((int) $id);
217 $resql = $db->query($sqlupdate);
231$form =
new Form($db);
232$societestatic =
new Societe($db);
237$paymentvatstatic =
new Tva($db);
247if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
248 $param .=
'&contextpage='.$contextpage;
250if ($limit > 0 && $limit != $conf->liste_limit) {
251 $param .=
'&limit='.$limit;
254 $param .=
'&id='.urlencode($id);
258 $title = $object->ref.
' - '.$langs->trans(
"AccountStatements");
261 $title = $langs->trans(
"FinancialAccount").
' - '.$langs->trans(
"AccountStatements");
274 $sql =
"SELECT DISTINCT(b.num_releve) as numr";
275 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
276 $sql .=
" WHERE b.fk_account = ".((int) $object->id);
277 $sql .= $db->order($sortfield, $sortorder);
282 $result = $db->query($sql);
283 $totalnboflines = $db->num_rows($result);
286 $sql .= $db->plimit($conf->liste_limit + 1, $offset);
288 $result = $db->query($sql);
290 $numrows = $db->num_rows($result);
295 print
dol_get_fiche_head($head,
'statement', $langs->trans(
"FinancialAccount"), 0,
'account');
297 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
301 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
306 print
'<div class="tabsAction">';
308 if ($object->canBeConciliated() > 0) {
309 $allowautomaticconciliation =
false;
310 $titletoconciliatemanual = $langs->trans(
"Conciliate");
311 $titletoconciliateauto = $langs->trans(
"Conciliate");
312 if ($allowautomaticconciliation) {
313 $titletoconciliatemanual .=
' ('.$langs->trans(
"Manual").
')';
314 $titletoconciliateauto .=
' ('.$langs->trans(
"Auto").
')';
318 if ($user->hasRight(
'banque',
'consolidate')) {
319 $buttonreconcile =
'<a class="butAction" href="'.DOL_URL_ROOT.
'/compta/bank/bankentries_list.php?action=reconcile&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&search_conciliated=0&search_account='.$id.$param.
'">'.$titletoconciliatemanual.
'</a>';
321 $buttonreconcile =
'<a class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliatemanual.
'</a>';
325 if ($allowautomaticconciliation) {
327 if ($user->hasRight(
'banque',
'consolidate')) {
329 $newparam = preg_replace(
'/search_conciliated=\d+/i',
'', $newparam);
330 $buttonreconcile .=
' <a class="butAction" style="margin-bottom: 5px !important; margin-top: 5px !important" href="'.DOL_URL_ROOT.
'/compta/bank/bankentries_list.php?action=reconcile&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&search_conciliated=0'.$newparam.
'">'.$titletoconciliateauto.
'</a>';
332 $buttonreconcile .=
' <a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliateauto.
'</a>';
336 print $buttonreconcile;
342 print_barre_liste(
'', $page, $_SERVER[
"PHP_SELF"],
"&account=".$object->id, $sortfield, $sortorder,
'', $numrows, $totalnboflines,
'');
344 print
'<form name="aaa" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
345 print
'<input type="hidden" name="token" value="'.newToken().
'">';
346 print
'<input type="hidden" name="action" value="confirm_editbankreceipt">';
347 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
348 print
'<input type="hidden" name="account" value="'.$object->id.
'">';
349 print
'<input type="hidden" name="page" value="'.$page.
'">';
351 print
'<table class="noborder centpercent">';
352 print
'<tr class="liste_titre">';
353 print
'<td>'.$langs->trans(
"Ref").
'</td>';
354 print
'<td class="right">'.$langs->trans(
"InitialBankBalance").
'</td>';
355 print
'<td class="right">'.$langs->trans(
"EndBankBalance").
'</td>';
359 $balancestart = array();
362 while ($i < min($numrows, $conf->liste_limit)) {
363 $objp = $db->fetch_object($result);
365 if (!isset($objp->numr)) {
368 print
'<tr class="oddeven">';
370 if ($action !=
'editbankreceipt' || $objp->numr != $brref) {
371 print
'<a href="releve.php?num='.$objp->numr.
'&account='.$object->id.
'">'.$objp->numr.
'</a>';
373 print
'<input type="hidden" name="oldbankreceipt" value="'.$objp->numr.
'">';
374 print
'<input type="text" name="newbankreceipt" value="'.$objp->numr.
'">';
375 print
'<input type="submit" class="button smallpaddingimp" name="actionnewbankreceipt" value="'.$langs->trans(
"Save").
'">';
376 print
'<input type="submit" class="button button-cancel smallpaddingimp" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
381 $sql =
"SELECT sum(b.amount) as amount";
382 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
383 $sql .=
" WHERE b.num_releve < '".$db->escape($objp->numr).
"'";
384 $sql .=
" AND b.num_releve <> ''";
385 $sql .=
" AND b.fk_account = ".((int) $object->id);
386 $resql = $db->query($sql);
388 $obj = $db->fetch_object($resql);
389 $balancestart[$objp->numr] = $obj->amount;
392 print
'<td class="right"><span class="amount">'.price($balancestart[$objp->numr],
'', $langs, 1, -1, -1, empty($object->currency_code) ? $conf->currency : $object->currency_code).
'</span></td>';
395 $sql =
"SELECT sum(b.amount) as amount";
396 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
397 $sql .=
" WHERE b.num_releve = '".$db->escape($objp->numr).
"'";
398 $sql .=
" AND b.fk_account = ".((int) $object->id);
399 $resql = $db->query($sql);
401 $obj = $db->fetch_object($resql);
402 $content[$objp->numr] = $obj->amount;
405 print
'<td class="right"><span class="amount">'.price(($balancestart[$objp->numr] + $content[$objp->numr]),
'', $langs, 1, -1, -1, empty($object->currency_code) ? $conf->currency : $object->currency_code).
'</span></td>';
407 print
'<td class="center">';
408 if ($user->hasRight(
'banque',
'consolidate') && $action !=
'editbankreceipt') {
409 print
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?account='.$object->id.($page > 0 ?
'&page='.$page :
'').
'&action=editbankreceipt&token='.newToken().
'&brref='.urlencode($objp->numr).
'">'.
img_edit().
'</a>';
431 print
dol_get_fiche_head($head,
'statement', $langs->trans(
"AccountStatement"), -1,
'account');
435 $morehtmlright .=
'<div class="pagination"><ul>';
436 if ($foundprevious) {
437 $morehtmlright .=
'<li class="pagination"><a class="paginationnext" href="'.$_SERVER[
"PHP_SELF"].
'?num='.urlencode($foundprevious).
'&ve='.urlencode($ve).
'&account='.((int) $object->id).
'"><i class="fa fa-chevron-left" title="'.
dol_escape_htmltag($langs->trans(
"Previous")).
'"></i></a></li>';
439 $morehtmlright .=
'<li class="pagination"><span class="active">'.$langs->trans(
"AccountStatement").
" ".$numref.
'</span></li>';
441 $morehtmlright .=
'<li class="pagination"><a class="paginationnext" href="'.$_SERVER[
"PHP_SELF"].
'?num='.urlencode($foundnext).
'&ve='.urlencode($ve).
'&account='.((int) $object->id).
'"><i class="fa fa-chevron-right" title="'.
dol_escape_htmltag($langs->trans(
"Next")).
'"></i></a></li>';
443 $morehtmlright .=
'</ul></div>';
445 $title = $langs->trans(
"AccountStatement").
' '.$numref.
' - '.$langs->trans(
"BankAccount").
' '.$object->getNomUrl(1,
'receipts');
448 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
449 print
'<input type="hidden" name="token" value="'.newToken().
'">';
450 print
'<input type="hidden" name="action" value="add">';
452 print
'<div class="div-table-responsive">';
453 print
'<table class="noborder centpercent">';
454 print
'<tr class="liste_titre">';
455 print
'<td class="center">'.$langs->trans(
"DateOperationShort").
'</td>';
456 print
'<td class="center">'.$langs->trans(
"DateValueShort").
'</td>';
457 print
'<td>'.$langs->trans(
"Type").
'</td>';
458 print
'<td>'.$langs->trans(
"Description").
'</td>';
459 print
'<td class="right" width="60">'.$langs->trans(
"Debit").
'</td>';
460 print
'<td class="right" width="60">'.$langs->trans(
"Credit").
'</td>';
461 print
'<td class="right">'.$langs->trans(
"Balance").
'</td>';
462 print
'<td> </td>';
466 $sql =
"SELECT sum(b.amount) as amount";
467 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
468 $sql .=
" WHERE b.num_releve < '".$db->escape($numref).
"'";
469 $sql .=
" AND b.num_releve <> ''";
470 $sql .=
" AND b.fk_account = ".((int) $object->id);
472 $resql = $db->query($sql);
474 $obj = $db->fetch_object($resql);
475 $total = $obj->amount;
479 $totalc = $totald = 0;
482 $sql = $sqlrequestforbankline;
484 $result = $db->query($sql);
486 $numrows = $db->num_rows($result);
490 print
'<tr class="oddeven"><td colspan="3"></td>';
491 print
'<td colspan="3"><b>'.$langs->trans(
"InitialBankBalance").
" :</b></td>";
492 print
'<td class="right"><b>'.price($total).
'</b></td><td> </td>';
495 while ($i < $numrows) {
496 $objp = $db->fetch_object($result);
497 $total = $total + $objp->amount;
499 print
'<tr class="oddeven">';
502 print
'<td class="nowrap center">'.dol_print_date($db->jdate($objp->do),
"day").
'</td>';
505 print
'<td valign="center" class="center nowrap">';
506 print
'<span class="spanforajaxedit">'.dol_print_date($db->jdate($objp->dv),
"day").
'</span>';
508 print
'<span class="inline-block">';
509 print
'<a class="ajaxforbankoperationchange reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvprev&num='.$numref.
'&account='.$object->id.
'&rowid='.$objp->rowid.
'&dvid='.$objp->rowid.
'">';
511 print
'<a class="ajaxforbankoperationchange reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvnext&num='.$numref.
'&account='.$object->id.
'&rowid='.$objp->rowid.
'&dvid='.$objp->rowid.
'">';
517 if ($objp->fk_type ==
'SOLD') {
518 $type_label =
' ';
520 $type_label = ($langs->trans(
"PaymentTypeShort".$objp->fk_type) !=
"PaymentTypeShort".$objp->fk_type) ? $langs->trans(
"PaymentTypeShort".$objp->fk_type) : $objp->fk_type;
523 if ($objp->fk_bordereau > 0) {
524 $remisestatic->id = $objp->fk_bordereau;
525 $remisestatic->ref = $objp->ref;
526 $link =
' '.$remisestatic->getNomUrl(1);
528 print
'<td class="nowrap">'.$type_label.
' '.($objp->num_chq ? $objp->num_chq :
'').$link.
'</td>';
531 print
'<td valign="center">';
532 print
'<a href="'.DOL_URL_ROOT.
'/compta/bank/line.php?rowid='.$objp->rowid.
'&account='.$object->id.
'">';
534 preg_match(
'/\((.+)\)/i', $objp->label, $reg);
535 if (!empty($reg[1]) && $langs->trans($reg[1]) != $reg[1]) {
536 print $langs->trans($reg[1]);
546 $links = $object->get_url($objp->rowid);
547 foreach ($links as $key => $val) {
553 if ($links[$key][
'type'] ==
'payment') {
554 $paymentstatic->id = $links[$key][
'url_id'];
555 $paymentstatic->ref = $langs->trans(
"Payment");
556 print
' '.$paymentstatic->getNomUrl(1);
558 } elseif ($links[$key][
'type'] ==
'payment_supplier') {
559 $paymentsupplierstatic->id = $links[$key][
'url_id'];
560 $paymentsupplierstatic->ref = $langs->trans(
"Payment");
561 print
' '.$paymentsupplierstatic->getNomUrl(1);
563 } elseif ($links[$key][
'type'] ==
'payment_sc') {
564 print
'<a href="'.DOL_URL_ROOT.
'/compta/payment_sc/card.php?id='.$links[$key][
'url_id'].
'">';
565 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
566 print $langs->trans(
"SocialContributionPayment");
569 } elseif ($links[$key][
'type'] ==
'payment_vat') {
570 $paymentvatstatic->id = $links[$key][
'url_id'];
571 $paymentvatstatic->ref = $langs->trans(
"Payment");
572 print
' '.$paymentvatstatic->getNomUrl(1);
573 } elseif ($links[$key][
'type'] ==
'payment_salary') {
574 print
'<a href="'.DOL_URL_ROOT.
'/salaries/card.php?id='.$links[$key][
'url_id'].
'">';
575 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
576 print $langs->trans(
"Payment");
579 } elseif ($links[$key][
'type'] ==
'payment_donation') {
580 $paymentdonationstatic->id = $links[$key][
'url_id'];
581 $paymentdonationstatic->ref = $langs->trans(
"Payment");
582 print
' '.$paymentdonationstatic->getNomUrl(1);
584 } elseif ($links[$key][
'type'] ==
'payment_loan') {
585 $paymentloanstatic->id = $links[$key][
'url_id'];
586 $paymentloanstatic->ref = $langs->trans(
"Payment");
587 print
' '.$paymentloanstatic->getNomUrl(1);
589 } elseif ($links[$key][
'type'] ==
'payment_various') {
590 $paymentvariousstatic->id = $links[$key][
'url_id'];
591 $paymentvariousstatic->ref = $langs->trans(
"Payment");
592 print
' '.$paymentvariousstatic->getNomUrl(1);
594 } elseif ($links[$key][
'type'] ==
'banktransfert') {
596 if ($objp->amount > 0) {
597 $banklinestatic->fetch($links[$key][
'url_id']);
598 $bankstatic->id = $banklinestatic->fk_account;
599 $bankstatic->label = $banklinestatic->bank_account_label;
600 print
' ('.$langs->trans(
"from").
' ';
601 print $bankstatic->getNomUrl(1,
'transactions');
602 print
' '.$langs->trans(
"toward").
' ';
603 $bankstatic->id = $objp->bankid;
604 $bankstatic->label = $objp->bankref;
605 print $bankstatic->getNomUrl(1,
'');
608 $bankstatic->id = $objp->bankid;
609 $bankstatic->label = $objp->bankref;
610 print
' ('.$langs->trans(
"from").
' ';
611 print $bankstatic->getNomUrl(1,
'');
612 print
' '.$langs->trans(
"toward").
' ';
613 $banklinestatic->fetch($links[$key][
'url_id']);
614 $bankstatic->id = $banklinestatic->fk_account;
615 $bankstatic->label = $banklinestatic->bank_account_label;
616 print $bankstatic->getNomUrl(1,
'transactions');
619 } elseif ($links[$key][
'type'] ==
'company') {
620 $societestatic->id = $links[$key][
'url_id'];
621 $societestatic->name = $links[$key][
'label'];
622 print $societestatic->getNomUrl(1,
'company', 24);
624 } elseif ($links[$key][
'type'] ==
'member') {
625 print
'<a href="'.DOL_URL_ROOT.
'/adherents/card.php?rowid='.$links[$key][
'url_id'].
'">';
626 print
img_object($langs->trans(
'ShowMember'),
'user').
' ';
627 print $links[$key][
'label'];
630 } elseif ($links[$key][
'type'] ==
'user') {
631 print
'<a href="'.DOL_URL_ROOT.
'/user/card.php?id='.$links[$key][
'url_id'].
'">';
632 print
img_object($langs->trans(
'ShowUser'),
'user').
' ';
633 print $links[$key][
'label'];
636 } elseif ($links[$key][
'type'] ==
'sc') {
637 print
'<a href="'.DOL_URL_ROOT.
'/compta/sociales/card.php?id='.$links[$key][
'url_id'].
'">';
638 print
img_object($langs->trans(
'ShowBill'),
'bill').
' ';
639 print $langs->trans(
"SocialContribution");
643 print
'<a href="'.$links[$key][
'url'].$links[$key][
'url_id'].
'">';
644 print $links[$key][
'label'];
652 $sql =
"SELECT label";
653 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_categ as ct";
654 $sql .=
", ".MAIN_DB_PREFIX.
"bank_class as cl";
655 $sql .=
" WHERE ct.rowid = cl.fk_categ";
656 $sql .=
" AND ct.entity = ".((int) $conf->entity);
657 $sql .=
" AND cl.lineid = ".((int) $objp->rowid);
659 $resc = $db->query($sql);
661 $numc = $db->num_rows($resc);
663 if ($numc && !$newline) {
666 while ($ii < $numc) {
667 $objc = $db->fetch_object($resc);
668 print
"<br>- <i>".$objc->label.
"</i>";
678 if ($objp->amount < 0) {
679 $totald = $totald + abs($objp->amount);
680 print
'<td class="nowrap right">'.price($objp->amount * -1).
"</td><td> </td>\n";
682 $totalc = $totalc + abs($objp->amount);
683 print
'<td> </td><td class="nowrap right">'.price($objp->amount).
"</td>\n";
686 print
'<td class="nowrap right">'.price(
price2num($total,
'MT')).
"</td>\n";
688 if ($user->hasRight(
'banque',
'modifier') || $user->hasRight(
'banque',
'consolidate')) {
689 print
'<td class="center"><a class="editfielda reposition" href="'.DOL_URL_ROOT.
'/compta/bank/line.php?rowid='.$objp->rowid.
'&account='.$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?account='.$object->id.
'&num='.$numref).
'">';
693 print
"<td class=\"center\"> </td>";
704 print
"\n".
'<tr class="liste_total"><td class="right" colspan="4">'.$langs->trans(
"Total").
' :</td><td class="right">'.
price($totald).
'</td><td class="right">'.
price($totalc).
"</td><td> </td><td> </td></tr>";
708 print
"<td class=\"right\" colspan=\"3\"> </td><td colspan=\"3\"><b>".$langs->trans(
"EndBankBalance").
" :</b></td>";
709 print
'<td class="right"><b>'.price(
price2num($total,
'MT')).
"</b></td><td> </td>";
714 $urlajax = DOL_URL_ROOT.
'/core/ajax/bankconciliate.php?token='.
currentToken();
716 <script type="text/javascript">
718 $("a.ajaxforbankoperationchange").each(function(){
719 var current = $(this);
720 current.click(function()
722 console.log("We click on ajaxforbankoperationchange");
723 var url = "'.$urlajax.
'&"+current.attr("href").split("?")[1];
724 $.get(url, function(data)
728 current.parent().parent().find(".spanforajaxedit").replaceWith(data);
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
account_statement_prepare_head($object, $num)
Prepare array with list of tabs.
bank_prepare_head(Account $object)
Prepare array with list of tabs.
Class to manage bank accounts.
Class to manage bank transaction lines.
Class to manage members of a foundation.
Classe permettant la gestion des paiements des charges La tva collectee n'est calculee que sur les fa...
Class to manage payments for supplier invoices.
Class to manage payments of customer invoices.
Class to manage payments of donations.
Class to manage payments of loans.
Class to manage various payments.
Class to manage cheque delivery receipts.
Class to manage third parties objects (customers, suppliers, prospects...)
Put here description of your class.
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.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
currentToken()
Return the value of token currently saved into session with name 'token'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
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.
img_edit_add($titlealt='default', $other='')
Show logo +.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
img_edit_remove($titlealt='default', $other='')
Show logo -.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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.