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[
$object->table_element][
'label'])) {
602 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
603 $sql .= ($extrafields->attributes[
$object->table_element][
'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[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
617 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_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 width175" id="num_releve" 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 $placeholder .=
' '.$langs->trans(
"or").
' ';
966 $placeholder .= $yyyy.$mm.$dd;
968 $texttoshow .= $langs->trans(
"InputReceiptNumberBis");
971 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="'.(
GETPOSTINT(
'num_releve') ?
GETPOSTINT(
'num_releve') :
'').
'">';
974 if (is_array($options) && count($options)) {
975 print $langs->trans(
"EventualyAddCategory").
': ';
978 print
'<br><div style="margin-top: 5px;"><span class="opacitymedium">'.$langs->trans(
"ThenCheckLinesAndConciliate").
'</span> ';
979 print
'<input type="submit" class="button" name="confirm_reconcile" value="'.$langs->trans(
"Conciliate").
'">';
980 print
' <span class="opacitymedium">'.$langs->trans(
"otherwise").
'</span> ';
981 print
'<input type="submit" class="button small" name="confirm_savestatement" value="'.$langs->trans(
"SaveStatementOnly").
'">';
982 print
' <span class="opacitymedium">'.$langs->trans(
"or").
'</span> ';
983 print
'<input type="submit" name="cancel" class="button button-cancel small" value="'.$langs->trans(
"Cancel").
'">';
988 $listoflastreceipts =
'';
989 $sql =
"SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX.
"bank";
990 $sql .=
" WHERE fk_account = ".((int)
$object->id).
" AND num_releve IS NOT NULL";
991 $sql .= $db->order(
"num_releve",
"DESC");
992 $sql .= $db->plimit($nbmax + 1);
995 print $langs->trans(
"LastAccountStatements").
' : ';
996 $resqlr = $db->query($sql);
998 $numr = $db->num_rows($resqlr);
1001 while (($i < $numr) && ($i < $nbmax)) {
1002 $objr = $db->fetch_object($resqlr);
1004 $last_releve = $objr->num_releve;
1008 $newentreyinlist =
'<a target="_blank" href="'.DOL_URL_ROOT.
'/compta/bank/releve.php?account='.((int) $id).
'&num='.urlencode($objr->num_releve).
'">';
1009 $newentreyinlist .=
img_picto($objr->num_releve,
'generic',
'class="paddingright"');
1011 $listoflastreceipts = $newentreyinlist.$listoflastreceipts;
1013 if ($numr >= $nbmax) {
1014 $listoflastreceipts =
"... ".$listoflastreceipts;
1016 print $listoflastreceipts;
1018 print
'<b>'.$langs->trans(
"None").
'</b>';
1027 <script type="text/javascript">
1028 $("#num_releve").val("' . $last_releve.
'");
1037 $param .=
'&page='.urlencode((
string) ($page));
1040 $moreforfilter =
'';
1041 $moreforfilter .=
'<div class="divsearchfield">';
1042 $moreforfilter .= $langs->trans(
'DateOperationShort');
1043 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1044 $moreforfilter .=
'<div class="nowrap inline-block">';
1045 $moreforfilter .= $form->selectDate($search_dt_start,
'search_start_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1046 $moreforfilter .=
'</div>';
1047 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'' :
' ');
1048 $moreforfilter .=
'<div class="nowrap inline-block">';
1049 $moreforfilter .= $form->selectDate($search_dt_end,
'search_end_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1050 $moreforfilter .=
'</div>';
1051 $moreforfilter .=
'</div>';
1053 $moreforfilter .=
'<div class="divsearchfield">';
1054 $moreforfilter .= $langs->trans(
'DateValueShort');
1055 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1056 $moreforfilter .=
'<div class="nowrap inline-block">';
1057 $moreforfilter .= $form->selectDate($search_dv_start,
'search_start_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1058 $moreforfilter .=
'</div>';
1059 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'' :
' ');
1060 $moreforfilter .=
'<div class="nowrap inline-block">';
1061 $moreforfilter .= $form->selectDate($search_dv_end,
'search_end_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1062 $moreforfilter .=
'</div>';
1063 $moreforfilter .=
'</div>';
1065 if (isModEnabled(
'category')) {
1067 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1068 $langs->load(
'categories');
1071 $moreforfilter .=
'<div class="divsearchfield">';
1072 $tmptitle = $langs->trans(
'RubriquesTransactions');
1073 $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, $search_bid,
'parent',
null,
null, 1);
1074 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$form->selectarray(
'search_bid', $cate_arbo, $search_bid, $tmptitle, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1075 $moreforfilter .=
'</div>';
1079 $parameters = array();
1080 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1081 if (empty($reshook)) {
1082 $moreforfilter .= $hookmanager->resPrint;
1084 $moreforfilter = $hookmanager->resPrint;
1087 if ($moreforfilter) {
1088 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1089 print $moreforfilter;
1090 print
'</div>'.
"\n";
1093 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1094 $htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1095 $selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
1096 $selectedfields .= ($action ==
'reconcile' ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1099 if ($action ==
'reconcile') {
1100 $arrayfields[
'b.num_releve'][
'checked'] = 1;
1103 print
'<div class="div-table-responsive">';
1104 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1108 print
'<tr class="liste_titre_filter">';
1111 print
'<td class="liste_titre valignmiddle center">';
1112 $searchpicto = $form->showFilterButtons(
'left');
1118 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1119 print
'<td class="liste_titre">';
1120 print
'<input type="text" class="flat" name="search_ref" size="2" value="'.dol_escape_htmltag($search_ref).
'">';
1123 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1124 print
'<td class="liste_titre">';
1125 print
'<input type="text" class="flat maxwidth100" name="search_description" value="'.dol_escape_htmltag($search_description).
'">';
1128 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1129 print
'<td class="liste_titre"> </td>';
1131 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1132 print
'<td class="liste_titre"> </td>';
1134 if (!empty($arrayfields[
'type'][
'checked'])) {
1135 print
'<td class="liste_titre center">';
1136 print $form->select_types_paiements(empty($search_type) ?
'' : $search_type,
'search_type',
'', 2, 1, 1, 0, 1,
'maxwidth100', 1);
1140 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1141 print
'<td class="liste_titre center"><input type="text" class="flat" name="req_nb" value="'.dol_escape_htmltag($search_req_nb).
'" size="2"></td>';
1144 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1145 print
'<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty_user).
'"></td>';
1148 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1149 print
'<td class="liste_titre">';
1150 $form->select_comptes($search_account,
'search_account', 0,
'', 1, ($id > 0 || !empty($ref) ?
' disabled="disabled"' :
''), 0,
'maxwidth100');
1154 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1155 print
'<td class="liste_titre right">';
1156 print
'<input type="text" class="flat width50" name="search_debit" value="'.dol_escape_htmltag($search_debit).
'">';
1160 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1161 print
'<td class="liste_titre right">';
1162 print
'<input type="text" class="flat width50" name="search_credit" value="'.dol_escape_htmltag($search_credit).
'">';
1166 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1167 print
'<td class="liste_titre right">';
1168 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1169 print $form->textwithpicto(
'', $htmltext, 1);
1173 if (!empty($arrayfields[
'balance'][
'checked'])) {
1174 print
'<td class="liste_titre right">';
1175 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1176 print $form->textwithpicto(
'', $htmltext, 1);
1180 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1181 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>';
1184 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1185 print
'<td class="liste_titre center parentonrightofpage">';
1186 print $form->selectyesno(
'search_conciliated', $search_conciliated, 1,
false, 1, 1,
'search_status onrightofpage maxwidth75');
1190 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1191 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>';
1194 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1196 print
'<td class="nowraponall center"></td>';
1200 print
'<td class="liste_titre valignmiddle center">';
1203 $searchpicto = $form->showFilterButtons();
1209 $totalarray = array();
1210 $totalarray[
'nbfield'] = 0;
1213 print
'<tr class="liste_titre">';
1216 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1217 $totalarray[
'nbfield']++;
1219 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1220 print_liste_field_titre($arrayfields[
'b.rowid'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rowid',
'', $param,
'', $sortfield, $sortorder);
1221 $totalarray[
'nbfield']++;
1223 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1224 print_liste_field_titre($arrayfields[
'b.label'][
'label'], $_SERVER[
'PHP_SELF'],
'b.label',
'', $param,
'', $sortfield, $sortorder);
1225 $totalarray[
'nbfield']++;
1227 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1228 print_liste_field_titre($arrayfields[
'b.dateo'][
'label'], $_SERVER[
'PHP_SELF'],
'b.dateo',
'', $param,
'', $sortfield, $sortorder,
"center ");
1229 $totalarray[
'nbfield']++;
1231 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1232 print_liste_field_titre($arrayfields[
'b.datev'][
'label'], $_SERVER[
'PHP_SELF'],
'b.datev,b.dateo,b.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1233 $totalarray[
'nbfield']++;
1235 if (!empty($arrayfields[
'type'][
'checked'])) {
1236 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
1237 $totalarray[
'nbfield']++;
1239 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1240 print_liste_field_titre($arrayfields[
'b.num_chq'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_chq',
'', $param,
'', $sortfield, $sortorder,
"center ");
1241 $totalarray[
'nbfield']++;
1243 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1244 print_liste_field_titre($arrayfields[
'bu.label'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1245 $totalarray[
'nbfield']++;
1247 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1248 print_liste_field_titre($arrayfields[
'ba.ref'][
'label'], $_SERVER[
'PHP_SELF'],
'ba.ref',
'', $param,
'', $sortfield, $sortorder);
1249 $totalarray[
'nbfield']++;
1251 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1252 print_liste_field_titre($arrayfields[
'b.debit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1253 $totalarray[
'nbfield']++;
1255 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1256 print_liste_field_titre($arrayfields[
'b.credit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1257 $totalarray[
'nbfield']++;
1259 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1260 print_liste_field_titre($arrayfields[
'balancebefore'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1261 $totalarray[
'nbfield']++;
1263 if (!empty($arrayfields[
'balance'][
'checked'])) {
1264 print_liste_field_titre($arrayfields[
'balance'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1265 $totalarray[
'nbfield']++;
1267 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1268 print_liste_field_titre($arrayfields[
'b.num_releve'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_releve',
'', $param,
'', $sortfield, $sortorder,
"center ");
1269 $totalarray[
'nbfield']++;
1271 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1272 print_liste_field_titre($arrayfields[
'b.conciliated'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rappro',
'', $param,
'', $sortfield, $sortorder,
"center ");
1273 $totalarray[
'nbfield']++;
1275 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1276 print_liste_field_titre($arrayfields[
'b.fk_bordereau'][
'label'], $_SERVER[
'PHP_SELF'],
'b.fk_bordereau',
'', $param,
'', $sortfield, $sortorder,
"center ");
1277 $totalarray[
'nbfield']++;
1281 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1283 $parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1284 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1285 print $hookmanager->resPrint;
1287 print
'<td class="nowraponall center"></td>';
1288 $totalarray[
'nbfield']++;
1292 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1293 $totalarray[
'nbfield']++;
1299 $balancecalculated =
false;
1300 $posconciliatecol = 0;
1301 $cachebankaccount = array();
1307 $savnbfield = $totalarray[
'nbfield'];
1308 $totalarray = array();
1309 $totalarray[
'nbfield'] = 0;
1310 $totalarray[
'totaldeb'] = 0;
1311 $totalarray[
'totalcred'] = 0;
1313 $imaxinloop = ($limit ? min($num, $limit) : $num);
1314 while ($i < $imaxinloop) {
1315 $objp = $db->fetch_object($resql);
1316 $links = $bankaccountstatic->get_url($objp->rowid);
1319 if (!$balancecalculated && (!empty($arrayfields[
'balancebefore'][
'checked']) || !empty($arrayfields[
'balance'][
'checked'])) && ($mode_balance_ok || $search_conciliated ===
'0')) {
1320 if (!$search_account) {
1321 dol_print_error(
null,
'account is not defined but $mode_balance_ok is true');
1328 $sqlforbalance =
'SELECT SUM(b.amount) as previoustotal';
1329 $sqlforbalance .=
" FROM ";
1330 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
1331 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank as b";
1332 $sqlforbalance .=
" WHERE b.fk_account = ba.rowid";
1333 $sqlforbalance .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
1334 $sqlforbalance .=
" AND b.fk_account = ".((int) $search_account);
1336 $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.
"))))";
1337 $resqlforbalance = $db->query($sqlforbalance);
1340 if ($resqlforbalance) {
1341 $objforbalance = $db->fetch_object($resqlforbalance);
1342 if ($objforbalance) {
1344 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1345 $balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount);
1348 $balance = $objforbalance->previoustotal;
1355 $balancecalculated =
true;
1358 if ($user->hasRight(
'banque',
'consolidate') && $action ==
'reconcile') {
1359 $tmpnbfieldbeforebalance = 0;
1360 $tmpnbfieldafterbalance = 0;
1361 $balancefieldfound = 0;
1362 foreach ($arrayfields as $key => $val) {
1363 if ($key ==
'balancebefore' || $key ==
'balance') {
1364 $balancefieldfound++;
1367 if (!empty($arrayfields[$key][
'checked'])) {
1368 if (!$balancefieldfound) {
1369 $tmpnbfieldbeforebalance++;
1371 $tmpnbfieldafterbalance++;
1376 $element = $extrafieldsobjectkey;
1377 if (!empty($extrafields->attributes[$element][
'label']) && is_array($extrafields->attributes[$element][
'label']) && count($extrafields->attributes[$element][
'label'])) {
1378 foreach ($extrafields->attributes[$element][
'label'] as $key => $val) {
1379 if (!empty($arrayfields[
"ef.".$key][
'checked'])) {
1380 if (!empty($arrayfields[$key][
'checked'])) {
1381 if (!$balancefieldfound) {
1382 $tmpnbfieldbeforebalance++;
1384 $tmpnbfieldafterbalance++;
1391 print
'<tr class="oddeven trforbreak">';
1396 if ($tmpnbfieldbeforebalance) {
1397 print
'<td colspan="'.$tmpnbfieldbeforebalance.
'">';
1402 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1403 print
'<td class="right">';
1404 if ($search_conciliated !==
'0') {
1405 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1413 if (!empty($arrayfields[
'balance'][
'checked'])) {
1414 print
'<td class="right">';
1415 if ($search_conciliated !==
'0') {
1416 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1424 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1429 print
'<td colspan="'.($tmpnbfieldafterbalance).
'">';
1442 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1443 $balance =
price2num($balancebefore,
'MT');
1444 $balancebefore =
price2num($balancebefore - ($sign * $objp->amount),
'MT');
1446 $balancebefore =
price2num($balance,
'MT');
1447 $balance =
price2num($balance + ($sign * $objp->amount),
'MT');
1450 if (empty($cachebankaccount[$objp->bankid])) {
1451 $bankaccounttmp =
new Account($db);
1452 $bankaccounttmp->fetch($objp->bankid);
1453 $cachebankaccount[$objp->bankid] = $bankaccounttmp;
1454 $bankaccount = $bankaccounttmp;
1456 $bankaccount = $cachebankaccount[$objp->bankid];
1460 $backgroundcolor =
"class='oddeven'";
1462 if ($objp->amount < 0) {
1464 $backgroundcolor =
'style="background: '.$color.
';"';
1467 $backgroundcolor =
'style="background: '.$color.
';"';
1471 $banklinestatic->id = $objp->rowid;
1472 $banklinestatic->ref = $objp->rowid;
1474 print
'<tr class="oddeven" '.$backgroundcolor.
'>';
1478 print
'<td class="center">';
1479 if (!$objp->conciliated && $action ==
'reconcile') {
1480 print
'<input class="flat checkforselect" name="rowid['.$objp->rowid.
']" type="checkbox" name="toselect[]" value="'.$objp->rowid.
'" size="1"'.(!empty($tmparray[$objp->rowid]) ?
' checked' :
'').
'>';
1484 $totalarray[
'nbfield']++;
1489 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1490 print
'<td class="nowrap left">';
1491 print $banklinestatic->getNomUrl(1);
1494 $totalarray[
'nbfield']++;
1499 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1503 preg_match(
'/\((.+)\)/i', $objp->label, $reg);
1504 if (!empty($reg[1]) && $langs->trans($reg[1]) != $reg[1]) {
1506 $labeltoshow = $langs->trans($reg[1]);
1508 if ($objp->label ==
'(payment_salary)') {
1509 $labeltoshow = $langs->trans(
"SalaryPayment");
1512 $titletoshow = $objp->label;
1517 print
'<td class="tdoverflowmax250"'.($titletoshow ?
' title="'.dol_escape_htmltag($titletoshow).
'"' :
'').
'>';
1520 $cachebankaccount = array();
1521 foreach ($links as $key => $val) {
1522 print
'<!-- '.$links[$key][
'type'].
' -->';
1523 if ($links[$key][
'type'] ==
'withdraw') {
1524 $banktransferstatic->id = $links[$key][
'url_id'];
1525 $banktransferstatic->ref = $links[$key][
'label'];
1526 print $banktransferstatic->getNomUrl(0).($labeltoshow ?
' ' :
'');
1527 } elseif ($links[$key][
'type'] ==
'payment') {
1528 $paymentstatic->id = $links[$key][
'url_id'];
1529 $paymentstatic->ref = $links[$key][
'url_id'];
1530 $paymentstatic->date = $db->jdate($objp->do);
1531 print $paymentstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1532 } elseif ($links[$key][
'type'] ==
'payment_supplier') {
1533 $paymentsupplierstatic->id = $links[$key][
'url_id'];
1534 $paymentsupplierstatic->ref = $links[$key][
'url_id'];
1535 print $paymentsupplierstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1536 } elseif ($links[$key][
'type'] ==
'payment_sc') {
1537 $paymentscstatic->id = $links[$key][
'url_id'];
1538 $paymentscstatic->ref = $links[$key][
'url_id'];
1539 $paymentscstatic->label = $links[$key][
'label'];
1540 print $paymentscstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1541 } elseif ($links[$key][
'type'] ==
'payment_vat') {
1542 $paymentvatstatic->id = $links[$key][
'url_id'];
1543 $paymentvatstatic->ref = $links[$key][
'url_id'];
1544 print $paymentvatstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1545 } elseif ($links[$key][
'type'] ==
'payment_salary') {
1546 $paymentsalstatic->id = $links[$key][
'url_id'];
1547 $paymentsalstatic->ref = $links[$key][
'url_id'];
1548 $paymentsalstatic->label = $links[$key][
'label'];
1549 print $paymentsalstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1550 } elseif ($links[$key][
'type'] ==
'payment_loan') {
1551 print
'<a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$links[$key][
'url_id'].
'">';
1552 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
1553 print
'</a>'.($labeltoshow ?
' ' :
'');
1554 } elseif ($links[$key][
'type'] ==
'payment_donation') {
1555 $paymentdonationstatic->id = $links[$key][
'url_id'];
1556 $paymentdonationstatic->ref = $links[$key][
'url_id'];
1557 print $paymentdonationstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1558 } elseif ($links[$key][
'type'] ==
'payment_expensereport') {
1559 $paymentexpensereportstatic->id = $links[$key][
'url_id'];
1560 $paymentexpensereportstatic->ref = $links[$key][
'url_id'];
1561 print $paymentexpensereportstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1562 } elseif ($links[$key][
'type'] ==
'payment_various') {
1563 $paymentvariousstatic->id = $links[$key][
'url_id'];
1564 $paymentvariousstatic->ref = $links[$key][
'url_id'];
1565 print $paymentvariousstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1566 } elseif ($links[$key][
'type'] ==
'banktransfert') {
1568 if ($objp->amount > 0) {
1569 $banklinestatic->fetch($links[$key][
'url_id']);
1570 $bankstatic->id = $banklinestatic->fk_account;
1571 $bankstatic->label = $banklinestatic->bank_account_ref;
1572 print $langs->trans(
"TransferFrom").
' ';
1573 print $bankstatic->getNomUrl(1,
'transactions');
1574 print
' '.$langs->trans(
"toward").
' ';
1575 $bankstatic->id = $objp->bankid;
1576 $bankstatic->label = $objp->bankref;
1577 print $bankstatic->getNomUrl(1,
'');
1578 print($labeltoshow ?
' - ' :
'');
1580 $bankstatic->id = $objp->bankid;
1581 $bankstatic->label = $objp->bankref;
1582 print $langs->trans(
"TransferFrom").
' ';
1583 print $bankstatic->getNomUrl(1,
'');
1584 print
' '.$langs->trans(
"toward").
' ';
1585 $banklinestatic->fetch($links[$key][
'url_id']);
1586 $bankstatic->id = $banklinestatic->fk_account;
1587 $bankstatic->label = $banklinestatic->bank_account_ref;
1588 print $bankstatic->getNomUrl(1,
'transactions');
1589 print($labeltoshow ?
' - ' :
'');
1592 } elseif ($links[$key][
'type'] ==
'company') {
1593 } elseif ($links[$key][
'type'] ==
'user') {
1594 } elseif ($links[$key][
'type'] ==
'member') {
1595 } elseif ($links[$key][
'type'] ==
'sc') {
1596 } elseif ($links[$key][
'type'] ==
'vat') {
1597 } elseif ($links[$key][
'type'] ==
'salary') {
1601 print
'<a href="'.$links[$key][
'url'].$links[$key][
'url_id'].
'">';
1602 if (preg_match(
'/^\((.*)\)$/i', $links[$key][
'label'], $reg)) {
1604 if ($reg[1] ==
'paiement') {
1605 $reg[1] =
'Payment';
1607 print $langs->trans($reg[1]);
1609 print $links[$key][
'label'];
1611 print
'</a>'.($labeltoshow ?
' - ' :
'');
1619 $totalarray[
'nbfield']++;
1624 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1625 print
'<td class="nowrap center">';
1626 print
'<span class="spanforajaxedit" id="dateoperation_'.$objp->rowid.
'">'.
dol_print_date($db->jdate($objp->do),
"day").
"</span>";
1628 print
'<span class="inline-block">';
1629 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=doprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1631 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=donext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1636 $totalarray[
'nbfield']++;
1641 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1642 print
'<td class="nowrap center">';
1643 print
'<span class="spanforajaxedit" id="datevalue_'.$objp->rowid.
'">'.
dol_print_date($db->jdate($objp->dv),
"day").
"</span>";
1645 print
'<span class="inline-block">';
1646 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1648 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvnext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1653 $totalarray[
'nbfield']++;
1658 if (!empty($arrayfields[
'type'][
'checked'])) {
1659 print
'<td class="tdoverflowmax100">';
1660 $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);
1661 if ($labeltype ==
'SOLD') {
1668 $totalarray[
'nbfield']++;
1673 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1674 print
'<td class="nowrap center">'.($objp->num_chq ?
dol_escape_htmltag($objp->num_chq) :
"").
"</td>\n";
1676 $totalarray[
'nbfield']++;
1681 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1682 print
'<td class="tdoverflowmax150">';
1684 $companylinked_id = 0;
1689 foreach ($links as $key => $value) {
1690 if ($links[$key][
'type'] ==
'payment_sc') {
1691 $type_link =
'payment_sc';
1693 if ($links[$key][
'type'] ==
'payment_salary') {
1694 $type_link =
'payment_salary';
1696 if ($links[$key][
'type'] ==
'payment_expensereport') {
1697 $type_link =
'payment_expensereport';
1700 if ($links[$key][
'type'] ==
'company') {
1701 $companylinked_id = $links[$key][
'url_id'];
1703 if ($links[$key][
'type'] ==
'user') {
1704 $userlinked_id = $links[$key][
'url_id'];
1708 if ($companylinked_id) {
1710 $companystatic->fetch($companylinked_id);
1711 print $companystatic->getNomUrl(1);
1712 } elseif ($userlinked_id &&
1713 (($type_link ==
'payment_salary' && $user->hasRight(
'salaries',
'read'))
1714 || ($type_link ==
'payment_sc' && $user->hasRight(
'tax',
'charges',
'lire'))
1715 || ($type_link ==
'payment_expensereport' && $user->hasRight(
'expensereport',
'lire')))) {
1717 if (!empty($conf->cache[
'user'][$userlinked_id])) {
1718 $tmpuser = $conf->cache[
'user'][$userlinked_id];
1720 $tmpuser =
new User($db);
1721 $tmpuser->fetch($userlinked_id);
1722 $conf->cache[
'user'][$userlinked_id] = $tmpuser;
1724 print $tmpuser->getNomUrl(-1);
1731 $totalarray[
'nbfield']++;
1736 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1737 print
'<td class="nowrap">';
1738 print $bankaccount->getNomUrl(1);
1741 $totalarray[
'nbfield']++;
1746 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1747 print
'<td class="nowrap right"><span class="amount">';
1748 if ($objp->amount < 0) {
1749 print
price($objp->amount * -1);
1750 $totalarray[
'totaldeb'] += $objp->amount;
1752 print
"</span></td>\n";
1754 $totalarray[
'nbfield']++;
1757 $totalarray[
'totaldebfield'] = $totalarray[
'nbfield'];
1762 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1763 print
'<td class="nowrap right"><span class="amount">';
1764 if ($objp->amount > 0) {
1765 print
price($objp->amount);
1766 $totalarray[
'totalcred'] += $objp->amount;
1768 print
"</span></td>\n";
1770 $totalarray[
'nbfield']++;
1773 $totalarray[
'totalcredfield'] = $totalarray[
'nbfield'];
1778 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1779 if ($mode_balance_ok) {
1780 if ($balancebefore >= 0) {
1781 print
'<td class="nowrap right"> '.price($balancebefore).
'</td>';
1783 print
'<td class="error nowrap right"> '.price($balancebefore).
'</td>';
1786 print
'<td class="right">-</td>';
1789 $totalarray[
'nbfield']++;
1794 if (!empty($arrayfields[
'balance'][
'checked'])) {
1795 if ($mode_balance_ok) {
1796 if ($balance >= 0) {
1797 print
'<td class="nowrap right"> '.price($balance).
'</td>';
1799 print
'<td class="error nowrap right"> '.price($balance).
'</td>';
1802 print
'<td class="right">-</td>';
1805 $totalarray[
'nbfield']++;
1809 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1810 print
'<td class="nowraponall center">';
1812 if ($bankaccount->canBeConciliated() > 0) {
1813 if ($objp->num_releve) {
1814 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>';
1819 $totalarray[
'nbfield']++;
1820 $posconciliatecol = $totalarray[
'nbfield'];
1824 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1825 print
'<td class="nowraponall center">';
1826 print
yn($objp->conciliated);
1829 $totalarray[
'nbfield']++;
1833 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1834 $bordereaustatic->fetch($objp->fk_bordereau);
1835 print
'<td class="nowraponall center">';
1836 print $bordereaustatic->getNomUrl();
1839 $totalarray[
'nbfield']++;
1844 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1846 $parameters = array(
'arrayfields' => $arrayfields,
'object'=>$object,
'obj' => $objp,
'i' => $i,
'totalarray' => &$totalarray);
1847 $reshook=$hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1848 print $hookmanager->resPrint;
1851 print
'<td class="nowraponall center">';
1853 if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) {
1854 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.
'">';
1858 if ($user->hasRight(
'banque',
'modifier') || $user->hasRight(
'banque',
'consolidate')) {
1859 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.
'">';
1863 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.
'">';
1867 if ($bankaccount->canBeConciliated() > 0 && empty($objp->conciliated)) {
1868 if ($db->jdate($objp->dv) < ($now - $conf->bank->rappro->warning_delay)) {
1869 print
' '.img_warning($langs->trans(
"ReconciliationLate"));
1872 if ($user->hasRight(
'banque',
'modifier')) {
1873 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&rowid='.$objp->rowid.
'&page='.$page.$param.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
'').
'">';
1874 print
img_delete(
'',
'class="marginleftonly"');
1880 $totalarray[
'nbfield']++;
1885 print
'<td class="center">';
1886 if (!$objp->conciliated && $action ==
'reconcile') {
1887 print
'<input class="flat checkforselect" name="rowid['.$objp->rowid.
']" type="checkbox" value="'.$objp->rowid.
'" size="1"'.(!empty($tmparray[$objp->rowid]) ?
' checked' :
'').
'>';
1891 $totalarray[
'nbfield']++;
1901 if (isset($totalarray[
'totaldebfield']) || isset($totalarray[
'totalcredfield'])) {
1902 print
'<tr class="liste_total">';
1904 while ($i < $totalarray[
'nbfield']) {
1907 if ($num < $limit && empty($offset)) {
1908 print
'<td class="left">'.$langs->trans(
"Total").
'</td>';
1910 print
'<td class="left tdoverflowmax50" title="'.$langs->trans(
"Totalforthispage").
'">'.$langs->trans(
"Totalforthispage").
'</td>';
1912 } elseif ($totalarray[
'totaldebfield'] == $i) {
1913 print
'<td class="right"><span class="amount">'.price(-1 * $totalarray[
'totaldeb']).
'</span></td>';
1914 } elseif ($totalarray[
'totalcredfield'] == $i) {
1915 print
'<td class="right"><span class="amount">'.price($totalarray[
'totalcred']).
'</span></td>';
1916 } elseif ($i == $posconciliatecol) {
1917 print
'<td class="center">';
1918 if ($user->hasRight(
'banque',
'consolidate') && $action ==
'reconcile') {
1919 print
'<input class="button smallpaddingimp" name="confirm_reconcile" type="submit" value="'.$langs->trans(
"Conciliate").
'">';
1932 foreach ($arrayfields as $key => $val) {
1933 if (!empty($val[
'checked'])) {
1937 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.