SET EXCLUSIVE ON
Private aa,bb,bianhao
DIMENSION a(1)
SCAN
aa="00"
APPEND BLANK
replace lysmy.应收金额 WITH lysmy.单价*lysmy.吨位
replace lysmy.运杂费合计 WITH lysmy.装卸费用+lysmy.汽运费用+lysmy.铁轮费用+lysmy.其他杂费
replace lysmy.运杂费单价 WITH lysmy.运杂费合计/lysmy.吨位
replace lysmy.税费单价 WITH (lysmy.单价*0.17)/1.17
replace lysmy.税费合计 WITH lysmy.税费单价*lysmy.吨位
replace lysmy.不含税厂价 WITH lysmy.单价-lysmy.税费单价-lysmy.运杂费单价
replace lysmy.不含税金额 WITH lysmy.不含税厂价* lysmy.吨位
IF EMPTY(lysmy.编号)
replace lysmy.编号 WITH LEFT(ALLTRIM(lysmy.部门),2)+"液"+"C"+ALLTRIM(SUBSTR(lysmy.日期,4,3))+"01"
ELSE
SELECT MAX(lysmy.编号) FROM lysmy INTO ARRAY a &&取表中最大的数值
bianhao=VAL(SUBSTR(a(1),1,3))+1 &&自动增加编号
replace lysmy.编号 WITH LEFT(ALLTRIM(lysmy.部门),2)+"液"+"C"+ALLTRIM(SUBSTR(lysmy.日期,4,3))+&bianhao &&将替换新的数据
ENDIF
ENDSCAN
RETURN
为什么红色区域提示数据益处,请大家帮忙检查一下!谢谢