Modifications for POSterita

This commit is contained in:
shameem_z 2007-09-20 06:20:59 +00:00
parent 6699c75ed8
commit 9826e3c4df
1 changed files with 23 additions and 1 deletions

View File

@ -1647,8 +1647,30 @@ public class MInvoice extends X_C_Invoice implements DocAction
// Create Cash
if (PAYMENTRULE_Cash.equals(getPaymentRule()))
{
MCash cash = MCash.get (getCtx(), getAD_Org_ID(),
// Modifications for POSterita
/*
MCash cash = MCash.get (getCtx(), getAD_Org_ID(),
getDateInvoiced(), getC_Currency_ID(), get_TrxName());
*/
MCash cash;
int posId = Env.getContextAsInt(getCtx(),Env.POS_ID);
if (posId != 0)
{
MPOS pos = new MPOS(getCtx(),posId,get_TrxName());
int cashBookId = pos.getC_CashBook_ID();
cash = MCash.get(getCtx(),cashBookId,getDateInvoiced(),get_TrxName());
}
else
{
cash = MCash.get (getCtx(), getAD_Org_ID(),
getDateInvoiced(), getC_Currency_ID(), get_TrxName());
}
// End Posterita Modifications
if (cash == null || cash.get_ID() == 0)
{
m_processMsg = "@NoCashBook@";