This commit is contained in:
armenrz 2007-05-09 08:55:11 +00:00
parent c17c1ae08c
commit 49d4a971c3
1 changed files with 17 additions and 0 deletions

View File

@ -324,6 +324,11 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
maxDate = line.getDateAcct();
}
setStatementDifference(total);
//AZ Goodwill
//refresh current balance
MBankAccount ba = MBankAccount.get(getCtx(), getC_BankAccount_ID());
setBeginningBalance(ba.getCurrentBalance());
//end AZ
setEndingBalance(getBeginningBalance().add(total));
if (!MPeriod.isOpen(getCtx(), minDate, MDocType.DOCBASETYPE_BankStatement)
|| !MPeriod.isOpen(getCtx(), maxDate, MDocType.DOCBASETYPE_BankStatement))
@ -457,6 +462,13 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
if (MFactAcct.delete(Table_ID, getC_BankStatement_ID(), get_TrxName()) < 0)
return false; // could not delete
}
//Added Lines by AZ Goodwill
//Recover Bank Account
MBankAccount ba = MBankAccount.get(getCtx(), getC_BankAccount_ID());
ba.setCurrentBalance(ba.getCurrentBalance().subtract(getStatementDifference()));
ba.save(get_TrxName());
//End of Added Lines
// Set lines to 0
MBankStatementLine[] lines = getLines(true);
@ -488,6 +500,11 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
MPayment payment = new MPayment (getCtx(), line.getC_Payment_ID(), get_TrxName());
payment.setIsReconciled(false);
payment.save(get_TrxName());
// MZ (Goodwill)
// set Payment to NULL
line.setC_Payment_ID(0);
line.save(get_TrxName());
// end MZ
}
}
}