declare rep_goods_sale_deal PROCEDURE for
rep_goods_sale_deal @override =0,@deptcode =' ' , @gdsincode =' ' , @recorddate =:recorddate , @totalamount =0 , @totalinmoney =0 , @totalsalemoney =0 , @totaldiscountmoney =0 , @totalinmoney_nt =0 , @totalsaletax =0 , @batchno =' ' , @sendflag =0 , @suppliercode =' ' , @classcode =0 , @salemode =0 , @saletaxrate =0 , @intaxrate =0 ;
PB编译错误, 求大哥大叔帮忙解决困惑, 3个错误 附上图, 在线等待热心人。。。
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- 那枚四叶草 2015-10-06 06:19关注
type variables
public double saleprice
public double actualsaleprice
public integer goodssalemode
public integer salemode
public string buyercode
public string buyername
public string salercode
public string salername
public date saledate
public string flowno
public string discountbillno
public string deptpath
public integer daysbefore
public double taxrate
public date lastmonthenddate
public string salegdsincode
public string saledeptcode
public string is_shop_select
public string is_sqlclause_flowno = ""
public boolean ib_stock = false
public date currentdate
public long il_errcurrentrow
public boolean ib_have_coupon = false
public boolean autostop = false
public integer ii_shoptype
public string is_sendcenter_saledept
public string is_sendcenter_saledept_unin
end variablesforward prototypes
public function boolean batchsaledeal (string deptcode,string gdsincode,string batchno,string as_shopcode,long al_classcode,double batchsaleamount,double batchactualpay,double batchshouldpay,ref double adbl_saleinmoney,ref double adbl_saleinmoney_nt,ref double adbl_saletax)
public function boolean discountchangedeal (string as_deptcode,string as_gdsincode,string as_batchno,string as_shopcode,long al_classcode,double adbl_batchsaleamount,double adbl_batchactualpay,double adbl_batchshouldpay,double adbl_batchinmoney,double adbl_batchinmoney_nt,date adt_saledate,string as_buyercode,string as_buyername,string as_salediscountbillno,ref double adbl_changeinmoney,ref double adbl_changeinmoney_nt)
public subroutine errmessage_flowdeal (string errstring,long currentrow)
public subroutine infomessage_flowdeal (string infostring,long currentrow)
public function integer saleflow_timer ()
public function boolean unin_batchsaledeal (string deptcode,string gdsincode,string batchno,double batchsaleamount,double batchactualpay)
public function boolean uninsaledeal (string deptcode,string gdsincode,string as_shopcode,long al_classcode,double saleamount,double shouldpay,double actualpay,ref double adbl_saleinmoney,ref double adbl_saleinmoney_nt,ref double adbl_saletax)
public function boolean uninsaledeal_stock (string deptcode,string gdsincode,double saleamount,double shouldpay,double actualpay)
public function boolean wf_acc_position_out (string gdsincode,string deptcode,string batchno,double batchsaleamount,ref string as_errmsg)
public function boolean wf_coupon (string shopcode)
public function boolean wf_deal_bas_basket (long as_row)
public function boolean wf_deal_bas_basket_goods (long al_row)
public function boolean wf_dw_supplier_goods_sale (string suppliercode,string gdsincode,double salemoney)
public function boolean wf_dw_supplier_sale (string suppliercode,integer is_unin,double salemoney)
public function boolean wf_dynamicchk (string deptcode,string gdsincode,double saleamount,datetime saletime)
end prototypespublic function boolean batchsaledeal (string deptcode,string gdsincode,string batchno,string as_shopcode,long al_classcode,double batchsaleamount,double batchactualpay,double batchshouldpay,ref double adbl_saleinmoney,ref double adbl_saleinmoney_nt,ref double adbl_saletax);
double inprice
double inprice_nt
double batchleftamount
double batchleftinmoney
double batchleftinmoney_nt
double batchleftsalemoney
string suppliercode
string orderdept
double batchsaleinmoney
double batchsaleinmoney_nt
double batchsalesalemoney
double batchsaletax
double batchprofit
integer day
integer j
integer haverecord
date recorddate
double totalamount
double totalinmoney
double totalinmoney_nt
double totalsaletax
double totalsalemoney
double totaldiscountmoney
double discountrate
double supplierdiscount
integer balancemode
integer stockflag
string shopcode
double nowamount
str_negative_lost str_lost
double defaultbatchamount
double defaultinmoney
double defaultinmoney_nt
double defaultsalemoney
long goodsiono
double origin_inprice
double origin_inprice_nt
string origin_batchno
double currentshopprice
double currentdiscountmoney
double currentsupplierdiscount
double intaxrate
string ls_errmsg
double changeinmoney
double changeinmoney_ntdeclare rep_goods_sale_deal PROCEDURE for
rep_goods_sale_deal @override =0,@deptcode =' ' , @gdsincode =' ' , @recorddate =:recorddate , @totalamount =0 , @totalinmoney =0 , @totalsalemoney =0 , @totaldiscountmoney =0 , @totalinmoney_nt =0 , @totalsaletax =0 , @batchno =' ' , @sendflag =0 , @suppliercode =' ' , @classcode =0 , @salemode =0 , @saletaxrate =0 , @intaxrate =0 ;select balancemode , stockflag , inprice , inprice_nt , suppliercode , nowamount , originbatchno , intaxrate
into :balancemode,:stockflag,:inprice,:inprice_nt,:suppliercode,:nowamount,:origin_batchno,:intaxrate
from acc_gdsbatchdtl where gdsincode =:gdsincode and batchno =:batchno using sqlca;
/* SQL Parameters List
0-> :balancemode
1-> :stockflag
2-> :inprice
3-> :inprice_nt
4-> :suppliercode
5-> :nowamount
6-> :origin_batchno
7-> :intaxrate
8-> :gdsincode
9-> :batchno
*/if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "1,select from acc_gdsbatchdtl,gdsincode :" + gdsincode + ",batchno:" + batchno
return false
end ifif batchno = gbatchno and nowamount = 0 then
select lastinprice , lastinprice_nt , lastintaxrate
into :inprice,:inprice_nt,:intaxrate
from inf_goods where gdsincode =:gdsincode using sqlca;
/* SQL Parameters List
0-> :inprice
1-> :inprice_nt
2-> :intaxrate
3-> :gdsincode
*/if sqlca.sqlcode <> 0 then sqlca.sqlerrtext = sqlca.sqlerrtext + "2,select from inf_goods,gdsincode:" + gdsincode return false end if update acc_gdsbatchdtl set inprice =0 , inprice_nt =0 , intaxrate =0 where gdsincode =:gdsincode and batchno =:batchno using sqlca;
/* SQL Parameters List
0-> :inprice
1-> :inprice_nt
2-> :intaxrate
3-> :gdsincode
4-> :batchno
*/if sqlca.sqlcode <> 0 then sqlca.sqlerrtext = sqlca.sqlerrtext + "2.1 update acc_gdsbatchdtl,gdsincode:" + gdsincode return false end if
end if
if origin_batchno = batchno then
origin_inprice = inprice
origin_inprice_nt = inprice_nt
else
select inprice , inprice_nt
into :origin_inprice,:origin_inprice_nt
from acc_gdsbatchdtl where batchno =:origin_batchno and gdsincode =:gdsincode using sqlca;
/* SQL Parameters List
0-> :origin_inprice
1-> :origin_inprice_nt
2-> :origin_batchno
3-> :gdsincode
*/if sqlca.sqlcode <> 0 then sqlca.sqlerrtext = sqlca.sqlerrtext + "1,select from acc_gdsbatchdtl,gdsincode :" + gdsincode + ",batchno:" + origin_batchno return false end if
end if
select nowamount , nowinmoney , nowinmoney_nt , nowsalemoney
into :defaultbatchamount,:defaultinmoney,:defaultinmoney_nt,:defaultsalemoney
from acc_gdsincodedtl where gdsincode =:gdsincode and batchno =:gbatchno and deptcode =:deptcode using sqlca;
/* SQL Parameters List
0-> :defaultbatchamount
1-> :defaultinmoney
2-> :defaultinmoney_nt
3-> :defaultsalemoney
4-> :gdsincode
5-> :gbatchno
6-> :deptcode
*/if sqlca.sqlcode <> 0 and sqlca.sqlcode <> 100 then
return false
end ifif sqlca.sqlcode = 100 then
defaultbatchamount = 0
defaultinmoney = 0
defaultinmoney_nt = 0
defaultsalemoney = 0
insert into acc_gdsincodedtl values ( ' ' , ' ' , ' ' , 0 , 0 , 0 , NULL , 0 , 1 , 1 , '00' ) using sqlca;
/* SQL Parameters List
0-> :gdsincode
1-> :gbatchno
2-> :deptcode
*/if sqlca.sqlcode <> 0 then return false end if insert into acc_incodeamount values ( ' ' , ' ' , 0 , 0 , 0 , 0 , 0 , 0 , null , 0 , 0 , 0 , 0 , 0 , 0 ) using sqlca;
/* SQL Parameters List
0-> :gdsincode
1-> :deptcode
*/if sqlca.sqlcode <> 0 then return false end if
end if
select nowamount , nowinmoney , nowinmoney_nt , nowsalemoney
into :batchleftamount,:batchleftinmoney,:batchleftinmoney_nt,:batchleftsalemoney
from acc_gdsincodedtl where gdsincode =:gdsincode and batchno =:batchno and deptcode =:deptcode using sqlca;
/* SQL Parameters List
0-> :batchleftamount
1-> :batchleftinmoney
2-> :batchleftinmoney_nt
3-> :batchleftsalemoney
4-> :gdsincode
5-> :batchno
6-> :deptcode
*/if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "3,select from acc_gdsincodedtl,deptcode:" + deptcode + ",batchno:" + batchno + ",gdsincode:" + gdsincode
return false
end ifif myround(batchleftamount - batchsaleamount,3) = 0 then
batchsaleinmoney = batchleftinmoney
batchsaleinmoney_nt = batchleftinmoney_nt
batchsalesalemoney = batchleftsalemoney
else
batchsaleinmoney = myround(inprice * batchsaleamount,2)
batchsaleinmoney_nt = myround(inprice_nt * batchsaleamount,2)if myround(batchleftamount - batchsaleamount,3) > 0 and myround(batchleftinmoney,2) >= 0 and myround(batchleftinmoney - batchsaleinmoney,2) < 0 then batchsaleinmoney = batchleftinmoney end if if myround(batchleftamount - batchsaleamount,3) > 0 and myround(batchleftinmoney_nt,2) >= 0 and myround(batchleftinmoney_nt - batchsaleinmoney_nt,2) < 0 then batchsaleinmoney_nt = batchleftinmoney_nt end if batchsalesalemoney = myround(saleprice * batchsaleamount,2)
end if
batchsaletax = myround((batchactualpay * taxrate) / (1 + taxrate),2)
batchprofit = batchactualpay - batchsaletax - batchsaleinmoney_nt
f_init_lost(str_lost)if myround(batchsaleamount,3) < 0 and myround(defaultbatchamount,3) < 0 then
goodsiono = 0if f_negative_pop(gdsincode,deptcode,inprice,inprice_nt,-1 * batchsaleamount,-1 * batchsaleinmoney,-1 * batchsaleinmoney_nt,-1 * batchsalesalemoney,defaultbatchamount,defaultinmoney,defaultinmoney_nt,defaultsalemoney,str_lost,flowno,batchno,0,suppliercode,saleprice,buyercode,buyername,goodsiono,origin_batchno,origin_inprice,origin_inprice_nt,intaxrate) = false then return false end if
end if
update acc_gdsincodedtl set nowamount =nowamount - 0 - 0 , nowinmoney =nowinmoney - 0 - 0 - 0 , nowsalemoney =nowsalemoney - 0 - 0 , lastsaledate =( case when lastsaledate > '2015-6-7' then lastsaledate else '2015-6-7' end ) , nowinmoney_nt =nowinmoney_nt - 0 - 0 - 0 , sendflag =0
where gdsincode =:gdsincode and batchno =:batchno and deptcode =:deptcode using sqlca;
/* SQL Parameters List
0-> :batchsaleamount
1-> :str_lost.totallostamount
2-> :batchsaleinmoney
3-> :str_lost.totallostinmoney
4-> :str_lost.inmoneychange
5-> :batchsalesalemoney
6-> :str_lost.totallostsalemoney
7-> :saledate
8-> :saledate
9-> :batchsaleinmoney_nt
10-> :str_lost.totallostinmoney_nt
11-> :str_lost.inmoneychange_nt
12-> :gdsincode
13-> :batchno
14-> :deptcode
*/if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "3.1,update acc_gdsincodedtl,deptcode:" + deptcode + ",batchno:" + batchno + "gdsincode :" + gdsincode
return false
end ifupdate acc_gdsbatchdtl set nowamount =nowamount - 0 - 0 , nowinmoney =nowinmoney - 0 - 0 - 0 , nowsalemoney =nowsalemoney - 0 - 0 , retailamount =retailamount + 0 + 0 , retailmoney =retailmoney + 0 + 0 , wholesaleamount =wholesaleamount + 0 , wholesalemoney =wholesalemoney + 0 , returnamount =returnamount + 0 , moveoutamount =moveoutamount + 0 + 0 , alteramount =alteramount + 0 , damageamount =damageamount + 0 , chkamount =chkamount + 0 , lastsaledate ='2015-6-7' , nowinmoney_nt =nowinmoney_nt - 0 - 0 - 0
where gdsincode =:gdsincode and batchno =:batchno using sqlca;
/* SQL Parameters List
0-> :batchsaleamount
1-> :str_lost.totallostamount
2-> :batchsaleinmoney
3-> :str_lost.totallostinmoney
4-> :str_lost.inmoneychange
5-> :batchsalesalemoney
6-> :str_lost.totallostsalemoney
7-> :batchsaleamount
8-> :str_lost.lostretailamount
9-> :batchactualpay
10-> :str_lost.lostretailmoney
11-> :str_lost.lostwholesaleamount
12-> :str_lost.lostwholesalemoney
13-> :str_lost.lostreturnamount
14-> :str_lost.lostmoveamount
15-> :str_lost.lostsendamount
16-> :str_lost.lostalteramount
17-> :str_lost.lostdamageamount
18-> :str_lost.lostcheckamount
19-> :saledate
20-> :batchsaleinmoney_nt
21-> :str_lost.totallostinmoney_nt
22-> :str_lost.inmoneychange_nt
23-> :gdsincode
24-> :batchno
*/if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "3.2,update acc_gdsbatchdtl,batchno:" + batchno + "gdsincode :" + gdsincode
return false
end ifupdate acc_incodeamount set nowamount =nowamount - 0 , nowinmoney =nowinmoney - 0 - 0 , nowsalemoney =nowsalemoney - 0 , nowinmoney_nt =nowinmoney_nt - 0 - 0 , lastsaledate ='2015-6-7' , sendflag =0
where gdsincode =:gdsincode and deptcode =:deptcode using sqlca;
/* SQL Parameters List
0-> :batchsaleamount
1-> :batchsaleinmoney
2-> :str_lost.inmoneychange
3-> :batchsalesalemoney
4-> :batchsaleinmoney_nt
5-> :str_lost.inmoneychange_nt
6-> :saledate
7-> :gdsincode
8-> :deptcode
*/if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "3.3,update acc_incodeamount,deptcode:" + deptcode + ",gdsincode:" + gdsincode
return false
end ifif giswms = 1 then
if wf_acc_position_out(gdsincode,deptcode,batchno,batchsaleamount,ls_errmsg) = false then sqlca.sqlerrtext = sqlca.sqlerrtext + "wf_acc_position_out,deptcode:" + deptcode + ",gdsincode:" + gdsincode + ls_errmsg return false end if
end if
update rep_s_deptdaily set frontsalemoney =frontsalemoney + 0 , frontsalelost =frontsalelost + ( 0 - 0 ) , todaymoney =todaymoney - 0 , frontsaletax =frontsaletax + 0 , sendflag =0
where recorddate =:saledate and deptcode =:deptcode using sqlca;
/* SQL Parameters List
0-> :batchactualpay
1-> :batchsalesalemoney
2-> :batchactualpay
3-> :batchsalesalemoney
4-> :batchsaletax
5-> :saledate
6-> :deptcode
*/if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "3.4,update rep_s_deptdaily,deptcode:" + deptcode + ",gdsincode:" + gdsincode
return false
end ifif saledate = gtoday then
update rep_i_deptdaily set frontsalemoney =frontsalemoney + 0 + 0 , todaymoney =todaymoney - 0 - 0 , frontsalemoney_nt =frontsalemoney_nt + 0 + 0 , todaymoney_nt =todaymoney_nt - 0 - 0 , sendflag =0
where recorddate =:saledate and deptcode =:deptcode using sqlca;
/* SQL Parameters List
0-> :batchsaleinmoney
1-> :str_lost.inmoneychange
2-> :batchsaleinmoney
3-> :str_lost.inmoneychange
4-> :batchsaleinmoney_nt
5-> :str_lost.inmoneychange_nt
6-> :batchsaleinmoney_nt
7-> :str_lost.inmoneychange_nt
8-> :saledate
9-> :deptcode
*/if sqlca.sqlcode <> 0 then sqlca.sqlerrtext = sqlca.sqlerrtext + "3.5,update rep_i_deptdaily,deptcode:" + deptcode + ",gdsincode:" + gdsincode return false end if
else
update rep_i_deptdaily set frontsalemoney =frontsalemoney + 0 , todaymoney =todaymoney - 0 , frontsalemoney_nt =frontsalemoney_nt + 0 , todaymoney_nt =todaymoney_nt - 0 , sendflag =0
where recorddate =:gtoday and deptcode =:deptcode using sqlca;
/* SQL Parameters List
0-> :str_lost.inmoneychange
1-> :str_lost.inmoneychange
2-> :str_lost.inmoneychange_nt
3-> :str_lost.inmoneychange_nt
4-> :gtoday
5-> :deptcode
*/if sqlca.sqlcode <> 0 then sqlca.sqlerrtext = sqlca.sqlerrtext + "3.5,update rep_i_deptdaily,deptcode:" + deptcode + ",gdsincode:" + gdsincode return false end if update rep_i_deptdaily set frontsalemoney =frontsalemoney + 0 , todaymoney =todaymoney - 0 , frontsalemoney_nt =frontsalemoney_nt + 0 , todaymoney_nt =todaymoney_nt - 0 , sendflag =0 where recorddate =:saledate and deptcode =:deptcode using sqlca;
/* SQL Parameters List
0-> :batchsaleinmoney
1-> :batchsaleinmoney
2-> :batchsaleinmoney_nt
3-> :batchsaleinmoney_nt
4-> :saledate
5-> :deptcode
*/解决 无用评论 打赏 举报
悬赏问题
- ¥100 set_link_state
- ¥15 虚幻5 UE美术毛发渲染
- ¥15 CVRP 图论 物流运输优化
- ¥15 Tableau online 嵌入ppt失败
- ¥100 支付宝网页转账系统不识别账号
- ¥15 基于单片机的靶位控制系统
- ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
- ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
- ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
- ¥15 手机接入宽带网线,如何释放宽带全部速度