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.

737 lines
34 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit u_check_all;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, BusinessSkinForm, bsSkinCtrls, DB, ADODB, StdCtrls, Mask,
DBCtrls, wwdblook, RxLookup, RxMemDS, dxExEdtr, dxTL, dxDBCtrl, dxDBGrid,
dxCntner, kbmMemTable, Grids, DBGrids, DBGridEh, ExtCtrls, bsdbctrls;
type
Tfrm_check_all = class(TForm)
bsBusinessSkinForm1: TbsBusinessSkinForm;
t_bz_balance: TRxMemoryData;
RxMemoryData1: TRxMemoryData;
DBGridEh1: TDBGridEh;
memtblprint1: TDataSource;
memtblprint: TkbmMemTable;
memtblprintORDNO: TIntegerField;
memtblprintFRT: TStringField;
memtblprintACCNAME: TStringField;
memtblprintOBJDR: TStringField;
memtblprintRMBDR: TFloatField;
memtblprintUSDDR: TFloatField;
memtblprintTTLDR: TFloatField;
memtblprintREMARKDR: TStringField;
memtblprintOBJCR: TStringField;
memtblprintRMBCR: TStringField;
memtblprintUSDCR: TFloatField;
memtblprintTTLCR: TFloatField;
memtblprintREMARKCR: TStringField;
memtblprintDR: TStringField;
memtblprintCR: TStringField;
memtblprintOTDR: TFloatField;
memtblprintOTCR: TFloatField;
memtblprintNOS: TIntegerField;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton16: TbsSkinButton;
DataSource1: TDataSource;
t_ch_accept: TADOQuery;
t_ch_pay: TADOQuery;
Panel2: TPanel;
bsSkinGroupBox1: TbsSkinGroupBox;
Memo1: TMemo;
bsSkinDBText1: TbsSkinDBText;
bsSkinLabel1: TbsSkinLabel;
V_op_bscard_All1: TDataSource;
V_op_bscard_All: TADOQuery;
bsSkinLabel2: TbsSkinLabel;
bsSkinDBText2: TbsSkinDBText;
bsSkinDBText3: TbsSkinDBText;
bsSkinLabel3: TbsSkinLabel;
bsSkinDBText4: TbsSkinDBText;
bsSkinLabel4: TbsSkinLabel;
bsSkinDBText5: TbsSkinDBText;
bsSkinLabel5: TbsSkinLabel;
bsSkinDBText6: TbsSkinDBText;
bsSkinLabel6: TbsSkinLabel;
bsSkinDBText7: TbsSkinDBText;
bsSkinLabel7: TbsSkinLabel;
bsSkinDBText8: TbsSkinDBText;
bsSkinLabel8: TbsSkinLabel;
bsSkinDBText9: TbsSkinDBText;
bsSkinLabel9: TbsSkinLabel;
bsSkinDBText10: TbsSkinDBText;
bsSkinLabel10: TbsSkinLabel;
bsSkinDBText11: TbsSkinDBText;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
BSNO:string;
procedure getsumstr;
end;
var
frm_check_all: Tfrm_check_all;
implementation
uses u_main, u_data_share, my_sys_function;
{$R *.dfm}
procedure Tfrm_check_all.getsumstr;
var
aQuery1,aQuery2:TAdoQuery;
str1,str2:string;
acceptstr,paystr:widestring;
accepteof,payeof:boolean;
armb,ausd,aot,atotal,prmb,pusd,pot,ptotal,rarmb,rausd,raot,ratotal,rprmb,rpusd,rpot,rptotal:double;
begin
//<2F><><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><C2B2>ϼ<EFBFBD><CFBC>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
memo1.Lines.Clear;
//if (t_ch_accept.IsEmpty or (not t_ch_accept.Active)) and (t_ch_pay.IsEmpty or (not t_ch_pay.Active)) then exit;
aQuery1:=CreateAdoQuery;
aQuery2:=CreateAdoQuery;
armb:=0;
ausd:=0;
aot:=0;
atotal:=0;
prmb:=0;
pusd:=0;
pot:=0;
ptotal:=0;
rarmb:=0;
rausd:=0;
raot:=0;
ratotal:=0;
rprmb:=0;
rpusd:=0;
rpot:=0;
rptotal:=0;
with V_op_bscard_All do
begin
Close;sql.Clear;
SQL.Add('select * from V_op_bscard_All');
SQL.Add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=bsno;
Open;
end;
with t_ch_accept do
begin
Close;sql.Clear;
SQL.Add('select * from t_ch_fee');
SQL.Add('where <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=bsno;
Open;
end;
with t_ch_pay do
begin
Close;sql.Clear;
SQL.Add('select * from t_ch_fee');
SQL.Add('where <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=bsno;
Open;
end;
try
accepteof:=false;
payeof:=false;
if (t_ch_accept.IsEmpty or (not t_ch_accept.Active)) then
aQuery1.SQL.Text:='select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,sum(case <20>ұ<EFBFBD> when ''RMB'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then 0 else (case <20>ұ<EFBFBD> when ''RMB'' then 0 else <20><><EFBFBD><EFBFBD> end) end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'sum(<28><><EFBFBD><EFBFBD>*<2A><><EFBFBD><EFBFBD>) as <20>ϼƽ<CFBC><C6BD><EFBFBD>'
+',sum(case <20>ұ<EFBFBD> when ''RMB'' then ˰<><CBB0> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then ˰<><CBB0> else 0 end) as <20><>Ԫ˰<D4AA><CBB0>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then 0 else (case <20>ұ<EFBFBD> when ''RMB'' then 0 else ˰<><CBB0> end) end) as <20><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,'
+'sum(˰<><CBB0>*<2A><><EFBFBD><EFBFBD>) as <20>ϼ<EFBFBD>˰<EFBFBD><CBB0>'
+' from t_ch_fee where 1=2 group by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'
else begin
acceptstr:=new_query(t_ch_accept);
aQuery1.SQL.Text:='select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,sum(case <20>ұ<EFBFBD> when ''RMB'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then 0 else (case <20>ұ<EFBFBD> when ''RMB'' then 0 else <20><><EFBFBD><EFBFBD> end) end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'sum(<28><><EFBFBD><EFBFBD>*<2A><><EFBFBD><EFBFBD>) as <20>ϼƽ<CFBC><C6BD><EFBFBD>'
+',sum(case <20>ұ<EFBFBD> when ''RMB'' then ˰<><CBB0> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then ˰<><CBB0> else 0 end) as <20><>Ԫ˰<D4AA><CBB0>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then 0 else (case <20>ұ<EFBFBD> when ''RMB'' then 0 else ˰<><CBB0> end) end) as <20><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,'
+'sum(˰<><CBB0>*<2A><><EFBFBD><EFBFBD>) as <20>ϼ<EFBFBD>˰<EFBFBD><CBB0>'
+' from t_ch_fee '+acceptstr+' where <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD>='+''''+bsNo +''''+' group by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
aQuery1.DataSource:=t_ch_accept.DataSource;
end;
aQuery1.Open;
aQuery1.first;
if (t_ch_pay.IsEmpty or (not t_ch_pay.Active)) then
aQuery2.SQL.Text:='select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,sum(case <20>ұ<EFBFBD> when ''RMB'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then 0 else (case <20>ұ<EFBFBD> when ''RMB'' then 0 else <20><><EFBFBD><EFBFBD> end) end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'sum(<28><><EFBFBD><EFBFBD>*<2A><><EFBFBD><EFBFBD>) as <20>ϼƽ<CFBC><C6BD><EFBFBD>'
+',sum(case <20>ұ<EFBFBD> when ''RMB'' then ˰<><CBB0> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then ˰<><CBB0> else 0 end) as <20><>Ԫ˰<D4AA><CBB0>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then 0 else (case <20>ұ<EFBFBD> when ''RMB'' then 0 else ˰<><CBB0> end) end) as <20><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,'
+'sum(˰<><CBB0>*<2A><><EFBFBD><EFBFBD>) as <20>ϼ<EFBFBD>˰<EFBFBD><CBB0>'
+' from t_ch_fee where 1=2 group by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'
else
begin
paystr:=new_query(t_ch_pay);
aQuery2.SQL.Text:='select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,sum(case <20>ұ<EFBFBD> when ''RMB'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then 0 else (case <20>ұ<EFBFBD> when ''RMB'' then 0 else <20><><EFBFBD><EFBFBD> end) end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'sum(<28><><EFBFBD><EFBFBD>*<2A><><EFBFBD><EFBFBD>) as <20>ϼƽ<CFBC><C6BD><EFBFBD>'
+',sum(case <20>ұ<EFBFBD> when ''RMB'' then ˰<><CBB0> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then ˰<><CBB0> else 0 end) as <20><>Ԫ˰<D4AA><CBB0>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then 0 else (case <20>ұ<EFBFBD> when ''RMB'' then 0 else ˰<><CBB0> end) end) as <20><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,'
+'sum(˰<><CBB0>*<2A><><EFBFBD><EFBFBD>) as <20>ϼ<EFBFBD>˰<EFBFBD><CBB0>'
+' from t_ch_fee '+acceptstr+' where <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD>='+''''+bsNo +''''+' group by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
aQuery2.DataSource:=t_ch_pay.DataSource;
end;
aQuery2.Open;
aQuery2.first;
while (not aQuery1.Eof) or (not aQuery2.Eof) do begin
if aQuery1.Eof then begin
str1:=FixLenStr('',120);
end else begin
str1:=FixLenStr(aQuery1.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString,20)+' '+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').Asfloat),12,' ',false);
if aQuery1.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').Asfloat<>0 then
str1:=str1+'(˰'+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').Asfloat),8,' ',false)+')'+' '+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').Asfloat),12,' ',false)
else
str1:=str1+' '+' '+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').Asfloat),12,' ',false);
if aQuery1.fieldbyname('<27><>Ԫ˰<D4AA><CBB0>').Asfloat<>0 then
str1:=str1+'(˰'+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27><>Ԫ˰<D4AA><CBB0>').Asfloat),8,' ',false)+')'+' '+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat),12,' ',false)
else
str1:=str1+' '+' '+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat),12,' ',false);
if aQuery1.fieldbyname('<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').Asfloat<>0 then
str1:=str1+'(˰'+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').Asfloat),8,' ',false)+')'+' '+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27>ϼƽ<CFBC><C6BD><EFBFBD>').Asfloat),12,' ',false)
else
str1:=str1+' '+' '+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27>ϼƽ<CFBC><C6BD><EFBFBD>').Asfloat),12,' ',false);
if aQuery1.fieldbyname('<27>ϼ<EFBFBD>˰<EFBFBD><CBB0>').Asfloat<>0 then
str1:=str1+'(˰'+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27>ϼ<EFBFBD>˰<EFBFBD><CBB0>').Asfloat),8,' ',false)+')'
else
str1:=str1+' ';
armb:=armb+aquery1.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').AsFloat;
ausd:=ausd+aquery1.fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat;
aot:=aot+aquery1.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
atotal:=atotal+aquery1.fieldbyname('<27>ϼƽ<CFBC><C6BD><EFBFBD>').AsFloat;
rarmb:=rarmb+aquery1.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').AsFloat;
rausd:=rausd+aquery1.fieldbyname('<27><>Ԫ˰<D4AA><CBB0>').AsFloat;
raot:=raot+aquery1.fieldbyname('<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').AsFloat;
ratotal:=ratotal+aquery1.fieldbyname('<27>ϼ<EFBFBD>˰<EFBFBD><CBB0>').AsFloat;
aQuery1.Next;
end;
if aQuery2.Eof then begin
str2:=FixLenStr('',120);
end else begin
str2:=FixLenStr(aQuery2.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString,20)+' '+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').Asfloat),12,' ',false);
if aQuery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').Asfloat<>0 then
str2:=str2+'(˰'+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').Asfloat),8,' ',false)+')'+' '+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').Asfloat),12,' ',false)
else
str2:=str2+' '+' '+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').Asfloat),12,' ',false);
if aQuery2.fieldbyname('<27><>Ԫ˰<D4AA><CBB0>').Asfloat<>0 then
str2:=str2+'(˰'+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27><>Ԫ˰<D4AA><CBB0>').Asfloat),8,' ',false)+')'+' '+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat),12,' ',false)
else
str2:=str2+' '+' '+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat),12,' ',false);
if aQuery2.fieldbyname('<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').Asfloat<>0 then
str2:=str2+'(˰'+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').Asfloat),8,' ',false)+')'+' '+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27>ϼƽ<CFBC><C6BD><EFBFBD>').Asfloat),12,' ',false)
else
str2:=str2+' '+' '+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27>ϼƽ<CFBC><C6BD><EFBFBD>').Asfloat),12,' ',false);
if aQuery2.fieldbyname('<27>ϼ<EFBFBD>˰<EFBFBD><CBB0>').Asfloat<>0 then
str2:=str2+'(˰'+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27>ϼ<EFBFBD>˰<EFBFBD><CBB0>').Asfloat),8,' ',false)+')'
else
str2:=str2+' ';
prmb:=prmb+aquery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').AsFloat;
pusd:=pusd+aquery2.fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat;
pot:=pot+aquery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
ptotal:=ptotal+aquery2.fieldbyname('<27>ϼƽ<CFBC><C6BD><EFBFBD>').AsFloat;
rprmb:=rprmb+aquery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').AsFloat;
rpusd:=rpusd+aquery2.fieldbyname('<27><>Ԫ˰<D4AA><CBB0>').AsFloat;
rpot:=rpot+aquery2.fieldbyname('<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').AsFloat;
rptotal:=rptotal+aquery2.fieldbyname('<27>ϼ<EFBFBD>˰<EFBFBD><CBB0>').AsFloat;
aQuery2.Next;
end;
memo1.Lines.Add(str1+'|'+str2);
end;
str1:=FixLenStr('-',120,'-');
str2:=FixLenStr('-',120,'-');
memo1.Lines.Add(str1+'|'+str2);
str1:=FixLenStr('Ӧ<>պϼ<D5BA>',20)+' '+FixLenStr(FormatFloat('#,##0.00',armb),12,' ',false);
if rarmb<>0 then
str1:=str1+'(˰'+FixLenStr(FormatFloat('#,##0.00',rarmb),8,' ',false)+')'+' '+FixLenStr(FormatFloat('#,##0.00',ausd),12,' ',false)
else
str1:=str1+' '+' '+FixLenStr(FormatFloat('#,##0.00',ausd),12,' ',false);
if rausd<>0 then
str1:=str1+'(˰'+FixLenStr(FormatFloat('#,##0.00',rausd),8,' ',false)+')'+' '+FixLenStr(FormatFloat('#,##0.00',aot),12,' ',false)
else
str1:=str1+' '+' '+FixLenStr(FormatFloat('#,##0.00',aot),12,' ',false);
if raot<>0 then
str1:=str1+'(˰'+FixLenStr(FormatFloat('#,##0.00',raot),8,' ',false)+')'+' '+FixLenStr(FormatFloat('#,##0.00',atotal),12,' ',false)
else
str1:=str1+' '+' '+FixLenStr(FormatFloat('#,##0.00',atotal),12,' ',false);
if ratotal<>0 then
str1:=str1+'(˰'+FixLenStr(FormatFloat('#,##0.00',ratotal),8,' ',false)+')'
else
str1:=str1+' ';
str2:=FixLenStr('Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>',20)+' '+FixLenStr(FormatFloat('#,##0.00',prmb),12,' ',false);
if rprmb<>0 then
str2:=str2+'(˰'+FixLenStr(FormatFloat('#,##0.00',rprmb),8,' ',false)+')'+' '+FixLenStr(FormatFloat('#,##0.00',pusd),12,' ',false)
else
str2:=str2+' '+' '+FixLenStr(FormatFloat('#,##0.00',pusd),12,' ',false);
if rpusd<>0 then
str2:=str2+'(˰'+FixLenStr(FormatFloat('#,##0.00',rpusd),8,' ',false)+')'+' '+FixLenStr(FormatFloat('#,##0.00',pot),12,' ',false)
else
str2:=str2+' '+' '+FixLenStr(FormatFloat('#,##0.00',pot),12,' ',false);
if rpot<>0 then
str2:=str2+'(˰'+FixLenStr(FormatFloat('#,##0.00',rpot),8,' ',false)+')'+' '+FixLenStr(FormatFloat('#,##0.00',ptotal),12,' ',false)
else
str2:=str2+' '+' '+FixLenStr(FormatFloat('#,##0.00',ptotal),12,' ',false);
if rptotal<>0 then
str2:=str2+'(˰'+FixLenStr(FormatFloat('#,##0.00',rptotal),8,' ',false)+')'
else
str2:=str2+' ';
memo1.Lines.Add(str1+'|'+str2);
str1:=FixLenStr('-',120,'-');
str2:=FixLenStr('-',120,'-');
memo1.Lines.Add(str1+'|'+str2);
str1:=FixLenStr('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>:',20)+' '+FixLenStr('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:',12,' ',false)
+' '+FixLenStr(FormatFloat('#,##0.00',armb-prmb),12,' ',false)
+' '+FixLenStr('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>:',12,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',ausd-pusd),12,' ',false)+FixLenStr('',48);
str2:=FixLenStr('',19)+' '+FixLenStr('<27><><EFBFBD><EFBFBD><EFBFBD>ұ<EFBFBD><D2B1><EFBFBD><EFBFBD><EFBFBD>:',13,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',aot-pot),12,' ',false)
+' '+FixLenStr('<27>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD>:',12,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',atotal-ptotal),12,' ',false);
memo1.Lines.Add(str1+'|'+str2);
finally
freeandnil(aQuery1);
freeandnil(aQuery2);
end;
if memo1.Lines.Count>0 then begin
str1:=FixLenStr('Ӧ<>տͻ<D5BF>',20)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ',24,' ',false)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD><EFBFBD>Ԫ ',24,' ',false)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ',24,' ',false)+' '+FixLenStr('Ӧ<>պϼ<D5BA> ',24,' ',false);
str2:=FixLenStr('Ӧ<><D3A6><EFBFBD>ͻ<EFBFBD>',20)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ',24,' ',false)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD><EFBFBD>Ԫ ',24,' ',false)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ',24,' ',false)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD> ',24,' ',false);
Memo1.Lines.Insert(0,str1+'|'+str2);
end;
end;
{
var
aQuery1,aQuery2:TAdoQuery;
str1,str2:string;
acceptstr,paystr:widestring;
accepteof,payeof:boolean;
armb,ausd,aot,atotal,prmb,pusd,pot,ptotal:double;
begin
if not strtobool(get_parameters_value(150,'false')) then exit;
//<2F><><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><C2B2>ϼ<EFBFBD><CFBC>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
memo1.Lines.Clear;
aQuery1:=CreateAdoQuery;
aQuery2:=CreateAdoQuery;
armb:=0;
ausd:=0;
aot:=0;
atotal:=0;
prmb:=0;
pusd:=0;
pot:=0;
ptotal:=0;
with V_op_bscard_All do
begin
Close;sql.Clear;
SQL.Add('select * from V_op_bscard_All');
SQL.Add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=bsno;
Open;
end;
with t_ch_accept do
begin
Close;sql.Clear;
SQL.Add('select * from t_ch_fee');
SQL.Add('where <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=bsno;
Open;
end;
with t_ch_pay do
begin
Close;sql.Clear;
SQL.Add('select * from t_ch_fee');
SQL.Add('where <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=bsno;
Open;
end;
try
accepteof:=false;
payeof:=false;
if (t_ch_accept.IsEmpty or (not t_ch_accept.Active)) then
aQuery1.SQL.Text:='select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,sum(case <20>ұ<EFBFBD> when ''RMB'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then 0 else (case <20>ұ<EFBFBD> when ''RMB'' then 0 else <20><><EFBFBD><EFBFBD> end) end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'sum(<28><><EFBFBD><EFBFBD>*<2A><><EFBFBD><EFBFBD>) as <20>ϼƽ<CFBC><C6BD><EFBFBD>'
+' from t_ch_fee where 1=2 group by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'
else begin
acceptstr:=new_query(t_ch_accept);
aQuery1.SQL.Text:='select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,sum(case <20>ұ<EFBFBD> when ''RMB'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then 0 else (case <20>ұ<EFBFBD> when ''RMB'' then 0 else <20><><EFBFBD><EFBFBD> end) end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'sum(<28><><EFBFBD><EFBFBD>*<2A><><EFBFBD><EFBFBD>) as <20>ϼƽ<CFBC><C6BD><EFBFBD>'
+' from t_ch_fee '+acceptstr+' where <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD>='+''''+bsNo +''''+' group by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
aQuery1.DataSource:=t_ch_accept.DataSource;
end;
aQuery1.Open;
aQuery1.first;
if (t_ch_pay.IsEmpty or (not t_ch_pay.Active)) then
aQuery2.SQL.Text:='select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,sum(case <20>ұ<EFBFBD> when ''RMB'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then 0 else (case <20>ұ<EFBFBD> when ''RMB'' then 0 else <20><><EFBFBD><EFBFBD> end) end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'sum(<28><><EFBFBD><EFBFBD>*<2A><><EFBFBD><EFBFBD>) as <20>ϼƽ<CFBC><C6BD><EFBFBD>'
+' from t_ch_fee where 1=2 group by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'
else begin
paystr:=new_query(t_ch_pay);
aQuery2.SQL.Text:='select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,sum(case <20>ұ<EFBFBD> when ''RMB'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then <20><><EFBFBD><EFBFBD> else 0 end) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>,'
+'sum(case <20>ұ<EFBFBD> when ''USD'' then 0 else (case <20>ұ<EFBFBD> when ''RMB'' then 0 else <20><><EFBFBD><EFBFBD> end) end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'sum(<28><><EFBFBD><EFBFBD>*<2A><><EFBFBD><EFBFBD>) as <20>ϼƽ<CFBC><C6BD><EFBFBD>'
+' from t_ch_fee '+paystr+' where <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD>='+''''+bsNo+''''+' group by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
aQuery2.DataSource:=t_ch_pay.DataSource;
end;
aQuery2.Open;
aQuery2.first;
while (not aQuery1.Eof) or (not aQuery2.Eof) do begin
if aQuery1.Eof then begin
str1:=FixLenStr('',72);
end else begin
str1:=FixLenStr(aQuery1.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString,20)+' '+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').Asfloat),12,' ',false)
+' '+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').Asfloat),12,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat),12,' ',false)
+' '+FixLenStr(FormatFloat('#,##0.00',aQuery1.fieldbyname('<27>ϼƽ<CFBC><C6BD><EFBFBD>').Asfloat),12,' ',false);
armb:=armb+aquery1.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').AsFloat;
ausd:=ausd+aquery1.fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat;
aot:=aot+aquery1.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
atotal:=atotal+aquery1.fieldbyname('<27>ϼƽ<CFBC><C6BD><EFBFBD>').AsFloat;
aQuery1.Next;
end;
if aQuery2.Eof then begin
str2:=FixLenStr('',72);
end else begin
str2:=FixLenStr(aQuery2.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString,20)+' '+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').Asfloat),12,' ',false)
+' '+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').Asfloat),12,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat),12,' ',false)
+' '+FixLenStr(FormatFloat('#,##0.00',aQuery2.fieldbyname('<27>ϼƽ<CFBC><C6BD><EFBFBD>').Asfloat),12,' ',false);
prmb:=prmb+aquery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').AsFloat;
pusd:=pusd+aquery2.fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat;
pot:=pot+aquery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
ptotal:=ptotal+aquery2.fieldbyname('<27>ϼƽ<CFBC><C6BD><EFBFBD>').AsFloat;
aQuery2.Next;
end;
memo1.Lines.Add(str1+'|'+str2);
end;
str1:=FixLenStr('-',72,'-');
str2:=FixLenStr('-',72,'-');
memo1.Lines.Add(str1+'|'+str2);
str1:=FixLenStr('Ӧ<>պϼ<D5BA>',20)+' '+FixLenStr(FormatFloat('#,##0.00',armb),12,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',ausd),12,' ',false)
+' '+FixLenStr(FormatFloat('#,##0.00',aot),12,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',atotal),12,' ',false);
str2:=FixLenStr('Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>',20)+' '+FixLenStr(FormatFloat('#,##0.00',prmb),12,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',pusd),12,' ',false)
+' '+FixLenStr(FormatFloat('#,##0.00',pot),12,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',ptotal),12,' ',false);
memo1.Lines.Add(str1+'|'+str2);
str1:=FixLenStr('-',72,'-');
str2:=FixLenStr('-',72,'-');
memo1.Lines.Add(str1+'|'+str2);
str1:=FixLenStr('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>:',20)+' '+FixLenStr('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:',12,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',armb-prmb),12,' ',false)
+' '+FixLenStr('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>:',12,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',ausd-pusd),12,' ',false);
str2:=FixLenStr('',19)+' '+FixLenStr('<27><><EFBFBD><EFBFBD><EFBFBD>ұ<EFBFBD><D2B1><EFBFBD><EFBFBD><EFBFBD>:',13,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',aot-pot),12,' ',false)
+' '+FixLenStr('<27>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD>:',12,' ',false)+' '+FixLenStr(FormatFloat('#,##0.00',atotal-ptotal),12,' ',false);
// if (edit_type.text='1') and if_open('226') then
memo1.Lines.Add(str1+'|'+str2);
// if (edit_type.text='2') and if_open('227') then
// memo1.Lines.Add(str1+'|'+str2);
// if (edit_type.text='3') and if_open('228') then
/// memo1.Lines.Add(str1+'|'+str2);
// if (edit_type.text='4') and if_open('229') then
// memo1.Lines.Add(str1+'|'+str2);
finally
freeandnil(aQuery1);
freeandnil(aQuery2);
end;
if memo1.Lines.Count>0 then begin
str1:=FixLenStr('Ӧ<>տͻ<D5BF>',20)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',12,' ',false)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD><EFBFBD>Ԫ',12,' ',false)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',12,' ',false)+' '+FixLenStr('Ӧ<>պϼ<D5BA>',12,' ',false);
str2:=FixLenStr('Ӧ<><D3A6><EFBFBD>ͻ<EFBFBD>',20)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',12,' ',false)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD><EFBFBD>Ԫ',12,' ',false)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',12,' ',false)+' '+FixLenStr('Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>',12,' ',false);
Memo1.Lines.Insert(0,str1+'|'+str2);
end;
end;
}
procedure Tfrm_check_all.FormShow(Sender: TObject);
var
book1:Tbookmark;
aQuery,aQueryaccept,aQueryPay:TADOQuery;
Frt,s:String;
havprn,Profithavprn:boolean;
NOS:integer;
begin
try
getsumstr;
except
on e:Exception do
begin
ShowMessage(e.Message);
end;
end;
prnlist:=true;
//Ӧ<><D3A6>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬһ<CDAC>е<EFBFBD><D0B5><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD>
aQueryaccept:=CreateAdoQuery;
aQuerypay:=CreateAdoQuery;
NOS:=0;
try
aQueryaccept.Close;aQueryaccept.sql.Clear;
aQueryaccept.sql.Text:='select * from t_ch_fee where <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD>='''+BSNO+''' order by CH_ID';
aQueryaccept.Open;
aQuerypay.Close;aQuerypay.sql.Clear;
aQuerypay.sql.Text:='select * from t_ch_fee where <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD>='''+BSNO+''' order by CH_ID';
aQuerypay.Open;
memtblprint.close;
memtblprint.EmptyTable;
memtblprint.Open;
aQueryaccept.First;
while not aQueryaccept.Eof do begin
Frt:=GetFrt(aQueryaccept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if memtblprint.Locate('ACCNAME;OBJDR',vararrayof([aQueryaccept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,aQueryaccept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring]),[]) then
begin
memtblprint.Edit;
if aQueryaccept.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then
begin
memtblprint.FieldByName('USDDR').AsFloat:=memtblprint.FieldByName('USDDR').AsFloat+aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=memtblprint.FieldByName('TTLDR').AsFloat+(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else if aQueryaccept.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then
begin
memtblprint.FieldByName('RMBDR').AsFloat:=memtblprint.FieldByName('RMBDR').AsFloat+aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=memtblprint.FieldByName('TTLDR').AsFloat+(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
begin
memtblprint.FieldByName('OTDR').AsFloat:=memtblprint.FieldByName('OTDR').AsFloat+aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=memtblprint.FieldByName('TTLDR').AsFloat+(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprint.FieldByName('REMARKDR').AsString='' then
begin
memtblprint.FieldByName('REMARKDR').AsString:=aQueryaccept.fieldbyName('<27><>ע').AsString;
end
else
begin
memtblprint.FieldByName('REMARKDR').AsString:=memtblprint.FieldByName('REMARKDR').AsString+' '+aQueryaccept.fieldbyName('<27><>ע').AsString;
end;
memtblprint.Post;
end else begin
memtblprint.Insert;
NOS:=NOS+1;
memtblprint.FieldByName('NOS').AsInteger:=NOS;
memtblprint.FieldByName('ORDNO').AsInteger:=0;
memtblprint.FieldByName('FRT').AsString:=GetFrt(aQueryaccept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprint.FieldByName('ACCNAME').AsString:=aQueryaccept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprint.FieldByName('OBJDR').AsString:=aQueryaccept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprint.FieldByName('OBJCR').AsString:='';
memtblprint.FieldByName('REMARKCR').AsString:='';
memtblprint.FieldByName('USDCR').AsFloat:=0;
memtblprint.FieldByName('RMBCR').AsFloat:=0;
memtblprint.FieldByName('OTCR').AsFloat:=0;
memtblprint.FieldByName('TTLCR').AsFloat:=0;
memtblprint.FieldByName('DR').AsString:='T';
memtblprint.FieldByName('CR').AsString:='F';
if aQueryaccept.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then
begin
memtblprint.FieldByName('USDDR').AsFloat:=aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
if aQueryaccept.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then
begin
memtblprint.FieldByName('RMBDR').AsFloat:=aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
begin
memtblprint.FieldByName('OTDR').AsFloat:=aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
memtblprint.FieldByName('REMARKDR').AsString:=memtblprint.FieldByName('REMARKDR').AsString+' '+aQueryaccept.fieldbyName('<27><>ע').AsString;
memtblprint.Post;
end;
aQueryaccept.Next;
end;
aQuerypay.First;
while not aQuerypay.Eof do begin
Frt:=GetFrt(aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if memtblprint.Locate('ACCNAME;CR',vararrayof([aQuerypay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'F']),[]) then begin
memtblprint.Edit;
memtblprint.FieldByName('OBJCR').AsString:=aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
if aQuerypay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then
begin
memtblprint.FieldByName('USDCR').AsFloat:=memtblprint.FieldByName('USDCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
if aQuerypay.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then
begin
memtblprint.FieldByName('RMBCR').AsFloat:=memtblprint.FieldByName('RMBCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
begin
memtblprint.FieldByName('OTCR').AsFloat:=memtblprint.FieldByName('OTCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprint.FieldByName('REMARKCR').AsString='' then
begin
memtblprint.FieldByName('REMARKCR').AsString:=aQuerypay.fieldbyName('<27><>ע').AsString;
end
else
begin
memtblprint.FieldByName('REMARKCR').AsString:=memtblprint.FieldByName('REMARKCR').AsString+' '+aQuerypay.fieldbyName('<27><>ע').AsString;
end;
memtblprint.FieldByName('CR').AsString:='T';
memtblprint.Post;
end
else
begin
if memtblprint.Locate('ACCNAME;OBJCR',vararrayof([aQuerypay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring]),[]) then
begin
memtblprint.Edit;
if aQuerypay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then
begin
s:=s+FormatFloat('0.00;-0.00;0',aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
memtblprint.FieldByName('USDCR').AsFloat:=memtblprint.FieldByName('USDCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
if aQuerypay.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then
begin
s:=s+FormatFloat('0.00;-0.00;0',aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
memtblprint.FieldByName('RMBCR').AsFloat:=memtblprint.FieldByName('RMBCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
begin
memtblprint.FieldByName('OTCR').AsFloat:=memtblprint.FieldByName('OTCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprint.FieldByName('REMARKCR').AsString='' then
begin
memtblprint.FieldByName('REMARKCR').AsString:=aQuerypay.fieldbyName('<27><>ע').AsString;
end
else
begin
memtblprint.FieldByName('REMARKCR').AsString:=memtblprint.FieldByName('REMARKCR').AsString+' '+aQuerypay.fieldbyName('<27><>ע').AsString;
end;
memtblprint.FieldByName('CR').AsString:='T';
memtblprint.Post;
end
else
begin
memtblprint.Insert;
NOS:=NOS+1;
memtblprint.FieldByName('NOS').AsInteger:=NOS;
memtblprint.FieldByName('ORDNO').AsInteger:=0;
memtblprint.FieldByName('FRT').AsString:=GetFrt(aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprint.FieldByName('ACCNAME').AsString:=aQuerypay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprint.FieldByName('OBJCR').AsString:=aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprint.FieldByName('OBJDR').AsString:='';
memtblprint.FieldByName('REMARKCR').AsString:='';
memtblprint.FieldByName('USDDR').AsFloat:=0;
memtblprint.FieldByName('RMBDR').AsFloat:=0;
memtblprint.FieldByName('OTDR').AsFloat:=0;
memtblprint.FieldByName('TTLDR').AsFloat:=0;
memtblprint.FieldByName('USDCR').AsFloat:=0;
memtblprint.FieldByName('RMBCR').AsFloat:=0;
memtblprint.FieldByName('OTCR').AsFloat:=0;
memtblprint.FieldByName('TTLCR').AsFloat:=0;
memtblprint.FieldByName('DR').AsString:='F';
memtblprint.FieldByName('CR').AsString:='T';
if aQuerypay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then
begin
memtblprint.FieldByName('USDCR').AsFloat:=aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
if aQuerypay.FieldByName('<27>ұ<EFBFBD>').AsString='RMB'
then
begin
memtblprint.FieldByName('RMBCR').AsFloat:=aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
begin
memtblprint.FieldByName('OTCR').AsFloat:=aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
memtblprint.FieldByName('REMARKCR').AsString:=memtblprint.FieldByName('REMARKCR').AsString+' '+aQuerypay.fieldbyName('<27><>ע').AsString;
memtblprint.Post;
end;
end;
aQuerypay.Next;
end;
memtblprint.SortOn('NOS;FRT;ACCNAME',[]);
finally
freeandnil(aQueryAccept);
freeandnil(aQueryPay);
end;
// memtblprint.Open;
end;
procedure Tfrm_check_all.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
action:=cafree;
frm_check_all:=nil;
end;
end.