123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- $PBExportHeader$f_find_tax.srf
- global type f_find_tax from function_object
- end type
- forward prototypes
- global function integer f_find_tax (integer arg_cusid, integer arg_mtrlid, ref string arg_cusmtrlcode, ref string arg_cusmtrlname, ref string arg_cusmtrlmode)
- global function integer f_find_tax (integer arg_id, string arg_table, ref decimal arg_tax)
- end prototypes
- global function integer f_find_tax (integer arg_cusid, integer arg_mtrlid, ref string arg_cusmtrlcode, ref string arg_cusmtrlname, ref string arg_cusmtrlmode);Int rslt = 1
- SELECT cusmtrlcode, cusmtrlname, cusmtrlmode
- into :arg_cusmtrlcode, :arg_cusmtrlname, :arg_cusmtrlmode
- FROM u_cusmtrlname
- where cusid = :arg_cusid and mtrlid = :arg_mtrlid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- GOTO ext
- END IF
- ext:
- RETURN rslt
- end function
- global function integer f_find_tax (integer arg_id, string arg_table, ref decimal arg_tax);Int rslt = 1
- IF arg_table = 'u_cust' then
- SELECT tax
- into :arg_tax
- FROM u_cust
- where cusid = :arg_id;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- GOTO ext
- END IF
- ELSEIF arg_table = 'u_spt' then
- SELECT tax
- into :arg_tax
- FROM u_spt
- where sptid = :arg_id;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- GOTO ext
- END IF
- ELSE
- rslt = 0
- END IF
- ext:
- RETURN rslt
- end function
|