📄 frm_allexportbillinfo.~pas
字号:
exit;
end;
{读取主单记录}
context:=fileread(myfilehandle,ztrustfile,sizeof(ztrustfile));
SqlStr:='';
thdm.UpStr(sqlstr,'filetable ');
{Maincode}
thdm.UpStr(sqlstr,'maincode',Ztrustfile.mawb,',');
{hawb}
thdm.UpStr(sqlstr,'hawb',Ztrustfile.hawb,',');
{FileNo}
thdm.UpStr(sqlstr,'FileNo',Ztrustfile.fileno,',');
{trusttype}
thdm.UpStr(sqlstr,'TrustType',Ztrustfile.trusttype,',');
{trustsource}
thdm.UpStr(sqlstr,'TrustSource',Ztrustfile.trustsource,',');
{quotecode}
if Ztrustfile.jjcode='' then
thdm.UpStr(sqlstr,'QuoteCode','null',',')
else
thdm.UpStr(sqlstr,'QuoteCode',Ztrustfile.jjcode,',');
{djnumber}
thdm.UpStr(sqlstr,'DjNumber',Ztrustfile.djnumber,',');
{kjkm}
thdm.UpStr(sqlstr,'kjkm',Ztrustfile.kjkm,',');
{zcdjnumber}
thdm.UpStr(sqlstr,'zcdjnumber',Ztrustfile.zcdjnumber,',');
{zckjkm}
thdm.UpStr(sqlstr,'zckjkm',Ztrustfile.zckjkm,',');
{cuscode}
if Ztrustfile.cuscode='' then
thdm.UpStr(sqlstr,'CusCode','null',',')
else
thdm.UpStr(sqlstr,'cuscode',Ztrustfile.cuscode,',');
{发货人名称}
thdm.UpStr(sqlstr,'cuscodename',Ztrustfile.cuscodename,',');
{收货人}
thdm.UpStr(sqlstr,'ShouHuoren',Ztrustfile.consigncode,',');
{收货人名称}
thdm.UpStr(sqlstr,'Consignname',Ztrustfile.consignname,',');
{代理商}
thdm.UpStr(sqlstr,'agentcode',Ztrustfile.agentcode,',');
{Shipper}
thdm.UpStr(sqlstr,'Shipper',Ztrustfile.shipper,',');
{Consignee}
thdm.UpStr(sqlstr,'Consignee',Ztrustfile.consignee,',');
{Agent 通知方}
thdm.UpStr(sqlstr,'agent',Ztrustfile.inform,',');
{cuscompany运费对象}
thdm.UpStr(sqlstr,'cuscompany','',',');
{Reciplace 收货地}
thdm.UpStr(sqlstr,'reciplace',Ztrustfile.receport,',');
{AirPort 装货港}
thdm.UpStr(sqlstr,'airport',Ztrustfile.loadport,',');
{AirPortTo 卸货港}
thdm.UpStr(sqlstr,'airportto',Ztrustfile.unloadport,',');
{destination 目的地}
thdm.UpStr(sqlstr,'destination',Ztrustfile.dest,',');
{Carrier 航空公司}
thdm.UpStr(sqlstr,'carrier',Ztrustfile.shipcomcode,',');
{一乘航班,经停,出运日期}
thdm.UpStr(sqlstr,'by1',Ztrustfile.ycvoyage,',');
thdm.UpStr(sqlstr,'to1',Ztrustfile.ycport,',');
thdm.UpStr(sqlstr,'fdate',Ztrustfile.ycvoyagedate,',');
thdm.UpStr(sqlstr,'dfdate',Ztrustfile.ycvoyagedate,',');
thdm.UpStr(sqlstr,'fdate1',Ztrustfile.ycvoyagedate,',');
{二乘航班,经停,出运日期}
thdm.UpStr(sqlstr,'by2',Ztrustfile.ecvoyage,',');
thdm.UpStr(sqlstr,'to2',Ztrustfile.ecport,',');
thdm.UpStr(sqlstr,'fdate2',Ztrustfile.ecvoyagedate,',');
{三乘航班,经停,出运日期}
thdm.UpStr(sqlstr,'by3',Ztrustfile.scvoyage,',');
thdm.UpStr(sqlstr,'to3',Ztrustfile.scport,',');
thdm.UpStr(sqlstr,'fdate3',Ztrustfile.scvoyagedate,',');
{Accinfo 麦头}
thdm.UpStr(sqlstr,'accinfo',Ztrustfile.maitou,',');
{Handing}
thdm.UpStr(sqlstr,'handling',Ztrustfile.hi,',');
{Curr}
thdm.UpStr(sqlstr,'curr',Ztrustfile.currency,',');
{CHGS}
thdm.UpStr(sqlstr,'chgs',Ztrustfile.chgs,',');
{PPD}
thdm.UpStr(sqlstr,'ppd',Ztrustfile.ppd,',');
{COLL}
thdm.UpStr(sqlstr,'coll',Ztrustfile.coll,',');
{OPPD}
thdm.UpStr(sqlstr,'oppd',Ztrustfile.oppd,',');
{OCOLL}
thdm.UpStr(sqlstr,'ocoll',Ztrustfile.ocoll,',');
{DCV}
thdm.UpStr(sqlstr,'dvc',Ztrustfile.dvc,',');
{DVCus}
thdm.UpStr(sqlstr,'dvcus',Ztrustfile.odvc,',');
{accinsurance}
thdm.UpStr(sqlstr,'AccInsurance',Ztrustfile.ai,',');
{A.i.c.}
thdm.UpStr(sqlstr,'aic',Ztrustfile.aic,',');
{签定日期}
thdm.UpStr(sqlstr,'execdate',Ztrustfile.billdate,',');
thdm.UpStr(sqlstr,'dexecdate',Ztrustfile.billdate,',');
{签定地点}
thdm.UpStr(sqlstr,'execplace',Ztrustfile.billplace,',');
{业务员}
thdm.UpStr(sqlstr,'bussiness',Ztrustfile.bussiness,',');
{Befinish 是否完成标记}
thdm.UpStr(sqlstr,'befinish',Ztrustfile.finish,',');
thdm.UpStr(sqlstr,'keydown',Ztrustfile.keydown,',');
thdm.UpStr(sqlstr,'ifdiscard',Ztrustfile.discard,',');
thdm.UpStr(sqlstr,'ifzhidan',Ztrustfile.zhidan,',');
{进出口标记 出口为1}
thdm.UpStr(sqlstr,'inout',1,',');
{修改操作人}
thdm.UpStr(sqlstr,'modioper',Ztrustfile.ModiOper,',');
{操作人}
thdm.UpStr(sqlstr,'operate',Ztrustfile.opercode,'');
thdm.UpStr(sqlstr,'FileCode=',ZtrustFile.Relacode,'w');
if thdm.execsql(sqlstr) then
else
begin
thdm.THMsgother('主单数据更新时出错,记录导入失败,请检查!',mtinformation);
exit;
end;
Varmain:=ZtrustFile.relacode;
RelaCode:=ZTrustFile.relacode;
thdm.ExecSQL(pchar('delete from planegoods where filecode='''+VarMain+''''));
{保存货物记录}
if ztrustfile.GoodsNumber>0 then
begin
for i:=1 to ztrustfile.goodsnumber do
begin
context:=fileread(myfilehandle,goodsfile,sizeof(goodsfile));
codeget:=THDM.GetCode('B') ;
{件数 单位 体积 等级 公式 }
{计费重量 单价 费用 货物描述 编号 编号 C.M.I 一个 }
SqlStr:='Insert into PlaneGoods(GoodsCode,FileCode,Pieces,weight,'+
'kgid,Size,rateclass,Formula,chargweight,rate,'+
'total,SpeGoods,SpeRemark,goods) Values(';
THDM.InsStr(SqlStr,codeget,',');
THDM.InsStr(SqlStr,VarMain,',');
THDM.InsStr(SqlStr,goodsfile.GoodsNumber ,',');
THDM.InsStr(SqlStr,goodsfile.goodsweight,',');
THDM.InsStr(SqlStr,goodsfile.goodsunit,',');
THDM.InsStr(SqlStr,goodsfile.goodssize,',');
THDM.InsStr(SqlStr,goodsfile.goodsgrade,',');
THDM.InsStr(SqlStr,goodsfile.formul,',');
THDM.InsStr(SqlStr,goodsfile.chargeweight,',');
THDM.InsStr(SqlStr,goodsfile.unitprice,',');
THDM.InsStr(SqlStr,goodsfile.total,',');
THDM.InsStr(SqlStr,'',',');
THDM.InsStr(SqlStr,'',',');
THDM.InsStr(SqlStr,goodsfile.goodsdesc,'');
if thdm.ExecSQL(sqlstr) then
else
begin
thdm.THMsgother('主单货物数据数据导入插入时出错,记录导入失败,请检查!',mtinformation);
exit;
end;
end;
end;
{进舱派车通知}
thdm.ExecSQL(pchar('delete from Landtrans where trustcode='''+VarMain+''''));
if ztrustfile.JCPCNumber>0 then
begin
context:=fileread(myfilehandle,jcpcfile,sizeof(jcpcfile));
CodeGet:=thdm.GetCode('Q');
SqlStr:='insert into landtrans(transcode,trustcode,goodshw,'+
'carname,carrela,thdate,stationcode,'+
'stationaddr,stationrelation,stationtele,jcno,jcdate,'+
'jctime,ccdate,cctime,goodsplace,'+
'goodsrelationstyle,goodsrelation,dodate,jcpc,benative,remark) values(';
thdm.InsStr(sqlstr,CodeGet,',');
thdm.InsStr(sqlstr,Varmain,',');
thdm.InsStr(sqlstr,jcpcfile.goodshw,',');
thdm.InsStr(sqlstr,jcpcfile.carname,',');
thdm.InsStr(sqlstr,jcpcfile.carrela,',');
thdm.InsStr(sqlstr,jcpcfile.thdate,',');
thdm.InsStr(sqlstr,jcpcfile.station,',');
thdm.InsStr(sqlstr,jcpcfile.stationaddr,',');
thdm.InsStr(sqlstr,jcpcfile.stationrela,',');
thdm.InsStr(sqlstr,jcpcfile.stationstyle,',');
thdm.InsStr(sqlstr,jcpcfile.jcno,',');
thdm.InsStr(sqlstr,jcpcfile.jcdate,',');
thdm.InsStr(sqlstr,jcpcfile.jctime,',');
thdm.InsStr(sqlstr,jcpcfile.ccdate,',');
thdm.InsStr(sqlstr,jcpcfile.cctime,',');
thdm.InsStr(sqlstr,jcpcfile.goodsplace,',');
thdm.InsStr(sqlstr,jcpcfile.goodsrelastyle,',');
thdm.InsStr(sqlstr,jcpcfile.goodsrela,',');
thdm.InsStr(sqlstr,jcpcfile.recorddate,',');
thdm.InsStr(sqlstr,jcpcfile.ifpc,',');
thdm.InsStr(sqlstr,jcpcfile.ifnative,',');
thdm.InsStr(sqlstr,jcpcfile.remark,'');
if thdm.ExecSQL(sqlstr) then
else
begin
thdm.THMsgother('主单进舱派车数据导入插入时出错,记录导入失败,请检查!',mtinformation);
exit;
end;
end;
{报关文件}
thdm.ExecSQL(pchar('delete from truckfile where trustcode='''+VarMain+''''));
if ztrustfile.bgnumber>0 then
begin
for i:=1 to ztrustfile.bgnumber do
begin
context:=fileread(myfilehandle,bgfile,sizeof(bgfile));
codeget:=thdm.GetCode('K');
sqlstr:='insert into truckfile(kcode,trustcode,fileno,mawb,cuscode,'+
'ciqname,filename,filenameno,recedate,returndate,ciqrecedate,ciqreturndate,'+
'occurtime,PlaneOcean,operator,remark) values(';
thdm.InsStr(sqlstr,codeget,',');
thdm.InsStr(sqlstr,varmain,',');
thdm.InsStr(sqlstr,bgfile.fileno,',');
thdm.InsStr(sqlstr,bgfile.mawb,',');
thdm.InsStr(sqlstr,bgfile.jyname,',');
thdm.InsStr(sqlstr,bgfile.bghname,',');
thdm.InsStr(sqlstr,bgfile.filename,',');
thdm.InsStr(sqlstr,bgfile.filenameno,',');
thdm.InsStr(sqlstr,bgfile.cusrecedate,',');
thdm.InsStr(sqlstr,bgfile.cusretudate,',');
thdm.InsStr(sqlstr,bgfile.ciqrecedate,',');
thdm.InsStr(sqlstr,bgfile.ciqretudate,',');
thdm.InsStr(sqlstr,bgfile.recorddate,',');
thdm.InsStr(sqlstr,1,',');
thdm.InsStr(sqlstr,bgfile.opercode,',');
thdm.InsStr(sqlstr,bgfile.remark,'');
if THDM.ExecSQL(SqlStr) then
else
begin
thdm.THMsgother('主单报关文件数据导入插入时出错,记录导入失败,请检查!',mtinformation);
exit;
end;
end;
end;
{费用记录}
thdm.ExecSQL(pchar('delete from fareinfo where filecode='''+VarMain+''''));
if ztrustfile.farenumber>0 then
begin
for i:=1 to ztrustfile.farenumber do
begin
context:=fileread(myfilehandle,farefile,sizeof(farefile));
codeget:=thdm.GetCode('F');
SqlStr:='insert into FareInfo(Fareno,Filecode,cuscode,cuscodename,'+
'Farecode,Farepaytodate,Billno,invoiceno,bxno,operator,Acount,FareType,'+
'Writedate,currencytype,currencyrate,recedeal,'+
'goodscode,unitprice,opercwmark,Remark) values (';
thdm.InsStr(sqlstr,codeget,',');
thdm.InsStr(sqlstr,varmain,',');
thdm.InsStr(sqlstr,farefile.cuscode,',');
thdm.InsStr(sqlstr,farefile.cuscodename,',');
thdm.InsStr(sqlstr,farefile.farename,',');
thdm.InsStr(sqlstr,farefile.paytodate,',');
thdm.InsStr(sqlstr,farefile.billno,',');
thdm.InsStr(sqlstr,farefile.invoiceno,',');
thdm.InsStr(sqlstr,'',',');
thdm.InsStr(sqlstr,farefile.opercode,',');
thdm.InsStr(sqlstr,farefile.fareacount,',');
thdm.InsStr(sqlstr,farefile.faretype,',');
thdm.InsStr(sqlstr,farefile.recorddate,',');
thdm.InsStr(sqlstr,farefile.currencytype,',');
thdm.InsStr(sqlstr,farefile.rate,',');
thdm.InsStr(sqlstr,farefile.recedeal,',');
thdm.InsStr(sqlstr,farefile.farefl,',');
thdm.InsStr(sqlstr,farefile.unitprice,',');
thdm.InsStr(sqlstr,farefile.opercwmark,',');
thdm.InsStr(sqlstr,'','');
if THDM.ExecSQL(SqlStr) then
else
begin
thdm.THMsgother('主单费用数据导入插入时出错,记录导入失败,请检查!',mtinformation);
exit;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -