36require
'../../main.inc.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/paymentvat.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/paymentsocialcontribution.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/tva.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
53require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
54require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
55require_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
56require_once DOL_DOCUMENT_ROOT.
'/don/class/paymentdonation.class.php';
57require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/paymentexpensereport.class.php';
58require_once DOL_DOCUMENT_ROOT.
'/loan/class/loan.class.php';
59require_once DOL_DOCUMENT_ROOT.
'/fourn/class/paiementfourn.class.php';
60require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
71$langs->loadLangs(array(
"banks",
"bills",
"categories",
"companies",
"margins",
"salaries",
"loan",
"donations",
"trips",
"members",
"compta",
"accountancy"));
75$action =
GETPOST(
'action',
'aZ09');
76$cancel =
GETPOST(
'cancel',
'alpha');
77$confirm =
GETPOST(
'confirm',
'alpha');
78$contextpage =
'bankentrieslist';
79$massaction =
GETPOST(
'massaction',
'alpha');
80$optioncss =
GETPOST(
'optioncss',
'aZ09');
84$search_debit =
GETPOST(
"search_debit",
'alpha');
85$search_credit =
GETPOST(
"search_credit",
'alpha');
86$search_type =
GETPOST(
"search_type",
'alpha');
87$search_account =
GETPOST(
"search_account",
'int') ?
GETPOST(
"search_account",
'int') :
GETPOST(
"account",
'int');
88$search_accountancy_code =
GETPOST(
'search_accountancy_code',
'alpha') ?
GETPOST(
'search_accountancy_code',
'alpha') :
GETPOST(
'accountancy_code',
'alpha');
90$search_ref =
GETPOST(
'search_ref',
'alpha');
91$search_description =
GETPOST(
"search_description",
'alpha');
96$search_thirdparty_user =
GETPOST(
"search_thirdparty",
'alpha') ?
GETPOST(
"search_thirdparty",
'alpha') :
GETPOST(
"thirdparty",
'alpha');
97$search_req_nb =
GETPOST(
"req_nb",
'alpha');
98$search_num_releve =
GETPOST(
"search_num_releve",
'alpha');
99$search_conciliated =
GETPOST(
"search_conciliated",
'int');
100$search_fk_bordereau =
GETPOST(
"search_fk_bordereau",
'int');
101$optioncss =
GETPOST(
'optioncss',
'alpha');
102$toselect =
GETPOST(
'toselect',
'array');
103$num_releve =
GETPOST(
"num_releve",
"alpha");
109$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
110$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
112if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
116$offset = $limit * $page;
117$pageprev = $page - 1;
118$pagenext = $page + 1;
120 $sortorder =
'desc,desc,desc';
123 $sortfield =
'b.datev,b.dateo,b.rowid';
127if ($id > 0 || !empty($ref)) {
128 $result =
$object->fetch($id, $ref);
132 $langs->load(
"errors");
133 print($langs->trans(
'ErrorRecordNotFound'));
139$contextpage =
'banktransactionlist'.(empty(
$object->id) ?
'' :
'-'.$object->id);
141$mode_balance_ok =
false;
143if (($sortfield ==
'b.datev' || $sortfield ==
'b.datev,b.dateo,b.rowid')) {
144 $sortfield =
'b.datev,b.dateo,b.rowid';
145 if ($id > 0 || !empty($ref) || $search_account > 0) {
146 $mode_balance_ok =
true;
151$hookmanager->initHooks(array(
'banktransactionlist', $contextpage));
154$extrafieldsobjectkey =
'bank';
157$extrafields->fetch_name_optionals_label($extrafieldsobjectkey);
158$search_array_options = $extrafields->getOptionalsFromPost($extrafieldsobjectkey,
'',
'search_');
161 'b.rowid' => array(
'label' => $langs->trans(
"Ref"),
'checked' => 1,
'position' => 10),
162 'b.label' => array(
'label' => $langs->trans(
"Description"),
'checked' => 1,
'position' => 20),
163 'b.dateo' => array(
'label' => $langs->trans(
"DateOperationShort"),
'checked' => -1,
'position' => 30),
164 'b.datev' => array(
'label' => $langs->trans(
"DateValueShort"),
'checked' => 1,
'position' => 40),
165 'type' => array(
'label' => $langs->trans(
"Type"),
'checked' => 1,
'position' => 50),
166 'b.num_chq' => array(
'label' => $langs->trans(
"Numero"),
'checked' => 0,
'position' => 60),
167 'b.fk_bordereau' => array(
'label' => $langs->trans(
"ChequeNumber"),
'checked' => 0,
'position' => 65),
168 'bu.label' => array(
'label' => $langs->trans(
"ThirdParty").
'/'.$langs->trans(
"User"),
'checked' => 1,
'position' => 70),
169 'ba.ref' => array(
'label' => $langs->trans(
"BankAccount"),
'checked' => (($id > 0 || !empty($ref)) ? 0 : 1),
'position' => 80),
170 'b.debit' => array(
'label' => $langs->trans(
"Debit"),
'checked' => 1,
'position' => 90),
171 'b.credit' => array(
'label' => $langs->trans(
"Credit"),
'checked' => 1,
'position' => 100),
172 'balancebefore' => array(
'label' => $langs->trans(
"BalanceBefore"),
'checked' => 0,
'position' => 110),
173 'balance' => array(
'label' => $langs->trans(
"Balance"),
'checked' => 1,
'position' => 120),
174 'b.num_releve' => array(
'label' => $langs->trans(
"AccountStatement"),
'checked' => 1,
'position' => 130),
175 'b.conciliated' => array(
'label' => $langs->trans(
"BankLineReconciled"),
'enabled' =>
$object->rappro,
'checked' => ($action ==
'reconcile' ? 1 : 0),
'position' => 140),
178include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
184$fieldvalue = (!empty($id) ?
$id : (!empty($ref) ? $ref :
''));
185$fieldtype = (!empty($ref) ?
'ref' :
'rowid');
188 $socid = $user->socid;
190 $result =
restrictedArea($user,
'banque', $fieldvalue,
'bank_account&bank_account',
'',
'', $fieldtype);
193 $socid = $user->socid;
203if (
GETPOST(
'cancel',
'alpha')) {
207if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
211$parameters = array();
212$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
217include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
219if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
220 $search_dt_start =
'';
222 $search_dv_start =
'';
230 $search_description =
'';
231 $search_thirdparty_user =
'';
232 $search_num_releve =
'';
233 $search_conciliated =
'';
234 $search_fk_bordereau =
'';
237 $search_account =
"";
238 if ($id > 0 || !empty($ref)) {
243if (empty($reshook)) {
244 $objectclass =
'Account';
245 $objectlabel =
'BankTransaction';
246 $permissiontoread = $user->hasRight(
'banque',
'lire');
247 $permissiontodelete = $user->hasRight(
'banque',
'modifier');
248 $uploaddir =
$conf->bank->dir_output;
249 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
252$rowids =
GETPOST(
'rowid',
'array');
255if ((
GETPOST(
'confirm_savestatement',
'alpha') ||
GETPOST(
'confirm_reconcile',
'alpha'))
256 && (
GETPOST(
"num_releve",
"alpha") || !empty($rowids))
257 && $user->hasRight(
'banque',
'consolidate')
258 && (!GETPOSTISSET(
'pageplusone') || (
GETPOST(
'pageplusone') ==
GETPOST(
'pageplusoneold')))) {
262 $num_releve =
GETPOST(
"num_releve",
"alpha");
267 $rowids =
GETPOST(
'rowid',
'array');
269 if (!empty($rowids) && is_array($rowids)) {
270 foreach ($rowids as $row) {
272 $result = $bankline->fetch($row);
273 $bankline->num_releve = $num_releve;
274 $result = $bankline->update_conciliation($user,
GETPOST(
"cat"),
GETPOST(
'confirm_reconcile',
'alpha') ? 1 : 0);
282 if (!$error && count($rowids) > 0) {
283 setEventMessages($langs->trans(
"XNewLinesConciliated", count($rowids)),
null);
287 $langs->load(
"errors");
292 $langs->load(
"errors");
293 setEventMessages($langs->trans(
"ErrorPleaseTypeBankTransactionReportName"),
null,
'errors');
297 $param =
'action=reconcile&contextpage=banktransactionlist&id='.((int)
$object->id).
'&search_account='.((int)
$object->id);
299 $param .=
'&page='.urlencode((
string) ($page));
302 $param .=
'&offset='.urlencode((
string) ($offset));
305 $param .=
'&limit='.((int) $limit);
307 if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
308 $param .=
'&search_conciliated='.urlencode((
string) ($search_conciliated));
310 if ($search_thirdparty_user) {
311 $param .=
'&search_thirdparty='.urlencode($search_thirdparty_user);
313 if ($search_num_releve) {
314 $param .=
'&search_num_releve='.urlencode($search_num_releve);
316 if ($search_description) {
317 $param .=
'&search_description='.urlencode($search_description);
320 $param .=
'&search_start_dtmonth='.GETPOSTINT(
'search_start_dtmonth').
'&search_start_dtday='.
GETPOSTINT(
'search_start_dtday').
'&search_start_dtyear='.
GETPOSTINT(
'search_start_dtyear');
323 $param .=
'&search_end_dtmonth='.GETPOSTINT(
'search_end_dtmonth').
'&search_end_dtday='.
GETPOSTINT(
'search_end_dtday').
'&search_end_dtyear='.
GETPOSTINT(
'search_end_dtyear');
326 $param .=
'&search_start_dvmonth='.GETPOSTINT(
'search_start_dvmonth').
'&search_start_dvday='.
GETPOSTINT(
'search_start_dvday').
'&search_start_dvyear='.
GETPOSTINT(
'search_start_dvyear');
329 $param .=
'&search_end_dvmonth='.GETPOSTINT(
'search_end_dvmonth').
'&search_end_dvday='.
GETPOSTINT(
'search_end_dvday').
'&search_end_dvyear='.
GETPOSTINT(
'search_end_dvyear');
332 $param .=
'&search_type='.urlencode($search_type);
335 $param .=
'&search_debit='.urlencode($search_debit);
337 if ($search_credit) {
338 $param .=
'&search_credit='.urlencode($search_credit);
340 $param .=
'&sortfield='.urlencode($sortfield).
'&sortorder='.urlencode($sortorder);
341 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?'.$param);
347if (
GETPOST(
'save') && !$cancel && $user->hasRight(
'banque',
'modifier')) {
356 $operation =
GETPOST(
"operation",
'alpha');
357 $num_chq =
GETPOST(
"num_chq",
'alpha');
358 $label =
GETPOST(
"label",
'alpha');
359 $cat1 =
GETPOST(
"cat1",
'alpha');
361 $bankaccountid =
$id;
367 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Date")),
null,
'errors');
371 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
375 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Label")),
null,
'errors');
379 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Amount")),
null,
'errors');
381 if (!($bankaccountid > 0)) {
383 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"BankAccount")),
null,
'errors');
393 $objecttmp->fetch($bankaccountid);
394 $insertid = $objecttmp->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user,
'',
'', $search_accountancy_code);
397 header(
"Location: ".$_SERVER[
'PHP_SELF'].($id ?
"?id=".$id :
''));
407if ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->hasRight(
'banque',
'modifier')) {
409 $result = $accline->fetch(
GETPOSTINT(
"rowid"));
410 $result = $accline->delete($user);
422$form =
new Form($db);
426$companystatic =
new Societe($db);
427$bankaccountstatic =
new Account($db);
428$userstatic =
new User($db);
431$societestatic =
new Societe($db);
432$userstatic =
new User($db);
434$loanstatic =
new Loan($db);
436$donstatic =
new Don($db);
453if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
454 $param .=
'&contextpage='.urlencode($contextpage);
456if ($limit > 0 && $limit !=
$conf->liste_limit) {
457 $param .=
'&limit='.((int) $limit);
460 $param .=
'&id='.urlencode((
string) (
$id));
463 $param .=
'&ref='.urlencode($ref);
465if (!empty($search_ref)) {
466 $param .=
'&search_ref='.urlencode($search_ref);
468if (!empty($search_description)) {
469 $param .=
'&search_description='.urlencode($search_description);
471if (!empty($search_type)) {
472 $param .=
'&type='.urlencode($search_type);
474if (!empty($search_thirdparty_user)) {
475 $param .=
'&search_thirdparty='.urlencode($search_thirdparty_user);
477if (!empty($search_debit)) {
478 $param .=
'&search_debit='.urlencode($search_debit);
480if (!empty($search_credit)) {
481 $param .=
'&search_credit='.urlencode($search_credit);
483if ($search_account > 0) {
484 $param .=
'&search_account='.((int) $search_account);
486if (!empty($search_num_releve)) {
487 $param .=
'&search_num_releve='.urlencode($search_num_releve);
489if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
490 $param .=
'&search_conciliated='.urlencode((
string) ($search_conciliated));
492if ($search_fk_bordereau > 0) {
493 $param .=
'$&search_fk_bordereau='.urlencode((
string) ($search_fk_bordereau));
495if ($search_bid > 0) {
496 $param .=
'&search_bid='.((int) $search_bid);
499 $param .=
'&search_start_dtmonth='.GETPOSTINT(
'search_start_dtmonth').
'&search_start_dtday='.
GETPOSTINT(
'search_start_dtday').
'&search_start_dtyear='.
GETPOSTINT(
'search_start_dtyear');
502 $param .=
'&search_end_dtmonth='.GETPOSTINT(
'search_end_dtmonth').
'&search_end_dtday='.
GETPOSTINT(
'search_end_dtday').
'&search_end_dtyear='.
GETPOSTINT(
'search_end_dtyear');
505 $param .=
'&search_start_dvmonth='.GETPOSTINT(
'search_start_dvmonth').
'&search_start_dvday='.
GETPOSTINT(
'search_start_dvday').
'&search_start_dvyear='.
GETPOSTINT(
'search_start_dvyear');
508 $param .=
'&search_end_dvmonth='.GETPOSTINT(
'search_end_dvmonth').
'&search_end_dvday='.
GETPOSTINT(
'search_end_dvday').
'&search_end_dvyear='.
GETPOSTINT(
'search_end_dvyear');
511 $param .=
'&req_nb='.urlencode($search_req_nb);
514 $param .=
'&thirdparty='.urlencode((
string) (
GETPOSTINT(
"search_thirdparty")));
516if ($optioncss !=
'') {
517 $param .=
'&optioncss='.urlencode($optioncss);
519if ($action ==
'reconcile') {
520 $param .=
'&action=reconcile';
528include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
532$buttonreconcile =
'';
535if ($id > 0 || !empty($ref)) {
536 $title =
$object->ref.
' - '.$langs->trans(
"Transactions");
538 $title = $langs->trans(
"BankTransactions");
542llxHeader(
'', $title, $help_url,
'', 0, 0, array(), array(), $param);
545if ($id > 0 || !empty($ref)) {
547 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
550 $arrayofbankcateg = $bankcateg->fetchAll();
551 foreach ($arrayofbankcateg as $bankcategory) {
552 $options[$bankcategory->id] = $bankcategory->label;
557 $activetab =
'journal';
558 if ($action ==
'reconcile') {
559 $activetab =
'reconcile';
561 print
dol_get_fiche_head($head, $activetab, $langs->trans(
"FinancialAccount"), 0,
'account');
563 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
565 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
608$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,";
609$sql .=
" b.fk_account, b.fk_type, b.fk_bordereau,";
610$sql .=
" ba.rowid as bankid, ba.ref as bankref";
612if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
613 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
614 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
618$parameters = array();
619$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
620$sql .= $hookmanager->resPrint;
622if ($search_bid > 0) {
623 $sql .= MAIN_DB_PREFIX.
"category_bankline as l,";
625$sql .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
626$sql .=
" ".MAIN_DB_PREFIX.
"bank as b";
627if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
628 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (b.rowid = ef.fk_object)";
632$parameters = array();
633$reshook = $hookmanager->executeHooks(
'printFieldListJoin', $parameters, $object, $action);
634$sql .= $hookmanager->resPrint;
636$sql .=
" WHERE b.fk_account = ba.rowid";
637$sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
638if ($search_account > 0) {
639 $sql .=
" AND b.fk_account = ".((int) $search_account);
643 $sql .=
" AND b.dateo >= '".$db->idate($search_dt_start).
"'";
646 $sql .=
" AND b.dateo <= '".$db->idate($search_dt_end).
"'";
650 $sql .=
" AND b.datev >= '".$db->idate($search_dv_start).
"'";
653 $sql .=
" AND b.datev <= '".$db->idate($search_dv_end).
"'";
661if ($search_num_releve) {
664if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
665 $sql .=
" AND b.rappro = ".((int) $search_conciliated);
667if ($search_fk_bordereau > 0) {
668 $sql .=
" AND b.fk_bordereau = " . ((int) $search_fk_bordereau);
670if ($search_thirdparty_user) {
671 $sql .=
" AND (b.rowid IN ";
672 $sql .=
" ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url AS bu";
673 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"bank AS b2 ON b2.rowid = bu.fk_bank";
674 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"user AS subUser ON (bu.type = 'user' AND bu.url_id = subUser.rowid)";
675 $sql .=
" WHERE ".
natural_search(array(
"subUser.firstname",
"subUser.lastname"), $search_thirdparty_user, 0, 1).
")";
677 $sql .=
" OR b.rowid IN ";
678 $sql .=
" ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url AS bu";
679 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"bank AS b2 ON b2.rowid = bu.fk_bank";
680 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"societe AS subSoc ON (bu.type = 'company' AND bu.url_id = subSoc.rowid)";
681 $sql .=
" WHERE ".
natural_search(array(
"subSoc.nom"), $search_thirdparty_user, 0, 1);
684if ($search_description) {
685 $search_description_to_use = $search_description;
686 $arrayoffixedlabels = array(
688 'CustomerInvoicePayment',
689 'CustomerInvoicePaymentBack',
690 'SupplierInvoicePayment',
691 'SupplierInvoicePaymentBack',
693 'ExpenseReportPayment',
694 'SocialContributionPayment',
695 'SubscriptionPayment',
698 foreach ($arrayoffixedlabels as $keyforlabel) {
699 $translatedlabel = $langs->transnoentitiesnoconv($keyforlabel);
700 if (preg_match(
'/'.$search_description.
'/i', $translatedlabel)) {
701 $search_description_to_use .=
"|".$keyforlabel;
707if ($search_bid > 0) {
708 $sql .=
" AND b.rowid = l.lineid AND l.fk_categ = ".((int) $search_bid);
710if (!empty($search_type)) {
711 $sql .=
" AND b.fk_type = '".$db->escape($search_type).
"'";
716 $sql .=
' AND b.amount <= 0';
720 $sql .=
' AND b.amount >= 0';
723include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
726$parameters = array();
727$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
728$sql .= $hookmanager->resPrint;
730$sql .= $db->order($sortfield, $sortorder);
732$nbtotalofrecords =
'';
735 $result = $db->query($sql);
736 $nbtotalofrecords = $db->num_rows($result);
737 $nbtotalofpages = ceil($nbtotalofrecords / $limit);
740if (($id > 0 || !empty($ref)) && ((
string) $page ==
'')) {
743 $page = ($nbtotalofpages - 1);
744 $offset = $limit * $page;
749if ($page >= $nbtotalofpages) {
751 $page = ($nbtotalofpages - 1);
752 $offset = $limit * $page;
760if (empty($search_account)) {
761 $mode_balance_ok =
false;
764if (!empty($search_ref)) {
765 $mode_balance_ok =
false;
767if (!empty($search_description)) {
768 $mode_balance_ok =
false;
770if (!empty($search_type)) {
771 $mode_balance_ok =
false;
773if (!empty($search_debit)) {
774 $mode_balance_ok =
false;
776if (!empty($search_credit)) {
777 $mode_balance_ok =
false;
779if (!empty($search_thirdparty_user)) {
780 $mode_balance_ok =
false;
782if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
783 $mode_balance_ok =
false;
785if (!empty($search_num_releve)) {
786 $mode_balance_ok =
false;
788if (!empty($search_fk_bordereau)) {
789 $mode_balance_ok =
false;
792$sql .= $db->plimit($limit + 1, $offset);
794dol_syslog(
'compta/bank/bankentries_list.php', LOG_DEBUG);
795$resql = $db->query($sql);
797 $num = $db->num_rows($resql);
799 $arrayofselected = (!empty($toselect) && is_array($toselect)) ? $toselect : array();
802 $arrayofmassactions = array(
806 if (in_array($massaction, array(
'presend',
'predelete'))) {
807 $arrayofmassactions = array();
809 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
812 if ($action ==
'delete') {
813 $text = $langs->trans(
'ConfirmDeleteTransaction');
814 print $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&rowid='.
GETPOSTINT(
"rowid"), $langs->trans(
'DeleteTransaction'), $text,
'confirm_delete',
null,
'', 1);
818 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'" name="search_form">'.
"\n";
819 if ($optioncss !=
'') {
820 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
822 print
'<input type="hidden" name="token" value="'.newToken().
'">';
823 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
824 print
'<input type="hidden" name="action" value="'.($action !=
'delete' ? $action :
'search').
'">';
826 print
'<input type="hidden" name="view" value="'.dol_escape_htmltag($view).
'">';
828 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
829 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
830 print
'<input type="hidden" name="page" value="'.$page.
'">';
831 print
'<input type="hidden" name="id" value="'.$id.
'">';
832 print
'<input type="hidden" name="ref" value="'.$ref.
'">';
834 print
'<input type="hidden" name="bid" value="'.GETPOSTINT(
"bid").
'">';
838 if ($user->hasRight(
'banque',
'modifier') && $action ==
'addline' &&
getDolGlobalString(
'BANK_USE_OLD_VARIOUS_PAYMENT')) {
841 print
'<table class="noborder centpercent">';
843 print
'<tr class="liste_titre">';
844 print
'<td>'.$langs->trans(
"Description").
'</td>';
845 print
'<td>'.$langs->trans(
"Date").
'</td>';
846 print
'<td> </td>';
847 print
'<td>'.$langs->trans(
"Type").
'</td>';
848 print
'<td>'.$langs->trans(
"Numero").
'</td>';
849 print
'<td class=right>'.$langs->trans(
"BankAccount").
'</td>';
850 print
'<td class=right>'.$langs->trans(
"Debit").
'</td>';
851 print
'<td class=right>'.$langs->trans(
"Credit").
'</td>';
858 print
'<td class="center"> </td>';
863 print
'<input name="label" class="flat minwidth200" type="text" value="'.GETPOST(
"label",
"alpha").
'">';
864 if (is_array($options) && count($options)) {
865 print
'<br>'.$langs->trans(
"Rubrique").
': ';
869 print
'<td class="nowrap">';
870 print $form->selectDate(empty($dateop) ? -1 : $dateop,
'op', 0, 0, 0,
'transaction');
872 print
'<td> </td>';
873 print
'<td class="nowrap">';
874 $form->select_types_paiements((
GETPOST(
'operation') ?
GETPOST(
'operation') : (
$object->
type ==
Account::TYPE_CASH ?
'LIQ' :
'')),
'operation',
'1,2', 2, 1);
877 print
'<input name="num_chq" class="flat" type="text" size="4" value="'.GETPOST(
"num_chq",
"alpha").
'">';
881 print
'<td class=right>';
882 $form->select_comptes(
GETPOSTINT(
'add_account') ?
GETPOSTINT(
'add_account') : $search_account,
'add_account', 0,
'', 1, (
$id > 0 || !empty($ref) ?
' disabled="disabled"' :
''));
885 print
'<td class="right"><input name="adddebit" class="flat" type="text" size="4" value="'.GETPOST(
"adddebit",
"alpha").
'"></td>';
886 print
'<td class="right"><input name="addcredit" class="flat" type="text" size="4" value="'.GETPOST(
"addcredit",
"alpha").
'"></td>';
893 print
'<td class="center">';
894 print
'<input type="submit" name="save" class="button buttongen marginbottomonly button-add" value="'.$langs->trans(
"Add").
'"><br>';
895 print
'<input type="submit" name="cancel" class="button buttongen marginbottomonly button-cancel" value="'.$langs->trans(
"Cancel").
'">';
903 $urlajax = DOL_URL_ROOT.
'/core/ajax/bankconciliate.php?token='.
currentToken();
905 <script type="text/javascript">
907 $("a.ajaxforbankoperationchange").each(function(){
908 var current = $(this);
909 current.click(function()
911 var url = "'.$urlajax.
'&"+current.attr("href").split("?")[1];
912 $.get(url, function(data)
916 current.parent().parent().find(".spanforajaxedit").replaceWith(data);
931 if ($action !=
'addline') {
933 if (
$object->status == $object::STATUS_CLOSED) {
934 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'Bank account is closed',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.
newToken().
'&page='.$page.$param,
'', -2);
937 $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);
939 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.
newToken().
'&page='.$page.$param,
'', $user->rights->banque->modifier);
943 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'Direct input in bank lines has been disabled by option BANK_DISABLE_DIRECT_INPUT',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.
newToken().
'&page='.$page.$param,
'', -2);
955 if ($action !=
'addline' && $action !=
'reconcile') {
956 $morehtml .= $buttonreconcile;
959 $morehtmlright =
'<!-- Add New button -->'.$newcardbutton;
961 $picto =
'bank_account';
962 if ($id > 0 || !empty($ref)) {
967 print_barre_liste($langs->trans(
"BankTransactions"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton.$morehtml, $num, $nbtotalofrecords, $picto, 0, $morehtmlright,
'', $limit, 0, 0, 1);
970 if ($user->hasRight(
'banque',
'consolidate') && $action ==
'reconcile') {
973 $listoflastreceipts =
'';
974 $sql =
"SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX.
"bank";
975 $sql .=
" WHERE fk_account = ".((int)
$object->id).
" AND num_releve IS NOT NULL";
976 $sql .= $db->order(
"num_releve",
"DESC");
977 $sql .= $db->plimit($nbmax + 1);
979 $last_receipts = array();
984 $resqlr = $db->query($sql);
987 $numr = $db->num_rows($resqlr);
988 while (($i < $numr) && ($i < $nbmax)) {
989 $objr = $db->fetch_object($resqlr);
991 $last_receipts[] = $objr->num_releve;
993 $last_releve = $objr->num_releve;
1001 print
'<!-- form with reconciliation input -->'.
"\n";
1002 print
'<div class="valignmiddle inline-block" style="padding-right: 20px;">';
1004 print
'<strong>'.$langs->trans(
"InputReceiptNumber").
'</strong>: ';
1005 print
'<input class="flat width100 center" id="num_releve" list="num_releve_list" name="num_releve" type="text" value="'.(GETPOST(
'num_releve') ?
GETPOST(
'num_releve') :
'').
'">';
1007 $texttoshow = $langs->trans(
"InputReceiptNumber").
': ';
1008 $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);
1009 $mm =
dol_substr($langs->transnoentitiesnoconv(
"Month"), 0, 1).substr($langs->transnoentitiesnoconv(
"Month"), 0, 1);
1010 $dd =
dol_substr($langs->transnoentitiesnoconv(
"Day"), 0, 1).substr($langs->transnoentitiesnoconv(
"Day"), 0, 1);
1011 $placeholder = $yyyy.$mm;
1012 $placeholder2 = $yyyy.$mm;
1013 $placeholder2 .=
' '.$langs->trans(
"or").
' ';
1014 $placeholder2 .= $yyyy.$mm.$dd;
1015 if (!$placeholder) {
1016 $texttoshow .= $langs->trans(
"InputReceiptNumberBis");
1019 print
'<input class="flat width100 center" pattern="[0-9]+" title="'.dol_escape_htmltag($texttoshow.
': '.$placeholder2).
'" id="num_releve" list="num_releve_list" name="num_releve" placeholder="'.
dol_escape_htmltag($placeholder).
'" type="text" value="'.(
GETPOSTINT(
'num_releve') ?
GETPOSTINT(
'num_releve') :
'').
'">';
1023 if (!empty($last_receipts)) {
1024 print
'<datalist id="num_releve_list">';
1025 foreach ($last_receipts as $num_releve) {
1026 print
'<option value="'.$num_releve.
'"></option>';
1028 print
'</datalist>';
1032 if (is_array($options) && count($options)) {
1033 print $langs->trans(
"EventualyAddCategory").
': ';
1036 print
'<br><div style="margin-top: 5px;"><span class="opacitymedium">'.$langs->trans(
"ThenCheckLinesAndConciliate").
'</span> ';
1037 print
'<input type="submit" class="button" name="confirm_reconcile" value="'.$langs->trans(
"Conciliate").
'">';
1038 print
' <span class="opacitymedium">'.$langs->trans(
"otherwise").
'</span> ';
1039 print
'<input type="submit" class="button small" name="confirm_savestatement" value="'.$langs->trans(
"SaveStatementOnly").
'">';
1045 print $langs->trans(
"LastAccountStatements").
' : ';
1047 foreach ($last_receipts as $num_releve) {
1048 $newentreyinlist =
'<a target="_blank" href="'.DOL_URL_ROOT.
'/compta/bank/releve.php?account='.((int) $id).
'&num='.urlencode($num_releve).
'">';
1049 $newentreyinlist .=
img_picto($num_releve,
'generic',
'class="paddingright"');
1051 $listoflastreceipts = $newentreyinlist.$listoflastreceipts;
1053 if ($numr >= $nbmax) {
1054 $listoflastreceipts =
"... ".$listoflastreceipts;
1056 print $listoflastreceipts;
1058 print
'<b>'.$langs->trans(
"None").
'</b>';
1064 <script type="text/javascript">
1065 $("#num_releve").val("' . $last_releve.
'");
1074 $param .=
'&page='.urlencode((
string) ($page));
1077 $moreforfilter =
'';
1078 $moreforfilter .=
'<div class="divsearchfield">';
1079 $moreforfilter .= $langs->trans(
'DateOperationShort');
1080 $moreforfilter .= (
$conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1081 $moreforfilter .=
'<div class="nowrap inline-block">';
1082 $moreforfilter .= $form->selectDate($search_dt_start,
'search_start_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1083 $moreforfilter .=
'</div>';
1084 $moreforfilter .= (
$conf->browser->layout ==
'phone' ?
'' :
' ');
1085 $moreforfilter .=
'<div class="nowrap inline-block">';
1086 $moreforfilter .= $form->selectDate($search_dt_end,
'search_end_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1087 $moreforfilter .=
'</div>';
1088 $moreforfilter .=
'</div>';
1090 $moreforfilter .=
'<div class="divsearchfield">';
1091 $moreforfilter .= $langs->trans(
'DateValueShort');
1092 $moreforfilter .= (
$conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1093 $moreforfilter .=
'<div class="nowrap inline-block">';
1094 $moreforfilter .= $form->selectDate($search_dv_start,
'search_start_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1095 $moreforfilter .=
'</div>';
1096 $moreforfilter .= (
$conf->browser->layout ==
'phone' ?
'' :
' ');
1097 $moreforfilter .=
'<div class="nowrap inline-block">';
1098 $moreforfilter .= $form->selectDate($search_dv_end,
'search_end_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1099 $moreforfilter .=
'</div>';
1100 $moreforfilter .=
'</div>';
1102 if (isModEnabled(
'category')) {
1104 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1105 $langs->load(
'categories');
1108 $moreforfilter .=
'<div class="divsearchfield">';
1109 $tmptitle = $langs->trans(
'RubriquesTransactions');
1110 $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, $search_bid,
'parent', 0, 0, 1);
1111 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$form->selectarray(
'search_bid', $cate_arbo, $search_bid, $tmptitle, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1112 $moreforfilter .=
'</div>';
1116 $parameters = array();
1117 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1118 if (empty($reshook)) {
1119 $moreforfilter .= $hookmanager->resPrint;
1121 $moreforfilter = $hookmanager->resPrint;
1124 if ($moreforfilter) {
1125 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1126 print $moreforfilter;
1127 print
'</div>'.
"\n";
1130 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1131 $htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1132 $selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
1133 $selectedfields .= ($action ==
'reconcile' ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1136 if ($action ==
'reconcile') {
1137 $arrayfields[
'b.num_releve'][
'checked'] = 1;
1140 print
'<div class="div-table-responsive">';
1141 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1145 print
'<tr class="liste_titre_filter">';
1148 print
'<td class="liste_titre valignmiddle center">';
1149 $searchpicto = $form->showFilterButtons(
'left');
1155 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1156 print
'<td class="liste_titre">';
1157 print
'<input type="text" class="flat" name="search_ref" size="2" value="'.dol_escape_htmltag($search_ref).
'">';
1160 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1161 print
'<td class="liste_titre">';
1162 print
'<input type="text" class="flat maxwidth100" name="search_description" value="'.dol_escape_htmltag($search_description).
'">';
1165 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1166 print
'<td class="liste_titre"> </td>';
1168 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1169 print
'<td class="liste_titre"> </td>';
1172 if (!empty($arrayfields[
'type'][
'checked'])) {
1173 print
'<td class="liste_titre center">';
1174 print $form->select_types_paiements(empty($search_type) ?
'' : $search_type,
'search_type',
'', 2, 1, 1, 0, 1,
'maxwidth100', 1);
1178 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1179 print
'<td class="liste_titre center"><input type="text" class="flat" name="req_nb" value="'.dol_escape_htmltag($search_req_nb).
'" size="2"></td>';
1182 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1183 print
'<td class="liste_titre center"><input type="text" class="flat width50" name="search_fk_bordereau" value="'.dol_escape_htmltag($search_fk_bordereau).
'"></td>';
1186 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1187 print
'<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty_user).
'"></td>';
1190 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1191 print
'<td class="liste_titre">';
1192 $form->select_comptes($search_account,
'search_account', 0,
'', 1, ($id > 0 || !empty($ref) ?
' disabled="disabled"' :
''), 0,
'maxwidth100');
1196 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1197 print
'<td class="liste_titre right">';
1198 print
'<input type="text" class="flat width50" name="search_debit" value="'.dol_escape_htmltag($search_debit).
'">';
1202 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1203 print
'<td class="liste_titre right">';
1204 print
'<input type="text" class="flat width50" name="search_credit" value="'.dol_escape_htmltag($search_credit).
'">';
1208 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1209 print
'<td class="liste_titre right">';
1210 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1211 print $form->textwithpicto(
'', $htmltext, 1);
1215 if (!empty($arrayfields[
'balance'][
'checked'])) {
1216 print
'<td class="liste_titre right">';
1217 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1218 print $form->textwithpicto(
'', $htmltext, 1);
1222 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1224 print
'<td class="liste_titre center"><input type="text" class="flat width50" name="search_num_releve" value="'.dol_escape_htmltag($search_num_releve).
'"></td>';
1227 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1228 print
'<td class="liste_titre center parentonrightofpage">';
1229 print $form->selectyesno(
'search_conciliated', $search_conciliated, 1,
false, 1, 1,
'search_status onrightofpage width75');
1233 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1235 print
'<td class="nowraponall center"></td>';
1239 print
'<td class="liste_titre valignmiddle center">';
1242 $searchpicto = $form->showFilterButtons();
1248 $totalarray = array();
1249 $totalarray[
'nbfield'] = 0;
1252 print
'<tr class="liste_titre">';
1255 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1256 $totalarray[
'nbfield']++;
1258 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1259 print_liste_field_titre($arrayfields[
'b.rowid'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rowid',
'', $param,
'', $sortfield, $sortorder);
1260 $totalarray[
'nbfield']++;
1262 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1263 print_liste_field_titre($arrayfields[
'b.label'][
'label'], $_SERVER[
'PHP_SELF'],
'b.label',
'', $param,
'', $sortfield, $sortorder);
1264 $totalarray[
'nbfield']++;
1266 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1267 print_liste_field_titre($arrayfields[
'b.dateo'][
'label'], $_SERVER[
'PHP_SELF'],
'b.dateo',
'', $param,
'', $sortfield, $sortorder,
"center ");
1268 $totalarray[
'nbfield']++;
1270 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1271 print_liste_field_titre($arrayfields[
'b.datev'][
'label'], $_SERVER[
'PHP_SELF'],
'b.datev,b.dateo,b.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1272 $totalarray[
'nbfield']++;
1274 if (!empty($arrayfields[
'type'][
'checked'])) {
1275 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
1276 $totalarray[
'nbfield']++;
1278 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1279 print_liste_field_titre($arrayfields[
'b.num_chq'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_chq',
'', $param,
'', $sortfield, $sortorder,
"center ");
1280 $totalarray[
'nbfield']++;
1282 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1283 print_liste_field_titre($arrayfields[
'b.fk_bordereau'][
'label'], $_SERVER[
'PHP_SELF'],
'b.fk_bordereau',
'', $param,
'', $sortfield, $sortorder,
"center ");
1284 $totalarray[
'nbfield']++;
1286 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1287 print_liste_field_titre($arrayfields[
'bu.label'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1288 $totalarray[
'nbfield']++;
1290 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1291 print_liste_field_titre($arrayfields[
'ba.ref'][
'label'], $_SERVER[
'PHP_SELF'],
'ba.ref',
'', $param,
'', $sortfield, $sortorder);
1292 $totalarray[
'nbfield']++;
1294 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1295 print_liste_field_titre($arrayfields[
'b.debit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1296 $totalarray[
'nbfield']++;
1298 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1299 print_liste_field_titre($arrayfields[
'b.credit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1300 $totalarray[
'nbfield']++;
1302 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1303 print_liste_field_titre($arrayfields[
'balancebefore'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1304 $totalarray[
'nbfield']++;
1306 if (!empty($arrayfields[
'balance'][
'checked'])) {
1307 print_liste_field_titre($arrayfields[
'balance'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1308 $totalarray[
'nbfield']++;
1310 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1312 print_liste_field_titre($arrayfields[
'b.num_releve'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_releve',
'', $param,
'', $sortfield, $sortorder,
"center ");
1313 $totalarray[
'nbfield']++;
1315 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1316 print_liste_field_titre($arrayfields[
'b.conciliated'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rappro',
'', $param,
'', $sortfield, $sortorder,
"center ");
1317 $totalarray[
'nbfield']++;
1321 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1323 $parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1324 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1325 print $hookmanager->resPrint;
1327 print
'<td class="nowraponall center"></td>';
1328 $totalarray[
'nbfield']++;
1332 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1333 $totalarray[
'nbfield']++;
1339 $balancecalculated =
false;
1340 $posconciliatecol = 0;
1341 $cachebankaccount = array();
1347 $savnbfield = $totalarray[
'nbfield'];
1348 $totalarray = array();
1349 $totalarray[
'nbfield'] = 0;
1350 $totalarray[
'totaldeb'] = 0;
1351 $totalarray[
'totalcred'] = 0;
1353 $imaxinloop = ($limit ? min($num, $limit) : $num);
1354 while ($i < $imaxinloop) {
1355 $objp = $db->fetch_object($resql);
1356 $links = $bankaccountstatic->get_url($objp->rowid);
1358 if (!$balancecalculated && (!empty($arrayfields[
'balancebefore'][
'checked']) || !empty($arrayfields[
'balance'][
'checked'])) && ($mode_balance_ok || $search_conciliated ===
'0')) {
1359 if (!$search_account) {
1360 dol_print_error(
null,
'account is not defined but $mode_balance_ok is true');
1367 $sqlforbalance =
'SELECT SUM(b.amount) as previoustotal';
1368 $sqlforbalance .=
" FROM ";
1369 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
1370 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank as b";
1371 $sqlforbalance .=
" WHERE b.fk_account = ba.rowid";
1372 $sqlforbalance .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
1373 $sqlforbalance .=
" AND b.fk_account = ".((int) $search_account);
1375 $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.
"))))";
1376 $resqlforbalance = $db->query($sqlforbalance);
1379 if ($resqlforbalance) {
1380 $objforbalance = $db->fetch_object($resqlforbalance);
1381 if ($objforbalance) {
1383 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1384 $balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount);
1387 $balance = $objforbalance->previoustotal;
1394 $balancecalculated =
true;
1397 if ($user->hasRight(
'banque',
'consolidate') && $action ==
'reconcile') {
1398 $tmpnbfieldbeforebalance = 0;
1399 $tmpnbfieldafterbalance = 0;
1400 $balancefieldfound = 0;
1401 foreach ($arrayfields as $key => $val) {
1402 if ($key ==
'balancebefore' || $key ==
'balance') {
1403 $balancefieldfound++;
1406 if (!empty($arrayfields[$key][
'checked'])) {
1407 if (!$balancefieldfound) {
1408 $tmpnbfieldbeforebalance++;
1410 $tmpnbfieldafterbalance++;
1415 $element = $extrafieldsobjectkey;
1416 if (!empty($extrafields->attributes[$element][
'label']) && is_array($extrafields->attributes[$element][
'label']) && count($extrafields->attributes[$element][
'label'])) {
1417 foreach ($extrafields->attributes[$element][
'label'] as $key => $val) {
1418 if (!empty($arrayfields[
"ef.".$key][
'checked'])) {
1419 if (!empty($arrayfields[$key][
'checked'])) {
1420 if (!$balancefieldfound) {
1421 $tmpnbfieldbeforebalance++;
1423 $tmpnbfieldafterbalance++;
1430 print
'<tr class="oddeven trforbreak">';
1435 if ($tmpnbfieldbeforebalance) {
1436 print
'<td colspan="'.$tmpnbfieldbeforebalance.
'">';
1441 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1442 print
'<td class="right">';
1443 if ($search_conciliated !==
'0') {
1444 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1452 if (!empty($arrayfields[
'balance'][
'checked'])) {
1453 print
'<td class="right">';
1454 if ($search_conciliated !==
'0') {
1455 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1464 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1469 print
'<td colspan="'.($tmpnbfieldafterbalance).
'">';
1482 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1483 $balance =
price2num($balancebefore,
'MT');
1484 $balancebefore =
price2num($balancebefore - ($sign * $objp->amount),
'MT');
1486 $balancebefore =
price2num($balance,
'MT');
1487 $balance =
price2num($balance + ($sign * $objp->amount),
'MT');
1490 if (empty($cachebankaccount[$objp->bankid])) {
1491 $bankaccounttmp =
new Account($db);
1492 $bankaccounttmp->fetch($objp->bankid);
1493 $cachebankaccount[$objp->bankid] = $bankaccounttmp;
1494 $bankaccount = $bankaccounttmp;
1496 $bankaccount = $cachebankaccount[$objp->bankid];
1500 $backgroundcolor =
"class='oddeven'";
1502 if ($objp->amount < 0) {
1504 $backgroundcolor =
'style="background: '.$color.
';"';
1507 $backgroundcolor =
'style="background: '.$color.
';"';
1511 $banklinestatic->id = $objp->rowid;
1512 $banklinestatic->ref = (string) $objp->rowid;
1514 print
'<tr class="oddeven" '.$backgroundcolor.
'>';
1518 print
'<td class="center">';
1519 if (!$objp->conciliated && $action ==
'reconcile') {
1520 print
'<input class="flat checkforselect" name="rowid['.$objp->rowid.
']" type="checkbox" name="toselect[]" value="'.$objp->rowid.
'" size="1"'.(!empty($tmparray[$objp->rowid]) ?
' checked' :
'').
'>';
1524 $totalarray[
'nbfield']++;
1529 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1530 print
'<td class="nowrap left">';
1531 print $banklinestatic->getNomUrl(1);
1534 $totalarray[
'nbfield']++;
1539 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1543 preg_match(
'/\((.+)\)/i', $objp->label, $reg);
1544 if (!empty($reg[1]) && $langs->trans($reg[1]) != $reg[1]) {
1546 $labeltoshow = $langs->trans($reg[1]);
1548 if ($objp->label ==
'(payment_salary)') {
1549 $labeltoshow = $langs->trans(
"SalaryPayment");
1552 $titletoshow = $objp->label;
1557 print
'<td class="tdoverflowmax250"'.($titletoshow ?
' title="'.dol_escape_htmltag($titletoshow).
'"' :
'').
'>';
1560 $cachebankaccount = array();
1561 foreach ($links as $key => $val) {
1562 print
'<!-- '.$links[$key][
'type'].
' -->';
1563 if ($links[$key][
'type'] ==
'withdraw') {
1564 $banktransferstatic->id = $links[$key][
'url_id'];
1565 $banktransferstatic->ref = $links[$key][
'label'];
1566 print $banktransferstatic->getNomUrl(0).($labeltoshow ?
' ' :
'');
1567 } elseif ($links[$key][
'type'] ==
'payment') {
1568 $paymentstatic->id = $links[$key][
'url_id'];
1569 $paymentstatic->ref = (string) $links[$key][
'url_id'];
1570 $paymentstatic->date = $db->jdate($objp->do);
1571 print $paymentstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1572 } elseif ($links[$key][
'type'] ==
'payment_supplier') {
1573 $paymentsupplierstatic->id = $links[$key][
'url_id'];
1574 $paymentsupplierstatic->ref = (string) $links[$key][
'url_id'];
1575 print $paymentsupplierstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1576 } elseif ($links[$key][
'type'] ==
'payment_sc') {
1577 $paymentscstatic->id = $links[$key][
'url_id'];
1578 $paymentscstatic->ref = (string) $links[$key][
'url_id'];
1579 $paymentscstatic->label = $links[$key][
'label'];
1580 print $paymentscstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1581 } elseif ($links[$key][
'type'] ==
'payment_vat') {
1582 $paymentvatstatic->id = $links[$key][
'url_id'];
1583 $paymentvatstatic->ref = (string) $links[$key][
'url_id'];
1584 print $paymentvatstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1585 } elseif ($links[$key][
'type'] ==
'payment_salary') {
1586 $paymentsalstatic->id = $links[$key][
'url_id'];
1587 $paymentsalstatic->ref = (string) $links[$key][
'url_id'];
1588 $paymentsalstatic->label = $links[$key][
'label'];
1589 print $paymentsalstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1590 } elseif ($links[$key][
'type'] ==
'payment_loan') {
1591 print
'<a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$links[$key][
'url_id'].
'">';
1592 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
1593 print
'</a>'.($labeltoshow ?
' ' :
'');
1594 } elseif ($links[$key][
'type'] ==
'payment_donation') {
1595 $paymentdonationstatic->id = $links[$key][
'url_id'];
1596 $paymentdonationstatic->ref = (string) $links[$key][
'url_id'];
1597 print $paymentdonationstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1598 } elseif ($links[$key][
'type'] ==
'payment_expensereport') {
1599 $paymentexpensereportstatic->id = $links[$key][
'url_id'];
1600 $paymentexpensereportstatic->ref = (string) $links[$key][
'url_id'];
1601 print $paymentexpensereportstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1602 } elseif ($links[$key][
'type'] ==
'payment_various') {
1603 $paymentvariousstatic->id = $links[$key][
'url_id'];
1604 $paymentvariousstatic->ref = (string) $links[$key][
'url_id'];
1605 print $paymentvariousstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1606 } elseif ($links[$key][
'type'] ==
'banktransfert') {
1608 if ($objp->amount > 0) {
1609 $banklinestatic->fetch($links[$key][
'url_id']);
1610 $bankstatic->id = $banklinestatic->fk_account;
1611 $bankstatic->label = $banklinestatic->bank_account_ref;
1612 print $langs->trans(
"TransferFrom").
' ';
1613 print $bankstatic->getNomUrl(1,
'transactions');
1614 print
' '.$langs->trans(
"toward").
' ';
1615 $bankstatic->id = $objp->bankid;
1616 $bankstatic->label = $objp->bankref;
1617 print $bankstatic->getNomUrl(1,
'');
1618 print($labeltoshow ?
' - ' :
'');
1620 $bankstatic->id = $objp->bankid;
1621 $bankstatic->label = $objp->bankref;
1622 print $langs->trans(
"TransferFrom").
' ';
1623 print $bankstatic->getNomUrl(1,
'');
1624 print
' '.$langs->trans(
"toward").
' ';
1625 $banklinestatic->fetch($links[$key][
'url_id']);
1626 $bankstatic->id = $banklinestatic->fk_account;
1627 $bankstatic->label = $banklinestatic->bank_account_ref;
1628 print $bankstatic->getNomUrl(1,
'transactions');
1629 print($labeltoshow ?
' - ' :
'');
1632 } elseif ($links[$key][
'type'] ==
'company') {
1633 } elseif ($links[$key][
'type'] ==
'user') {
1634 } elseif ($links[$key][
'type'] ==
'member') {
1635 } elseif ($links[$key][
'type'] ==
'sc') {
1636 } elseif ($links[$key][
'type'] ==
'vat') {
1637 } elseif ($links[$key][
'type'] ==
'salary') {
1641 print
'<a href="'.$links[$key][
'url'].$links[$key][
'url_id'].
'">';
1642 if (preg_match(
'/^\((.*)\)$/i', $links[$key][
'label'], $reg)) {
1644 if ($reg[1] ==
'paiement') {
1645 $reg[1] =
'Payment';
1647 print $langs->trans($reg[1]);
1649 print $links[$key][
'label'];
1651 print
'</a>'.($labeltoshow ?
' - ' :
'');
1659 $totalarray[
'nbfield']++;
1664 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1665 print
'<td class="nowraponall center">';
1666 print
'<span class="spanforajaxedit" id="dateoperation_'.$objp->rowid.
'" title="'.
dol_print_date($db->jdate($objp->do),
"day").
'">'.
dol_print_date($db->jdate($objp->do),
"dayreduceformat").
"</span>";
1668 print
'<span class="inline-block">';
1669 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=doprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1671 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=donext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1676 $totalarray[
'nbfield']++;
1681 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1682 print
'<td class="nowraponall center">';
1683 print
'<span class="spanforajaxedit" id="datevalue_'.$objp->rowid.
'" title="'.
dol_print_date($db->jdate($objp->dv),
"day").
'">'.
dol_print_date($db->jdate($objp->dv),
"dayreduceformat").
"</span>";
1685 print
'<span class="inline-block">';
1686 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1688 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvnext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1693 $totalarray[
'nbfield']++;
1698 if (!empty($arrayfields[
'type'][
'checked'])) {
1699 $labeltype = ($langs->transnoentitiesnoconv(
"PaymentTypeShort".$objp->fk_type) !=
"PaymentTypeShort".$objp->fk_type) ? $langs->transnoentitiesnoconv(
"PaymentTypeShort".$objp->fk_type) : $langs->getLabelFromKey($db, $objp->fk_type,
'c_paiement',
'code',
'libelle',
'', 1);
1700 if (empty($arrayfields[
'b.num_chq'][
'checked'])) {
1701 $labeltype .= ($objp->num_chq ?
' - '.$objp->num_chq :
'');
1703 print
'<td class="tdoverflowmax100" title="'.dolPrintLabel($labeltype).
'">';
1704 if ($labeltype ==
'SOLD') {
1711 $totalarray[
'nbfield']++;
1716 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1717 print
'<td class="tdoverflowmax100 center" title="'.($objp->num_chq ?
dolPrintLabel($objp->num_chq) :
"").
'">'.($objp->num_chq ?
dolPrintLabel($objp->num_chq) :
"").
"</td>\n";
1719 $totalarray[
'nbfield']++;
1724 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1725 $bordereaustatic->fetch($objp->fk_bordereau);
1726 print
'<td class="nowraponall center">';
1727 print $bordereaustatic->getNomUrl();
1730 $totalarray[
'nbfield']++;
1735 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1736 print
'<td class="tdoverflowmax125">';
1738 $companylinked_id = 0;
1744 foreach ($links as $key => $value) {
1745 if ($links[$key][
'type'] ==
'payment_sc') {
1746 $type_link =
'payment_sc';
1748 if ($links[$key][
'type'] ==
'payment_salary') {
1749 $type_link =
'payment_salary';
1751 if ($links[$key][
'type'] ==
'payment_donation') {
1752 $paymentdonationstatic->fetch($links[$key][
'url_id']);
1753 $donstatic->fetch($paymentdonationstatic->fk_donation);
1754 $companylinked_id = $donstatic->socid;
1755 if (!$companylinked_id) {
1756 $thirdstr = ($donstatic->societe !==
"" ?
1757 $donstatic->societe :
1758 $donstatic->firstname.
" ".$donstatic->lastname);
1761 if ($links[$key][
'type'] ==
'payment_expensereport') {
1762 $type_link =
'payment_expensereport';
1765 if ($links[$key][
'type'] ==
'company') {
1766 $companylinked_id = $links[$key][
'url_id'];
1768 if ($links[$key][
'type'] ==
'user') {
1769 $userlinked_id = $links[$key][
'url_id'];
1774 if ($companylinked_id) {
1776 $companystatic->fetch($companylinked_id);
1777 print $companystatic->getNomUrl(1);
1778 } elseif ($userlinked_id &&
1779 (($type_link ==
'payment_salary' && $user->hasRight(
'salaries',
'read'))
1780 || ($type_link ==
'payment_sc' && $user->hasRight(
'tax',
'charges',
'lire'))
1781 || ($type_link ==
'payment_expensereport' && $user->hasRight(
'expensereport',
'lire')))) {
1783 if (!empty(
$conf->cache[
'user'][$userlinked_id])) {
1784 $tmpuser =
$conf->cache[
'user'][$userlinked_id];
1786 $tmpuser =
new User($db);
1787 $tmpuser->fetch($userlinked_id);
1788 $conf->cache[
'user'][$userlinked_id] = $tmpuser;
1790 print $tmpuser->getNomUrl(-1);
1791 } elseif ($thirdstr) {
1799 $totalarray[
'nbfield']++;
1804 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1805 print
'<td class="nowrap">';
1806 print $bankaccount->getNomUrl(1);
1809 $totalarray[
'nbfield']++;
1814 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1815 print
'<td class="nowraponall right"><span class="amount">';
1816 if ($objp->amount < 0) {
1817 print
price($objp->amount * -1);
1818 $totalarray[
'totaldeb'] += $objp->amount;
1820 print
"</span></td>\n";
1822 $totalarray[
'nbfield']++;
1825 $totalarray[
'totaldebfield'] = $totalarray[
'nbfield'];
1830 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1831 print
'<td class="nowraponall right"><span class="amount">';
1832 if ($objp->amount > 0) {
1833 print
price($objp->amount);
1834 $totalarray[
'totalcred'] += $objp->amount;
1836 print
"</span></td>\n";
1838 $totalarray[
'nbfield']++;
1841 $totalarray[
'totalcredfield'] = $totalarray[
'nbfield'];
1846 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1847 if ($mode_balance_ok) {
1848 if ($balancebefore >= 0) {
1849 print
'<td class="nowrap right"> '.price($balancebefore).
'</td>';
1851 print
'<td class="error nowrap right"> '.price($balancebefore).
'</td>';
1854 print
'<td class="right">-</td>';
1857 $totalarray[
'nbfield']++;
1862 if (!empty($arrayfields[
'balance'][
'checked'])) {
1863 if ($mode_balance_ok) {
1864 if ($balance >= 0) {
1865 print
'<td class="nowrap right"> '.price($balance).
'</td>';
1867 print
'<td class="error nowrap right"> '.price($balance).
'</td>';
1870 print
'<td class="right">-</td>';
1873 $totalarray[
'nbfield']++;
1877 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1878 print
'<td class="nowraponall center">';
1880 if ($bankaccount->canBeConciliated() > 0) {
1881 if ($objp->num_releve) {
1882 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>';
1887 $totalarray[
'nbfield']++;
1888 $posconciliatecol = $totalarray[
'nbfield'];
1893 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1894 print
'<td class="nowraponall center">';
1895 print
yn($objp->conciliated);
1898 $totalarray[
'nbfield']++;
1902 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1903 $bordereaustatic->fetch($objp->fk_bordereau);
1904 print
'<td class="nowraponall center">';
1905 print $bordereaustatic->getNomUrl();
1908 $totalarray[
'nbfield']++;
1913 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1915 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $objp,
'i' => $i,
'totalarray' => &$totalarray);
1916 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1917 print $hookmanager->resPrint;
1920 print
'<td class="nowraponall center">';
1922 if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) {
1923 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.
'">';
1927 if ($user->hasRight(
'banque',
'modifier') || $user->hasRight(
'banque',
'consolidate')) {
1928 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.
'">';
1932 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.
'">';
1936 if ($bankaccount->canBeConciliated() > 0 && empty($objp->conciliated)) {
1937 if ($db->jdate($objp->dv) < ($now -
$conf->bank->rappro->warning_delay)) {
1938 print
' '.img_warning($langs->trans(
"ReconciliationLate"));
1941 if ($user->hasRight(
'banque',
'modifier')) {
1942 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&rowid='.$objp->rowid.
'&page='.$page.$param.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
'').
'">';
1943 print
img_delete(
'',
'class="marginleftonly"');
1949 $totalarray[
'nbfield']++;
1954 print
'<td class="center">';
1955 if (!$objp->conciliated && $action ==
'reconcile') {
1956 print
'<input class="flat checkforselect" name="rowid['.$objp->rowid.
']" type="checkbox" value="'.$objp->rowid.
'" size="1"'.(!empty($tmparray[$objp->rowid]) ?
' checked' :
'').
'>';
1960 $totalarray[
'nbfield']++;
1970 if (isset($totalarray[
'totaldebfield']) || isset($totalarray[
'totalcredfield'])) {
1971 print
'<tr class="liste_total">';
1973 while ($i < $totalarray[
'nbfield']) {
1976 if ($num < $limit && empty($offset)) {
1977 print
'<td class="left">'.$langs->trans(
"Total").
'</td>';
1979 print
'<td class="left tdoverflowmax50" title="'.$langs->trans(
"Totalforthispage").
'">'.$langs->trans(
"Totalforthispage").
'</td>';
1981 } elseif ($totalarray[
'totaldebfield'] == $i) {
1982 print
'<td class="right"><span class="amount">'.price(-1 * $totalarray[
'totaldeb']).
'</span></td>';
1983 } elseif ($totalarray[
'totalcredfield'] == $i) {
1984 print
'<td class="right"><span class="amount">'.price($totalarray[
'totalcred']).
'</span></td>';
1985 } elseif ($i == $posconciliatecol) {
1986 print
'<td class="center">';
2001 foreach ($arrayfields as $key => $val) {
2002 if (!empty($val[
'checked'])) {
2006 print
'<tr><td colspan="'.($colspan + 1).
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
bank_prepare_head(Account $object)
Prepare array with list of tabs.
Class to manage bank accounts.
Class to manage bank transaction lines.
Class to manage members of a foundation.
Class to manage bank categories.
Class to manage withdrawal receipts.
Class for managing the social charges.
Class to manage donations.
Class to manage payments for supplier invoices.
Class to manage payments of customer invoices.
Class to manage payments of donations.
Class to manage payments of expense report.
Class to manage payments of salaries.
Class to manage payments of social contributions.
Class to manage payments of social contributions.
Class to manage various payments.
Class to manage cheque delivery receipts.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
currentToken()
Return the value of token currently saved into session with name 'token'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_view($titlealt='default', $float=0, $other='class="valignmiddle"')
Show logo view card.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_edit_add($titlealt='default', $other='')
Show logo +.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dolPrintLabel($s)
Return a string label (so on 1 line only and that should not contains any HTML) ready to be output on...
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
img_edit_remove($titlealt='default', $other='')
Show logo -.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.