oracle滞纳金的计算
create or replace function GET_ZNJ(
JFJZRQ in date,
YJE in number,
ZNJBL in number,
ZT in varchar2,
SJJFRQ in date,
MIAN_ZNJ in varchar2,
ZNJ_JMCS in number
) return NUMBER is
V_ZNJ NUMBER(14,2);
V_DATE date;
V_DAYS number;
begin
V_ZNJ := 0;
成都创新互联公司-专业网站定制、快速模板网站建设、高性价比长岭网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式长岭网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖长岭地区。费用合理售后完善,10年实体公司更值得信赖。
IF ZT <= '4' THEN
V_DATE := SYSDATE;
END IF;
IF ZT >= '5' THEN
V_DATE := SJJFRQ;
END IF;
V_DAYS := trunc(V_DATE) - trunc(JFJZRQ);
IF MIAN_ZNJ = '1' THEN --不予减免1
BEGIN
V_ZNJ := CASE WHEN V_DAYS <= 0 THEN 0
ELSE NVL(ROUND(V_DAYS * YJE * ZNJBL,2),0)
END;
END;
ELSIF MIAN_ZNJ = '0' THEN --全部减免0
BEGIN
V_ZNJ := 0;
END;
ELSIF MIAN_ZNJ = '2' THEN --日期减免2
BEGIN
V_ZNJ := CASE WHEN V_DAYS - ZNJ_JMCS <= 0 THEN 0
ELSE NVL(ROUND((V_DAYS - ZNJ_JMCS) * YJE * ZNJBL,2),0)
END;
END;
ELSIF MIAN_ZNJ = '3' THEN --比例减免3
BEGIN
V_ZNJ := CASE WHEN V_DAYS <= 0 THEN 0
ELSE NVL(ROUND(ROUND(V_DAYS * YJE * ZNJBL,2) * (1 - ZNJ_JMCS),2),0)
END;
END;
ELSIF MIAN_ZNJ = '4' THEN --定额减免4
BEGIN
V_ZNJ := CASE WHEN V_DAYS <= 0 THEN 0
ELSE NVL(ROUND(V_DAYS * YJE * ZNJBL,2),0) - ZNJ_JMCS
END;
IF V_ZNJ < 0 THEN
V_ZNJ := 0;
END IF;
END;
ELSE --不予减免
BEGIN
V_ZNJ := CASE WHEN V_DAYS <= 0 THEN 0
ELSE NVL(ROUND(V_DAYS * YJE * ZNJBL,2),0)
END;
END;
END IF;
-- 滞纳金大于应缴金额时,滞纳金=应缴金额
IF V_ZNJ > YJE THEN
V_ZNJ := YJE;
END IF;
return V_ZNJ;
end GET_ZNJ;
当前标题:oracle滞纳金的计算
标题链接:http://ybzwz.com/article/jeejdp.html