[IMP] account: Bank statement reconciliation
It was impossible to make a partial reconciliation with several lines. Each time a new line is proposed for the reconciliation, the previous partial reconcialtion is canceled. The partial reconciliation can just be proposed on the last selected line when: self.get("balance") * (last_line.debit - last_line.credit)<0
This commit is contained in:
parent
1f07b9429c
commit
c02d0287d8
|
@ -1303,8 +1303,14 @@ openerp.account = function (instance) {
|
|||
|
||||
// Show or hide partial reconciliation
|
||||
if (self.get("mv_lines_selected").length > 0) {
|
||||
var propose_partial = self.getCreatedLines().length === 0 && self.get("mv_lines_selected").length === 1 && balance_type === "greater" && ! self.get("mv_lines_selected")[0].partial_reconcile;
|
||||
self.get("mv_lines_selected")[0].propose_partial_reconcile = propose_partial;
|
||||
var last_line = _.last(self.get("mv_lines_selected"));
|
||||
var propose_partial = self.getCreatedLines().length === 0
|
||||
&& balance_type === "greater"
|
||||
&& Math.abs(self.get("balance")) < Math.abs(last_line.debit - last_line.credit)
|
||||
&& self.get("balance") * (last_line.debit - last_line.credit) < 0
|
||||
&& ! last_line.partial_reconcile
|
||||
&& ! last_line.already_paid;
|
||||
last_line.propose_partial_reconcile = propose_partial;
|
||||
self.updateAccountingViewMatchedLines();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue