f_check_cust_balcamt.srf 677 B

12345678910111213141516171819202122232425262728293031323334
  1. $PBExportHeader$f_check_cust_balcamt.srf
  2. global type f_check_cust_balcamt from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_check_cust_balcamt (long arg_cusid, ref string arg_msg)
  6. end prototypes
  7. global function integer f_check_cust_balcamt (long arg_cusid, ref string arg_msg);Int rslt = 1
  8. Decimal ld_balcamt
  9. SELECT sum(cus_balcamt) INTO :ld_balcamt
  10. FROM v_cus_balcamt
  11. Where cusid = :arg_cusid;
  12. IF sqlca.SQLCode <> 0 THEN
  13. arg_msg = '查询客户是否有结余金额失败,'+sqlca.SQLErrText
  14. rslt = 0
  15. GOTO ext
  16. END IF
  17. IF ld_balcamt <> 0 THEN
  18. arg_msg = '客户有结余金额'
  19. rslt = 0
  20. GOTO ext
  21. END IF
  22. ext:
  23. RETURN rslt
  24. end function