src-db/database/model/triggers/GL_JOURNALLINE2_TRG.xml
changeset 20217 d62cb5baa0c1
parent 19528 ddafe117203b
child 21737 fcb87e990fcd
equal deleted inserted replaced
20216:0136c51b6c5f 20217:d62cb5baa0c1
    58   FROM C_AcctSchema a,
    58   FROM C_AcctSchema a,
    59     C_Currency c
    59     C_Currency c
    60   WHERE a.C_Currency_ID=c.C_Currency_ID
    60   WHERE a.C_Currency_ID=c.C_Currency_ID
    61     AND a.C_AcctSchema_ID=v_AcctSchema_ID;
    61     AND a.C_AcctSchema_ID=v_AcctSchema_ID;
    62   v_rate:=v_CurrencyRate;
    62   v_rate:=v_CurrencyRate;
    63   IF(v_rate IS NULL) THEN
    63   IF(v_rate IS NULL OR v_rate = 0) THEN
    64     v_rate:=C_CURRENCY_RATE(:NEW.C_Currency_ID, v_TargetCurrency_ID, v_DateAcct, v_CurrencyRateType, :NEW.AD_CLIENT_ID, :NEW.AD_ORG_ID) ;
    64     v_rate:=C_CURRENCY_RATE(:NEW.C_Currency_ID, v_TargetCurrency_ID, v_DateAcct, v_CurrencyRateType, :NEW.AD_CLIENT_ID, :NEW.AD_ORG_ID) ;
    65   END IF;
    65   END IF;
    66   :NEW.AMTACCTDR:=ROUND(COALESCE(:NEW.AMTSOURCEDR, 0) *v_rate, v_StdPrecision) ;
    66   :NEW.AMTACCTDR:=ROUND(COALESCE(:NEW.AMTSOURCEDR, 0) *v_rate, v_StdPrecision) ;
    67   :NEW.AMTACCTCR:=ROUND(COALESCE(:NEW.AMTSOURCECR, 0) *v_rate, v_StdPrecision) ;
    67   :NEW.AMTACCTCR:=ROUND(COALESCE(:NEW.AMTSOURCECR, 0) *v_rate, v_StdPrecision) ;
    68   :NEW.CURRENCYRATE:=v_rate;
    68   :NEW.CURRENCYRATE:=v_rate;