36require
'../../main.inc.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
50require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
53require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
54require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
55require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
56require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/paymentvat.class.php';
57require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
58require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/paymentsocialcontribution.class.php';
59require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/tva.class.php';
60require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
61require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
62require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
63require_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
64require_once DOL_DOCUMENT_ROOT.
'/don/class/paymentdonation.class.php';
65require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/paymentexpensereport.class.php';
66require_once DOL_DOCUMENT_ROOT.
'/loan/class/loan.class.php';
67require_once DOL_DOCUMENT_ROOT.
'/fourn/class/paiementfourn.class.php';
68require_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:int');
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 recordNotFound(
'', 0);
137$contextpage =
'banktransactionlist'.(empty(
$object->id) ?
'' :
'-'.$object->id);
139$mode_balance_ok =
false;
141if (($sortfield ==
'b.datev' || $sortfield ==
'b.datev,b.dateo,b.rowid')) {
142 $sortfield =
'b.datev,b.dateo,b.rowid';
143 if ($id > 0 || !empty($ref) || $search_account > 0) {
144 $mode_balance_ok =
true;
149$hookmanager->initHooks(array(
'banktransactionlist', $contextpage));
151$extrafieldsobjectkey =
'bank';
154$extrafields->fetch_name_optionals_label($extrafieldsobjectkey);
155$search_array_options = $extrafields->getOptionalsFromPost($extrafieldsobjectkey,
'',
'search_');
158 'b.rowid' => array(
'label' => $langs->trans(
"Ref"),
'checked' =>
'1',
'position' => 10),
159 'b.label' => array(
'label' => $langs->trans(
"Description"),
'checked' =>
'1',
'position' => 20),
160 'b.dateo' => array(
'label' => $langs->trans(
"DateOperationShort"),
'checked' =>
'-1',
'position' => 30),
161 'b.datev' => array(
'label' => $langs->trans(
"DateValueShort"),
'checked' =>
'1',
'position' => 40),
162 'type' => array(
'label' => $langs->trans(
"Type"),
'checked' =>
'1',
'position' => 50),
163 'b.num_chq' => array(
'label' => $langs->trans(
"Numero"),
'checked' =>
'0',
'position' => 60),
164 'b.fk_bordereau' => array(
'label' => $langs->trans(
"ChequeNumber"),
'checked' =>
'0',
'position' => 65),
165 'bu.label' => array(
'label' => $langs->trans(
"ThirdParty").
'/'.$langs->trans(
"User"),
'checked' =>
'1',
'position' => 70),
166 'ba.ref' => array(
'label' => $langs->trans(
"BankAccount"),
'checked' => (($id > 0 || !empty($ref)) ?
'0' :
'1'),
'position' => 80),
167 'b.debit' => array(
'label' => $langs->trans(
"Debit"),
'checked' =>
'1',
'position' => 90),
168 'b.credit' => array(
'label' => $langs->trans(
"Credit"),
'checked' =>
'1',
'position' => 100),
169 'balancebefore' => array(
'label' => $langs->trans(
"BalanceBefore"),
'checked' =>
'0',
'position' => 110),
170 'balance' => array(
'label' => $langs->trans(
"Balance"),
'checked' =>
'1',
'position' => 120),
171 'b.num_releve' => array(
'label' => $langs->trans(
"AccountStatement"),
'checked' =>
'1',
'position' => 130),
172 'b.conciliated' => array(
'label' => $langs->trans(
"BankLineReconciled"),
'enabled' => (
string) (int)
$object->rappro,
'checked' => ($action ==
'reconcile' ?
'1' :
'0'),
'position' => 140),
175include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
181$fieldvalue = (!empty($id) ?
$id : (!empty($ref) ? $ref :
''));
182$fieldtype = (!empty($ref) ?
'ref' :
'rowid');
185 $socid = $user->socid;
187 $result =
restrictedArea($user,
'banque', $fieldvalue,
'bank_account&bank_account',
'',
'', $fieldtype);
190 $socid = $user->socid;
200if (
GETPOST(
'cancel',
'alpha')) {
204if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
208$parameters = array();
209$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
214include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
216if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
217 $search_dt_start =
'';
219 $search_dv_start =
'';
227 $search_description =
'';
228 $search_thirdparty_user =
'';
229 $search_num_releve =
'';
230 $search_conciliated =
'';
231 $search_fk_bordereau =
'';
234 $search_account =
"";
235 if ($id > 0 || !empty($ref)) {
240if (empty($reshook)) {
241 $objectclass =
'Account';
242 $objectlabel =
'BankTransaction';
243 $permissiontoread = $user->hasRight(
'banque',
'lire');
244 $permissiontodelete = $user->hasRight(
'banque',
'modifier');
245 $uploaddir =
$conf->bank->dir_output;
246 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
249$rowids =
GETPOST(
'rowid',
'array:int');
252if ((
GETPOST(
'confirm_savestatement',
'alpha') ||
GETPOST(
'confirm_reconcile',
'alpha'))
253 && (
GETPOST(
"num_releve",
"alpha") || !empty($rowids))
254 && $user->hasRight(
'banque',
'consolidate')
255 && (!GETPOSTISSET(
'pageplusone') || (
GETPOST(
'pageplusone') ==
GETPOST(
'pageplusoneold')))) {
259 $num_releve =
GETPOST(
"num_releve",
"alpha");
264 $rowids =
GETPOST(
'rowid',
'array:int');
266 if (!empty($rowids) && is_array($rowids)) {
267 foreach ($rowids as $row) {
269 $result = $bankline->fetch($row);
270 $bankline->num_releve = $num_releve;
271 $result = $bankline->update_conciliation($user,
GETPOSTINT(
"cat"),
GETPOST(
'confirm_reconcile',
'alpha') ? 1 : 0);
279 if (!$error && count($rowids) > 0) {
280 setEventMessages($langs->trans(
"XNewLinesConciliated", count($rowids)),
null);
284 $langs->load(
"errors");
289 $langs->load(
"errors");
290 setEventMessages($langs->trans(
"ErrorPleaseTypeBankTransactionReportName"),
null,
'errors');
294 $param =
'action=reconcile&contextpage=banktransactionlist&id='.((int)
$object->id).
'&search_account='.((int)
$object->id);
296 $param .=
'&page='.urlencode((
string) ($page));
299 $param .=
'&offset='.urlencode((
string) ($offset));
302 $param .=
'&limit='.((int) $limit);
304 if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
305 $param .=
'&search_conciliated='.urlencode((
string) ($search_conciliated));
307 if ($search_thirdparty_user) {
308 $param .=
'&search_thirdparty='.urlencode($search_thirdparty_user);
310 if ($search_num_releve) {
311 $param .=
'&search_num_releve='.urlencode($search_num_releve);
313 if ($search_description) {
314 $param .=
'&search_description='.urlencode($search_description);
317 $param .=
'&search_start_dtmonth='.GETPOSTINT(
'search_start_dtmonth').
'&search_start_dtday='.
GETPOSTINT(
'search_start_dtday').
'&search_start_dtyear='.
GETPOSTINT(
'search_start_dtyear');
320 $param .=
'&search_end_dtmonth='.GETPOSTINT(
'search_end_dtmonth').
'&search_end_dtday='.
GETPOSTINT(
'search_end_dtday').
'&search_end_dtyear='.
GETPOSTINT(
'search_end_dtyear');
323 $param .=
'&search_start_dvmonth='.GETPOSTINT(
'search_start_dvmonth').
'&search_start_dvday='.
GETPOSTINT(
'search_start_dvday').
'&search_start_dvyear='.
GETPOSTINT(
'search_start_dvyear');
326 $param .=
'&search_end_dvmonth='.GETPOSTINT(
'search_end_dvmonth').
'&search_end_dvday='.
GETPOSTINT(
'search_end_dvday').
'&search_end_dvyear='.
GETPOSTINT(
'search_end_dvyear');
329 $param .=
'&search_type='.urlencode($search_type);
332 $param .=
'&search_debit='.urlencode($search_debit);
334 if ($search_credit) {
335 $param .=
'&search_credit='.urlencode($search_credit);
337 $param .=
'&sortfield='.urlencode($sortfield).
'&sortorder='.urlencode($sortorder);
338 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?'.$param);
344if (
GETPOST(
'save') && !$cancel && $user->hasRight(
'banque',
'modifier')) {
353 $operation =
GETPOST(
"operation",
'alpha');
354 $num_chq =
GETPOST(
"num_chq",
'alpha');
355 $label =
GETPOST(
"label",
'alpha');
356 $cat1 =
GETPOST(
"cat1",
'alpha');
358 $bankaccountid =
$id;
364 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Date")),
null,
'errors');
368 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
372 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Label")),
null,
'errors');
376 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Amount")),
null,
'errors');
378 if (!($bankaccountid > 0)) {
380 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"BankAccount")),
null,
'errors');
390 $objecttmp->fetch($bankaccountid);
391 $insertid = $objecttmp->addline((
int) $dateop, $operation, $label, (
float) $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user,
'',
'', $search_accountancy_code);
394 header(
"Location: ".$_SERVER[
'PHP_SELF'].($id ?
"?id=".$id :
''));
404if ($action ==
'confirm_deleteonreconcile' && $confirm ==
'yes' && $user->hasRight(
'banque',
'modifier')) {
406 $result = $accline->fetch(
GETPOSTINT(
"rowid"));
407 $result = $accline->delete($user);
414 $action =
'reconcile';
417if ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->hasRight(
'banque',
'modifier')) {
419 $result = $accline->fetch(
GETPOSTINT(
"rowid"));
420 $result = $accline->delete($user);
464if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
465 $param .=
'&contextpage='.urlencode($contextpage);
467if ($limit > 0 && $limit !=
$conf->liste_limit) {
468 $param .=
'&limit='.((int) $limit);
471 $param .=
'&id='.urlencode((
string) (
$id));
474 $param .=
'&ref='.urlencode($ref);
476if (!empty($search_ref)) {
477 $param .=
'&search_ref='.urlencode($search_ref);
479if (!empty($search_description)) {
480 $param .=
'&search_description='.urlencode($search_description);
482if (!empty($search_type)) {
483 $param .=
'&type='.urlencode($search_type);
485if (!empty($search_thirdparty_user)) {
486 $param .=
'&search_thirdparty='.urlencode($search_thirdparty_user);
488if (!empty($search_debit)) {
489 $param .=
'&search_debit='.urlencode($search_debit);
491if (!empty($search_credit)) {
492 $param .=
'&search_credit='.urlencode($search_credit);
494if ($search_account > 0) {
495 $param .=
'&search_account='.((int) $search_account);
497if (!empty($search_num_releve)) {
498 $param .=
'&search_num_releve='.urlencode($search_num_releve);
500if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
501 $param .=
'&search_conciliated='.urlencode((
string) ($search_conciliated));
503if ($search_fk_bordereau > 0) {
504 $param .=
'$&search_fk_bordereau='.urlencode((
string) ($search_fk_bordereau));
506if ($search_bid > 0) {
507 $param .=
'&search_bid='.((int) $search_bid);
510 $param .=
'&search_start_dtmonth='.GETPOSTINT(
'search_start_dtmonth').
'&search_start_dtday='.
GETPOSTINT(
'search_start_dtday').
'&search_start_dtyear='.
GETPOSTINT(
'search_start_dtyear');
513 $param .=
'&search_end_dtmonth='.GETPOSTINT(
'search_end_dtmonth').
'&search_end_dtday='.
GETPOSTINT(
'search_end_dtday').
'&search_end_dtyear='.
GETPOSTINT(
'search_end_dtyear');
516 $param .=
'&search_start_dvmonth='.GETPOSTINT(
'search_start_dvmonth').
'&search_start_dvday='.
GETPOSTINT(
'search_start_dvday').
'&search_start_dvyear='.
GETPOSTINT(
'search_start_dvyear');
519 $param .=
'&search_end_dvmonth='.GETPOSTINT(
'search_end_dvmonth').
'&search_end_dvday='.
GETPOSTINT(
'search_end_dvday').
'&search_end_dvyear='.
GETPOSTINT(
'search_end_dvyear');
522 $param .=
'&req_nb='.urlencode($search_req_nb);
525 $param .=
'&thirdparty='.urlencode((
string) (
GETPOSTINT(
"search_thirdparty")));
527if ($optioncss !=
'') {
528 $param .=
'&optioncss='.urlencode($optioncss);
530if ($action ==
'reconcile' || $action ==
'confirm_deleteonreconcile') {
531 $param .=
'&action=reconcile';
539include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
543$buttonreconcile =
'';
546if ($id > 0 || !empty($ref)) {
547 $title =
$object->ref.
' - '.$langs->trans(
"Transactions");
549 $title = $langs->trans(
"BankTransactions");
553llxHeader(
'', $title, $help_url,
'', 0, 0, array(), array(), $param);
556if ($id > 0 || !empty($ref)) {
558 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
561 $arrayofbankcateg = $bankcateg->fetchAll();
562 foreach ($arrayofbankcateg as $bankcategory) {
563 $options[$bankcategory->id] = $bankcategory->label;
568 $activetab =
'journal';
569 if ($action ==
'reconcile' || $action ==
'confirm_deleteonreconcile') {
570 $activetab =
'reconcile';
572 print
dol_get_fiche_head($head, $activetab, $langs->trans(
"FinancialAccount"), 0,
'account');
574 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
576 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
581$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,";
582$sql .=
" b.fk_account, b.fk_type, b.fk_bordereau,";
583$sql .=
" ba.rowid as bankid, ba.ref as bankref";
585if (!empty($extrafields->attributes[$extrafieldsobjectkey][
'label'])) {
586 foreach ($extrafields->attributes[$extrafieldsobjectkey][
'label'] as $key => $val) {
587 $sql .= ($extrafields->attributes[$extrafieldsobjectkey][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
591$parameters = array();
592$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
593$sql .= $hookmanager->resPrint;
595if ($search_bid > 0) {
596 $sql .= MAIN_DB_PREFIX.
"category_bankline as l,";
598$sql .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
599$sql .=
" ".MAIN_DB_PREFIX.
"bank as b";
600if (!empty($extrafields->attributes[$extrafieldsobjectkey][
'label']) && is_array($extrafields->attributes[$extrafieldsobjectkey][
'label']) && count($extrafields->attributes[$extrafieldsobjectkey][
'label'])) {
601 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$extrafieldsobjectkey.
"_extrafields as ef on (b.rowid = ef.fk_object)";
605$parameters = array();
606$reshook = $hookmanager->executeHooks(
'printFieldListJoin', $parameters, $object, $action);
607$sql .= $hookmanager->resPrint;
609$sql .=
" WHERE b.fk_account = ba.rowid";
610$sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
611if ($search_account > 0) {
612 $sql .=
" AND b.fk_account = ".((int) $search_account);
616 $sql .=
" AND b.dateo >= '".$db->idate($search_dt_start).
"'";
619 $sql .=
" AND b.dateo <= '".$db->idate($search_dt_end).
"'";
623 $sql .=
" AND b.datev >= '".$db->idate($search_dv_start).
"'";
626 $sql .=
" AND b.datev <= '".$db->idate($search_dv_end).
"'";
634if ($search_num_releve) {
637if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
638 $sql .=
" AND b.rappro = ".((int) $search_conciliated);
640if ($search_fk_bordereau > 0) {
641 $sql .=
" AND b.fk_bordereau = " . ((int) $search_fk_bordereau);
643if ($search_thirdparty_user) {
644 $sql .=
" AND (b.rowid IN ";
645 $sql .=
" ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url AS bu";
646 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"bank AS b2 ON b2.rowid = bu.fk_bank";
647 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"user AS subUser ON (bu.type = 'user' AND bu.url_id = subUser.rowid)";
648 $sql .=
" WHERE ".
natural_search(array(
"subUser.firstname",
"subUser.lastname"), $search_thirdparty_user, 0, 1).
")";
650 $sql .=
" OR b.rowid IN ";
651 $sql .=
" ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url AS bu";
652 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"bank AS b2 ON b2.rowid = bu.fk_bank";
653 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"societe AS subSoc ON (bu.type = 'company' AND bu.url_id = subSoc.rowid)";
654 $sql .=
" WHERE ".
natural_search(array(
"subSoc.nom"), $search_thirdparty_user, 0, 1);
657if ($search_description) {
658 $search_description_to_use = $search_description;
659 $arrayoffixedlabels = array(
661 'CustomerInvoicePayment',
662 'CustomerInvoicePaymentBack',
663 'SupplierInvoicePayment',
664 'SupplierInvoicePaymentBack',
666 'ExpenseReportPayment',
667 'SocialContributionPayment',
668 'SubscriptionPayment',
671 foreach ($arrayoffixedlabels as $keyforlabel) {
672 $translatedlabel = $langs->transnoentitiesnoconv($keyforlabel);
673 if (preg_match(
'/'.$search_description.
'/i', $translatedlabel)) {
674 $search_description_to_use .=
"|".$keyforlabel;
680if ($search_bid > 0) {
681 $sql .=
" AND b.rowid = l.lineid AND l.fk_categ = ".((int) $search_bid);
683if (!empty($search_type)) {
684 $sql .=
" AND b.fk_type = '".$db->escape($search_type).
"'";
689 $sql .=
' AND b.amount <= 0';
693 $sql .=
' AND b.amount >= 0';
696include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
699$parameters = array();
700$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
701$sql .= $hookmanager->resPrint;
703$sql .=
$db->order($sortfield, $sortorder);
705$nbtotalofrecords =
'';
708 $result =
$db->query($sql);
709 $nbtotalofrecords =
$db->num_rows($result);
710 $nbtotalofpages = ceil($nbtotalofrecords / $limit);
713if (($id > 0 || !empty($ref)) && ((
string) $page ==
'')) {
716 $page = ($nbtotalofpages - 1);
717 $offset = $limit * $page;
722if ($page >= $nbtotalofpages) {
724 $page = ($nbtotalofpages - 1);
725 $offset = $limit * $page;
733if (empty($search_account)) {
734 $mode_balance_ok =
false;
737if (!empty($search_ref)) {
738 $mode_balance_ok =
false;
740if (!empty($search_description)) {
741 $mode_balance_ok =
false;
743if (!empty($search_type)) {
744 $mode_balance_ok =
false;
746if (!empty($search_debit)) {
747 $mode_balance_ok =
false;
749if (!empty($search_credit)) {
750 $mode_balance_ok =
false;
752if (!empty($search_thirdparty_user)) {
753 $mode_balance_ok =
false;
755if ($search_conciliated !=
'' && $search_conciliated !=
'-1') {
756 $mode_balance_ok =
false;
758if (!empty($search_num_releve)) {
759 $mode_balance_ok =
false;
761if (!empty($search_fk_bordereau)) {
762 $mode_balance_ok =
false;
765$sql .=
$db->plimit($limit + 1, $offset);
767dol_syslog(
'compta/bank/bankentries_list.php', LOG_DEBUG);
768$resql =
$db->query($sql);
770 $num =
$db->num_rows($resql);
772 $arrayofselected = (!empty($toselect) && is_array($toselect)) ? $toselect : array();
775 $arrayofmassactions = array(
779 if (in_array($massaction, array(
'presend',
'predelete'))) {
780 $arrayofmassactions = array();
782 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
785 if ($action ==
'delete') {
786 $text = $langs->trans(
'ConfirmDeleteTransaction');
787 print $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&rowid='.
GETPOSTINT(
"rowid"), $langs->trans(
'DeleteTransaction'), $text,
'confirm_delete',
null,
'', 1);
791 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'" name="search_form">'.
"\n";
792 if ($optioncss !=
'') {
793 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
795 print
'<input type="hidden" name="token" value="'.newToken().
'">';
796 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
797 print
'<input type="hidden" name="action" value="'.($action !=
'delete' ? $action :
'search').
'">';
799 print
'<input type="hidden" name="mode" value="'.dol_escape_htmltag($mode).
'">';
801 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
802 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
803 print
'<input type="hidden" name="page" value="'.$page.
'">';
804 print
'<input type="hidden" name="id" value="'.$id.
'">';
805 print
'<input type="hidden" name="ref" value="'.$ref.
'">';
807 print
'<input type="hidden" name="bid" value="'.GETPOSTINT(
"bid").
'">';
811 if ($user->hasRight(
'banque',
'modifier') && $action ==
'addline' &&
getDolGlobalString(
'BANK_USE_OLD_VARIOUS_PAYMENT')) {
814 print
'<table class="noborder centpercent">';
816 print
'<tr class="liste_titre">';
817 print
'<td>'.$langs->trans(
"Description").
'</td>';
818 print
'<td>'.$langs->trans(
"Date").
'</td>';
819 print
'<td> </td>';
820 print
'<td>'.$langs->trans(
"Type").
'</td>';
821 print
'<td>'.$langs->trans(
"Numero").
'</td>';
822 print
'<td class=right>'.$langs->trans(
"BankAccount").
'</td>';
823 print
'<td class=right>'.$langs->trans(
"Debit").
'</td>';
824 print
'<td class=right>'.$langs->trans(
"Credit").
'</td>';
831 print
'<td class="center"> </td>';
836 print
'<input name="label" class="flat minwidth200" type="text" value="'.GETPOST(
"label",
"alpha").
'">';
837 if (is_array($options) && count($options)) {
838 print
'<br>'.$langs->trans(
"Rubrique").
': ';
842 print
'<td class="nowrap">';
843 print $form->selectDate(empty($dateop) ? -1 : $dateop,
'op', 0, 0, 0,
'transaction');
845 print
'<td> </td>';
846 print
'<td class="nowrap">';
847 print $form->select_types_paiements((
GETPOST(
'operation') ?
GETPOST(
'operation') : (
$object->
type ==
Account::TYPE_CASH ?
'LIQ' :
'')),
'operation',
'1,2', 2, 1, 0, 0, 1,
'', 1);
850 print
'<input name="num_chq" class="flat" type="text" size="4" value="'.GETPOST(
"num_chq",
"alpha").
'">';
854 print
'<td class=right>';
855 print $form->select_comptes(
GETPOSTINT(
'add_account') ?
GETPOSTINT(
'add_account') : $search_account,
'add_account', 0,
'', 1, (
$id > 0 || !empty($ref) ?
' disabled="disabled"' :
''), 0,
'', 1);
858 print
'<td class="right"><input name="adddebit" class="flat" type="text" size="4" value="'.GETPOST(
"adddebit",
"alpha").
'"></td>';
859 print
'<td class="right"><input name="addcredit" class="flat" type="text" size="4" value="'.GETPOST(
"addcredit",
"alpha").
'"></td>';
866 print
'<td class="center">';
867 print
'<input type="submit" name="save" class="button buttongen marginbottomonly button-add" value="'.$langs->trans(
"Add").
'"><br>';
868 print
'<input type="submit" name="cancel" class="button buttongen marginbottomonly button-cancel" value="'.$langs->trans(
"Cancel").
'">';
876 $urlajax = DOL_URL_ROOT.
'/core/ajax/bankconciliate.php?format=dayreduceformat&token='.currentToken();
878 <script type="text/javascript">
880 $("a.ajaxforbankoperationchange").each(function(){
881 var current = $(this);
882 current.click(function()
884 var url = "'.$urlajax.
'&"+current.attr("href").split("?")[1];
885 console.log("We click on ajaxforbankoperationchange url="+url);
886 $.get(url, function(data)
889 current.parent().parent().find(".spanforajaxedit").replaceWith(data);
904 if ($action !=
'addline') {
906 if (
$object->status == $object::STATUS_CLOSED) {
907 $newcardbutton = dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'Bank account is closed',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.newToken().
'&page='.$page.$param,
'', -2);
910 $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->hasRight(
'banque',
'modifier'));
912 $newcardbutton = dolGetButtonTitle($langs->trans(
'AddBankRecord'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=addline&token='.newToken().
'&page='.$page.$param,
'', $user->hasRight(
'banque',
'modifier'));
916 $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);
922 if ($action !=
'addline' && $action !=
'reconcile' && $action !=
'confirm_deleteonreconcile') {
923 $morehtml .= $buttonreconcile;
926 $morehtmlright =
'<!-- Add New button -->'.$newcardbutton;
928 $picto =
'bank_account';
929 if ($id > 0 || !empty($ref)) {
934 print_barre_liste($langs->trans(
"BankTransactions"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton.$morehtml, $num, $nbtotalofrecords, $picto, 0, $morehtmlright,
'', $limit, 0, 0, 1);
937 if ($user->hasRight(
'banque',
'consolidate') && ($action ==
'reconcile' || $action ==
'confirm_deleteonreconcile')) {
940 $listoflastreceipts =
'';
941 $sql =
"SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX.
"bank";
942 $sql .=
" WHERE fk_account = ".((int)
$object->id).
" AND num_releve IS NOT NULL";
943 $sql .=
$db->order(
"num_releve",
"DESC");
944 $sql .=
$db->plimit($nbmax + 1);
946 $last_receipts = array();
951 $resqlr =
$db->query($sql);
954 $numr =
$db->num_rows($resqlr);
955 while (($i < $numr) && ($i < $nbmax)) {
956 $objr =
$db->fetch_object($resqlr);
958 $last_receipts[] = $objr->num_releve;
960 $last_releve = $objr->num_releve;
968 print
'<!-- form with reconciliation input -->'.
"\n";
969 print
'<div class="valignmiddle inline-block" style="padding-right: 20px;">';
971 print
'<strong>'.$langs->trans(
"InputReceiptNumber").
'</strong>: ';
972 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') :
'').
'">';
974 $texttoshow = $langs->trans(
"InputReceiptNumber").
': ';
975 $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);
976 $mm =
dol_substr($langs->transnoentitiesnoconv(
"Month"), 0, 1).substr($langs->transnoentitiesnoconv(
"Month"), 0, 1);
977 $dd =
dol_substr($langs->transnoentitiesnoconv(
"Day"), 0, 1).substr($langs->transnoentitiesnoconv(
"Day"), 0, 1);
978 $placeholder = $yyyy.$mm;
979 $placeholder2 = $yyyy.$mm;
980 $placeholder2 .=
' '.$langs->trans(
"or").
' ';
981 $placeholder2 .= $yyyy.$mm.$dd;
983 $texttoshow .= $langs->trans(
"InputReceiptNumberBis");
986 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') :
'').
'">';
990 if (!empty($last_receipts)) {
991 print
'<datalist id="num_releve_list">';
992 foreach ($last_receipts as $num_releve) {
993 print
'<option value="'.$num_releve.
'"></option>';
999 if (is_array($options) && count($options)) {
1000 print $langs->trans(
"EventualyAddCategory").
': ';
1003 print
'<br><div style="margin-top: 5px;"><span class="opacitymedium">'.$langs->trans(
"ThenCheckLinesAndConciliate").
'</span> ';
1004 print
'<input type="submit" class="button" name="confirm_reconcile" value="'.$langs->trans(
"Conciliate").
'">';
1005 print
' <span class="opacitymedium">'.$langs->trans(
"otherwise").
'</span> ';
1006 print
'<input type="submit" class="button small" name="confirm_savestatement" value="'.$langs->trans(
"SaveStatementOnly").
'">';
1012 print
'<!-- Last bank statements -->'.
"\n";
1013 print $langs->trans(
"LastAccountStatements").
' : ';
1015 foreach ($last_receipts as $num_releve) {
1016 $newentreyinlist =
'<a target="_blank" href="'.DOL_URL_ROOT.
'/compta/bank/releve.php?account='.((int) $id).
'&num='.urlencode($num_releve).
'">';
1017 $newentreyinlist .=
img_picto($num_releve,
'generic',
'class="paddingright"');
1019 $listoflastreceipts = $newentreyinlist.$listoflastreceipts;
1021 if ($numr >= $nbmax) {
1022 $listoflastreceipts =
"... ".$listoflastreceipts;
1024 print $listoflastreceipts;
1026 print
'<b>'.$langs->trans(
"None").
'</b>';
1032 <script type="text/javascript">
1033 $("#num_releve").val("' . $last_releve.
'");
1042 $param .=
'&page='.urlencode((
string) ($page));
1045 $moreforfilter =
'';
1046 $moreforfilter .=
'<div class="divsearchfield">';
1047 $moreforfilter .= $langs->trans(
'DateOperationShort');
1048 $moreforfilter .= (
$conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1049 $moreforfilter .=
'<div class="nowrap inline-block">';
1050 $moreforfilter .= $form->selectDate($search_dt_start,
'search_start_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1051 $moreforfilter .=
'</div>';
1052 $moreforfilter .= (
$conf->browser->layout ==
'phone' ?
'' :
' ');
1053 $moreforfilter .=
'<div class="nowrap inline-block">';
1054 $moreforfilter .= $form->selectDate($search_dt_end,
'search_end_dt', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1055 $moreforfilter .=
'</div>';
1056 $moreforfilter .=
'</div>';
1058 $moreforfilter .=
'<div class="divsearchfield">';
1059 $moreforfilter .= $langs->trans(
'DateValueShort');
1060 $moreforfilter .= (
$conf->browser->layout ==
'phone' ?
'<br>' :
' ');
1061 $moreforfilter .=
'<div class="nowrap inline-block">';
1062 $moreforfilter .= $form->selectDate($search_dv_start,
'search_start_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1063 $moreforfilter .=
'</div>';
1064 $moreforfilter .= (
$conf->browser->layout ==
'phone' ?
'' :
' ');
1065 $moreforfilter .=
'<div class="nowrap inline-block">';
1066 $moreforfilter .= $form->selectDate($search_dv_end,
'search_end_dv', 0, 0, 1,
"search_form", 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1067 $moreforfilter .=
'</div>';
1068 $moreforfilter .=
'</div>';
1072 if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1073 $langs->load(
'categories');
1076 $moreforfilter .=
'<div class="divsearchfield">';
1077 $tmptitle = $langs->trans(
'RubriquesTransactions');
1078 $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, $search_bid,
'parent', 0, 0, 1);
1079 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$form->selectarray(
'search_bid', $cate_arbo, $search_bid, $tmptitle, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1080 $moreforfilter .=
'</div>';
1084 $parameters = array();
1085 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1086 if (empty($reshook)) {
1087 $moreforfilter .= $hookmanager->resPrint;
1089 $moreforfilter = $hookmanager->resPrint;
1092 if ($moreforfilter) {
1093 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1094 print $moreforfilter;
1095 print
'</div>'.
"\n";
1098 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1099 $htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
1100 $selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
1101 $selectedfields .= (($action ==
'reconcile' || $action ==
'confirm_deleteonreconcile') ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1104 if ($action ==
'reconcile' || $action ==
'confirm_deleteonreconcile') {
1105 $arrayfields[
'b.num_releve'][
'checked'] = 1;
1108 print
'<div class="div-table-responsive">';
1109 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1113 print
'<tr class="liste_titre_filter">';
1115 if (
$conf->main_checkbox_left_column) {
1116 print
'<td class="liste_titre valignmiddle center">';
1117 $searchpicto = $form->showFilterButtons(
'left');
1123 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1124 print
'<td class="liste_titre">';
1125 print
'<input type="text" class="flat" name="search_ref" size="2" value="'.dol_escape_htmltag($search_ref).
'">';
1128 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1129 print
'<td class="liste_titre">';
1130 print
'<input type="text" class="flat maxwidth100" name="search_description" value="'.dol_escape_htmltag($search_description).
'">';
1133 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1134 print
'<td class="liste_titre"> </td>';
1136 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1137 print
'<td class="liste_titre"> </td>';
1140 if (!empty($arrayfields[
'type'][
'checked'])) {
1141 print
'<td class="liste_titre">';
1142 print $form->select_types_paiements(empty($search_type) ?
'' : $search_type,
'search_type',
'', 2, 1, 1, 0, 1,
'maxwidth100', 1);
1146 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1147 print
'<td class="liste_titre center"><input type="text" class="flat" name="req_nb" value="'.dol_escape_htmltag($search_req_nb).
'" size="2"></td>';
1150 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1151 print
'<td class="liste_titre center"><input type="text" class="flat width50" name="search_fk_bordereau" value="'.dol_escape_htmltag($search_fk_bordereau).
'"></td>';
1154 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1155 print
'<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty_user).
'"></td>';
1158 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1159 print
'<td class="liste_titre">';
1160 $form->select_comptes($search_account,
'search_account', 0,
'', 1, ($id > 0 || !empty($ref) ?
' disabled="disabled"' :
''), 0,
'maxwidth100');
1164 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1165 print
'<td class="liste_titre right">';
1166 print
'<input type="text" class="flat width50" name="search_debit" value="'.dol_escape_htmltag($search_debit).
'">';
1170 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1171 print
'<td class="liste_titre right">';
1172 print
'<input type="text" class="flat width50" name="search_credit" value="'.dol_escape_htmltag($search_credit).
'">';
1176 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1177 print
'<td class="liste_titre right">';
1178 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1179 print $form->textwithpicto(
'', $htmltext, 1);
1183 if (!empty($arrayfields[
'balance'][
'checked'])) {
1184 print
'<td class="liste_titre right">';
1185 $htmltext = $langs->trans(
"BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv(
"DateValue"));
1186 print $form->textwithpicto(
'', $htmltext, 1);
1190 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1192 print
'<td class="liste_titre center"><input type="text" class="flat width50" name="search_num_releve" value="'.dol_escape_htmltag($search_num_releve).
'"></td>';
1195 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1196 print
'<td class="liste_titre center parentonrightofpage">';
1197 print $form->selectyesno(
'search_conciliated', $search_conciliated, 1,
false, 1, 1,
'search_status onrightofpage width75');
1201 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1203 print
'<td class="nowraponall center"></td>';
1206 if (!
$conf->main_checkbox_left_column) {
1207 print
'<td class="liste_titre valignmiddle center">';
1210 $searchpicto = $form->showFilterButtons();
1220 print
'<tr class="liste_titre">';
1222 if (
$conf->main_checkbox_left_column) {
1223 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1226 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1227 print_liste_field_titre($arrayfields[
'b.rowid'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rowid',
'', $param,
'', $sortfield, $sortorder);
1230 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1231 print_liste_field_titre($arrayfields[
'b.label'][
'label'], $_SERVER[
'PHP_SELF'],
'b.label',
'', $param,
'', $sortfield, $sortorder);
1234 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1235 print_liste_field_titre($arrayfields[
'b.dateo'][
'label'], $_SERVER[
'PHP_SELF'],
'b.dateo',
'', $param,
'', $sortfield, $sortorder,
"center ");
1238 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1239 print_liste_field_titre($arrayfields[
'b.datev'][
'label'], $_SERVER[
'PHP_SELF'],
'b.datev,b.dateo,b.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1242 if (!empty($arrayfields[
'type'][
'checked'])) {
1243 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1246 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1247 print_liste_field_titre($arrayfields[
'b.num_chq'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_chq',
'', $param,
'', $sortfield, $sortorder,
"center ");
1250 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1251 print_liste_field_titre($arrayfields[
'b.fk_bordereau'][
'label'], $_SERVER[
'PHP_SELF'],
'b.fk_bordereau',
'', $param,
'', $sortfield, $sortorder,
"center ");
1254 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1255 print_liste_field_titre($arrayfields[
'bu.label'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1258 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1259 print_liste_field_titre($arrayfields[
'ba.ref'][
'label'], $_SERVER[
'PHP_SELF'],
'ba.ref',
'', $param,
'', $sortfield, $sortorder);
1262 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1263 print_liste_field_titre($arrayfields[
'b.debit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1266 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1267 print_liste_field_titre($arrayfields[
'b.credit'][
'label'], $_SERVER[
'PHP_SELF'],
'b.amount',
'', $param,
'', $sortfield, $sortorder,
"right ");
1270 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1271 print_liste_field_titre($arrayfields[
'balancebefore'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1274 if (!empty($arrayfields[
'balance'][
'checked'])) {
1275 print_liste_field_titre($arrayfields[
'balance'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
"right ");
1278 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1280 print_liste_field_titre($arrayfields[
'b.num_releve'][
'label'], $_SERVER[
'PHP_SELF'],
'b.num_releve',
'', $param,
'', $sortfield, $sortorder,
"center ");
1283 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1284 print_liste_field_titre($arrayfields[
'b.conciliated'][
'label'], $_SERVER[
'PHP_SELF'],
'b.rappro',
'', $param,
'', $sortfield, $sortorder,
"center ");
1289 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1291 $parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1292 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1293 print $hookmanager->resPrint;
1295 print
'<td class="nowraponall center"></td>';
1298 if (!
$conf->main_checkbox_left_column) {
1300 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1307 $balancecalculated =
false;
1308 $posconciliatecol = 0;
1309 $cachebankaccount = array();
1321 $imaxinloop = ($limit ? min($num, $limit) : $num);
1322 while ($i < $imaxinloop) {
1323 $objp =
$db->fetch_object($resql);
1324 $links = $bankaccountstatic->get_url($objp->rowid);
1326 if (!$balancecalculated && (!empty($arrayfields[
'balancebefore'][
'checked']) || !empty($arrayfields[
'balance'][
'checked'])) && ($mode_balance_ok || $search_conciliated ===
'0')) {
1327 if (!$search_account) {
1328 dol_print_error(
null,
'account is not defined but $mode_balance_ok is true');
1335 $sqlforbalance =
'SELECT SUM(b.amount) as previoustotal';
1336 $sqlforbalance .=
" FROM ";
1337 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank_account as ba,";
1338 $sqlforbalance .=
" ".MAIN_DB_PREFIX.
"bank as b";
1339 $sqlforbalance .=
" WHERE b.fk_account = ba.rowid";
1340 $sqlforbalance .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
1341 $sqlforbalance .=
" AND b.fk_account = ".((int) $search_account);
1343 $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.
"))))";
1344 $resqlforbalance =
$db->query($sqlforbalance);
1347 if ($resqlforbalance) {
1348 $objforbalance =
$db->fetch_object($resqlforbalance);
1349 if ($objforbalance) {
1351 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1352 $balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount);
1355 $balance = $objforbalance->previoustotal;
1362 $balancecalculated =
true;
1365 if ($user->hasRight(
'banque',
'consolidate') && ($action ==
'reconcile' || $action ==
'confirm_deleteonreconcile')) {
1366 $tmpnbfieldbeforebalance = 0;
1367 $tmpnbfieldafterbalance = 0;
1368 $balancefieldfound = 0;
1369 foreach ($arrayfields as $key => $val) {
1370 if ($key ==
'balancebefore' || $key ==
'balance') {
1371 $balancefieldfound++;
1374 if (!empty($arrayfields[$key][
'checked'])) {
1375 if (!$balancefieldfound) {
1376 $tmpnbfieldbeforebalance++;
1378 $tmpnbfieldafterbalance++;
1383 $element = $extrafieldsobjectkey;
1384 if (!empty($extrafields->attributes[$element][
'label']) && is_array($extrafields->attributes[$element][
'label']) && count($extrafields->attributes[$element][
'label'])) {
1385 foreach ($extrafields->attributes[$element][
'label'] as $key => $val) {
1386 if (!empty($arrayfields[
"ef.".$key][
'checked'])) {
1387 if (!empty($arrayfields[$key][
'checked'])) {
1388 if (!$balancefieldfound) {
1389 $tmpnbfieldbeforebalance++;
1391 $tmpnbfieldafterbalance++;
1398 print
'<tr class="oddeven trforbreak">';
1400 if (
$conf->main_checkbox_left_column) {
1403 if ($tmpnbfieldbeforebalance) {
1404 print
'<td colspan="'.$tmpnbfieldbeforebalance.
'">';
1409 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1410 print
'<td class="right">';
1411 if ($search_conciliated !==
'0') {
1412 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1420 if (!empty($arrayfields[
'balance'][
'checked'])) {
1421 print
'<td class="right">';
1422 if ($search_conciliated !==
'0') {
1423 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1432 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1437 print
'<td colspan="'.($tmpnbfieldafterbalance).
'">';
1442 if (!
$conf->main_checkbox_left_column) {
1450 if ($sortfield ==
'b.datev,b.dateo,b.rowid' && ($sortorder ==
'desc' || $sortorder ==
'desc,desc' || $sortorder ==
'desc,desc,desc')) {
1451 $balance =
price2num($balancebefore,
'MT');
1452 $balancebefore =
price2num($balancebefore - ($sign * $objp->amount),
'MT');
1454 $balancebefore =
price2num($balance,
'MT');
1455 $balance =
price2num($balance + ($sign * $objp->amount),
'MT');
1458 if (empty($cachebankaccount[$objp->bankid])) {
1460 $bankaccounttmp->fetch($objp->bankid);
1461 $cachebankaccount[$objp->bankid] = $bankaccounttmp;
1462 $bankaccount = $bankaccounttmp;
1464 $bankaccount = $cachebankaccount[$objp->bankid];
1468 $backgroundcolor =
"class='oddeven'";
1470 if ($objp->amount < 0) {
1472 $backgroundcolor =
'style="background: '.$color.
';"';
1475 $backgroundcolor =
'style="background: '.$color.
';"';
1479 $banklinestatic->id = $objp->rowid;
1480 $banklinestatic->ref = (
string) $objp->rowid;
1482 print
'<tr class="oddeven" '.$backgroundcolor.
'>';
1485 if (
$conf->main_checkbox_left_column) {
1486 print
'<td class="center">';
1487 if (!$objp->conciliated && ($action ==
'reconcile' || $action ==
'confirm_deleteonreconcile')) {
1488 print
'<input class="flat checkforselect" name="rowid['.$objp->rowid.
']" type="checkbox" name="toselect[]" value="'.$objp->rowid.
'" size="1"'.(!empty($tmparray[$objp->rowid]) ?
' checked' :
'').
'>';
1497 if (!empty($arrayfields[
'b.rowid'][
'checked'])) {
1498 print
'<td class="nowrap left">';
1499 print $banklinestatic->getNomUrl(1);
1507 if (!empty($arrayfields[
'b.label'][
'checked'])) {
1511 preg_match(
'/\((.+)\)/i', $objp->label, $reg);
1512 if (!empty($reg[1]) && $langs->trans($reg[1]) != $reg[1]) {
1514 $labeltoshow = $langs->trans($reg[1]);
1516 if ($objp->label ==
'(payment_salary)') {
1517 $labeltoshow = $langs->trans(
"SalaryPayment");
1520 $titletoshow = $objp->label;
1525 print
'<td class="tdoverflowmax250"'.($titletoshow ?
' title="'.dol_escape_htmltag($titletoshow).
'"' :
'').
'>';
1528 $cachebankaccount = array();
1529 foreach ($links as $key => $val) {
1530 print
'<!-- '.$links[$key][
'type'].
' -->';
1531 if ($links[$key][
'type'] ==
'withdraw') {
1532 $banktransferstatic->id = $links[$key][
'url_id'];
1533 $banktransferstatic->ref = $links[$key][
'label'];
1534 print $banktransferstatic->getNomUrl(0).($labeltoshow ?
' ' :
'');
1535 } elseif ($links[$key][
'type'] ==
'payment') {
1536 $paymentstatic->id = $links[$key][
'url_id'];
1537 $paymentstatic->ref = (
string) $links[$key][
'url_id'];
1538 $paymentstatic->date =
$db->jdate($objp->do);
1539 print $paymentstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1540 } elseif ($links[$key][
'type'] ==
'payment_supplier') {
1541 $paymentsupplierstatic->id = $links[$key][
'url_id'];
1542 $paymentsupplierstatic->ref = (
string) $links[$key][
'url_id'];
1543 print $paymentsupplierstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1544 } elseif ($links[$key][
'type'] ==
'payment_sc') {
1545 $paymentscstatic->id = $links[$key][
'url_id'];
1546 $paymentscstatic->ref = (
string) $links[$key][
'url_id'];
1547 $paymentscstatic->label = $links[$key][
'label'];
1548 print $paymentscstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1549 } elseif ($links[$key][
'type'] ==
'payment_vat') {
1550 $paymentvatstatic->id = $links[$key][
'url_id'];
1551 $paymentvatstatic->ref = (
string) $links[$key][
'url_id'];
1552 print $paymentvatstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1553 } elseif ($links[$key][
'type'] ==
'payment_salary') {
1554 $paymentsalstatic->id = $links[$key][
'url_id'];
1555 $paymentsalstatic->ref = (
string) $links[$key][
'url_id'];
1556 $paymentsalstatic->label = $links[$key][
'label'];
1557 print $paymentsalstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1558 } elseif ($links[$key][
'type'] ==
'payment_loan') {
1559 print
'<a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$links[$key][
'url_id'].
'">';
1560 print
' '.img_object($langs->trans(
'ShowPayment'),
'payment').
' ';
1561 print
'</a>'.($labeltoshow ?
' ' :
'');
1562 } elseif ($links[$key][
'type'] ==
'payment_donation') {
1563 $paymentdonationstatic->id = $links[$key][
'url_id'];
1564 $paymentdonationstatic->ref = (
string) $links[$key][
'url_id'];
1565 print $paymentdonationstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1566 } elseif ($links[$key][
'type'] ==
'payment_expensereport') {
1567 $paymentexpensereportstatic->id = $links[$key][
'url_id'];
1568 $paymentexpensereportstatic->ref = (
string) $links[$key][
'url_id'];
1569 print $paymentexpensereportstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1570 } elseif ($links[$key][
'type'] ==
'payment_various') {
1571 $paymentvariousstatic->id = $links[$key][
'url_id'];
1572 $paymentvariousstatic->ref = (
string) $links[$key][
'url_id'];
1573 print $paymentvariousstatic->getNomUrl(2).($labeltoshow ?
' ' :
'');
1574 } elseif ($links[$key][
'type'] ==
'banktransfert') {
1576 if ($objp->amount > 0) {
1577 $banklinestatic->fetch($links[$key][
'url_id']);
1578 $bankstatic->id = $banklinestatic->fk_account;
1579 $bankstatic->label = $banklinestatic->bank_account_ref;
1580 print $langs->trans(
"TransferFrom").
' ';
1581 print $bankstatic->getNomUrl(1,
'transactions');
1582 print
' '.$langs->trans(
"toward").
' ';
1583 $bankstatic->id = $objp->bankid;
1584 $bankstatic->label = $objp->bankref;
1585 print $bankstatic->getNomUrl(1,
'');
1586 print($labeltoshow ?
' - ' :
'');
1588 $bankstatic->id = $objp->bankid;
1589 $bankstatic->label = $objp->bankref;
1590 print $langs->trans(
"TransferFrom").
' ';
1591 print $bankstatic->getNomUrl(1,
'');
1592 print
' '.$langs->trans(
"toward").
' ';
1593 $banklinestatic->fetch($links[$key][
'url_id']);
1594 $bankstatic->id = $banklinestatic->fk_account;
1595 $bankstatic->label = $banklinestatic->bank_account_ref;
1596 print $bankstatic->getNomUrl(1,
'transactions');
1597 print($labeltoshow ?
' - ' :
'');
1600 } elseif ($links[$key][
'type'] ==
'company') {
1601 } elseif ($links[$key][
'type'] ==
'user') {
1602 } elseif ($links[$key][
'type'] ==
'member') {
1603 } elseif ($links[$key][
'type'] ==
'sc') {
1604 } elseif ($links[$key][
'type'] ==
'vat') {
1605 } elseif ($links[$key][
'type'] ==
'salary') {
1609 print
'<a href="'.$links[$key][
'url'].$links[$key][
'url_id'].
'">';
1610 if (preg_match(
'/^\((.*)\)$/i', $links[$key][
'label'], $reg)) {
1612 if ($reg[1] ==
'paiement') {
1613 $reg[1] =
'Payment';
1615 print $langs->trans($reg[1]);
1617 print $links[$key][
'label'];
1619 print
'</a>'.($labeltoshow ?
' - ' :
'');
1632 if (!empty($arrayfields[
'b.dateo'][
'checked'])) {
1633 print
'<td class="nowraponall center">';
1634 print
'<span class="spanforajaxedit" id="dateoperation_'.$objp->rowid.
'" title="'.
dol_print_date(
$db->jdate($objp->do),
"day").
'">';
1638 print
'<span class="inline-block">';
1639 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=doprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1641 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=donext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1651 if (!empty($arrayfields[
'b.datev'][
'checked'])) {
1652 print
'<td class="nowraponall center">';
1653 print
'<span class="spanforajaxedit" id="datevalue_'.$objp->rowid.
'" title="'.
dol_print_date(
$db->jdate($objp->dv),
"day").
'">';
1657 print
'<span class="inline-block">';
1658 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvprev&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1660 print
'<a class="ajaxforbankoperationchange" href="'.$_SERVER[
'PHP_SELF'].
'?action=dvnext&account='.$objp->bankid.
'&rowid='.$objp->rowid.
'">';
1670 if (!empty($arrayfields[
'type'][
'checked'])) {
1671 $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);
1672 if (empty($arrayfields[
'b.num_chq'][
'checked'])) {
1673 $labeltype .= ($objp->num_chq ?
' <span class="opacitymedium">- '.$objp->num_chq.
'</span>' :
'');
1675 print
'<td class="tdoverflowmax100" title="'.dolPrintLabel($labeltype).
'">';
1676 if ($labeltype ==
'SOLD') {
1688 if (!empty($arrayfields[
'b.num_chq'][
'checked'])) {
1689 print
'<td class="tdoverflowmax100 center" title="'.($objp->num_chq ?
dolPrintLabel($objp->num_chq) :
"").
'">'.($objp->num_chq ?
dolPrintLabel($objp->num_chq) :
"").
"</td>\n";
1696 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1697 $bordereaustatic->fetch($objp->fk_bordereau);
1698 print
'<td class="nowraponall center">';
1699 print $bordereaustatic->getNomUrl();
1707 if (!empty($arrayfields[
'bu.label'][
'checked'])) {
1708 print
'<td class="tdoverflowmax125">';
1710 $companylinked_id = 0;
1716 foreach ($links as $key => $value) {
1717 if ($links[$key][
'type'] ==
'payment_sc') {
1718 $type_link =
'payment_sc';
1720 if ($links[$key][
'type'] ==
'payment_salary') {
1721 $type_link =
'payment_salary';
1723 if ($links[$key][
'type'] ==
'payment_donation') {
1724 $paymentdonationstatic->fetch($links[$key][
'url_id']);
1725 $donstatic->fetch($paymentdonationstatic->fk_donation);
1726 $companylinked_id = $donstatic->socid;
1727 if (!$companylinked_id) {
1728 $thirdstr = ($donstatic->societe !==
"" ?
1729 $donstatic->societe :
1730 $donstatic->firstname.
" ".$donstatic->lastname);
1733 if ($links[$key][
'type'] ==
'payment_expensereport') {
1734 $type_link =
'payment_expensereport';
1737 if ($links[$key][
'type'] ==
'company') {
1738 $companylinked_id = $links[$key][
'url_id'];
1740 if ($links[$key][
'type'] ==
'user') {
1741 $userlinked_id = $links[$key][
'url_id'];
1746 if ($companylinked_id) {
1748 $companystatic->fetch($companylinked_id);
1749 print $companystatic->getNomUrl(1);
1750 } elseif ($userlinked_id &&
1751 (($type_link ==
'payment_salary' && $user->hasRight(
'salaries',
'read'))
1752 || ($type_link ==
'payment_sc' && $user->hasRight(
'tax',
'charges',
'lire'))
1753 || ($type_link ==
'payment_expensereport' && $user->hasRight(
'expensereport',
'lire')))) {
1755 if (!empty(
$conf->cache[
'user'][$userlinked_id])) {
1756 $tmpuser =
$conf->cache[
'user'][$userlinked_id];
1759 $tmpuser->fetch($userlinked_id);
1760 $conf->cache[
'user'][$userlinked_id] = $tmpuser;
1762 print $tmpuser->getNomUrl(-1);
1763 } elseif ($thirdstr) {
1776 if (!empty($arrayfields[
'ba.ref'][
'checked'])) {
1777 print
'<td class="nowrap">';
1778 print $bankaccount->getNomUrl(1);
1786 if (!empty($arrayfields[
'b.debit'][
'checked'])) {
1787 print
'<td class="nowraponall right"><span class="amount">';
1788 if ($objp->amount < 0) {
1789 print
price($objp->amount * -1);
1792 print
"</span></td>\n";
1802 if (!empty($arrayfields[
'b.credit'][
'checked'])) {
1803 print
'<td class="nowraponall right"><span class="amount">';
1804 if ($objp->amount > 0) {
1805 print
price($objp->amount);
1808 print
"</span></td>\n";
1818 if (!empty($arrayfields[
'balancebefore'][
'checked'])) {
1819 if ($mode_balance_ok) {
1820 if ($balancebefore >= 0) {
1821 print
'<td class="nowrap right"> '.price($balancebefore).
'</td>';
1823 print
'<td class="error nowrap right"> '.price($balancebefore).
'</td>';
1826 print
'<td class="right">-</td>';
1834 if (!empty($arrayfields[
'balance'][
'checked'])) {
1835 if ($mode_balance_ok) {
1836 if ($balance >= 0) {
1837 print
'<td class="nowrap right"> '.price($balance).
'</td>';
1839 print
'<td class="error nowrap right"> '.price($balance).
'</td>';
1842 print
'<td class="right">-</td>';
1849 if (!empty($arrayfields[
'b.num_releve'][
'checked'])) {
1850 print
'<td class="nowraponall center">';
1852 if ($bankaccount->canBeConciliated() > 0) {
1853 if ($objp->num_releve) {
1854 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>';
1865 if (!empty($arrayfields[
'b.conciliated'][
'checked'])) {
1866 print
'<td class="nowraponall center">';
1867 print
yn($objp->conciliated);
1874 if (!empty($arrayfields[
'b.fk_bordereau'][
'checked'])) {
1875 $bordereaustatic->fetch($objp->fk_bordereau);
1876 print
'<td class="nowraponall center">';
1877 print $bordereaustatic->getNomUrl();
1886 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1888 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $objp,
'i' => $i,
'totalarray' => &$totalarray);
1889 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1890 print $hookmanager->resPrint;
1893 print
'<td class="nowraponall center">';
1895 if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) {
1896 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.
'">';
1900 if ($user->hasRight(
'banque',
'modifier') || $user->hasRight(
'banque',
'consolidate')) {
1901 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.
'">';
1905 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.
'">';
1909 if ($bankaccount->canBeConciliated() > 0 && empty($objp->conciliated)) {
1910 if (
$db->jdate($objp->dv) < ($now -
$conf->bank->rappro->warning_delay)) {
1911 print
' '.img_warning($langs->trans(
"ReconciliationLate"));
1914 if ($user->hasRight(
'banque',
'modifier')) {
1917 $parambis = preg_replace(
'/&?action=(reconcile|confirm_deleteonreconcile)(&|$)/',
'\2', $param);
1918 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action='.($action ==
'reconcile' ?
'confirm_deleteonreconcile&confirm=yes' :
'delete').
'&token='.newToken().
'&rowid='.$objp->rowid.
'&page='.$page.$parambis.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
'').
'">';
1919 print
img_delete(
'',
'class="marginleftonly"');
1929 if (!
$conf->main_checkbox_left_column) {
1930 print
'<td class="center">';
1931 if (!$objp->conciliated && ($action ==
'reconcile' || $action ==
'confirm_deleteonreconcile')) {
1932 print
'<input class="flat checkforselect" name="rowid['.$objp->rowid.
']" type="checkbox" value="'.$objp->rowid.
'" size="1"'.(!empty($tmparray[$objp->rowid]) ?
' checked' :
'').
'>';
1946 if (isset($totalarray[
'totaldebfield']) || isset($totalarray[
'totalcredfield'])) {
1947 print
'<tr class="liste_total">';
1949 while ($i < $totalarray[
'nbfield']) {
1952 if ($num < $limit && empty($offset)) {
1953 print
'<td class="left">'.$langs->trans(
"Total").
'</td>';
1955 print
'<td class="left tdoverflowmax50" title="'.$langs->trans(
"Totalforthispage").
'">'.$langs->trans(
"Totalforthispage").
'</td>';
1957 } elseif ($totalarray[
'totaldebfield'] == $i) {
1958 print
'<td class="right"><span class="amount">'.price(-1 * $totalarray[
'totaldeb']).
'</span></td>';
1959 } elseif ($totalarray[
'totalcredfield'] == $i) {
1960 print
'<td class="right"><span class="amount">'.price($totalarray[
'totalcred']).
'</span></td>';
1961 } elseif ($i == $posconciliatecol) {
1962 print
'<td class="center">';
1974 foreach ($arrayfields as $key => $val) {
1975 if (!empty($val[
'checked'])) {
1979 print
'<tr><td colspan="'.($colspan + 1).
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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_now($mode='gmt')
Return date for now.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
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_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...
dolPrintLabel($s, $escapeonlyhtmltags=0)
Return a string label (so on 1 line only and that should not contains any HTML) ready to be output on...
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_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
img_edit_add($titlealt='default', $other='')
Show logo "+".
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
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.