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

问题描述

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:" + deptcode + ",gdsincode:" + gdsincode
    return false
end if

end if

if daysbefore > 0 then
recorddate = saledate

for j = 1 to daysbefore
    recorddate = relativedate(recorddate,1)
    update rep_s_deptdaily set lastdaymoney =lastdaymoney - 0 , todaymoney =todaymoney - 0 , sendflag =0
    where recorddate =:recorddate and deptcode =:deptcode  using sqlca;

/* SQL Parameters List
0-> :batchsalesalemoney
1-> :batchsalesalemoney
2-> :recorddate
3-> :deptcode
*/

    if sqlca.sqlcode <> 0 then
        sqlca.sqlerrtext = sqlca.sqlerrtext + "3.6,update rep_s_deptdaily,deptcode:" + deptcode + ",gdsincode:" + gdsincode
        return false
    end if

    update rep_i_deptdaily set lastdaymoney =lastdaymoney - 0 , todaymoney =todaymoney - 0 , lastdaymoney_nt =lastdaymoney_nt - 0 , todaymoney_nt =todaymoney_nt - 0 , sendflag =0
    where recorddate =:recorddate and deptcode =:deptcode  using sqlca;

/* SQL Parameters List
0-> :batchsaleinmoney
1-> :batchsaleinmoney
2-> :batchsaleinmoney_nt
3-> :batchsaleinmoney_nt
4-> :recorddate
5-> :deptcode
*/

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

next

end if

choose case salemode
case 1
update rep_deptsale set retailmoney =retailmoney + 0 , frontprofit =frontprofit + 0 , frontinmoney =frontinmoney + 0 , frontinmoney_nt =frontinmoney_nt + 0 , frontsaletax =frontsaletax + 0 , sendflag =0
where recorddate =:saledate and deptcode =:deptcode using sqlca;
/* SQL Parameters List
0-> :batchactualpay
1-> :batchprofit
2-> :batchsaleinmoney
3-> :batchsaleinmoney_nt
4-> :batchsaletax
5-> :saledate
6-> :deptcode
/
case 2
update rep_deptsale set frontreturn =frontreturn - 0 , frontprofit =frontprofit + 0 , frontinmoney =frontinmoney + 0 , frontinmoney_nt =frontinmoney_nt + 0 , frontsaletax =frontsaletax + 0 , sendflag =0
where recorddate =:saledate and deptcode =:deptcode using sqlca;
/
SQL Parameters List
0-> :batchactualpay
1-> :batchprofit
2-> :batchsaleinmoney
3-> :batchsaleinmoney_nt
4-> :batchsaletax
5-> :saledate
6-> :deptcode
/
case 3
update rep_deptsale set discountmoney =discountmoney + 0 , frontprofit =frontprofit + 0 , frontinmoney =frontinmoney + 0 , frontinmoney_nt =frontinmoney_nt + 0 , frontsaletax =frontsaletax + 0 , sendflag =0
where recorddate =:saledate and deptcode =:deptcode using sqlca;
/
SQL Parameters List
0-> :batchactualpay
1-> :batchprofit
2-> :batchsaleinmoney
3-> :batchsaleinmoney_nt
4-> :batchsaletax
5-> :saledate
6-> :deptcode
/
case 4
update rep_deptsale set discountmoney =discountmoney + 0 , frontprofit =frontprofit + 0 , frontinmoney =frontinmoney + 0 , frontinmoney_nt =frontinmoney_nt + 0 , frontsaletax =frontsaletax + 0 , sendflag =0
where recorddate =:saledate and deptcode =:deptcode using sqlca;
/
SQL Parameters List
0-> :batchactualpay
1-> :batchprofit
2-> :batchsaleinmoney
3-> :batchsaleinmoney_nt
4-> :batchsaletax
5-> :saledate
6-> :deptcode
*/
end choose

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

update rep_deptsale set frontinmoney =frontinmoney + 0 , frontinmoney_nt =frontinmoney_nt + 0 , frontprofit =frontprofit - 0 , sendflag =0
where deptcode =:deptcode and recorddate =:gtoday using sqlca;
/* SQL Parameters List
0-> :str_lost.inmoneychange
1-> :str_lost.inmoneychange_nt
2-> :str_lost.inmoneychange_nt
3-> :deptcode
4-> :gtoday
*/

