35 require
'../../main.inc.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
41 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
44 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
45 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
46 require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
47 require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/paymentvat.class.php';
48 require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
49 require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/paymentsocialcontribution.class.php';
50 require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/tva.class.php';
51 require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
52 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
53 require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
54 require_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
55 require_once DOL_DOCUMENT_ROOT.
'/don/class/paymentdonation.class.php';
56 require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/paymentexpensereport.class.php';
57 require_once DOL_DOCUMENT_ROOT.
'/loan/class/loan.class.php';
58 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/paiementfourn.class.php';
59 require_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'.(empty($object->ref) ?
'' :
'-'.$object->id);
70 $massaction =
GETPOST(
'massaction',
'alpha');
71 $optioncss =
GETPOST(
'optioncss',
'aZ09');
74 $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref :
''));
75 $fieldtype = (!empty($ref) ?
'ref' :
'rowid');
78 $socid = $user->socid;
80 $result =
restrictedArea($user,
'banque', $fieldvalue,
'bank_account&bank_account',
'',
'', $fieldtype);
83 $socid = $user->socid;
89 $search_debit =
GETPOST(
"search_debit",
'alpha');
90 $search_credit =
GETPOST(
"search_credit",
'alpha');
91 $search_type =
GETPOST(
"search_type",
'alpha');
92 $search_account =
GETPOST(
"search_account",
'int') ?
GETPOST(
"search_account",
'int') :
GETPOST(
"account",
'int');
93 $search_accountancy_code =
GETPOST(
'search_accountancy_code',
'alpha') ?
GETPOST(
'search_accountancy_code',
'alpha') :
GETPOST(
'accountancy_code',
'alpha');
95 $search_ref =
GETPOST(
'search_ref',
'alpha');
96 $search_description =
GETPOST(
"search_description",
'alpha');
97 $search_dt_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_start_dtmonth',
'int'),
GETPOST(
'search_start_dtday',
'int'),
GETPOST(
'search_start_dtyear',
'int'));
99 $search_dv_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_start_dvmonth',
'int'),
GETPOST(
'search_start_dvday',
'int'),
GETPOST(
'search_start_dvyear',
'int'));
101 $search_thirdparty_user =
GETPOST(
"search_thirdparty",
'alpha') ?
GETPOST(
"search_thirdparty",
'alpha') :
GETPOST(
"thirdparty",
'alpha');
102 $search_req_nb =
GETPOST(
"req_nb",
'alpha');
103 $search_num_releve =
GETPOST(
"search_num_releve",
'alpha');
104 $search_conciliated =
GETPOST(
"search_conciliated",
'int');
105 $search_fk_bordereau =
GETPOST(
"search_fk_bordereau",
'int');
106 $optioncss =
GETPOST(
'optioncss',
'alpha');
107 $toselect =
GETPOST(
'toselect',
'array');
108 $num_releve =
GETPOST(
"num_releve",
"alpha");
109 if (empty($dateop)) {
113 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
114 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
115 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
117 $pageplusone =
GETPOST(
"pageplusone",
'int');
119 $page = $pageplusone - 1;
121 if (empty($page) || $page == -1) {
124 $offset = $limit * $page;
125 $pageprev = $page - 1;
126 $pagenext = $page + 1;
128 $sortorder =
'desc,desc,desc';
131 $sortfield =
'b.datev,b.dateo,b.rowid';
135 if ($id > 0 || !empty($ref)) {
136 $result = $object->fetch($id, $ref);
137 $search_account = $object->id;
139 if (!($object->id > 0)) {
140 $langs->load(
"errors");
141 print($langs->trans(
'ErrorRecordNotFound'));
146 $mode_balance_ok =
false;
148 if (($sortfield ==
'b.datev' || $sortfield ==
'b.datev,b.dateo,b.rowid')) {
149 $sortfield =
'b.datev,b.dateo,b.rowid';
150 if ($id > 0 || !empty($ref) || $search_account > 0) {
151 $mode_balance_ok =
true;
156 $hookmanager->initHooks(array(
'banktransactionlist', $contextpage));
160 $extrafields->fetch_name_optionals_label(
'banktransaction');
161 $search_array_options = $extrafields->getOptionalsFromPost(
'banktransaction',
'',
'search_');
163 $arrayfields = array(
164 'b.rowid'=>array(
'label'=>$langs->trans(
"Ref"),
'checked'=>1,
'position'=>10),
165 'b.label'=>array(
'label'=>$langs->trans(
"Description"),
'checked'=>1,
'position'=>20),
166 'b.dateo'=>array(
'label'=>$langs->trans(
"DateOperationShort"),
'checked'=>1,
'position'=>30),
167 'b.datev'=>array(
'label'=>$langs->trans(
"DateValueShort"),
'checked'=>1,
'position'=>40),
168 'type'=>array(
'label'=>$langs->trans(
"Type"),
'checked'=>1,
'position'=>50),
169 'b.num_chq'=>array(
'label'=>$langs->trans(
"Numero"),
'checked'=>1,
'position'=>60),
170 'bu.label'=>array(
'label'=>$langs->trans(
"ThirdParty").
'/'.$langs->trans(
"User"),
'checked'=>1,
'position'=>70),
171 'ba.ref'=>array(
'label'=>$langs->trans(
"BankAccount"),
'checked'=>(($id > 0 || !empty($ref)) ? 0 : 1),
'position'=>80),
172 'b.debit'=>array(
'label'=>$langs->trans(
"Debit"),
'checked'=>1,
'position'=>90),
173 'b.credit'=>array(
'label'=>$langs->trans(
"Credit"),
'checked'=>1,
'position'=>100),
174 'balancebefore'=>array(
'label'=>$langs->trans(
"BalanceBefore"),
'checked'=>0,
'position'=>110),
175 'balance'=>array(
'label'=>$langs->trans(
"Balance"),
'checked'=>1,
'position'=>120),
176 'b.num_releve'=>array(
'label'=>$langs->trans(
"AccountStatement"),
'checked'=>1,
'position'=>130),
177 'b.conciliated'=>array(
'label'=>$langs->trans(
"BankLineReconciled"),
'enabled'=> $object->rappro,
'checked'=>($action ==
'reconcile' ? 1 : 0),
'position'=>140),
178 'b.fk_bordereau'=>array(
'label'=>$langs->trans(
"ChequeNumber"),
'checked'=>0,
'position'=>150),
181 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
190 if (
GETPOST(
'cancel',
'alpha')) {
194 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
198 $parameters = array();
199 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
204 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
206 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
207 $search_dt_start =
'';
209 $search_dv_start =
'';
217 $search_description =
'';
218 $search_thirdparty_user =
'';
219 $search_num_releve =
'';
220 $search_conciliated =
'';
221 $search_fk_bordereau =
'';
224 $search_account =
"";
225 if ($id > 0 || !empty($ref)) {
226 $search_account = $object->id;
230 if (empty($reshook)) {
231 $objectclass =
'Account';
232 $objectlabel =
'BankTransaction';
233 $permissiontoread = !empty($user->rights->banque->lire);
234 $permissiontodelete = !empty($user->rights->banque->modifier);
235 $uploaddir = $conf->bank->dir_output;
236 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
239 $rowids =
GETPOST(
'rowid',
'array');
242 if ((
GETPOST(
'confirm_savestatement',
'alpha') ||
GETPOST(
'confirm_reconcile',
'alpha'))
243 && (
GETPOST(
"num_releve",
"alpha") || !empty($rowids))
244 && !empty($user->rights->banque->consolidate)
249 $num_releve =
GETPOST(
"num_releve",
"alpha");
254 $rowids =
GETPOST(
'rowid',
'array');
256 if (!empty($rowids) && is_array($rowids)) {
257 foreach ($rowids as $row) {
259 $result = $bankline->fetch($row);
260 $bankline->num_releve = $num_releve;
261 $result = $bankline->update_conciliation($user,
GETPOST(
"cat"),
GETPOST(
'confirm_reconcile',
'alpha') ? 1 : 0);
271 $langs->load(
"errors");
276 $langs->load(
"errors");
277 setEventMessages($langs->trans(
"ErrorPleaseTypeBankTransactionReportName"),
null,
'errors');
281 $param =
'action=reconcile&contextpage=banktransactionlist&id='.((int) $id).
'&search_account='.((int) $id);
283 $param .=
'&page='.urlencode($page);
286 $param .=
'&offset='.urlencode($offset);
289 $param .=
'&limit='.urlencode($limit);
291 if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
292 $param .=
'&search_conciliated='.urlencode($search_conciliated);
294 if ($search_thirdparty_user) {
295 $param .=
'&search_thirdparty='.urlencode($search_thirdparty_user);
297 if ($search_num_releve) {
298 $param .=
'&search_num_releve='.urlencode($search_num_releve);
300 if ($search_description) {
301 $param .=
'&search_description='.urlencode($search_description);
304 $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');
307 $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');
310 $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');
313 $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');
316 $param .=
'&search_type='.urlencode($search_type);
319 $param .=
'&search_debit='.urlencode($search_debit);
321 if ($search_credit) {
322 $param .=
'&search_credit='.urlencode($search_credit);
324 $param .=
'&sortfield='.urlencode($sortfield).
'&sortorder='.urlencode($sortorder);
325 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?'.$param);
331 if (
GETPOST(
'save') && !$cancel && !empty($user->rights->banque->modifier)) {
340 $operation =
GETPOST(
"operation",
'alpha');
341 $num_chq =
GETPOST(
"num_chq",
'alpha');
342 $label =
GETPOST(
"label",
'alpha');
343 $cat1 =
GETPOST(
"cat1",
'alpha');
345 $bankaccountid = $id;
346 if (
GETPOST(
'add_account',
'int') > 0) {
347 $bankaccountid =
GETPOST(
'add_account',
'int');
351 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Date")),
null,
'errors');
355 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
359 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Label")),
null,
'errors');
363 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Amount")),
null,
'errors');
365 if (!($bankaccountid > 0)) {
367 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"BankAccount")),
null,
'errors');
375 if (!$error && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
377 $objecttmp->fetch($bankaccountid);
378 $insertid = $objecttmp->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user,
'',
'', $search_accountancy_code);
381 header(
"Location: ".$_SERVER[
'PHP_SELF'].($id ?
"?id=".$id :
''));
391 if ($action ==
'confirm_delete' && $confirm ==
'yes' && !empty($user->rights->banque->modifier)) {
393 $result = $accline->fetch(
GETPOST(
"rowid",
"int"));
394 $result = $accline->delete($user);
410 $companystatic =
new Societe($db);
411 $bankaccountstatic =
new Account($db);
412 $userstatic=
new User($db);
415 $societestatic =
new Societe($db);
416 $userstatic =
new User($db);
418 $loanstatic =
new Loan($db);
420 $donstatic =
new Don($db);
429 $bankstatic =
new Account($db);
437 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
438 $param .=
'&contextpage='.urlencode($contextpage);
440 if ($limit > 0 && $limit != $conf->liste_limit) {
441 $param .=
'&limit='.urlencode($limit);
444 $param .=
'&id='.urlencode($id);
447 $param .=
'&ref='.urlencode($ref);
449 if (!empty($search_ref)) {
450 $param .=
'&search_ref='.urlencode($search_ref);
452 if (!empty($search_description)) {
453 $param .=
'&search_description='.urlencode($search_description);
455 if (!empty($search_type)) {
456 $param .=
'&type='.urlencode($search_type);
458 if (!empty($search_thirdparty_user)) {
459 $param .=
'&search_thirdparty='.urlencode($search_thirdparty_user);
461 if (!empty($search_debit)) {
462 $param .=
'&search_debit='.urlencode($search_debit);
464 if (!empty($search_credit)) {
465 $param .=
'&search_credit='.urlencode($search_credit);
467 if ($search_account > 0) {
468 $param .=
'&search_account='.urlencode($search_account);
470 if (!empty($search_num_releve)) {
471 $param .=
'&search_num_releve='.urlencode($search_num_releve);
473 if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
474 $param .=
'&search_conciliated='.urlencode($search_conciliated);
476 if ($search_fk_bordereau > 0) {
477 $param .=
'$&search_fk_bordereau='.urlencode($search_fk_bordereau);
479 if ($search_bid > 0) {
480 $param .=
'&search_bid='.urlencode($search_bid);
483 $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');
486 $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');
489 $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');
492 $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');
494 if ($search_req_nb) {
495 $param .=
'&req_nb='.urlencode($search_req_nb);
497 if (
GETPOST(
"search_thirdparty",
'int')) {
498 $param .=
'&thirdparty='.urlencode(
GETPOST(
"search_thirdparty",
'int'));
500 if ($optioncss !=
'') {
501 $param .=
'&optioncss='.urlencode($optioncss);
503 if ($action ==
'reconcile') {
504 $param .=
'&action=reconcile';
512 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
516 $buttonreconcile =
'';
519 if ($id > 0 || !empty($ref)) {
520 $title = $object->ref.
' - '.$langs->trans(
"Transactions");
522 $title = $langs->trans(
"BankTransactions");
529 if ($id > 0 || !empty($ref)) {
531 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
534 foreach ($bankcateg->fetchAll() as $bankcategory) {
535 $options[$bankcategory->id] = $bankcategory->label;
540 print
dol_get_fiche_head($head,
'journal', $langs->trans(
"FinancialAccount"), 0,
'account');
542 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
544 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
553 if ($action !=
'reconcile') {
554 if ($object->canBeConciliated() > 0) {
555 $allowautomaticconciliation =
false;
556 $titletoconciliatemanual = $langs->trans(
"Conciliate");
557 $titletoconciliateauto = $langs->trans(
"Conciliate");
558 if ($allowautomaticconciliation) {
559 $titletoconciliatemanual .=
' ('.$langs->trans(
"Manual").
')';
560 $titletoconciliateauto .=
' ('.$langs->trans(
"Auto").
')';
564 if ($user->rights->banque->consolidate) {
566 $newparam = preg_replace(
'/search_conciliated=\d+/i',
'', $newparam);
567 $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>';
569 $buttonreconcile =
'<a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliatemanual.
'</a>';
572 if ($allowautomaticconciliation) {
574 if ($user->rights->banque->consolidate) {
576 $newparam = preg_replace(
'/search_conciliated=\d+/i',
'', $newparam);
577 $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>';
579 $buttonreconcile .=
' <a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliateauto.
'</a>';
586 $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,";
587 $sql .=
" b.fk_account, b.fk_type, b.fk_bordereau,";
588 $sql .=
" ba.rowid as bankid, ba.ref as bankref";
590 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
591 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
592 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
596 $parameters = array();
597 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
598 $sql .= $hookmanager->resPrint;
600 if ($search_bid > 0) {
601 $sql .= MAIN_DB_PREFIX.
"bank_class as l,";
603 $sql .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
604 $sql .=
" ".MAIN_DB_PREFIX.
"bank as b";
605 if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
606 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (b.rowid = ef.fk_object)";
610 $parameters = array();
611 $reshook = $hookmanager->executeHooks(
'printFieldListJoin', $parameters);
612 $sql .= $hookmanager->resPrint;
614 $sql .=
" WHERE b.fk_account = ba.rowid";
615 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
616 if ($search_account > 0) {
617 $sql .=
" AND b.fk_account = ".((int) $search_account);
621 $sql .=
" AND b.dateo >= '".$db->idate($search_dt_start).
"'";
624 $sql .=
" AND b.dateo <= '".$db->idate($search_dt_end).
"'";
628 $sql .=
" AND b.datev >= '".$db->idate($search_dv_start).
"'";
631 $sql .=
" AND b.datev <= '".$db->idate($search_dv_end).
"'";
636 if ($search_req_nb) {
639 if ($search_num_releve) {
642 if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
643 $sql .=
" AND b.rappro = ".((int) $search_conciliated);
645 if ($search_fk_bordereau > 0) {
646 $sql .=
" AND b.fk_bordereau = " . ((int) $search_fk_bordereau);
648 if ($search_thirdparty_user) {
649 $sql.=
" AND (b.rowid IN ";
650 $sql.=
" ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url AS bu";
651 $sql.=
" JOIN ".MAIN_DB_PREFIX.
"bank AS b2 ON b2.rowid = bu.fk_bank";
652 $sql.=
" JOIN ".MAIN_DB_PREFIX.
"user AS subUser ON (bu.type = 'user' AND bu.url_id = subUser.rowid)";
653 $sql.=
" WHERE ".
natural_search(array(
"subUser.firstname",
"subUser.lastname"), $search_thirdparty_user,
'', 1).
")";
655 $sql.=
" OR b.rowid IN ";
656 $sql.=
" ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url AS bu";
657 $sql.=
" JOIN ".MAIN_DB_PREFIX.
"bank AS b2 ON b2.rowid = bu.fk_bank";
658 $sql.=
" JOIN ".MAIN_DB_PREFIX.
"societe AS subSoc ON (bu.type = 'company' AND bu.url_id = subSoc.rowid)";
659 $sql.=
" WHERE ".
natural_search(array(
"subSoc.nom"), $search_thirdparty_user,
'', 1);
662 if ($search_description) {
663 $search_description_to_use = $search_description;
664 $arrayoffixedlabels = array(
666 'CustomerInvoicePayment',
'CustomerInvoicePaymentBack',
667 'SupplierInvoicePayment',
'SupplierInvoicePaymentBack',
669 'ExpenseReportPayment',
670 'SocialContributionPayment',
671 'SubscriptionPayment',
674 foreach ($arrayoffixedlabels as $keyforlabel) {
675 $translatedlabel = $langs->transnoentitiesnoconv($keyforlabel);
676 if (preg_match(
'/'.$search_description.
'/i', $translatedlabel)) {
677 $search_description_to_use .=
"|".$keyforlabel;
683 if ($search_bid > 0) {
684 $sql .=
" AND b.rowid = l.lineid AND l.fk_categ = ".((int) $search_bid);
686 if (!empty($search_type)) {
687 $sql .=
" AND b.fk_type = '".$db->escape($search_type).
"'";
692 $sql .=
' AND b.amount <= 0';
694 if ($search_credit) {
696 $sql .=
' AND b.amount >= 0';
699 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
702 $parameters = array();
703 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
704 $sql .= $hookmanager->resPrint;
706 $sql .= $db->order($sortfield, $sortorder);
710 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
711 $result = $db->query($sql);
716 if (($id > 0 || !empty($ref)) && ((
string) $page ==
'')) {
719 $page = ($nbtotalofpages - 1);
720 $offset = $limit * $page;
725 if ($page >= $nbtotalofpages) {
727 $page = ($nbtotalofpages - 1);
728 $offset = $limit * $page;
736 if (empty($search_account)) {
737 $mode_balance_ok =
false;
740 if (!empty($search_ref)) {
741 $mode_balance_ok =
false;
743 if (!empty($search_description)) {
744 $mode_balance_ok =
false;
746 if (!empty($search_type)) {
747 $mode_balance_ok =
false;
749 if (!empty($search_debit)) {
750 $mode_balance_ok =
false;
752 if (!empty($search_credit)) {
753 $mode_balance_ok =
false;
755 if (!empty($search_thirdparty_user)) {
756 $mode_balance_ok =
false;
758 if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
759 $mode_balance_ok =
false;
761 if (!empty($search_num_releve)) {
762 $mode_balance_ok =
false;
764 if (!empty($search_fk_bordereau)) {
765 $mode_balance_ok =
false;
768 $sql .= $db->plimit($limit + 1, $offset);
770 dol_syslog(
'compta/bank/bankentries_list.php', LOG_DEBUG);
771 $resql = $db->query($sql);
773 $num = $db->num_rows(
$resql);
775 $arrayofselected = (!empty($toselect) && is_array($toselect)) ? $toselect : array();
778 $arrayofmassactions = array(
783 if (in_array($massaction, array(
'presend',
'predelete'))) {
784 $arrayofmassactions = array();
786 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
789 if ($action ==
'delete') {
790 $text = $langs->trans(
'ConfirmDeleteTransaction');
791 print
$form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&rowid='.
GETPOST(
"rowid",
'int'), $langs->trans(
'DeleteTransaction'), $text,
'confirm_delete',
null,
'', 1);
795 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'" name="search_form">'.
"\n";
796 if ($optioncss !=
'') {
797 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
799 print
'<input type="hidden" name="token" value="'.newToken().
'">';
800 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
801 print
'<input type="hidden" name="action" value="'.($action !=
'delete' ? $action :
'search').
'">';
803 print
'<input type="hidden" name="view" value="'.dol_escape_htmltag($view).
'">';
805 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
806 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
807 print
'<input type="hidden" name="page" value="'.$page.
'">';
808 print
'<input type="hidden" name="id" value="'.$id.
'">';
809 print
'<input type="hidden" name="ref" value="'.$ref.
'">';
811 print
'<input type="hidden" name="bid" value="'.GETPOST(
"bid",
'int').
'">';
815 if ($user->rights->banque->consolidate && $action ==
'reconcile') {
816 print
'<div class="valignmiddle inline-block" style="padding-right: 20px;">';
817 print
'<strong>'.$langs->trans(
"InputReceiptNumber").
'</strong>: ';
818 print
'<input class="flat" id="num_releve" name="num_releve" type="text" value="'.(GETPOST(
'num_releve') ?
GETPOST(
'num_releve') :
'').
'" size="10">';
820 if (is_array($options) && count($options)) {
821 print $langs->trans(
"EventualyAddCategory").
': ';
824 print
'<br><div style="margin-top: 5px;"><span class="opacitymedium">'.$langs->trans(
"ThenCheckLinesAndConciliate").
'</span> ';
825 print
'<input class="button" name="confirm_savestatement" type="submit" value="'.$langs->trans(
"SaveStatementOnly").
'">';
826 print
' '.$langs->trans(
"or").
' ';
827 print
'<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans(
"Conciliate").
'">';
828 print
' '.$langs->trans(
"or").
' ';
829 print
'<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans(
"Cancel").
'">';
835 $sql =
"SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX.
"bank";
836 $sql .=
" WHERE fk_account = ".((int) $object->id).
" AND num_releve IS NOT NULL";
837 $sql .= $db->order(
"num_releve",
"DESC");
838 $sql .= $db->plimit($nbmax + 1);
840 print $langs->trans(
"LastAccountStatements").
' : ';
841 $resqlr = $db->query($sql);
843 $numr = $db->num_rows($resqlr);
846 while (($i < $numr) && ($i < $nbmax)) {
847 $objr = $db->fetch_object($resqlr);
849 $last_releve = $objr->num_releve;
853 $liste =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/releve.php?account='.$id.
'&num='.$objr->num_releve.
'">'.$objr->num_releve.
'</a> '.$liste;
855 if ($numr >= $nbmax) {
856 $liste =
"... ".$liste;
860 print
'<b>'.$langs->trans(
"None").
'</b>';
867 if (!empty($conf->global->BANK_REPORT_LAST_NUM_RELEVE)) {
869 <script type="text/javascript">
870 $("#num_releve").val("' . $last_releve.
'");
878 if (!empty($user->rights->banque->modifier) && $action ==
'addline' && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
881 print
'<table class="noborder centpercent">';
883 print
'<tr class="liste_titre">';
884 print
'<td>'.$langs->trans(
"Description").
'</td>';
885 print
'<td>'.$langs->trans(
"Date").
'</td>';
886 print
'<td> </td>';
887 print
'<td>'.$langs->trans(
"Type").
'</td>';
888 print
'<td>'.$langs->trans(
"Numero").
'</td>';
889 print
'<td class=right>'.$langs->trans(
"BankAccount").
'</td>';
890 print
'<td class=right>'.$langs->trans(
"Debit").
'</td>';
891 print
'<td class=right>'.$langs->trans(
"Credit").
'</td>';
898 print
'<td align="center"> </td>';
903 print
'<input name="label" class="flat minwidth200" type="text" value="'.GETPOST(
"label",
"alpha").
'">';
904 if (is_array($options) && count($options)) {
905 print
'<br>'.$langs->trans(
"Rubrique").
': ';
909 print
'<td class="nowrap">';
910 print
$form->selectDate(empty($dateop) ?-1 : $dateop,
'op', 0, 0, 0,
'transaction');
912 print
'<td> </td>';
913 print
'<td class="nowrap">';
917 print
'<input name="num_chq" class="flat" type="text" size="4" value="'.GETPOST(
"num_chq",
"alpha").
'">';
921 print
'<td class=right>';
922 $form->select_comptes(
GETPOST(
'add_account',
'int') ?
GETPOST(
'add_account',
'int') : $search_account,
'add_account', 0,
'', 1, ($id > 0 || !empty($ref) ?
' disabled="disabled"' :
''));
925 print
'<td class="right"><input name="adddebit" class="flat" type="text" size="4" value="'.GETPOST(
"adddebit",
"alpha").
'"></td>';
926 print
'<td class="right"><input name="addcredit" class="flat" type="text" size="4" value="'.GETPOST(
"addcredit",
"alpha").
'"></td>';
933 print
'<td class="center">';
934 print
'<input type="submit" name="save" class="button buttongen marginbottomonly button-add" value="'.$langs->trans(
"Add").
'"><br>';
935 print
'<input type="submit" name="cancel" class="button buttongen marginbottomonly button-cancel" value="'.$langs->trans(
"Cancel").
'">';
943 $urlajax = DOL_URL_ROOT.
'/core/ajax/bankconciliate.php?token='.
currentToken();
945 <script type="text/javascript">
947 $("a.ajaxforbankoperationchange").each(function(){
948 var current = $(this);
949 current.click(function()
951 var url = "'.$urlajax.
'&"+current.attr("href").split("?")[1];
952 $.get(url, function(data)
956 current.parent().parent().find(".spanforajaxedit").replaceWith(data);
971 if ($action !=
'addline' && $action !=
'reconcile') {
972 if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
973 if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
974 $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);
977 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.
newToken().
'&page='.$page.$param,
'', $user->rights->banque->modifier);
980 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.
newToken().
'&page='.$page.$param,
'', -1);
992 if ($action !=
'addline' && $action !=
'reconcile') {
993 $morehtml .= $buttonreconcile;
996 $morehtml .=
'<!-- Add New button -->'.$newcardbutton;
998 $picto =
'bank_account';
999 if ($id > 0 || !empty($ref)) {
1003 print_barre_liste($langs->trans(
"BankTransactions"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords, $picto, 0, $morehtml,
'', $limit, 0, 0, 1);
1007 $param .=
'&page='.urlencode($page);
1010 $moreforfilter =
'';
1012 $moreforfilter .=
'<div class="divsearchfield">';
1013 $moreforfilter .= $langs->trans(
'DateOperationShort');
1014 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1015 $moreforfilter .=
'<div class="nowrap inline-block">';
1016 $moreforfilter .=
$form->selectDate($search_dt_start,
'search_start_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1017 $moreforfilter .=
'</div>';
1018 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'' :
' ');
1019 $moreforfilter .=
'<div class="nowrap inline-block">';
1020 $moreforfilter .=
$form->selectDate($search_dt_end,
'search_end_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1021 $moreforfilter .=
'</div>';
1022 $moreforfilter .=
'</div>';
1024 $moreforfilter .=
'<div class="divsearchfield">';
1025 $moreforfilter .= $langs->trans(
'DateValueShort');
1026 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1027 $moreforfilter .=
'<div class="nowrap inline-block">';
1028 $moreforfilter .=
$form->selectDate($search_dv_start,
'search_start_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1029 $moreforfilter .=
'</div>';
1030 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'' :
' ');
1031 $moreforfilter .=
'<div class="nowrap inline-block">';
1032 $moreforfilter .=
$form->selectDate($search_dv_end,
'search_end_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1033 $moreforfilter .=
'</div>';
1034 $moreforfilter .=
'</div>';
1038 if (
isModEnabled(
'categorie') && !empty($user->rights->categorie->lire)) {
1039 $langs->load(
'categories');
1042 $moreforfilter .=
'<div class="divsearchfield">';
1043 $tmptitle = $langs->trans(
'RubriquesTransactions');
1044 $cate_arbo =
$form->select_all_categories(Categorie::TYPE_BANK_LINE, $search_bid,
'parent',
null,
null, 1);
1045 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$form->selectarray(
'search_bid', $cate_arbo, $search_bid, $tmptitle, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1046 $moreforfilter .=
'</div>';
1050 $parameters = array();
1051 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
1052 if (empty($reshook)) {
1053 $moreforfilter .= $hookmanager->resPrint;
1055 $moreforfilter = $hookmanager->resPrint;
1058 if ($moreforfilter) {
1059 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1060 print $moreforfilter;
1061 print
'</div>'.
"\n";
1064 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1065 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
1067 if ($action ==
'reconcile') {
1068 $arrayfields[
'b.num_releve'][
'checked'] = 1;
1071 print
'<div class="div-table-responsive">';
1072 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1075 print
'<tr class="liste_titre_filter">';
1076 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1077 print
'<td class="liste_titre">';
1078 print
'<input type="text" class="flat" name="search_ref" size="2" value="'.dol_escape_htmltag($search_ref).
'">';
1081 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1082 print
'<td class="liste_titre">';
1083 print
'<input type="text" class="flat maxwidth100" name="search_description" value="'.dol_escape_htmltag($search_description).
'">';
1086 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1087 print
'<td class="liste_titre"> </td>';
1089 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1090 print
'<td class="liste_titre"> </td>';
1092 if (!empty($arrayfields[
'type'][
'checked'])) {
1093 print
'<td class="liste_titre" align="center">';
1094 print
$form->select_types_paiements(empty($search_type) ?
'' : $search_type,
'search_type',
'', 2, 1, 1, 0, 1,
'maxwidth100', 1);
1098 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1099 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>';
1102 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1103 print
'<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty_user).
'"></td>';
1106 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1107 print
'<td class="liste_titre">';
1108 $form->select_comptes($search_account,
'search_account', 0,
'', 1, ($id > 0 || !empty($ref) ?
' disabled="disabled"' :
''), 0,
'maxwidth100');
1112 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1113 print
'<td class="liste_titre right">';
1114 print
'<input type="text" class="flat width50" name="search_debit" value="'.dol_escape_htmltag($search_debit).
'">';
1118 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1119 print
'<td class="liste_titre right">';
1120 print
'<input type="text" class="flat width50" name="search_credit" value="'.dol_escape_htmltag($search_credit).
'">';
1124 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1125 print
'<td class="liste_titre right">';
1126 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1127 print
$form->textwithpicto(
'', $htmltext, 1);
1131 if (!empty($arrayfields[
'balance'][
'checked'])) {
1132 print
'<td class="liste_titre right">';
1133 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1134 print
$form->textwithpicto(
'', $htmltext, 1);
1138 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1139 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>';
1142 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1143 print
'<td class="liste_titre center parentonrightofpage">';
1144 print
$form->selectyesno(
'search_conciliated', $search_conciliated, 1,
false, 1, 1,
'search_status onrightofpage maxwidth75');
1148 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1149 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>';
1153 print
'<td class="liste_titre" align="middle">';
1154 $searchpicto =
$form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0,
'checkforselect', 1);
1160 print
'<tr class="liste_titre">';
1161 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1162 print_liste_field_titre($arrayfields[
'b.rowid'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rowid',
'', $param,
'', $sortfield, $sortorder);
1164 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1165 print_liste_field_titre($arrayfields[
'b.label'][
'label'], $_SERVER[
'PHP_SELF'],
'b.label',
'', $param,
'', $sortfield, $sortorder);
1167 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1168 print_liste_field_titre($arrayfields[
'b.dateo'][
'label'], $_SERVER[
'PHP_SELF'],
'b.dateo',
'', $param,
'', $sortfield, $sortorder,
"center ");
1170 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1171 print_liste_field_titre($arrayfields[
'b.datev'][
'label'], $_SERVER[
'PHP_SELF'],
'b.datev,b.dateo,b.rowid',
'', $param,
'align="center"', $sortfield, $sortorder);
1173 if (!empty($arrayfields[
'type'][
'checked'])) {
1174 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'align="center"', $sortfield, $sortorder);
1176 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1177 print_liste_field_titre($arrayfields[
'b.num_chq'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_chq',
'', $param,
'', $sortfield, $sortorder,
"center ");
1179 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1180 print_liste_field_titre($arrayfields[
'bu.label'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1182 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1183 print_liste_field_titre($arrayfields[
'ba.ref'][
'label'], $_SERVER[
'PHP_SELF'],
'ba.ref',
'', $param,
'', $sortfield, $sortorder);
1185 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1186 print_liste_field_titre($arrayfields[
'b.debit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1188 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1189 print_liste_field_titre($arrayfields[
'b.credit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1191 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1192 print_liste_field_titre($arrayfields[
'balancebefore'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1194 if (!empty($arrayfields[
'balance'][
'checked'])) {
1195 print_liste_field_titre($arrayfields[
'balance'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1197 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1198 print_liste_field_titre($arrayfields[
'b.num_releve'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_releve',
'', $param,
'', $sortfield, $sortorder,
"center ");
1200 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1201 print_liste_field_titre($arrayfields[
'b.conciliated'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rappro',
'', $param,
'', $sortfield, $sortorder,
"center ");
1203 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1204 print_liste_field_titre($arrayfields[
'b.fk_bordereau'][
'label'], $_SERVER[
'PHP_SELF'],
'b.fk_bordereau',
'', $param,
'', $sortfield, $sortorder,
"center ");
1208 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1210 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
1211 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1212 print $hookmanager->resPrint;
1214 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
1219 $balancecalculated =
false;
1220 $posconciliatecol = 0;
1221 $cachebankaccount = array();
1226 while ($i < min($num, $limit)) {
1227 $objp = $db->fetch_object(
$resql);
1228 $links = $bankaccountstatic->get_url($objp->rowid);
1231 if (!$balancecalculated && (!empty($arrayfields[
'balancebefore'][
'checked']) || !empty($arrayfields[
'balance'][
'checked'])) && ($mode_balance_ok || $search_conciliated ===
'0')) {
1232 if (!$search_account) {
1233 dol_print_error(
'',
'account is not defined but $mode_balance_ok is true');
1240 $sqlforbalance =
'SELECT SUM(b.amount) as previoustotal';
1241 $sqlforbalance .=
" FROM ";
1242 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
1243 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank as b";
1244 $sqlforbalance .=
" WHERE b.fk_account = ba.rowid";
1245 $sqlforbalance .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
1246 $sqlforbalance .=
" AND b.fk_account = ".((int) $search_account);
1247 $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.
"))))";
1248 $resqlforbalance = $db->query($sqlforbalance);
1250 if ($resqlforbalance) {
1251 $objforbalance = $db->fetch_object($resqlforbalance);
1252 if ($objforbalance) {
1254 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1255 $balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount);
1258 $balance = $objforbalance->previoustotal;
1265 $balancecalculated =
true;
1268 if ($user->rights->banque->consolidate && $action ==
'reconcile') {
1269 $tmpnbfieldbeforebalance = 0;
1270 $tmpnbfieldafterbalance = 0;
1271 $balancefieldfound = 0;
1272 foreach ($arrayfields as $key => $val) {
1273 if ($key ==
'balancebefore' || $key ==
'balance') {
1274 $balancefieldfound++;
1277 if (!empty($arrayfields[$key][
'checked'])) {
1278 if (!$balancefieldfound) {
1279 $tmpnbfieldbeforebalance++;
1281 $tmpnbfieldafterbalance++;
1286 $element =
'banktransaction';
1287 if (!empty($extrafields->attributes[$element][
'label']) && is_array($extrafields->attributes[$element][
'label']) && count($extrafields->attributes[$element][
'label'])) {
1288 foreach ($extrafields->attributes[$element][
'label'] as $key => $val) {
1289 if (!empty($arrayfields[
"ef.".$key][
'checked'])) {
1290 if (!empty($arrayfields[$key][
'checked'])) {
1291 if (!$balancefieldfound) {
1292 $tmpnbfieldbeforebalance++;
1294 $tmpnbfieldafterbalance++;
1301 print
'<tr class="oddeven trforbreak">';
1302 if ($tmpnbfieldbeforebalance) {
1303 print
'<td colspan="'.$tmpnbfieldbeforebalance.
'">';
1308 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1309 print
'<td class="right">';
1310 if ($search_conciliated !==
'0') {
1315 if (!empty($arrayfields[
'balance'][
'checked'])) {
1316 print
'<td class="right">';
1317 if ($search_conciliated !==
'0') {
1322 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1323 print
'<td class="center">';
1324 print
'<input type="checkbox" id="selectAll" title="'.dol_escape_htmltag($langs->trans(
"SelectAll")).
'" />';
1325 print
' <script type="text/javascript">
1326 $("input#selectAll").change(function() {
1327 $("input[type=checkbox][name^=rowid]").prop("checked", $(this).is(":checked"));
1332 print
'<td colspan="'.($tmpnbfieldafterbalance + 1).
'">';
1339 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1340 $balance =
price2num($balancebefore,
'MT');
1341 $balancebefore =
price2num($balancebefore - ($sign * $objp->amount),
'MT');
1343 $balancebefore =
price2num($balance,
'MT');
1344 $balance =
price2num($balance + ($sign * $objp->amount),
'MT');
1347 if (empty($cachebankaccount[$objp->bankid])) {
1348 $bankaccounttmp =
new Account($db);
1349 $bankaccounttmp->fetch($objp->bankid);
1350 $cachebankaccount[$objp->bankid] = $bankaccounttmp;
1351 $bankaccount = $bankaccounttmp;
1353 $bankaccount = $cachebankaccount[$objp->bankid];
1356 if (empty($conf->global->BANK_COLORIZE_MOVEMENT)) {
1357 $backgroundcolor =
"class='oddeven'";
1359 if ($objp->amount < 0) {
1361 $backgroundcolor =
'style="background: '.$color.
';"';
1364 $backgroundcolor =
'style="background: '.$color.
';"';
1368 $banklinestatic->id = $objp->rowid;
1369 $banklinestatic->ref = $objp->rowid;
1371 print
'<tr class="oddeven" '.$backgroundcolor.
'>';
1374 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1375 print
'<td class="nowrap left">';
1376 print $banklinestatic->getNomUrl(1);
1379 $totalarray[
'nbfield']++;
1384 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1388 preg_match(
'/\((.+)\)/i', $objp->label, $reg);
1389 if (!empty($reg[1]) && $langs->trans($reg[1]) != $reg[1]) {
1390 $labeltoshow = $langs->trans($reg[1]);
1392 if ($objp->label ==
'(payment_salary)') {
1393 $labeltoshow = $langs->trans(
"SalaryPayment");
1396 $titletoshow = $objp->label;
1401 print
'<td class="tdoverflowmax250"'.($titletoshow ?
' title="'.dol_escape_htmltag($titletoshow).
'"' :
'').
'>';
1404 $cachebankaccount = array();
1405 foreach ($links as $key => $val) {
1406 print
'<!-- '.$links[$key][
'type'].
' -->';
1407 if ($links[$key][
'type'] ==
'withdraw') {
1408 $banktransferstatic->id = $links[$key][
'url_id'];
1409 $banktransferstatic->ref = $links[$key][
'label'];
1410 print $banktransferstatic->getNomUrl(0).
' ';
1411 } elseif ($links[$key][
'type'] ==
'payment') {
1412 $paymentstatic->id = $links[$key][
'url_id'];
1413 $paymentstatic->ref = $links[$key][
'url_id'];
1414 $paymentstatic->date = $db->jdate($objp->do);
1415 print $paymentstatic->getNomUrl(2).
' ';
1416 } elseif ($links[$key][
'type'] ==
'payment_supplier') {
1417 $paymentsupplierstatic->id = $links[$key][
'url_id'];
1418 $paymentsupplierstatic->ref = $links[$key][
'url_id'];
1419 print $paymentsupplierstatic->getNomUrl(2).
' ';
1420 } elseif ($links[$key][
'type'] ==
'payment_sc') {
1421 $paymentscstatic->id = $links[$key][
'url_id'];
1422 $paymentscstatic->ref = $links[$key][
'url_id'];
1423 $paymentscstatic->label = $links[$key][
'label'];
1424 print $paymentscstatic->getNomUrl(2).
' ';
1425 } elseif ($links[$key][
'type'] ==
'payment_vat') {
1426 $paymentvatstatic->id = $links[$key][
'url_id'];
1427 $paymentvatstatic->ref = $links[$key][
'url_id'];
1428 print $paymentvatstatic->getNomUrl(2).
' ';
1429 } elseif ($links[$key][
'type'] ==
'payment_salary') {
1430 $paymentsalstatic->id = $links[$key][
'url_id'];
1431 $paymentsalstatic->ref = $links[$key][
'url_id'];
1432 $paymentsalstatic->label = $links[$key][
'label'];
1433 print $paymentsalstatic->getNomUrl(2).
' ';
1434 } elseif ($links[$key][
'type'] ==
'payment_loan') {
1435 print
'<a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$links[$key][
'url_id'].
'">';
1436 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
1438 } elseif ($links[$key][
'type'] ==
'payment_donation') {
1439 $paymentdonationstatic->id = $links[$key][
'url_id'];
1440 $paymentdonationstatic->ref = $links[$key][
'url_id'];
1441 print $paymentdonationstatic->getNomUrl(2).
' ';
1442 } elseif ($links[$key][
'type'] ==
'payment_expensereport') {
1443 $paymentexpensereportstatic->id = $links[$key][
'url_id'];
1444 $paymentexpensereportstatic->ref = $links[$key][
'url_id'];
1445 print $paymentexpensereportstatic->getNomUrl(2).
' ';
1446 } elseif ($links[$key][
'type'] ==
'payment_various') {
1447 $paymentvariousstatic->id = $links[$key][
'url_id'];
1448 $paymentvariousstatic->ref = $links[$key][
'url_id'];
1449 print $paymentvariousstatic->getNomUrl(2).
' ';
1450 } elseif ($links[$key][
'type'] ==
'banktransfert') {
1452 if ($objp->amount > 0) {
1453 $banklinestatic->fetch($links[$key][
'url_id']);
1454 $bankstatic->id = $banklinestatic->fk_account;
1455 $bankstatic->label = $banklinestatic->bank_account_ref;
1456 print $langs->trans(
"TransferFrom").
' ';
1457 print $bankstatic->getNomUrl(1,
'transactions');
1458 print
' '.$langs->trans(
"toward").
' ';
1459 $bankstatic->id = $objp->bankid;
1460 $bankstatic->label = $objp->bankref;
1461 print $bankstatic->getNomUrl(1,
'');
1464 $bankstatic->id = $objp->bankid;
1465 $bankstatic->label = $objp->bankref;
1466 print $langs->trans(
"TransferFrom").
' ';
1467 print $bankstatic->getNomUrl(1,
'');
1468 print
' '.$langs->trans(
"toward").
' ';
1469 $banklinestatic->fetch($links[$key][
'url_id']);
1470 $bankstatic->id = $banklinestatic->fk_account;
1471 $bankstatic->label = $banklinestatic->bank_account_ref;
1472 print $bankstatic->getNomUrl(1,
'transactions');
1476 } elseif ($links[$key][
'type'] ==
'company') {
1477 } elseif ($links[$key][
'type'] ==
'user') {
1478 } elseif ($links[$key][
'type'] ==
'member') {
1479 } elseif ($links[$key][
'type'] ==
'sc') {
1480 } elseif ($links[$key][
'type'] ==
'vat') {
1481 } elseif ($links[$key][
'type'] ==
'salary') {
1485 print
'<a href="'.$links[$key][
'url'].$links[$key][
'url_id'].
'">';
1486 if (preg_match(
'/^\((.*)\)$/i', $links[$key][
'label'], $reg)) {
1488 if ($reg[1] ==
'paiement') {
1489 $reg[1] =
'Payment';
1491 print $langs->trans($reg[1]);
1493 print $links[$key][
'label'];
1495 print
'</a>'.($labeltoshow ?
' - ' :
'');
1503 $totalarray[
'nbfield']++;
1508 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1509 print
'<td align="center" class="nowrap">';
1510 print
'<span class="spanforajaxedit" id="dateoperation_'.$objp->rowid.
'">'.
dol_print_date($db->jdate($objp->do),
"day").
"</span>";
1512 print
'<span class="inline-block">';
1513 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=doprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1515 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=donext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1520 $totalarray[
'nbfield']++;
1525 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1526 print
'<td align="center" class="nowrap">';
1527 print
'<span class="spanforajaxedit" id="datevalue_'.$objp->rowid.
'">'.
dol_print_date($db->jdate($objp->dv),
"day").
"</span>";
1529 print
'<span class="inline-block">';
1530 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1532 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvnext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1537 $totalarray[
'nbfield']++;
1542 if (!empty($arrayfields[
'type'][
'checked'])) {
1543 print
'<td class="tdoverflowmax100 center">';
1544 $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);
1545 if ($labeltype ==
'SOLD') {
1552 $totalarray[
'nbfield']++;
1557 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1558 print
'<td class="nowrap" align="center">'.($objp->num_chq ?
dol_escape_htmltag($objp->num_chq) :
"").
"</td>\n";
1560 $totalarray[
'nbfield']++;
1565 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1566 print
'<td class="tdoverflowmax150">';
1568 $companylinked_id = 0;
1573 foreach ($links as $key => $value) {
1574 if ($links[$key][
'type'] ==
'payment_sc') {
1575 $type_link =
'payment_sc';
1577 if ($links[$key][
'type'] ==
'payment_salary') {
1578 $type_link =
'payment_salary';
1581 if ($links[$key][
'type'] ==
'company') {
1582 $companylinked_id = $links[$key][
'url_id'];
1584 if ($links[$key][
'type'] ==
'user') {
1585 $userlinked_id = $links[$key][
'url_id'];
1589 if ($companylinked_id) {
1591 $companystatic->fetch($companylinked_id);
1592 print $companystatic->getNomUrl(1);
1593 } elseif ($userlinked_id &&
1594 (($type_link ==
'payment_salary' && !empty($user->rights->salaries->read))
1595 || ($type_link ==
'payment_sc' && !empty($user->rights->tax->charges->lire)))) {
1597 if (!empty($conf->cache[
'user'][$userlinked_id])) {
1598 $tmpuser = $conf->cache[
'user'][$userlinked_id];
1600 $tmpuser =
new User($db);
1601 $tmpuser->fetch($userlinked_id);
1602 $conf->cache[
'user'][$userlinked_id] = $tmpuser;
1604 print $tmpuser->getNomUrl(1);
1611 $totalarray[
'nbfield']++;
1616 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1617 print
'<td class="nowrap">';
1618 print $bankaccount->getNomUrl(1);
1621 $totalarray[
'nbfield']++;
1626 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1627 print
'<td class="nowrap right"><span class="amount">';
1628 if ($objp->amount < 0) {
1629 print
price($objp->amount * -1);
1630 $totalarray[
'totaldeb'] += $objp->amount;
1632 print
"</span></td>\n";
1634 $totalarray[
'nbfield']++;
1637 $totalarray[
'totaldebfield'] = $totalarray[
'nbfield'];
1642 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1643 print
'<td class="nowrap right"><span class="amount">';
1644 if ($objp->amount > 0) {
1645 print
price($objp->amount);
1646 $totalarray[
'totalcred'] += $objp->amount;
1648 print
"</span></td>\n";
1650 $totalarray[
'nbfield']++;
1653 $totalarray[
'totalcredfield'] = $totalarray[
'nbfield'];
1658 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1659 if ($mode_balance_ok) {
1660 if ($balancebefore >= 0) {
1661 print
'<td class="nowrap right"> '.price($balancebefore).
'</td>';
1663 print
'<td class="error nowrap right"> '.price($balancebefore).
'</td>';
1666 print
'<td class="right">-</td>';
1669 $totalarray[
'nbfield']++;
1674 if (!empty($arrayfields[
'balance'][
'checked'])) {
1675 if ($mode_balance_ok) {
1676 if ($balance >= 0) {
1677 print
'<td class="nowrap right"> '.price($balance).
'</td>';
1679 print
'<td class="error nowrap right"> '.price($balance).
'</td>';
1682 print
'<td class="right">-</td>';
1685 $totalarray[
'nbfield']++;
1689 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1690 print
'<td class="nowraponall" align="center">';
1692 if ($bankaccount->canBeConciliated() > 0) {
1693 if ($objp->num_releve) {
1694 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>';
1696 if (!$objp->conciliated && $action ==
'reconcile') {
1697 if ($objp->num_releve) {
1700 print
'<input class="flat" name="rowid['.$objp->rowid.
']" type="checkbox" value="'.$objp->rowid.
'" size="1"'.(!empty($_POST[
'rowid'][$objp->rowid]) ?
' checked' :
'').
'>';
1705 $totalarray[
'nbfield']++;
1706 $posconciliatecol = $totalarray[
'nbfield'];
1710 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1711 print
'<td class="nowraponall" align="center">';
1712 print
yn($objp->conciliated);
1715 $totalarray[
'nbfield']++;
1719 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1720 $bordereaustatic->fetch($objp->fk_bordereau);
1721 print
'<td class="nowraponall" align="center">';
1722 print $bordereaustatic->getNomUrl();
1725 $totalarray[
'nbfield']++;
1730 $parameters=array(
'arrayfields'=>$arrayfields,
'obj'=>$objp,
'i'=>$i,
'totalarray'=>&$totalarray);
1731 $reshook=$hookmanager->executeHooks(
'printFieldListValue', $parameters, $objecttmp);
1732 print $hookmanager->resPrint;
1735 print
'<td class="nowraponall" align="center">';
1737 if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) {
1738 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.
'">';
1742 if ($user->rights->banque->modifier || $user->rights->banque->consolidate) {
1743 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.
'">';
1747 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.
'">';
1751 if ($bankaccount->canBeConciliated() > 0 && empty($objp->conciliated)) {
1752 if ($db->jdate($objp->dv) < ($now - $conf->bank->rappro->warning_delay)) {
1753 print
' '.img_warning($langs->trans(
"ReconciliationLate"));
1756 if ($user->rights->banque->modifier) {
1757 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&rowid='.$objp->rowid.
'&page='.$page.$param.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
'').
'">';
1758 print
img_delete(
'',
'class="marginleftonly"');
1764 if ($massactionbutton || $massaction) {
1766 if (in_array($obj->rowid, $arrayofselected)) {
1769 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1773 $totalarray[
'nbfield']++;
1782 if (isset($totalarray[
'totaldebfield']) || isset($totalarray[
'totalcredfield'])) {
1783 print
'<tr class="liste_total">';
1785 while ($i < $totalarray[
'nbfield']) {
1788 if ($num < $limit && empty($offset)) {
1789 print
'<td class="left">'.$langs->trans(
"Total").
'</td>';
1791 print
'<td class="left tdoverflowmax50" title="'.$langs->trans(
"Totalforthispage").
'">'.$langs->trans(
"Totalforthispage").
'</td>';
1793 } elseif ($totalarray[
'totaldebfield'] == $i) {
1794 print
'<td class="right"><span class="amount">'.price(-1 * $totalarray[
'totaldeb']).
'</span></td>';
1795 } elseif ($totalarray[
'totalcredfield'] == $i) {
1796 print
'<td class="right"><span class="amount">'.price($totalarray[
'totalcred']).
'</span></td>';
1797 } elseif ($i == $posconciliatecol) {
1798 print
'<td class="center">';
1799 if ($user->rights->banque->consolidate && $action ==
'reconcile') {
1800 print
'<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans(
"Conciliate").
'">';
1813 foreach ($arrayfields as $key => $val) {
1814 if (!empty($val[
'checked'])) {
1818 print
'<tr><td colspan="'.($colspan + 1).
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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.
const TYPE_CASH
Cash account.
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.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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.
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...
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
img_edit_add($titlealt='default', $other='')
Show logo +.
isModEnabled($module)
Is Dolibarr module enabled.
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 -.
$nbtotalofrecords
Count total nb of records.
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.