f_get_planprice.srf 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. $PBExportHeader$f_get_planprice.srf
  2. global type f_get_planprice from function_object
  3. end type
  4. forward prototypes
  5. global function decimal f_get_planprice (long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, boolean arg_getdft)
  6. end prototypes
  7. global function decimal f_get_planprice (long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, boolean arg_getdft);//arg_GetDft 是否取默认
  8. Dec lde_planprice
  9. SELECT planprice
  10. INTO :lde_planprice
  11. FROM u_mtrl_planprice
  12. WHERE mtrlid = :arg_mtrlid
  13. AND status = :arg_status
  14. AND woodcode = :arg_woodcode
  15. And pcode = :arg_pcode;
  16. IF sqlca.SQLCode <> 0 THEN
  17. lde_planprice = 0
  18. END IF
  19. IF IsNull(lde_planprice) THEN lde_planprice = 0
  20. IF lde_planprice = 0 THEN
  21. IF arg_GetDft THEN
  22. SELECT planprice
  23. INTO :lde_planprice
  24. FROM u_mtrldef
  25. Where mtrlid = :arg_mtrlid;
  26. IF sqlca.SQLCode <> 0 THEN
  27. lde_planprice = 0
  28. END IF
  29. IF IsNull(lde_planprice) THEN lde_planprice = 0
  30. END IF
  31. END IF
  32. RETURN lde_planprice
  33. end function