if sqlca.sqlcode <> 0 then
return false
end if

if gtoday = saledate then
update rep_buyer set saledinmoney =saledinmoney + 0 + 0 , saledsalemoney =saledsalemoney + 0 , saledinmoney_nt =saledinmoney_nt + 0 + 0 , saletax =saletax + 0 , sendflag =0 , nowinmoney =nowinmoney - 0 - 0 , nowinmoney_nt =nowinmoney_nt - 0 - 0 , nowsalemoney =nowsalemoney - 0
where recorddate =:saledate and deptcode =:gshopcode and buyercode =:buyercode and buyername =:buyername using sqlca;
/* SQL Parameters List
0-> :batchsaleinmoney
1-> :str_lost.inmoneychange
2-> :batchactualpay
3-> :batchsaleinmoney_nt
4-> :str_lost.inmoneychange_nt
5-> :batchsaletax
6-> :batchsaleinmoney
7-> :str_lost.inmoneychange
8-> :batchsaleinmoney_nt
9-> :str_lost.inmoneychange_nt
10-> :batchsalesalemoney
11-> :saledate
12-> :gshopcode
13-> :buyercode
14-> :buyername
*/

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

else
update rep_buyer set saledinmoney =saledinmoney + 0 , saledinmoney_nt =saledinmoney_nt + 0 , sendflag =0 , nowinmoney =nowinmoney - 0 , nowinmoney_nt =nowinmoney_nt - 0
where recorddate =:gtoday and deptcode =:gshopcode and buyercode =:buyercode and buyername =:buyername using sqlca;
/* SQL Parameters List
0-> :str_lost.inmoneychange
1-> :str_lost.inmoneychange_nt
2-> :str_lost.inmoneychange
3-> :str_lost.inmoneychange_nt
4-> :gtoday
5-> :gshopcode
6-> :buyercode
7-> :buyername
*/

解决方案三:

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

update rep_buyer set saledinmoney =saledinmoney + 0 , saledsalemoney =saledsalemoney + 0 , saledinmoney_nt =saledinmoney_nt + 0 , saletax =saletax + 0 , sendflag =0 , nowinmoney =nowinmoney - 0 , nowinmoney_nt =nowinmoney_nt - 0 , nowsalemoney =nowsalemoney - 0
where recorddate =:saledate and deptcode =:gshopcode and buyercode =:buyercode and buyername =:buyername  using sqlca;

/* SQL Parameters List
0-> :batchsaleinmoney
1-> :batchactualpay
2-> :batchsaleinmoney_nt
3-> :batchsaletax
4-> :batchsaleinmoney
5-> :batchsaleinmoney_nt
6-> :batchsalesalemoney
7-> :saledate
8-> :gshopcode
9-> :buyercode
10> :buyername
*/

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

end if

if daysbefore > 0 then
recorddate = saledate
for j = 1 to daysbefore
recorddate = relativedate(recorddate,1)
update rep_buyer set sendflag =0 , nowinmoney =nowinmoney - 0 , nowinmoney_nt =nowinmoney_nt - 0 , nowsalemoney =nowsalemoney - 0
where recorddate =:recorddate and deptcode =:gshopcode and buyercode =:buyercode and buyername =:buyername using sqlca;
/* SQL Parameters List
0-> :batchsaleinmoney
1-> :batchsaleinmoney_nt
2-> :batchsalesalemoney
3-> :recorddate
4-> :gshopcode
5-> :buyercode
6-> :buyername
*/

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

next

end if

totalamount = batchsaleamount
totalinmoney = batchsaleinmoney
totalinmoney_nt = batchsaleinmoney_nt
totalsalemoney = batchactualpay
totalsaletax = batchsaletax
totaldiscountmoney = batchsalesalemoney - batchactualpay

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-> :deptcode
1-> :gdsincode
2-> :this.saledate
3-> :totalamount
4-> :totalinmoney
5-> :totalsalemoney
6-> :totaldiscountmoney
7-> :totalinmoney_nt
8-> :totalsaletax
9-> :batchno
10-> :suppliercode
11-> :al_classcode
12-> :this.salemode
13-> :this.taxrate
14-> :intaxrate
*/
if sqlca.sqlcode = -1 then
sqlca.sqlerrtext = sqlca.sqlerrtext + " 3.8,update rep_goods_sale,deptcode:" + deptcode + ",gdsincode:" + gdsincode
return false
end if

