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 =
'banktransactionlist';
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');
83$search_dt_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_start_dtmonth',
'int'),
GETPOST(
'search_start_dtday',
'int'),
GETPOST(
'search_start_dtyear',
'int'));
85$search_dv_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_start_dvmonth',
'int'),
GETPOST(
'search_start_dvday',
'int'),
GETPOST(
'search_start_dvyear',
'int'));
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");
99$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
100$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
101$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
102$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
103$pageplusone =
GETPOST(
"pageplusone",
'int');
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);
123 $search_account = $object->id;
125 if (!($object->id > 0)) {
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));
149$extrafields->fetch_name_optionals_label(
'banktransaction');
150$search_array_options = $extrafields->getOptionalsFromPost(
'banktransaction',
'',
'search_');
153 'b.rowid'=>array(
'label'=>$langs->trans(
"Ref"),
'checked'=>1,
'position'=>10),
154 'b.label'=>array(
'label'=>$langs->trans(
"Description"),
'checked'=>1,
'position'=>20),
155 'b.dateo'=>array(
'label'=>$langs->trans(
"DateOperationShort"),
'checked'=>1,
'position'=>30),
156 'b.datev'=>array(
'label'=>$langs->trans(
"DateValueShort"),
'checked'=>1,
'position'=>40),
157 'type'=>array(
'label'=>$langs->trans(
"Type"),
'checked'=>1,
'position'=>50),
158 'b.num_chq'=>array(
'label'=>$langs->trans(
"Numero"),
'checked'=>1,
'position'=>60),
159 'bu.label'=>array(
'label'=>$langs->trans(
"ThirdParty").
'/'.$langs->trans(
"User"),
'checked'=>1,
'position'=>70),
160 'ba.ref'=>array(
'label'=>$langs->trans(
"BankAccount"),
'checked'=>(($id > 0 || !empty($ref)) ? 0 : 1),
'position'=>80),
161 'b.debit'=>array(
'label'=>$langs->trans(
"Debit"),
'checked'=>1,
'position'=>90),
162 'b.credit'=>array(
'label'=>$langs->trans(
"Credit"),
'checked'=>1,
'position'=>100),
163 'balancebefore'=>array(
'label'=>$langs->trans(
"BalanceBefore"),
'checked'=>0,
'position'=>110),
164 'balance'=>array(
'label'=>$langs->trans(
"Balance"),
'checked'=>1,
'position'=>120),
165 'b.num_releve'=>array(
'label'=>$langs->trans(
"AccountStatement"),
'checked'=>1,
'position'=>130),
166 'b.conciliated'=>array(
'label'=>$langs->trans(
"BankLineReconciled"),
'enabled'=> $object->rappro,
'checked'=>($action ==
'reconcile' ? 1 : 0),
'position'=>140),
167 'b.fk_bordereau'=>array(
'label'=>$langs->trans(
"ChequeNumber"),
'checked'=>0,
'position'=>150),
170include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
176$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref :
''));
177$fieldtype = (!empty($ref) ?
'ref' :
'rowid');
180 $socid = $user->socid;
182 $result =
restrictedArea($user,
'banque', $fieldvalue,
'bank_account&bank_account',
'',
'', $fieldtype);
185 $socid = $user->socid;
195if (
GETPOST(
'cancel',
'alpha')) {
199if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
203$parameters = array();
204$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
209include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
211if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
212 $search_dt_start =
'';
214 $search_dv_start =
'';
222 $search_description =
'';
223 $search_thirdparty_user =
'';
224 $search_num_releve =
'';
225 $search_conciliated =
'';
226 $search_fk_bordereau =
'';
229 $search_account =
"";
230 if ($id > 0 || !empty($ref)) {
231 $search_account = $object->id;
235if (empty($reshook)) {
236 $objectclass =
'Account';
237 $objectlabel =
'BankTransaction';
238 $permissiontoread = !empty($user->rights->banque->lire);
239 $permissiontodelete = $user->hasRight(
'banque',
'modifier');
240 $uploaddir = $conf->bank->dir_output;
241 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
244$rowids =
GETPOST(
'rowid',
'array');
247if ((
GETPOST(
'confirm_savestatement',
'alpha') ||
GETPOST(
'confirm_reconcile',
'alpha'))
248 && (
GETPOST(
"num_releve",
"alpha") || !empty($rowids))
249 && !empty($user->rights->banque->consolidate)
250 && (!GETPOSTISSET(
'pageplusone') || (
GETPOST(
'pageplusone') ==
GETPOST(
'pageplusoneold')))) {
254 $num_releve =
GETPOST(
"num_releve",
"alpha");
259 $rowids =
GETPOST(
'rowid',
'array');
261 if (!empty($rowids) && is_array($rowids)) {
262 foreach ($rowids as $row) {
264 $result = $bankline->fetch($row);
265 $bankline->num_releve = $num_releve;
266 $result = $bankline->update_conciliation($user,
GETPOST(
"cat"),
GETPOST(
'confirm_reconcile',
'alpha') ? 1 : 0);
274 if (!$error && count($rowids) > 0) {
275 setEventMessages($langs->trans(
"XNewLinesConciliated", count($rowids)),
null);
279 $langs->load(
"errors");
284 $langs->load(
"errors");
285 setEventMessages($langs->trans(
"ErrorPleaseTypeBankTransactionReportName"),
null,
'errors');
289 $param =
'action=reconcile&contextpage=banktransactionlist&id='.((int) $object->id).
'&search_account='.((int) $object->id);
291 $param .=
'&page='.urlencode($page);
294 $param .=
'&offset='.urlencode($offset);
297 $param .=
'&limit='.((int) $limit);
299 if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
300 $param .=
'&search_conciliated='.urlencode($search_conciliated);
302 if ($search_thirdparty_user) {
303 $param .=
'&search_thirdparty='.urlencode($search_thirdparty_user);
305 if ($search_num_releve) {
306 $param .=
'&search_num_releve='.urlencode($search_num_releve);
308 if ($search_description) {
309 $param .=
'&search_description='.urlencode($search_description);
312 $param .=
'&search_start_dtmonth='.GETPOST(
'search_start_dtmonth',
'int').
'&search_start_dtday='.
GETPOST(
'search_start_dtday',
'int').
'&search_start_dtyear='.
GETPOST(
'search_start_dtyear',
'int');
315 $param .=
'&search_end_dtmonth='.GETPOST(
'search_end_dtmonth',
'int').
'&search_end_dtday='.
GETPOST(
'search_end_dtday',
'int').
'&search_end_dtyear='.
GETPOST(
'search_end_dtyear',
'int');
318 $param .=
'&search_start_dvmonth='.GETPOST(
'search_start_dvmonth',
'int').
'&search_start_dvday='.
GETPOST(
'search_start_dvday',
'int').
'&search_start_dvyear='.
GETPOST(
'search_start_dvyear',
'int');
321 $param .=
'&search_end_dvmonth='.GETPOST(
'search_end_dvmonth',
'int').
'&search_end_dvday='.
GETPOST(
'search_end_dvday',
'int').
'&search_end_dvyear='.
GETPOST(
'search_end_dvyear',
'int');
324 $param .=
'&search_type='.urlencode($search_type);
327 $param .=
'&search_debit='.urlencode($search_debit);
329 if ($search_credit) {
330 $param .=
'&search_credit='.urlencode($search_credit);
332 $param .=
'&sortfield='.urlencode($sortfield).
'&sortorder='.urlencode($sortorder);
333 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?'.$param);
339if (
GETPOST(
'save') && !$cancel && $user->hasRight(
'banque',
'modifier')) {
348 $operation =
GETPOST(
"operation",
'alpha');
349 $num_chq =
GETPOST(
"num_chq",
'alpha');
350 $label =
GETPOST(
"label",
'alpha');
351 $cat1 =
GETPOST(
"cat1",
'alpha');
353 $bankaccountid = $id;
354 if (
GETPOST(
'add_account',
'int') > 0) {
355 $bankaccountid =
GETPOST(
'add_account',
'int');
359 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Date")),
null,
'errors');
363 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
367 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Label")),
null,
'errors');
371 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Amount")),
null,
'errors');
373 if (!($bankaccountid > 0)) {
375 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"BankAccount")),
null,
'errors');
383 if (!$error && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
385 $objecttmp->fetch($bankaccountid);
386 $insertid = $objecttmp->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user,
'',
'', $search_accountancy_code);
389 header(
"Location: ".$_SERVER[
'PHP_SELF'].($id ?
"?id=".$id :
''));
399if ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->hasRight(
'banque',
'modifier')) {
401 $result = $accline->fetch(
GETPOST(
"rowid",
"int"));
402 $result = $accline->delete($user);
414$form =
new Form($db);
418$companystatic =
new Societe($db);
419$bankaccountstatic =
new Account($db);
420$userstatic=
new User($db);
423$societestatic =
new Societe($db);
424$userstatic =
new User($db);
426$loanstatic =
new Loan($db);
428$donstatic =
new Don($db);
445if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
446 $param .=
'&contextpage='.urlencode($contextpage);
448if ($limit > 0 && $limit != $conf->liste_limit) {
449 $param .=
'&limit='.((int) $limit);
452 $param .=
'&id='.urlencode($id);
455 $param .=
'&ref='.urlencode($ref);
457if (!empty($search_ref)) {
458 $param .=
'&search_ref='.urlencode($search_ref);
460if (!empty($search_description)) {
461 $param .=
'&search_description='.urlencode($search_description);
463if (!empty($search_type)) {
464 $param .=
'&type='.urlencode($search_type);
466if (!empty($search_thirdparty_user)) {
467 $param .=
'&search_thirdparty='.urlencode($search_thirdparty_user);
469if (!empty($search_debit)) {
470 $param .=
'&search_debit='.urlencode($search_debit);
472if (!empty($search_credit)) {
473 $param .=
'&search_credit='.urlencode($search_credit);
475if ($search_account > 0) {
476 $param .=
'&search_account='.urlencode($search_account);
478if (!empty($search_num_releve)) {
479 $param .=
'&search_num_releve='.urlencode($search_num_releve);
481if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
482 $param .=
'&search_conciliated='.urlencode($search_conciliated);
484if ($search_fk_bordereau > 0) {
485 $param .=
'$&search_fk_bordereau='.urlencode($search_fk_bordereau);
487if ($search_bid > 0) {
488 $param .=
'&search_bid='.urlencode($search_bid);
491 $param .=
'&search_start_dtmonth='.GETPOST(
'search_start_dtmonth',
'int').
'&search_start_dtday='.
GETPOST(
'search_start_dtday',
'int').
'&search_start_dtyear='.
GETPOST(
'search_start_dtyear',
'int');
494 $param .=
'&search_end_dtmonth='.GETPOST(
'search_end_dtmonth',
'int').
'&search_end_dtday='.
GETPOST(
'search_end_dtday',
'int').
'&search_end_dtyear='.
GETPOST(
'search_end_dtyear',
'int');
497 $param .=
'&search_start_dvmonth='.GETPOST(
'search_start_dvmonth',
'int').
'&search_start_dvday='.
GETPOST(
'search_start_dvday',
'int').
'&search_start_dvyear='.
GETPOST(
'search_start_dvyear',
'int');
500 $param .=
'&search_end_dvmonth='.GETPOST(
'search_end_dvmonth',
'int').
'&search_end_dvday='.
GETPOST(
'search_end_dvday',
'int').
'&search_end_dvyear='.
GETPOST(
'search_end_dvyear',
'int');
503 $param .=
'&req_nb='.urlencode($search_req_nb);
505if (
GETPOST(
"search_thirdparty",
'int')) {
506 $param .=
'&thirdparty='.urlencode(
GETPOST(
"search_thirdparty",
'int'));
508if ($optioncss !=
'') {
509 $param .=
'&optioncss='.urlencode($optioncss);
511if ($action ==
'reconcile') {
512 $param .=
'&action=reconcile';
520include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
524$buttonreconcile =
'';
527if ($id > 0 || !empty($ref)) {
528 $title = $object->ref.
' - '.$langs->trans(
"Transactions");
530 $title = $langs->trans(
"BankTransactions");
534llxHeader(
'', $title, $help_url,
'', 0, 0, array(), array(), $param);
537if ($id > 0 || !empty($ref)) {
539 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
542 foreach ($bankcateg->fetchAll() as $bankcategory) {
543 $options[$bankcategory->id] = $bankcategory->label;
548 print
dol_get_fiche_head($head,
'journal', $langs->trans(
"FinancialAccount"), 0,
'account');
550 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
552 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
561 if ($action !=
'reconcile') {
562 if ($object->canBeConciliated() > 0) {
563 $allowautomaticconciliation =
false;
564 $titletoconciliatemanual = $langs->trans(
"Conciliate");
565 $titletoconciliateauto = $langs->trans(
"Conciliate");
566 if ($allowautomaticconciliation) {
567 $titletoconciliatemanual .=
' ('.$langs->trans(
"Manual").
')';
568 $titletoconciliateauto .=
' ('.$langs->trans(
"Auto").
')';
572 if ($user->rights->banque->consolidate) {
574 $newparam = preg_replace(
'/search_conciliated=\d+/i',
'', $newparam);
575 $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>';
577 $buttonreconcile =
'<a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliatemanual.
'</a>';
580 if ($allowautomaticconciliation) {
582 if ($user->rights->banque->consolidate) {
584 $newparam = preg_replace(
'/search_conciliated=\d+/i',
'', $newparam);
585 $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>';
587 $buttonreconcile .=
' <a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliateauto.
'</a>';
594$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,";
595$sql .=
" b.fk_account, b.fk_type, b.fk_bordereau,";
596$sql .=
" ba.rowid as bankid, ba.ref as bankref";
598if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
599 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
600 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
604$parameters = array();
605$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
606$sql .= $hookmanager->resPrint;
608if ($search_bid > 0) {
609 $sql .= MAIN_DB_PREFIX.
"bank_class as l,";
611$sql .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
612$sql .=
" ".MAIN_DB_PREFIX.
"bank as b";
613if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
614 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (b.rowid = ef.fk_object)";
618$parameters = array();
619$reshook = $hookmanager->executeHooks(
'printFieldListJoin', $parameters);
620$sql .= $hookmanager->resPrint;
622$sql .=
" WHERE b.fk_account = ba.rowid";
623$sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
624if ($search_account > 0) {
625 $sql .=
" AND b.fk_account = ".((int) $search_account);
629 $sql .=
" AND b.dateo >= '".$db->idate($search_dt_start).
"'";
632 $sql .=
" AND b.dateo <= '".$db->idate($search_dt_end).
"'";
636 $sql .=
" AND b.datev >= '".$db->idate($search_dv_start).
"'";
639 $sql .=
" AND b.datev <= '".$db->idate($search_dv_end).
"'";
647if ($search_num_releve) {
650if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
651 $sql .=
" AND b.rappro = ".((int) $search_conciliated);
653if ($search_fk_bordereau > 0) {
654 $sql .=
" AND b.fk_bordereau = " . ((int) $search_fk_bordereau);
656if ($search_thirdparty_user) {
657 $sql.=
" AND (b.rowid IN ";
658 $sql.=
" ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url AS bu";
659 $sql.=
" JOIN ".MAIN_DB_PREFIX.
"bank AS b2 ON b2.rowid = bu.fk_bank";
660 $sql.=
" JOIN ".MAIN_DB_PREFIX.
"user AS subUser ON (bu.type = 'user' AND bu.url_id = subUser.rowid)";
661 $sql.=
" WHERE ".
natural_search(array(
"subUser.firstname",
"subUser.lastname"), $search_thirdparty_user,
'', 1).
")";
663 $sql.=
" OR b.rowid IN ";
664 $sql.=
" ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url AS bu";
665 $sql.=
" JOIN ".MAIN_DB_PREFIX.
"bank AS b2 ON b2.rowid = bu.fk_bank";
666 $sql.=
" JOIN ".MAIN_DB_PREFIX.
"societe AS subSoc ON (bu.type = 'company' AND bu.url_id = subSoc.rowid)";
667 $sql.=
" WHERE ".
natural_search(array(
"subSoc.nom"), $search_thirdparty_user,
'', 1);
670if ($search_description) {
671 $search_description_to_use = $search_description;
672 $arrayoffixedlabels = array(
674 'CustomerInvoicePayment',
'CustomerInvoicePaymentBack',
675 'SupplierInvoicePayment',
'SupplierInvoicePaymentBack',
677 'ExpenseReportPayment',
678 'SocialContributionPayment',
679 'SubscriptionPayment',
682 foreach ($arrayoffixedlabels as $keyforlabel) {
683 $translatedlabel = $langs->transnoentitiesnoconv($keyforlabel);
684 if (preg_match(
'/'.$search_description.
'/i', $translatedlabel)) {
685 $search_description_to_use .=
"|".$keyforlabel;
691if ($search_bid > 0) {
692 $sql .=
" AND b.rowid = l.lineid AND l.fk_categ = ".((int) $search_bid);
694if (!empty($search_type)) {
695 $sql .=
" AND b.fk_type = '".$db->escape($search_type).
"'";
700 $sql .=
' AND b.amount <= 0';
704 $sql .=
' AND b.amount >= 0';
707include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
710$parameters = array();
711$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
712$sql .= $hookmanager->resPrint;
714$sql .= $db->order($sortfield, $sortorder);
716$nbtotalofrecords =
'';
719 $result = $db->query($sql);
720 $nbtotalofrecords = $db->num_rows($result);
721 $nbtotalofpages = ceil($nbtotalofrecords / $limit);
724if (($id > 0 || !empty($ref)) && ((
string) $page ==
'')) {
727 $page = ($nbtotalofpages - 1);
728 $offset = $limit * $page;
733if ($page >= $nbtotalofpages) {
735 $page = ($nbtotalofpages - 1);
736 $offset = $limit * $page;
744if (empty($search_account)) {
745 $mode_balance_ok =
false;
748if (!empty($search_ref)) {
749 $mode_balance_ok =
false;
751if (!empty($search_description)) {
752 $mode_balance_ok =
false;
754if (!empty($search_type)) {
755 $mode_balance_ok =
false;
757if (!empty($search_debit)) {
758 $mode_balance_ok =
false;
760if (!empty($search_credit)) {
761 $mode_balance_ok =
false;
763if (!empty($search_thirdparty_user)) {
764 $mode_balance_ok =
false;
766if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
767 $mode_balance_ok =
false;
769if (!empty($search_num_releve)) {
770 $mode_balance_ok =
false;
772if (!empty($search_fk_bordereau)) {
773 $mode_balance_ok =
false;
776$sql .= $db->plimit($limit + 1, $offset);
778dol_syslog(
'compta/bank/bankentries_list.php', LOG_DEBUG);
779$resql = $db->query($sql);
781 $num = $db->num_rows($resql);
783 $arrayofselected = (!empty($toselect) && is_array($toselect)) ? $toselect : array();
786 $arrayofmassactions = array(
791 if (in_array($massaction, array(
'presend',
'predelete'))) {
792 $arrayofmassactions = array();
794 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
797 if ($action ==
'delete') {
798 $text = $langs->trans(
'ConfirmDeleteTransaction');
799 print $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&rowid='.
GETPOST(
"rowid",
'int'), $langs->trans(
'DeleteTransaction'), $text,
'confirm_delete',
null,
'', 1);
803 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'" name="search_form">'.
"\n";
804 if ($optioncss !=
'') {
805 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
807 print
'<input type="hidden" name="token" value="'.newToken().
'">';
808 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
809 print
'<input type="hidden" name="action" value="'.($action !=
'delete' ? $action :
'search').
'">';
811 print
'<input type="hidden" name="view" value="'.dol_escape_htmltag($view).
'">';
813 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
814 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
815 print
'<input type="hidden" name="page" value="'.$page.
'">';
816 print
'<input type="hidden" name="id" value="'.$id.
'">';
817 print
'<input type="hidden" name="ref" value="'.$ref.
'">';
819 print
'<input type="hidden" name="bid" value="'.GETPOST(
"bid",
'int').
'">';
823 if ($user->rights->banque->consolidate && $action ==
'reconcile') {
824 print
'<div class="valignmiddle inline-block" style="padding-right: 20px;">';
825 $texttoshow = $langs->trans(
"InputReceiptNumber").
': ';
826 $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);
827 $mm =
dol_substr($langs->transnoentitiesnoconv(
"Month"), 0, 1).substr($langs->transnoentitiesnoconv(
"Month"), 0, 1);
828 $dd =
dol_substr($langs->transnoentitiesnoconv(
"Day"), 0, 1).substr($langs->transnoentitiesnoconv(
"Day"), 0, 1);
829 $placeholder = $yyyy.$mm;
830 $placeholder .=
' '.$langs->trans(
"or").
' ';
831 $placeholder .= $yyyy.$mm.$dd;
833 $texttoshow .= $langs->trans(
"InputReceiptNumberBis");
836 print
'<input class="flat width175" pattern="[0-9]+" title="'.dol_escape_htmltag($texttoshow.($placeholder ?
': '.$placeholder :
'')).
'" id="num_releve" name="num_releve" placeholder="'.
dol_escape_htmltag($placeholder).
'" type="text" value="'.(
GETPOST(
'num_releve',
'int') ?
GETPOST(
'num_releve',
'int') :
'').
'">';
838 if (is_array($options) && count($options)) {
839 print $langs->trans(
"EventualyAddCategory").
': ';
842 print
'<br><div style="margin-top: 5px;"><span class="opacitymedium">'.$langs->trans(
"ThenCheckLinesAndConciliate").
'</span> ';
843 print
'<input class="button" name="confirm_savestatement" type="submit" value="'.$langs->trans(
"SaveStatementOnly").
'">';
844 print
' '.$langs->trans(
"or").
' ';
845 print
'<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans(
"Conciliate").
'">';
846 print
' '.$langs->trans(
"or").
' ';
847 print
'<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans(
"Cancel").
'">';
853 $sql =
"SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX.
"bank";
854 $sql .=
" WHERE fk_account = ".((int) $object->id).
" AND num_releve IS NOT NULL";
855 $sql .= $db->order(
"num_releve",
"DESC");
856 $sql .= $db->plimit($nbmax + 1);
858 print $langs->trans(
"LastAccountStatements").
' : ';
859 $resqlr = $db->query($sql);
861 $numr = $db->num_rows($resqlr);
864 while (($i < $numr) && ($i < $nbmax)) {
865 $objr = $db->fetch_object($resqlr);
867 $last_releve = $objr->num_releve;
871 $liste =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/releve.php?account='.$id.
'&num='.$objr->num_releve.
'">'.$objr->num_releve.
'</a> '.$liste;
873 if ($numr >= $nbmax) {
874 $liste =
"... ".$liste;
878 print
'<b>'.$langs->trans(
"None").
'</b>';
885 if (!empty($conf->global->BANK_REPORT_LAST_NUM_RELEVE)) {
887 <script type="text/javascript">
888 $("#num_releve").val("' . $last_releve.
'");
896 if ($user->hasRight(
'banque',
'modifier') && $action ==
'addline' && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
899 print
'<table class="noborder centpercent">';
901 print
'<tr class="liste_titre">';
902 print
'<td>'.$langs->trans(
"Description").
'</td>';
903 print
'<td>'.$langs->trans(
"Date").
'</td>';
904 print
'<td> </td>';
905 print
'<td>'.$langs->trans(
"Type").
'</td>';
906 print
'<td>'.$langs->trans(
"Numero").
'</td>';
907 print
'<td class=right>'.$langs->trans(
"BankAccount").
'</td>';
908 print
'<td class=right>'.$langs->trans(
"Debit").
'</td>';
909 print
'<td class=right>'.$langs->trans(
"Credit").
'</td>';
916 print
'<td align="center"> </td>';
921 print
'<input name="label" class="flat minwidth200" type="text" value="'.GETPOST(
"label",
"alpha").
'">';
922 if (is_array($options) && count($options)) {
923 print
'<br>'.$langs->trans(
"Rubrique").
': ';
927 print
'<td class="nowrap">';
928 print $form->selectDate(empty($dateop) ?-1 : $dateop,
'op', 0, 0, 0,
'transaction');
930 print
'<td> </td>';
931 print
'<td class="nowrap">';
932 $form->select_types_paiements((
GETPOST(
'operation') ?
GETPOST(
'operation') : ($object->courant ==
Account::TYPE_CASH ?
'LIQ' :
'')),
'operation',
'1,2', 2, 1);
935 print
'<input name="num_chq" class="flat" type="text" size="4" value="'.GETPOST(
"num_chq",
"alpha").
'">';
939 print
'<td class=right>';
940 $form->select_comptes(
GETPOST(
'add_account',
'int') ?
GETPOST(
'add_account',
'int') : $search_account,
'add_account', 0,
'', 1, ($id > 0 || !empty($ref) ?
' disabled="disabled"' :
''));
943 print
'<td class="right"><input name="adddebit" class="flat" type="text" size="4" value="'.GETPOST(
"adddebit",
"alpha").
'"></td>';
944 print
'<td class="right"><input name="addcredit" class="flat" type="text" size="4" value="'.GETPOST(
"addcredit",
"alpha").
'"></td>';
951 print
'<td class="center">';
952 print
'<input type="submit" name="save" class="button buttongen marginbottomonly button-add" value="'.$langs->trans(
"Add").
'"><br>';
953 print
'<input type="submit" name="cancel" class="button buttongen marginbottomonly button-cancel" value="'.$langs->trans(
"Cancel").
'">';
961 $urlajax = DOL_URL_ROOT.
'/core/ajax/bankconciliate.php?token='.
currentToken();
963 <script type="text/javascript">
965 $("a.ajaxforbankoperationchange").each(function(){
966 var current = $(this);
967 current.click(function()
969 var url = "'.$urlajax.
'&"+current.attr("href").split("?")[1];
970 $.get(url, function(data)
974 current.parent().parent().find(".spanforajaxedit").replaceWith(data);
989 if ($action !=
'addline' && $action !=
'reconcile') {
990 if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
991 if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
992 $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);
995 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.newToken().
'&page='.$page.$param,
'', $user->rights->banque->modifier);
998 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.newToken().
'&page='.$page.$param,
'', -1);
1010 if ($action !=
'addline' && $action !=
'reconcile') {
1011 $morehtml .= $buttonreconcile;
1014 $morehtml .=
'<!-- Add New button -->'.$newcardbutton;
1016 $picto =
'bank_account';
1017 if ($id > 0 || !empty($ref)) {
1021 print_barre_liste($langs->trans(
"BankTransactions"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml,
'', $limit, 0, 0, 1);
1025 $param .=
'&page='.urlencode($page);
1028 $moreforfilter =
'';
1030 $moreforfilter .=
'<div class="divsearchfield">';
1031 $moreforfilter .= $langs->trans(
'DateOperationShort');
1032 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1033 $moreforfilter .=
'<div class="nowrap inline-block">';
1034 $moreforfilter .= $form->selectDate($search_dt_start,
'search_start_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1035 $moreforfilter .=
'</div>';
1036 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'' :
' ');
1037 $moreforfilter .=
'<div class="nowrap inline-block">';
1038 $moreforfilter .= $form->selectDate($search_dt_end,
'search_end_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1039 $moreforfilter .=
'</div>';
1040 $moreforfilter .=
'</div>';
1042 $moreforfilter .=
'<div class="divsearchfield">';
1043 $moreforfilter .= $langs->trans(
'DateValueShort');
1044 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1045 $moreforfilter .=
'<div class="nowrap inline-block">';
1046 $moreforfilter .= $form->selectDate($search_dv_start,
'search_start_dv', 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_dv_end,
'search_end_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1051 $moreforfilter .=
'</div>';
1052 $moreforfilter .=
'</div>';
1054 if (isModEnabled(
'categorie')) {
1056 if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire')) {
1057 $langs->load(
'categories');
1060 $moreforfilter .=
'<div class="divsearchfield">';
1061 $tmptitle = $langs->trans(
'RubriquesTransactions');
1062 $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, $search_bid,
'parent',
null,
null, 1);
1063 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$form->selectarray(
'search_bid', $cate_arbo, $search_bid, $tmptitle, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1064 $moreforfilter .=
'</div>';
1068 $parameters = array();
1069 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
1070 if (empty($reshook)) {
1071 $moreforfilter .= $hookmanager->resPrint;
1073 $moreforfilter = $hookmanager->resPrint;
1076 if ($moreforfilter) {
1077 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1078 print $moreforfilter;
1079 print
'</div>'.
"\n";
1082 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1083 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
1085 if ($action ==
'reconcile') {
1086 $arrayfields[
'b.num_releve'][
'checked'] = 1;
1089 print
'<div class="div-table-responsive">';
1090 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1093 print
'<tr class="liste_titre_filter">';
1094 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1095 print
'<td class="liste_titre">';
1096 print
'<input type="text" class="flat" name="search_ref" size="2" value="'.dol_escape_htmltag($search_ref).
'">';
1099 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1100 print
'<td class="liste_titre">';
1101 print
'<input type="text" class="flat maxwidth100" name="search_description" value="'.dol_escape_htmltag($search_description).
'">';
1104 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1105 print
'<td class="liste_titre"> </td>';
1107 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1108 print
'<td class="liste_titre"> </td>';
1110 if (!empty($arrayfields[
'type'][
'checked'])) {
1111 print
'<td class="liste_titre" align="center">';
1112 print $form->select_types_paiements(empty($search_type) ?
'' : $search_type,
'search_type',
'', 2, 1, 1, 0, 1,
'maxwidth100', 1);
1116 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1117 print
'<td class="liste_titre" align="center"><input type="text" class="flat" name="req_nb" value="'.dol_escape_htmltag($search_req_nb).
'" size="2"></td>';
1120 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1121 print
'<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty_user).
'"></td>';
1124 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1125 print
'<td class="liste_titre">';
1126 $form->select_comptes($search_account,
'search_account', 0,
'', 1, ($id > 0 || !empty($ref) ?
' disabled="disabled"' :
''), 0,
'maxwidth100');
1130 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1131 print
'<td class="liste_titre right">';
1132 print
'<input type="text" class="flat width50" name="search_debit" value="'.dol_escape_htmltag($search_debit).
'">';
1136 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1137 print
'<td class="liste_titre right">';
1138 print
'<input type="text" class="flat width50" name="search_credit" value="'.dol_escape_htmltag($search_credit).
'">';
1142 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1143 print
'<td class="liste_titre right">';
1144 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1145 print $form->textwithpicto(
'', $htmltext, 1);
1149 if (!empty($arrayfields[
'balance'][
'checked'])) {
1150 print
'<td class="liste_titre right">';
1151 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1152 print $form->textwithpicto(
'', $htmltext, 1);
1156 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1157 print
'<td class="liste_titre" align="center"><input type="text" class="flat" name="search_num_releve" value="'.dol_escape_htmltag($search_num_releve).
'" size="3"></td>';
1160 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1161 print
'<td class="liste_titre center parentonrightofpage">';
1162 print $form->selectyesno(
'search_conciliated', $search_conciliated, 1,
false, 1, 1,
'search_status onrightofpage maxwidth75');
1166 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1167 print
'<td class="liste_titre" align="center"><input type="text" class="flat" name="search_fk_bordereau" value="'.dol_escape_htmltag($search_fk_bordereau).
'" size="3"></td>';
1171 print
'<td class="liste_titre" align="middle">';
1172 $searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0,
'checkforselect', 1);
1178 print
'<tr class="liste_titre">';
1179 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1180 print_liste_field_titre($arrayfields[
'b.rowid'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rowid',
'', $param,
'', $sortfield, $sortorder);
1182 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1183 print_liste_field_titre($arrayfields[
'b.label'][
'label'], $_SERVER[
'PHP_SELF'],
'b.label',
'', $param,
'', $sortfield, $sortorder);
1185 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1186 print_liste_field_titre($arrayfields[
'b.dateo'][
'label'], $_SERVER[
'PHP_SELF'],
'b.dateo',
'', $param,
'', $sortfield, $sortorder,
"center ");
1188 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1189 print_liste_field_titre($arrayfields[
'b.datev'][
'label'], $_SERVER[
'PHP_SELF'],
'b.datev,b.dateo,b.rowid',
'', $param,
'align="center"', $sortfield, $sortorder);
1191 if (!empty($arrayfields[
'type'][
'checked'])) {
1192 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'align="center"', $sortfield, $sortorder);
1194 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1195 print_liste_field_titre($arrayfields[
'b.num_chq'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_chq',
'', $param,
'', $sortfield, $sortorder,
"center ");
1197 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1198 print_liste_field_titre($arrayfields[
'bu.label'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1200 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1201 print_liste_field_titre($arrayfields[
'ba.ref'][
'label'], $_SERVER[
'PHP_SELF'],
'ba.ref',
'', $param,
'', $sortfield, $sortorder);
1203 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1204 print_liste_field_titre($arrayfields[
'b.debit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1206 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1207 print_liste_field_titre($arrayfields[
'b.credit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1209 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1210 print_liste_field_titre($arrayfields[
'balancebefore'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1212 if (!empty($arrayfields[
'balance'][
'checked'])) {
1213 print_liste_field_titre($arrayfields[
'balance'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1215 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1216 print_liste_field_titre($arrayfields[
'b.num_releve'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_releve',
'', $param,
'', $sortfield, $sortorder,
"center ");
1218 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1219 print_liste_field_titre($arrayfields[
'b.conciliated'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rappro',
'', $param,
'', $sortfield, $sortorder,
"center ");
1221 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1222 print_liste_field_titre($arrayfields[
'b.fk_bordereau'][
'label'], $_SERVER[
'PHP_SELF'],
'b.fk_bordereau',
'', $param,
'', $sortfield, $sortorder,
"center ");
1226 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1228 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
1229 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1230 print $hookmanager->resPrint;
1232 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
1237 $balancecalculated =
false;
1238 $posconciliatecol = 0;
1239 $cachebankaccount = array();
1244 while ($i < min($num, $limit)) {
1245 $objp = $db->fetch_object($resql);
1246 $links = $bankaccountstatic->get_url($objp->rowid);
1249 if (!$balancecalculated && (!empty($arrayfields[
'balancebefore'][
'checked']) || !empty($arrayfields[
'balance'][
'checked'])) && ($mode_balance_ok || $search_conciliated ===
'0')) {
1250 if (!$search_account) {
1251 dol_print_error(
'',
'account is not defined but $mode_balance_ok is true');
1258 $sqlforbalance =
'SELECT SUM(b.amount) as previoustotal';
1259 $sqlforbalance .=
" FROM ";
1260 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
1261 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank as b";
1262 $sqlforbalance .=
" WHERE b.fk_account = ba.rowid";
1263 $sqlforbalance .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
1264 $sqlforbalance .=
" AND b.fk_account = ".((int) $search_account);
1265 $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.
"))))";
1266 $resqlforbalance = $db->query($sqlforbalance);
1268 if ($resqlforbalance) {
1269 $objforbalance = $db->fetch_object($resqlforbalance);
1270 if ($objforbalance) {
1272 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1273 $balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount);
1276 $balance = $objforbalance->previoustotal;
1283 $balancecalculated =
true;
1286 if ($user->rights->banque->consolidate && $action ==
'reconcile') {
1287 $tmpnbfieldbeforebalance = 0;
1288 $tmpnbfieldafterbalance = 0;
1289 $balancefieldfound = 0;
1290 foreach ($arrayfields as $key => $val) {
1291 if ($key ==
'balancebefore' || $key ==
'balance') {
1292 $balancefieldfound++;
1295 if (!empty($arrayfields[$key][
'checked'])) {
1296 if (!$balancefieldfound) {
1297 $tmpnbfieldbeforebalance++;
1299 $tmpnbfieldafterbalance++;
1304 $element =
'banktransaction';
1305 if (!empty($extrafields->attributes[$element][
'label']) && is_array($extrafields->attributes[$element][
'label']) && count($extrafields->attributes[$element][
'label'])) {
1306 foreach ($extrafields->attributes[$element][
'label'] as $key => $val) {
1307 if (!empty($arrayfields[
"ef.".$key][
'checked'])) {
1308 if (!empty($arrayfields[$key][
'checked'])) {
1309 if (!$balancefieldfound) {
1310 $tmpnbfieldbeforebalance++;
1312 $tmpnbfieldafterbalance++;
1319 print
'<tr class="oddeven trforbreak">';
1320 if ($tmpnbfieldbeforebalance) {
1321 print
'<td colspan="'.$tmpnbfieldbeforebalance.
'">';
1326 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1327 print
'<td class="right">';
1328 if ($search_conciliated !==
'0') {
1333 if (!empty($arrayfields[
'balance'][
'checked'])) {
1334 print
'<td class="right">';
1335 if ($search_conciliated !==
'0') {
1340 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1341 print
'<td class="center">';
1342 print
'<input type="checkbox" id="selectAll" title="'.dol_escape_htmltag($langs->trans(
"SelectAll")).
'" />';
1343 print
' <script type="text/javascript">
1344 $("input#selectAll").change(function() {
1345 $("input[type=checkbox][name^=rowid]").prop("checked", $(this).is(":checked"));
1350 print
'<td colspan="'.($tmpnbfieldafterbalance + 1).
'">';
1357 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1358 $balance =
price2num($balancebefore,
'MT');
1359 $balancebefore =
price2num($balancebefore - ($sign * $objp->amount),
'MT');
1361 $balancebefore =
price2num($balance,
'MT');
1362 $balance =
price2num($balance + ($sign * $objp->amount),
'MT');
1365 if (empty($cachebankaccount[$objp->bankid])) {
1366 $bankaccounttmp =
new Account($db);
1367 $bankaccounttmp->fetch($objp->bankid);
1368 $cachebankaccount[$objp->bankid] = $bankaccounttmp;
1369 $bankaccount = $bankaccounttmp;
1371 $bankaccount = $cachebankaccount[$objp->bankid];
1374 if (empty($conf->global->BANK_COLORIZE_MOVEMENT)) {
1375 $backgroundcolor =
"class='oddeven'";
1377 if ($objp->amount < 0) {
1379 $backgroundcolor =
'style="background: '.$color.
';"';
1382 $backgroundcolor =
'style="background: '.$color.
';"';
1386 $banklinestatic->id = $objp->rowid;
1387 $banklinestatic->ref = $objp->rowid;
1389 print
'<tr class="oddeven" '.$backgroundcolor.
'>';
1392 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1393 print
'<td class="nowrap left">';
1394 print $banklinestatic->getNomUrl(1);
1397 $totalarray[
'nbfield']++;
1402 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1406 preg_match(
'/\((.+)\)/i', $objp->label, $reg);
1407 if (!empty($reg[1]) && $langs->trans($reg[1]) != $reg[1]) {
1408 $labeltoshow = $langs->trans($reg[1]);
1410 if ($objp->label ==
'(payment_salary)') {
1411 $labeltoshow = $langs->trans(
"SalaryPayment");
1414 $titletoshow = $objp->label;
1419 print
'<td class="tdoverflowmax250"'.($titletoshow ?
' title="'.dol_escape_htmltag($titletoshow).
'"' :
'').
'>';
1422 $cachebankaccount = array();
1423 foreach ($links as $key => $val) {
1424 print
'<!-- '.$links[$key][
'type'].
' -->';
1425 if ($links[$key][
'type'] ==
'withdraw') {
1426 $banktransferstatic->id = $links[$key][
'url_id'];
1427 $banktransferstatic->ref = $links[$key][
'label'];
1428 print $banktransferstatic->getNomUrl(0).($labeltoshow ?
' ' :
'');
1429 } elseif ($links[$key][
'type'] ==
'payment') {
1430 $paymentstatic->id = $links[$key][
'url_id'];
1431 $paymentstatic->ref = $links[$key][
'url_id'];
1432 $paymentstatic->date = $db->jdate($objp->do);
1433 print $paymentstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1434 } elseif ($links[$key][
'type'] ==
'payment_supplier') {
1435 $paymentsupplierstatic->id = $links[$key][
'url_id'];
1436 $paymentsupplierstatic->ref = $links[$key][
'url_id'];
1437 print $paymentsupplierstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1438 } elseif ($links[$key][
'type'] ==
'payment_sc') {
1439 $paymentscstatic->id = $links[$key][
'url_id'];
1440 $paymentscstatic->ref = $links[$key][
'url_id'];
1441 $paymentscstatic->label = $links[$key][
'label'];
1442 print $paymentscstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1443 } elseif ($links[$key][
'type'] ==
'payment_vat') {
1444 $paymentvatstatic->id = $links[$key][
'url_id'];
1445 $paymentvatstatic->ref = $links[$key][
'url_id'];
1446 print $paymentvatstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1447 } elseif ($links[$key][
'type'] ==
'payment_salary') {
1448 $paymentsalstatic->id = $links[$key][
'url_id'];
1449 $paymentsalstatic->ref = $links[$key][
'url_id'];
1450 $paymentsalstatic->label = $links[$key][
'label'];
1451 print $paymentsalstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1452 } elseif ($links[$key][
'type'] ==
'payment_loan') {
1453 print
'<a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$links[$key][
'url_id'].
'">';
1454 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
1455 print
'</a>'.($labeltoshow ?
' ' :
'');
1456 } elseif ($links[$key][
'type'] ==
'payment_donation') {
1457 $paymentdonationstatic->id = $links[$key][
'url_id'];
1458 $paymentdonationstatic->ref = $links[$key][
'url_id'];
1459 print $paymentdonationstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1460 } elseif ($links[$key][
'type'] ==
'payment_expensereport') {
1461 $paymentexpensereportstatic->id = $links[$key][
'url_id'];
1462 $paymentexpensereportstatic->ref = $links[$key][
'url_id'];
1463 print $paymentexpensereportstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1464 } elseif ($links[$key][
'type'] ==
'payment_various') {
1465 $paymentvariousstatic->id = $links[$key][
'url_id'];
1466 $paymentvariousstatic->ref = $links[$key][
'url_id'];
1467 print $paymentvariousstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1468 } elseif ($links[$key][
'type'] ==
'banktransfert') {
1470 if ($objp->amount > 0) {
1471 $banklinestatic->fetch($links[$key][
'url_id']);
1472 $bankstatic->id = $banklinestatic->fk_account;
1473 $bankstatic->label = $banklinestatic->bank_account_ref;
1474 print $langs->trans(
"TransferFrom").
' ';
1475 print $bankstatic->getNomUrl(1,
'transactions');
1476 print
' '.$langs->trans(
"toward").
' ';
1477 $bankstatic->id = $objp->bankid;
1478 $bankstatic->label = $objp->bankref;
1479 print $bankstatic->getNomUrl(1,
'');
1480 print ($labeltoshow ?
' - ' :
'');
1482 $bankstatic->id = $objp->bankid;
1483 $bankstatic->label = $objp->bankref;
1484 print $langs->trans(
"TransferFrom").
' ';
1485 print $bankstatic->getNomUrl(1,
'');
1486 print
' '.$langs->trans(
"toward").
' ';
1487 $banklinestatic->fetch($links[$key][
'url_id']);
1488 $bankstatic->id = $banklinestatic->fk_account;
1489 $bankstatic->label = $banklinestatic->bank_account_ref;
1490 print $bankstatic->getNomUrl(1,
'transactions');
1491 print ($labeltoshow ?
' - ' :
'');
1494 } elseif ($links[$key][
'type'] ==
'company') {
1495 } elseif ($links[$key][
'type'] ==
'user') {
1496 } elseif ($links[$key][
'type'] ==
'member') {
1497 } elseif ($links[$key][
'type'] ==
'sc') {
1498 } elseif ($links[$key][
'type'] ==
'vat') {
1499 } elseif ($links[$key][
'type'] ==
'salary') {
1503 print
'<a href="'.$links[$key][
'url'].$links[$key][
'url_id'].
'">';
1504 if (preg_match(
'/^\((.*)\)$/i', $links[$key][
'label'], $reg)) {
1506 if ($reg[1] ==
'paiement') {
1507 $reg[1] =
'Payment';
1509 print $langs->trans($reg[1]);
1511 print $links[$key][
'label'];
1513 print
'</a>'.($labeltoshow ?
' - ' :
'');
1521 $totalarray[
'nbfield']++;
1526 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1527 print
'<td align="center" class="nowrap">';
1528 print
'<span class="spanforajaxedit" id="dateoperation_'.$objp->rowid.
'">'.
dol_print_date($db->jdate($objp->do),
"day").
"</span>";
1530 print
'<span class="inline-block">';
1531 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=doprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1533 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=donext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1538 $totalarray[
'nbfield']++;
1543 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1544 print
'<td align="center" class="nowrap">';
1545 print
'<span class="spanforajaxedit" id="datevalue_'.$objp->rowid.
'">'.
dol_print_date($db->jdate($objp->dv),
"day").
"</span>";
1547 print
'<span class="inline-block">';
1548 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1550 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvnext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1555 $totalarray[
'nbfield']++;
1560 if (!empty($arrayfields[
'type'][
'checked'])) {
1561 print
'<td class="tdoverflowmax100">';
1562 $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);
1563 if ($labeltype ==
'SOLD') {
1570 $totalarray[
'nbfield']++;
1575 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1576 print
'<td class="nowrap" align="center">'.($objp->num_chq ?
dol_escape_htmltag($objp->num_chq) :
"").
"</td>\n";
1578 $totalarray[
'nbfield']++;
1583 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1584 print
'<td class="tdoverflowmax150">';
1586 $companylinked_id = 0;
1591 foreach ($links as $key => $value) {
1592 if ($links[$key][
'type'] ==
'payment_sc') {
1593 $type_link =
'payment_sc';
1595 if ($links[$key][
'type'] ==
'payment_salary') {
1596 $type_link =
'payment_salary';
1599 if ($links[$key][
'type'] ==
'company') {
1600 $companylinked_id = $links[$key][
'url_id'];
1602 if ($links[$key][
'type'] ==
'user') {
1603 $userlinked_id = $links[$key][
'url_id'];
1607 if ($companylinked_id) {
1609 $companystatic->fetch($companylinked_id);
1610 print $companystatic->getNomUrl(1);
1611 } elseif ($userlinked_id &&
1612 (($type_link ==
'payment_salary' && !empty($user->rights->salaries->read))
1613 || ($type_link ==
'payment_sc' && !empty($user->rights->tax->charges->lire)))) {
1615 if (!empty($conf->cache[
'user'][$userlinked_id])) {
1616 $tmpuser = $conf->cache[
'user'][$userlinked_id];
1618 $tmpuser =
new User($db);
1619 $tmpuser->fetch($userlinked_id);
1620 $conf->cache[
'user'][$userlinked_id] = $tmpuser;
1622 print $tmpuser->getNomUrl(1);
1629 $totalarray[
'nbfield']++;
1634 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1635 print
'<td class="nowrap">';
1636 print $bankaccount->getNomUrl(1);
1639 $totalarray[
'nbfield']++;
1644 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1645 print
'<td class="nowrap right"><span class="amount">';
1646 if ($objp->amount < 0) {
1647 print
price($objp->amount * -1);
1648 $totalarray[
'totaldeb'] += $objp->amount;
1650 print
"</span></td>\n";
1652 $totalarray[
'nbfield']++;
1655 $totalarray[
'totaldebfield'] = $totalarray[
'nbfield'];
1660 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1661 print
'<td class="nowrap right"><span class="amount">';
1662 if ($objp->amount > 0) {
1663 print
price($objp->amount);
1664 $totalarray[
'totalcred'] += $objp->amount;
1666 print
"</span></td>\n";
1668 $totalarray[
'nbfield']++;
1671 $totalarray[
'totalcredfield'] = $totalarray[
'nbfield'];
1676 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1677 if ($mode_balance_ok) {
1678 if ($balancebefore >= 0) {
1679 print
'<td class="nowrap right"> '.price($balancebefore).
'</td>';
1681 print
'<td class="error nowrap right"> '.price($balancebefore).
'</td>';
1684 print
'<td class="right">-</td>';
1687 $totalarray[
'nbfield']++;
1692 if (!empty($arrayfields[
'balance'][
'checked'])) {
1693 if ($mode_balance_ok) {
1694 if ($balance >= 0) {
1695 print
'<td class="nowrap right"> '.price($balance).
'</td>';
1697 print
'<td class="error nowrap right"> '.price($balance).
'</td>';
1700 print
'<td class="right">-</td>';
1703 $totalarray[
'nbfield']++;
1707 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1708 print
'<td class="nowraponall" align="center">';
1710 if ($bankaccount->canBeConciliated() > 0) {
1711 if ($objp->num_releve) {
1712 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>';
1714 if (!$objp->conciliated && $action ==
'reconcile') {
1715 if ($objp->num_releve) {
1718 print
'<input class="flat" name="rowid['.$objp->rowid.
']" type="checkbox" value="'.$objp->rowid.
'" size="1"'.(!empty($_POST[
'rowid'][$objp->rowid]) ?
' checked' :
'').
'>';
1723 $totalarray[
'nbfield']++;
1724 $posconciliatecol = $totalarray[
'nbfield'];
1728 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1729 print
'<td class="nowraponall" align="center">';
1730 print
yn($objp->conciliated);
1733 $totalarray[
'nbfield']++;
1737 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1738 $bordereaustatic->fetch($objp->fk_bordereau);
1739 print
'<td class="nowraponall" align="center">';
1740 print $bordereaustatic->getNomUrl();
1743 $totalarray[
'nbfield']++;
1748 $parameters=array(
'arrayfields'=>$arrayfields,
'obj'=>$objp,
'i'=>$i,
'totalarray'=>&$totalarray);
1749 $reshook=$hookmanager->executeHooks(
'printFieldListValue', $parameters, $objecttmp);
1750 print $hookmanager->resPrint;
1753 print
'<td class="nowraponall" align="center">';
1755 if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) {
1756 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.
'">';
1760 if ($user->rights->banque->modifier || $user->rights->banque->consolidate) {
1761 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.
'">';
1765 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.
'">';
1769 if ($bankaccount->canBeConciliated() > 0 && empty($objp->conciliated)) {
1770 if ($db->jdate($objp->dv) < ($now - $conf->bank->rappro->warning_delay)) {
1771 print
' '.img_warning($langs->trans(
"ReconciliationLate"));
1774 if ($user->rights->banque->modifier) {
1775 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.newToken().
'&rowid='.$objp->rowid.
'&page='.$page.$param.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
'').
'">';
1776 print
img_delete(
'',
'class="marginleftonly"');
1782 if ($massactionbutton || $massaction) {
1784 if (in_array($obj->rowid, $arrayofselected)) {
1787 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1791 $totalarray[
'nbfield']++;
1800 if (isset($totalarray[
'totaldebfield']) || isset($totalarray[
'totalcredfield'])) {
1801 print
'<tr class="liste_total">';
1803 while ($i < $totalarray[
'nbfield']) {
1806 if ($num < $limit && empty($offset)) {
1807 print
'<td class="left">'.$langs->trans(
"Total").
'</td>';
1809 print
'<td class="left tdoverflowmax50" title="'.$langs->trans(
"Totalforthispage").
'">'.$langs->trans(
"Totalforthispage").
'</td>';
1811 } elseif ($totalarray[
'totaldebfield'] == $i) {
1812 print
'<td class="right"><span class="amount">'.price(-1 * $totalarray[
'totaldeb']).
'</span></td>';
1813 } elseif ($totalarray[
'totalcredfield'] == $i) {
1814 print
'<td class="right"><span class="amount">'.price($totalarray[
'totalcred']).
'</span></td>';
1815 } elseif ($i == $posconciliatecol) {
1816 print
'<td class="center">';
1817 if ($user->rights->banque->consolidate && $action ==
'reconcile') {
1818 print
'<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans(
"Conciliate").
'">';
1831 foreach ($arrayfields as $key => $val) {
1832 if (!empty($val[
'checked'])) {
1836 print
'<tr><td colspan="'.($colspan + 1).
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
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.
Classe permettant la gestion des paiements des charges La tva collectee n'est calculee que sur les fa...
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_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
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 '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
img_view($titlealt='default', $float=0, $other='class="valignmiddle"')
Show logo view card.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dol_substr($string, $start, $length=null, $stringencoding='', $trunconbytes=0)
Make a substring.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_edit_add($titlealt='default', $other='')
Show logo +.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
img_edit_remove($titlealt='default', $other='')
Show logo -.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.