Fix a deadlock feature

This commit is contained in:
Laurent Destailleur 2016-10-06 15:29:10 +02:00
parent db3e3642b0
commit c982409c72
3 changed files with 34 additions and 13 deletions

View File

@ -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 '<form action="'.$_SERVER["PHP_SELF"].'?'.$param.'" name="search" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="search">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<table class="noborder" width="100%">';
// Ligne de titre tableau des ecritures
@ -504,19 +515,16 @@ if ($id > 0 || ! empty($ref))
print '<td>'.$langs->trans("ThirdParty").'</td>';
print '<td align="right">'.$langs->trans("Debit").'</td>';
print '<td align="right">'.$langs->trans("Credit").'</td>';
print '<td align="right" width="80">'.$langs->trans("BankBalance").'</td>';
print '<td align="center" width="60">';
print '<td align="right">'.$langs->trans("BankBalance").'</td>';
print '<td align="center">';
if ($object->canBeConciliated() > 0) {
print $langs->trans("AccountStatementShort");
} else {
print '&nbsp;';
}
print '</td></tr>';
print '<form action="'.$_SERVER["PHP_SELF"].'?'.$param.'" name="search" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="search">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '</td>';
print '<td></td>';
print '</tr>';
$period_filter .= $langs->trans('From').'&nbsp;'.$form->select_date($req_stdt,'req_stdt',0,0,1,null,1,0,1);
$period_filter .= '&nbsp;';
@ -530,12 +538,16 @@ if ($id > 0 || ! empty($ref))
$form->select_types_paiements($paiementtype,'paiementtype',$filtertype,2,1,1,8);
print '</td>';
print '<td><input type="text" class="flat" name="req_nb" value="'.$req_nb.'" size="2"></td>';
print '<td><input type="text" class="flat" name="req_desc" value="'.$req_desc.'" size="24"></td>';
print '<td><input type="text" class="flat" name="req_desc" value="'.$req_desc.'" size="14"></td>';
print '<td><input type="text" class="flat" name="thirdparty" value="'.$thirdparty.'" size="14"></td>';
print '<td align="right"><input type="text" class="flat" name="req_debit" value="'.$req_debit.'" size="4"></td>';
print '<td align="right"><input type="text" class="flat" name="req_credit" value="'.$req_credit.'" size="4"></td>';
print '<td align="center">&nbsp;</td>';
print '<td class="liste_titre" align="right">';
print '<td align="center">';
$array=array('reconciled'=>$langs->trans("Reconciled"), 'notreconciled'=>$langs->trans("NotReconciled"));
print $form->selectarray('search_reconciled', $array, $search_reconciled, 1);
print '</td>';
print '<td class="liste_titre" align="right">';
$searchpitco=$form->showFilterAndCheckAddButtons(0);
print $searchpitco;
print '</td>';
@ -919,6 +931,8 @@ if ($id > 0 || ! empty($ref))
print '</td>';
}
print '<td></td>';
print "</tr>";
}
@ -935,6 +949,7 @@ if ($id > 0 || ! empty($ref))
print ' '.$object->currency_code.'</td>';
print '<td align="right" class="nowrap"><b>'.price($total).'</b></td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '</tr>';
} else {
// Only total according row displays
@ -946,6 +961,7 @@ if ($id > 0 || ! empty($ref))
print '<td align="right" class="nowrap"><b>'.price($total_cred).'</b></td>';
print '<td align="right" class="nowrap"><b>'.price($total_cred-($total_deb*-1)).'</b></td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '</tr>';
}
$db->free($result);

View File

@ -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();

View File

@ -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