select count ( ) INTO :haverecord from rep_class_sale where recorddate ='2015-6-7' and shopcode =' ' and classcode =0 and salemode =0 using sqlca;
/
SQL Parameters List
0-> :haverecord
1-> :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 amount =amount + 0 , inmoney =inmoney + 0 , inmoney_nt =inmoney_nt + 0 , salemoney =salemoney + 0 , saletax =saletax + 0 , salelost =salelost + 0 - 0 , sendflag =0
where recorddate =:saledate and shopcode =:as_shopcode and classcode =0 and salemode =0 using sqlca;
/* SQL Parameters List
0-> :batchsaleamount
1-> :batchsaleinmoney
2-> :batchsaleinmoney_nt
3-> :batchactualpay
4-> :batchsaletax
5-> :batchsalesalemoney
6-> :batchactualpay
7-> :saledate
8-> :as_shopcode
9-> :al_classcode
10-> :salemode
*/
else

insert into rep_class_sale values ( :saledate , ' ' , 0 , 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-> :batchsaleamount
5-> :batchsaleinmoney
6-> :batchsaleinmoney_nt
7-> :batchactualpay
8-> :batchsaletax
9-> :batchsalesalemoney
10-> :batchactualpay
*/
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 myround(totaldiscountmoney,2) <> 0 then
select discountrate into :discountrate from inf_contract_goods where gdscode =:gdsincode and suppliercode =:suppliercode using sqlca;
/* SQL Parameters List
0-> :discountrate
1-> :gdsincode
2-> :suppliercode
*/

if sqlca.sqlcode = 0 then
    supplierdiscount = myround(totaldiscountmoney * discountrate,2)
    select count ( *) INTO :haverecord from rep_goods_discount where gdsincode =:gdsincode and deptcode =:deptcode and recorddate =:saledate and batchno =:batchno  using sqlca;

/* SQL Parameters List
0-> :haverecord
1-> :gdsincode
2-> :deptcode
3-> :saledate
4-> :batchno
*/

    if sqlca.sqlcode <> 0 then
        sqlca.sqlerrtext = sqlca.sqlerrtext + "5,select from rep_goods_discount,gdsincode:" + gdsincode + ",deptcode:" + deptcode + ",recorddate," + string(recorddate,"yyyy/mm/dd") + ",batchno:" + batchno
        return false
    end if

    if haverecord <> 0 then
        update rep_goods_discount set amount =amount + 0 , inmoney =inmoney + 0 , salemoney =salemoney + 0 , discountmoney =discountmoney + 0 , supplierdiscount =supplierdiscount + 0 , notbalancemoney =notbalancemoney + 0 , balanceflag =0 , sendflag =0
        where gdsincode =:gdsincode and deptcode =:deptcode and recorddate =:saledate and batchno =:batchno  using sqlca;

/* SQL Parameters List
0-> :totalamount
1-> :totalinmoney
2-> :totalsalemoney
3-> :totaldiscountmoney
4-> :supplierdiscount
5-> :supplierdiscount
6-> :gdsincode
7-> :deptcode
8-> :saledate
9-> :batchno
*/

    else
        insert into rep_goods_discount values ( :deptcode , :gdsincode , :saledate , 0 , 0 , 0 , 0 , 0 , 0 , ' ' , ' ' , ' ' , 0 , 0 )  using sqlca;

/* SQL Parameters List
0-> :deptcode
1-> :gdsincode
2-> :saledate
3-> :totalamount
4-> :totalinmoney
5-> :totalsalemoney
6-> :totaldiscountmoney
7-> :supplierdiscount
8-> :supplierdiscount
9-> :deptpath
10-> :batchno
11-> :suppliercode
*/

解决方案四:

end if

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

end if

end if

if discountbillno <> "" then
currentdiscountmoney = batchshouldpay - batchactualpay
currentsupplierdiscount = myround(currentdiscountmoney * discountrate,2)
supplierdiscount = myround(totaldiscountmoney * discountrate,2)
select count ( ) INTO :haverecord from rep_discountbill
where recorddate =:saledate and billno =:discountbillno and deptcode =:deptcode and gdsincode =:gdsincode and batchno =:batchno using sqlca;
/
SQL Parameters List
0-> :haverecord
1-> :saledate
2-> :discountbillno
3-> :deptcode
4-> :gdsincode
5-> :batchno
*/

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

if haverecord <> 0 then
    update rep_discountbill set amount =amount + 0 , inmoney =inmoney + 0 , inmoney_nt =inmoney_nt + 0 , salemoney =salemoney + 0 , saletax =saletax + 0 , discountmoney =discountmoney + 0 , supplierdiscount =supplierdiscount + 0 , sendflag =0
    where recorddate =:saledate and billno =:discountbillno and deptcode =:deptcode and gdsincode =:gdsincode and batchno =:batchno  using sqlca;

/* SQL Parameters List
0-> :totalamount
1-> :totalinmoney
2-> :batchsaleinmoney_nt
3-> :totalsalemoney
4-> :batchsaletax
5-> :currentdiscountmoney
6-> :currentsupplierdiscount
7-> :saledate
8-> :discountbillno
9-> :deptcode
10-> :gdsincode
11-> :batchno
/
else
insert into rep_discountbill values ( :saledate , ' ' , ' ' , ' ' , ' ' , 0 , 0 , 0 , 0 , 0 , 0 , 0 , ' ' , 0 ) using sqlca;
/
SQL Parameters List
0-> :saledate
1-> :discountbillno
2-> :deptcode
3-> :gdsincode
4-> :batchno
5-> :totalamount
6-> :totalinmoney
7-> :batchsaleinmoney_nt
8-> :totalsalemoney
9-> :batchsaletax
10-> :currentdiscountmoney
11-> :currentsupplierdiscount
12-> :suppliercode
*/
end if

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

end if

if balancemode = 2 then

if stockflag = 6 then
    select deptcode into :shopcode from acc_gdsbatchdtl where batchno =:batchno and gdsincode =:gdsincode  using sqlca;

/* SQL Parameters List
0-> :shopcode
1-> :batchno
2-> :gdsincode
*/

    if sqlca.sqlcode <> 0 then
        sqlca.sqlerrtext = sqlca.sqlerrtext + "6,select from acc_gdsbatchdtl,batchno:" + batchno + "gdscode:" + gdsincode
        return false
    end if

    if sendothergoodssale(saledate,deptcode,gdsincode,batchno,1,suppliercode,totalamount,totalinmoney,totalsalemoney,shopcode) = false then
        sqlca.sqlerrtext = sqlca.sqlerrtext + "6,function sendothergoodssale"
        return false
    end if

else

    if othergoodssale(saledate,deptcode,gdsincode,batchno,1,suppliercode,totalamount,totalinmoney,totalsalemoney) = false then
        sqlca.sqlerrtext = sqlca.sqlerrtext + "6.1, othergoodssale,deptcode:" + deptcode + ",gdsincode:" + gdsincode
        return false
    end if

end if

end if

if saledate = gtoday then
update rep_supplier set returnsupplier =returnsupplier + 0 , frontsalemoney =frontsalemoney + 0 + 0 , frontinmoney =frontinmoney + 0 + 0 + 0 , backinmoney =backinmoney + 0 , backsalemoney =backsalemoney + 0 , moveout =moveout + 0 + 0 , damage =damage + 0 , chkless =chkless + 0 , alterout =alterout + 0 , nowinmoney =nowinmoney - 0 - 0 - 0 , nowsalemoney =nowsalemoney - 0 - 0 , frontinmoney_nt =frontinmoney_nt + 0 + 0 + 0 , frontsaletax =frontsaletax + 0 + 0 , backinmoney_nt =backinmoney_nt + 0 , backsaletax =backsaletax + 0 , sendflag =0
where suppliercode =:suppliercode and recorddate =:saledate and deptcode =:gshopcode using sqlca;
/* SQL Parameters List
0-> :str_lost.lostreturninmoney
1-> :batchactualpay
2-> :str_lost.lostretailmoney
3-> :batchsaleinmoney
4-> :str_lost.lostretailinmoney
5-> :str_lost.inmoneychange
6-> :str_lost.lostwholesaleinmoney
7-> :str_lost.lostwholesalemoney
8-> :str_lost.lostmoveinmoney
9-> :str_lost.lostsendinmoney
10-> :str_lost.lostdamageinmoney
11-> :str_lost.lostcheckinmoney
12-> :str_lost.lostalterinmoney
13-> :batchsaleinmoney
14-> :str_lost.totallostinmoney
15-> :str_lost.inmoneychange
16-> :batchsalesalemoney
17-> :str_lost.totallostsalemoney
18-> :batchsaleinmoney_nt
19-> :str_lost.lostretailinmoney_nt
20-> :str_lost.inmoneychange_nt
21-> :batchsaletax
22-> :str_lost.lostretailsaletax
23-> :str_lost.lostwholesaleinmoney_nt
24-> :str_lost.lostwholesalesaletax
25-> :suppliercode
26-> :saledate
27-> :gshopcode
*/

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

else
update rep_supplier set nowinmoney =nowinmoney - 0 , nowsalemoney =nowsalemoney - 0 , frontinmoney =frontinmoney + 0 , frontsalemoney =frontsalemoney + 0 , frontinmoney_nt =frontinmoney_nt + 0 , frontsaletax =frontsaletax + 0 , sendflag =0
where recorddate =:saledate and deptcode =:gshopcode and suppliercode =:suppliercode using sqlca;
/* SQL Parameters List
0-> :batchsaleinmoney
1-> :batchsalesalemoney
2-> :batchsaleinmoney
3-> :batchactualpay
4-> :batchsaleinmoney_nt
5-> :batchsaletax
6-> :saledate
7-> :gshopcode
8-> :suppliercode
*/

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

update rep_supplier set returnsupplier =returnsupplier + 0 , frontsalemoney =frontsalemoney + 0 , frontinmoney =frontinmoney + 0 + 0 , backinmoney =backinmoney + 0 , backsalemoney =backsalemoney + 0 , moveout =moveout + 0 + 0 , damage =damage + 0 , chkless =chkless + 0 , alterout =alterout + 0 , nowinmoney =nowinmoney - 0 - 0 , nowsalemoney =nowsalemoney - 0 , frontinmoney_nt =frontinmoney_nt + 0 + 0 , frontsaletax =frontsaletax + 0 , backinmoney_nt =backinmoney_nt + 0 , backsaletax =backsaletax + 0 , sendflag =0
where suppliercode =:suppliercode and recorddate =:gtoday and deptcode =:gshopcode  using sqlca;

/* SQL Parameters List
0-> :str_lost.lostreturninmoney
1-> :str_lost.lostretailmoney
2-> :str_lost.lostretailinmoney
3-> :str_lost.inmoneychange
4-> :str_lost.lostwholesaleinmoney
5-> :str_lost.lostwholesalemoney
6-> :str_lost.lostmoveinmoney
7-> :str_lost.lostsendinmoney
8-> :str_lost.lostdamageinmoney
9-> :str_lost.lostcheckinmoney
10-> :str_lost.lostalterinmoney
11-> :str_lost.totallostinmoney
12-> :str_lost.inmoneychange
13-> :str_lost.totallostsalemoney
14-> :str_lost.lostretailinmoney_nt
15-> :str_lost.inmoneychange_nt
16-> :str_lost.lostretailsaletax
17-> :str_lost.lostwholesaleinmoney_nt
18-> :str_lost.lostwholesalesaletax
19-> :suppliercode
20-> :gtoday
21-> :gshopcode
*/

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

end if

if daysbefore > 0 then
recorddate = saledate

for j = 1 to daysbefore
    recorddate = relativedate(recorddate,1)
    update rep_supplier set nowinmoney =nowinmoney - 0 , nowsalemoney =nowsalemoney - 0 , sendflag =0
    where recorddate =:recorddate and deptcode =:gshopcode and suppliercode =:suppliercode  using sqlca;

/* SQL Parameters List
0-> :batchsaleinmoney
1-> :batchsalesalemoney
2-> :recorddate
3-> :gshopcode
4-> :suppliercode
*/

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

next

end if

select count ( ) INTO :haverecord from rep_saler
where recorddate =:saledate and salercode =:salercode and salername =:salername using sqlca;
/
SQL Parameters List
0-> :haverecord
1-> :saledate
2-> :salercode
3-> :salername
*/

if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "7,rep_saler,salercode :" + salercode + ",salername" + salername
return false
end if

if haverecord <> 0 then
update rep_saler set salemoney =salemoney + 0 , profit =profit + 0 , inmoney =inmoney + 0 , inmoney_nt =inmoney_nt + 0 , saletax =saletax + 0
where recorddate =:saledate and salercode =:salercode and salername =:salername using sqlca;
/* SQL Parameters List
0-> :batchactualpay
1-> :batchprofit
2-> :batchsaleinmoney
3-> :batchsaleinmoney_nt
4-> :batchsaletax
5-> :saledate
6-> :salercode
7-> :salername
/
else
insert into rep_saler values ( :salercode , :salername , :saledate , 0 , 0 , 0 , 0 , 0 , 0 ) using sqlca;
/
SQL Parameters List
0-> :salercode
1-> :salername
2-> :saledate
3-> :batchactualpay
4-> :batchprofit
5-> :batchsaleinmoney
6-> :batchsaleinmoney_nt
7-> :batchsaletax
*/
end if

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

if batchsaleamount > 0 then

if f_rep_sendadd(gtoday,deptcode,suppliercode,gdsincode,al_classcode,batchno,batchsaleamount,"frontsale",inprice,inprice_nt,origin_batchno,origin_inprice,origin_inprice_nt) = false then
    return false
end if

end if

changeinmoney = 0
changeinmoney_nt = 0

if batchno <> gbatchno then

if discountchangedeal(deptcode,gdsincode,batchno,as_shopcode,al_classcode,batchsaleamount,batchactualpay,batchshouldpay,batchsaleinmoney,batchsaleinmoney_nt,saledate,buyercode,buyername,discountbillno,changeinmoney,changeinmoney_nt) = false then
    return false
end if

end if

wf_dw_supplier_sale(suppliercode,0,batchactualpay)

if ib_have_coupon = true then
wf_dw_supplier_goods_sale(suppliercode,gdsincode,batchactualpay)
end if

adbl_saleinmoney = batchsaleinmoney + changeinmoney
adbl_saleinmoney_nt = batchsaleinmoney_nt + changeinmoney_nt
adbl_saletax = batchsaletax
return true
end function

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);string changebillno
string changesuppliercode
string batch_suppliercode
double cheapinprice
double oddment
double batchinprice
double batchinprice_nt
double intaxrate
double cheapinmoney
double cheapinmoney_nt
double changeinmoney
double changeinmoney_nt
double tmpcheapinmoney
integer setsupplier
long haverecord
integer calmode
integer id
double suppliersharerate
string originbatchno
double batchinprice_origin
double nowamount

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 bil_discount_change.billno , bil_discount_change_goods.cheapinprice , bil_discount_change_goods.setsupplier , bil_discount_change_goods.suppliercode , bil_discount_change_goods.oddment , calmode , suppliersharerate
into :changebillno,:cheapinprice,:setsupplier,:changesuppliercode,:oddment,:calmode,:suppliersharerate
from bil_discount_change_goods , bil_discount_change
where bil_discount_change_goods.billno =bil_discount_change.billno
and bil_discount_change_goods.shopcode =:as_shopcode
and bil_discount_change_goods.gdsincode =:as_gdsincode
and bil_discount_change.dealflag =1
and bil_discount_change_goods.saleendflag =0
and bil_discount_change.salestartdate <= :adt_saledate and bil_discount_change.saleenddate >= :adt_saledate using sqlca;
/* SQL Parameters List
0-> :changebillno
1-> :cheapinprice
2-> :setsupplier
3-> :changesuppliercode
4-> :oddment
5-> :calmode
6-> :suppliersharerate
7-> :as_shopcode
8-> :as_gdsincode
9-> :adt_saledate
10-> :adt_saledate
*/

