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);
80$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
81$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
83if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
87$offset = $limit * $page;
98if ($id > 0 || !empty($ref)) {
99 $result =
$object->fetch($id, $ref);
105$contextpage =
'banktransactionlist'.(empty(
$object->ref) ?
'' :
'-'.$object->id);
108$fieldid = (!empty($ref) ? $ref : $id);
109$fieldname = (!empty($ref) ?
'ref' :
'rowid');
111 $socid = $user->socid;
114$result =
restrictedArea($user,
'banque', $fieldid,
'bank_account',
'',
'', $fieldname);
122$sql =
"SELECT b.num_releve as num";
123$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
124$sql .=
" WHERE b.num_releve < '".$db->escape($numref).
"'";
125$sql .=
" AND b.num_releve <> ''";
126$sql .=
" AND b.fk_account = ".((int)
$object->id);
127$sql .=
" ORDER BY b.num_releve DESC";
128$sql .= $db->plimit(1);
130dol_syslog(
"htdocs/compta/bank/releve.php", LOG_DEBUG);
131$resql = $db->query($sql);
133 $numrows = $db->num_rows($resql);
135 $obj = $db->fetch_object($resql);
136 if ($rel ==
'prev') {
139 $foundprevious = $obj->num;
145$sql =
"SELECT b.num_releve as num";
146$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
147$sql .=
" WHERE b.num_releve > '".$db->escape($numref).
"'";
148$sql .=
" AND b.fk_account = ".((int)
$object->id);
149$sql .=
" ORDER BY b.num_releve ASC";
150$sql .= $db->plimit(1);
152dol_syslog(
"htdocs/compta/bank/releve.php", LOG_DEBUG);
153$resql = $db->query($sql);
155 $numrows = $db->num_rows($resql);
157 $obj = $db->fetch_object($resql);
158 if ($rel ==
'next') {
161 $foundnext = $obj->num;
167$sql =
"SELECT b.rowid, b.dateo as do, b.datev as dv,";
168$sql .=
" b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,";
169$sql .=
" b.fk_bordereau,";
171$sql .=
" ba.rowid as bankid, ba.ref as bankref, ba.label as banklabel";
172$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account as ba,";
173$sql .=
" ".MAIN_DB_PREFIX.
"bank as b";
174$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bordereau_cheque as bc ON bc.rowid=b.fk_bordereau';
175$sql .=
" WHERE b.num_releve = '".$db->escape($numref).
"'";
177 $sql .=
" OR b.num_releve is null";
179$sql .=
" AND b.fk_account = ".((int)
$object->id);
180$sql .=
" AND b.fk_account = ba.rowid";
181$sql .=
" AND ba.entity IN (".getEntity(
$object->element).
")";
182$sql .= $db->order(
"b.datev, b.datec",
"ASC");
184$sqlrequestforbankline = $sql;
191if ($action ==
'confirm_editbankreceipt' && !empty($oldbankreceipt) && !empty($newbankreceipt)) {
193 $sqltest =
"SELECT b.rowid FROM ".MAIN_DB_PREFIX.
"bank as b, ".MAIN_DB_PREFIX.
"bank_account as ba";
194 $sqltest .=
" WHERE b.fk_account = ba.rowid AND ba.entity = ".((int) $conf->entity);
195 $sqltest .=
" AND num_releve = '".$db->escape($newbankreceipt).
"'";
196 $sqltest .= $db->plimit(1);
198 $resql = $db->query($sqltest);
200 $obj = $db->fetch_object($resql);
201 if ($obj && $obj->rowid) {
211 $sqlupdate =
"UPDATE ".MAIN_DB_PREFIX.
"bank SET num_releve = '".$db->escape($newbankreceipt).
"'";
212 $sqlupdate .=
" WHERE num_releve = '".$db->escape($oldbankreceipt).
"' AND fk_account = ".((int) $id);
214 $resql = $db->query($sqlupdate);
228$form =
new Form($db);
229$societestatic =
new Societe($db);
234$paymentvatstatic =
new Tva($db);
244if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
245 $param .=
'&contextpage='.$contextpage;
247if ($limit > 0 && $limit != $conf->liste_limit) {
248 $param .=
'&limit='.$limit;
251 $param .=
'&id='.urlencode((
string) ($id));
255 $title =
$object->ref.
' - '.$langs->trans(
"AccountStatements");
258 $title = $langs->trans(
"FinancialAccount").
' - '.$langs->trans(
"AccountStatements");
271 $sql =
"SELECT DISTINCT(b.num_releve) as numr";
272 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
273 $sql .=
" WHERE b.fk_account = ".((int)
$object->id);
274 $sql .=
" AND b.num_releve IS NOT NULL AND b.num_releve <> '' AND b.num_releve <> '0'";
275 $sql .= $db->order($sortfield, $sortorder);
280 $result = $db->query($sql);
281 $totalnboflines = $db->num_rows($result);
284 $sql .= $db->plimit($limit + 1, $offset);
286 $resql = $db->query($sql);
288 $num = $db->num_rows($resql);
293 print
dol_get_fiche_head($head,
'statement', $langs->trans(
"FinancialAccount"), 0,
'account');
295 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
299 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
304 if (
$object->canBeConciliated() > 0) {
305 $allowautomaticconciliation =
false;
306 $titletoconciliatemanual = $langs->trans(
"Conciliate");
307 $titletoconciliateauto = $langs->trans(
"Conciliate");
308 if ($allowautomaticconciliation) {
309 $titletoconciliatemanual .=
' ('.$langs->trans(
"Manual").
')';
310 $titletoconciliateauto .=
' ('.$langs->trans(
"Auto").
')';
314 if ($user->hasRight(
'banque',
'consolidate')) {
315 $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>';
317 $buttonreconcile =
'<a class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliatemanual.
'</a>';
321 if ($allowautomaticconciliation) {
323 if ($user->hasRight(
'banque',
'consolidate')) {
325 $newparam = preg_replace(
'/search_conciliated=\d+/i',
'', $newparam);
326 $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>';
328 $buttonreconcile .=
' <a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliateauto.
'</a>';
334 $arrayofmassactions = array(
341 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
344 if ($action !=
'addline' && $action !=
'reconcile') {
345 $morehtml .= $buttonreconcile;
348 print
'<form name="aaa" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
349 print
'<input type="hidden" name="token" value="'.newToken().
'">';
350 print
'<input type="hidden" name="action" value="confirm_editbankreceipt">';
351 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
352 print
'<input type="hidden" name="account" value="'.$object->id.
'">';
353 print
'<input type="hidden" name="page" value="'.$page.
'">';
355 $param =
"&account=".$object->id.($limit ?
'&limit='.$limit :
'');
356 print_barre_liste($langs->trans(
"AccountStatements"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton.$morehtml, $num, $totalnboflines,
'', 0,
'',
'', $limit, 0, 0, 1);
358 print
'<table class="noborder centpercent">';
359 print
'<tr class="liste_titre">';
360 print
'<td>'.$langs->trans(
"Ref").
'</td>';
361 print
'<td class="right">'.$langs->trans(
"InitialBankBalance").
'</td>';
362 print
'<td class="right">'.$langs->trans(
"EndBankBalance").
'</td>';
366 $balancestart = array();
369 $imaxinloop = ($limit ? min($num, $limit) : $num);
370 while ($i < $imaxinloop) {
371 $objp = $db->fetch_object($resql);
373 print
'<tr class="oddeven">';
375 if ($action !=
'editbankreceipt' || $objp->numr != $brref) {
376 print
'<a href="releve.php?num='.$objp->numr.
'&account='.
$object->id.
'">'.$objp->numr.
'</a>';
378 print
'<input type="hidden" name="oldbankreceipt" value="'.$objp->numr.
'">';
379 print
'<input type="text" name="newbankreceipt" value="'.$objp->numr.
'">';
380 print
'<input type="submit" class="button smallpaddingimp" name="actionnewbankreceipt" value="'.$langs->trans(
"Save").
'">';
381 print
'<input type="submit" class="button button-cancel smallpaddingimp" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
386 $sql =
"SELECT sum(b.amount) as amount";
387 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
388 $sql .=
" WHERE b.num_releve < '".$db->escape($objp->numr).
"'";
389 $sql .=
" AND b.num_releve <> ''";
390 $sql .=
" AND b.fk_account = ".((int)
$object->id);
391 $resqlstart = $db->query($sql);
393 $obj = $db->fetch_object($resqlstart);
394 $balancestart[$objp->numr] = $obj->amount;
395 $db->free($resqlstart);
397 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>';
400 $sql =
"SELECT sum(b.amount) as amount";
401 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
402 $sql .=
" WHERE b.num_releve = '".$db->escape($objp->numr).
"'";
403 $sql .=
" AND b.fk_account = ".((int)
$object->id);
404 $resqlend = $db->query($sql);
406 $obj = $db->fetch_object($resqlend);
407 $content[$objp->numr] = $obj->amount;
408 $db->free($resqlend);
410 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>';
412 print
'<td class="center">';
413 if ($user->hasRight(
'banque',
'consolidate') && $action !=
'editbankreceipt') {
414 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>';
425 print
'<tr><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
442 print
dol_get_fiche_head($head,
'statement', $langs->trans(
"AccountStatement"), -1,
'account');
446 $morehtmlright .=
'<div class="pagination"><ul>';
447 if ($foundprevious) {
448 $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>';
450 $morehtmlright .=
'<li class="pagination"><span class="active">'.$langs->trans(
"AccountStatement").
" ".$numref.
'</span></li>';
452 $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>';
454 $morehtmlright .=
'</ul></div>';
456 $title = $langs->trans(
"AccountStatement").
' '.$numref.
' - '.$langs->trans(
"BankAccount").
' '.
$object->getNomUrl(1,
'receipts');
459 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
460 print
'<input type="hidden" name="token" value="'.newToken().
'">';
461 print
'<input type="hidden" name="action" value="add">';
463 print
'<div class="div-table-responsive">';
464 print
'<table class="noborder centpercent">';
465 print
'<tr class="liste_titre">';
466 print
'<td class="center">'.$langs->trans(
"DateOperationShort").
'</td>';
467 print
'<td class="center">'.$langs->trans(
"DateValueShort").
'</td>';
468 print
'<td>'.$langs->trans(
"Type").
'</td>';
469 print
'<td>'.$langs->trans(
"Description").
'</td>';
470 print
'<td class="right" width="60">'.$langs->trans(
"Debit").
'</td>';
471 print
'<td class="right" width="60">'.$langs->trans(
"Credit").
'</td>';
472 print
'<td class="right">'.$langs->trans(
"Balance").
'</td>';
473 print
'<td> </td>';
477 $sql =
"SELECT sum(b.amount) as amount";
478 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
479 $sql .=
" WHERE b.num_releve < '".$db->escape($numref).
"'";
480 $sql .=
" AND b.num_releve <> ''";
481 $sql .=
" AND b.fk_account = ".((int)
$object->id);
483 $resql = $db->query($sql);
485 $obj = $db->fetch_object($resql);
486 $total = $obj->amount;
490 $totalc = $totald = 0;
493 $sql = $sqlrequestforbankline;
495 $resql = $db->query($sql);
497 $num = $db->num_rows($resql);
501 print
'<tr class="oddeven"><td colspan="3"></td>';
502 print
'<td colspan="3"><b>'.$langs->trans(
"InitialBankBalance").
" :</b></td>";
503 print
'<td class="right"><b>'.price($total).
'</b></td><td> </td>';
507 $objp = $db->fetch_object($resql);
508 $total = $total + $objp->amount;
510 print
'<tr class="oddeven">';
513 print
'<td class="nowrap center">'.dol_print_date($db->jdate($objp->do),
"day").
'</td>';
516 print
'<td valign="center" class="center nowrap">';
517 print
'<span class="spanforajaxedit">'.dol_print_date($db->jdate($objp->dv),
"day").
'</span>';
519 print
'<span class="inline-block">';
520 print
'<a class="ajaxforbankoperationchange reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvprev&num='.urlencode($numref).
'&account='.
$object->id.
'&rowid='.$objp->rowid.
'&dvid='.$objp->rowid.
'">';
522 print
'<a class="ajaxforbankoperationchange reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvnext&num='.urlencode($numref).
'&account='.
$object->id.
'&rowid='.$objp->rowid.
'&dvid='.$objp->rowid.
'">';
528 if ($objp->fk_type ==
'SOLD') {
529 $type_label =
' ';
531 $type_label = ($langs->trans(
"PaymentTypeShort".$objp->fk_type) !=
"PaymentTypeShort".$objp->fk_type) ? $langs->trans(
"PaymentTypeShort".$objp->fk_type) : $objp->fk_type;
534 if ($objp->fk_bordereau > 0) {
535 $remisestatic->id = $objp->fk_bordereau;
536 $remisestatic->ref = $objp->ref;
537 $link =
' '.$remisestatic->getNomUrl(1);
539 print
'<td class="nowrap">'.$type_label.
' '.($objp->num_chq ? $objp->num_chq :
'').$link.
'</td>';
542 print
'<td valign="center">';
543 print
'<a href="'.DOL_URL_ROOT.
'/compta/bank/line.php?rowid='.$objp->rowid.
'&account='.
$object->id.
'">';
546 preg_match(
'/\((.+)\)/i', $objp->label, $reg);
547 if (!empty($reg[1]) && $langs->trans($reg[1]) != $reg[1]) {
548 print $langs->trans($reg[1]);
558 $links =
$object->get_url($objp->rowid);
559 foreach ($links as $key => $val) {
565 if ($links[$key][
'type'] ==
'payment') {
566 $paymentstatic->id = $links[$key][
'url_id'];
567 $paymentstatic->ref = $langs->trans(
"Payment");
568 print
' '.$paymentstatic->getNomUrl(1);
570 } elseif ($links[$key][
'type'] ==
'payment_supplier') {
571 $paymentsupplierstatic->id = $links[$key][
'url_id'];
572 $paymentsupplierstatic->ref = $langs->trans(
"Payment");
573 print
' '.$paymentsupplierstatic->getNomUrl(1);
575 } elseif ($links[$key][
'type'] ==
'payment_sc') {
576 print
'<a href="'.DOL_URL_ROOT.
'/compta/payment_sc/card.php?id='.$links[$key][
'url_id'].
'">';
577 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
578 print $langs->trans(
"SocialContributionPayment");
581 } elseif ($links[$key][
'type'] ==
'payment_vat') {
582 $paymentvatstatic->id = $links[$key][
'url_id'];
583 $paymentvatstatic->ref = $langs->trans(
"Payment");
584 print
' '.$paymentvatstatic->getNomUrl(1);
585 } elseif ($links[$key][
'type'] ==
'payment_salary') {
586 print
'<a href="'.DOL_URL_ROOT.
'/salaries/card.php?id='.$links[$key][
'url_id'].
'">';
587 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
588 print $langs->trans(
"Payment");
591 } elseif ($links[$key][
'type'] ==
'payment_donation') {
592 $paymentdonationstatic->id = $links[$key][
'url_id'];
593 $paymentdonationstatic->ref = $langs->trans(
"Payment");
594 print
' '.$paymentdonationstatic->getNomUrl(1);
596 } elseif ($links[$key][
'type'] ==
'payment_loan') {
597 $paymentloanstatic->id = $links[$key][
'url_id'];
598 $paymentloanstatic->ref = $langs->trans(
"Payment");
599 print
' '.$paymentloanstatic->getNomUrl(1);
601 } elseif ($links[$key][
'type'] ==
'payment_various') {
602 $paymentvariousstatic->id = $links[$key][
'url_id'];
603 $paymentvariousstatic->ref = $langs->trans(
"Payment");
604 print
' '.$paymentvariousstatic->getNomUrl(1);
606 } elseif ($links[$key][
'type'] ==
'banktransfert') {
608 if ($objp->amount > 0) {
609 $banklinestatic->fetch($links[$key][
'url_id']);
610 $bankstatic->id = $banklinestatic->fk_account;
611 $bankstatic->label = $banklinestatic->bank_account_label;
612 print
' ('.$langs->trans(
"from").
' ';
613 print $bankstatic->getNomUrl(1,
'transactions');
614 print
' '.$langs->trans(
"toward").
' ';
615 $bankstatic->id = $objp->bankid;
616 $bankstatic->label = $objp->bankref;
617 print $bankstatic->getNomUrl(1,
'');
620 $bankstatic->id = $objp->bankid;
621 $bankstatic->label = $objp->bankref;
622 print
' ('.$langs->trans(
"from").
' ';
623 print $bankstatic->getNomUrl(1,
'');
624 print
' '.$langs->trans(
"toward").
' ';
625 $banklinestatic->fetch($links[$key][
'url_id']);
626 $bankstatic->id = $banklinestatic->fk_account;
627 $bankstatic->label = $banklinestatic->bank_account_label;
628 print $bankstatic->getNomUrl(1,
'transactions');
631 } elseif ($links[$key][
'type'] ==
'company') {
632 $societestatic->id = $links[$key][
'url_id'];
633 $societestatic->name = $links[$key][
'label'];
634 print $societestatic->getNomUrl(1,
'company', 24);
636 } elseif ($links[$key][
'type'] ==
'member') {
637 print
'<a href="'.DOL_URL_ROOT.
'/adherents/card.php?rowid='.$links[$key][
'url_id'].
'">';
638 print
img_object($langs->trans(
'ShowMember'),
'user').
' ';
639 print $links[$key][
'label'];
642 } elseif ($links[$key][
'type'] ==
'user') {
643 print
'<a href="'.DOL_URL_ROOT.
'/user/card.php?id='.$links[$key][
'url_id'].
'">';
644 print
img_object($langs->trans(
'ShowUser'),
'user').
' ';
645 print $links[$key][
'label'];
648 } elseif ($links[$key][
'type'] ==
'sc') {
649 print
'<a href="'.DOL_URL_ROOT.
'/compta/sociales/card.php?id='.$links[$key][
'url_id'].
'">';
650 print
img_object($langs->trans(
'ShowBill'),
'bill').
' ';
651 print $langs->trans(
"SocialContribution");
655 print
'<a href="'.$links[$key][
'url'].$links[$key][
'url_id'].
'">';
656 print $links[$key][
'label'];
664 $sql =
"SELECT label";
665 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_categ as ct";
666 $sql .=
", ".MAIN_DB_PREFIX.
"bank_class as cl";
667 $sql .=
" WHERE ct.rowid = cl.fk_categ";
668 $sql .=
" AND ct.entity = ".((int) $conf->entity);
669 $sql .=
" AND cl.lineid = ".((int) $objp->rowid);
671 $resc = $db->query($sql);
673 $numc = $db->num_rows($resc);
675 if ($numc && !$newline) {
678 while ($ii < $numc) {
679 $objc = $db->fetch_object($resc);
680 print
"<br>- <i>".$objc->label.
"</i>";
690 if ($objp->amount < 0) {
691 $totald = $totald + abs($objp->amount);
692 print
'<td class="nowrap right">'.price($objp->amount * -1).
"</td><td> </td>\n";
694 $totalc = $totalc + abs($objp->amount);
695 print
'<td> </td><td class="nowrap right">'.price($objp->amount).
"</td>\n";
698 print
'<td class="nowrap right">'.price(
price2num($total,
'MT')).
"</td>\n";
700 if ($user->hasRight(
'banque',
'modifier') || $user->hasRight(
'banque',
'consolidate')) {
701 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)).
'">';
705 print
"<td class=\"center\"> </td>";
716 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>";
720 print
"<td class=\"right\" colspan=\"3\"> </td><td colspan=\"3\"><b>".$langs->trans(
"EndBankBalance").
" :</b></td>";
721 print
'<td class="right"><b>'.price(
price2num($total,
'MT')).
"</b></td><td> </td>";
726 $urlajax = DOL_URL_ROOT.
'/core/ajax/bankconciliate.php?token='.
currentToken();
728 <script type="text/javascript">
730 $("a.ajaxforbankoperationchange").each(function(){
731 var current = $(this);
732 current.click(function()
734 console.log("We click on ajaxforbankoperationchange");
735 var url = "'.$urlajax.
'&"+current.attr("href").split("?")[1];
736 $.get(url, function(data)
740 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()
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...)
Put here description of your class.
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)
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'.
print_barre_liste($title, $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.
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.
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.