PB编译错误, 求大哥大叔帮忙解决困惑, 3个错误 附上图, 在线等待热心人。。。

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 ;

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 variables

forward 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 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);
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_nt

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 ;

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 if

if 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 if

if 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 if

if 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 = 0

if 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 if

update 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 if

update 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 if

if 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 if

if 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
*/

if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "3.5,update rep_i_deptdaily,deptcode:" + as_deptcode + ",gdsincode:" + as_gdsincode
return false
end if

update rep_deptsale set frontprofit =frontprofit - 0 , frontinmoney =frontinmoney + 0 , frontinmoney_nt =frontinmoney_nt + 0 , sendflag =0
where recorddate =:adt_saledate and deptcode =:as_deptcode using sqlca;
/* SQL Parameters List
0-> :changeinmoney_nt
1-> :changeinmoney
2-> :changeinmoney_nt
3-> :adt_saledate
4-> :as_deptcode
*/

if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "3.8,update rep_deptsale,deptcode:" + as_deptcode + ",gdsincode:" + as_gdsincode
return false
end if

update rep_buyer set saledinmoney =saledinmoney + 0 , saledinmoney_nt =saledinmoney_nt + 0 , buyinmoney =buyinmoney + 0 , sendflag =0
where recorddate =:adt_saledate and deptcode =:gshopcode and buyercode =:as_buyercode and buyername =:as_buyername using sqlca;
/* SQL Parameters List
0-> :changeinmoney
1-> :changeinmoney_nt
2-> :changeinmoney
3-> :adt_saledate
4-> :gshopcode
5-> :as_buyercode
6-> :as_buyername
*/

if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "3.9,update rep_buyer"
return false
end if

salemode = 3

if sqlca.sqlcode = -1 then
sqlca.sqlerrtext = sqlca.sqlerrtext + " declare rep_goods_sale_deal procedure for rep_goods_sale_deal"
return false
end if

execute rep_goods_sale_deal;
/* SQL Parameters List
0-> :as_deptcode
1-> :as_gdsincode
2-> :adt_saledate
3-> :changeinmoney
4-> :changeinmoney_nt
5-> :changebillno
6-> :batch_suppliercode
7-> :al_classcode
8-> :this.salemode
9-> :this.taxrate
10-> :intaxrate
*/

if sqlca.sqlcode = -1 then
sqlca.sqlerrtext = sqlca.sqlerrtext + " 3.8,update rep_goods_sale,deptcode:" + as_deptcode + ",gdsincode:" + as_gdsincode
return false
end if

select count ( ) INTO :haverecord from rep_class_sale
where recorddate =:adt_saledate and shopcode =:as_shopcode and classcode =0 and salemode =0 using sqlca;
/
SQL Parameters List
0-> :haverecord
1-> :adt_saledate
2-> :as_shopcode
3-> :al_classcode
4-> :salemode
*/

if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "select from rep_class_sale,shopcode:" + as_shopcode + ",classcode:" + string(al_classcode) + ",salemode:" + string(salemode) + ",recorddate," + string(saledate,"yyyy/mm/dd")
return false
end if

if haverecord > 0 then
update rep_class_sale set inmoney =inmoney + 0 , inmoney_nt =inmoney_nt + 0 , sendflag =0
where recorddate =:adt_saledate and shopcode =:as_shopcode and classcode =0 and salemode =0 using sqlca;
/* SQL Parameters List
0-> :changeinmoney
1-> :changeinmoney_nt
2-> :adt_saledate
3-> :as_shopcode
4-> :al_classcode
5-> :salemode
/
else
insert into rep_class_sale values ( :saledate , ' ' , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ) using sqlca;
/
SQL Parameters List
0-> :saledate
1-> :as_shopcode
2-> :al_classcode
3-> :salemode
4-> :changeinmoney
5-> :changeinmoney_nt
*/
end if

if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "update/insert rep_class_sale,shopcode:" + as_shopcode + ",classcode:" + string(al_classcode) + ",salemode:" + string(salemode) + ",recorddate," + string(saledate,"yyyy/mm/dd")
return false
end if

if as_salediscountbillno <> "" then
select count ( ) INTO :haverecord from rep_discountbill
where recorddate =:adt_saledate and billno =:as_salediscountbillno and deptcode =:as_deptcode and gdsincode =:as_gdsincode and batchno =:changebillno using sqlca;
/
SQL Parameters List
0-> :haverecord
1-> :adt_saledate
2-> :as_salediscountbillno
3-> :as_deptcode
4-> :as_gdsincode
5-> :changebillno
*/

if sqlca.sqlcode <> 0 then
    sqlca.sqlerrtext = sqlca.sqlerrtext + "5,select from rep_discountbill,billno:" + as_salediscountbillno + ",gdsincode:" + as_gdsincode + ",deptcode:" + as_deptcode + ",recorddate," + string(adt_saledate,"yyyy/mm/dd") + ",batchno:00"
    return false
end if

if haverecord <> 0 then
    update rep_discountbill set inmoney =inmoney + 0 , inmoney_nt =inmoney_nt + 0 , sendflag =0 
    where recorddate =:adt_saledate and billno =:as_salediscountbillno and deptcode =:as_deptcode and gdsincode =:as_gdsincode and batchno =:changebillno  using sqlca;

/* SQL Parameters List
0-> :changeinmoney
1-> :changeinmoney_nt
2-> :adt_saledate
3-> :as_salediscountbillno
4-> :as_deptcode
5-> :as_gdsincode
6-> :changebillno
/
else
insert into rep_discountbill values ( :adt_saledate , ' ' , ' ' , ' ' , ' ' , 0 , 0 , 0 , 0 , 0 , 0 , 0 , ' ' , 0 ) using sqlca;
/
SQL Parameters List
0-> :adt_saledate
1-> :as_salediscountbillno
2-> :as_deptcode
3-> :as_gdsincode
4-> :changebillno
5-> :changeinmoney
6-> :changeinmoney_nt
7-> :batch_suppliercode
*/
end if

if sqlca.sqlcode <> 0 then
    sqlca.sqlerrtext = sqlca.sqlerrtext + "5.1,update rep_discountbill,deptcode:" + as_deptcode + ",gdsincode:" + as_gdsincode
    return false
end if

end if

update rep_supplier set frontinmoney =frontinmoney + 0 , frontinmoney_nt =frontinmoney_nt + 0 , buyin =buyin + 0 , sendflag =0
where suppliercode =:batch_suppliercode and recorddate =:adt_saledate and deptcode =:gshopcode using sqlca;
/* SQL Parameters List
0-> :changeinmoney
1-> :changeinmoney_nt
2-> :changeinmoney
3-> :batch_suppliercode
4-> :adt_saledate
5-> :gshopcode
*/

if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "6.2, update rep_supplier,deptcode:" + as_deptcode + ",gdsincode:" + as_gdsincode
return false
end if

update bil_discount_change_goods set oddment =0
where billno =:changebillno and gdsincode =:as_gdsincode and shopcode =:as_shopcode using sqlca;
/* SQL Parameters List
0-> :oddment
1-> :changebillno
2-> :as_gdsincode
3-> :as_shopcode
*/