if sqlca.sqlcode = 100 then
return true
else

if sqlca.sqlcode <> 0 then
    sqlca.sqlerrtext = sqlca.sqlerrtext + "select from bil_discount_change_goods,gdsincode :" + as_gdsincode + ",shopcode:" + as_shopcode
    return false
end if

end if

select inprice , inprice_nt , suppliercode , intaxrate , originbatchno
into :batchinprice,:batchinprice_nt,:batch_suppliercode,:intaxrate,:originbatchno
from acc_gdsbatchdtl where gdsincode =:as_gdsincode and batchno =:as_batchno using sqlca;
/* SQL Parameters List
0-> :batchinprice
1-> :batchinprice_nt
2-> :batch_suppliercode
3-> :intaxrate
4-> :originbatchno
5-> :as_gdsincode
6-> :as_batchno
*/

if sqlca.sqlcode <> 0 then
sqlca.sqlerrtext = sqlca.sqlerrtext + "1,select from acc_gdsbatchdtl,gdsincode :" + as_gdsincode + ",batchno:" + as_batchno
return false
end if

if setsupplier = 1 and lower(changesuppliercode) <> lower(batch_suppliercode) then
return true
end if

if calmode = 1 then

if originbatchno = as_batchno then

    if myround(cheapinprice - batchinprice,6) >= 0 then
        return true
    end if

    tmpcheapinmoney = myround(adbl_batchsaleamount * cheapinprice,10) + oddment
    cheapinmoney = myround(tmpcheapinmoney,2)
    oddment = tmpcheapinmoney - cheapinmoney
    cheapinmoney_nt = myround(cheapinmoney / (1 + intaxrate),2)
    changeinmoney = cheapinmoney - adbl_batchinmoney
    changeinmoney_nt = cheapinmoney_nt - adbl_batchinmoney_nt
