f_find_cust_dftprice.srf 915 B

12345678910111213141516171819202122232425262728293031323334353637
  1. $PBExportHeader$f_find_cust_dftprice.srf
  2. global type f_find_cust_dftprice from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_find_cust_dftprice (long arg_pricelistid, long arg_mtrlid, ref decimal arg_price, ref decimal arg_rebate)
  6. end prototypes
  7. global function integer f_find_cust_dftprice (long arg_pricelistid, long arg_mtrlid, ref decimal arg_price, ref decimal arg_rebate);Int rslt = 1
  8. SELECT u_sale_price_mx.price,
  9. u_sale_price_mx.rebate
  10. INTO :arg_price,
  11. :arg_rebate
  12. FROM u_sale_price_list,u_sale_price_mx
  13. WHERE u_sale_price_list.pricelistid = u_sale_price_mx.pricelistid
  14. AND u_sale_price_list.pricelistid = :arg_pricelistid
  15. AND u_sale_price_mx.mtrlid = :arg_mtrlid;
  16. IF sqlca.SQLCode <> 0 THEN
  17. arg_price = 0
  18. arg_rebate = 1
  19. rslt = 0
  20. GOTO ext
  21. ELSEIF sqlca.SQLNRows = 0 THEN
  22. arg_price = 0
  23. arg_rebate = 1
  24. rslt = 0
  25. GOTO ext
  26. END IF
  27. ext:
  28. RETURN rslt
  29. end function