f_get_203.srf 735 B

1234567891011121314151617181920212223242526272829
  1. $PBExportHeader$f_get_203.srf
  2. global type f_get_203 from function_object
  3. end type
  4. forward prototypes
  5. global function decimal f_get_203 (long arg_cmonth, string arg_subname)
  6. end prototypes
  7. global function decimal f_get_203 (long arg_cmonth, string arg_subname);decimal rslt_amt
  8. select ECredit - EDebit into :rslt_amt
  9. from cw_balance,cw_subject
  10. where cw_balance.accsetid = cw_subject.accsetid
  11. and cw_balance.subid = cw_subject.subid
  12. and cw_balance.accsetid = :sys_accsetid
  13. and cw_balance.yearmon = :arg_cmonth
  14. and left(cw_balance.subid,6) = '203002'
  15. and ltrim(rtrim(cw_subject.name)) = :arg_subname;
  16. if sqlca.sqlcode <> 0 then
  17. rslt_amt = 0
  18. end if
  19. if isnull(rslt_amt) then rslt_amt = 0
  20. return rslt_amt
  21. end function