else
    select inprice into :batchinprice_origin from acc_gdsbatchdtl
    where gdsincode =:as_gdsincode and batchno =:originbatchno  using sqlca;

/* SQL Parameters List
0-> :batchinprice_origin
1-> :as_gdsincode
2-> :originbatchno
*/

    if sqlca.sqlcode <> 0 then
        sqlca.sqlerrtext = sqlca.sqlerrtext + "1,select from acc_gdsbatchdtl,gdsincode :" + as_gdsincode + ",batchno:" + as_batchno
        return false
    end if

    if myround(cheapinprice - batchinprice_origin,6) >= 0 then
        return true
    end if

    cheapinprice = cheapinprice + batchinprice - batchinprice_origin
    tmpcheapinmoney = myround(adbl_batchsaleamount * cheapinprice,10) + oddment
    cheapinmoney = myround(tmpcheapinmoney,2)
    oddment = tmpcheapinmoney - cheapinmoney
    cheapinmoney_nt = myround(cheapinmoney / (1 + intaxrate),2)
    changeinmoney = cheapinmoney - adbl_batchinmoney
    changeinmoney_nt = cheapinmoney_nt - adbl_batchinmoney_nt
end if

else

if calmode = 2 then
    changeinmoney = myround((adbl_batchactualpay - adbl_batchshouldpay) * suppliersharerate,2)

    if changeinmoney = 0 then
        return true
    end if

    changeinmoney_nt = myround(changeinmoney / (1 + intaxrate),2)
    cheapinmoney = myround(adbl_batchinmoney + changeinmoney,2)
    cheapinmoney_nt = myround(adbl_batchinmoney_nt + changeinmoney_nt,2)
    cheapinprice = myround(abs(cheapinmoney / adbl_batchsaleamount),6)

    if myround(cheapinprice - batchinprice,6) >= 0 then
        return true
    end if

