f_check_spt_balcamt.srf 678 B

12345678910111213141516171819202122232425262728293031323334
  1. $PBExportHeader$f_check_spt_balcamt.srf
  2. global type f_check_spt_balcamt from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_check_spt_balcamt (long arg_sptid, ref string arg_msg)
  6. end prototypes
  7. global function integer f_check_spt_balcamt (long arg_sptid, ref string arg_msg);Int rslt = 1
  8. Decimal ld_balcamt
  9. SELECT sum(spt_balcamt) INTO :ld_balcamt
  10. FROM v_spt_balcamt
  11. Where sptid = :arg_sptid;
  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