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.

1483 lines
84 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 AccCloseOffu;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, DBGridEh, DB, kbmMemTable, ImgList,ADODB,DateUtils,
Buttons, BusinessSkinForm, bsSkinCtrls, ExtCtrls, ComCtrls, bsSkinTabs;
type
TAddtionMonthlyFeeDataEvent = procedure(Sender : TObject; Msg : String) of Object;
TfrmAccCloseOff = class(TForm)
DBGridEh1: TDBGridEh;
memTblPeriod: TkbmMemTable;
dsrPeriod: TDataSource;
memTblPeriodPERIOD: TStringField;
memTblPeriodPYEAR: TIntegerField;
memTblPeriodPMONTH: TIntegerField;
memTblPeriodFDAY: TDateTimeField;
memTblPeriodTDAY: TDateTimeField;
memTblPeriodCLOSED: TStringField;
ImageList1: TImageList;
bsBusinessSkinForm1: TbsBusinessSkinForm;
bbtnExcute: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
memtotal: TkbmMemTable;
memtotalID: TIntegerField;
memtotalField16: TSmallintField;
memtotalField: TIntegerField;
memtotalField2: TSmallintField;
memtotalField3: TSmallintField;
memtotalField4: TDateField;
memtotalField5: TStringField;
memtotalField6: TStringField;
memtotalField7: TStringField;
memtotalField8: TStringField;
memtotalField9: TStringField;
memtotalField10: TFloatField;
memtotalField11: TFloatField;
memtotalField12: TFloatField;
memtotalField13: TFloatField;
memtotalField14: TFloatField;
memtotalField15: TFloatField;
memtotal1: TDataSource;
kbmThreadDataSet1: TkbmThreadDataSet;
t_ch_bank_genleg: TADOQuery;
t_ch_cust_genleg: TADOQuery;
t_ch_genleg: TADOQuery;
memtotalRMB: TFloatField;
memtotalRMB2: TFloatField;
memtotalRMB3: TFloatField;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
bsSkinTabSheet2: TbsSkinTabSheet;
DBGridLegBook: TDBGridEh;
DBGridEh2: TDBGridEh;
MemoMsg: TMemo;
v_op_bscard: TADOQuery;
v_op_bscard1: TDataSource;
v_op_bscardDSDesigner2: TStringField;
v_op_bscardDSDesigner3: TStringField;
v_op_bscardDSDesigner4: TStringField;
v_op_bscardDSDesigner5: TStringField;
v_op_bscardDSDesigner6: TStringField;
v_op_bscardDSDesigner7: TDateTimeField;
v_op_bscardDSDesigner8: TStringField;
v_op_bscardDSDesigner9: TStringField;
v_op_bscardDSDesigner10: TStringField;
v_op_bscardDSDesigner11: TStringField;
v_op_bscardDSDesigner12: TStringField;
v_op_bscardDSDesigner13: TStringField;
v_op_bscardDSDesigner14: TStringField;
v_op_bscardDSDesigner15: TStringField;
v_op_bscardDSDesigner16: TStringField;
v_op_bscardDSDesigner17: TStringField;
v_op_bscardDSDesigner18: TStringField;
v_op_bscardDSDesigner19: TStringField;
v_op_bscardDSDesigner20: TStringField;
v_op_bscardDSDesigner21: TDateTimeField;
v_op_bscardDSDesigner22: TStringField;
v_op_bscardDSDesigner23: TStringField;
v_op_bscardDSDesigner24: TStringField;
v_op_bscardDSDesigner25: TStringField;
v_op_bscardDSDesigner26: TStringField;
v_op_bscardDSDesigner27: TStringField;
v_op_bscardDSDesigner28: TDateTimeField;
v_op_bscardDSDesigner29: TStringField;
v_op_bscardDSDesigner30: TStringField;
v_op_bscardDSDesigner31: TStringField;
v_op_bscardDSDesigner32: TStringField;
v_op_bscardDSDesigner33: TIntegerField;
v_op_bscardDSDesigner34: TStringField;
v_op_bscardDSDesigner35: TStringField;
v_op_bscardDSDesigner36: TStringField;
v_op_bscardDSDesigner37: TDateTimeField;
v_op_bscardDSDesigner38: TStringField;
v_op_bscardDSDesigner39: TStringField;
v_op_bscardDSDesigner40: TStringField;
v_op_bscardDSDesigner41: TStringField;
v_op_bscardDSDesigner42: TIntegerField;
v_op_bscardDSDesigner43: TBCDField;
v_op_bscardDSDesigner44: TBCDField;
v_op_bscardDSDesigner1: TIntegerField;
v_op_bscardDSDesigner210: TIntegerField;
v_op_bscardDSDesigner310: TIntegerField;
v_op_bscardDSDesigner45: TIntegerField;
v_op_bscardDSDesigner52: TIntegerField;
v_op_bscardDSDesigner62: TIntegerField;
v_op_bscardDSDesigner72: TIntegerField;
v_op_bscardDSDesigner82: TIntegerField;
v_op_bscardDSDesigner92: TIntegerField;
v_op_bscardDSDesigner102: TIntegerField;
v_op_bscardDSDesigner46: TIntegerField;
v_op_bscardTEU: TIntegerField;
v_op_bscardDSDesigner47: TStringField;
v_op_bscardUSD: TBCDField;
v_op_bscardUSD2: TBCDField;
v_op_bscardUSD3: TBCDField;
v_op_bscardUSD4: TBCDField;
v_op_bscardUSD5: TBCDField;
v_op_bscardRMB: TBCDField;
v_op_bscardRMB2: TBCDField;
v_op_bscardRMB3: TBCDField;
v_op_bscardRMB4: TBCDField;
v_op_bscardRMB5: TBCDField;
v_op_bscardDSDesigner48: TBCDField;
v_op_bscardDSDesigner49: TBCDField;
v_op_bscardDSDesigner50: TBCDField;
v_op_bscardDSDesigner51: TStringField;
v_op_bscardDSDesigner53: TBCDField;
v_op_bscardDSDesigner54: TBCDField;
v_op_bscardDSDesigner55: TBCDField;
bsSkinPanel2: TbsSkinPanel;
Label2: TLabel;
Label3: TLabel;
ComboBoxYear: TComboBox;
EditYM: TEdit;
bsSkinPanel1: TbsSkinPanel;
Label1: TLabel;
Panel1: TPanel;
Label4: TLabel;
Label5: TLabel;
DateTimePicker1: TDateTimePicker;
DateTimePicker2: TDateTimePicker;
Button1: TButton;
Button2: TButton;
v_op_bscardDSDesigner: TStringField;
procedure FormShow(Sender: TObject);
procedure ComboBoxYearChange(Sender: TObject);
procedure bbtnExcuteClick(Sender: TObject);
procedure t_ch_bank_genlegAfterInsert(DataSet: TDataSet);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure DBGridLegBookDblClick(Sender: TObject);
private
aStep : SmallInt;
procedure AddtionMonthlyFeeData(aYear, aMonth, aBsNo : String; Plus, CalcStl : Boolean;
Proc : TAddtionMonthlyFeeDataEvent = nil);
{ Private declarations }
public
{ Public declarations }
ShowCtrls : Boolean;
procedure UpdateAccDate(AccDate,toAccDate,SetAccDate:string);
end;
var
frmAccCloseOff: TfrmAccCloseOff;
implementation
uses my_sys_function, u_main;
{$R *.dfm}
procedure TfrmAccCloseOff.AddtionMonthlyFeeData(aYear, aMonth, aBsNo : String; Plus, CalcStl : Boolean;
Proc : TAddtionMonthlyFeeDataEvent = nil);
var aQuery, aQuery2 : TAdoQuery;
PlusChar : Char;
I1, I2 : Integer;
begin
aQuery:=CreateAdoQuery;
aQuery2:=CreateAdoQuery;
if Plus then
PlusChar:='+'
else PlusChar:='-';
with aQuery do
try
//////<2F><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD>˵<EFBFBD>Ӧ<EFBFBD><D3A6>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>///////
Close;SQL.Clear;
SQL.Add('Select c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, c.<2E><><EFBFBD><EFBFBD>, c.<2E>ұ<EFBFBD>,c.<2E><><EFBFBD><EFBFBD>, b.ҵ<><D2B5><EFBFBD><EFBFBD>Դ, b.<2E><>Դ<EFBFBD><D4B4>ϸ,b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, b.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,b.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>,b.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>');
SQL.Add(',Sum(ISNULL(c.<2E><><EFBFBD><EFBFBD>,0)) as <20><><EFBFBD><EFBFBD>');
SQL.Add('from t_ch_fee c, v_op_bscard b');
SQL.Add('where b.<2E><><EFBFBD><EFBFBD>=c.<2E><><EFBFBD><EFBFBD> and c.<2E><><EFBFBD><EFBFBD><>0');
if strtoint(get_parameters_value(140,'0'))=0 then
SQL.Add(' and SUBSTRING(CONVERT(char(15),b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>,111),1,7)='''+FormatDateTime('YYYY', EncodeDate(Logininfo.offyear,Logininfo.offmonth,1))+'/'+FormatDateTime('MM', EncodeDate(Logininfo.offyear,Logininfo.offmonth,1))+'''')
else begin
SQL.Add(' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+FormatDateTime('YYYY-MM-DD',Logininfo.endday)+''' AND b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+FormatDateTime('YYYY-MM-DD',Incmonth(Logininfo.endday)+1)+'''');
end;
if aBsNo<>'' then begin
SQL.Add(' and b.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+aBsNo+'''');
end else begin
SQL.Add(' and b.<2E><><EFBFBD><EFBFBD>״̬=''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>''');
end;
SQL.Add('Group By c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, c.<2E><><EFBFBD><EFBFBD>, c.<2E>ұ<EFBFBD>,c.<2E><><EFBFBD><EFBFBD>, b.ҵ<><D2B5><EFBFBD><EFBFBD>Դ, b.<2E><>Դ<EFBFBD><D4B4>ϸ, b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, b.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,b.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>,b.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>');
SQL.Add('Order By c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, c.<2E><><EFBFBD><EFBFBD>, c.<2E>ұ<EFBFBD>,c.<2E><><EFBFBD><EFBFBD>, b.ҵ<><D2B5><EFBFBD><EFBFBD>Դ, b.<2E><>Դ<EFBFBD><D4B4>ϸ, b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, b.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,b.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>,b.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>');
Open;First;
I1:=0;
I2:=RecordCount;
while not Eof do begin
Inc(I1);
if Assigned(Proc) then
Proc(nil, Format('Ӧ<><D3A6>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=%s, Rec : %d / %d', [aQuery.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString, I1, I2]));
with aQuery2, SQL do begin
Close;Clear;
Add('Select Count(*) as rd from t_ch_custbalance');
Add('where <20><>='+aYear+' and <20><>='+aMonth);
Add('and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and ҵ<><D2B5><EFBFBD><EFBFBD>Դ='''+aQuery.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString+'''');
Add('and <20><>Դ<EFBFBD><D4B4>ϸ='''+aQuery.FieldByName('<27><>Դ<EFBFBD><D4B4>ϸ').AsString+'''');
Add('and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and <20><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='''+aQuery.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString+'''');
Open;
if Plus and (FieldByName('rd').AsInteger=0) then begin
Close;Clear;
Add('Insert Into t_ch_custbalance');
Add('(<28><>,<2C><>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD>Դ,<2C><>Դ<EFBFBD><D4B4>ϸ,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>');
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD>USD');
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD');
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>');
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>)');
Add('Values('+aYear+','+aMonth+','''+aQuery.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add(','''+aQuery.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString+'''');
Add(','''+aQuery.FieldByName('<27><>Դ<EFBFBD><D4B4>ϸ').AsString+'''');
Add(','''+aQuery.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add(','''+aQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add(','''+aQuery.FieldByName('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add(','''+aQuery.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString+'''');
if aQuery.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then begin
if aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then
Add(',0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,0,0,0,0,0,0,0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,0,0,0)')
else
Add(',0,0,0,0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,0,0,0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+')');
end else begin
if aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then
Add(',0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,0,0,0,0,0,0,0,0,'+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat)+',0,'+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat)+',0,0,0,0)')
else
Add(',0,0,0,0,0,0,0,0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,0,0,0,0,'+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat)+',0,'+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat)+')');
end;
end else begin
Close;Clear;
Add('Update t_ch_custbalance Set');
if aQuery.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then begin
if aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
Add('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD>'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD>ϼ<EFBFBD>'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
end else begin
Add('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
end;
end else begin
if aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
Add('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD>USD=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD>USD'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD>ϼ<EFBFBD>'+PlusChar+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat));
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>'+PlusChar+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat));
end else begin
Add('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'+PlusChar+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat));
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'+PlusChar+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat));
end;
end;
Add('where <20><>='+aYear+' and <20><>='+aMonth);
Add('and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and ҵ<><D2B5><EFBFBD><EFBFBD>Դ='''+aQuery.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString+'''');
Add('and <20><>Դ<EFBFBD><D4B4>ϸ='''+aQuery.FieldByName('<27><>Դ<EFBFBD><D4B4>ϸ').AsString+'''');
Add('and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and <20><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='''+aQuery.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString+'''');
end;
// sql.SaveToFile('d:\1.txt');
ExecSQL;
end;
Next;
end;
if not CalcStl then exit;
//////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ///////////
Close;SQL.Clear;
SQL.Add('Select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>, ԭʼ<D4AD>ұ<EFBFBD> as <20>ұ<EFBFBD>, <20><><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD>Դ, <20><>Դ<EFBFBD><D4B4>ϸ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>');
SQL.Add(',Sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>');
SQL.Add('from v_fee_do_bscard_detail ');
SQL.Add('where 1=1 ');
if strtoint(get_parameters_value(140,'0'))=0 then
SQL.Add(' and SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7)='''+FormatDateTime('YYYY', EncodeDate(Logininfo.offyear,Logininfo.offmonth,1))+'/'+FormatDateTime('MM', EncodeDate(Logininfo.offyear,Logininfo.offmonth,1))+'''')
else begin
SQL.Add(' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>'''+FormatDateTime('YYYY-MM-DD',Logininfo.endday)+''' AND <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><'''+FormatDateTime('YYYY-MM-DD',Incmonth(Logininfo.endday+1))+'''');
end;
if aBsNo<>'' then
SQL.Add('and b.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+aBsNo+'''');
SQL.Add('Group By <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>, ԭʼ<D4AD>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>, ҵ<><D2B5><EFBFBD><EFBFBD>Դ, <20><>Դ<EFBFBD><D4B4>ϸ, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>');
Open;First;
I1:=0;
I2:=RecordCount;
while not Eof do begin
Inc(I1);
if Assigned(Proc) then
Proc(nil, Format('ʵ<><CAB5>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3>ͻ<EFBFBD>=%s, Rec : %d / %d', [aQuery.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString, I1, I2]));
with aQuery2, SQL do begin
Close;Clear;
Add('Select Count(*) as rd from t_ch_custbalance');
Add('where <20><>='+aYear+' and <20><>='+aMonth);
Add('and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and ҵ<><D2B5><EFBFBD><EFBFBD>Դ='''+aQuery.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString+'''');
Add('and <20><>Դ<EFBFBD><D4B4>ϸ='''+aQuery.FieldByName('<27><>Դ<EFBFBD><D4B4>ϸ').AsString+'''');
Add('and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and <20><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='''+aQuery.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString+'''');
Open;
if Plus and (FieldByName('rd').AsInteger=0) then begin
Close;Clear;
Add('Insert Into t_ch_custbalance');
Add('(<28><>,<2C><>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD>Դ,<2C><>Դ<EFBFBD><D4B4>ϸ,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>');
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD>USD');
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD');
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>');
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>)');
Add('Values('+aYear+','+aMonth+','''+aQuery.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add(','''+aQuery.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString+'''');
Add(','''+aQuery.FieldByName('<27><>Դ<EFBFBD><D4B4>ϸ').AsString+'''');
Add(','''+aQuery.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add(','''+aQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add(','''+aQuery.FieldByName('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add(','''+aQuery.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString+'''');
if aQuery.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then begin
if aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then
if aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat>=0 then
Add(',0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',-'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,0,0,0,0,0,0,0,0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',-'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,0,0,0)')
else
Add(',0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+','+floattostr(abs(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat))+',0,0,0,0,0,0,0,0,0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+','+floattostr(abs(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat))+',0,0,0,0)')
else
if aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat>=0 then
Add(',0,0,0,0,0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',-'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,0,0,0,0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',-'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+')')
else
Add(',0,0,0,0,0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+','+floattostr(abs(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat))+',0,0,0,0,0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+','+floattostr(abs(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat))+')');
end else begin
if aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then
if aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat>=0 then
Add(',0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',-'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,0,0,0,0,0,0,0,0,0,'+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat)+',-'+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat)+',0,0,0,0)')
else
Add(',0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+','+floattostr(abs(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat))+',0,0,0,0,0,0,0,0,0,0,'+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat)+','+floattostr(Abs(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat))+',0,0,0,0)')
else
if aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat>=0 then
Add(',0,0,0,0,0,0,0,0,0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',-'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',0,0,0,0,0,0,'+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat)+',-'+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat)+')')
else
Add(',0,0,0,0,0,0,0,0,0,0,0,0,0,0,'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+','+floattostr(abs(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat))+',0,0,0,0,0,0,'+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat)+',-'+floattostr(abs(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat))+')');
end;
end else begin
Close;Clear;
Add('Update t_ch_custbalance Set');
if aQuery.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then begin
if aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
Add('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD>'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD>ϼ<EFBFBD>'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
if aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat>=0 then
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>-'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>-'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString)
else
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>+'+floattostr(abs(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat))+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>+'+floattostr(abs(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat)));
end else begin
Add('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
if aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat>=0 then
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>-'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString)
else
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+floattostr(abs(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat))+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>+'+floattostr(abs(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat)));
end;
end else begin
if aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
Add('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD>USD=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD>USD'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD>ϼ<EFBFBD>'+PlusChar+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat));
if aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat>=0 then
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD-'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>-'+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat))
else
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD+'+floattostr(abs(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat))+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>+'+floattostr(abs(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat)));
end else begin
Add('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD'+PlusChar+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'+PlusChar+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat));
if aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat>=0 then
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD-'+aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>-'+floattostr(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat))
else
Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD+'+floattostr(abs(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat))+',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>=<3D><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>+'+floattostr(abs(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat*aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat)));
end;
end;
Add('where <20><>='+aYear+' and <20><>='+aMonth);
Add('and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and ҵ<><D2B5><EFBFBD><EFBFBD>Դ='''+aQuery.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString+'''');
Add('and <20><>Դ<EFBFBD><D4B4>ϸ='''+aQuery.FieldByName('<27><>Դ<EFBFBD><D4B4>ϸ').AsString+'''');
Add('and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+aQuery.FieldByName('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Add('and <20><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='''+aQuery.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString+'''');
end;
// if aQuery.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString='<27><><EFBFBD><EFBFBD>' then
// sql.SaveToFile('e:\e.txt');
ExecSQL;
end;
Next;
end;
finally
Close;
FreeAndNil(aQuery);
aQuery2.Close;
FreeAndNil(aQuery2);
end;
end;
procedure TfrmAccCloseOff.FormShow(Sender: TObject);
var aQuery : TAdoQuery;
I : Integer;
begin
aStep:=0;
Panel1.Visible:=false;
//<2F><>ʾ<EFBFBD><CABE>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ComboBoxYear.Items.Clear;
aQuery:=CreateAdoQuery;
with aQuery do
try
EditYM.Text:=Format('%d <20><> %d <20><>', [LoginInfo.OffYear, LoginInfo.OffMonth]);
Close;SQL.Clear;
SQL.Add('Select Distinct PYear from Period');
Open;
First;
while not Eof do begin
ComboBoxYear.Items.Add(FieldByName('PYear').AsString);
Next;
end;
ComboBoxYear.ItemIndex:=ComboBoxYear.Items.IndexOf(IntToStr(LoginInfo.OffYear));
Close;SQL.Clear;
SQL.Add('Select * from Period order by period');
Open;
memTblPeriod.Close;
memTblPeriod.EmptyTable;
memTblPeriod.Filtered:=false;
memTblPeriod.Filter:='PYear='+ComboBoxYear.Items[ComboBoxYear.ItemIndex];
memTblPeriod.Filtered:=true;
memTblPeriod.LoadFromDataSet(aQuery, []);
finally
Close;Free;
end;
end;
procedure TfrmAccCloseOff.ComboBoxYearChange(Sender: TObject);
begin
with memTblPeriod do begin
Filter:='PYear='+ComboBoxYear.Items[ComboBoxYear.ItemIndex];
if not Filtered then Filtered:=true;
end;
end;
procedure TfrmAccCloseOff.bbtnExcuteClick(Sender: TObject);
var aQuery, aQuery2 : TAdoQuery;
TtlCount,offyear,offmonth,i,hc,nc,tyear,tmonth : Integer;
aYear, aMonth,strdate,stredate,afyear,afMonth : String;
bal,usdbal,rmbbal:double;
YYYY,MM,DD :Word;
begin
//<2F><>ĩ<EFBFBD><C4A9><EFBFBD><EFBFBD>
aQuery:=CreateAdoQuery;
aQuery2:=CreateAdoQuery;
with aQuery do
try
Close;SQL.Clear;
SQL.Add('select top 1 * from period where closed=''F'' order by period');
Open;
offyear:=fieldbyname('pyear').asinteger;
offmonth:=fieldbyname('pmonth').asinteger;
if offmonth=1 then begin
aYear:=inttostr(offyear-1);
amonth:='12';
end else begin
aYear:=inttostr(offyear);
amonth:=inttostr(offmonth-1);
end;
if offmonth=12 then begin
afYear:=inttostr(offyear+1);
afmonth:='1';
end else begin
afYear:=inttostr(offyear);
afmonth:=inttostr(offmonth+1);
end;
bal:=0;
usdbal:=0;
rmbbal:=0;
case aStep of
0 : begin
strdate:=FormatDateTime('YYYY-MM-DD',Logininfo.endday);
YYYY:=YearOf(Incmonth(Logininfo.endday));
MM:=MonthOf(Incmonth(Logininfo.endday));
DD:=DaysInMonth(Incmonth(Logininfo.endday));
stredate:=FormatDateTime('YYYY-MM-DD',encodeDate(YYYY,MM,DD));
if strtobool(get_parameters_value(142,'false')) then
begin
MemoMsg.Clear;
MemoMsg.Lines.Add('ע<>⣺');
MemoMsg.Lines.Add(' ת<>ʺ<EFBFBD><CABA><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>Ӧ<EFBFBD>ա<EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E3BDAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8><C4A3><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>Ҫת<D2AA>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɡ<EFBFBD><C9A1><EFBFBD>ť<EFBFBD><C5A5>');
MemoMsg.Font.Color:=clRed;
bbtnExcute.Caption:='<27><><EFBFBD>ɣ<EFBFBD>';
aStep:=1;
end;
end;
1 : begin
bsSkinPanel1.Visible:=true;
bsSkinPanel1.Update;
bbtnExcute.Enabled:=false;
frm_main.db.BeginTrans;
//aYear<61><72>aMonth ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>ڼ<EFBFBD>
Close;SQL.Clear;
SQL.Add('Update Period Set Closed=''T''');
SQL.Add('where pyear='+inttostr(offYear)+' and pmonth='+inttostr(offMonth));
ExecSQL;
with memTblPeriod do
begin
Locate('PMonth', OffMonth, []);
Edit;
FieldByName('Closed').AsString:='T';
Post;
end;
Logininfo.offyear:=StrToInt(afYear);
Logininfo.offmonth:=StrToInt(afmonth);
if strtoint(get_parameters_value(140,'0'))=0 then
Logininfo.endday:=EncodeDate(Logininfo.offyear, Logininfo.offmonth,1)-1
else begin
if Logininfo.offmonth=1 then begin
tYear:=Logininfo.offyear-1;
tmonth:=12;
end else begin
tYear:=Logininfo.offyear;
tmonth:=Logininfo.offmonth-1;
end;
Logininfo.endday:=EncodeDate(tyear,tmonth,strtoint(get_parameters_value(140,'0')));
end;
if frm_main.db.InTransaction then
frm_main.db.CommitTrans;
if ComboBoxYear.ItemIndex<>ComboBoxYear.Items.IndexOf(afYear) then begin
ComboBoxYear.ItemIndex:=ComboBoxYear.Items.IndexOf(afYear);
ComboBoxYearChange(ComboBoxYear);
end;
MessageDlg('<27><><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD>ɣ<EFBFBD>', mtWarning, [mbOk], 0);
end;
end;
finally
bsSkinPanel1.Visible:=false;
Close;
FreeAndNil(aQuery);
aQuery2.Close;
FreeAndNil(aQuery2);
if frm_main.db.InTransaction then
frm_main.db.RollbackTrans;
end;
end;
{procedure TfrmAccCloseOff.bbtnExcuteClick(Sender: TObject);
var aQuery, aQuery2 : TAdoQuery;
TtlCount,offyear,offmonth,i,hc,nc,tyear,tmonth : Integer;
aYear, aMonth,strdate,stredate,afyear,afMonth : String;
bal,usdbal,rmbbal:double;
YYYY,MM,DD :Word;
begin
//<2F><>ĩ<EFBFBD><C4A9><EFBFBD><EFBFBD>
aQuery:=CreateAdoQuery;
aQuery2:=CreateAdoQuery;
with aQuery do
try
Close;SQL.Clear;
SQL.Add('select top 1 * from period where closed=''F''');
Open;
offyear:=fieldbyname('pyear').asinteger;
offmonth:=fieldbyname('pmonth').asinteger;
if offmonth=1 then begin
aYear:=inttostr(offyear-1);
amonth:='12';
end else begin
aYear:=inttostr(offyear);
amonth:=inttostr(offmonth-1);
end;
if offmonth=12 then begin
afYear:=inttostr(offyear+1);
afmonth:='1';
end else begin
afYear:=inttostr(offyear);
afmonth:=inttostr(offmonth+1);
end;
bal:=0;
usdbal:=0;
rmbbal:=0;
case aStep of
0 : begin
strdate:=FormatDateTime('YYYY-MM-DD',Logininfo.endday);
YYYY:=YearOf(Incmonth(Logininfo.endday));
MM:=MonthOf(Incmonth(Logininfo.endday));
DD:=DaysInMonth(Incmonth(Logininfo.endday));
stredate:=FormatDateTime('YYYY-MM-DD',encodeDate(YYYY,MM,DD));
//stredate:=FormatDateTime('YYYY-MM-DD',Incmonth(Logininfo.endday)+1);
if strtobool(get_parameters_value(141,'false')) then
begin
i:=0;
//<2F><><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
memtotal.open;
close;sql.clear;
sql.Add('select * from v_op_fee where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>'''+strdate+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='''+stredate+''' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
open;
first;
while not eof do
begin
if fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger=1 then
begin
if fieldbyname('<27>ұ<EFBFBD>').AsString='' then
begin
if fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').Asfloat<>0 then
begin
memtotal.Append;
memtotal['ID']:=i;
memtotal['<27><><EFBFBD><EFBFBD>']:=1;
memtotal['<27><>']:=offyear;
memtotal['<27><>']:=offmonth;
memtotal['<27><>']:=DayOf(FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
memtotal['<27><><EFBFBD><EFBFBD>']:=FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
memtotal['ժҪ']:=fieldbyname('<27><>ע').asstring;
memtotal['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
if fieldbyname('<27><><EFBFBD>ʽ').asstring='<27>ֽ<EFBFBD>' then
begin
memtotal['<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>']:='<27>ֽ<EFBFBD>';
end
else
begin
memtotal['<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>']:=fieldbyname('<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>').asstring;
memtotal['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
end;
if fieldbyname('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then
begin
memtotal['<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').Asfloat;
memtotal['<27><><EFBFBD><EFBFBD>']:=bal+fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').Asfloat;
memtotal['RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').Asfloat;
end
else
begin
memtotal['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').Asfloat;
memtotal['<27><><EFBFBD><EFBFBD>']:=bal-fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').Asfloat;
memtotal['RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').Asfloat;
end;
memtotal.post;
end;
if fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').Asfloat<>0 then
begin
memtotal.Append;
memtotal['ID']:=i;
memtotal['<27><><EFBFBD><EFBFBD>']:=1;
memtotal['<27><>']:=offyear;
memtotal['<27><>']:=offmonth;
memtotal['<27><>']:=DayOf(FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
memtotal['<27><><EFBFBD><EFBFBD>']:=FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
memtotal['ժҪ']:=fieldbyname('<27><>ע').asstring;
memtotal['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
if fieldbyname('<27><><EFBFBD>ʽ').asstring='<27>ֽ<EFBFBD>' then
begin
memtotal['<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>']:='<27>ֽ<EFBFBD>';
end
else
begin
memtotal['<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>']:=fieldbyname('<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>').asstring;
memtotal['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
end;
if fieldbyname('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then
begin
memtotal['<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>']:=fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').Asfloat;
memtotal['<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>']:=fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').Asfloat*GetUsdExrate(FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime));
end
else
begin
memtotal['<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').Asfloat;
memtotal['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').Asfloat*GetUsdExrate(FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime));
end;
memtotal.post;
end;
end
else
begin
memtotal.Append;
memtotal['ID']:=i;
memtotal['<27><><EFBFBD><EFBFBD>']:=1;
memtotal['<27><>']:=offyear;
memtotal['<27><>']:=offmonth;
memtotal['<27><>']:=DayOf(FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
memtotal['<27><><EFBFBD><EFBFBD>']:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime;
memtotal['ժҪ']:=fieldbyname('<27><>ע').asstring;
memtotal['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
if trim(fieldbyname('<27>ұ<EFBFBD>').AsString)='RMB' then
begin
if fieldbyname('<27><><EFBFBD>ʽ').asstring='<27>ֽ<EFBFBD>' then
begin
memtotal['<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>']:='<27>ֽ<EFBFBD>';
end else begin
memtotal['<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>']:=fieldbyname('<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>').asstring;
memtotal['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
end;
if fieldbyname('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
memtotal['<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtotal['RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end else begin
memtotal['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtotal['RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
end
else
begin
if fieldbyname('<27><><EFBFBD>ʽ').asstring='<27>ֽ<EFBFBD>' then
begin
memtotal['<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>']:='<27>ֽ<EFBFBD>';
end
else
begin
memtotal['<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>']:=fieldbyname('<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>').asstring;
memtotal['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
end;
if fieldbyname('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
memtotal['<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtotal['<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat*GetUsdExrate(FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime));
end
else
begin
memtotal['<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtotal['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat*GetUsdExrate(FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime));
end;
end;
memtotal.post;
end;
end
else
begin
memtotal.Append;
memtotal['ID']:=i;
memtotal['<27><><EFBFBD><EFBFBD>']:=1;
memtotal['<27><>']:=offyear;
memtotal['<27><>']:=offmonth;
memtotal['<27><>']:=DayOf(FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
memtotal['<27><><EFBFBD><EFBFBD>']:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime;
memtotal['ժҪ']:=fieldbyname('<27><>ע').asstring;
memtotal['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
memtotal['<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>']:=fieldbyname('<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>').asstring;
memtotal['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
if trim(fieldbyname('<27>ұ<EFBFBD>').AsString)='RMB' then
begin
if fieldbyname('<27><><EFBFBD><EFBFBD>').AsString='<27>շ<EFBFBD>' then
begin
memtotal['<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtotal['RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end
else
begin
memtotal['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtotal['RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
end
else
begin
if fieldbyname('<27><><EFBFBD><EFBFBD>').AsString='<27>շ<EFBFBD>' then begin
memtotal['<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtotal['<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat*GetUsdExrate(FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime));
end else begin
memtotal['<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtotal['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat*GetUsdExrate(FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime));
end;
end;
memtotal.post;
end;
Next;
end;
end;
if strtobool(get_parameters_value(142,'false')) then
begin
close;sql.clear;
sql.Add('select count(*) as rd from v_op_bscard where <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+strdate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+stredate+'''');
open;
ttlcount:=fieldbyname('rd').asinteger;
close;sql.clear;
sql.Add('select count(*) as rd from v_op_bscard where <20><><EFBFBD><EFBFBD>״̬=''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+strdate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+stredate+'''');
open;
hc:=fieldbyname('rd').asinteger;
if (strtoint(get_parameters_value(137,'0'))=1) then
begin
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><DABC>DZ<EFBFBD><C7B1>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳһ<CDB3><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
close;sql.clear;
sql.Add('select count(*) as rd from v_op_bscard where ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' and <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+strdate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+stredate+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+stredate+'''');
open;
if Recordset.RecordCount>0 then
begin
close;sql.clear;
sql.Add('update t_op_seae set <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> where ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' and <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+strdate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+stredate+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+stredate+'''');
ExecSQL;
close;sql.clear;
sql.Add('update t_op_seai set <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> where ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' and <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+strdate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+stredate+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+stredate+'''');
ExecSQL;
close;sql.clear;
sql.Add('update t_op_aire set <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>=һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> where ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' and <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+strdate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+stredate+''' and һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+stredate+'''');
ExecSQL;
close;sql.clear;
sql.Add('update t_op_airi set <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> where ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' and <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+strdate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+stredate+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+stredate+'''');
ExecSQL;
end;
end;
//<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>÷<EFBFBD><C3B7>ʵ<EFBFBD>ҵ<EFBFBD><D2B5>
close;sql.clear;
sql.Add('select count(*) as rd from v_op_bscard where <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+strdate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+stredate+'''');
open;
nc:=fieldbyname('rd').asinteger;
if nc<>0 then
begin
v_op_bscard.Close;
v_op_bscard.sql.clear;
v_op_bscard.sql.Add('select * from v_op_bscard where <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+strdate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+stredate+'''');
v_op_bscard.Open;
if MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '+inttostr(nc)+' Ʊҵ<C6B1><D2B5>û<EFBFBD>з<EFBFBD><D0B7>÷<EFBFBD><C3B7><EFBFBD>,<2C>Ƿ<EFBFBD><C7B7><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>һ<EFBFBD>ڼ<EFBFBD>',mtWarning,[mbyes,mbno],0)=mryes then
begin
Panel1.Visible:=true;
DateTimePicker1.date:=Logininfo.endday;
DateTimePicker1.date:=Incmonth(Logininfo.endday)+1;
DateTimePicker2.date:=Logininfo.endday;
DateTimePicker2.date:=Incmonth(Logininfo.endday)+1;
MemoMsg.Clear;
MemoMsg.Lines.Add('ע<>⣺');
MemoMsg.Lines.Add(' ת<>ʺ<EFBFBD><CABA><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>Ӧ<EFBFBD>ա<EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E3BDAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8><C4A3><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>Ҫת<D2AA>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɡ<EFBFBD><C9A1><EFBFBD>ť<EFBFBD><C5A5>');
MemoMsg.Font.Color:=clRed;
bbtnExcute.Caption:='<27><><EFBFBD>ɣ<EFBFBD>';
aStep:=1;
end
else
begin
v_op_bscard.Close;
v_op_bscard.sql.clear;
v_op_bscard.sql.Add('select * from v_op_bscard where <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+strdate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+stredate+'''');
v_op_bscard.Open;
MemoMsg.Clear;
MemoMsg.Lines.Add('ע<>⣺');
MemoMsg.Lines.Add(' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '+inttostr(nc)+' Ʊҵ<C6B1><D2B5>û<EFBFBD>з<EFBFBD><D0B7>÷<EFBFBD><C3B7>ʣ<EFBFBD>');
bbtnExcute.Enabled:=false;
MemoMsg.Font.Color:=clRed;
end;
end
else
begin
MemoMsg.Clear;
MemoMsg.Lines.Add('ע<>⣺');
MemoMsg.Lines.Add(' ת<>ʺ<EFBFBD><CABA><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>Ӧ<EFBFBD>ա<EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E3BDAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8><C4A3><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>Ҫת<D2AA>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɡ<EFBFBD><C9A1><EFBFBD>ť<EFBFBD><C5A5>');
MemoMsg.Font.Color:=clRed;
bbtnExcute.Caption:='<27><><EFBFBD>ɣ<EFBFBD>';
aStep:=1;
end;
end;
end;
1 : begin
bsSkinPanel1.Visible:=true;
bsSkinPanel1.Update;
bbtnExcute.Enabled:=false;
frm_main.db.BeginTrans;
//aYear<61><72>aMonth ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>ڼ<EFBFBD>
if strtobool(get_parameters_value(141,'false')) then
begin
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Close;SQL.Clear;
SQL.Add('Delete from t_ch_bank_genleg');
SQL.Add('where <20><>='+inttostr(offYear)+' and <20><>='+inttostr(offMonth));
ExecSQL;
Close;SQL.Clear;
SQL.Add('Delete from t_ch_cust_genleg');
SQL.Add('where <20><>='+inttostr(offYear)+' and <20><>='+inttostr(offMonth));
ExecSQL;
Close;SQL.Clear;
SQL.Add('Delete from t_ch_genleg');
SQL.Add('where <20><>='+inttostr(offYear)+' and <20><>='+inttostr(offMonth));
ExecSQL;
Close;SQL.Clear;
SQL.Add('Insert Into t_ch_bank_genleg');
SQL.Add('(<28><>,<2C><>,<2C><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',<2C>ۼƽ跽,<2C>ۼƴ<DBBC><C6B4><EFBFBD>,<2C>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>½跽,<2C><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',USD<53>ۼƽ跽,USD<53>ۼƴ<DBBC><C6B4><EFBFBD>,USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,USD<53><44><EFBFBD>½跽,USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',RMB<4D>ۼƽ跽,RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>,RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,RMB<4D><42><EFBFBD>½跽,RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)');
SQL.Add('Select '+IntToStr(OffYear)+','+IntToStr(OffMonth));
SQL.Add(',<2C><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',<2C>ۼƽ跽,<2C>ۼƴ<DBBC><C6B4><EFBFBD>,<2C>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add(',USD<53>ۼƽ跽,USD<53>ۼƴ<DBBC><C6B4><EFBFBD>,USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add(',RMB<4D>ۼƽ跽,RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>,RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add('from t_ch_bank_genleg');
SQL.Add('where <20><>='+aYear+' and <20><>='+aMonth);
ExecSQL;
Close;SQL.Clear;
SQL.Add('Insert Into t_ch_cust_genleg');
SQL.Add('(<28><>,<2C><>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',<2C>ۼƽ跽,<2C>ۼƴ<DBBC><C6B4><EFBFBD>,<2C>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>½跽,<2C><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',USD<53>ۼƽ跽,USD<53>ۼƴ<DBBC><C6B4><EFBFBD>,USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,USD<53><44><EFBFBD>½跽,USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',RMB<4D>ۼƽ跽,RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>,RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,RMB<4D><42><EFBFBD>½跽,RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)');
SQL.Add('Select '+IntToStr(OffYear)+','+IntToStr(OffMonth));
SQL.Add(',<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',<2C>ۼƽ跽,<2C>ۼƴ<DBBC><C6B4><EFBFBD>,<2C>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add(',USD<53>ۼƽ跽,USD<53>ۼƴ<DBBC><C6B4><EFBFBD>,USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add(',RMB<4D>ۼƽ跽,RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>,RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add('from t_ch_cust_genleg');
SQL.Add('where <20><>='+aYear+' and <20><>='+aMonth);
ExecSQL;
Close;SQL.Clear;
SQL.Add('Insert Into t_ch_genleg');
SQL.Add('(<28><>,<2C><>');
SQL.Add(',<2C>ۼƽ跽,<2C>ۼƴ<DBBC><C6B4><EFBFBD>,<2C>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>½跽,<2C><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',USD<53>ۼƽ跽,USD<53>ۼƴ<DBBC><C6B4><EFBFBD>,USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,USD<53><44><EFBFBD>½跽,USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',RMB<4D>ۼƽ跽,RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>,RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,RMB<4D><42><EFBFBD>½跽,RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)');
SQL.Add('Select '+IntToStr(OffYear)+','+IntToStr(OffMonth));
SQL.Add(',<2C>ۼƽ跽+<2B><><EFBFBD>½跽,<2C>ۼƴ<DBBC><C6B4><EFBFBD>,<2C>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add(',USD<53>ۼƽ跽,USD<53>ۼƴ<DBBC><C6B4><EFBFBD>,USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add(',RMB<4D>ۼƽ跽,RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>,RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add('from t_ch_genleg');
SQL.Add('where <20><>='+aYear+' and <20><>='+aMonth);
ExecSQL;
t_ch_bank_genleg.Close;
t_ch_bank_genleg.Parameters.ParamByName('<27><>').Value:=inttostr(offYear);
t_ch_bank_genleg.Parameters.ParamByName('<27><>').Value:=inttostr(offMonth);
t_ch_bank_genleg.open;
t_ch_cust_genleg.Close;
t_ch_cust_genleg.Parameters.ParamByName('<27><>').Value:=inttostr(offYear);
t_ch_cust_genleg.Parameters.ParamByName('<27><>').Value:=inttostr(offMonth);
t_ch_cust_genleg.open;
t_ch_genleg.Close;
t_ch_genleg.Parameters.ParamByName('<27><>').Value:=inttostr(offYear);
t_ch_genleg.Parameters.ParamByName('<27><>').Value:=inttostr(offMonth);
t_ch_genleg.open;
with memtotal do begin
First;
while not eof do begin
if t_ch_genleg.IsEmpty then
begin
t_ch_genleg.Insert;
t_ch_genleg.FieldByName('<27><>').AsString:=inttostr(offyear);
t_ch_genleg.FieldByName('<27><>').AsString:=inttostr(offmonth);
if memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_genleg.FieldByName('<27>ۼƽ跽').Asfloat:=memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('<27><><EFBFBD>½跽').Asfloat:=memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_genleg.FieldByName('<27>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('<27><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_genleg.FieldByName('USD<53>ۼƽ跽').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('USD<53><44><EFBFBD>½跽').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_genleg.FieldByName('USD<53>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_genleg.FieldByName('RMB<4D>ۼƽ跽').Asfloat:=memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD>½跽').Asfloat:=memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_genleg.FieldByName('RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
t_ch_genleg.post;
end else begin
t_ch_genleg.Edit;
if memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_genleg.FieldByName('<27>ۼƽ跽').Asfloat:=t_ch_genleg.FieldByName('<27>ۼƽ跽').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('<27><><EFBFBD>½跽').Asfloat:=t_ch_genleg.FieldByName('<27><><EFBFBD>½跽').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_genleg.FieldByName('<27>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('<27>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('<27><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('<27><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_genleg.FieldByName('USD<53>ۼƽ跽').Asfloat:=t_ch_genleg.FieldByName('USD<53>ۼƽ跽').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('USD<53><44><EFBFBD>½跽').Asfloat:=t_ch_genleg.FieldByName('USD<53><44><EFBFBD>½跽').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_genleg.FieldByName('USD<53>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('USD<53>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_genleg.FieldByName('RMB<4D>ۼƽ跽').Asfloat:=t_ch_genleg.FieldByName('RMB<4D>ۼƽ跽').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD>½跽').Asfloat:=t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD>½跽').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_genleg.FieldByName('RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
t_ch_genleg.post;
end;
if not t_ch_bank_genleg.Locate('<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>',memtotal.Fieldbyname('<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>').AsString,[]) then
begin
t_ch_bank_genleg.Insert;
t_ch_bank_genleg.FieldByName('<27><>').AsString:=inttostr(offyear);
t_ch_bank_genleg.FieldByName('<27><>').AsString:=inttostr(offmonth);
t_ch_bank_genleg.FieldByName('<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>').AsString:=memtotal.fieldbyname('<27><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>').AsString;
t_ch_bank_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
if memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_bank_genleg.FieldByName('<27>ۼƽ跽').Asfloat:=memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('<27><><EFBFBD>½跽').Asfloat:=memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_bank_genleg.FieldByName('<27>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('<27><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_bank_genleg.FieldByName('USD<53>ۼƽ跽').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD>½跽').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_bank_genleg.FieldByName('USD<53>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_bank_genleg.FieldByName('RMB<4D>ۼƽ跽').Asfloat:=memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD>½跽').Asfloat:=memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_bank_genleg.FieldByName('RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
t_ch_bank_genleg.post;
end else begin
t_ch_bank_genleg.Edit;
if memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_bank_genleg.FieldByName('<27>ۼƽ跽').Asfloat:=t_ch_bank_genleg.FieldByName('<27>ۼƽ跽').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('<27><><EFBFBD>½跽').Asfloat:=t_ch_bank_genleg.FieldByName('<27><><EFBFBD>½跽').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_bank_genleg.FieldByName('<27>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('<27>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('<27><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('<27><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_bank_genleg.FieldByName('USD<53>ۼƽ跽').Asfloat:=t_ch_bank_genleg.FieldByName('USD<53>ۼƽ跽').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD>½跽').Asfloat:=t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD>½跽').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_bank_genleg.FieldByName('USD<53>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('USD<53>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_bank_genleg.FieldByName('RMB<4D>ۼƽ跽').Asfloat:=t_ch_bank_genleg.FieldByName('RMB<4D>ۼƽ跽').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD>½跽').Asfloat:=t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD>½跽').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_bank_genleg.FieldByName('RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_bank_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
t_ch_bank_genleg.post;
end;
if not t_ch_cust_genleg.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',memtotal.Fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString,[]) then begin
t_ch_cust_genleg.Insert;
t_ch_cust_genleg.FieldByName('<27><>').AsString:=inttostr(offyear);
t_ch_cust_genleg.FieldByName('<27><>').AsString:=inttostr(offmonth);
t_ch_cust_genleg.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtotal.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
if memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_cust_genleg.FieldByName('<27>ۼƽ跽').Asfloat:=memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('<27><><EFBFBD>½跽').Asfloat:=memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_cust_genleg.FieldByName('<27>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('<27><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_cust_genleg.FieldByName('USD<53>ۼƽ跽').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD>½跽').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_cust_genleg.FieldByName('USD<53>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_cust_genleg.FieldByName('RMB<4D>ۼƽ跽').Asfloat:=memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD>½跽').Asfloat:=memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_cust_genleg.FieldByName('RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
t_ch_cust_genleg.post;
end else begin
t_ch_cust_genleg.Edit;
if memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_cust_genleg.FieldByName('<27>ۼƽ跽').Asfloat:=t_ch_cust_genleg.FieldByName('<27>ۼƽ跽').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('<27><><EFBFBD>½跽').Asfloat:=t_ch_cust_genleg.FieldByName('<27><><EFBFBD>½跽').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_cust_genleg.FieldByName('<27>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('<27>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('<27><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('<27><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_cust_genleg.FieldByName('USD<53>ۼƽ跽').Asfloat:=t_ch_cust_genleg.FieldByName('USD<53>ۼƽ跽').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD>½跽').Asfloat:=t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD>½跽').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>ҽ<D2BD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_cust_genleg.FieldByName('USD<53>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('USD<53>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat+memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_cust_genleg.FieldByName('RMB<4D>ۼƽ跽').Asfloat:=t_ch_cust_genleg.FieldByName('RMB<4D>ۼƽ跽').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD>½跽').Asfloat:=t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD>½跽').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><EFBFBD><E8B7BD><EFBFBD><EFBFBD>').AsFloat;
end;
if memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat<>0 then begin
t_ch_cust_genleg.FieldByName('RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('RMB<4D>ۼƽ跽').Asfloat+memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').Asfloat+memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat:=t_ch_cust_genleg.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asfloat-memtotal.fieldbyname('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
t_ch_cust_genleg.post;
end;
Next;
end;
end;
Close;SQL.Clear;
SQL.Add('Delete from t_ch_bank_genleg');
SQL.Add('where <20><>='+afYear+' and <20><>='+afMonth);
ExecSQL;
Close;SQL.Clear;
SQL.Add('Delete from t_ch_cust_genleg');
SQL.Add('where <20><>='+afYear+' and <20><>='+afMonth);
ExecSQL;
Close;SQL.Clear;
SQL.Add('Delete from t_ch_genleg');
SQL.Add('where <20><>='+afYear+' and <20><>='+afMonth);
ExecSQL;
Close;SQL.Clear;
SQL.Add('Insert Into t_ch_bank_genleg');
SQL.Add('(<28><>,<2C><>,<2C><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',<2C>ۼƽ跽,<2C>ۼƴ<DBBC><C6B4><EFBFBD>,<2C>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>½跽,<2C><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',USD<53>ۼƽ跽,USD<53>ۼƴ<DBBC><C6B4><EFBFBD>,USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,USD<53><44><EFBFBD>½跽,USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',RMB<4D>ۼƽ跽,RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>,RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,RMB<4D><42><EFBFBD>½跽,RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)');
SQL.Add('Select '+afYear+','+afMonth);
SQL.Add(',<2C><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',<2C>ۼƽ跽,<2C>ۼƴ<DBBC><C6B4><EFBFBD>,<2C>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add(',USD<53>ۼƽ跽,USD<53>ۼƴ<DBBC><C6B4><EFBFBD>,USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add(',RMB<4D>ۼƽ跽,RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>,RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add('from t_ch_bank_genleg');
SQL.Add('where <20><>='+IntToStr(OffYear)+' and <20><>='+IntToStr(OffMonth));
ExecSQL;
Close;SQL.Clear;
SQL.Add('Insert Into t_ch_cust_genleg');
SQL.Add('(<28><>,<2C><>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',<2C>ۼƽ跽,<2C>ۼƴ<DBBC><C6B4><EFBFBD>,<2C>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>½跽,<2C><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',USD<53>ۼƽ跽,USD<53>ۼƴ<DBBC><C6B4><EFBFBD>,USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,USD<53><44><EFBFBD>½跽,USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',RMB<4D>ۼƽ跽,RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>,RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,RMB<4D><42><EFBFBD>½跽,RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)');
SQL.Add('Select '+afYear+','+afMonth);
SQL.Add(',<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',<2C>ۼƽ跽,<2C>ۼƴ<DBBC><C6B4><EFBFBD>,<2C>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add(',USD<53>ۼƽ跽,USD<53>ۼƴ<DBBC><C6B4><EFBFBD>,USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add(',RMB<4D>ۼƽ跽,RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>,RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add('from t_ch_cust_genleg');
SQL.Add('where <20><>='+IntToStr(OffYear)+' and <20><>='+IntToStr(OffMonth));
ExecSQL;
Close;SQL.Clear;
SQL.Add('Insert Into t_ch_genleg');
SQL.Add('(<28><>,<2C><>');
SQL.Add(',<2C>ۼƽ跽,<2C>ۼƴ<DBBC><C6B4><EFBFBD>,<2C>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>½跽,<2C><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',USD<53>ۼƽ跽,USD<53>ۼƴ<DBBC><C6B4><EFBFBD>,USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,USD<53><44><EFBFBD>½跽,USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',RMB<4D>ۼƽ跽,RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>,RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,RMB<4D><42><EFBFBD>½跽,RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>,RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)');
SQL.Add('Select '+afYear+','+afMonth);
SQL.Add(',<2C>ۼƽ跽+<2B><><EFBFBD>½跽,<2C>ۼƴ<DBBC><C6B4><EFBFBD>,<2C>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add(',USD<53>ۼƽ跽,USD<53>ۼƴ<DBBC><C6B4><EFBFBD>,USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add(',RMB<4D>ۼƽ跽,RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>,RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>,0,0,0');
SQL.Add('from t_ch_genleg');
SQL.Add('where <20><>='+IntToStr(OffYear)+' and <20><>='+IntToStr(OffMonth));
ExecSQL;
end;
if strtobool(get_parameters_value(142,'false')) then
begin
//ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Close;SQL.Clear;
SQL.Add('Delete from t_ch_custbalance');
SQL.Add('where <20><>='+inttostr(offYear)+' and <20><>='+inttostr(offMonth));
ExecSQL;
Close;SQL.Clear;
SQL.Add('Insert Into t_ch_custbalance');
SQL.Add('(<28><>,<2C><>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD>Դ,<2C><>Դ<EFBFBD><D4B4>ϸ,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>');
SQL.Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD>USD');
SQL.Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD');
SQL.Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>');
SQL.Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>)');
SQL.Add('Select '+IntToStr(OffYear)+','+IntToStr(OffMonth));
SQL.Add(',<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD>Դ,<2C><>Դ<EFBFBD><D4B4>ϸ,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>');
SQL.Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>,0,0,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD,0');
SQL.Add(',0,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD>USD,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0,0,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,0,0,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD');
SQL.Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>,0,0,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>ϼ<EFBFBD>');
SQL.Add(',<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>,0,0,<2C><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>');
SQL.Add('from t_ch_custbalance');
SQL.Add('where <20><>='+aYear+' and <20><>='+aMonth);
ExecSQL;
AddtionMonthlyFeeData(IntToStr(OffYear), IntToStr(OffMonth), '', true, true);
end;
Close;SQL.Clear;
SQL.Add('Update Period Set Closed=''T''');
SQL.Add('where pyear='+inttostr(offYear)+' and pmonth='+inttostr(offMonth));
ExecSQL;
with memTblPeriod do begin
Locate('PMonth', OffMonth, []);
Edit;
FieldByName('Closed').AsString:='T';
Post;
end;
Logininfo.offyear:=StrToInt(afYear);
Logininfo.offmonth:=StrToInt(afmonth);
if strtoint(get_parameters_value(140,'0'))=0 then
Logininfo.endday:=EncodeDate(Logininfo.offyear, Logininfo.offmonth,1)-1
else begin
if Logininfo.offmonth=1 then begin
tYear:=Logininfo.offyear-1;
tmonth:=12;
end else begin
tYear:=Logininfo.offyear;
tmonth:=Logininfo.offmonth-1;
end;
Logininfo.endday:=EncodeDate(tyear,tmonth,strtoint(get_parameters_value(140,'0')));
end;
if frm_main.db.InTransaction then
frm_main.db.CommitTrans;
if ComboBoxYear.ItemIndex<>ComboBoxYear.Items.IndexOf(afYear) then begin
ComboBoxYear.ItemIndex:=ComboBoxYear.Items.IndexOf(afYear);
ComboBoxYearChange(ComboBoxYear);
end;
MessageDlg('<27><><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD>ɣ<EFBFBD>', mtWarning, [mbOk], 0);
end;
end;
finally
bsSkinPanel1.Visible:=false;
Close;
FreeAndNil(aQuery);
aQuery2.Close;
FreeAndNil(aQuery2);
if frm_main.db.InTransaction then
frm_main.db.RollbackTrans;
end;
end;
}
procedure TfrmAccCloseOff.t_ch_bank_genlegAfterInsert(DataSet: TDataSet);
begin
DataSet.FieldByName('<27>ۼƽ跽').AsFloat:=0;
DataSet.FieldByName('<27>ۼƴ<DBBC><C6B4><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('<27>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('<27><><EFBFBD>½跽').AsFloat:=0;
DataSet.FieldByName('<27><><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('USD<53>ۼƽ跽').AsFloat:=0;
DataSet.FieldByName('USD<53>ۼƴ<DBBC><C6B4><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('USD<53>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('USD<53><44><EFBFBD>½跽').AsFloat:=0;
DataSet.FieldByName('USD<53><44><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('USD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('RMB<4D>ۼƽ跽').AsFloat:=0;
DataSet.FieldByName('RMB<4D>ۼƴ<DBBC><C6B4><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('RMB<4D>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('RMB<4D><42><EFBFBD>½跽').AsFloat:=0;
DataSet.FieldByName('RMB<4D><42><EFBFBD>´<EFBFBD><C2B4><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=0;
end;
procedure TfrmAccCloseOff.UpdateAccDate(AccDate,toAccDate,SetAccDate:string);
var aAdoQuery:TAdoQuery;
begin
aAdoQuery:=CreateAdoQuery;
with aAdoQuery do
try
aAdoQuery.Close;
aAdoQuery.sql.clear;
aAdoQuery.sql.Add('update t_op_seae set <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>='''+SetAccDate+''' where <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+AccDate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+toAccDate+'''');
aAdoQuery.Execsql;
aAdoQuery.Close;
aAdoQuery.sql.clear;
aAdoQuery.sql.Add('update t_op_seai set <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>='''+SetAccDate+''' where <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+AccDate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+toAccDate+'''');
aAdoQuery.Execsql;
aAdoQuery.Close;
aAdoQuery.sql.clear;
aAdoQuery.sql.Add('update t_op_aire set <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>='''+SetAccDate+''' where <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+AccDate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+toAccDate+'''');
aAdoQuery.Execsql;
aAdoQuery.Close;
aAdoQuery.sql.clear;
aAdoQuery.sql.Add('update t_op_airi set <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>='''+SetAccDate+''' where <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>'''+AccDate+''' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><'''+toAccDate+'''');
aAdoQuery.Execsql;
finally
aAdoQuery.free;
end;
end;
procedure TfrmAccCloseOff.Button1Click(Sender: TObject);
begin
UpdateAccDate(FormatDateTime('YYYY-MM-DD',Logininfo.endday),FormatDateTime('YYYY-MM-DD',Incmonth(Logininfo.endday)+1),FormatdateTime('YYYY-MM-DD',DateTimePicker2.DateTime));
Panel1.Visible:=false;
end;
procedure TfrmAccCloseOff.Button2Click(Sender: TObject);
begin
Panel1.Visible:=false;
bbtnExcute.Enabled:=false;
end;
procedure TfrmAccCloseOff.DBGridLegBookDblClick(Sender: TObject);
begin
fee_view(v_op_bscard.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
end.