else
    return true
end if

end if

update rep_i_deptdaily set frontsalemoney =frontsalemoney + 0 , frontsalemoney_nt =frontsalemoney_nt + 0 , changeless =changeless - 0 , changeless_nt =changeless_nt - 0 , sendflag =0
where recorddate =:adt_saledate and deptcode =:as_deptcode using sqlca;
/* SQL Parameters List
0-> :changeinmoney
1-> :changeinmoney_nt
2-> :changeinmoney
3-> :changeinmoney_nt
4-> :adt_saledate
5-> :as_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
*/

时间: 2024-08-04 09:56:14

故障-PB编译错误, 求大哥大叔帮忙解决困惑, 3个错误 附上图, 在线等待热心人。。。的相关文章

Myeclipse把tomcat 6.0换成 tomcat 7.0出现这种错误求大神帮忙

问题描述 Myeclipse把tomcat 6.0换成 tomcat 7.0出现这种错误求大神帮忙 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/eco]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase

android 类qq空间图片查看器。出现好多错误 求大神帮忙。小女涉入甚浅。

问题描述 android 类qq空间图片查看器.出现好多错误 求大神帮忙.小女涉入甚浅. 11-20 11:26:39.629: E/AndroidRuntime(1136): FATAL EXCEPTION: main 11-20 11:26:39.629: E/AndroidRuntime(1136): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.desktop/co

