You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

204 lines
6.4 KiB
Plaintext

unit u_cw_duibi;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, wwdbdatetimepicker, bsSkinCtrls, BusinessSkinForm, DB,
ADODB;
type
Tfrm_cw_duibi = class(TForm)
Label8: TLabel;
wwDBDateTimePicker3: TwwDBDateTimePicker;
Label11: TLabel;
wwDBDateTimePicker4: TwwDBDateTimePicker;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsBusinessSkinForm1: TbsBusinessSkinForm;
t_bill: TADOQuery;
db_cw: TADOConnection;
T_Voucher: TADOQuery;
t_cw_design: TADOQuery;
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_cw_duibi: Tfrm_cw_duibi;
implementation
uses u_main, u_sys_progress;
{$R *.dfm}
procedure Tfrm_cw_duibi.bsSkinButton1Click(Sender: TObject);
var
str:widestring;
begin
t_cw_design.open;
str:='Provider=SQLOLEDB.1;';
str:=str+'Password='+t_cw_design.fieldbyname('登陆密码').asstring+';';
str:=str+'Persist Security Info=False;';
str:=str+'User ID='+t_cw_design.fieldbyname('登陆用户').asstring+';';
str:=str+'Initial Catalog='+t_cw_design.fieldbyname('数据库').asstring+';';
str:=str+'Data Source='+t_cw_design.fieldbyname('服务器').asstring;
db_cw.Connected:=false;
db_cw.ConnectionString:=str;
if (wwDBDateTimePicker3.text='')or(wwDBDateTimePicker4.text='')then
begin
showmessage('请输入会计期间的开始结束日期!!');
exit;
end;
case t_cw_design.fieldbyname('财务软件').asinteger of
0:
begin
end;
1:
begin
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(self);
frm_sys_progress.bsSkinGauge1.ProgressText:='打开数据请等候。。。';
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.MaxValue:=35;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.Update;
T_Voucher.close;
T_Voucher.sql.clear;
T_Voucher.sql.add('select FVoucherID from T_Voucher');
T_Voucher.open;
t_bill.close;
t_bill.sql.clear;
t_bill.sql.add('select 业务编号,财务,财务凭证 from t_op_seae where 财务=1 '
+' and 会计期间>='+''''+wwDBDateTimePicker3.text+''''
+' and 会计期间<='+''''+wwDBDateTimePicker4.text+'''');
t_bill.open;
if not t_bill.IsEmpty then
begin
frm_sys_progress.bsSkinGauge1.MaxValue:=t_bill.RecordCount;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.bsSkinGauge1.ProgressText:='比对海运出口业务。。。';
t_bill.first;
while not t_bill.eof do
begin
if not T_Voucher.locate('FVoucherID',t_bill.fieldbyname('财务凭证').asinteger,[]) then
begin
t_bill.edit;
t_bill['财务']:=0;
t_bill['财务凭证']:='';
t_bill.post;
end;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_bill.next;
end;
end;
t_bill.close;
t_bill.sql.clear;
t_bill.sql.add('select 业务编号,财务,财务凭证 from t_op_seai where 财务=1 '
+' and 会计期间>='+''''+wwDBDateTimePicker3.text+''''
+' and 会计期间<='+''''+wwDBDateTimePicker4.text+'''');
t_bill.open;
if not t_bill.IsEmpty then
begin
frm_sys_progress.bsSkinGauge1.MaxValue:=t_bill.RecordCount;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.bsSkinGauge1.ProgressText:='比对海运进口业务。。。';
t_bill.first;
while not t_bill.eof do
begin
if not T_Voucher.locate('FVoucherID',t_bill.fieldbyname('财务凭证').asinteger,[]) then
begin
t_bill.edit;
t_bill['财务']:=0;
t_bill['财务凭证']:='';
t_bill.post;
end;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_bill.next;
end;
end;
t_bill.close;
t_bill.sql.clear;
t_bill.sql.add('select 业务编号,财务,财务凭证 from t_op_aire where 财务=1 '
+' and 会计期间>='+''''+wwDBDateTimePicker3.text+''''
+' and 会计期间<='+''''+wwDBDateTimePicker4.text+'''');
t_bill.open;
if not t_bill.IsEmpty then
begin
frm_sys_progress.bsSkinGauge1.MaxValue:=t_bill.RecordCount;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.bsSkinGauge1.ProgressText:='比对空运出口业务。。。';
t_bill.first;
while not t_bill.eof do
begin
if not T_Voucher.locate('FVoucherID',t_bill.fieldbyname('财务凭证').asinteger,[]) then
begin
t_bill.edit;
t_bill['财务']:=0;
t_bill['财务凭证']:='';
t_bill.post;
end;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_bill.next;
end;
end;
t_bill.close;
t_bill.sql.clear;
t_bill.sql.add('select 业务编号,财务,财务凭证 from t_op_airi where 财务=1 '
+' and 会计期间>='+''''+wwDBDateTimePicker3.text+''''
+' and 会计期间<='+''''+wwDBDateTimePicker4.text+'''');
t_bill.open;
if not t_bill.IsEmpty then
begin
frm_sys_progress.bsSkinGauge1.MaxValue:=t_bill.RecordCount;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.bsSkinGauge1.ProgressText:='比对空运进口业务。。。';
t_bill.first;
while not t_bill.eof do
begin
if not T_Voucher.locate('FVoucherID',t_bill.fieldbyname('财务凭证').asinteger,[]) then
begin
t_bill.edit;
t_bill['财务']:=0;
t_bill['财务凭证']:='';
t_bill.post;
end;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_bill.next;
end;
end;
frm_sys_progress.close;
frm_sys_progress:=nil;
showmessage('凭证比对完成!!');
end;
2:
begin
end;
3:
begin
end;
end;
end;
procedure Tfrm_cw_duibi.bsSkinButton2Click(Sender: TObject);
begin
close;
end;
end.