From c982409c72bccec08afaa205249d01b83c5d7a8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Oct 2016 15:29:10 +0200 Subject: [PATCH] Fix a deadlock feature --- htdocs/compta/bank/account.php | 38 +++++++++++++++------ htdocs/core/modules/modAccounting.class.php | 5 ++- htdocs/langs/en_US/banks.lang | 4 ++- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 8adbfb1fcb5..15d20b333f4 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -81,6 +81,8 @@ $req_enddtday=GETPOST('req_enddtday', 'int'); $req_enddtyear=GETPOST('req_enddtyear', 'int'); $req_enddt = dol_mktime(23, 59, 59, $req_enddtmonth, $req_enddtday, $req_enddtyear); +$search_reconciled = GETPOST('search_reconciled'); + $vline=GETPOST("vline"); $page=GETPOST('page','int'); $negpage=GETPOST('negpage','int'); @@ -108,6 +110,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $req_enddtday=""; $req_enddtyear=""; $req_enddt = ""; + $search_reconciled = ''; } /* @@ -281,6 +284,8 @@ if ($id > 0 || ! empty($ref)) $mode_search = 1; } + if ($search_reconciled == 'reconciled') $sql_rech.=" AND num_releve IS NOT NULL"; + if ($search_reconciled == 'notreconciled') $sql_rech.=" AND num_releve IS NULL"; $sql = "SELECT count(*) as total"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; @@ -294,7 +299,8 @@ if ($id > 0 || ! empty($ref)) $sql.= " AND b.fk_account = ba.rowid"; $sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")"; $sql.= $sql_rech; - + print $sql; + dol_syslog("account.php count transactions -", LOG_DEBUG); $result=$db->query($sql); if ($result) @@ -492,6 +498,11 @@ if ($id > 0 || ! empty($ref)) * Show list of bank transactions */ + print '
'; + print ''; + print ''; + print ''; + print ''; // Ligne de titre tableau des ecritures @@ -504,19 +515,16 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - print ''; - print ''; + print ''; - - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; $period_filter .= $langs->trans('From').' '.$form->select_date($req_stdt,'req_stdt',0,0,1,null,1,0,1); $period_filter .= ' '; @@ -530,12 +538,16 @@ if ($id > 0 || ! empty($ref)) $form->select_types_paiements($paiementtype,'paiementtype',$filtertype,2,1,1,8); print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; - print ''; + print ''; @@ -919,6 +931,8 @@ if ($id > 0 || ! empty($ref)) print ''; } + print ''; + print ""; } @@ -935,6 +949,7 @@ if ($id > 0 || ! empty($ref)) print ' '.$object->currency_code.''; print ''; print ''; + print ''; print ''; } else { // Only total according row displays @@ -946,6 +961,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; + print ''; print ''; } $db->free($result); diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index af081130db4..f3ad949b879 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -207,11 +207,14 @@ class modAccounting extends DolibarrModules "chaine", "csv" ); + /* Not required to disable this. This make not possible to do complete reconciliation. + Also, this is not a problem, lines added manually will be reported as "not binded into accounting export module + and will be binded manually to be created into general ledger $this->const[24] = array( "BANK_DISABLE_DIRECT_INPUT", "yesno", "1" - ); + );*/ // Tabs $this->tabs = array(); diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 778f3ab1828..d3fdf872ad0 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -88,6 +88,8 @@ AddBankRecordLong=Add transaction manually ConciliatedBy=Reconciled by DateConciliating=Reconcile date BankLineConciliated=Transaction reconciled +Reconciled=Reconciled +NotReconciled=Not reconciled CustomerInvoicePayment=Customer payment SupplierInvoicePayment=Supplier payment SubscriptionPayment=Subscription payment @@ -131,7 +133,7 @@ FutureTransaction=Transaction in futur. No way to conciliate. SelectChequeTransactionAndGenerate=Select/filter checks to include into the check deposit receipt and click on "Create". InputReceiptNumber=Choose the bank statement related with the conciliation. Use a sortable numeric value: YYYYMM or YYYYMMDD EventualyAddCategory=Eventually, specify a category in which to classify the records -ToConciliate=To conciliate? +ToConciliate=To reconcile ? ThenCheckLinesAndConciliate=Then, check the lines present in the bank statement and click DefaultRIB=Default BAN AllRIB=All BAN
'.$langs->trans("ThirdParty").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("BankBalance").''; + print ''.$langs->trans("BankBalance").''; if ($object->canBeConciliated() > 0) { print $langs->trans("AccountStatementShort"); } else { print ' '; } - print '
 '; + print ''; + $array=array('reconciled'=>$langs->trans("Reconciled"), 'notreconciled'=>$langs->trans("NotReconciled")); + print $form->selectarray('search_reconciled', $array, $search_reconciled, 1); + print ''; $searchpitco=$form->showFilterAndCheckAddButtons(0); print $searchpitco; print '
'.price($total).'  
'.price($total_cred).''.price($total_cred-($total_deb*-1)).'