编程-有一个小程序急用,但是我不会编译,求大神帮忙编译啊~~~太感谢!!

问题描述 有一个小程序急用,但是我不会编译,求大神帮忙编译啊~~~太感谢!! 如题,是一个小程序,用的是自己的makefile,下载下来了但是不会编译啊~~~~要exe格式的,那位大神可以帮忙编译出来真是太感激不尽!或者教一下我~~~太感谢了!编译好请发zhaojialiangsuper@126.com~源码地址 源码:https://releases.stm32flash.googlecode.com/git/stm32flash-0.4.tar.gz 解决方案 http://download

错误信息-编译DX9程序出现奇怪的错误,请大牛帮忙解决,谢谢

问题描述 编译DX9程序出现奇怪的错误,请大牛帮忙解决,谢谢 1>g:directx 2007included3dx9math.h(787) : error C2143: syntax error : missing ',' before '*' 1>g:directx 2007included3dx9math.h(792) : error C2143: syntax error : missing ',' before '*' 1>g:directx 2007included3dx9m

实时调试- 电脑一开机就跳出对话框显示.NET FRAMWORK出现错误, 急求大神帮忙解决!

问题描述 电脑一开机就跳出对话框显示.NET FRAMWORK出现错误, 急求大神帮忙解决! 电脑原本没这个问题,昨天卸载了一些如土豆视频之类的应用软件后就出现了此问题,现在QQ,迅雷等账号都无法登陆,显示登陆超时,但浏览器网页可以打开.我试过将.NET FRAMWORK卸载后重装,问题依然无法解决.错误对话框如下: 解决方案 既然是启动出问题,装个CClear之类的工具,把启动项分批禁用,找出引起问题的那个,删除它. 解决方案二: Microsoft.NET没有安装好或者与是系统Microso

