35require
'../../main.inc.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/paymentvat.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/paymentsocialcontribution.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/tva.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
53require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
54require_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
55require_once DOL_DOCUMENT_ROOT.
'/don/class/paymentdonation.class.php';
56require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/paymentexpensereport.class.php';
57require_once DOL_DOCUMENT_ROOT.
'/loan/class/loan.class.php';
58require_once DOL_DOCUMENT_ROOT.
'/fourn/class/paiementfourn.class.php';
59require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
62$langs->loadLangs(array(
"banks",
"bills",
"categories",
"companies",
"margins",
"salaries",
"loan",
"donations",
"trips",
"members",
"compta",
"accountancy"));
66$action =
GETPOST(
'action',
'aZ09');
67$cancel =
GETPOST(
'cancel',
'alpha');
68$confirm =
GETPOST(
'confirm',
'alpha');
69$contextpage =
'bankentrieslist';
70$massaction =
GETPOST(
'massaction',
'alpha');
71$optioncss =
GETPOST(
'optioncss',
'aZ09');
75$search_debit =
GETPOST(
"search_debit",
'alpha');
76$search_credit =
GETPOST(
"search_credit",
'alpha');
77$search_type =
GETPOST(
"search_type",
'alpha');
78$search_account =
GETPOST(
"search_account",
'int') ?
GETPOST(
"search_account",
'int') :
GETPOST(
"account",
'int');
79$search_accountancy_code =
GETPOST(
'search_accountancy_code',
'alpha') ?
GETPOST(
'search_accountancy_code',
'alpha') :
GETPOST(
'accountancy_code',
'alpha');
81$search_ref =
GETPOST(
'search_ref',
'alpha');
82$search_description =
GETPOST(
"search_description",
'alpha');
87$search_thirdparty_user =
GETPOST(
"search_thirdparty",
'alpha') ?
GETPOST(
"search_thirdparty",
'alpha') :
GETPOST(
"thirdparty",
'alpha');
88$search_req_nb =
GETPOST(
"req_nb",
'alpha');
89$search_num_releve =
GETPOST(
"search_num_releve",
'alpha');
90$search_conciliated =
GETPOST(
"search_conciliated",
'int');
91$search_fk_bordereau =
GETPOST(
"search_fk_bordereau",
'int');
92$optioncss =
GETPOST(
'optioncss',
'alpha');
93$toselect =
GETPOST(
'toselect',
'array');
94$num_releve =
GETPOST(
"num_releve",
"alpha");
100$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
101$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
105 $page = $pageplusone - 1;
107if (empty($page) || $page == -1) {
110$offset = $limit * $page;
111$pageprev = $page - 1;
112$pagenext = $page + 1;
114 $sortorder =
'desc,desc,desc';
117 $sortfield =
'b.datev,b.dateo,b.rowid';
121if ($id > 0 || !empty($ref)) {
122 $result =
$object->fetch($id, $ref);
126 $langs->load(
"errors");
127 print($langs->trans(
'ErrorRecordNotFound'));
133$contextpage =
'banktransactionlist'.(empty(
$object->id) ?
'' :
'-'.$object->id);
135$mode_balance_ok =
false;
137if (($sortfield ==
'b.datev' || $sortfield ==
'b.datev,b.dateo,b.rowid')) {
138 $sortfield =
'b.datev,b.dateo,b.rowid';
139 if ($id > 0 || !empty($ref) || $search_account > 0) {
140 $mode_balance_ok =
true;
145$hookmanager->initHooks(array(
'banktransactionlist', $contextpage));
148$extrafieldsobjectkey =
'bank';
151$extrafields->fetch_name_optionals_label($extrafieldsobjectkey);
152$search_array_options = $extrafields->getOptionalsFromPost($extrafieldsobjectkey,
'',
'search_');
155 'b.rowid' => array(
'label' => $langs->trans(
"Ref"),
'checked' => 1,
'position' => 10),
156 'b.label' => array(
'label' => $langs->trans(
"Description"),
'checked' => 1,
'position' => 20),
157 'b.dateo' => array(
'label' => $langs->trans(
"DateOperationShort"),
'checked' => -1,
'position' => 30),
158 'b.datev' => array(
'label' => $langs->trans(
"DateValueShort"),
'checked' => 1,
'position' => 40),
159 'type' => array(
'label' => $langs->trans(
"Type"),
'checked' => 1,
'position' => 50),
160 'b.num_chq' => array(
'label' => $langs->trans(
"Numero"),
'checked' => 1,
'position' => 60),
161 'bu.label' => array(
'label' => $langs->trans(
"ThirdParty").
'/'.$langs->trans(
"User"),
'checked' => 1,
'position' => 70),
162 'ba.ref' => array(
'label' => $langs->trans(
"BankAccount"),
'checked' => (($id > 0 || !empty($ref)) ? 0 : 1),
'position' => 80),
163 'b.debit' => array(
'label' => $langs->trans(
"Debit"),
'checked' => 1,
'position' => 90),
164 'b.credit' => array(
'label' => $langs->trans(
"Credit"),
'checked' => 1,
'position' => 100),
165 'balancebefore' => array(
'label' => $langs->trans(
"BalanceBefore"),
'checked' => 0,
'position' => 110),
166 'balance' => array(
'label' => $langs->trans(
"Balance"),
'checked' => 1,
'position' => 120),
167 'b.num_releve' => array(
'label' => $langs->trans(
"AccountStatement"),
'checked' => 1,
'position' => 130),
168 'b.conciliated' => array(
'label' => $langs->trans(
"BankLineReconciled"),
'enabled' =>
$object->rappro,
'checked' => ($action ==
'reconcile' ? 1 : 0),
'position' => 140),
169 'b.fk_bordereau' => array(
'label' => $langs->trans(
"ChequeNumber"),
'checked' => 0,
'position' => 150),
172include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
178$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref :
''));
179$fieldtype = (!empty($ref) ?
'ref' :
'rowid');
182 $socid = $user->socid;
184 $result =
restrictedArea($user,
'banque', $fieldvalue,
'bank_account&bank_account',
'',
'', $fieldtype);
187 $socid = $user->socid;
197if (
GETPOST(
'cancel',
'alpha')) {
201if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
205$parameters = array();
206$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
211include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
213if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
214 $search_dt_start =
'';
216 $search_dv_start =
'';
224 $search_description =
'';
225 $search_thirdparty_user =
'';
226 $search_num_releve =
'';
227 $search_conciliated =
'';
228 $search_fk_bordereau =
'';
231 $search_account =
"";
232 if ($id > 0 || !empty($ref)) {
237if (empty($reshook)) {
238 $objectclass =
'Account';
239 $objectlabel =
'BankTransaction';
240 $permissiontoread = $user->hasRight(
'banque',
'lire');
241 $permissiontodelete = $user->hasRight(
'banque',
'modifier');
242 $uploaddir = $conf->bank->dir_output;
243 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
246$rowids =
GETPOST(
'rowid',
'array');
249if ((
GETPOST(
'confirm_savestatement',
'alpha') ||
GETPOST(
'confirm_reconcile',
'alpha'))
250 && (
GETPOST(
"num_releve",
"alpha") || !empty($rowids))
251 && $user->hasRight(
'banque',
'consolidate')
252 && (!GETPOSTISSET(
'pageplusone') || (
GETPOST(
'pageplusone') ==
GETPOST(
'pageplusoneold')))) {
256 $num_releve =
GETPOST(
"num_releve",
"alpha");
261 $rowids =
GETPOST(
'rowid',
'array');
263 if (!empty($rowids) && is_array($rowids)) {
264 foreach ($rowids as $row) {
266 $result = $bankline->fetch($row);
267 $bankline->num_releve = $num_releve;
268 $result = $bankline->update_conciliation($user,
GETPOST(
"cat"),
GETPOST(
'confirm_reconcile',
'alpha') ? 1 : 0);
276 if (!$error && count($rowids) > 0) {
277 setEventMessages($langs->trans(
"XNewLinesConciliated", count($rowids)),
null);
281 $langs->load(
"errors");
286 $langs->load(
"errors");
287 setEventMessages($langs->trans(
"ErrorPleaseTypeBankTransactionReportName"),
null,
'errors');
291 $param =
'action=reconcile&contextpage=banktransactionlist&id='.((int)
$object->id).
'&search_account='.((int)
$object->id);
293 $param .=
'&page='.urlencode((
string) ($page));
296 $param .=
'&offset='.urlencode((
string) ($offset));
299 $param .=
'&limit='.((int) $limit);
301 if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
302 $param .=
'&search_conciliated='.urlencode((
string) ($search_conciliated));
304 if ($search_thirdparty_user) {
305 $param .=
'&search_thirdparty='.urlencode($search_thirdparty_user);
307 if ($search_num_releve) {
308 $param .=
'&search_num_releve='.urlencode($search_num_releve);
310 if ($search_description) {
311 $param .=
'&search_description='.urlencode($search_description);
314 $param .=
'&search_start_dtmonth='.GETPOSTINT(
'search_start_dtmonth').
'&search_start_dtday='.
GETPOSTINT(
'search_start_dtday').
'&search_start_dtyear='.
GETPOSTINT(
'search_start_dtyear');
317 $param .=
'&search_end_dtmonth='.GETPOSTINT(
'search_end_dtmonth').
'&search_end_dtday='.
GETPOSTINT(
'search_end_dtday').
'&search_end_dtyear='.
GETPOSTINT(
'search_end_dtyear');
320 $param .=
'&search_start_dvmonth='.GETPOSTINT(
'search_start_dvmonth').
'&search_start_dvday='.
GETPOSTINT(
'search_start_dvday').
'&search_start_dvyear='.
GETPOSTINT(
'search_start_dvyear');
323 $param .=
'&search_end_dvmonth='.GETPOSTINT(
'search_end_dvmonth').
'&search_end_dvday='.
GETPOSTINT(
'search_end_dvday').
'&search_end_dvyear='.
GETPOSTINT(
'search_end_dvyear');
326 $param .=
'&search_type='.urlencode($search_type);
329 $param .=
'&search_debit='.urlencode($search_debit);
331 if ($search_credit) {
332 $param .=
'&search_credit='.urlencode($search_credit);
334 $param .=
'&sortfield='.urlencode($sortfield).
'&sortorder='.urlencode($sortorder);
335 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?'.$param);
341if (
GETPOST(
'save') && !$cancel && $user->hasRight(
'banque',
'modifier')) {
350 $operation =
GETPOST(
"operation",
'alpha');
351 $num_chq =
GETPOST(
"num_chq",
'alpha');
352 $label =
GETPOST(
"label",
'alpha');
353 $cat1 =
GETPOST(
"cat1",
'alpha');
355 $bankaccountid = $id;
361 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Date")),
null,
'errors');
365 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
369 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Label")),
null,
'errors');
373 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Amount")),
null,
'errors');
375 if (!($bankaccountid > 0)) {
377 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"BankAccount")),
null,
'errors');
387 $objecttmp->fetch($bankaccountid);
388 $insertid = $objecttmp->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user,
'',
'', $search_accountancy_code);
391 header(
"Location: ".$_SERVER[
'PHP_SELF'].($id ?
"?id=".$id :
''));
401if ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->hasRight(
'banque',
'modifier')) {
403 $result = $accline->fetch(
GETPOSTINT(
"rowid"));
404 $result = $accline->delete($user);
416$form =
new Form($db);
420$companystatic =
new Societe($db);
421$bankaccountstatic =
new Account($db);
422$userstatic =
new User($db);
425$societestatic =
new Societe($db);
426$userstatic =
new User($db);
428$loanstatic =
new Loan($db);
430$donstatic =
new Don($db);
447if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
448 $param .=
'&contextpage='.urlencode($contextpage);
450if ($limit > 0 && $limit != $conf->liste_limit) {
451 $param .=
'&limit='.((int) $limit);
454 $param .=
'&id='.urlencode((
string) ($id));
457 $param .=
'&ref='.urlencode($ref);
459if (!empty($search_ref)) {
460 $param .=
'&search_ref='.urlencode($search_ref);
462if (!empty($search_description)) {
463 $param .=
'&search_description='.urlencode($search_description);
465if (!empty($search_type)) {
466 $param .=
'&type='.urlencode($search_type);
468if (!empty($search_thirdparty_user)) {
469 $param .=
'&search_thirdparty='.urlencode($search_thirdparty_user);
471if (!empty($search_debit)) {
472 $param .=
'&search_debit='.urlencode($search_debit);
474if (!empty($search_credit)) {
475 $param .=
'&search_credit='.urlencode($search_credit);
477if ($search_account > 0) {
478 $param .=
'&search_account='.((int) $search_account);
480if (!empty($search_num_releve)) {
481 $param .=
'&search_num_releve='.urlencode($search_num_releve);
483if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
484 $param .=
'&search_conciliated='.urlencode((
string) ($search_conciliated));
486if ($search_fk_bordereau > 0) {
487 $param .=
'$&search_fk_bordereau='.urlencode((
string) ($search_fk_bordereau));
489if ($search_bid > 0) {
490 $param .=
'&search_bid='.((int) $search_bid);
493 $param .=
'&search_start_dtmonth='.GETPOSTINT(
'search_start_dtmonth').
'&search_start_dtday='.
GETPOSTINT(
'search_start_dtday').
'&search_start_dtyear='.
GETPOSTINT(
'search_start_dtyear');
496 $param .=
'&search_end_dtmonth='.GETPOSTINT(
'search_end_dtmonth').
'&search_end_dtday='.
GETPOSTINT(
'search_end_dtday').
'&search_end_dtyear='.
GETPOSTINT(
'search_end_dtyear');
499 $param .=
'&search_start_dvmonth='.GETPOSTINT(
'search_start_dvmonth').
'&search_start_dvday='.
GETPOSTINT(
'search_start_dvday').
'&search_start_dvyear='.
GETPOSTINT(
'search_start_dvyear');
502 $param .=
'&search_end_dvmonth='.GETPOSTINT(
'search_end_dvmonth').
'&search_end_dvday='.
GETPOSTINT(
'search_end_dvday').
'&search_end_dvyear='.
GETPOSTINT(
'search_end_dvyear');
505 $param .=
'&req_nb='.urlencode($search_req_nb);
508 $param .=
'&thirdparty='.urlencode((
string) (
GETPOSTINT(
"search_thirdparty")));
510if ($optioncss !=
'') {
511 $param .=
'&optioncss='.urlencode($optioncss);
513if ($action ==
'reconcile') {
514 $param .=
'&action=reconcile';
522include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
526$buttonreconcile =
'';
529if ($id > 0 || !empty($ref)) {
530 $title =
$object->ref.
' - '.$langs->trans(
"Transactions");
532 $title = $langs->trans(
"BankTransactions");
536llxHeader(
'', $title, $help_url,
'', 0, 0, array(), array(), $param);
539if ($id > 0 || !empty($ref)) {
541 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
544 $arrayofbankcateg = $bankcateg->fetchAll();
545 foreach ($arrayofbankcateg as $bankcategory) {
546 $options[$bankcategory->id] = $bankcategory->label;
551 print
dol_get_fiche_head($head,
'journal', $langs->trans(
"FinancialAccount"), 0,
'account');
553 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
555 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
564 if ($action !=
'reconcile') {
565 if (
$object->canBeConciliated() > 0) {
566 $allowautomaticconciliation =
false;
567 $titletoconciliatemanual = $langs->trans(
"Conciliate");
568 $titletoconciliateauto = $langs->trans(
"Conciliate");
569 if ($allowautomaticconciliation) {
570 $titletoconciliatemanual .=
' ('.$langs->trans(
"Manual").
')';
571 $titletoconciliateauto .=
' ('.$langs->trans(
"Auto").
')';
575 if ($user->hasRight(
'banque',
'consolidate')) {
577 $newparam = preg_replace(
'/search_conciliated=\d+/i',
'', $newparam);
578 $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.
'">'.$titletoconciliatemanual.
'</a>';
580 $buttonreconcile =
'<a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliatemanual.
'</a>';
583 if ($allowautomaticconciliation) {
585 if ($user->hasRight(
'banque',
'consolidate')) {
587 $newparam = preg_replace(
'/search_conciliated=\d+/i',
'', $newparam);
588 $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>';
590 $buttonreconcile .=
' <a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliateauto.
'</a>';
597$sql =
"SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro as conciliated, b.num_releve, b.num_chq,";
598$sql .=
" b.fk_account, b.fk_type, b.fk_bordereau,";
599$sql .=
" ba.rowid as bankid, ba.ref as bankref";
601if (!empty($extrafields->attributes[$extrafieldsobjectkey][
'label'])) {
602 foreach ($extrafields->attributes[$extrafieldsobjectkey][
'label'] as $key => $val) {
603 $sql .= ($extrafields->attributes[$extrafieldsobjectkey][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
607$parameters = array();
608$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
609$sql .= $hookmanager->resPrint;
611if ($search_bid > 0) {
612 $sql .= MAIN_DB_PREFIX.
"bank_class as l,";
614$sql .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
615$sql .=
" ".MAIN_DB_PREFIX.
"bank as b";
616if (!empty($extrafields->attributes[$extrafieldsobjectkey][
'label']) && is_array($extrafields->attributes[$extrafieldsobjectkey][
'label']) && count($extrafields->attributes[$extrafieldsobjectkey][
'label'])) {
617 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$extrafieldsobjectkey.
"_extrafields as ef on (b.rowid = ef.fk_object)";
621$parameters = array();
622$reshook = $hookmanager->executeHooks(
'printFieldListJoin', $parameters, $object, $action);
623$sql .= $hookmanager->resPrint;
625$sql .=
" WHERE b.fk_account = ba.rowid";
626$sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
627if ($search_account > 0) {
628 $sql .=
" AND b.fk_account = ".((int) $search_account);
632 $sql .=
" AND b.dateo >= '".$db->idate($search_dt_start).
"'";
635 $sql .=
" AND b.dateo <= '".$db->idate($search_dt_end).
"'";
639 $sql .=
" AND b.datev >= '".$db->idate($search_dv_start).
"'";
642 $sql .=
" AND b.datev <= '".$db->idate($search_dv_end).
"'";
650if ($search_num_releve) {
653if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
654 $sql .=
" AND b.rappro = ".((int) $search_conciliated);
656if ($search_fk_bordereau > 0) {
657 $sql .=
" AND b.fk_bordereau = " . ((int) $search_fk_bordereau);
659if ($search_thirdparty_user) {
660 $sql .=
" AND (b.rowid IN ";
661 $sql .=
" ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url AS bu";
662 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"bank AS b2 ON b2.rowid = bu.fk_bank";
663 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"user AS subUser ON (bu.type = 'user' AND bu.url_id = subUser.rowid)";
664 $sql .=
" WHERE ".
natural_search(array(
"subUser.firstname",
"subUser.lastname"), $search_thirdparty_user,
'', 1).
")";
666 $sql .=
" OR b.rowid IN ";
667 $sql .=
" ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url AS bu";
668 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"bank AS b2 ON b2.rowid = bu.fk_bank";
669 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"societe AS subSoc ON (bu.type = 'company' AND bu.url_id = subSoc.rowid)";
670 $sql .=
" WHERE ".
natural_search(array(
"subSoc.nom"), $search_thirdparty_user,
'', 1);
673if ($search_description) {
674 $search_description_to_use = $search_description;
675 $arrayoffixedlabels = array(
677 'CustomerInvoicePayment',
'CustomerInvoicePaymentBack',
678 'SupplierInvoicePayment',
'SupplierInvoicePaymentBack',
680 'ExpenseReportPayment',
681 'SocialContributionPayment',
682 'SubscriptionPayment',
685 foreach ($arrayoffixedlabels as $keyforlabel) {
686 $translatedlabel = $langs->transnoentitiesnoconv($keyforlabel);
687 if (preg_match(
'/'.$search_description.
'/i', $translatedlabel)) {
688 $search_description_to_use .=
"|".$keyforlabel;
694if ($search_bid > 0) {
695 $sql .=
" AND b.rowid = l.lineid AND l.fk_categ = ".((int) $search_bid);
697if (!empty($search_type)) {
698 $sql .=
" AND b.fk_type = '".$db->escape($search_type).
"'";
703 $sql .=
' AND b.amount <= 0';
707 $sql .=
' AND b.amount >= 0';
710include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
713$parameters = array();
714$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
715$sql .= $hookmanager->resPrint;
717$sql .= $db->order($sortfield, $sortorder);
719$nbtotalofrecords =
'';
722 $result = $db->query($sql);
723 $nbtotalofrecords = $db->num_rows($result);
724 $nbtotalofpages = ceil($nbtotalofrecords / $limit);
727if (($id > 0 || !empty($ref)) && ((
string) $page ==
'')) {
730 $page = ($nbtotalofpages - 1);
731 $offset = $limit * $page;
736if ($page >= $nbtotalofpages) {
738 $page = ($nbtotalofpages - 1);
739 $offset = $limit * $page;
747if (empty($search_account)) {
748 $mode_balance_ok =
false;
751if (!empty($search_ref)) {
752 $mode_balance_ok =
false;
754if (!empty($search_description)) {
755 $mode_balance_ok =
false;
757if (!empty($search_type)) {
758 $mode_balance_ok =
false;
760if (!empty($search_debit)) {
761 $mode_balance_ok =
false;
763if (!empty($search_credit)) {
764 $mode_balance_ok =
false;
766if (!empty($search_thirdparty_user)) {
767 $mode_balance_ok =
false;
769if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
770 $mode_balance_ok =
false;
772if (!empty($search_num_releve)) {
773 $mode_balance_ok =
false;
775if (!empty($search_fk_bordereau)) {
776 $mode_balance_ok =
false;
779$sql .= $db->plimit($limit + 1, $offset);
781dol_syslog(
'compta/bank/bankentries_list.php', LOG_DEBUG);
782$resql = $db->query($sql);
784 $num = $db->num_rows($resql);
786 $arrayofselected = (!empty($toselect) && is_array($toselect)) ? $toselect : array();
789 $arrayofmassactions = array(
793 if (in_array($massaction, array(
'presend',
'predelete'))) {
794 $arrayofmassactions = array();
796 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
799 if ($action ==
'delete') {
800 $text = $langs->trans(
'ConfirmDeleteTransaction');
801 print $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&rowid='.
GETPOSTINT(
"rowid"), $langs->trans(
'DeleteTransaction'), $text,
'confirm_delete',
null,
'', 1);
805 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'" name="search_form">'.
"\n";
806 if ($optioncss !=
'') {
807 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
809 print
'<input type="hidden" name="token" value="'.newToken().
'">';
810 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
811 print
'<input type="hidden" name="action" value="'.($action !=
'delete' ? $action :
'search').
'">';
813 print
'<input type="hidden" name="view" value="'.dol_escape_htmltag($view).
'">';
815 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
816 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
817 print
'<input type="hidden" name="page" value="'.$page.
'">';
818 print
'<input type="hidden" name="id" value="'.$id.
'">';
819 print
'<input type="hidden" name="ref" value="'.$ref.
'">';
821 print
'<input type="hidden" name="bid" value="'.GETPOSTINT(
"bid").
'">';
825 if ($user->hasRight(
'banque',
'modifier') && $action ==
'addline' &&
getDolGlobalString(
'BANK_USE_OLD_VARIOUS_PAYMENT')) {
828 print
'<table class="noborder centpercent">';
830 print
'<tr class="liste_titre">';
831 print
'<td>'.$langs->trans(
"Description").
'</td>';
832 print
'<td>'.$langs->trans(
"Date").
'</td>';
833 print
'<td> </td>';
834 print
'<td>'.$langs->trans(
"Type").
'</td>';
835 print
'<td>'.$langs->trans(
"Numero").
'</td>';
836 print
'<td class=right>'.$langs->trans(
"BankAccount").
'</td>';
837 print
'<td class=right>'.$langs->trans(
"Debit").
'</td>';
838 print
'<td class=right>'.$langs->trans(
"Credit").
'</td>';
845 print
'<td class="center"> </td>';
850 print
'<input name="label" class="flat minwidth200" type="text" value="'.GETPOST(
"label",
"alpha").
'">';
851 if (is_array($options) && count($options)) {
852 print
'<br>'.$langs->trans(
"Rubrique").
': ';
856 print
'<td class="nowrap">';
857 print $form->selectDate(empty($dateop) ? -1 : $dateop,
'op', 0, 0, 0,
'transaction');
859 print
'<td> </td>';
860 print
'<td class="nowrap">';
861 $form->select_types_paiements((
GETPOST(
'operation') ?
GETPOST(
'operation') : (
$object->
type ==
Account::TYPE_CASH ?
'LIQ' :
'')),
'operation',
'1,2', 2, 1);
864 print
'<input name="num_chq" class="flat" type="text" size="4" value="'.GETPOST(
"num_chq",
"alpha").
'">';
868 print
'<td class=right>';
869 $form->select_comptes(
GETPOSTINT(
'add_account') ?
GETPOSTINT(
'add_account') : $search_account,
'add_account', 0,
'', 1, ($id > 0 || !empty($ref) ?
' disabled="disabled"' :
''));
872 print
'<td class="right"><input name="adddebit" class="flat" type="text" size="4" value="'.GETPOST(
"adddebit",
"alpha").
'"></td>';
873 print
'<td class="right"><input name="addcredit" class="flat" type="text" size="4" value="'.GETPOST(
"addcredit",
"alpha").
'"></td>';
880 print
'<td class="center">';
881 print
'<input type="submit" name="save" class="button buttongen marginbottomonly button-add" value="'.$langs->trans(
"Add").
'"><br>';
882 print
'<input type="submit" name="cancel" class="button buttongen marginbottomonly button-cancel" value="'.$langs->trans(
"Cancel").
'">';
890 $urlajax = DOL_URL_ROOT.
'/core/ajax/bankconciliate.php?token='.
currentToken();
892 <script type="text/javascript">
894 $("a.ajaxforbankoperationchange").each(function(){
895 var current = $(this);
896 current.click(function()
898 var url = "'.$urlajax.
'&"+current.attr("href").split("?")[1];
899 $.get(url, function(data)
903 current.parent().parent().find(".spanforajaxedit").replaceWith(data);
918 if ($action !=
'addline') {
921 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?action=create&accountid='.urlencode($search_account).
'&backtopage='.urlencode($_SERVER[
'PHP_SELF'].
'?id='.urlencode($search_account)),
'', $user->rights->banque->modifier);
923 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.
newToken().
'&page='.$page.$param,
'', $user->rights->banque->modifier);
926 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.
newToken().
'&page='.$page.$param,
'', -1);
938 if ($action !=
'addline' && $action !=
'reconcile') {
939 $morehtml .= $buttonreconcile;
942 $morehtmlright =
'<!-- Add New button -->'.$newcardbutton;
944 $picto =
'bank_account';
945 if ($id > 0 || !empty($ref)) {
950 print_barre_liste($langs->trans(
"BankTransactions"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton.$morehtml, $num, $nbtotalofrecords, $picto, 0, $morehtmlright,
'', $limit, 0, 0, 1);
953 if ($user->hasRight(
'banque',
'consolidate') && $action ==
'reconcile') {
954 print
'<!-- form with reconciliation input -->'.
"\n";
955 print
'<div class="valignmiddle inline-block" style="padding-right: 20px;">';
957 print
'<strong>'.$langs->trans(
"InputReceiptNumber").
'</strong>: ';
958 print
'<input class="flat width100" id="num_releve" list="num_releve_list" name="num_releve" type="text" value="'.(GETPOST(
'num_releve') ?
GETPOST(
'num_releve') :
'').
'">';
960 $texttoshow = $langs->trans(
"InputReceiptNumber").
': ';
961 $yyyy =
dol_substr($langs->transnoentitiesnoconv(
"Year"), 0, 1).substr($langs->transnoentitiesnoconv(
"Year"), 0, 1).substr($langs->transnoentitiesnoconv(
"Year"), 0, 1).substr($langs->transnoentitiesnoconv(
"Year"), 0, 1);
962 $mm =
dol_substr($langs->transnoentitiesnoconv(
"Month"), 0, 1).substr($langs->transnoentitiesnoconv(
"Month"), 0, 1);
963 $dd =
dol_substr($langs->transnoentitiesnoconv(
"Day"), 0, 1).substr($langs->transnoentitiesnoconv(
"Day"), 0, 1);
964 $placeholder = $yyyy.$mm;
965 $placeholder2 = $yyyy.$mm;
966 $placeholder2 .=
' '.$langs->trans(
"or").
' ';
967 $placeholder2 .= $yyyy.$mm.$dd;
969 $texttoshow .= $langs->trans(
"InputReceiptNumberBis");
972 print
'<input class="flat width100" pattern="[0-9]+" title="'.dol_escape_htmltag($texttoshow.
': '.$placeholder2).
'" id="num_releve" name="num_releve" placeholder="'.
dol_escape_htmltag($placeholder).
'" type="text" value="'.(
GETPOSTINT(
'num_releve') ?
GETPOSTINT(
'num_releve') :
'').
'">';
975 if (is_array($options) && count($options)) {
976 print $langs->trans(
"EventualyAddCategory").
': ';
979 print
'<br><div style="margin-top: 5px;"><span class="opacitymedium">'.$langs->trans(
"ThenCheckLinesAndConciliate").
'</span> ';
980 print
'<input type="submit" class="button" name="confirm_reconcile" value="'.$langs->trans(
"Conciliate").
'">';
981 print
' <span class="opacitymedium">'.$langs->trans(
"otherwise").
'</span> ';
982 print
'<input type="submit" class="button small" name="confirm_savestatement" value="'.$langs->trans(
"SaveStatementOnly").
'">';
983 print
' <span class="opacitymedium">'.$langs->trans(
"or").
'</span> ';
984 print
'<input type="submit" name="cancel" class="button button-cancel small" value="'.$langs->trans(
"Cancel").
'">';
989 $listoflastreceipts =
'';
990 $sql =
"SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX.
"bank";
991 $sql .=
" WHERE fk_account = ".((int)
$object->id).
" AND num_releve IS NOT NULL";
992 $sql .= $db->order(
"num_releve",
"DESC");
993 $sql .= $db->plimit($nbmax + 1);
996 print $langs->trans(
"LastAccountStatements").
' : ';
997 $resqlr = $db->query($sql);
999 $numr = $db->num_rows($resqlr);
1002 while (($i < $numr) && ($i < $nbmax)) {
1003 $objr = $db->fetch_object($resqlr);
1005 $last_releve = $objr->num_releve;
1009 $newentreyinlist =
'<a target="_blank" href="'.DOL_URL_ROOT.
'/compta/bank/releve.php?account='.((int) $id).
'&num='.urlencode($objr->num_releve).
'">';
1010 $newentreyinlist .=
img_picto($objr->num_releve,
'generic',
'class="paddingright"');
1012 $listoflastreceipts = $newentreyinlist.$listoflastreceipts;
1014 if ($numr >= $nbmax) {
1015 $listoflastreceipts =
"... ".$listoflastreceipts;
1017 print $listoflastreceipts;
1019 print
'<b>'.$langs->trans(
"None").
'</b>';
1028 <script type="text/javascript">
1029 $("#num_releve").val("' . $last_releve.
'");
1038 $param .=
'&page='.urlencode((
string) ($page));
1041 $moreforfilter =
'';
1042 $moreforfilter .=
'<div class="divsearchfield">';
1043 $moreforfilter .= $langs->trans(
'DateOperationShort');
1044 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1045 $moreforfilter .=
'<div class="nowrap inline-block">';
1046 $moreforfilter .= $form->selectDate($search_dt_start,
'search_start_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1047 $moreforfilter .=
'</div>';
1048 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'' :
' ');
1049 $moreforfilter .=
'<div class="nowrap inline-block">';
1050 $moreforfilter .= $form->selectDate($search_dt_end,
'search_end_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1051 $moreforfilter .=
'</div>';
1052 $moreforfilter .=
'</div>';
1054 $moreforfilter .=
'<div class="divsearchfield">';
1055 $moreforfilter .= $langs->trans(
'DateValueShort');
1056 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1057 $moreforfilter .=
'<div class="nowrap inline-block">';
1058 $moreforfilter .= $form->selectDate($search_dv_start,
'search_start_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1059 $moreforfilter .=
'</div>';
1060 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'' :
' ');
1061 $moreforfilter .=
'<div class="nowrap inline-block">';
1062 $moreforfilter .= $form->selectDate($search_dv_end,
'search_end_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1063 $moreforfilter .=
'</div>';
1064 $moreforfilter .=
'</div>';
1066 if (isModEnabled(
'category')) {
1068 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1069 $langs->load(
'categories');
1072 $moreforfilter .=
'<div class="divsearchfield">';
1073 $tmptitle = $langs->trans(
'RubriquesTransactions');
1074 $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, $search_bid,
'parent',
null,
null, 1);
1075 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$form->selectarray(
'search_bid', $cate_arbo, $search_bid, $tmptitle, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1076 $moreforfilter .=
'</div>';
1080 $parameters = array();
1081 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1082 if (empty($reshook)) {
1083 $moreforfilter .= $hookmanager->resPrint;
1085 $moreforfilter = $hookmanager->resPrint;
1088 if ($moreforfilter) {
1089 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1090 print $moreforfilter;
1091 print
'</div>'.
"\n";
1094 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1095 $htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1096 $selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
1097 $selectedfields .= ($action ==
'reconcile' ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1100 if ($action ==
'reconcile') {
1101 $arrayfields[
'b.num_releve'][
'checked'] = 1;
1104 print
'<div class="div-table-responsive">';
1105 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1109 print
'<tr class="liste_titre_filter">';
1112 print
'<td class="liste_titre valignmiddle center">';
1113 $searchpicto = $form->showFilterButtons(
'left');
1119 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1120 print
'<td class="liste_titre">';
1121 print
'<input type="text" class="flat" name="search_ref" size="2" value="'.dol_escape_htmltag($search_ref).
'">';
1124 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1125 print
'<td class="liste_titre">';
1126 print
'<input type="text" class="flat maxwidth100" name="search_description" value="'.dol_escape_htmltag($search_description).
'">';
1129 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1130 print
'<td class="liste_titre"> </td>';
1132 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1133 print
'<td class="liste_titre"> </td>';
1135 if (!empty($arrayfields[
'type'][
'checked'])) {
1136 print
'<td class="liste_titre center">';
1137 print $form->select_types_paiements(empty($search_type) ?
'' : $search_type,
'search_type',
'', 2, 1, 1, 0, 1,
'maxwidth100', 1);
1141 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1142 print
'<td class="liste_titre center"><input type="text" class="flat" name="req_nb" value="'.dol_escape_htmltag($search_req_nb).
'" size="2"></td>';
1145 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1146 print
'<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty_user).
'"></td>';
1149 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1150 print
'<td class="liste_titre">';
1151 $form->select_comptes($search_account,
'search_account', 0,
'', 1, ($id > 0 || !empty($ref) ?
' disabled="disabled"' :
''), 0,
'maxwidth100');
1155 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1156 print
'<td class="liste_titre right">';
1157 print
'<input type="text" class="flat width50" name="search_debit" value="'.dol_escape_htmltag($search_debit).
'">';
1161 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1162 print
'<td class="liste_titre right">';
1163 print
'<input type="text" class="flat width50" name="search_credit" value="'.dol_escape_htmltag($search_credit).
'">';
1167 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1168 print
'<td class="liste_titre right">';
1169 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1170 print $form->textwithpicto(
'', $htmltext, 1);
1174 if (!empty($arrayfields[
'balance'][
'checked'])) {
1175 print
'<td class="liste_titre right">';
1176 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1177 print $form->textwithpicto(
'', $htmltext, 1);
1181 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1182 print
'<td class="liste_titre center"><input type="text" class="flat" name="search_num_releve" value="'.dol_escape_htmltag($search_num_releve).
'" size="3"></td>';
1185 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1186 print
'<td class="liste_titre center parentonrightofpage">';
1187 print $form->selectyesno(
'search_conciliated', $search_conciliated, 1,
false, 1, 1,
'search_status onrightofpage maxwidth75');
1191 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1192 print
'<td class="liste_titre center"><input type="text" class="flat" name="search_fk_bordereau" value="'.dol_escape_htmltag($search_fk_bordereau).
'" size="3"></td>';
1195 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1197 print
'<td class="nowraponall center"></td>';
1201 print
'<td class="liste_titre valignmiddle center">';
1204 $searchpicto = $form->showFilterButtons();
1210 $totalarray = array();
1211 $totalarray[
'nbfield'] = 0;
1214 print
'<tr class="liste_titre">';
1217 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1218 $totalarray[
'nbfield']++;
1220 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1221 print_liste_field_titre($arrayfields[
'b.rowid'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rowid',
'', $param,
'', $sortfield, $sortorder);
1222 $totalarray[
'nbfield']++;
1224 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1225 print_liste_field_titre($arrayfields[
'b.label'][
'label'], $_SERVER[
'PHP_SELF'],
'b.label',
'', $param,
'', $sortfield, $sortorder);
1226 $totalarray[
'nbfield']++;
1228 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1229 print_liste_field_titre($arrayfields[
'b.dateo'][
'label'], $_SERVER[
'PHP_SELF'],
'b.dateo',
'', $param,
'', $sortfield, $sortorder,
"center ");
1230 $totalarray[
'nbfield']++;
1232 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1233 print_liste_field_titre($arrayfields[
'b.datev'][
'label'], $_SERVER[
'PHP_SELF'],
'b.datev,b.dateo,b.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1234 $totalarray[
'nbfield']++;
1236 if (!empty($arrayfields[
'type'][
'checked'])) {
1237 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
1238 $totalarray[
'nbfield']++;
1240 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1241 print_liste_field_titre($arrayfields[
'b.num_chq'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_chq',
'', $param,
'', $sortfield, $sortorder,
"center ");
1242 $totalarray[
'nbfield']++;
1244 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1245 print_liste_field_titre($arrayfields[
'bu.label'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1246 $totalarray[
'nbfield']++;
1248 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1249 print_liste_field_titre($arrayfields[
'ba.ref'][
'label'], $_SERVER[
'PHP_SELF'],
'ba.ref',
'', $param,
'', $sortfield, $sortorder);
1250 $totalarray[
'nbfield']++;
1252 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1253 print_liste_field_titre($arrayfields[
'b.debit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1254 $totalarray[
'nbfield']++;
1256 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1257 print_liste_field_titre($arrayfields[
'b.credit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1258 $totalarray[
'nbfield']++;
1260 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1261 print_liste_field_titre($arrayfields[
'balancebefore'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1262 $totalarray[
'nbfield']++;
1264 if (!empty($arrayfields[
'balance'][
'checked'])) {
1265 print_liste_field_titre($arrayfields[
'balance'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1266 $totalarray[
'nbfield']++;
1268 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1269 print_liste_field_titre($arrayfields[
'b.num_releve'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_releve',
'', $param,
'', $sortfield, $sortorder,
"center ");
1270 $totalarray[
'nbfield']++;
1272 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1273 print_liste_field_titre($arrayfields[
'b.conciliated'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rappro',
'', $param,
'', $sortfield, $sortorder,
"center ");
1274 $totalarray[
'nbfield']++;
1276 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1277 print_liste_field_titre($arrayfields[
'b.fk_bordereau'][
'label'], $_SERVER[
'PHP_SELF'],
'b.fk_bordereau',
'', $param,
'', $sortfield, $sortorder,
"center ");
1278 $totalarray[
'nbfield']++;
1282 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1284 $parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1285 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1286 print $hookmanager->resPrint;
1288 print
'<td class="nowraponall center"></td>';
1289 $totalarray[
'nbfield']++;
1293 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1294 $totalarray[
'nbfield']++;
1300 $balancecalculated =
false;
1301 $posconciliatecol = 0;
1302 $cachebankaccount = array();
1308 $savnbfield = $totalarray[
'nbfield'];
1309 $totalarray = array();
1310 $totalarray[
'nbfield'] = 0;
1311 $totalarray[
'totaldeb'] = 0;
1312 $totalarray[
'totalcred'] = 0;
1314 $imaxinloop = ($limit ? min($num, $limit) : $num);
1315 while ($i < $imaxinloop) {
1316 $objp = $db->fetch_object($resql);
1317 $links = $bankaccountstatic->get_url($objp->rowid);
1320 if (!$balancecalculated && (!empty($arrayfields[
'balancebefore'][
'checked']) || !empty($arrayfields[
'balance'][
'checked'])) && ($mode_balance_ok || $search_conciliated ===
'0')) {
1321 if (!$search_account) {
1322 dol_print_error(
null,
'account is not defined but $mode_balance_ok is true');
1329 $sqlforbalance =
'SELECT SUM(b.amount) as previoustotal';
1330 $sqlforbalance .=
" FROM ";
1331 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
1332 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank as b";
1333 $sqlforbalance .=
" WHERE b.fk_account = ba.rowid";
1334 $sqlforbalance .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
1335 $sqlforbalance .=
" AND b.fk_account = ".((int) $search_account);
1337 $sqlforbalance .=
" AND (b.datev < '".$db->idate($db->jdate($objp->dv)).
"' OR (b.datev = '".$db->idate($db->jdate($objp->dv)).
"' AND (b.dateo < '".$db->idate($db->jdate($objp->do)).
"' OR (b.dateo = '".$db->idate($db->jdate($objp->do)).
"' AND b.rowid < ".$objp->rowid.
"))))";
1338 $resqlforbalance = $db->query($sqlforbalance);
1341 if ($resqlforbalance) {
1342 $objforbalance = $db->fetch_object($resqlforbalance);
1343 if ($objforbalance) {
1345 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1346 $balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount);
1349 $balance = $objforbalance->previoustotal;
1356 $balancecalculated =
true;
1359 if ($user->hasRight(
'banque',
'consolidate') && $action ==
'reconcile') {
1360 $tmpnbfieldbeforebalance = 0;
1361 $tmpnbfieldafterbalance = 0;
1362 $balancefieldfound = 0;
1363 foreach ($arrayfields as $key => $val) {
1364 if ($key ==
'balancebefore' || $key ==
'balance') {
1365 $balancefieldfound++;
1368 if (!empty($arrayfields[$key][
'checked'])) {
1369 if (!$balancefieldfound) {
1370 $tmpnbfieldbeforebalance++;
1372 $tmpnbfieldafterbalance++;
1377 $element = $extrafieldsobjectkey;
1378 if (!empty($extrafields->attributes[$element][
'label']) && is_array($extrafields->attributes[$element][
'label']) && count($extrafields->attributes[$element][
'label'])) {
1379 foreach ($extrafields->attributes[$element][
'label'] as $key => $val) {
1380 if (!empty($arrayfields[
"ef.".$key][
'checked'])) {
1381 if (!empty($arrayfields[$key][
'checked'])) {
1382 if (!$balancefieldfound) {
1383 $tmpnbfieldbeforebalance++;
1385 $tmpnbfieldafterbalance++;
1392 print
'<tr class="oddeven trforbreak">';
1397 if ($tmpnbfieldbeforebalance) {
1398 print
'<td colspan="'.$tmpnbfieldbeforebalance.
'">';
1403 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1404 print
'<td class="right">';
1405 if ($search_conciliated !==
'0') {
1406 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1414 if (!empty($arrayfields[
'balance'][
'checked'])) {
1415 print
'<td class="right">';
1416 if ($search_conciliated !==
'0') {
1417 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1425 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1430 print
'<td colspan="'.($tmpnbfieldafterbalance).
'">';
1443 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1444 $balance =
price2num($balancebefore,
'MT');
1445 $balancebefore =
price2num($balancebefore - ($sign * $objp->amount),
'MT');
1447 $balancebefore =
price2num($balance,
'MT');
1448 $balance =
price2num($balance + ($sign * $objp->amount),
'MT');
1451 if (empty($cachebankaccount[$objp->bankid])) {
1452 $bankaccounttmp =
new Account($db);
1453 $bankaccounttmp->fetch($objp->bankid);
1454 $cachebankaccount[$objp->bankid] = $bankaccounttmp;
1455 $bankaccount = $bankaccounttmp;
1457 $bankaccount = $cachebankaccount[$objp->bankid];
1461 $backgroundcolor =
"class='oddeven'";
1463 if ($objp->amount < 0) {
1465 $backgroundcolor =
'style="background: '.$color.
';"';
1468 $backgroundcolor =
'style="background: '.$color.
';"';
1472 $banklinestatic->id = $objp->rowid;
1473 $banklinestatic->ref = $objp->rowid;
1475 print
'<tr class="oddeven" '.$backgroundcolor.
'>';
1479 print
'<td class="center">';
1480 if (!$objp->conciliated && $action ==
'reconcile') {
1481 print
'<input class="flat checkforselect" name="rowid['.$objp->rowid.
']" type="checkbox" name="toselect[]" value="'.$objp->rowid.
'" size="1"'.(!empty($tmparray[$objp->rowid]) ?
' checked' :
'').
'>';
1485 $totalarray[
'nbfield']++;
1490 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1491 print
'<td class="nowrap left">';
1492 print $banklinestatic->getNomUrl(1);
1495 $totalarray[
'nbfield']++;
1500 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1504 preg_match(
'/\((.+)\)/i', $objp->label, $reg);
1505 if (!empty($reg[1]) && $langs->trans($reg[1]) != $reg[1]) {
1507 $labeltoshow = $langs->trans($reg[1]);
1509 if ($objp->label ==
'(payment_salary)') {
1510 $labeltoshow = $langs->trans(
"SalaryPayment");
1513 $titletoshow = $objp->label;
1518 print
'<td class="tdoverflowmax250"'.($titletoshow ?
' title="'.dol_escape_htmltag($titletoshow).
'"' :
'').
'>';
1521 $cachebankaccount = array();
1522 foreach ($links as $key => $val) {
1523 print
'<!-- '.$links[$key][
'type'].
' -->';
1524 if ($links[$key][
'type'] ==
'withdraw') {
1525 $banktransferstatic->id = $links[$key][
'url_id'];
1526 $banktransferstatic->ref = $links[$key][
'label'];
1527 print $banktransferstatic->getNomUrl(0).($labeltoshow ?
' ' :
'');
1528 } elseif ($links[$key][
'type'] ==
'payment') {
1529 $paymentstatic->id = $links[$key][
'url_id'];
1530 $paymentstatic->ref = $links[$key][
'url_id'];
1531 $paymentstatic->date = $db->jdate($objp->do);
1532 print $paymentstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1533 } elseif ($links[$key][
'type'] ==
'payment_supplier') {
1534 $paymentsupplierstatic->id = $links[$key][
'url_id'];
1535 $paymentsupplierstatic->ref = $links[$key][
'url_id'];
1536 print $paymentsupplierstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1537 } elseif ($links[$key][
'type'] ==
'payment_sc') {
1538 $paymentscstatic->id = $links[$key][
'url_id'];
1539 $paymentscstatic->ref = $links[$key][
'url_id'];
1540 $paymentscstatic->label = $links[$key][
'label'];
1541 print $paymentscstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1542 } elseif ($links[$key][
'type'] ==
'payment_vat') {
1543 $paymentvatstatic->id = $links[$key][
'url_id'];
1544 $paymentvatstatic->ref = $links[$key][
'url_id'];
1545 print $paymentvatstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1546 } elseif ($links[$key][
'type'] ==
'payment_salary') {
1547 $paymentsalstatic->id = $links[$key][
'url_id'];
1548 $paymentsalstatic->ref = $links[$key][
'url_id'];
1549 $paymentsalstatic->label = $links[$key][
'label'];
1550 print $paymentsalstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1551 } elseif ($links[$key][
'type'] ==
'payment_loan') {
1552 print
'<a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$links[$key][
'url_id'].
'">';
1553 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
1554 print
'</a>'.($labeltoshow ?
' ' :
'');
1555 } elseif ($links[$key][
'type'] ==
'payment_donation') {
1556 $paymentdonationstatic->id = $links[$key][
'url_id'];
1557 $paymentdonationstatic->ref = $links[$key][
'url_id'];
1558 print $paymentdonationstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1559 } elseif ($links[$key][
'type'] ==
'payment_expensereport') {
1560 $paymentexpensereportstatic->id = $links[$key][
'url_id'];
1561 $paymentexpensereportstatic->ref = $links[$key][
'url_id'];
1562 print $paymentexpensereportstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1563 } elseif ($links[$key][
'type'] ==
'payment_various') {
1564 $paymentvariousstatic->id = $links[$key][
'url_id'];
1565 $paymentvariousstatic->ref = $links[$key][
'url_id'];
1566 print $paymentvariousstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1567 } elseif ($links[$key][
'type'] ==
'banktransfert') {
1569 if ($objp->amount > 0) {
1570 $banklinestatic->fetch($links[$key][
'url_id']);
1571 $bankstatic->id = $banklinestatic->fk_account;
1572 $bankstatic->label = $banklinestatic->bank_account_ref;
1573 print $langs->trans(
"TransferFrom").
' ';
1574 print $bankstatic->getNomUrl(1,
'transactions');
1575 print
' '.$langs->trans(
"toward").
' ';
1576 $bankstatic->id = $objp->bankid;
1577 $bankstatic->label = $objp->bankref;
1578 print $bankstatic->getNomUrl(1,
'');
1579 print($labeltoshow ?
' - ' :
'');
1581 $bankstatic->id = $objp->bankid;
1582 $bankstatic->label = $objp->bankref;
1583 print $langs->trans(
"TransferFrom").
' ';
1584 print $bankstatic->getNomUrl(1,
'');
1585 print
' '.$langs->trans(
"toward").
' ';
1586 $banklinestatic->fetch($links[$key][
'url_id']);
1587 $bankstatic->id = $banklinestatic->fk_account;
1588 $bankstatic->label = $banklinestatic->bank_account_ref;
1589 print $bankstatic->getNomUrl(1,
'transactions');
1590 print($labeltoshow ?
' - ' :
'');
1593 } elseif ($links[$key][
'type'] ==
'company') {
1594 } elseif ($links[$key][
'type'] ==
'user') {
1595 } elseif ($links[$key][
'type'] ==
'member') {
1596 } elseif ($links[$key][
'type'] ==
'sc') {
1597 } elseif ($links[$key][
'type'] ==
'vat') {
1598 } elseif ($links[$key][
'type'] ==
'salary') {
1602 print
'<a href="'.$links[$key][
'url'].$links[$key][
'url_id'].
'">';
1603 if (preg_match(
'/^\((.*)\)$/i', $links[$key][
'label'], $reg)) {
1605 if ($reg[1] ==
'paiement') {
1606 $reg[1] =
'Payment';
1608 print $langs->trans($reg[1]);
1610 print $links[$key][
'label'];
1612 print
'</a>'.($labeltoshow ?
' - ' :
'');
1620 $totalarray[
'nbfield']++;
1625 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1626 print
'<td class="nowrap center">';
1627 print
'<span class="spanforajaxedit" id="dateoperation_'.$objp->rowid.
'">'.
dol_print_date($db->jdate($objp->do),
"day").
"</span>";
1629 print
'<span class="inline-block">';
1630 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=doprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1632 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=donext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1637 $totalarray[
'nbfield']++;
1642 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1643 print
'<td class="nowrap center">';
1644 print
'<span class="spanforajaxedit" id="datevalue_'.$objp->rowid.
'">'.
dol_print_date($db->jdate($objp->dv),
"day").
"</span>";
1646 print
'<span class="inline-block">';
1647 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1649 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvnext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1654 $totalarray[
'nbfield']++;
1659 if (!empty($arrayfields[
'type'][
'checked'])) {
1660 print
'<td class="tdoverflowmax100">';
1661 $labeltype = ($langs->trans(
"PaymentTypeShort".$objp->fk_type) !=
"PaymentTypeShort".$objp->fk_type) ? $langs->trans(
"PaymentTypeShort".$objp->fk_type) : $langs->getLabelFromKey($db, $objp->fk_type,
'c_paiement',
'code',
'libelle',
'', 1);
1662 if ($labeltype ==
'SOLD') {
1669 $totalarray[
'nbfield']++;
1674 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1675 print
'<td class="nowrap center">'.($objp->num_chq ?
dol_escape_htmltag($objp->num_chq) :
"").
"</td>\n";
1677 $totalarray[
'nbfield']++;
1682 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1683 print
'<td class="tdoverflowmax150">';
1685 $companylinked_id = 0;
1690 foreach ($links as $key => $value) {
1691 if ($links[$key][
'type'] ==
'payment_sc') {
1692 $type_link =
'payment_sc';
1694 if ($links[$key][
'type'] ==
'payment_salary') {
1695 $type_link =
'payment_salary';
1697 if ($links[$key][
'type'] ==
'payment_expensereport') {
1698 $type_link =
'payment_expensereport';
1701 if ($links[$key][
'type'] ==
'company') {
1702 $companylinked_id = $links[$key][
'url_id'];
1704 if ($links[$key][
'type'] ==
'user') {
1705 $userlinked_id = $links[$key][
'url_id'];
1709 if ($companylinked_id) {
1711 $companystatic->fetch($companylinked_id);
1712 print $companystatic->getNomUrl(1);
1713 } elseif ($userlinked_id &&
1714 (($type_link ==
'payment_salary' && $user->hasRight(
'salaries',
'read'))
1715 || ($type_link ==
'payment_sc' && $user->hasRight(
'tax',
'charges',
'lire'))
1716 || ($type_link ==
'payment_expensereport' && $user->hasRight(
'expensereport',
'lire')))) {
1718 if (!empty($conf->cache[
'user'][$userlinked_id])) {
1719 $tmpuser = $conf->cache[
'user'][$userlinked_id];
1721 $tmpuser =
new User($db);
1722 $tmpuser->fetch($userlinked_id);
1723 $conf->cache[
'user'][$userlinked_id] = $tmpuser;
1725 print $tmpuser->getNomUrl(-1);
1732 $totalarray[
'nbfield']++;
1737 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1738 print
'<td class="nowrap">';
1739 print $bankaccount->getNomUrl(1);
1742 $totalarray[
'nbfield']++;
1747 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1748 print
'<td class="nowrap right"><span class="amount">';
1749 if ($objp->amount < 0) {
1750 print
price($objp->amount * -1);
1751 $totalarray[
'totaldeb'] += $objp->amount;
1753 print
"</span></td>\n";
1755 $totalarray[
'nbfield']++;
1758 $totalarray[
'totaldebfield'] = $totalarray[
'nbfield'];
1763 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1764 print
'<td class="nowrap right"><span class="amount">';
1765 if ($objp->amount > 0) {
1766 print
price($objp->amount);
1767 $totalarray[
'totalcred'] += $objp->amount;
1769 print
"</span></td>\n";
1771 $totalarray[
'nbfield']++;
1774 $totalarray[
'totalcredfield'] = $totalarray[
'nbfield'];
1779 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1780 if ($mode_balance_ok) {
1781 if ($balancebefore >= 0) {
1782 print
'<td class="nowrap right"> '.price($balancebefore).
'</td>';
1784 print
'<td class="error nowrap right"> '.price($balancebefore).
'</td>';
1787 print
'<td class="right">-</td>';
1790 $totalarray[
'nbfield']++;
1795 if (!empty($arrayfields[
'balance'][
'checked'])) {
1796 if ($mode_balance_ok) {
1797 if ($balance >= 0) {
1798 print
'<td class="nowrap right"> '.price($balance).
'</td>';
1800 print
'<td class="error nowrap right"> '.price($balance).
'</td>';
1803 print
'<td class="right">-</td>';
1806 $totalarray[
'nbfield']++;
1810 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1811 print
'<td class="nowraponall center">';
1813 if ($bankaccount->canBeConciliated() > 0) {
1814 if ($objp->num_releve) {
1815 print
'<a href="releve.php?num='.urlencode($objp->num_releve).
'&account='.urlencode($objp->bankid).
'&save_lastsearch_values=1">'.
dol_escape_htmltag($objp->num_releve).
'</a>';
1820 $totalarray[
'nbfield']++;
1821 $posconciliatecol = $totalarray[
'nbfield'];
1825 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1826 print
'<td class="nowraponall center">';
1827 print
yn($objp->conciliated);
1830 $totalarray[
'nbfield']++;
1834 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1835 $bordereaustatic->fetch($objp->fk_bordereau);
1836 print
'<td class="nowraponall center">';
1837 print $bordereaustatic->getNomUrl();
1840 $totalarray[
'nbfield']++;
1846 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1848 $parameters = array(
'arrayfields' => $arrayfields,
'object'=>$object,
'obj' => $objp,
'i' => $i,
'totalarray' => &$totalarray);
1849 $reshook=$hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1850 print $hookmanager->resPrint;
1853 print
'<td class="nowraponall center">';
1855 if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) {
1856 print
'<a class="editfielda" href="'.DOL_URL_ROOT.
'/compta/bank/line.php?save_lastsearch_values=1&rowid='.$objp->rowid.($object->id > 0 ?
'&account='.$object->id :
'').
'&page='.$page.
'">';
1860 if ($user->hasRight(
'banque',
'modifier') || $user->hasRight(
'banque',
'consolidate')) {
1861 print
'<a class="editfielda" href="'.DOL_URL_ROOT.
'/compta/bank/line.php?save_lastsearch_values=1&rowid='.$objp->rowid.($object->id > 0 ?
'&account='.$object->id :
'').
'&page='.$page.
'">';
1865 print
'<a class="editfielda" href="'.DOL_URL_ROOT.
'/compta/bank/line.php?save_lastsearch_values=1&rowid='.$objp->rowid.($object->id > 0 ?
'&account='.$object->id :
'').
'&page='.$page.
'">';
1869 if ($bankaccount->canBeConciliated() > 0 && empty($objp->conciliated)) {
1870 if ($db->jdate($objp->dv) < ($now - $conf->bank->rappro->warning_delay)) {
1871 print
' '.img_warning($langs->trans(
"ReconciliationLate"));
1874 if ($user->hasRight(
'banque',
'modifier')) {
1875 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&rowid='.$objp->rowid.
'&page='.$page.$param.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
'').
'">';
1876 print
img_delete(
'',
'class="marginleftonly"');
1882 $totalarray[
'nbfield']++;
1887 print
'<td class="center">';
1888 if (!$objp->conciliated && $action ==
'reconcile') {
1889 print
'<input class="flat checkforselect" name="rowid['.$objp->rowid.
']" type="checkbox" value="'.$objp->rowid.
'" size="1"'.(!empty($tmparray[$objp->rowid]) ?
' checked' :
'').
'>';
1893 $totalarray[
'nbfield']++;
1903 if (isset($totalarray[
'totaldebfield']) || isset($totalarray[
'totalcredfield'])) {
1904 print
'<tr class="liste_total">';
1906 while ($i < $totalarray[
'nbfield']) {
1909 if ($num < $limit && empty($offset)) {
1910 print
'<td class="left">'.$langs->trans(
"Total").
'</td>';
1912 print
'<td class="left tdoverflowmax50" title="'.$langs->trans(
"Totalforthispage").
'">'.$langs->trans(
"Totalforthispage").
'</td>';
1914 } elseif ($totalarray[
'totaldebfield'] == $i) {
1915 print
'<td class="right"><span class="amount">'.price(-1 * $totalarray[
'totaldeb']).
'</span></td>';
1916 } elseif ($totalarray[
'totalcredfield'] == $i) {
1917 print
'<td class="right"><span class="amount">'.price($totalarray[
'totalcred']).
'</span></td>';
1918 } elseif ($i == $posconciliatecol) {
1919 print
'<td class="center">';
1934 foreach ($arrayfields as $key => $val) {
1935 if (!empty($val[
'checked'])) {
1939 print
'<tr><td colspan="'.($colspan + 1).
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
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.
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 to manage bank categories.
Class to manage withdrawal receipts.
Class for managing the social charges.
Class to manage donations.
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 expense report.
Class to manage payments of salaries.
Class to manage payments of social contributions.
Class to manage payments of social contributions.
Class to manage various payments.
Class to manage cheque delivery receipts.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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 '.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
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.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
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_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_view($titlealt='default', $float=0, $other='class="valignmiddle"')
Show logo view card.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dol_substr($string, $start, $length=null, $stringencoding='', $trunconbytes=0)
Make a substring.
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 +.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
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.