IDEMPIERE-1075 InvoiceNGL Bug

This commit is contained in:
anozimada 2013-06-19 11:53:25 -05:00
parent ac221701ca
commit f35a0b7ae0
1 changed files with 14 additions and 14 deletions

View File

@ -258,7 +258,20 @@ public class InvoiceNGL extends SvrProcess
continue;
MInvoice invoice = new MInvoice(getCtx(), gl.getC_Invoice_ID(), null);
if (invoice.getC_Currency_ID() == as.getC_Currency_ID())
continue;
continue;
//
if (AD_Org_ID == 0) // invoice org id
AD_Org_ID = gl.getAD_Org_ID();
// Change in Org
if (AD_Org_ID != gl.getAD_Org_ID())
{
createBalancing (asDefaultAccts, journal, drTotal, crTotal, AD_Org_ID, (i+1) * 10);
//
AD_Org_ID = gl.getAD_Org_ID();
drTotal = Env.ZERO;
crTotal = Env.ZERO;
journal = null;
}
//
if (journal == null)
{
@ -288,19 +301,6 @@ public class InvoiceNGL extends SvrProcess
line.setAmtSourceCr (cr);
line.setAmtAcctCr (cr);
line.saveEx();
//
if (AD_Org_ID == 0) // invoice org id
AD_Org_ID = gl.getAD_Org_ID();
// Change in Org
if (AD_Org_ID != gl.getAD_Org_ID())
{
createBalancing (asDefaultAccts, journal, drTotal, crTotal, AD_Org_ID, (i+1) * 10);
//
AD_Org_ID = gl.getAD_Org_ID();
drTotal = Env.ZERO;
crTotal = Env.ZERO;
journal = null;
}
}
createBalancing (asDefaultAccts, journal, drTotal, crTotal, AD_Org_ID, (list.size()+1) * 10);