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

@ -260,6 +260,19 @@ public class InvoiceNGL extends SvrProcess
if (invoice.getC_Currency_ID() == as.getC_Currency_ID()) 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) if (journal == null)
{ {
journal = new MJournal (batch); journal = new MJournal (batch);
@ -288,19 +301,6 @@ public class InvoiceNGL extends SvrProcess
line.setAmtSourceCr (cr); line.setAmtSourceCr (cr);
line.setAmtAcctCr (cr); line.setAmtAcctCr (cr);
line.saveEx(); 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); createBalancing (asDefaultAccts, journal, drTotal, crTotal, AD_Org_ID, (list.size()+1) * 10);