php开发遇到错误 Creating default object from empty value 求大神帮忙解决下

问题描述 php开发遇到错误 Creating default object from empty value 求大神帮忙解决下 代码: 14 define('IN_ECS', true); 15 $smarty->left_delimiter = '<!--{'; 16 $smarty->right_delimiter = '}-->'; 17 require(dirname(__FILE__) . '/includes/init.php'); 18 if ((DEBUG_MOD

android播放器点播放后,出现以下错误,求大神帮忙解决

问题描述 android播放器点播放后,出现以下错误,求大神帮忙解决 解决方案 权限设置没设置,要在配置文件把android.permission.access_network_state这个权限加进去

在网上下载了一个zint-2.4.3的源码 用qt编译的时候 编译不过 求大神帮忙

问题描述 在网上下载了一个zint-2.4.3的源码 用qt编译的时候 编译不过 求大神帮忙 在网上下载了一个zint-2.4.3的源码 用qt编译的时候 编译不过 求大神帮忙

跪求大神帮忙解决一个java语法问题

问题描述 跪求大神帮忙解决一个java语法问题 有行代码编译总是不能通过,我觉得是语法问题,但是找了很久都找不出来啊.请大婶帮忙解决,感激不尽. 解决方案 你的代码呢?你的代码呢? 解决方案二: 1.请把您的问题要点尽量在标题说明,大神都很忙,有时不会点进来看内容,会先用标题过滤一下:2.就算大神今天闲下来,您这也没代码可看啊. 解决方案三: 检查 1. 单词 有没有写错,2.命名是否不符合要求3.语法问题 需要看代码 解决方案四: 编译不通过的问题大致分为两种,1,语法错误.2.ide(ecl