Class FactUtil


  • public final class FactUtil
    extends Object
    Author:
    ancu
    • Constructor Detail

      • FactUtil

        public FactUtil()
    • Method Detail

      • createSimpleOperation

        public static FactLine[] createSimpleOperation​(Fact fact,
                                                       DocLine docLine,
                                                       MAccount account_DR,
                                                       MAccount account_CR,
                                                       int C_Currency_ID,
                                                       BigDecimal amt,
                                                       boolean signSensitive)
        Create a simple acct transaction, as fellows:
        
         if signSensitive == true then
         	if amt >= 0
         		account_DR	DR			 amt
         		account_CR		CR		 amt
        	if amt < 0
         		account_CR	DR			-amt
         		account_DR		CR		-amt
         if signSensitive == false then:
        		account_DR	DR			 amt
        		account_CR		CR		-amt
        		(same as when signSensitive==true and amt>=0)
         
        Note:
        • Operation index is automatically incremented
        Parameters:
        fact -
        docLine - Document line or null
        account_DR - DR account
        account_CR - CR account
        C_Currency_ID - Currency
        amt - amount
        signSensitive - if true, the DR and CR account will switch when amount is negative
        Returns:
        resulting two fact lines