BF [ 2804602 ] Doc_Order optimization if there are no requisitions

https://sourceforge.net/tracker/?func=detail&aid=2804602&group_id=176962&atid=879335
This commit is contained in:
teo_sarca 2009-06-11 05:13:17 +00:00
parent 9e62761e21
commit 31504f36a8
1 changed files with 12 additions and 9 deletions

View File

@ -397,15 +397,18 @@ public class Doc_Order extends Doc
getC_Currency_ID(), null, cost);
}
// Offset
MAccount offset = getAccount(ACCTTYPE_CommitmentOffset, as);
if (offset == null)
if (m_requisitions.length > 0)
{
p_Error = "@NotFound@ @CommitmentOffset_Acct@";
log.log(Level.SEVERE, p_Error);
return null;
MAccount offset = getAccount(ACCTTYPE_CommitmentOffset, as);
if (offset == null)
{
p_Error = "@NotFound@ @CommitmentOffset_Acct@";
log.log(Level.SEVERE, p_Error);
return null;
}
fact.createLine (null, offset,
getC_Currency_ID(), total, null);
}
fact.createLine (null, offset,
getC_Currency_ID(), total, null);
//
facts.add(fact);
} // reservations