33require
'../../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/tva.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/fourn/class/paiementfourn.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/don/class/paymentdonation.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/loan/class/paymentloan.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
50require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
53$langs->loadLangs(array(
"banks",
"categories",
"companies",
"bills",
"trips",
"donations",
"loan",
"salaries"));
55$action =
GETPOST(
'action',
'aZ09');
58$dvid =
GETPOST(
'dvid',
'alpha');
59$numref =
GETPOST(
'num',
'alpha');
61$brref =
GETPOST(
'brref',
'alpha');
62$oldbankreceipt =
GETPOST(
'oldbankreceipt',
'alpha');
63$newbankreceipt =
GETPOST(
'newbankreceipt',
'alpha');
64$rel =
GETPOST(
"rel",
'alphanohtml');
65$backtopage =
GETPOST(
'backtopage',
'alpha');
68$hookmanager->initHooks(array(
'bankaccountstatement',
'globalcard'));
70if ($user->hasRight(
'banque',
'consolidate') && $action ==
'dvnext' && !empty($dvid)) {
72 $al->datev_next($dvid);
75if ($user->hasRight(
'banque',
'consolidate') && $action ==
'dvprev' && !empty($dvid)) {
77 $al->datev_previous($dvid);
82$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
83$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
85if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
89$offset = $limit * $page;
100if ($id > 0 || !empty($ref)) {
101 $result =
$object->fetch($id, $ref);
107$contextpage =
'banktransactionlist'.(empty(
$object->ref) ?
'' :
'-'.$object->id);
110$fieldid = (!empty($ref) ? $ref :
$id);
111$fieldname = (!empty($ref) ?
'ref' :
'rowid');
113 $socid = $user->socid;
116$result =
restrictedArea($user,
'banque', $fieldid,
'bank_account',
'',
'', $fieldname);
124$sql =
"SELECT b.num_releve as num";
125$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
126$sql .=
" WHERE b.num_releve < '".$db->escape($numref).
"'";
127$sql .=
" AND b.num_releve <> ''";
128$sql .=
" AND b.fk_account = ".((int)
$object->id);
129$sql .=
" ORDER BY b.num_releve DESC";
130$sql .= $db->plimit(1);
132dol_syslog(
"htdocs/compta/bank/releve.php", LOG_DEBUG);
133$resql = $db->query($sql);
135 $numrows = $db->num_rows($resql);
137 $obj = $db->fetch_object($resql);
138 if ($rel ==
'prev') {
141 $foundprevious = $obj->num;
147$sql =
"SELECT b.num_releve as num";
148$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
149$sql .=
" WHERE b.num_releve > '".$db->escape($numref).
"'";
150$sql .=
" AND b.fk_account = ".((int)
$object->id);
151$sql .=
" ORDER BY b.num_releve ASC";
152$sql .= $db->plimit(1);
154dol_syslog(
"htdocs/compta/bank/releve.php", LOG_DEBUG);
155$resql = $db->query($sql);
157 $numrows = $db->num_rows($resql);
159 $obj = $db->fetch_object($resql);
160 if ($rel ==
'next') {
163 $foundnext = $obj->num;
169$sql =
"SELECT b.rowid, b.dateo as do, b.datev as dv,";
170$sql .=
" b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,";
171$sql .=
" b.fk_bordereau,";
173$sql .=
" ba.rowid as bankid, ba.ref as bankref, ba.label as banklabel";
174$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account as ba,";
175$sql .=
" ".MAIN_DB_PREFIX.
"bank as b";
176$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bordereau_cheque as bc ON bc.rowid=b.fk_bordereau';
177$sql .=
" WHERE b.num_releve = '".$db->escape($numref).
"'";
179 $sql .=
" OR b.num_releve is null";
181$sql .=
" AND b.fk_account = ".((int)
$object->id);
182$sql .=
" AND b.fk_account = ba.rowid";
183$sql .=
" AND ba.entity IN (".getEntity(
$object->element).
")";
184$sql .= $db->order(
"b.datev, b.datec",
"ASC");
186$sqlrequestforbankline = $sql;
193if ($action ==
'confirm_editbankreceipt' && !empty($oldbankreceipt) && !empty($newbankreceipt) && $user->hasRight(
'banque',
'consolidate')) {
195 $sqltest =
"SELECT b.rowid FROM ".MAIN_DB_PREFIX.
"bank as b, ".MAIN_DB_PREFIX.
"bank_account as ba";
196 $sqltest .=
" WHERE b.fk_account = ba.rowid AND ba.entity = ".((int) $conf->entity);
197 $sqltest .=
" AND num_releve = '".$db->escape($newbankreceipt).
"'";
198 $sqltest .= $db->plimit(1);
200 $resql = $db->query($sqltest);
202 $obj = $db->fetch_object($resql);
203 if ($obj && $obj->rowid) {
213 $sqlupdate =
"UPDATE ".MAIN_DB_PREFIX.
"bank SET num_releve = '".$db->escape($newbankreceipt).
"'";
214 $sqlupdate .=
" WHERE num_releve = '".$db->escape($oldbankreceipt).
"' AND fk_account = ".((int) $id);
216 $resql = $db->query($sqlupdate);
230$form =
new Form($db);
231$societestatic =
new Societe($db);
236$paymentvatstatic =
new Tva($db);
246if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
247 $param .=
'&contextpage='.$contextpage;
249if ($limit > 0 && $limit != $conf->liste_limit) {
250 $param .=
'&limit='.$limit;
253 $param .=
'&id='.urlencode((
string) ($id));
257 $title =
$object->ref.
' - '.$langs->trans(
"AccountStatements");
260 $title = $langs->trans(
"FinancialAccount").
' - '.$langs->trans(
"AccountStatements");
273 $sql =
"SELECT DISTINCT(b.num_releve) as numr";
274 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
275 $sql .=
" WHERE b.fk_account = ".((int)
$object->id);
276 $sql .=
" AND b.num_releve IS NOT NULL AND b.num_releve <> '' AND b.num_releve <> '0'";
277 $sql .= $db->order($sortfield, $sortorder);
282 $result = $db->query($sql);
283 $totalnboflines = $db->num_rows($result);
286 $sql .= $db->plimit($limit + 1, $offset);
288 $resql = $db->query($sql);
290 $num = $db->num_rows($resql);
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 if (
$object->canBeConciliated() > 0) {
307 $allowautomaticconciliation =
false;
308 $titletoconciliatemanual = $langs->trans(
"Conciliate");
309 $titletoconciliateauto = $langs->trans(
"Conciliate");
310 if ($allowautomaticconciliation) {
311 $titletoconciliatemanual .=
' ('.$langs->trans(
"Manual").
')';
312 $titletoconciliateauto .=
' ('.$langs->trans(
"Auto").
')';
316 if ($user->hasRight(
'banque',
'consolidate')) {
317 $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>';
319 $buttonreconcile =
'<a class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliatemanual.
'</a>';
323 if ($allowautomaticconciliation) {
325 if ($user->hasRight(
'banque',
'consolidate')) {
327 $newparam = preg_replace(
'/search_conciliated=\d+/i',
'', $newparam);
328 $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>';
330 $buttonreconcile .=
' <a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliateauto.
'</a>';
336 $arrayofmassactions = array(
343 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
346 if ($action !=
'addline' && $action !=
'reconcile') {
347 $morehtml .= $buttonreconcile;
350 print
'<form name="aaa" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
351 print
'<input type="hidden" name="token" value="'.newToken().
'">';
352 print
'<input type="hidden" name="action" value="confirm_editbankreceipt">';
353 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
354 print
'<input type="hidden" name="account" value="'.$object->id.
'">';
355 print
'<input type="hidden" name="page" value="'.$page.
'">';
357 $param =
"&account=".$object->id.($limit ?
'&limit='.$limit :
'');
358 print_barre_liste($langs->trans(
"AccountStatements"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton.$morehtml, $num, $totalnboflines,
'', 0,
'',
'', $limit, 0, 0, 1);
360 print
'<table class="noborder centpercent">';
361 print
'<tr class="liste_titre">';
362 print
'<td>'.$langs->trans(
"Ref").
'</td>';
363 print
'<td class="right">'.$langs->trans(
"InitialBankBalance").
'</td>';
364 print
'<td class="right">'.$langs->trans(
"EndBankBalance").
'</td>';
368 $balancestart = array();
371 $imaxinloop = ($limit ? min($num, $limit) : $num);
372 while ($i < $imaxinloop) {
373 $objp = $db->fetch_object($resql);
375 print
'<tr class="oddeven">';
377 if ($action !=
'editbankreceipt' || $objp->numr != $brref) {
378 print
'<a href="releve.php?num='.$objp->numr.
'&account='.
$object->id.
'">'.$objp->numr.
'</a>';
380 print
'<input type="hidden" name="oldbankreceipt" value="'.$objp->numr.
'">';
381 print
'<input type="text" name="newbankreceipt" value="'.$objp->numr.
'">';
382 print
'<input type="submit" class="button smallpaddingimp" name="actionnewbankreceipt" value="'.$langs->trans(
"Save").
'">';
383 print
'<input type="submit" class="button button-cancel smallpaddingimp" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
388 $sql =
"SELECT sum(b.amount) as amount";
389 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
390 $sql .=
" WHERE b.num_releve < '".$db->escape($objp->numr).
"'";
391 $sql .=
" AND b.num_releve <> ''";
392 $sql .=
" AND b.fk_account = ".((int)
$object->id);
393 $resqlstart = $db->query($sql);
395 $obj = $db->fetch_object($resqlstart);
396 $balancestart[$objp->numr] = $obj->amount;
397 $db->free($resqlstart);
399 print
'<td class="right"><span class="amount">'.price($balancestart[$objp->numr], 0, $langs, 1, -1, -1, empty(
$object->currency_code) ? $conf->currency :
$object->currency_code).
'</span></td>';
402 $sql =
"SELECT sum(b.amount) as amount";
403 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
404 $sql .=
" WHERE b.num_releve = '".$db->escape($objp->numr).
"'";
405 $sql .=
" AND b.fk_account = ".((int)
$object->id);
406 $resqlend = $db->query($sql);
408 $obj = $db->fetch_object($resqlend);
409 $content[$objp->numr] = $obj->amount;
410 $db->free($resqlend);
412 print
'<td class="right"><span class="amount">'.price(($balancestart[$objp->numr] + $content[$objp->numr]), 0, $langs, 1, -1, -1, empty(
$object->currency_code) ? $conf->currency :
$object->currency_code).
'</span></td>';
414 print
'<td class="center">';
415 if ($user->hasRight(
'banque',
'consolidate') && $action !=
'editbankreceipt') {
416 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>';
427 print
'<tr><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
444 print
dol_get_fiche_head($head,
'statement', $langs->trans(
"AccountStatement"), -1,
'account');
448 $morehtmlright .=
'<div class="pagination"><ul>';
449 if ($foundprevious) {
450 $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>';
452 $morehtmlright .=
'<li class="pagination"><span class="active">'.$langs->trans(
"AccountStatement").
" ".$numref.
'</span></li>';
454 $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>';
456 $morehtmlright .=
'</ul></div>';
458 $title = $langs->trans(
"AccountStatement").
' '.$numref.
' - '.$langs->trans(
"BankAccount").
' '.
$object->getNomUrl(1,
'receipts');
461 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
462 print
'<input type="hidden" name="token" value="'.newToken().
'">';
463 print
'<input type="hidden" name="action" value="add">';
465 print
'<div class="div-table-responsive">';
466 print
'<table class="noborder centpercent">';
467 print
'<tr class="liste_titre">';
468 print
'<td class="center">'.$langs->trans(
"DateOperationShort").
'</td>';
469 print
'<td class="center">'.$langs->trans(
"DateValueShort").
'</td>';
470 print
'<td>'.$langs->trans(
"Type").
'</td>';
471 print
'<td>'.$langs->trans(
"Description").
'</td>';
472 print
'<td class="right" width="60">'.$langs->trans(
"Debit").
'</td>';
473 print
'<td class="right" width="60">'.$langs->trans(
"Credit").
'</td>';
474 print
'<td class="right">'.$langs->trans(
"Balance").
'</td>';
475 print
'<td> </td>';
479 $sql =
"SELECT sum(b.amount) as amount";
480 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
481 $sql .=
" WHERE b.num_releve < '".$db->escape($numref).
"'";
482 $sql .=
" AND b.num_releve <> ''";
483 $sql .=
" AND b.fk_account = ".((int)
$object->id);
485 $resql = $db->query($sql);
487 $obj = $db->fetch_object($resql);
488 $total = $obj->amount;
492 $totalc = $totald = 0;
495 $sql = $sqlrequestforbankline;
497 $resql = $db->query($sql);
499 $num = $db->num_rows($resql);
503 print
'<tr class="oddeven"><td colspan="3"></td>';
504 print
'<td colspan="3"><b>'.$langs->trans(
"InitialBankBalance").
" :</b></td>";
505 print
'<td class="right"><b>'.price($total).
'</b></td><td> </td>';
509 $objp = $db->fetch_object($resql);
510 $total += $objp->amount;
512 print
'<tr class="oddeven">';
515 print
'<td class="nowrap center">'.dol_print_date($db->jdate($objp->do),
"day").
'</td>';
518 print
'<td valign="center" class="center nowrap">';
519 print
'<span class="spanforajaxedit">'.dol_print_date($db->jdate($objp->dv),
"day").
'</span>';
521 print
'<span class="inline-block">';
522 print
'<a class="ajaxforbankoperationchange reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvprev&num='.urlencode($numref).
'&account='.
$object->id.
'&rowid='.$objp->rowid.
'&dvid='.$objp->rowid.
'">';
524 print
'<a class="ajaxforbankoperationchange reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvnext&num='.urlencode($numref).
'&account='.
$object->id.
'&rowid='.$objp->rowid.
'&dvid='.$objp->rowid.
'">';
530 if ($objp->fk_type ==
'SOLD') {
531 $type_label =
' ';
533 $type_label = ($langs->trans(
"PaymentTypeShort".$objp->fk_type) !=
"PaymentTypeShort".$objp->fk_type) ? $langs->trans(
"PaymentTypeShort".$objp->fk_type) : $objp->fk_type;
536 if ($objp->fk_bordereau > 0) {
537 $remisestatic->id = $objp->fk_bordereau;
538 $remisestatic->ref = $objp->ref;
539 $link =
' '.$remisestatic->getNomUrl(1);
541 print
'<td class="nowrap">'.$type_label.
' '.($objp->num_chq ? $objp->num_chq :
'').$link.
'</td>';
544 print
'<td valign="center">';
545 print
'<a href="'.DOL_URL_ROOT.
'/compta/bank/line.php?rowid='.$objp->rowid.
'&account='.
$object->id.
'">';
548 preg_match(
'/\((.+)\)/i', $objp->label, $reg);
549 if (!empty($reg[1]) && $langs->trans($reg[1]) != $reg[1]) {
550 print $langs->trans($reg[1]);
560 $links =
$object->get_url($objp->rowid);
561 foreach ($links as $key => $val) {
567 if ($links[$key][
'type'] ==
'payment') {
568 $paymentstatic->id = $links[$key][
'url_id'];
569 $paymentstatic->ref = $langs->trans(
"Payment");
570 print
' '.$paymentstatic->getNomUrl(1);
572 } elseif ($links[$key][
'type'] ==
'payment_supplier') {
573 $paymentsupplierstatic->id = $links[$key][
'url_id'];
574 $paymentsupplierstatic->ref = $langs->trans(
"Payment");
575 print
' '.$paymentsupplierstatic->getNomUrl(1);
577 } elseif ($links[$key][
'type'] ==
'payment_sc') {
578 print
'<a href="'.DOL_URL_ROOT.
'/compta/payment_sc/card.php?id='.$links[$key][
'url_id'].
'">';
579 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
580 print $langs->trans(
"SocialContributionPayment");
583 } elseif ($links[$key][
'type'] ==
'payment_vat') {
584 $paymentvatstatic->id = $links[$key][
'url_id'];
585 $paymentvatstatic->ref = $langs->trans(
"Payment");
586 print
' '.$paymentvatstatic->getNomUrl(1);
587 } elseif ($links[$key][
'type'] ==
'payment_salary') {
588 print
'<a href="'.DOL_URL_ROOT.
'/salaries/card.php?id='.$links[$key][
'url_id'].
'">';
589 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
590 print $langs->trans(
"Payment");
593 } elseif ($links[$key][
'type'] ==
'payment_donation') {
594 $paymentdonationstatic->id = $links[$key][
'url_id'];
595 $paymentdonationstatic->ref = $langs->trans(
"Payment");
596 print
' '.$paymentdonationstatic->getNomUrl(1);
598 } elseif ($links[$key][
'type'] ==
'payment_loan') {
599 $paymentloanstatic->id = $links[$key][
'url_id'];
600 $paymentloanstatic->ref = $langs->trans(
"Payment");
601 print
' '.$paymentloanstatic->getNomUrl(1);
603 } elseif ($links[$key][
'type'] ==
'payment_various') {
604 $paymentvariousstatic->id = $links[$key][
'url_id'];
605 $paymentvariousstatic->ref = $langs->trans(
"Payment");
606 print
' '.$paymentvariousstatic->getNomUrl(1);
608 } elseif ($links[$key][
'type'] ==
'banktransfert') {
610 if ($objp->amount > 0) {
611 $banklinestatic->fetch($links[$key][
'url_id']);
612 $bankstatic->id = $banklinestatic->fk_account;
613 $bankstatic->label = $banklinestatic->bank_account_label;
614 print
' ('.$langs->trans(
"from").
' ';
615 print $bankstatic->getNomUrl(1,
'transactions');
616 print
' '.$langs->trans(
"toward").
' ';
617 $bankstatic->id = $objp->bankid;
618 $bankstatic->label = $objp->bankref;
619 print $bankstatic->getNomUrl(1,
'');
622 $bankstatic->id = $objp->bankid;
623 $bankstatic->label = $objp->bankref;
624 print
' ('.$langs->trans(
"from").
' ';
625 print $bankstatic->getNomUrl(1,
'');
626 print
' '.$langs->trans(
"toward").
' ';
627 $banklinestatic->fetch($links[$key][
'url_id']);
628 $bankstatic->id = $banklinestatic->fk_account;
629 $bankstatic->label = $banklinestatic->bank_account_label;
630 print $bankstatic->getNomUrl(1,
'transactions');
633 } elseif ($links[$key][
'type'] ==
'company') {
634 $societestatic->id = $links[$key][
'url_id'];
635 $societestatic->name = $links[$key][
'label'];
636 print $societestatic->getNomUrl(1,
'company', 24);
638 } elseif ($links[$key][
'type'] ==
'member') {
639 print
'<a href="'.DOL_URL_ROOT.
'/adherents/card.php?rowid='.$links[$key][
'url_id'].
'">';
640 print
img_object($langs->trans(
'ShowMember'),
'user').
' ';
641 print $links[$key][
'label'];
644 } elseif ($links[$key][
'type'] ==
'user') {
645 print
'<a href="'.DOL_URL_ROOT.
'/user/card.php?id='.$links[$key][
'url_id'].
'">';
646 print
img_object($langs->trans(
'ShowUser'),
'user').
' ';
647 print $links[$key][
'label'];
650 } elseif ($links[$key][
'type'] ==
'sc') {
651 print
'<a href="'.DOL_URL_ROOT.
'/compta/sociales/card.php?id='.$links[$key][
'url_id'].
'">';
652 print
img_object($langs->trans(
'ShowBill'),
'bill').
' ';
653 print $langs->trans(
"SocialContribution");
657 print
'<a href="'.$links[$key][
'url'].$links[$key][
'url_id'].
'">';
658 print $links[$key][
'label'];
666 $sql =
"SELECT label";
667 $sql .=
" FROM ".MAIN_DB_PREFIX.
"categorie as ct";
668 $sql .=
", ".MAIN_DB_PREFIX.
"category_bankline as cl";
669 $sql .=
" WHERE ct.rowid = cl.fk_categ";
670 $sql .=
" AND ct.entity = ".((int) $conf->entity);
671 $sql .=
" AND cl.lineid = ".((int) $objp->rowid);
673 $resc = $db->query($sql);
675 $numc = $db->num_rows($resc);
677 if ($numc && !$newline) {
680 while ($ii < $numc) {
681 $objc = $db->fetch_object($resc);
682 print
"<br>- <i>".$objc->label.
"</i>";
692 if ($objp->amount < 0) {
693 $totald += abs($objp->amount);
694 print
'<td class="nowrap right">'.price($objp->amount * -1).
"</td><td> </td>\n";
696 $totalc += abs($objp->amount);
697 print
'<td> </td><td class="nowrap right">'.price($objp->amount).
"</td>\n";
700 print
'<td class="nowrap right">'.price(
price2num($total,
'MT')).
"</td>\n";
702 if ($user->hasRight(
'banque',
'modifier') || $user->hasRight(
'banque',
'consolidate')) {
703 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='.urlencode($numref)).
'">';
707 print
"<td class=\"center\"> </td>";
718 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>";
722 print
"<td class=\"right\" colspan=\"3\"> </td><td colspan=\"3\"><b>".$langs->trans(
"EndBankBalance").
" :</b></td>";
723 print
'<td class="right"><b>'.price(
price2num($total,
'MT')).
"</b></td><td> </td>";
728 $urlajax = DOL_URL_ROOT.
'/core/ajax/bankconciliate.php?token='.
currentToken();
730 <script type="text/javascript">
732 $("a.ajaxforbankoperationchange").each(function(){
733 var current = $(this);
734 current.click(function()
736 console.log("We click on ajaxforbankoperationchange");
737 var url = "'.$urlajax.
'&"+current.attr("href").split("?")[1];
738 $.get(url, function(data)
742 current.parent().parent().find(".spanforajaxedit").replaceWith(data);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
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.
Class for managing the social charges.
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...)
Class to manage VAT - Value-added tax (also known in French as TVA - Taxe sur la valeur ajoutée)
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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 '.
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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_edit_add($titlealt='default', $other='')
Show logo +.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify 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.