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.

1401 lines
72 KiB
Plaintext

11 months ago
unit U_ch_prnFee;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxExEdtr, u_fee_check, StdCtrls, Mask, DBCtrls, dxDBTLCl,
dxGrClms, dxDBGrid, dxTL, dxDBCtrl, dxCntner, bsSkinCtrls, DB, ADODB,
Menus, Grids, Wwdbigrd, Wwdbgrid, ExtCtrls, bsSkinBoxCtrls, bsdbctrls,
DBGrids, DBGridEh, kbmMemTable, kbmMemBinaryStreamFormat;
type
Tfrm_cw_prnFee = class(TForm)
tv_bscard_all: TADOQuery;
tv_bscard_all1: TDataSource;
t_ch_accept: TADOQuery;
Splitter1: TSplitter;
t_op_gain_main: TADOQuery;
t_op_gain: TADOQuery;
t_ch_pay: TADOQuery;
t_ch_accept1: TDataSource;
t_ch_pay1: TDataSource;
Panel2: TPanel;
bsSkinStdLabel4: TbsSkinStdLabel;
bsSkinStdLabel2: TbsSkinStdLabel;
bsSkinStdLabel3: TbsSkinStdLabel;
bsSkinStdLabel1: TbsSkinStdLabel;
bsSkinStdLabel5: TbsSkinStdLabel;
bsSkinStdLabel6: TbsSkinStdLabel;
bsSkinStdLabel7: TbsSkinStdLabel;
bsSkinStdLabel8: TbsSkinStdLabel;
bsSkinStdLabel9: TbsSkinStdLabel;
bsSkinStdLabel10: TbsSkinStdLabel;
bsSkinDBEdit6: TbsSkinDBEdit;
bsSkinDBEdit4: TbsSkinDBEdit;
bsSkinDBEdit1: TbsSkinDBEdit;
bsSkinDBEdit3: TbsSkinDBEdit;
bsSkinDBEdit5: TbsSkinDBEdit;
bsSkinDBEdit2: TbsSkinDBEdit;
bsSkinDBEdit8: TbsSkinDBEdit;
bsSkinDBEdit7: TbsSkinDBEdit;
bsSkinDBEdit9: TbsSkinDBEdit;
bsSkinDBEdit10: TbsSkinDBEdit;
Panel9: TPanel;
bsSkinStdLabel11: TbsSkinStdLabel;
bsSkinStdLabel12: TbsSkinStdLabel;
bsSkinStdLabel13: TbsSkinStdLabel;
bsSkinStdLabel14: TbsSkinStdLabel;
bsSkinStdLabel15: TbsSkinStdLabel;
bsSkinStdLabel16: TbsSkinStdLabel;
bsSkinStdLabel17: TbsSkinStdLabel;
bsSkinStdLabel18: TbsSkinStdLabel;
bsSkinStdLabel19: TbsSkinStdLabel;
bsSkinStdLabel20: TbsSkinStdLabel;
bsSkinDBEdit11: TbsSkinDBEdit;
bsSkinDBEdit12: TbsSkinDBEdit;
bsSkinDBEdit13: TbsSkinDBEdit;
bsSkinDBEdit14: TbsSkinDBEdit;
bsSkinDBEdit15: TbsSkinDBEdit;
bsSkinDBEdit16: TbsSkinDBEdit;
bsSkinDBEdit17: TbsSkinDBEdit;
bsSkinDBEdit18: TbsSkinDBEdit;
bsSkinDBEdit19: TbsSkinDBEdit;
bsSkinDBEdit20: TbsSkinDBEdit;
t_op_gain1: TDataSource;
t_op_gain_main1: TDataSource;
Panel1: TPanel;
DBGridEh1: TDBGridEh;
DBGridEh2: TDBGridEh;
Panel3: TPanel;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridMaskColumn;
dxDBGrid1Column3: TdxDBGridMaskColumn;
dxDBGrid1Column4: TdxDBGridMaskColumn;
dxDBGrid1Column5: TdxDBGridMaskColumn;
dxDBGrid1Column6: TdxDBGridDateColumn;
dxDBGrid1Column7: TdxDBGridMaskColumn;
dxDBGrid1Column8: TdxDBGridMaskColumn;
dxDBGrid1Column9: TdxDBGridMaskColumn;
dxDBGrid1Column10: TdxDBGridMaskColumn;
dxDBGrid1Column11: TdxDBGridMaskColumn;
dxDBGrid1Column12: TdxDBGridMaskColumn;
dxDBGrid1Column13: TdxDBGridMaskColumn;
dxDBGrid1Column14: TdxDBGridDateColumn;
dxDBGrid1Column15: TdxDBGridMaskColumn;
dxDBGrid1Column16: TdxDBGridMaskColumn;
dxDBGrid1Column17: TdxDBGridMaskColumn;
dxDBGrid1Column18: TdxDBGridMaskColumn;
dxDBGrid1Column19: TdxDBGridCurrencyColumn;
dxDBGrid1Column20: TdxDBGridMaskColumn;
dxDBGrid1Column21: TdxDBGridDateColumn;
dxDBGrid1Column22: TdxDBGridMaskColumn;
dxDBGrid1Column23: TdxDBGridMaskColumn;
dxDBGrid1Column24: TdxDBGridMaskColumn;
dxDBGrid1Column25: TdxDBGridMaskColumn;
dxDBGrid1Column26: TdxDBGridMaskColumn;
dxDBGrid1Column27: TdxDBGridCheckColumn;
dxDBGrid1Column28: TdxDBGridCheckColumn;
dxDBGrid1Column29: TdxDBGridCheckColumn;
dxDBGrid1Column30: TdxDBGridDateColumn;
dxDBGrid1Column31: TdxDBGridMaskColumn;
dxDBGrid1Column32: TdxDBGridMaskColumn;
dxDBGrid1Column33: TdxDBGridMaskColumn;
dxDBGrid1Column34: TdxDBGridMaskColumn;
dxDBGrid1Column35: TdxDBGridMaskColumn;
dxDBGrid1Column36: TdxDBGridMaskColumn;
dxDBGrid1Column37: TdxDBGridMaskColumn;
dxDBGrid1Column38: TdxDBGridDateColumn;
dxDBGrid1Column39: TdxDBGridMaskColumn;
dxDBGrid1Column40: TdxDBGridMaskColumn;
dxDBGrid1Column41: TdxDBGridMaskColumn;
dxDBGrid1Column42: TdxDBGridMaskColumn;
dxDBGrid1Column43: TdxDBGridMaskColumn;
dxDBGrid1Column44: TdxDBGridMaskColumn;
dxDBGrid1Column45: TdxDBGridMaskColumn;
dxDBGrid1Column46: TdxDBGridMaskColumn;
dxDBGrid1Column47: TdxDBGridMaskColumn;
dxDBGrid1Column48: TdxDBGridCurrencyColumn;
dxDBGrid1Column49: TdxDBGridDateColumn;
dxDBGrid1Column50: TdxDBGridDateColumn;
dxDBGrid1Column51: TdxDBGridMaskColumn;
dxDBGrid1Column52: TdxDBGridDateColumn;
dxDBGrid1Column53: TdxDBGridDateColumn;
dxDBGrid1Column54: TdxDBGridDateColumn;
dxDBGrid1Column55: TdxDBGridDateColumn;
dxDBGrid1Column56: TdxDBGridMaskColumn;
dxDBGrid1Column57: TdxDBGridMaskColumn;
dxDBGrid1Column58: TdxDBGridMaskColumn;
dxDBGrid1Column59: TdxDBGridMaskColumn;
dxDBGrid1Column60: TdxDBGridMaskColumn;
dxDBGrid1Column61: TdxDBGridMaskColumn;
dxDBGrid1Column62: TdxDBGridMaskColumn;
dxDBGrid1Column63: TdxDBGridMaskColumn;
dxDBGrid1Column64: TdxDBGridMaskColumn;
dxDBGrid1Column65: TdxDBGridDateColumn;
DBEdit1: TDBEdit;
DBEdit6: TDBEdit;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton5: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
dxDBGrid1Column67: TdxDBGridCheckColumn;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N74: TMenuItem;
qrytmp: TADOQuery;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N20: TMenuItem;
bsSkinPanel2: TbsSkinPanel;
Label3: TLabel;
bsSkinPanel3: TbsSkinPanel;
Label1: TLabel;
N5: TMenuItem;
N6: TMenuItem;
t_pin_gain: TADOStoredProc;
t_pin_gain1: TDataSource;
t_pin_pay: TADOStoredProc;
t_pin_pay1: TDataSource;
t_pin_accept: TADOStoredProc;
t_pin_accept1: TDataSource;
dxDBGrid1Column68: TdxDBGridColumn;
dxDBGrid1Column69: TdxDBGridColumn;
dxDBGrid1Column70: TdxDBGridColumn;
N7: TMenuItem;
N8: TMenuItem;
kbmBinaryStreamFormat1: TkbmBinaryStreamFormat;
kbmThreadDataSet1: TkbmThreadDataSet;
memtblprint: TkbmMemTable;
memtblprint1: TDataSource;
N9: TMenuItem;
N16: TMenuItem;
memtblprintFee: TkbmMemTable;
memtblprintFee1: TDataSource;
memtblprintFeeField: TStringField;
memtblprintFeeACCNAME: TStringField;
memtblprintFeeOBJDR: TStringField;
memtblprintFeeOBJCR: TStringField;
memtblprintFeeREMARKCR: TStringField;
memtblprintFeeUSDCR: TFloatField;
memtblprintFeeRMBCR: TFloatField;
memtblprintFeeOTCR: TFloatField;
memtblprintFeeTTLCR: TFloatField;
memtblprintFeeDR: TStringField;
memtblprintFeeCR: TStringField;
memtblprintFeeUSDDR: TFloatField;
memtblprintFeeTTLDR: TFloatField;
memtblprintFeeRMBDR: TFloatField;
memtblprintFeeOTDR: TFloatField;
memtblprintFeeREMARKDR: TStringField;
memtblprintFeeFRT: TStringField;
memtblprintFeeORDNO: TIntegerField;
memtblprintFeeField2: TStringField;
memtblprintFeeField3: TStringField;
memtblprintFeeField4: TStringField;
memtblprintFeeField5: TStringField;
memtblprintFeeField6: TStringField;
memtblprintFeeField7: TStringField;
memtblprintFeeField8: TStringField;
memtblprintFeeField9: TStringField;
memtblprintFeeField10: TStringField;
memtblprintFeeField11: TStringField;
memtblprintFeeField12: TStringField;
memtblprintFeeField13: TStringField;
memtblprintFeeField14: TStringField;
memtblprintFeeField15: TStringField;
memtblprintFeeField16: TStringField;
memtblprintFeeField17: TStringField;
memtblprintFeeField18: TStringField;
memtblprintFeeField19: TStringField;
memtblprintFeeField20: TStringField;
procedure bsSkinButton5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure DBEdit1Change(Sender: TObject);
procedure DBGridEh1GetCellParams(Sender: TObject; Column: TColumnEh;
AFont: TFont; var Background: TColor; State: TGridDrawState);
procedure DBGridEh2GetCellParams(Sender: TObject; Column: TColumnEh;
AFont: TFont; var Background: TColor; State: TGridDrawState);
procedure N10Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure N74Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N20Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure N8Click(Sender: TObject);
procedure N16Click(Sender: TObject);
private
{ Private declarations }
procedure updateprn(V_value:integer);
public
{ Public declarations }
end;
var
frm_cw_prnFee: Tfrm_cw_prnFee;
implementation
{$R *.dfm}
uses u_main,my_sys_function, u_data_share, u_ch_prnFee_query,u_ch_piliang_prnfee,
u_ch_piliang_zhuprnfee;
procedure Tfrm_cw_prnFee.bsSkinButton5Click(Sender: TObject);
begin
close ;
end;
procedure Tfrm_cw_prnFee.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption+'1');
frm_cw_prnFee.Hide;
frm_cw_prnFee.ManualFloat(frm_cw_prnFee.BoundsRect );
frm_main.freeTabs('frm_cw_prnFee');
action:=cafree;
frm_cw_prnFee:=nil;
end;
procedure Tfrm_cw_prnFee.FormShow(Sender: TObject);
begin
with tv_bscard_all,sql do
begin
Close; clear ;
add('select top 50 * from V_op_bscard_All where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD> and (¼<><C2BC><EFBFBD><EFBFBD>='''+employee+''' or <20><><EFBFBD><EFBFBD>Ա='''+employee+''' or <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+employee+''') order by <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD> desc,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD> '); //<2F><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
open;
end ;
loadreggrid(dxdbgrid1,true,caption+'1');
t_ch_pay.open ;
t_ch_accept.open ;
t_op_gain_main.Open ;
t_op_gain.Open ;
end;
procedure Tfrm_cw_prnFee.DBEdit1Change(Sender: TObject);
begin
if (DBEdit1.Text='ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ')then Panel9.Visible:=true
else Panel9.Visible:=false;
end;
procedure Tfrm_cw_prnFee.DBGridEh1GetCellParams(Sender: TObject;
Column: TColumnEh; AFont: TFont; var Background: TColor;
State: TGridDrawState);
begin
if frm_data_share.t_code_fee_color.Locate('<27><><EFBFBD><EFBFBD>״̬',t_ch_accept.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring,[])then
begin
try
Background:=StringToColor(frm_data_share.t_code_fee_color.fieldbyname('<27><>ɫ').asstring);
except
Background:=clwhite;
end;
end
else
Background:=clwhite;
end;
procedure Tfrm_cw_prnFee.DBGridEh2GetCellParams(Sender: TObject;
Column: TColumnEh; AFont: TFont; var Background: TColor;
State: TGridDrawState);
begin
if frm_data_share.t_code_fee_color.Locate('<27><><EFBFBD><EFBFBD>״̬',t_ch_pay.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring,[])then
begin
try
Background:=StringToColor(frm_data_share.t_code_fee_color.fieldbyname('<27><>ɫ').asstring);
except
Background:=clwhite;
end;
end
else
Background:=clwhite;
end;
procedure Tfrm_cw_prnFee.N10Click(Sender: TObject);
begin
update_grid_view_no(dxdbgrid1);
end;
procedure Tfrm_cw_prnFee.N14Click(Sender: TObject);
begin
update_grid_view_all(dxdbgrid1);
end;
procedure Tfrm_cw_prnFee.N12Click(Sender: TObject);
begin
update_grid(dxdbgrid1,112);
end;
procedure Tfrm_cw_prnFee.N74Click(Sender: TObject);
begin
update_grid_sort(dxdbgrid1,112);
end;
procedure Tfrm_cw_prnFee.bsSkinButton4Click(Sender: TObject);
var
i:integer ;
myNO:string ;
begin
if tv_bscard_all.IsEmpty then
exit;
if dxDBGrid1.SelectedCount<1 then
begin
showmessage('<27><>ѡ<EFBFBD><D1A1>Ҫȡ<D2AA><C8A1><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1>ҵ<EFBFBD><D2B5><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>');
exit;
end;
myNO:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString ;
try
tv_bscard_all.DisableControls;
for i:=0 to dxDBGrid1.SelectedCount-1 do
begin
tv_bscard_all.GotoBookmark(pointer(dxDBGrid1.selectedrows[i]));
if tv_bscard_all.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').asboolean then
updateprn(0);
end ;
finally
tv_bscard_all.Requery();
tv_bscard_all.enableControls;
tv_bscard_all.Locate('<27><><EFBFBD><EFBFBD>',myNO,[]) ;
end ;
end;
procedure Tfrm_cw_prnFee.bsSkinButton11Click(Sender: TObject);
begin
PopupMenu1.Popup(mouse.CursorPos.X,mouse.CursorPos.Y);
end;
procedure Tfrm_cw_prnFee.updateprn(V_value: integer);
var tblname:string ;
myNo:String ;
begin
myNo:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring ;
tblname:='' ;
if trim(tv_bscard_all.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>' then tblname:='t_op_seae'
else
if trim(tv_bscard_all.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>' then tblname:='t_op_seai'
else
if trim(tv_bscard_all.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>' then tblname:='t_op_aire'
else
if trim(tv_bscard_all.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>' then tblname:='t_op_airi'
else
if trim(tv_bscard_all.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='<27><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>' then tblname:='t_op_RailWay'
else raise exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ֪<D4A4><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') ;
with qrytmp,sql do
begin
close ; clear ;
add('update '+tblname+' set <20>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ= '+inttostr(V_value));
if strtobool(get_parameters_value(63,'false'))then
add(' ,<2C><><EFBFBD><EFBFBD>״̬=''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>''');
add('where <20><><EFBFBD><EFBFBD>='''+tv_bscard_all.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'''');
execsql ;
end ;
tv_bscard_all.Requery();
tv_bscard_all.Locate('<27><><EFBFBD><EFBFBD>',myNO,[]) ;
end;
procedure Tfrm_cw_prnFee.N1Click(Sender: TObject);
var
frt:string;
begin
updateprn(1);
if tv_bscard_all.FieldByName('װ<>˷<EFBFBD>ʽ').AsString='ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ' then begin
t_pin_accept.close;
t_pin_accept.Parameters[1].value:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_pin_accept.open;
t_pin_pay.close;
t_pin_pay.Parameters[1].value:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_pin_pay.open;
t_pin_gain.close;
t_pin_gain.Parameters[1].value:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_pin_gain.open;
sys_print('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><E3B5A5>ӡ',1,tv_bscard_all1,nil,nil,nil,
t_pin_accept1,t_pin_pay1,t_pin_gain1,t_op_gain_main1,nil,nil,nil);
end else begin
if strtobool(get_parameters_value(111,'false')) then begin
memtblprint.close;
memtblprint.Open;
t_ch_accept.First;
while not t_ch_accept.Eof do begin
Frt:=GetFrt(t_ch_accept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if memtblprint.Locate('Frt;ACCNAME;OBJDR',vararrayof([Frt,t_ch_accept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,t_ch_accept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring]),[]) then
begin
memtblprint.Edit;
if t_ch_accept.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then
begin
memtblprint.FieldByName('USDDR').AsFloat:=memtblprint.FieldByName('USDDR').AsFloat+t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=memtblprint.FieldByName('TTLDR').AsFloat+(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
if t_ch_accept.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then
begin
memtblprint.FieldByName('RMBDR').AsFloat:=memtblprint.FieldByName('RMBDR').AsFloat+t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=memtblprint.FieldByName('TTLDR').AsFloat+(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
begin
memtblprint.FieldByName('OTDR').AsFloat:=memtblprint.FieldByName('OTDR').AsFloat+t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=memtblprint.FieldByName('TTLDR').AsFloat+(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprint.FieldByName('REMARKDR').AsString='' then begin
memtblprint.FieldByName('REMARKDR').AsString:=t_ch_accept.fieldbyName('<27><>ע').AsString;
end else begin
memtblprint.FieldByName('REMARKDR').AsString:=memtblprint.FieldByName('REMARKDR').AsString+' '+t_ch_accept.fieldbyName('<27><>ע').AsString;
end;
memtblprint.Post;
end
else
begin
memtblprint.Insert;
memtblprint.FieldByName('ORDNO').AsInteger:=0;
memtblprint.FieldByName('FRT').AsString:=GetFrt(t_ch_accept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprint.FieldByName('ACCNAME').AsString:=t_ch_accept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprint.FieldByName('OBJDR').AsString:=t_ch_accept.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 t_ch_accept.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprint.FieldByName('USDDR').AsFloat:=t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else if t_ch_accept.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then begin
memtblprint.FieldByName('RMBDR').AsFloat:=t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprint.FieldByName('OTDR').AsFloat:=t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
memtblprint.FieldByName('REMARKDR').AsString:=memtblprint.FieldByName('REMARKDR').AsString+' '+t_ch_accept.fieldbyName('<27><>ע').AsString;
memtblprint.Post;
end;
t_ch_accept.Next;
end;
t_ch_pay.First;
while not t_ch_pay.Eof do begin
Frt:=GetFrt(t_ch_pay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if memtblprint.Locate('Frt;ACCNAME;CR',vararrayof([Frt,t_ch_pay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'F']),[]) then begin
memtblprint.Edit;
memtblprint.FieldByName('OBJCR').AsString:=t_ch_pay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
if t_ch_pay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprint.FieldByName('USDCR').AsFloat:=memtblprint.FieldByName('USDCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else if t_ch_pay.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then begin
memtblprint.FieldByName('RMBCR').AsFloat:=memtblprint.FieldByName('RMBCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprint.FieldByName('OTCR').AsFloat:=memtblprint.FieldByName('OTCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprint.FieldByName('REMARKCR').AsString='' then begin
memtblprint.FieldByName('REMARKCR').AsString:=t_ch_pay.fieldbyName('<27><>ע').AsString;
end else begin
memtblprint.FieldByName('REMARKCR').AsString:=memtblprint.FieldByName('REMARKCR').AsString+' '+t_ch_pay.fieldbyName('<27><>ע').AsString;
end;
memtblprint.FieldByName('CR').AsString:='T';
memtblprint.Post;
end else begin
if memtblprint.Locate('Frt;ACCNAME;OBJCR',vararrayof([Frt,t_ch_pay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,t_ch_pay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring]),[]) then begin
memtblprint.Edit;
if t_ch_pay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprint.FieldByName('USDCR').AsFloat:=memtblprint.FieldByName('USDCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else if t_ch_pay.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then begin
memtblprint.FieldByName('RMBCR').AsFloat:=memtblprint.FieldByName('RMBCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprint.FieldByName('OTCR').AsFloat:=memtblprint.FieldByName('OTCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprint.FieldByName('REMARKCR').AsString='' then begin
memtblprint.FieldByName('REMARKCR').AsString:=t_ch_pay.fieldbyName('<27><>ע').AsString;
end else begin
memtblprint.FieldByName('REMARKCR').AsString:=memtblprint.FieldByName('REMARKCR').AsString+' '+t_ch_pay.fieldbyName('<27><>ע').AsString;
end;
memtblprint.FieldByName('CR').AsString:='T';
memtblprint.Post;
end else begin
memtblprint.Insert;
memtblprint.FieldByName('ORDNO').AsInteger:=0;
memtblprint.FieldByName('FRT').AsString:=GetFrt(t_ch_pay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprint.FieldByName('ACCNAME').AsString:=t_ch_pay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprint.FieldByName('OBJCR').AsString:=t_ch_pay.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('DR').AsString:='F';
memtblprint.FieldByName('CR').AsString:='T';
if t_ch_pay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprint.FieldByName('USDCR').AsFloat:=t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else if t_ch_pay.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then begin
memtblprint.FieldByName('RMBCR').AsFloat:=t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprint.FieldByName('OTCR').AsFloat:=t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
memtblprint.FieldByName('REMARKCR').AsString:=memtblprint.FieldByName('REMARKCR').AsString+' '+t_ch_pay.fieldbyName('<27><>ע').AsString;
memtblprint.Post;
end;
end;
t_ch_pay.Next;
end;
memtblprint.SortOn('FRT;ACCNAME',[]);
sys_print('<27><><EFBFBD><EFBFBD><E3B5A5>ӡ',1,tv_bscard_all1,nil,nil,nil,
memtblprint1,nil,t_op_gain1,t_op_gain_main1,nil,nil,nil);
end else begin
sys_print('<27><><EFBFBD><EFBFBD><E3B5A5>ӡ',1,tv_bscard_all1,nil,nil,nil,
t_ch_accept1,t_ch_pay1,t_op_gain1,t_op_gain_main1,nil,nil,nil);
end;
end;
end;
procedure Tfrm_cw_prnFee.N3Click(Sender: TObject);
var
Frt:String;
begin
updateprn(1);
if tv_bscard_all.FieldByName('װ<>˷<EFBFBD>ʽ').AsString='ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ' then begin
t_pin_accept.close;
t_pin_accept.Parameters[1].value:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_pin_accept.open;
t_pin_pay.close;
t_pin_pay.Parameters[1].value:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_pin_pay.open;
t_pin_gain.close;
t_pin_gain.Parameters[1].value:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_pin_gain.open;
sys_print('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><E3B5A5>ӡ',3,tv_bscard_all1,nil,nil,nil,
t_pin_accept1,t_pin_pay1,t_pin_gain1,t_op_gain_main1,nil,nil,nil);
end else begin
if strtobool(get_parameters_value(111,'false')) then begin
memtblprint.close;
memtblprint.Open;
t_ch_accept.First;
while not t_ch_accept.Eof do begin
Frt:=GetFrt(t_ch_accept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if memtblprint.Locate('Frt;ACCNAME;OBJDR',vararrayof([Frt,t_ch_accept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,t_ch_accept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring]),[]) then begin
memtblprint.Edit;
if t_ch_accept.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprint.FieldByName('USDDR').AsFloat:=memtblprint.FieldByName('USDDR').AsFloat+t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=memtblprint.FieldByName('TTLDR').AsFloat+(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprint.FieldByName('RMBDR').AsFloat:=memtblprint.FieldByName('RMBDR').AsFloat+t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=memtblprint.FieldByName('TTLDR').AsFloat+(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprint.FieldByName('REMARKDR').AsString='' then begin
memtblprint.FieldByName('REMARKDR').AsString:=t_ch_accept.fieldbyName('<27><>ע').AsString;
end else begin
memtblprint.FieldByName('REMARKDR').AsString:=memtblprint.FieldByName('REMARKDR').AsString+' '+t_ch_accept.fieldbyName('<27><>ע').AsString;
end;
memtblprint.Post;
end else begin
memtblprint.Insert;
memtblprint.FieldByName('ORDNO').AsInteger:=0;
memtblprint.FieldByName('FRT').AsString:=GetFrt(t_ch_accept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprint.FieldByName('ACCNAME').AsString:=t_ch_accept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprint.FieldByName('OBJDR').AsString:=t_ch_accept.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('TTLCR').AsFloat:=0;
memtblprint.FieldByName('DR').AsString:='T';
memtblprint.FieldByName('CR').AsString:='F';
if t_ch_accept.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprint.FieldByName('USDDR').AsFloat:=t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprint.FieldByName('RMBDR').AsFloat:=t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
memtblprint.FieldByName('REMARKDR').AsString:=memtblprint.FieldByName('REMARKDR').AsString+' '+t_ch_accept.fieldbyName('<27><>ע').AsString;
memtblprint.Post;
end;
t_ch_accept.Next;
end;
t_ch_pay.First;
while not t_ch_pay.Eof do begin
Frt:=GetFrt(t_ch_pay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if memtblprint.Locate('Frt;ACCNAME;CR',vararrayof([Frt,t_ch_pay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'F']),[]) then begin
memtblprint.Edit;
memtblprint.FieldByName('OBJCR').AsString:=t_ch_pay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
if t_ch_pay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprint.FieldByName('USDCR').AsFloat:=memtblprint.FieldByName('USDCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprint.FieldByName('RMBCR').AsFloat:=memtblprint.FieldByName('RMBCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprint.FieldByName('REMARKCR').AsString='' then begin
memtblprint.FieldByName('REMARKCR').AsString:=t_ch_pay.fieldbyName('<27><>ע').AsString;
end else begin
memtblprint.FieldByName('REMARKCR').AsString:=memtblprint.FieldByName('REMARKCR').AsString+' '+t_ch_pay.fieldbyName('<27><>ע').AsString;
end;
memtblprint.FieldByName('CR').AsString:='T';
memtblprint.Post;
end else begin
if memtblprint.Locate('Frt;ACCNAME;OBJCR',vararrayof([Frt,t_ch_pay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,t_ch_pay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring]),[]) then begin
memtblprint.Edit;
if t_ch_pay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprint.FieldByName('USDCR').AsFloat:=memtblprint.FieldByName('USDCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprint.FieldByName('RMBCR').AsFloat:=memtblprint.FieldByName('RMBCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprint.FieldByName('REMARKCR').AsString='' then begin
memtblprint.FieldByName('REMARKCR').AsString:=t_ch_pay.fieldbyName('<27><>ע').AsString;
end else begin
memtblprint.FieldByName('REMARKCR').AsString:=memtblprint.FieldByName('REMARKCR').AsString+' '+t_ch_pay.fieldbyName('<27><>ע').AsString;
end;
memtblprint.FieldByName('CR').AsString:='T';
memtblprint.Post;
end else begin
memtblprint.Insert;
memtblprint.FieldByName('ORDNO').AsInteger:=0;
memtblprint.FieldByName('FRT').AsString:=GetFrt(t_ch_pay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprint.FieldByName('ACCNAME').AsString:=t_ch_pay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprint.FieldByName('OBJCR').AsString:=t_ch_pay.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('TTLDR').AsFloat:=0;
memtblprint.FieldByName('DR').AsString:='F';
memtblprint.FieldByName('CR').AsString:='T';
if t_ch_pay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprint.FieldByName('USDCR').AsFloat:=t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprint.FieldByName('RMBCR').AsFloat:=t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
memtblprint.FieldByName('REMARKCR').AsString:=memtblprint.FieldByName('REMARKCR').AsString+' '+t_ch_pay.fieldbyName('<27><>ע').AsString;
memtblprint.Post;
end;
end;
t_ch_pay.Next;
end;
memtblprint.SortOn('FRT;ACCNAME',[]);
sys_print('<27><><EFBFBD><EFBFBD><E3B5A5>ӡ',3,tv_bscard_all1,nil,nil,nil,
memtblprint1,nil,t_op_gain1,t_op_gain_main1,nil,nil,nil);
end else begin
sys_print('<27><><EFBFBD><EFBFBD><E3B5A5>ӡ',3,tv_bscard_all1,nil,nil,nil,
t_ch_accept1,t_ch_pay1,t_op_gain1,t_op_gain_main1,nil,nil,nil);
end;
end;
end;
procedure Tfrm_cw_prnFee.N20Click(Sender: TObject);
var
Frt:String;
i:Integer;
begin
updateprn(1);
// showmessage(tv_bscard_all.FieldByName('װ<>˷<EFBFBD>ʽ').AsString);
if tv_bscard_all.FieldByName('װ<>˷<EFBFBD>ʽ').AsString='ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ' then begin
t_pin_accept.close;
t_pin_accept.Parameters[1].value:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_pin_accept.open;
t_pin_pay.close;
t_pin_pay.Parameters[1].value:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_pin_pay.open;
t_pin_gain.close;
t_pin_gain.Parameters[1].value:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_pin_gain.open;
sys_print('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><E3B5A5>ӡ',2,tv_bscard_all1,nil,nil,nil,
t_pin_accept1,t_pin_pay1,t_pin_gain1,t_op_gain_main1,nil,nil,nil);
end
else
begin
if strtobool(get_parameters_value(111,'false')) then
begin
frm_ch_piliang_prnfee:=tfrm_ch_piliang_prnfee.Create (self);
tv_bscard_all.DisableControls;
memtblprint.close;
memtblprint.Open;
memtblprint.EmptyTable;
t_ch_accept.First;
while not t_ch_accept.Eof do
begin
Frt:=GetFrt(t_ch_accept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if memtblprint.Locate('Frt;ACCNAME;OBJDR',vararrayof([Frt,t_ch_accept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,t_ch_accept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring]),[]) then
begin
memtblprint.Edit;
if t_ch_accept.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then
begin
memtblprint.FieldByName('USDDR').AsFloat:=memtblprint.FieldByName('USDDR').AsFloat+t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=memtblprint.FieldByName('TTLDR').AsFloat+(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
begin
memtblprint.FieldByName('RMBDR').AsFloat:=memtblprint.FieldByName('RMBDR').AsFloat+t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=memtblprint.FieldByName('TTLDR').AsFloat+(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprint.FieldByName('REMARKDR').AsString='' then
begin
memtblprint.FieldByName('REMARKDR').AsString:=t_ch_accept.fieldbyName('<27><>ע').AsString;
end
else
begin
memtblprint.FieldByName('REMARKDR').AsString:=memtblprint.FieldByName('REMARKDR').AsString+' '+t_ch_accept.fieldbyName('<27><>ע').AsString;
end;
memtblprint.Post;
end
else
begin
memtblprint.Insert;
memtblprint.FieldByName('ORDNO').AsInteger:=0;
memtblprint.FieldByName('FRT').AsString:=GetFrt(t_ch_accept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprint.FieldByName('ACCNAME').AsString:=t_ch_accept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprint.FieldByName('OBJDR').AsString:=t_ch_accept.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('TTLCR').AsFloat:=0;
memtblprint.FieldByName('DR').AsString:='T';
memtblprint.FieldByName('CR').AsString:='F';
if t_ch_accept.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then
begin
memtblprint.FieldByName('USDDR').AsFloat:=t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
begin
memtblprint.FieldByName('RMBDR').AsFloat:=t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLDR').AsFloat:=(t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_accept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
memtblprint.FieldByName('REMARKDR').AsString:=memtblprint.FieldByName('REMARKDR').AsString+' '+t_ch_accept.fieldbyName('<27><>ע').AsString;
memtblprint.Post;
end;
t_ch_accept.Next;
end;
t_ch_pay.First;
while not t_ch_pay.Eof do
begin
Frt:=GetFrt(t_ch_pay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if memtblprint.Locate('Frt;ACCNAME;CR',vararrayof([Frt,t_ch_pay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'F']),[]) then
begin
memtblprint.Edit;
memtblprint.FieldByName('OBJCR').AsString:=t_ch_pay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
if t_ch_pay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprint.FieldByName('USDCR').AsFloat:=memtblprint.FieldByName('USDCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprint.FieldByName('RMBCR').AsFloat:=memtblprint.FieldByName('RMBCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprint.FieldByName('REMARKCR').AsString='' then begin
memtblprint.FieldByName('REMARKCR').AsString:=t_ch_pay.fieldbyName('<27><>ע').AsString;
end else begin
memtblprint.FieldByName('REMARKCR').AsString:=memtblprint.FieldByName('REMARKCR').AsString+' '+t_ch_pay.fieldbyName('<27><>ע').AsString;
end;
memtblprint.FieldByName('CR').AsString:='T';
memtblprint.Post;
end
else
begin
if memtblprint.Locate('Frt;ACCNAME;OBJCR',vararrayof([Frt,t_ch_pay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,t_ch_pay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring]),[]) then
begin
memtblprint.Edit;
if t_ch_pay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprint.FieldByName('USDCR').AsFloat:=memtblprint.FieldByName('USDCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprint.FieldByName('RMBCR').AsFloat:=memtblprint.FieldByName('RMBCR').AsFloat+t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=memtblprint.FieldByName('TTLCR').AsFloat+(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprint.FieldByName('REMARKCR').AsString='' then begin
memtblprint.FieldByName('REMARKCR').AsString:=t_ch_pay.fieldbyName('<27><>ע').AsString;
end else begin
memtblprint.FieldByName('REMARKCR').AsString:=memtblprint.FieldByName('REMARKCR').AsString+' '+t_ch_pay.fieldbyName('<27><>ע').AsString;
end;
memtblprint.FieldByName('CR').AsString:='T';
memtblprint.Post;
end
else
begin
memtblprint.Insert;
memtblprint.FieldByName('ORDNO').AsInteger:=0;
memtblprint.FieldByName('FRT').AsString:=GetFrt(t_ch_pay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprint.FieldByName('ACCNAME').AsString:=t_ch_pay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprint.FieldByName('OBJCR').AsString:=t_ch_pay.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('TTLDR').AsFloat:=0;
memtblprint.FieldByName('DR').AsString:='F';
memtblprint.FieldByName('CR').AsString:='T';
if t_ch_pay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then
begin
memtblprint.FieldByName('USDCR').AsFloat:=t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end
else
begin
memtblprint.FieldByName('RMBCR').AsFloat:=t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprint.FieldByName('TTLCR').AsFloat:=(t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*t_ch_pay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
memtblprint.FieldByName('REMARKCR').AsString:=memtblprint.FieldByName('REMARKCR').AsString+' '+t_ch_pay.fieldbyName('<27><>ע').AsString;
memtblprint.Post;
end;
end;
t_ch_pay.Next;
end;
memtblprint.SortOn('FRT;ACCNAME',[]);
sys_print('<27><><EFBFBD><EFBFBD><E3B5A5>ӡ',2,tv_bscard_all1,nil,nil,nil,
memtblprint1,nil,t_op_gain1,t_op_gain_main1,nil,nil,nil);
tv_bscard_all.EnableControls;
end else begin
sys_print('<27><><EFBFBD><EFBFBD><E3B5A5>ӡ',2,tv_bscard_all1,nil,nil,nil,
t_ch_accept1,t_ch_pay1,t_op_gain1,t_op_gain_main1,nil,nil,nil);
end;
end;
end;
procedure Tfrm_cw_prnFee.bsSkinButton10Click(Sender: TObject);
begin
frm_ch_prnfee_query:=Tfrm_ch_prnfee_query.create(self);
if frm_ch_prnfee_query.showmodal=mrok then
begin
with tv_bscard_all,sql do
begin
close ; clear ;
add('select * from V_op_bscard_All ');
add(frm_ch_prnfee_query.getprnstr);
add(' order by <20><><EFBFBD><EFBFBD> ');
open ;
end ;
end ;
frm_ch_prnfee_query.free ;
end;
procedure Tfrm_cw_prnFee.N6Click(Sender: TObject);
var
str:widestring;
i:integer;
myNO:string ;
begin
if tv_bscard_all.IsEmpty then
exit;
if dxDBGrid1.SelectedCount<1 then
begin
showmessage('<27><>ѡ<EFBFBD><D1A1>Ҫ<EFBFBD><D2AA>ӡ<EFBFBD><D3A1>ҵ<EFBFBD><D2B5><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>');
exit;
end;
str:='' ;
myNO:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString ;
try
frm_ch_piliang_prnfee:=tfrm_ch_piliang_prnfee.Create (self);
tv_bscard_all.DisableControls;
for i:=0 to dxDBGrid1.SelectedCount-1 do
begin
tv_bscard_all.GotoBookmark(pointer(dxDBGrid1.selectedrows[i]));
if (not tv_bscard_all.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').asboolean) and (tv_bscard_all.FieldByName('װ<>˷<EFBFBD>ʽ').AsString<>'ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ') then
begin
if str='' then
str:=''''+tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
else
str:=str+','+''''+tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'''';
end ;
end;
if str<>'' then begin
str:='('+str+')';
str:='select * from V_op_bscard_All where <20><><EFBFBD><EFBFBD> in '+str+default_sort(53,'V_op_bscard_All','','desc');
frm_ch_piliang_prnfee.tv_bscard_all.Parameters.ParamByName('SQLStr').value:=str;
frm_ch_piliang_prnfee.tv_bscard_all.open;
frm_ch_piliang_prnfee.ShowModal;
tv_bscard_all.Requery();
tv_bscard_all.Locate('<27><><EFBFBD><EFBFBD>',myNO,[]) ;
end;
finally
tv_bscard_all.EnableControls;
frm_ch_piliang_prnfee.Free;
frm_ch_piliang_prnfee:=nil;
end;
end;
procedure Tfrm_cw_prnFee.N8Click(Sender: TObject);
var
str:widestring;
i:integer;
myNO:string ;
begin
if tv_bscard_all.IsEmpty then
exit;
if dxDBGrid1.SelectedCount<1 then
begin
showmessage('<27><>ѡ<EFBFBD><D1A1>Ҫ<EFBFBD><D2AA>ӡ<EFBFBD><D3A1>ҵ<EFBFBD><D2B5><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>');
exit;
end;
str:='' ;
myNO:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString ;
try
frm_ch_piliang_zhuprnfee:=tfrm_ch_piliang_zhuprnfee.Create (self);
tv_bscard_all.DisableControls;
for i:=0 to dxDBGrid1.SelectedCount-1 do
begin
tv_bscard_all.GotoBookmark(pointer(dxDBGrid1.selectedrows[i]));
if (not tv_bscard_all.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').asboolean) and (tv_bscard_all.FieldByName('װ<>˷<EFBFBD>ʽ').AsString='ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ') then
begin
if str='' then
str:=''''+tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
else
str:=str+','+''''+tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'''';
end ;
end;
str:='('+str+')';
str:='select * from V_op_bscard_All where <20><><EFBFBD><EFBFBD> in '+str+default_sort(53,'V_op_bscard_All','','desc');
//showmessage(str);
frm_ch_piliang_zhuprnfee.tv_bscard_all.Parameters.ParamByName('SQLStr').value:=str;
frm_ch_piliang_zhuprnfee.tv_bscard_all.open;
frm_ch_piliang_zhuprnfee.ShowModal;
tv_bscard_all.Requery();
tv_bscard_all.Locate('<27><><EFBFBD><EFBFBD>',myNO,[]) ;
finally
tv_bscard_all.EnableControls;
frm_ch_piliang_prnfee.Free;
frm_ch_piliang_prnfee:=nil;
end;
end;
procedure Tfrm_cw_prnFee.N16Click(Sender: TObject);
var
Frt:String;
i,ordNO:Integer;
aQueryaccept:TADOQuery;
aQuerypay:TADOQuery;
begin
tv_bscard_all.DisableControls;
memtblprintFee.close;
memtblprintFee.Open;
memtblprintFee.EmptyTable;
ordNO:=1;
for i:=0 to dxDBGrid1.SelectedCount-1 do
begin
tv_bscard_all.GotoBookmark(pointer(dxDBGrid1.selectedrows[i]));
updateprn(1);
aQueryaccept:=CreateAdoQuery;
aQuerypay:=CreateAdoQuery;
try
aQueryaccept.Close;aQueryaccept.sql.Clear;
aQueryaccept.sql.Text:='select * from t_ch_fee where <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD>='''+tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''' 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>='''+tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''' order by CH_ID';
aQuerypay.Open;
aQueryaccept.First;
while not aQueryaccept.Eof do begin
Frt:=GetFrt(aQueryaccept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if memtblprintFee.Locate('<27><><EFBFBD><EFBFBD>;ACCNAME;OBJDR',vararrayof([tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,trim(aQueryaccept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring),trim(aQueryaccept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring)]),[]) then begin
memtblprintFee.Edit;
if aQueryaccept.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprintFee.FieldByName('USDDR').AsFloat:=memtblprintFee.FieldByName('USDDR').AsFloat+aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLDR').AsFloat:=memtblprintFee.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
memtblprintFee.FieldByName('RMBDR').AsFloat:=memtblprintFee.FieldByName('RMBDR').AsFloat+aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLDR').AsFloat:=memtblprintFee.FieldByName('TTLDR').AsFloat+(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprintFee.FieldByName('OTDR').AsFloat:=memtblprintFee.FieldByName('OTDR').AsFloat+aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLDR').AsFloat:=memtblprintFee.FieldByName('TTLDR').AsFloat+(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprintFee.FieldByName('REMARKDR').AsString='' then begin
memtblprintFee.FieldByName('REMARKDR').AsString:=aQueryaccept.fieldbyName('<27><>ע').AsString;
end else begin
memtblprintFee.FieldByName('REMARKDR').AsString:=memtblprintFee.FieldByName('REMARKDR').AsString+' '+aQueryaccept.fieldbyName('<27><>ע').AsString;
end;
memtblprintFee.Post;
end else begin
ordNO:=ordNO+1;
memtblprintFee.Append;
memtblprintFee.FieldByName('ORDNO').AsInteger:=ordNO;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('FRT').AsString:=GetFrt(aQueryaccept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprintFee.FieldByName('ACCNAME').AsString:=aQueryaccept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprintFee.FieldByName('OBJDR').AsString:=trim(aQueryaccept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprintFee.FieldByName('OBJCR').AsString:='';
memtblprintFee.FieldByName('REMARKCR').AsString:='';
memtblprintFee.FieldByName('USDCR').AsFloat:=0;
memtblprintFee.FieldByName('RMBCR').AsFloat:=0;
memtblprintFee.FieldByName('OTCR').AsFloat:=0;
memtblprintFee.FieldByName('TTLCR').AsFloat:=0;
memtblprintFee.FieldByName('DR').AsString:='T';
memtblprintFee.FieldByName('CR').AsString:='F';
if aQueryaccept.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprintFee.FieldByName('USDDR').AsFloat:=aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.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
memtblprintFee.FieldByName('RMBDR').AsFloat:=aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLDR').AsFloat:=(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprintFee.FieldByName('OTDR').AsFloat:=aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLDR').AsFloat:=(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
memtblprintFee.FieldByName('REMARKDR').AsString:=memtblprintFee.FieldByName('REMARKDR').AsString+' '+aQueryaccept.fieldbyName('<27><>ע').AsString;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
memtblprintFee.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('ί<>б<EFBFBD><D0B1><EFBFBD>').asstring;
memtblprintFee.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('װ<><D7B0><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><>װ<EFBFBD><D7B0>').AsString:=tv_bscard_all.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>Ա').asstring;
memtblprintFee.FieldByName('ί<>е<EFBFBD>λ').AsString:=tv_bscard_all.fieldbyname('ί<>е<EFBFBD>λ').asstring;
memtblprintFee.FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD>ѷ<EFBFBD>ʽ').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><>װ').AsString:=tv_bscard_all.fieldbyname('<27><>װ').asstring;
memtblprintFee.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 memtblprintFee.Locate('<27><><EFBFBD><EFBFBD>;ACCNAME;CR',vararrayof([tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,aQuerypay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'F']),[]) then begin
memtblprintFee.Edit;
memtblprintFee.FieldByName('OBJCR').AsString:=trim(aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if aQuerypay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprintFee.FieldByName('USDCR').AsFloat:=memtblprintFee.FieldByName('USDCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=memtblprintFee.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
memtblprintFee.FieldByName('RMBCR').AsFloat:=memtblprintFee.FieldByName('RMBCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=memtblprintFee.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprintFee.FieldByName('OTCR').AsFloat:=memtblprintFee.FieldByName('OTCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=memtblprintFee.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprintFee.FieldByName('REMARKCR').AsString='' then begin
memtblprintFee.FieldByName('REMARKCR').AsString:=aQuerypay.fieldbyName('<27><>ע').AsString;
end else begin
memtblprintFee.FieldByName('REMARKCR').AsString:=memtblprintFee.FieldByName('REMARKCR').AsString+' '+aQuerypay.fieldbyName('<27><>ע').AsString;
end;
memtblprintFee.FieldByName('CR').AsString:='T';
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.Post;
end else begin
if memtblprintFee.Locate('<27><><EFBFBD><EFBFBD>;ACCNAME;OBJCR',vararrayof([tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,aQuerypay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,trim(aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring)]),[]) then begin
memtblprintFee.Edit;
if aQuerypay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprintFee.FieldByName('USDCR').AsFloat:=memtblprintFee.FieldByName('USDCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=memtblprintFee.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
memtblprintFee.FieldByName('RMBCR').AsFloat:=memtblprintFee.FieldByName('RMBCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=memtblprintFee.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprintFee.FieldByName('OTCR').AsFloat:=memtblprintFee.FieldByName('OTCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=memtblprintFee.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprintFee.FieldByName('REMARKCR').AsString='' then begin
memtblprintFee.FieldByName('REMARKCR').AsString:=aQuerypay.fieldbyName('<27><>ע').AsString;
end else begin
memtblprintFee.FieldByName('REMARKCR').AsString:=memtblprintFee.FieldByName('REMARKCR').AsString+' '+aQuerypay.fieldbyName('<27><>ע').AsString;
end;
memtblprintFee.FieldByName('CR').AsString:='T';
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.Post;
end else begin
ordNO:=ordNO+1;
memtblprintFee.Append;
memtblprintFee.FieldByName('ORDNO').AsInteger:=ordNO;
memtblprintFee.FieldByName('FRT').AsString:=GetFrt(aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('ACCNAME').AsString:=aQuerypay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprintFee.FieldByName('OBJCR').AsString:=aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprintFee.FieldByName('OBJDR').AsString:='';
memtblprintFee.FieldByName('REMARKCR').AsString:='';
memtblprintFee.FieldByName('USDDR').AsFloat:=0;
memtblprintFee.FieldByName('RMBDR').AsFloat:=0;
memtblprintFee.FieldByName('OTDR').AsFloat:=0;
memtblprintFee.FieldByName('TTLDR').AsFloat:=0;
memtblprintFee.FieldByName('DR').AsString:='F';
memtblprintFee.FieldByName('CR').AsString:='T';
if aQuerypay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprintFee.FieldByName('USDCR').AsFloat:=aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.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
memtblprintFee.FieldByName('RMBCR').AsFloat:=aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprintFee.FieldByName('OTCR').AsFloat:=aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
memtblprintFee.FieldByName('REMARKCR').AsString:=memtblprintFee.FieldByName('REMARKCR').AsString+' '+aQuerypay.fieldbyName('<27><>ע').AsString;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
memtblprintFee.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('ί<>б<EFBFBD><D0B1><EFBFBD>').asstring;
memtblprintFee.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('װ<><D7B0><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><>װ<EFBFBD><D7B0>').AsString:=tv_bscard_all.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>Ա').asstring;
memtblprintFee.FieldByName('ί<>е<EFBFBD>λ').AsString:=tv_bscard_all.fieldbyname('ί<>е<EFBFBD>λ').asstring;
memtblprintFee.FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD>ѷ<EFBFBD>ʽ').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('<27><>װ').AsString:=tv_bscard_all.fieldbyname('<27><>װ').asstring;
memtblprintFee.Post;
end;
end;
aQuerypay.Next;
end;
finally
aQueryaccept.Free;
aQuerypay.Free;
end;
end;
memtblprintFee.SortOn('<27><><EFBFBD><EFBFBD>;ordNO;FRT;ACCNAME',[]);
sys_print('<27><><EFBFBD><EFBFBD><E3B5A5>ӡ',2,tv_bscard_all1,nil,nil,nil,memtblprintFee1,nil,t_op_gain1,t_op_gain_main1,nil,nil,nil);
tv_bscard_all.EnableControls;
end;
{procedure Tfrm_cw_prnFee.N16Click(Sender: TObject);
var
Frt:String;
i,ordNO:Integer;
aQueryaccept:TADOQuery;
aQuerypay:TADOQuery;
begin
tv_bscard_all.DisableControls;
memtblprintFee.close;
memtblprintFee.Open;
memtblprintFee.EmptyTable;
ordNO:=1;
for i:=0 to dxDBGrid1.SelectedCount-1 do
begin
tv_bscard_all.GotoBookmark(pointer(dxDBGrid1.selectedrows[i]));
aQueryaccept:=CreateAdoQuery;
aQuerypay:=CreateAdoQuery;
try
aQueryaccept.Close;aQueryaccept.sql.Clear;
aQueryaccept.sql.Text:='select * from t_ch_fee where <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD>='''+tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''' 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>='''+tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''' order by CH_ID';
aQuerypay.Open;
aQueryaccept.First;
while not aQueryaccept.Eof do begin
Frt:=GetFrt(aQueryaccept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if memtblprintFee.Locate('<27><><EFBFBD><EFBFBD>;Frt;ACCNAME;OBJDR',vararrayof([tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,Frt,trim(aQueryaccept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring),trim(aQueryaccept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring)]),[]) then begin
memtblprintFee.Edit;
if aQueryaccept.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprintFee.FieldByName('USDDR').AsFloat:=memtblprintFee.FieldByName('USDDR').AsFloat+aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLDR').AsFloat:=memtblprintFee.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
memtblprintFee.FieldByName('RMBDR').AsFloat:=memtblprintFee.FieldByName('RMBDR').AsFloat+aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLDR').AsFloat:=memtblprintFee.FieldByName('TTLDR').AsFloat+(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprintFee.FieldByName('OTDR').AsFloat:=memtblprintFee.FieldByName('OTDR').AsFloat+aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLDR').AsFloat:=memtblprintFee.FieldByName('TTLDR').AsFloat+(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprintFee.FieldByName('REMARKDR').AsString='' then begin
memtblprintFee.FieldByName('REMARKDR').AsString:=aQueryaccept.fieldbyName('<27><>ע').AsString;
end else begin
memtblprintFee.FieldByName('REMARKDR').AsString:=memtblprintFee.FieldByName('REMARKDR').AsString+' '+aQueryaccept.fieldbyName('<27><>ע').AsString;
end;
memtblprintFee.Post;
end else begin
ordNO:=ordNO+1;
memtblprintFee.Append;
memtblprintFee.FieldByName('ORDNO').AsInteger:=ordNO;
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('FRT').AsString:=GetFrt(aQueryaccept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprintFee.FieldByName('ACCNAME').AsString:=aQueryaccept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprintFee.FieldByName('OBJDR').AsString:=trim(aQueryaccept.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprintFee.FieldByName('OBJCR').AsString:='';
memtblprintFee.FieldByName('REMARKCR').AsString:='';
memtblprintFee.FieldByName('USDCR').AsFloat:=0;
memtblprintFee.FieldByName('RMBCR').AsFloat:=0;
memtblprintFee.FieldByName('OTCR').AsFloat:=0;
memtblprintFee.FieldByName('TTLCR').AsFloat:=0;
memtblprintFee.FieldByName('DR').AsString:='T';
memtblprintFee.FieldByName('CR').AsString:='F';
if aQueryaccept.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprintFee.FieldByName('USDDR').AsFloat:=aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.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
memtblprintFee.FieldByName('RMBDR').AsFloat:=aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLDR').AsFloat:=(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprintFee.FieldByName('OTDR').AsFloat:=aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLDR').AsFloat:=(aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQueryaccept.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
memtblprintFee.FieldByName('REMARKDR').AsString:=memtblprintFee.FieldByName('REMARKDR').AsString+' '+aQueryaccept.fieldbyName('<27><>ע').AsString;
memtblprintFee.Post;
end;
aQueryaccept.Next;
end;
aQuerypay.First;
while not aQuerypay.Eof do begin
Frt:=GetFrt(aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
ShowMessage(tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+' '+Frt+' '+aQuerypay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
if memtblprintFee.Locate('<27><><EFBFBD><EFBFBD>;Frt;ACCNAME;CR',vararrayof([tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,Frt,aQuerypay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'F']),[]) then begin
ShowMessage('1'+tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
memtblprintFee.Edit;
memtblprintFee.FieldByName('OBJCR').AsString:=trim(aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if aQuerypay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprintFee.FieldByName('USDCR').AsFloat:=memtblprintFee.FieldByName('USDCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=memtblprintFee.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
memtblprintFee.FieldByName('RMBCR').AsFloat:=memtblprintFee.FieldByName('RMBCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=memtblprintFee.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprintFee.FieldByName('OTCR').AsFloat:=memtblprintFee.FieldByName('OTCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=memtblprintFee.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprintFee.FieldByName('REMARKCR').AsString='' then begin
memtblprintFee.FieldByName('REMARKCR').AsString:=aQuerypay.fieldbyName('<27><>ע').AsString;
end else begin
memtblprintFee.FieldByName('REMARKCR').AsString:=memtblprintFee.FieldByName('REMARKCR').AsString+' '+aQuerypay.fieldbyName('<27><>ע').AsString;
end;
memtblprintFee.FieldByName('CR').AsString:='T';
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.Post;
end else begin
ShowMessage(tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+' '+Frt+' '+aQuerypay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
if memtblprintFee.Locate('<27><><EFBFBD><EFBFBD>;Frt;ACCNAME;OBJCR',vararrayof([tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,Frt,aQuerypay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,trim(aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring)]),[]) then begin
ShowMessage('2'+tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
memtblprintFee.Edit;
if aQuerypay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprintFee.FieldByName('USDCR').AsFloat:=memtblprintFee.FieldByName('USDCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=memtblprintFee.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
memtblprintFee.FieldByName('RMBCR').AsFloat:=memtblprintFee.FieldByName('RMBCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=memtblprintFee.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprintFee.FieldByName('OTCR').AsFloat:=memtblprintFee.FieldByName('OTCR').AsFloat+aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=memtblprintFee.FieldByName('TTLCR').AsFloat+(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
if memtblprintFee.FieldByName('REMARKCR').AsString='' then begin
memtblprintFee.FieldByName('REMARKCR').AsString:=aQuerypay.fieldbyName('<27><>ע').AsString;
end else begin
memtblprintFee.FieldByName('REMARKCR').AsString:=memtblprintFee.FieldByName('REMARKCR').AsString+' '+aQuerypay.fieldbyName('<27><>ע').AsString;
end;
memtblprintFee.FieldByName('CR').AsString:='T';
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.Post;
end else begin
ShowMessage('3'+tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
ordNO:=ordNO+1;
memtblprintFee.Append;
memtblprintFee.FieldByName('ORDNO').AsInteger:=ordNO;
memtblprintFee.FieldByName('FRT').AsString:=GetFrt(aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblprintFee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tv_bscard_all.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
memtblprintFee.FieldByName('ACCNAME').AsString:=aQuerypay.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprintFee.FieldByName('OBJCR').AsString:=aQuerypay.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblprintFee.FieldByName('OBJDR').AsString:='';
memtblprintFee.FieldByName('REMARKCR').AsString:='';
memtblprintFee.FieldByName('USDDR').AsFloat:=0;
memtblprintFee.FieldByName('RMBDR').AsFloat:=0;
memtblprintFee.FieldByName('OTDR').AsFloat:=0;
memtblprintFee.FieldByName('TTLDR').AsFloat:=0;
memtblprintFee.FieldByName('DR').AsString:='F';
memtblprintFee.FieldByName('CR').AsString:='T';
if aQuerypay.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
memtblprintFee.FieldByName('USDCR').AsFloat:=aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.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
memtblprintFee.FieldByName('RMBCR').AsFloat:=aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end else begin
memtblprintFee.FieldByName('OTCR').AsFloat:=aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
memtblprintFee.FieldByName('TTLCR').AsFloat:=(aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat*aQuerypay.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
end;
memtblprintFee.FieldByName('REMARKCR').AsString:=memtblprintFee.FieldByName('REMARKCR').AsString+' '+aQuerypay.fieldbyName('<27><>ע').AsString;
memtblprintFee.Post;
end;
end;
aQuerypay.Next;
end;
finally
aQueryaccept.Free;
aQuerypay.Free;
end;
end;}
end.