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');
83$search_dt_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_start_dtmonth',
'int'),
GETPOST(
'search_start_dtday',
'int'),
GETPOST(
'search_start_dtyear',
'int'));
85$search_dv_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_start_dvmonth',
'int'),
GETPOST(
'search_start_dvday',
'int'),
GETPOST(
'search_start_dvyear',
'int'));
87$search_thirdparty_user =
GETPOST(
"search_thirdparty",
'alpha') ?
GETPOST(
"search_thirdparty",
'alpha') :
GETPOST(
"thirdparty",
'alpha');
88$search_req_nb =
GETPOST(
"req_nb",
'alpha');
89$search_num_releve =
GETPOST(
"search_num_releve",
'alpha');
90$search_conciliated =
GETPOST(
"search_conciliated",
'int');
91$search_fk_bordereau =
GETPOST(
"search_fk_bordereau",
'int');
92$optioncss =
GETPOST(
'optioncss',
'alpha');
93$toselect =
GETPOST(
'toselect',
'array');
94$num_releve =
GETPOST(
"num_releve",
"alpha");
99$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
100$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
101$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
102$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
103$pageplusone =
GETPOST(
"pageplusone",
'int');
105 $page = $pageplusone - 1;
107if (empty($page) || $page == -1) {
110$offset = $limit * $page;
111$pageprev = $page - 1;
112$pagenext = $page + 1;
114 $sortorder =
'desc,desc,desc';
117 $sortfield =
'b.datev,b.dateo,b.rowid';
121if ($id > 0 || !empty($ref)) {
122 $result = $object->fetch($id, $ref);
123 $search_account = $object->id;
125 if (!($object->id > 0)) {
126 $langs->load(
"errors");
127 print($langs->trans(
'ErrorRecordNotFound'));
133$contextpage =
'banktransactionlist'.(empty($object->id) ?
'' :
'-'.$object->id);
135$mode_balance_ok =
false;
137if (($sortfield ==
'b.datev' || $sortfield ==
'b.datev,b.dateo,b.rowid')) {
138 $sortfield =
'b.datev,b.dateo,b.rowid';
139 if ($id > 0 || !empty($ref) || $search_account > 0) {
140 $mode_balance_ok =
true;
145$hookmanager->initHooks(array(
'banktransactionlist', $contextpage));
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)) {
233 $search_account = $object->id;
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($page);
296 $param .=
'&offset='.urlencode($offset);
299 $param .=
'&limit='.((int) $limit);
301 if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
302 $param .=
'&search_conciliated='.urlencode($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='.GETPOST(
'search_start_dtmonth',
'int').
'&search_start_dtday='.
GETPOST(
'search_start_dtday',
'int').
'&search_start_dtyear='.
GETPOST(
'search_start_dtyear',
'int');
317 $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');
320 $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');
323 $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');
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;
356 if (
GETPOST(
'add_account',
'int') > 0) {
357 $bankaccountid =
GETPOST(
'add_account',
'int');
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(
GETPOST(
"rowid",
"int"));
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($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='.urlencode($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($search_conciliated);
486if ($search_fk_bordereau > 0) {
487 $param .=
'$&search_fk_bordereau='.urlencode($search_fk_bordereau);
489if ($search_bid > 0) {
490 $param .=
'&search_bid='.urlencode($search_bid);
493 $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');
496 $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');
499 $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');
502 $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');
505 $param .=
'&req_nb='.urlencode($search_req_nb);
507if (
GETPOST(
"search_thirdparty",
'int')) {
508 $param .=
'&thirdparty='.urlencode(
GETPOST(
"search_thirdparty",
'int'));
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 foreach ($bankcateg->fetchAll() as $bankcategory) {
545 $options[$bankcategory->id] = $bankcategory->label;
550 print
dol_get_fiche_head($head,
'journal', $langs->trans(
"FinancialAccount"), 0,
'account');
552 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
554 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
563 if ($action !=
'reconcile') {
564 if ($object->canBeConciliated() > 0) {
565 $allowautomaticconciliation =
false;
566 $titletoconciliatemanual = $langs->trans(
"Conciliate");
567 $titletoconciliateauto = $langs->trans(
"Conciliate");
568 if ($allowautomaticconciliation) {
569 $titletoconciliatemanual .=
' ('.$langs->trans(
"Manual").
')';
570 $titletoconciliateauto .=
' ('.$langs->trans(
"Auto").
')';
574 if ($user->hasRight(
'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.
'">'.$titletoconciliatemanual.
'</a>';
579 $buttonreconcile =
'<a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliatemanual.
'</a>';
582 if ($allowautomaticconciliation) {
584 if ($user->hasRight(
'banque',
'consolidate')) {
586 $newparam = preg_replace(
'/search_conciliated=\d+/i',
'', $newparam);
587 $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>';
589 $buttonreconcile .=
' <a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans(
"NotEnoughPermissions").
'" href="#">'.$titletoconciliateauto.
'</a>';
596$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,";
597$sql .=
" b.fk_account, b.fk_type, b.fk_bordereau,";
598$sql .=
" ba.rowid as bankid, ba.ref as bankref";
600if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
601 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
602 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
606$parameters = array();
607$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
608$sql .= $hookmanager->resPrint;
610if ($search_bid > 0) {
611 $sql .= MAIN_DB_PREFIX.
"bank_class as l,";
613$sql .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
614$sql .=
" ".MAIN_DB_PREFIX.
"bank as b";
615if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
616 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (b.rowid = ef.fk_object)";
620$parameters = array();
621$reshook = $hookmanager->executeHooks(
'printFieldListJoin', $parameters, $object, $action);
622$sql .= $hookmanager->resPrint;
624$sql .=
" WHERE b.fk_account = ba.rowid";
625$sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
626if ($search_account > 0) {
627 $sql .=
" AND b.fk_account = ".((int) $search_account);
631 $sql .=
" AND b.dateo >= '".$db->idate($search_dt_start).
"'";
634 $sql .=
" AND b.dateo <= '".$db->idate($search_dt_end).
"'";
638 $sql .=
" AND b.datev >= '".$db->idate($search_dv_start).
"'";
641 $sql .=
" AND b.datev <= '".$db->idate($search_dv_end).
"'";
649if ($search_num_releve) {
652if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
653 $sql .=
" AND b.rappro = ".((int) $search_conciliated);
655if ($search_fk_bordereau > 0) {
656 $sql .=
" AND b.fk_bordereau = " . ((int) $search_fk_bordereau);
658if ($search_thirdparty_user) {
659 $sql.=
" AND (b.rowid IN ";
660 $sql.=
" ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url AS bu";
661 $sql.=
" JOIN ".MAIN_DB_PREFIX.
"bank AS b2 ON b2.rowid = bu.fk_bank";
662 $sql.=
" JOIN ".MAIN_DB_PREFIX.
"user AS subUser ON (bu.type = 'user' AND bu.url_id = subUser.rowid)";
663 $sql.=
" WHERE ".
natural_search(array(
"subUser.firstname",
"subUser.lastname"), $search_thirdparty_user,
'', 1).
")";
665 $sql.=
" OR b.rowid IN ";
666 $sql.=
" ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url AS bu";
667 $sql.=
" JOIN ".MAIN_DB_PREFIX.
"bank AS b2 ON b2.rowid = bu.fk_bank";
668 $sql.=
" JOIN ".MAIN_DB_PREFIX.
"societe AS subSoc ON (bu.type = 'company' AND bu.url_id = subSoc.rowid)";
669 $sql.=
" WHERE ".
natural_search(array(
"subSoc.nom"), $search_thirdparty_user,
'', 1);
672if ($search_description) {
673 $search_description_to_use = $search_description;
674 $arrayoffixedlabels = array(
676 'CustomerInvoicePayment',
'CustomerInvoicePaymentBack',
677 'SupplierInvoicePayment',
'SupplierInvoicePaymentBack',
679 'ExpenseReportPayment',
680 'SocialContributionPayment',
681 'SubscriptionPayment',
684 foreach ($arrayoffixedlabels as $keyforlabel) {
685 $translatedlabel = $langs->transnoentitiesnoconv($keyforlabel);
686 if (preg_match(
'/'.$search_description.
'/i', $translatedlabel)) {
687 $search_description_to_use .=
"|".$keyforlabel;
693if ($search_bid > 0) {
694 $sql .=
" AND b.rowid = l.lineid AND l.fk_categ = ".((int) $search_bid);
696if (!empty($search_type)) {
697 $sql .=
" AND b.fk_type = '".$db->escape($search_type).
"'";
702 $sql .=
' AND b.amount <= 0';
706 $sql .=
' AND b.amount >= 0';
709include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
712$parameters = array();
713$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
714$sql .= $hookmanager->resPrint;
716$sql .= $db->order($sortfield, $sortorder);
718$nbtotalofrecords =
'';
721 $result = $db->query($sql);
722 $nbtotalofrecords = $db->num_rows($result);
723 $nbtotalofpages = ceil($nbtotalofrecords / $limit);
726if (($id > 0 || !empty($ref)) && ((
string) $page ==
'')) {
729 $page = ($nbtotalofpages - 1);
730 $offset = $limit * $page;
735if ($page >= $nbtotalofpages) {
737 $page = ($nbtotalofpages - 1);
738 $offset = $limit * $page;
746if (empty($search_account)) {
747 $mode_balance_ok =
false;
750if (!empty($search_ref)) {
751 $mode_balance_ok =
false;
753if (!empty($search_description)) {
754 $mode_balance_ok =
false;
756if (!empty($search_type)) {
757 $mode_balance_ok =
false;
759if (!empty($search_debit)) {
760 $mode_balance_ok =
false;
762if (!empty($search_credit)) {
763 $mode_balance_ok =
false;
765if (!empty($search_thirdparty_user)) {
766 $mode_balance_ok =
false;
768if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
769 $mode_balance_ok =
false;
771if (!empty($search_num_releve)) {
772 $mode_balance_ok =
false;
774if (!empty($search_fk_bordereau)) {
775 $mode_balance_ok =
false;
778$sql .= $db->plimit($limit + 1, $offset);
780dol_syslog(
'compta/bank/bankentries_list.php', LOG_DEBUG);
781$resql = $db->query($sql);
783 $num = $db->num_rows($resql);
785 $arrayofselected = (!empty($toselect) && is_array($toselect)) ? $toselect : array();
788 $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='.
GETPOST(
"rowid",
'int'), $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="'.GETPOST(
"bid",
'int').
'">';
825 if ($user->hasRight(
'banque',
'consolidate') && $action ==
'reconcile') {
826 print
'<div class="valignmiddle inline-block" style="padding-right: 20px;">';
827 $texttoshow = $langs->trans(
"InputReceiptNumber").
': ';
828 $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);
829 $mm =
dol_substr($langs->transnoentitiesnoconv(
"Month"), 0, 1).substr($langs->transnoentitiesnoconv(
"Month"), 0, 1);
830 $dd =
dol_substr($langs->transnoentitiesnoconv(
"Day"), 0, 1).substr($langs->transnoentitiesnoconv(
"Day"), 0, 1);
831 $placeholder = $yyyy.$mm;
832 $placeholder .=
' '.$langs->trans(
"or").
' ';
833 $placeholder .= $yyyy.$mm.$dd;
835 $texttoshow .= $langs->trans(
"InputReceiptNumberBis");
838 print
'<input class="flat width175" pattern="[0-9]+" title="'.dol_escape_htmltag($texttoshow.($placeholder ?
': '.$placeholder :
'')).
'" id="num_releve" name="num_releve" placeholder="'.
dol_escape_htmltag($placeholder).
'" type="text" value="'.(
GETPOST(
'num_releve',
'int') ?
GETPOST(
'num_releve',
'int') :
'').
'">';
840 if (is_array($options) && count($options)) {
841 print $langs->trans(
"EventualyAddCategory").
': ';
844 print
'<br><div style="margin-top: 5px;"><span class="opacitymedium">'.$langs->trans(
"ThenCheckLinesAndConciliate").
'</span> ';
845 print
'<input class="button" name="confirm_savestatement" type="submit" value="'.$langs->trans(
"SaveStatementOnly").
'">';
846 print
' '.$langs->trans(
"or").
' ';
847 print
'<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans(
"Conciliate").
'">';
848 print
' '.$langs->trans(
"or").
' ';
849 print
'<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans(
"Cancel").
'">';
855 $sql =
"SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX.
"bank";
856 $sql .=
" WHERE fk_account = ".((int) $object->id).
" AND num_releve IS NOT NULL";
857 $sql .= $db->order(
"num_releve",
"DESC");
858 $sql .= $db->plimit($nbmax + 1);
860 print $langs->trans(
"LastAccountStatements").
' : ';
861 $resqlr = $db->query($sql);
863 $numr = $db->num_rows($resqlr);
866 while (($i < $numr) && ($i < $nbmax)) {
867 $objr = $db->fetch_object($resqlr);
869 $last_releve = $objr->num_releve;
873 $liste =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/releve.php?account='.$id.
'&num='.$objr->num_releve.
'">'.$objr->num_releve.
'</a> '.$liste;
875 if ($numr >= $nbmax) {
876 $liste =
"... ".$liste;
880 print
'<b>'.$langs->trans(
"None").
'</b>';
889 <script type="text/javascript">
890 $("#num_releve").val("' . $last_releve.
'");
898 if ($user->hasRight(
'banque',
'modifier') && $action ==
'addline' &&
getDolGlobalString(
'BANK_USE_OLD_VARIOUS_PAYMENT')) {
901 print
'<table class="noborder centpercent">';
903 print
'<tr class="liste_titre">';
904 print
'<td>'.$langs->trans(
"Description").
'</td>';
905 print
'<td>'.$langs->trans(
"Date").
'</td>';
906 print
'<td> </td>';
907 print
'<td>'.$langs->trans(
"Type").
'</td>';
908 print
'<td>'.$langs->trans(
"Numero").
'</td>';
909 print
'<td class=right>'.$langs->trans(
"BankAccount").
'</td>';
910 print
'<td class=right>'.$langs->trans(
"Debit").
'</td>';
911 print
'<td class=right>'.$langs->trans(
"Credit").
'</td>';
918 print
'<td align="center"> </td>';
923 print
'<input name="label" class="flat minwidth200" type="text" value="'.GETPOST(
"label",
"alpha").
'">';
924 if (is_array($options) && count($options)) {
925 print
'<br>'.$langs->trans(
"Rubrique").
': ';
929 print
'<td class="nowrap">';
930 print $form->selectDate(empty($dateop) ? -1 : $dateop,
'op', 0, 0, 0,
'transaction');
932 print
'<td> </td>';
933 print
'<td class="nowrap">';
934 $form->select_types_paiements((
GETPOST(
'operation') ?
GETPOST(
'operation') : ($object->courant ==
Account::TYPE_CASH ?
'LIQ' :
'')),
'operation',
'1,2', 2, 1);
937 print
'<input name="num_chq" class="flat" type="text" size="4" value="'.GETPOST(
"num_chq",
"alpha").
'">';
941 print
'<td class=right>';
942 $form->select_comptes(
GETPOST(
'add_account',
'int') ?
GETPOST(
'add_account',
'int') : $search_account,
'add_account', 0,
'', 1, ($id > 0 || !empty($ref) ?
' disabled="disabled"' :
''));
945 print
'<td class="right"><input name="adddebit" class="flat" type="text" size="4" value="'.GETPOST(
"adddebit",
"alpha").
'"></td>';
946 print
'<td class="right"><input name="addcredit" class="flat" type="text" size="4" value="'.GETPOST(
"addcredit",
"alpha").
'"></td>';
953 print
'<td class="center">';
954 print
'<input type="submit" name="save" class="button buttongen marginbottomonly button-add" value="'.$langs->trans(
"Add").
'"><br>';
955 print
'<input type="submit" name="cancel" class="button buttongen marginbottomonly button-cancel" value="'.$langs->trans(
"Cancel").
'">';
963 $urlajax = DOL_URL_ROOT.
'/core/ajax/bankconciliate.php?token='.
currentToken();
965 <script type="text/javascript">
967 $("a.ajaxforbankoperationchange").each(function(){
968 var current = $(this);
969 current.click(function()
971 var url = "'.$urlajax.
'&"+current.attr("href").split("?")[1];
972 $.get(url, function(data)
976 current.parent().parent().find(".spanforajaxedit").replaceWith(data);
991 if ($action !=
'addline' && $action !=
'reconcile') {
994 $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);
996 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.newToken().
'&page='.$page.$param,
'', $user->rights->banque->modifier);
999 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.newToken().
'&page='.$page.$param,
'', -1);
1011 if ($action !=
'addline' && $action !=
'reconcile') {
1012 $morehtml .= $buttonreconcile;
1015 $morehtml .=
'<!-- Add New button -->'.$newcardbutton;
1017 $picto =
'bank_account';
1018 if ($id > 0 || !empty($ref)) {
1022 print_barre_liste($langs->trans(
"BankTransactions"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml,
'', $limit, 0, 0, 1);
1026 $param .=
'&page='.urlencode($page);
1029 $moreforfilter =
'';
1031 $moreforfilter .=
'<div class="divsearchfield">';
1032 $moreforfilter .= $langs->trans(
'DateOperationShort');
1033 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1034 $moreforfilter .=
'<div class="nowrap inline-block">';
1035 $moreforfilter .= $form->selectDate($search_dt_start,
'search_start_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1036 $moreforfilter .=
'</div>';
1037 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'' :
' ');
1038 $moreforfilter .=
'<div class="nowrap inline-block">';
1039 $moreforfilter .= $form->selectDate($search_dt_end,
'search_end_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1040 $moreforfilter .=
'</div>';
1041 $moreforfilter .=
'</div>';
1043 $moreforfilter .=
'<div class="divsearchfield">';
1044 $moreforfilter .= $langs->trans(
'DateValueShort');
1045 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1046 $moreforfilter .=
'<div class="nowrap inline-block">';
1047 $moreforfilter .= $form->selectDate($search_dv_start,
'search_start_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1048 $moreforfilter .=
'</div>';
1049 $moreforfilter .= ($conf->browser->layout ==
'phone' ?
'' :
' ');
1050 $moreforfilter .=
'<div class="nowrap inline-block">';
1051 $moreforfilter .= $form->selectDate($search_dv_end,
'search_end_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1052 $moreforfilter .=
'</div>';
1053 $moreforfilter .=
'</div>';
1055 if (isModEnabled(
'categorie')) {
1057 if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire')) {
1058 $langs->load(
'categories');
1061 $moreforfilter .=
'<div class="divsearchfield">';
1062 $tmptitle = $langs->trans(
'RubriquesTransactions');
1063 $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, $search_bid,
'parent',
null,
null, 1);
1064 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$form->selectarray(
'search_bid', $cate_arbo, $search_bid, $tmptitle, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1065 $moreforfilter .=
'</div>';
1069 $parameters = array();
1070 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1071 if (empty($reshook)) {
1072 $moreforfilter .= $hookmanager->resPrint;
1074 $moreforfilter = $hookmanager->resPrint;
1077 if ($moreforfilter) {
1078 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1079 print $moreforfilter;
1080 print
'</div>'.
"\n";
1083 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1084 $selectedfields = ($mode !=
'kanban' ? $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN')) :
'');
1086 if ($action ==
'reconcile') {
1087 $arrayfields[
'b.num_releve'][
'checked'] = 1;
1090 print
'<div class="div-table-responsive">';
1091 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1095 print
'<tr class="liste_titre_filter">';
1098 print
'<td class="liste_titre valignmiddle center">';
1099 $searchpicto = $form->showFilterButtons(
'left');
1105 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1106 print
'<td class="liste_titre">';
1107 print
'<input type="text" class="flat" name="search_ref" size="2" value="'.dol_escape_htmltag($search_ref).
'">';
1110 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1111 print
'<td class="liste_titre">';
1112 print
'<input type="text" class="flat maxwidth100" name="search_description" value="'.dol_escape_htmltag($search_description).
'">';
1115 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1116 print
'<td class="liste_titre"> </td>';
1118 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1119 print
'<td class="liste_titre"> </td>';
1121 if (!empty($arrayfields[
'type'][
'checked'])) {
1122 print
'<td class="liste_titre" align="center">';
1123 print $form->select_types_paiements(empty($search_type) ?
'' : $search_type,
'search_type',
'', 2, 1, 1, 0, 1,
'maxwidth100', 1);
1127 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1128 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>';
1131 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1132 print
'<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty_user).
'"></td>';
1135 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1136 print
'<td class="liste_titre">';
1137 $form->select_comptes($search_account,
'search_account', 0,
'', 1, ($id > 0 || !empty($ref) ?
' disabled="disabled"' :
''), 0,
'maxwidth100');
1141 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1142 print
'<td class="liste_titre right">';
1143 print
'<input type="text" class="flat width50" name="search_debit" value="'.dol_escape_htmltag($search_debit).
'">';
1147 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1148 print
'<td class="liste_titre right">';
1149 print
'<input type="text" class="flat width50" name="search_credit" value="'.dol_escape_htmltag($search_credit).
'">';
1153 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1154 print
'<td class="liste_titre right">';
1155 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1156 print $form->textwithpicto(
'', $htmltext, 1);
1160 if (!empty($arrayfields[
'balance'][
'checked'])) {
1161 print
'<td class="liste_titre right">';
1162 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1163 print $form->textwithpicto(
'', $htmltext, 1);
1167 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1168 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>';
1171 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1172 print
'<td class="liste_titre center parentonrightofpage">';
1173 print $form->selectyesno(
'search_conciliated', $search_conciliated, 1,
false, 1, 1,
'search_status onrightofpage maxwidth75');
1177 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1178 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>';
1181 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1183 print
'<td class="nowraponall" align="center"></td>';
1187 print
'<td class="liste_titre valignmiddle center">';
1190 $searchpicto = $form->showFilterButtons();
1196 $totalarray = array();
1197 $totalarray[
'nbfield'] = 0;
1200 print
'<tr class="liste_titre">';
1203 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1204 $totalarray[
'nbfield']++;
1206 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1207 print_liste_field_titre($arrayfields[
'b.rowid'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rowid',
'', $param,
'', $sortfield, $sortorder);
1208 $totalarray[
'nbfield']++;
1210 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1211 print_liste_field_titre($arrayfields[
'b.label'][
'label'], $_SERVER[
'PHP_SELF'],
'b.label',
'', $param,
'', $sortfield, $sortorder);
1212 $totalarray[
'nbfield']++;
1214 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1215 print_liste_field_titre($arrayfields[
'b.dateo'][
'label'], $_SERVER[
'PHP_SELF'],
'b.dateo',
'', $param,
'', $sortfield, $sortorder,
"center ");
1216 $totalarray[
'nbfield']++;
1218 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1219 print_liste_field_titre($arrayfields[
'b.datev'][
'label'], $_SERVER[
'PHP_SELF'],
'b.datev,b.dateo,b.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1220 $totalarray[
'nbfield']++;
1222 if (!empty($arrayfields[
'type'][
'checked'])) {
1223 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
1224 $totalarray[
'nbfield']++;
1226 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1227 print_liste_field_titre($arrayfields[
'b.num_chq'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_chq',
'', $param,
'', $sortfield, $sortorder,
"center ");
1228 $totalarray[
'nbfield']++;
1230 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1231 print_liste_field_titre($arrayfields[
'bu.label'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1232 $totalarray[
'nbfield']++;
1234 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1235 print_liste_field_titre($arrayfields[
'ba.ref'][
'label'], $_SERVER[
'PHP_SELF'],
'ba.ref',
'', $param,
'', $sortfield, $sortorder);
1236 $totalarray[
'nbfield']++;
1238 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1239 print_liste_field_titre($arrayfields[
'b.debit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1240 $totalarray[
'nbfield']++;
1242 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1243 print_liste_field_titre($arrayfields[
'b.credit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1244 $totalarray[
'nbfield']++;
1246 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1247 print_liste_field_titre($arrayfields[
'balancebefore'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1248 $totalarray[
'nbfield']++;
1250 if (!empty($arrayfields[
'balance'][
'checked'])) {
1251 print_liste_field_titre($arrayfields[
'balance'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1252 $totalarray[
'nbfield']++;
1254 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1255 print_liste_field_titre($arrayfields[
'b.num_releve'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_releve',
'', $param,
'', $sortfield, $sortorder,
"center ");
1256 $totalarray[
'nbfield']++;
1258 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1259 print_liste_field_titre($arrayfields[
'b.conciliated'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rappro',
'', $param,
'', $sortfield, $sortorder,
"center ");
1260 $totalarray[
'nbfield']++;
1262 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1263 print_liste_field_titre($arrayfields[
'b.fk_bordereau'][
'label'], $_SERVER[
'PHP_SELF'],
'b.fk_bordereau',
'', $param,
'', $sortfield, $sortorder,
"center ");
1264 $totalarray[
'nbfield']++;
1268 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1270 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
1271 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1272 print $hookmanager->resPrint;
1274 print
'<td class="nowraponall" align="center"></td>';
1275 $totalarray[
'nbfield']++;
1279 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1280 $totalarray[
'nbfield']++;
1286 $balancecalculated =
false;
1287 $posconciliatecol = 0;
1288 $cachebankaccount = array();
1294 $savnbfield = $totalarray[
'nbfield'];
1295 $totalarray = array();
1296 $totalarray[
'nbfield'] = 0;
1297 $totalarray[
'totaldeb'] = 0;
1298 $totalarray[
'totalcred'] = 0;
1300 $imaxinloop = ($limit ? min($num, $limit) : $num);
1301 while ($i < $imaxinloop) {
1302 $objp = $db->fetch_object($resql);
1303 $links = $bankaccountstatic->get_url($objp->rowid);
1306 if (!$balancecalculated && (!empty($arrayfields[
'balancebefore'][
'checked']) || !empty($arrayfields[
'balance'][
'checked'])) && ($mode_balance_ok || $search_conciliated ===
'0')) {
1307 if (!$search_account) {
1308 dol_print_error(
'',
'account is not defined but $mode_balance_ok is true');
1315 $sqlforbalance =
'SELECT SUM(b.amount) as previoustotal';
1316 $sqlforbalance .=
" FROM ";
1317 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
1318 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank as b";
1319 $sqlforbalance .=
" WHERE b.fk_account = ba.rowid";
1320 $sqlforbalance .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
1321 $sqlforbalance .=
" AND b.fk_account = ".((int) $search_account);
1322 $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.
"))))";
1323 $resqlforbalance = $db->query($sqlforbalance);
1325 if ($resqlforbalance) {
1326 $objforbalance = $db->fetch_object($resqlforbalance);
1327 if ($objforbalance) {
1329 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1330 $balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount);
1333 $balance = $objforbalance->previoustotal;
1340 $balancecalculated =
true;
1343 if ($user->hasRight(
'banque',
'consolidate') && $action ==
'reconcile') {
1344 $tmpnbfieldbeforebalance = 0;
1345 $tmpnbfieldafterbalance = 0;
1346 $balancefieldfound = 0;
1347 foreach ($arrayfields as $key => $val) {
1348 if ($key ==
'balancebefore' || $key ==
'balance') {
1349 $balancefieldfound++;
1352 if (!empty($arrayfields[$key][
'checked'])) {
1353 if (!$balancefieldfound) {
1354 $tmpnbfieldbeforebalance++;
1356 $tmpnbfieldafterbalance++;
1361 $element = $extrafieldsobjectkey;
1362 if (!empty($extrafields->attributes[$element][
'label']) && is_array($extrafields->attributes[$element][
'label']) && count($extrafields->attributes[$element][
'label'])) {
1363 foreach ($extrafields->attributes[$element][
'label'] as $key => $val) {
1364 if (!empty($arrayfields[
"ef.".$key][
'checked'])) {
1365 if (!empty($arrayfields[$key][
'checked'])) {
1366 if (!$balancefieldfound) {
1367 $tmpnbfieldbeforebalance++;
1369 $tmpnbfieldafterbalance++;
1376 print
'<tr class="oddeven trforbreak">';
1381 if ($tmpnbfieldbeforebalance) {
1382 print
'<td colspan="'.$tmpnbfieldbeforebalance.
'">';
1387 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1388 print
'<td class="right">';
1389 if ($search_conciliated !==
'0') {
1394 if (!empty($arrayfields[
'balance'][
'checked'])) {
1395 print
'<td class="right">';
1396 if ($search_conciliated !==
'0') {
1401 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1402 print
'<td class="center">';
1403 print
'<input type="checkbox" id="selectAll" title="'.dol_escape_htmltag($langs->trans(
"SelectAll")).
'" />';
1404 print
' <script type="text/javascript">
1405 $("input#selectAll").change(function() {
1406 $("input[type=checkbox][name^=rowid]").prop("checked", $(this).is(":checked"));
1413 print
'<td colspan="'.($tmpnbfieldafterbalance).
'">';
1426 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1427 $balance =
price2num($balancebefore,
'MT');
1428 $balancebefore =
price2num($balancebefore - ($sign * $objp->amount),
'MT');
1430 $balancebefore =
price2num($balance,
'MT');
1431 $balance =
price2num($balance + ($sign * $objp->amount),
'MT');
1434 if (empty($cachebankaccount[$objp->bankid])) {
1435 $bankaccounttmp =
new Account($db);
1436 $bankaccounttmp->fetch($objp->bankid);
1437 $cachebankaccount[$objp->bankid] = $bankaccounttmp;
1438 $bankaccount = $bankaccounttmp;
1440 $bankaccount = $cachebankaccount[$objp->bankid];
1444 $backgroundcolor =
"class='oddeven'";
1446 if ($objp->amount < 0) {
1448 $backgroundcolor =
'style="background: '.$color.
';"';
1451 $backgroundcolor =
'style="background: '.$color.
';"';
1455 $banklinestatic->id = $objp->rowid;
1456 $banklinestatic->ref = $objp->rowid;
1458 print
'<tr class="oddeven" '.$backgroundcolor.
'>';
1463 if ($massactionbutton || $massaction) {
1465 if (in_array($obj->rowid, $arrayofselected)) {
1468 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1472 $totalarray[
'nbfield']++;
1477 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1478 print
'<td class="nowrap left">';
1479 print $banklinestatic->getNomUrl(1);
1482 $totalarray[
'nbfield']++;
1487 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1491 preg_match(
'/\((.+)\)/i', $objp->label, $reg);
1492 if (!empty($reg[1]) && $langs->trans($reg[1]) != $reg[1]) {
1494 $labeltoshow = $langs->trans($reg[1]);
1496 if ($objp->label ==
'(payment_salary)') {
1497 $labeltoshow = $langs->trans(
"SalaryPayment");
1500 $titletoshow = $objp->label;
1505 print
'<td class="tdoverflowmax250"'.($titletoshow ?
' title="'.dol_escape_htmltag($titletoshow).
'"' :
'').
'>';
1508 $cachebankaccount = array();
1509 foreach ($links as $key => $val) {
1510 print
'<!-- '.$links[$key][
'type'].
' -->';
1511 if ($links[$key][
'type'] ==
'withdraw') {
1512 $banktransferstatic->id = $links[$key][
'url_id'];
1513 $banktransferstatic->ref = $links[$key][
'label'];
1514 print $banktransferstatic->getNomUrl(0).($labeltoshow ?
' ' :
'');
1515 } elseif ($links[$key][
'type'] ==
'payment') {
1516 $paymentstatic->id = $links[$key][
'url_id'];
1517 $paymentstatic->ref = $links[$key][
'url_id'];
1518 $paymentstatic->date = $db->jdate($objp->do);
1519 print $paymentstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1520 } elseif ($links[$key][
'type'] ==
'payment_supplier') {
1521 $paymentsupplierstatic->id = $links[$key][
'url_id'];
1522 $paymentsupplierstatic->ref = $links[$key][
'url_id'];
1523 print $paymentsupplierstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1524 } elseif ($links[$key][
'type'] ==
'payment_sc') {
1525 $paymentscstatic->id = $links[$key][
'url_id'];
1526 $paymentscstatic->ref = $links[$key][
'url_id'];
1527 $paymentscstatic->label = $links[$key][
'label'];
1528 print $paymentscstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1529 } elseif ($links[$key][
'type'] ==
'payment_vat') {
1530 $paymentvatstatic->id = $links[$key][
'url_id'];
1531 $paymentvatstatic->ref = $links[$key][
'url_id'];
1532 print $paymentvatstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1533 } elseif ($links[$key][
'type'] ==
'payment_salary') {
1534 $paymentsalstatic->id = $links[$key][
'url_id'];
1535 $paymentsalstatic->ref = $links[$key][
'url_id'];
1536 $paymentsalstatic->label = $links[$key][
'label'];
1537 print $paymentsalstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1538 } elseif ($links[$key][
'type'] ==
'payment_loan') {
1539 print
'<a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$links[$key][
'url_id'].
'">';
1540 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
1541 print
'</a>'.($labeltoshow ?
' ' :
'');
1542 } elseif ($links[$key][
'type'] ==
'payment_donation') {
1543 $paymentdonationstatic->id = $links[$key][
'url_id'];
1544 $paymentdonationstatic->ref = $links[$key][
'url_id'];
1545 print $paymentdonationstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1546 } elseif ($links[$key][
'type'] ==
'payment_expensereport') {
1547 $paymentexpensereportstatic->id = $links[$key][
'url_id'];
1548 $paymentexpensereportstatic->ref = $links[$key][
'url_id'];
1549 print $paymentexpensereportstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1550 } elseif ($links[$key][
'type'] ==
'payment_various') {
1551 $paymentvariousstatic->id = $links[$key][
'url_id'];
1552 $paymentvariousstatic->ref = $links[$key][
'url_id'];
1553 print $paymentvariousstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1554 } elseif ($links[$key][
'type'] ==
'banktransfert') {
1556 if ($objp->amount > 0) {
1557 $banklinestatic->fetch($links[$key][
'url_id']);
1558 $bankstatic->id = $banklinestatic->fk_account;
1559 $bankstatic->label = $banklinestatic->bank_account_ref;
1560 print $langs->trans(
"TransferFrom").
' ';
1561 print $bankstatic->getNomUrl(1,
'transactions');
1562 print
' '.$langs->trans(
"toward").
' ';
1563 $bankstatic->id = $objp->bankid;
1564 $bankstatic->label = $objp->bankref;
1565 print $bankstatic->getNomUrl(1,
'');
1566 print($labeltoshow ?
' - ' :
'');
1568 $bankstatic->id = $objp->bankid;
1569 $bankstatic->label = $objp->bankref;
1570 print $langs->trans(
"TransferFrom").
' ';
1571 print $bankstatic->getNomUrl(1,
'');
1572 print
' '.$langs->trans(
"toward").
' ';
1573 $banklinestatic->fetch($links[$key][
'url_id']);
1574 $bankstatic->id = $banklinestatic->fk_account;
1575 $bankstatic->label = $banklinestatic->bank_account_ref;
1576 print $bankstatic->getNomUrl(1,
'transactions');
1577 print($labeltoshow ?
' - ' :
'');
1580 } elseif ($links[$key][
'type'] ==
'company') {
1581 } elseif ($links[$key][
'type'] ==
'user') {
1582 } elseif ($links[$key][
'type'] ==
'member') {
1583 } elseif ($links[$key][
'type'] ==
'sc') {
1584 } elseif ($links[$key][
'type'] ==
'vat') {
1585 } elseif ($links[$key][
'type'] ==
'salary') {
1589 print
'<a href="'.$links[$key][
'url'].$links[$key][
'url_id'].
'">';
1590 if (preg_match(
'/^\((.*)\)$/i', $links[$key][
'label'], $reg)) {
1592 if ($reg[1] ==
'paiement') {
1593 $reg[1] =
'Payment';
1595 print $langs->trans($reg[1]);
1597 print $links[$key][
'label'];
1599 print
'</a>'.($labeltoshow ?
' - ' :
'');
1607 $totalarray[
'nbfield']++;
1612 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1613 print
'<td align="center" class="nowrap">';
1614 print
'<span class="spanforajaxedit" id="dateoperation_'.$objp->rowid.
'">'.
dol_print_date($db->jdate($objp->do),
"day").
"</span>";
1616 print
'<span class="inline-block">';
1617 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=doprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1619 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=donext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1624 $totalarray[
'nbfield']++;
1629 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1630 print
'<td align="center" class="nowrap">';
1631 print
'<span class="spanforajaxedit" id="datevalue_'.$objp->rowid.
'">'.
dol_print_date($db->jdate($objp->dv),
"day").
"</span>";
1633 print
'<span class="inline-block">';
1634 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1636 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvnext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1641 $totalarray[
'nbfield']++;
1646 if (!empty($arrayfields[
'type'][
'checked'])) {
1647 print
'<td class="tdoverflowmax100">';
1648 $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);
1649 if ($labeltype ==
'SOLD') {
1656 $totalarray[
'nbfield']++;
1661 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1662 print
'<td class="nowrap" align="center">'.($objp->num_chq ?
dol_escape_htmltag($objp->num_chq) :
"").
"</td>\n";
1664 $totalarray[
'nbfield']++;
1669 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1670 print
'<td class="tdoverflowmax150">';
1672 $companylinked_id = 0;
1677 foreach ($links as $key => $value) {
1678 if ($links[$key][
'type'] ==
'payment_sc') {
1679 $type_link =
'payment_sc';
1681 if ($links[$key][
'type'] ==
'payment_salary') {
1682 $type_link =
'payment_salary';
1685 if ($links[$key][
'type'] ==
'company') {
1686 $companylinked_id = $links[$key][
'url_id'];
1688 if ($links[$key][
'type'] ==
'user') {
1689 $userlinked_id = $links[$key][
'url_id'];
1693 if ($companylinked_id) {
1695 $companystatic->fetch($companylinked_id);
1696 print $companystatic->getNomUrl(1);
1697 } elseif ($userlinked_id &&
1698 (($type_link ==
'payment_salary' && $user->hasRight(
'salaries',
'read'))
1699 || ($type_link ==
'payment_sc' && $user->hasRight(
'tax',
'charges',
'lire')))) {
1701 if (!empty($conf->cache[
'user'][$userlinked_id])) {
1702 $tmpuser = $conf->cache[
'user'][$userlinked_id];
1704 $tmpuser =
new User($db);
1705 $tmpuser->fetch($userlinked_id);
1706 $conf->cache[
'user'][$userlinked_id] = $tmpuser;
1708 print $tmpuser->getNomUrl(1);
1715 $totalarray[
'nbfield']++;
1720 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1721 print
'<td class="nowrap">';
1722 print $bankaccount->getNomUrl(1);
1725 $totalarray[
'nbfield']++;
1730 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1731 print
'<td class="nowrap right"><span class="amount">';
1732 if ($objp->amount < 0) {
1733 print
price($objp->amount * -1);
1734 $totalarray[
'totaldeb'] += $objp->amount;
1736 print
"</span></td>\n";
1738 $totalarray[
'nbfield']++;
1741 $totalarray[
'totaldebfield'] = $totalarray[
'nbfield'];
1746 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1747 print
'<td class="nowrap right"><span class="amount">';
1748 if ($objp->amount > 0) {
1749 print
price($objp->amount);
1750 $totalarray[
'totalcred'] += $objp->amount;
1752 print
"</span></td>\n";
1754 $totalarray[
'nbfield']++;
1757 $totalarray[
'totalcredfield'] = $totalarray[
'nbfield'];
1762 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1763 if ($mode_balance_ok) {
1764 if ($balancebefore >= 0) {
1765 print
'<td class="nowrap right"> '.price($balancebefore).
'</td>';
1767 print
'<td class="error nowrap right"> '.price($balancebefore).
'</td>';
1770 print
'<td class="right">-</td>';
1773 $totalarray[
'nbfield']++;
1778 if (!empty($arrayfields[
'balance'][
'checked'])) {
1779 if ($mode_balance_ok) {
1780 if ($balance >= 0) {
1781 print
'<td class="nowrap right"> '.price($balance).
'</td>';
1783 print
'<td class="error nowrap right"> '.price($balance).
'</td>';
1786 print
'<td class="right">-</td>';
1789 $totalarray[
'nbfield']++;
1793 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1794 print
'<td class="nowraponall" align="center">';
1796 if ($bankaccount->canBeConciliated() > 0) {
1797 if ($objp->num_releve) {
1798 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>';
1800 if (!$objp->conciliated && $action ==
'reconcile') {
1801 if ($objp->num_releve) {
1804 print
'<input class="flat" name="rowid['.$objp->rowid.
']" type="checkbox" value="'.$objp->rowid.
'" size="1"'.(!empty($_POST[
'rowid'][$objp->rowid]) ?
' checked' :
'').
'>';
1809 $totalarray[
'nbfield']++;
1810 $posconciliatecol = $totalarray[
'nbfield'];
1814 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1815 print
'<td class="nowraponall" align="center">';
1816 print
yn($objp->conciliated);
1819 $totalarray[
'nbfield']++;
1823 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1824 $bordereaustatic->fetch($objp->fk_bordereau);
1825 print
'<td class="nowraponall" align="center">';
1826 print $bordereaustatic->getNomUrl();
1829 $totalarray[
'nbfield']++;
1834 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1836 $parameters=array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$objp,
'i'=>$i,
'totalarray'=>&$totalarray);
1837 $reshook=$hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1838 print $hookmanager->resPrint;
1841 print
'<td class="nowraponall" align="center">';
1843 if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) {
1844 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.
'">';
1848 if ($user->hasRight(
'banque',
'modifier') || $user->hasRight(
'banque',
'consolidate')) {
1849 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.
'">';
1853 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.
'">';
1857 if ($bankaccount->canBeConciliated() > 0 && empty($objp->conciliated)) {
1858 if ($db->jdate($objp->dv) < ($now - $conf->bank->rappro->warning_delay)) {
1859 print
' '.img_warning($langs->trans(
"ReconciliationLate"));
1862 if ($user->hasRight(
'banque',
'modifier')) {
1863 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.newToken().
'&rowid='.$objp->rowid.
'&page='.$page.$param.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
'').
'">';
1864 print
img_delete(
'',
'class="marginleftonly"');
1870 $totalarray[
'nbfield']++;
1876 if ($massactionbutton || $massaction) {
1878 if (in_array($objp->rowid, $arrayofselected)) {
1881 print
'<input id="cb'.$objp->rowid.
'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$objp->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1885 $totalarray[
'nbfield']++;
1895 if (isset($totalarray[
'totaldebfield']) || isset($totalarray[
'totalcredfield'])) {
1896 print
'<tr class="liste_total">';
1898 while ($i < $totalarray[
'nbfield']) {
1901 if ($num < $limit && empty($offset)) {
1902 print
'<td class="left">'.$langs->trans(
"Total").
'</td>';
1904 print
'<td class="left tdoverflowmax50" title="'.$langs->trans(
"Totalforthispage").
'">'.$langs->trans(
"Totalforthispage").
'</td>';
1906 } elseif ($totalarray[
'totaldebfield'] == $i) {
1907 print
'<td class="right"><span class="amount">'.price(-1 * $totalarray[
'totaldeb']).
'</span></td>';
1908 } elseif ($totalarray[
'totalcredfield'] == $i) {
1909 print
'<td class="right"><span class="amount">'.price($totalarray[
'totalcred']).
'</span></td>';
1910 } elseif ($i == $posconciliatecol) {
1911 print
'<td class="center">';
1912 if ($user->hasRight(
'banque',
'consolidate') && $action ==
'reconcile') {
1913 print
'<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans(
"Conciliate").
'">';
1926 foreach ($arrayfields as $key => $val) {
1927 if (!empty($val[
'checked'])) {
1931 print
'<tr><td colspan="'.($colspan + 1).
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
bank_prepare_head(Account $object)
Prepare array with list of tabs.
Class to manage bank accounts.
Class to manage bank transaction lines.
Class to manage members of a foundation.
Class to manage bank categories.
Class to manage withdrawal receipts.
Classe permettant la gestion des paiements des charges La tva collectee n'est calculee que sur les fa...
Class to manage donations.
Class to manage payments for supplier invoices.
Class to manage payments of customer invoices.
Class to manage payments of donations.
Class to manage payments of expense report.
Class to manage payments of salaries.
Class to manage payments of social contributions.
Class to manage payments of social contributions.
Class to manage various payments.
Class to manage cheque delivery receipts.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
currentToken()
Return the value of token currently saved into session with name 'token'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
img_view($titlealt='default', $float=0, $other='class="valignmiddle"')
Show logo view card.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_edit_add($titlealt='default', $other='')
Show logo +.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
img_edit_remove($titlealt='default', $other='')
Show logo -.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.