1 14 package org.compiere.model; 15 16 import java.util.*; 17 import java.sql.*; 18 import java.math.*; 19 20 import org.compiere.util.*; 21 22 28 public class MJournalLine extends X_GL_JournalLine 29 { 30 public MJournalLine (Properties ctx, int GL_JournalLine_ID) 31 { 32 super (ctx, GL_JournalLine_ID); 33 if (GL_JournalLine_ID == 0) 34 { 35 setLine (0); 40 setAmtAcctCr (Env.ZERO); 41 setAmtAcctDr (Env.ZERO); 42 setAmtSourceCr (Env.ZERO); 43 setAmtSourceDr (Env.ZERO); 44 setCurrencyRate (Env.ONE); 45 setCurrencyRateType (CURRENCYRATETYPE_Spot); 46 setDateAcct (new Timestamp(System.currentTimeMillis())); 47 setIsGenerated (true); 48 } 49 } 51 public MJournalLine (Properties ctx, ResultSet rs) 52 { 53 super (ctx, rs); 54 } 56 public void setGL_Journal_ID (int GL_Journal_ID) 57 { 58 super.setGL_Journal_ID (GL_Journal_ID); 59 } 60 61 66 public void setClientOrg (int AD_Client_ID, int AD_Org_ID) 67 { 68 super.setClientOrg(AD_Client_ID, AD_Org_ID); 69 } 71 72 78 public void setCurrency (int C_Currency_ID, String CurrencyRateType, BigDecimal CurrencyRate) 79 { 80 if (C_Currency_ID != 0) 81 setC_Currency_ID(C_Currency_ID); 82 if (CurrencyRateType != null && CurrencyRateType.length() != 0) 83 setCurrencyRateType(CurrencyRateType); 84 if (CurrencyRate != null && CurrencyRate.compareTo(Env.ZERO) == 0) 85 setCurrencyRate(CurrencyRate); 86 } 88 93 public void setAmtAcct (BigDecimal AmtAcctDr, BigDecimal AmtAcctCr) 94 { 95 if (AmtAcctDr != null && AmtAcctDr.compareTo(Env.ZERO) != 0) 96 super.setAmtAcctDr(AmtAcctDr); 97 if (AmtAcctCr != null && AmtAcctCr.compareTo(Env.ZERO) != 0) 98 super.setAmtAcctCr(AmtAcctCr); 99 } 101 102 103 } | Popular Tags |