From efd24cc1a2b27f613b0f29cb977410b1899615d7 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 1 Aug 2017 06:16:23 +0200 Subject: [PATCH 1/4] Fix: function length_accountg has been moved in getNomUrl --- htdocs/compta/bank/index.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 9bc8608692d..6c0d1613943 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -492,12 +492,10 @@ foreach ($accounts as $key=>$type) // Account number if (! empty($arrayfields['b.account_number']['checked'])) { - include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; - $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch('',$acc->account_number); - print ''.length_accountg($accountingaccount->getNomUrl(0,1,1,'',1)).''; + print ''.$accountingaccount->getNomUrl(0,1,1,'',1).''; if (! $i) $totalarray['nbfield']++; } From 9629a50853fb81953e17e012d4c7d84ae0be9c73 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 1 Aug 2017 06:21:19 +0200 Subject: [PATCH 2/4] Fix: SQL error in payment list --- htdocs/compta/paiement/list.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 4a7a2e3c81a..bddc5e9f500 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -3,8 +3,9 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2017 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,14 +32,15 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; $langs->load("bills"); $langs->load("compta"); // Security check -$facid =GETPOST('facid','int'); -$socid =GETPOST('socid','int'); -$userid=GETPOST('userid','int'); +$facid = GETPOST('facid','int'); +$socid = GETPOST('socid','int'); +$userid = GETPOST('userid','int'); $day = GETPOST('day','int'); $month = GETPOST('month','int'); $year = GETPOST('year','int'); @@ -129,7 +131,7 @@ else $sql = "SELECT DISTINCT p.rowid, p.ref, p.datep as dp, p.amount,"; // DISTINCT is to avoid duplicate when there is a link to sales representatives $sql.= " p.statut, p.num_paiement,"; $sql.= " c.code as paiement_code,"; - $sql.= " ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.accountancy_journal as accountancy_journal,"; + $sql.= " ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.fk_accountancy_journal as accountancy_journal,"; $sql.= " s.rowid as socid, s.nom as name"; // Add fields for extrafields foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; @@ -329,7 +331,11 @@ if ($resql) $accountstatic->label=$objp->blabel; $accountstatic->number=$objp->number; $accountstatic->account_number=$objp->account_number; - $accountstatic->accountancy_journal=$objp->accountancy_journal; + + $accountingjournal = new AccountingJournal($db); + $accountingjournal->fetch($objp->accountancy_journal); + $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1); + print $accountstatic->getNomUrl(1); } else print ' '; From 3c34add0d60c4351045fd1cdb221baa31724a961 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 1 Aug 2017 06:26:35 +0200 Subject: [PATCH 3/4] remove condition --- htdocs/compta/paiement/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index bddc5e9f500..04dbaf8fc11 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; $langs->load("bills"); $langs->load("compta"); From 4cb2a0bce27e6e559ed5ddedaf9142cf6b1086bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Aug 2017 15:17:30 +0200 Subject: [PATCH 4/4] Update list.php --- htdocs/compta/paiement/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 04dbaf8fc11..8344ed08095 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -334,7 +334,7 @@ if ($resql) $accountingjournal = new AccountingJournal($db); $accountingjournal->fetch($objp->accountancy_journal); - $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1); + $accountstatic->accountancy_journal = $accountingjournal->code; print $accountstatic->getNomUrl(1); }