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.

1625 lines
81 KiB
Plaintext

This file contains ambiguous Unicode characters!

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

unit u_rp_no_selfno;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, ExtCtrls, ComCtrls, bsSkinTabs, DB, ADODB,DateUtils,
dxExEdtr, dxDBTLCl, dxGrClms, dxDBGrid, dxTL, dxDBCtrl, dxCntner,
kbmMemTable, kbmMemBinaryStreamFormat, Menus, StdCtrls,
wwdbdatetimepicker, Grids, DBGridEh;
type
Tfrm_rp_no_selfno = class(TForm)
Panel1: TPanel;
bsSkinPanel2: TbsSkinPanel;
bsSkinButton10: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
p_total_client1: TDataSource;
p_total_sales1: TDataSource;
SaveDialog: TSaveDialog;
bsSkinPageControl4: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
bsSkinTabSheet3: TbsSkinTabSheet;
dxDBGrid3: TdxDBGrid;
dxDBGrid3Column22: TdxDBGridColumn;
dxDBGridColumn59: TdxDBGridColumn;
dxDBGridColumn60: TdxDBGridColumn;
dxDBGridColumn61: TdxDBGridColumn;
dxDBGridColumn62: TdxDBGridColumn;
dxDBGridColumn63: TdxDBGridColumn;
dxDBGridColumn64: TdxDBGridColumn;
dxDBGridColumn65: TdxDBGridColumn;
dxDBGridColumn66: TdxDBGridColumn;
dxDBGridColumn67: TdxDBGridColumn;
dxDBGridColumn68: TdxDBGridColumn;
dxDBGridColumn69: TdxDBGridColumn;
dxDBGridColumn70: TdxDBGridColumn;
dxDBGridColumn71: TdxDBGridColumn;
dxDBGridColumn72: TdxDBGridColumn;
dxDBGridColumn73: TdxDBGridColumn;
dxDBGridColumn74: TdxDBGridColumn;
dxDBGridColumn75: TdxDBGridColumn;
dxDBGridColumn76: TdxDBGridColumn;
dxDBGridColumn77: TdxDBGridColumn;
dxDBGridColumn78: TdxDBGridColumn;
dxDBGridColumn79: TdxDBGridColumn;
p_accept_bill: TADOStoredProc;
p_accept_bill1: TDataSource;
kbmBinaryStreamFormat1: TkbmBinaryStreamFormat;
kbmThreadDataSet1: TkbmThreadDataSet;
memtblrpt_total: TkbmMemTable;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N1101: TMenuItem;
memtblrpt_total1: TDataSource;
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
memtblDetail: TkbmMemTable;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column5: TdxDBGridColumn;
dxDBGridMaskColumn95: TdxDBGridMaskColumn;
memtblField: TkbmMemTable;
memtblFieldFieldName: TStringField;
memtblFieldDisplayName: TStringField;
memtblFieldlength: TIntegerField;
memtblFieldFooterSum: TSmallintField;
bstab1: TbsSkinTabSheet;
bsSkinPanel1: TbsSkinPanel;
bsSkinPageControl1: TbsSkinPageControl;
tab1: TbsSkinTabSheet;
bsSkinTabSheet2: TbsSkinTabSheet;
tab3: TbsSkinTabSheet;
tab4: TbsSkinTabSheet;
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox3: TbsSkinCheckRadioBox;
dxDBGrid2: TdxDBGrid;
dxDBGridColumn18: TdxDBGridColumn;
dxDBGridColumn22: TdxDBGridColumn;
dxDBGrid4: TdxDBGrid;
dxDBGridColumn1: TdxDBGridColumn;
dxDBGridColumn2: TdxDBGridColumn;
dxDBGrid4Column3: TdxDBGridColumn;
dxDBGrid6: TdxDBGrid;
dxDBGridColumn3: TdxDBGridColumn;
dxDBGridColumn4: TdxDBGridColumn;
dxDBGridColumn5: TdxDBGridColumn;
dxDBGrid6Column4: TdxDBGridColumn;
dxDBGrid7: TdxDBGrid;
dxDBGridColumn6: TdxDBGridColumn;
dxDBGridMaskColumn2: TdxDBGridMaskColumn;
dxDBGridMaskColumn3: TdxDBGridMaskColumn;
dxDBGridColumn7: TdxDBGridColumn;
dxDBGridColumn8: TdxDBGridColumn;
dxDBGridMaskColumn4: TdxDBGridMaskColumn;
dxDBGridMaskColumn5: TdxDBGridMaskColumn;
dxDBGridMaskColumn6: TdxDBGridMaskColumn;
dxDBGridColumn9: TdxDBGridColumn;
dxDBGridColumn10: TdxDBGridColumn;
dxDBGridColumn11: TdxDBGridColumn;
dxDBGridColumn12: TdxDBGridColumn;
dxDBGridColumn13: TdxDBGridColumn;
dxDBGridColumn14: TdxDBGridColumn;
dxDBGridColumn15: TdxDBGridColumn;
dxDBGridColumn16: TdxDBGridColumn;
dxDBGridColumn17: TdxDBGridColumn;
dxDBGridColumn19: TdxDBGridColumn;
dxDBGridColumn20: TdxDBGridColumn;
dxDBGridColumn21: TdxDBGridColumn;
dxDBGridColumn23: TdxDBGridColumn;
dxDBGridColumn24: TdxDBGridColumn;
dxDBGridColumn25: TdxDBGridColumn;
dxDBGridDateColumn1: TdxDBGridDateColumn;
dxDBGridColumn26: TdxDBGridColumn;
dxDBGridMaskColumn7: TdxDBGridMaskColumn;
dxDBGridMaskColumn8: TdxDBGridMaskColumn;
dxDBGridMaskColumn9: TdxDBGridMaskColumn;
dxDBGridMaskColumn10: TdxDBGridMaskColumn;
dxDBGridMaskColumn11: TdxDBGridMaskColumn;
dxDBGridMaskColumn12: TdxDBGridMaskColumn;
dxDBGridDateColumn2: TdxDBGridDateColumn;
dxDBGridMaskColumn13: TdxDBGridMaskColumn;
dxDBGridMaskColumn14: TdxDBGridMaskColumn;
dxDBGridMaskColumn15: TdxDBGridMaskColumn;
dxDBGridMaskColumn16: TdxDBGridMaskColumn;
dxDBGridMaskColumn17: TdxDBGridMaskColumn;
dxDBGridColumn27: TdxDBGridColumn;
dxDBGridColumn28: TdxDBGridColumn;
dxDBGridMaskColumn18: TdxDBGridMaskColumn;
dxDBGridMaskColumn19: TdxDBGridMaskColumn;
dxDBGridMaskColumn20: TdxDBGridMaskColumn;
dxDBGridMaskColumn21: TdxDBGridMaskColumn;
dxDBGridMaskColumn22: TdxDBGridMaskColumn;
dxDBGridMaskColumn23: TdxDBGridMaskColumn;
dxDBGridMaskColumn24: TdxDBGridMaskColumn;
dxDBGridMaskColumn25: TdxDBGridMaskColumn;
dxDBGridMaskColumn26: TdxDBGridMaskColumn;
dxDBGridMaskColumn27: TdxDBGridMaskColumn;
dxDBGridMaskColumn28: TdxDBGridMaskColumn;
dxDBGridMaskColumn29: TdxDBGridMaskColumn;
dxDBGridMaskColumn30: TdxDBGridMaskColumn;
dxDBGridMaskColumn31: TdxDBGridMaskColumn;
dxDBGridMaskColumn32: TdxDBGridMaskColumn;
dxDBGridMaskColumn33: TdxDBGridMaskColumn;
dxDBGridMaskColumn34: TdxDBGridMaskColumn;
dxDBGridMaskColumn35: TdxDBGridMaskColumn;
dxDBGridMaskColumn36: TdxDBGridMaskColumn;
dxDBGridMaskColumn37: TdxDBGridMaskColumn;
dxDBGridColumn29: TdxDBGridColumn;
dxDBGridColumn30: TdxDBGridColumn;
dxDBGridColumn31: TdxDBGridColumn;
dxDBGridColumn32: TdxDBGridColumn;
mem_total_sales: TkbmMemTable;
mem_total_client: TkbmMemTable;
mem_total_dept: TkbmMemTable;
p_total_dept1: TDataSource;
p_total1: TDataSource;
mem_total_deptField: TStringField;
mem_total_deptField2: TFloatField;
mem_total_salesField: TStringField;
mem_total_salesField2: TStringField;
mem_total_salesField3: TFloatField;
mem_total_clientField: TStringField;
mem_total_clientField2: TStringField;
mem_total_clientField3: TFloatField;
mem_total_clientField4: TStringField;
mem_total_salesField4: TBooleanField;
mem_total_clientField5: TBooleanField;
mem_total_deptField3: TBooleanField;
dxDBGrid2Column3: TdxDBGridColumn;
dxDBGrid4Column4: TdxDBGridColumn;
dxDBGrid6Column5: TdxDBGridColumn;
mem_client: TkbmMemTable;
StringField1: TStringField;
StringField2: TStringField;
FloatField1: TFloatField;
mem_clientField: TFloatField;
dxDBGrid7Column64: TdxDBGridColumn;
mem_total_clientUSD: TFloatField;
mem_total_clientRMB: TFloatField;
mem_total_salesUSD: TFloatField;
mem_total_salesRMB: TFloatField;
dxDBGrid4Column5: TdxDBGridColumn;
dxDBGrid4Column6: TdxDBGridColumn;
dxDBGrid6Column6: TdxDBGridColumn;
dxDBGrid6Column7: TdxDBGridColumn;
mem_total_clientField6: TStringField;
dxDBGrid6Column8: TdxDBGridColumn;
dxDBGrid7Column65: TdxDBGridColumn;
memtblrpt_totalField: TStringField;
memtblrpt_totalField2: TStringField;
memtblrpt_totalField3: TStringField;
memtblrpt_totalField4: TIntegerField;
memtblrpt_totalField5: TIntegerField;
memtblrpt_totalField6: TStringField;
memtblrpt_totalField7: TStringField;
memtblrpt_totalField8: TStringField;
memtblrpt_totalField9: TDateTimeField;
memtblrpt_totalUSD: TFloatField;
memtblrpt_totalUSD2: TFloatField;
memtblrpt_totalUSD3: TFloatField;
memtblrpt_totalRMB: TFloatField;
memtblrpt_totalRMB2: TFloatField;
memtblrpt_totalRMB3: TFloatField;
memtblrpt_totalField11: TFloatField;
memtblrpt_totalField12: TFloatField;
memtblrpt_totalField13: TFloatField;
memtblrpt_totalField14: TFloatField;
memtblrpt_totalField15: TFloatField;
memtblrpt_totalField16: TFloatField;
memtblrpt_totalField17: TFloatField;
memtblrpt_totalUSD4: TFloatField;
memtblrpt_totalRMB4: TFloatField;
memtblrpt_totalField19: TIntegerField;
memtblrpt_totalField20: TStringField;
memtblrpt_totalField21: TStringField;
memtblrpt_totalField22: TStringField;
memtblrpt_totalField23: TStringField;
memtblrpt_totalField24: TStringField;
memtblrpt_totalField25: TStringField;
memtblrpt_totalField26: TStringField;
memtblrpt_totalField27: TStringField;
memtblrpt_totalField28: TStringField;
memtblrpt_totalField29: TIntegerField;
memtblrpt_totalField30: TStringField;
memtblrpt_totalField31: TFloatField;
memtblrpt_totalField32: TFloatField;
memtblrpt_totalField1: TIntegerField;
memtblrpt_totalField210: TIntegerField;
memtblrpt_totalField33: TIntegerField;
memtblrpt_totalField42: TIntegerField;
memtblrpt_totalField52: TIntegerField;
memtblrpt_totalField62: TIntegerField;
memtblrpt_totalField72: TIntegerField;
memtblrpt_totalField82: TIntegerField;
memtblrpt_totalField92: TIntegerField;
memtblrpt_totalField102: TIntegerField;
memtblrpt_totalField34: TIntegerField;
memtblrpt_totalTEU: TIntegerField;
memtblrpt_totalField35: TStringField;
memtblrpt_totalField36: TStringField;
memtblrpt_totalField37: TStringField;
memtblrpt_totalField38: TStringField;
memtblrpt_totalField39: TStringField;
memtblrpt_totalField40: TStringField;
memtblrpt_totalField41: TStringField;
memtblrpt_totalField43: TStringField;
memtblrpt_totalField44: TStringField;
memtblrpt_totalField45: TStringField;
memtblrpt_totalField46: TStringField;
memtblrpt_totalField47: TStringField;
memtblrpt_totalField48: TStringField;
memtblrpt_totalField50: TStringField;
memtblrpt_totalField49: TSmallintField;
memtblrpt_totalField10: TDateField;
memtblrpt_totalField18: TDateField;
bsSkinButton12: TbsSkinButton;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
mem_clientUSD: TFloatField;
mem_clientRMB: TFloatField;
mem_clientFloatField: TFloatField;
mem_clientFloatField2: TFloatField;
mem_clientmonth: TkbmMemTable;
StringField3: TStringField;
StringField4: TStringField;
FloatField2: TFloatField;
FloatField3: TFloatField;
FloatField4: TFloatField;
FloatField5: TFloatField;
FloatField6: TFloatField;
FloatField7: TFloatField;
mem_clientmonthStringField: TStringField;
mem_clientsum: TkbmMemTable;
StringField5: TStringField;
StringField6: TStringField;
FloatField8: TFloatField;
FloatField9: TFloatField;
FloatField10: TFloatField;
FloatField11: TFloatField;
FloatField12: TFloatField;
FloatField13: TFloatField;
memtblrpt_totalField51: TStringField;
memtblrpt_totalStringField: TStringField;
mem_sum: TkbmMemTable;
StringField7: TStringField;
StringField8: TStringField;
FloatField14: TFloatField;
FloatField15: TFloatField;
FloatField16: TFloatField;
FloatField17: TFloatField;
FloatField18: TFloatField;
FloatField19: TFloatField;
mem_clientField2: TStringField;
dxDBGrid7Column66: TdxDBGridColumn;
mem_clientsumField: TStringField;
memtblrpt_totalField53: TStringField;
dxDBGrid7Column67: TdxDBGridColumn;
memtblrpt_totalField54: TStringField;
memtblrpt_totalField55: TFloatField;
memtblrpt_totalField56: TFloatField;
mem_total_salesStringField: TStringField;
mem_total_salesFloatField: TFloatField;
mem_total_salesFloatField2: TFloatField;
mem_total_clientStringField: TStringField;
mem_total_clientFloatField: TFloatField;
mem_total_clientFloatField2: TFloatField;
mem_total_deptStringField: TStringField;
mem_total_deptFloatField: TFloatField;
mem_total_deptFloatField2: TFloatField;
dxDBGrid2Column4: TdxDBGridColumn;
dxDBGrid4Column7: TdxDBGridColumn;
dxDBGrid6Column9: TdxDBGridColumn;
bsSkinTabSheet5: TbsSkinTabSheet;
mem_clientmonth1: TDataSource;
dxDBGrid5: TdxDBGrid;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
dxDBGridColumn35: TdxDBGridColumn;
dxDBGridColumn39: TdxDBGridColumn;
dxDBGridColumn40: TdxDBGridColumn;
dxDBGridColumn41: TdxDBGridColumn;
dxDBGridColumn42: TdxDBGridColumn;
dxDBGridColumn43: TdxDBGridColumn;
dxDBGridColumn44: TdxDBGridColumn;
dxDBGridColumn45: TdxDBGridColumn;
dxDBGridColumn46: TdxDBGridColumn;
dxDBGridColumn47: TdxDBGridColumn;
dxDBGridColumn48: TdxDBGridColumn;
dxDBGridColumn49: TdxDBGridColumn;
dxDBGridColumn50: TdxDBGridColumn;
dxDBGridColumn51: TdxDBGridColumn;
mem_clientmonthUSD: TFloatField;
mem_clientmonthUSD2: TFloatField;
mem_clientmonthRMB: TFloatField;
mem_clientmonthRMB2: TFloatField;
mem_clientmonthFloatField: TFloatField;
mem_clientmonthFloatField2: TFloatField;
mem_clientmonthFloatField3: TFloatField;
mem_clientmonthFloatField4: TFloatField;
mem_clientmonthFloatField5: TFloatField;
mem_clientmonthFloatField6: TFloatField;
mem_clientmonthIntegerField: TIntegerField;
mem_clientmonthDateTimeField: TDateTimeField;
dxDBGrid5Column17: TdxDBGridColumn;
dxDBGrid5Column18: TdxDBGridColumn;
memtblrpt_totalField57: TDateField;
dxDBGrid7Column68: TdxDBGridColumn;
mem_clientmonthStringField2: TStringField;
dxDBGrid5Column19: TdxDBGridColumn;
PopupMenu3: TPopupMenu;
MenuItem1: TMenuItem;
MenuItem2: TMenuItem;
MenuItem3: TMenuItem;
MenuItem4: TMenuItem;
MenuItem5: TMenuItem;
MenuItem6: TMenuItem;
MenuItem7: TMenuItem;
mem_total_clientField7: TStringField;
memtblrpt_totalField58: TStringField;
dxDBGrid6Column10: TdxDBGridColumn;
dxDBGrid7Column69: TdxDBGridColumn;
bsSkinCheckRadioBox4: TbsSkinCheckRadioBox;
mem_total_clientField8: TStringField;
dxDBGrid6Column11: TdxDBGridColumn;
memtblrpt_totalField59: TStringField;
dxDBGrid7Column70: TdxDBGridColumn;
mem_clientmonthField: TStringField;
mem_clientmonthField2: TStringField;
dxDBGrid5Column20: TdxDBGridColumn;
dxDBGrid5Column21: TdxDBGridColumn;
mem_clientmonthField3: TStringField;
dxDBGrid5Column22: TdxDBGridColumn;
dxDBGrid5Column23: TdxDBGridColumn;
procedure bsSkinButton5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Panel1Resize(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure dxDBGrid5DblClick(Sender: TObject);
procedure dxDBGrid6DblClick(Sender: TObject);
procedure dxDBGrid7DblClick(Sender: TObject);
procedure dxDBGrid8DblClick(Sender: TObject);
procedure bsSkinButton15Click(Sender: TObject);
procedure bsSkinCheckRadioBox3Click(Sender: TObject);
procedure bsSkinCheckRadioBox2Click(Sender: TObject);
procedure bsSkinButton12Click(Sender: TObject);
procedure N10Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure dxDBGridColumn7CustomDraw(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn;
const AText: String; AFont: TFont; var AColor: TColor; ASelected,
AFocused: Boolean; var ADone: Boolean);
procedure MenuItem1Click(Sender: TObject);
procedure MenuItem3Click(Sender: TObject);
procedure MenuItem5Click(Sender: TObject);
procedure MenuItem7Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
procedure do_1(str_bill:widestring);
procedure GetNoFee;
procedure Creatememtbl;
function GetZhangQi(SaleID,Cust:String):String;
function isChaoQi(SaleID,Cust:String):Boolean;
function GetZhangQiNum(SaleID,Cust:String;aetd:TDateTime;out zqstr:string):Double;
function GetZhangQiStr(SaleID,Cust:String):String;
function GetBetwMonth(aBe, aEe: TDate): Integer;
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_no_selfno: Tfrm_rp_no_selfno;
FmDate,ToDate,zhangdate:String;
sqlstr:WideString;
implementation
uses u_main, u_rp_no_seae_query,my_sys_function, u_rp_total_query,
u_rp_no_total, u_sys_progress;
{$R *.dfm}
function Tfrm_rp_no_selfno.GetBetwMonth(aBe, aEe: TDate): Integer;
var
bYear,bMonth,bDate,eYear,eMonth,eDate:Word;
begin
DecodeDate(aBe,bYear,bMonth,bDate);
DecodeDate(aEe,eYear,eMonth,eDate);
if bYear=eYear then
Result:=Abs(bMonth-eMonth)
else begin
if bYear>eYear then begin
Result:=bMonth+(12-eMonth);
end else begin
Result:=eMonth+(12-bMonth);
end;
end;
end;
function Tfrm_rp_no_selfno.GetZhangQi(SaleID,Cust:String):String;
var
aQuery:TADOQuery;
S,sub:String;
begin
if (FmDate='') then begin
FmDate:='2006-01-01';
end;
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
// SQL.Add('Select * from t_crm_client_sales where ״̬=''<27><><EFBFBD><EFBFBD>'' and <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><='''+FmDate+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+ToDate+''' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Cust+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+SaleID+'''');
SQL.Add('Select * from t_crm_client_sales where ״̬=''<27><><EFBFBD><EFBFBD>'' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>'''+FmDate+''' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Cust+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+SaleID+'''');
Open;
if not IsEmpty then begin
first;
S:='';
while not eof do begin
// S:=S+'<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>:'+FormatDateTime('YYYY-MM-DD',FieldByName('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').AsDateTime)+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>' then begin
S:=S+'<27><><EFBFBD>½<EFBFBD><C2BD><EFBFBD>;';
end else if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then begin
S:=S+'Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,['+fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+']<5D><>';
end else if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Լ<><D4BC>ʱ<EFBFBD><CAB1>' then begin
if StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0)=0 then
sub:='<27><><EFBFBD><EFBFBD>'
else if StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0)=1 then
sub:='<27><>1<EFBFBD><31>'
else if StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0)=2 then
sub:='<27><>2<EFBFBD><32>'
else if StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0)=3 then
sub:='<27><>3<EFBFBD><33>'
else
sub:='<27><>'+inttostr(StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0))+'<27><>';
if FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString='<27>̶<EFBFBD>' then
S:=sub+FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'<27><>'
else
S:=sub;
end else if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='<27>ֽ׶θ<D7B6><CEB8><EFBFBD>' then begin
S:=S+'<27>ֽ׶θ<D7B6><CEB8><EFBFBD>;';
end;
Next;
end;
result:=S;
end else begin
Result:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_rp_no_selfno.do_1(str_bill:widestring);
begin
end;
procedure Tfrm_rp_no_selfno.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_no_selfno.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption+'1');
savereggrid(dxdbgrid7,caption+'7');
savereggrid(dxdbgrid5,caption+'5');
frm_rp_no_selfno.Hide;
frm_rp_no_selfno.ManualFloat(frm_rp_no_selfno.BoundsRect );
frm_main.freeTabs('frm_rp_no_selfno');
action:=cafree;
frm_rp_no_selfno:=nil;
end;
procedure Tfrm_rp_no_selfno.Panel1Resize(Sender: TObject);
var
i:integer;
begin
i:=round(bsSkinPanel2.Width/7);
bsSkinCheckRadioBox1.Width:=i;
bsSkinButton10.Width:=i;
bsSkinButton9.Width:=i;
bsSkinButton1.Width:=i;
end;
procedure Tfrm_rp_no_selfno.bsSkinButton10Click(Sender: TObject);
var
zdate:Tdate;
num:double;
j:integer;
zqstr:string;
Protocolrec:TProtocolrec;
function getstlDate(Cust,SaleID:String;aetdDate:TDatetime):TDateTime;
var
aQuery2:TADOQuery;
aYear,aMonth,aDay,bDay:word;
aStlDate:TDateTime;
begin
aQuery2:=CreateAdoQuery;
aStlDate:=aetdDate;
try
with aQuery2 do begin
Close;SQL.Clear;
SQL.Add('Select * from t_crm_client_sales where ״̬=''<27><><EFBFBD><EFBFBD>'' and <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><='''+FormatDateTime('YYYY-MM-DD',aStlDate)+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+FormatDateTime('YYYY-MM-DD',aStlDate)+''' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Cust+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+SaleID+'''');
Open;
if not IsEmpty then begin
if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>' then begin
Result:=aStlDate;
end else if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then begin
result:=aStlDate+fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger;
end else if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Լ<><D4BC>ʱ<EFBFBD><CAB1>' then begin
if FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString='<27>̶<EFBFBD>' then begin
DecodeDate(IncMonth(aStlDate,StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0)),aYear,aMonth,aDay);
bDay:=DaysInMonth(EncodeDate(aYear,aMonth,1));
if fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger>bDay then
result:=EncodeDate(aYear,aMonth,bDay)
else
if fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger>0 then
result:=EncodeDate(aYear,aMonth,fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger)
else
result:=EncodeDate(aYear,aMonth,1);
end else
result:=IncMonth(aStlDate,StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0));
end else if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='<27>ֽ׶θ<D7B6><CEB8><EFBFBD>' then begin
DecodeDate(IncMonth(aStlDate,StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0)),aYear,aMonth,aDay);
if aDay>fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger then begin
bDay:=DaysInMonth(EncodeDate(aYear,aMonth,1));
if fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2').AsInteger>bDay then
result:=EncodeDate(aYear,aMonth,bDay)
else
if fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2').AsInteger>0 then
result:=EncodeDate(aYear,aMonth,fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2').AsInteger)
else
result:=EncodeDate(aYear,aMonth,1)
end else begin
bDay:=DaysInMonth(EncodeDate(aYear,aMonth,1));
if fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger>bDay then
result:=EncodeDate(aYear,aMonth,bDay)
else
if fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger>0 then
result:=EncodeDate(aYear,aMonth,fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger)
else
result:=EncodeDate(aYear,aMonth,1);
end;
end else begin
Result:=aStlDate;
end;
end else begin
Result:=aStlDate;
end;
end;
finally
FreeAndNil(aQuery2);
end;
end;
begin
try
frm_rp_total_query:=tfrm_rp_total_query.Create (self);
rp_seae_query_num:=1;
if bsSkinCheckRadioBox1.Checked then
rp_seae_query_type:=1;
rp_seae_query_limited:='0033';
rp_seae_query_str:='ҵ<><D2B5><EFBFBD>ۺ<EFBFBD>Ƿ<EFBFBD><C7B7>';
frm_rp_total_query.ShowModal;
finally
frm_rp_total_query.Free;
end;
if not p_accept_bill.Active then Exit;
if p_accept_bill.IsEmpty then Exit;
zdate:=date;
{
if zhangdate='' then
zdate:=date
else
zdate:=StrToDateDef(zhangdate,date);
}
memtblrpt_total.DisableControls;
memtblrpt_total.LoadFromDataSet(p_accept_bill,[mtcpostructure,mtcpoProperties,mtcpoFieldIndex]);
p_accept_bill.Close;
{
memtblrpt_total.open;
p_accept_bill.First;
while not p_accept_bill.eof do begin
if (p_accept_bill.FieldByName('Ӧ<>պϼ<D5BA>').AsFloat=0.00) or p_accept_bill.FieldByName('Ӧ<>պϼ<D5BA>').IsNull then
else begin
memtblrpt_total.insert;
for j:=0 to p_accept_bill.FieldCount-1 do begin
if memtblrpt_total.FindField(p_accept_bill.Fields[j].FieldName)<>nil then begin
memtblrpt_total.FieldByName(p_accept_bill.Fields[j].FieldName).Value:=p_accept_bill.Fields[j].Value;
end;
end;
memtblrpt_total.post;
end;
p_accept_bill.next;
end;
}
memtblrpt_total.SortOn('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',[]);
memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').ReadOnly:=false;
memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').ReadOnly:=false;
memtblrpt_total.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').ReadOnly:=false;
memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').ReadOnly:=false;
memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB>ϼ<EFBFBD>').ReadOnly:=false;
memtblrpt_total.FieldByName('<27>·ݺϼ<DDBA>').ReadOnly:=false;
memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').ReadOnly:=false;
memtblrpt_total.First;
mem_client.Close;
mem_client.EmptyTable;
mem_client.Open;
mem_clientsum.Close;
mem_clientsum.EmptyTable;
mem_clientsum.Open;
mem_clientmonth.Close;
mem_clientmonth.EmptyTable;
mem_clientmonth.Open;
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(application);
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.MaxValue:=memtblrpt_total.RecordCount;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.Update;
memtblrpt_total.First;
while not memtblrpt_total.eof do begin
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
memtblrpt_total.Edit;
Protocolrec:=getProtocol(trim(memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring),trim(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsStRING),memtblrpt_total.FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
if (Protocolrec.protocolDate<>null) and (Protocolrec.protocolDate<>0) then
memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=Protocolrec.protocolDate
else
memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=memtblrpt_total.FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime;
memtblrpt_total.Post;
if memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime<=zDate then begin
memtblrpt_total.Edit;
memtblrpt_total.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=MonthsBetween(zdate,memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=DaysBetween(ZDate,memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDatetime);
memtblrpt_total.Post;
end else begin
if mem_client.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsStRING]),[]) then begin
if mem_client.FieldByName('<27><><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD>').AsFloat<=0 then begin
memtblrpt_total.Edit;
memtblrpt_total.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=0;
memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=0;
memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=0;
memtblrpt_total.Post;
end else if mem_client.FieldByName('<27><><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD>').AsFloat=-1 then begin
{
if memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime<=zdate then begin
memtblrpt_total.Edit;
memtblrpt_total.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
memtblrpt_total.Post;
end;
}
end else begin
if (mem_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat)>mem_client.FieldByName('<27><><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD>').AsFloat then begin
memtblrpt_total.Edit;
memtblrpt_total.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
memtblrpt_total.Post;
end else begin
mem_client.Edit;
mem_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=mem_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_client.FieldByName('δ<><CEB4>USD').AsFloat:=mem_client.FieldByName('δ<><CEB4>USD').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4>USD').AsFloat;
mem_client.FieldByName('δ<><CEB4>RMB').AsFloat:=mem_client.FieldByName('δ<><CEB4>RMB').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4>RMB').AsFloat;
mem_client.FieldByName('δ<>պϼ<D5BA>').AsFloat:=mem_client.FieldByName('δ<>պϼ<D5BA>').AsFloat+memtblrpt_total.FieldByName('δ<>պϼ<D5BA>').AsFloat;
mem_client.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=mem_client.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_client.Post;
end;
end;
end else begin
mem_client.Insert;
mem_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_client.FieldByName('δ<><CEB4>USD').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4>USD').AsFloat;
mem_client.FieldByName('δ<><CEB4>RMB').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4>RMB').AsFloat;
mem_client.FieldByName('δ<>պϼ<D5BA>').AsFloat:=memtblrpt_total.FieldByName('δ<>պϼ<D5BA>').AsFloat;
mem_client.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
num:=GetZhangQiNum(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString,memtblrpt_total.FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime,zqstr);
mem_client.FieldByName('<27><><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD>').AsFloat:=num;
mem_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=zqstr;
mem_client.Post;
if mem_client.FieldByName('<27><><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD>').AsFloat<=0 then begin
memtblrpt_total.Edit;
memtblrpt_total.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=0;
memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=0;
memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=0;
memtblrpt_total.Post;
end else
if mem_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat>mem_client.FieldByName('<27><><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD>').AsFloat then begin
memtblrpt_total.Edit;
memtblrpt_total.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
memtblrpt_total.Post;
end;
end;
end;
if mem_clientmonth.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B>·<EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsStRING]),[]) then begin
mem_clientmonth.Edit;
mem_clientmonth.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=mem_clientmonth.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_clientmonth.FieldByName('δ<><CEB4>USD').AsFloat:=mem_clientmonth.FieldByName('δ<><CEB4>USD').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4>USD').AsFloat;
mem_clientmonth.FieldByName('δ<><CEB4>RMB').AsFloat:=mem_clientmonth.FieldByName('δ<><CEB4>RMB').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4>RMB').AsFloat;
mem_clientmonth.FieldByName('δ<>պϼ<D5BA>').AsFloat:=mem_clientmonth.FieldByName('δ<>պϼ<D5BA>').AsFloat+memtblrpt_total.FieldByName('δ<>պϼ<D5BA>').AsFloat;
mem_clientmonth.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=mem_clientmonth.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_clientmonth.FieldByName('Ӧ<><D3A6>USD').AsFloat:=mem_clientmonth.FieldByName('Ӧ<><D3A6>USD').AsFloat+memtblrpt_total.FieldByName('Ӧ<><D3A6>USD').AsFloat;
mem_clientmonth.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat:=mem_clientmonth.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_clientmonth.FieldByName('Ӧ<><D3A6>RMB').AsFloat:=mem_clientmonth.FieldByName('Ӧ<><D3A6>RMB').AsFloat+memtblrpt_total.FieldByName('Ӧ<><D3A6>RMB').AsFloat;
mem_clientmonth.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat:=mem_clientmonth.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
mem_clientmonth.FieldByName('Ӧ<>պϼ<D5BA>').AsFloat:=mem_clientmonth.FieldByName('Ӧ<>պϼ<D5BA>').AsFloat+memtblrpt_total.FieldByName('Ӧ<>պϼ<D5BA>').AsFloat;
mem_clientmonth.FieldByName('<27><><EFBFBD>պϼ<D5BA>').AsFloat:=mem_clientmonth.FieldByName('<27><><EFBFBD>պϼ<D5BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD>պϼ<D5BA>').AsFloat;
mem_clientmonth.FieldByName('Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>').AsFloat:=mem_clientmonth.FieldByName('Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>').AsFloat+memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_clientmonth.FieldByName('<27>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>').AsFloat:=mem_clientmonth.FieldByName('<27>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>').AsFloat+memtblrpt_total.FieldByName('<27>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>').AsFloat;
if (Pos(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString, mem_clientmonth.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString)=0) then
mem_clientmonth.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString:=mem_clientmonth.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString+','+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString;
mem_clientmonth.Post;
end else begin
mem_clientmonth.Insert;
mem_clientmonth.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_clientmonth.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_clientmonth.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString:=memtblrpt_total.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString;
mem_clientmonth.FieldByName('<27><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>').AsString;
mem_clientmonth.FieldByName('<27>·<EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsString;
mem_clientmonth.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=GetZhangQi(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring);
mem_clientmonth.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_clientmonth.FieldByName('δ<><CEB4>USD').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4>USD').AsFloat;
mem_clientmonth.FieldByName('δ<><CEB4>RMB').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4>RMB').AsFloat;
mem_clientmonth.FieldByName('δ<>պϼ<D5BA>').AsFloat:=memtblrpt_total.FieldByName('δ<>պϼ<D5BA>').AsFloat;
mem_clientmonth.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_clientmonth.FieldByName('Ӧ<><D3A6>USD').AsFloat:=memtblrpt_total.FieldByName('Ӧ<><D3A6>USD').AsFloat;
mem_clientmonth.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_clientmonth.FieldByName('Ӧ<><D3A6>RMB').AsFloat:=memtblrpt_total.FieldByName('Ӧ<><D3A6>RMB').AsFloat;
mem_clientmonth.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
mem_clientmonth.FieldByName('Ӧ<>պϼ<D5BA>').AsFloat:=memtblrpt_total.FieldByName('Ӧ<>պϼ<D5BA>').AsFloat;
mem_clientmonth.FieldByName('<27><><EFBFBD>պϼ<D5BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD>պϼ<D5BA>').AsFloat;
mem_clientmonth.FieldByName('Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_clientmonth.FieldByName('<27>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>').AsFloat:=memtblrpt_total.FieldByName('<27>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>').AsFloat;
mem_clientmonth.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_clientmonth.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_clientmonth.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString;
mem_clientmonth.Post;
end;
if mem_clientsum.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring]),[]) then begin
mem_clientsum.Edit;
mem_clientsum.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=mem_clientsum.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_clientsum.FieldByName('δ<><CEB4>USD').AsFloat:=mem_clientsum.FieldByName('δ<><CEB4>USD').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4>USD').AsFloat;
mem_clientsum.FieldByName('δ<><CEB4>RMB').AsFloat:=mem_clientsum.FieldByName('δ<><CEB4>RMB').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4>RMB').AsFloat;
mem_clientsum.FieldByName('δ<>պϼ<D5BA>').AsFloat:=mem_clientsum.FieldByName('δ<>պϼ<D5BA>').AsFloat+memtblrpt_total.FieldByName('δ<>պϼ<D5BA>').AsFloat;
mem_clientsum.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=mem_clientsum.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_clientsum.Post;
end else begin
// num:=GetZhangQiNum(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString,memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime,zqstr);
mem_clientsum.Insert;
mem_clientsum.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_clientsum.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_clientsum.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=GetZhangQi(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring);
mem_clientsum.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_clientsum.FieldByName('δ<><CEB4>USD').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4>USD').AsFloat;
mem_clientsum.FieldByName('δ<><CEB4>RMB').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4>RMB').AsFloat;
mem_clientsum.FieldByName('δ<>պϼ<D5BA>').AsFloat:=memtblrpt_total.FieldByName('δ<>պϼ<D5BA>').AsFloat;
mem_clientsum.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_clientsum.Post;
end;
memtblrpt_total.Next;
end;
freeAndNil(frm_sys_progress);
GetNoFee;
mem_clientmonth.SortOn('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B>·<EFBFBD>',[]);
end;
procedure Tfrm_rp_no_selfno.bsSkinButton1Click(Sender: TObject);
begin
with SaveDialog do
begin
DefaultExt :='xls';
Filter := '(*.xls)|*.xls';
if Execute then
begin
if tab1.Showing then
dxDBGrid2.SaveToXLS(FileName,true)
else if bsSkinTabSheet2.Showing then
dxDBGrid4.SaveToXLS(FileName,true)
else if tab3.Showing then
dxDBGrid6.SaveToXLS(FileName,true)
else if tab4.Showing then
dxDBGrid7.SaveToXLS(FileName,true)
else if bsSkinTabSheet5.Showing then
dxDBGrid5.SaveToXLS(FileName,true);
end;
end;
end;
procedure Tfrm_rp_no_selfno.bsSkinButton9Click(Sender: TObject);
begin
sys_print('ҵ<><D2B5><EFBFBD>ۺ<EFBFBD>Ƿ<EFBFBD><C7B7>',2,nil,nil,nil,nil,p_total_dept1,p_total_sales1,p_total_client1,memtblrpt_total1,p_total1,nil,nil);
end;
procedure Tfrm_rp_no_selfno.dxDBGrid5DblClick(Sender: TObject);
begin
fee_view(p_accept_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfrm_rp_no_selfno.dxDBGrid6DblClick(Sender: TObject);
begin
// fee_view(p_accept_fee.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfrm_rp_no_selfno.dxDBGrid7DblClick(Sender: TObject);
begin
// fee_view(p_pay_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfrm_rp_no_selfno.dxDBGrid8DblClick(Sender: TObject);
begin
// fee_view(p_pay_fee.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfrm_rp_no_selfno.bsSkinButton15Click(Sender: TObject);
var
str_bill:widestring;
begin
str_bill:='';
if trim(str_bill)='' then
begin
str_bill:='where '+open_data('0033','v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա','v_op_bscard.<2E>ͷ<EFBFBD>Ա','no','no');
end
else
begin
str_bill:=str_bill+' and '+open_data('0033','v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա','v_op_bscard.<2E>ͷ<EFBFBD>Ա','no','no');
end;
if str_bill='' then
str_bill:='where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
else
str_bill:=str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ';
do_1(str_bill);
GetNoFee;
end;
procedure Tfrm_rp_no_selfno.GetNoFee;
var
aQuery,aQuery2:TAdoQuery;
sumbal:Double;
hvcg:Boolean;
aYear,aMonth,aDay,bDay:word;
sDate,S:string;
begin
aQuery:=CreateAdoQuery;
aQuery2:=CreateAdoQuery;
try
if memtblrpt_total.IsEmpty then exit;
Creatememtbl;
mem_total_sales.Close;
mem_total_sales.EmptyTable;
mem_total_sales.Open;
mem_total_client.Close;
mem_total_client.EmptyTable;
mem_total_client.Open;
mem_total_dept.Close;
mem_total_dept.EmptyTable;
mem_total_dept.Open;
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(application);
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.MaxValue:=memtblrpt_total.RecordCount;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.Update;
memtblrpt_total.First;
with memtblrpt_total do begin
while not eof do begin
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
edit;
memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=MonthsBetween(memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime,now);
if mem_clientmonth.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B>·<EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsStRING]),[]) then begin
memtblrpt_total.FieldByName('<27>·ݺϼ<DDBA>').asstring:=memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsStRING+' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
+' Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
+' δ<><CEB4>USD:'+ mem_clientmonth.FieldByName('δ<><CEB4>USD').asstring+' δ<><CEB4>RMB:'+ mem_clientmonth.FieldByName('δ<><CEB4>RMB').asstring
+' δ<>պϼ<D5BA>:'+ mem_clientmonth.FieldByName('δ<>պϼ<D5BA>').asstring+' δ<><CEB4><EFBFBD>ϼ<EFBFBD>:'+ mem_clientmonth.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').asstring;
end;
if mem_clientsum.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring]),[]) then begin
memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB>ϼ<EFBFBD>').asstring:=memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsStRING+' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
+' Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
+' δ<><CEB4>USD:'+ mem_clientsum.FieldByName('δ<><CEB4>USD').asstring+' δ<><CEB4>RMB:'+ mem_clientsum.FieldByName('δ<><CEB4>RMB').asstring
+' δ<>պϼ<D5BA>:'+ mem_clientsum.FieldByName('δ<>պϼ<D5BA>').asstring+' δ<><CEB4><EFBFBD>ϼ<EFBFBD>:'+ mem_clientsum.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').asstring;
memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring:=mem_clientsum.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
end;
post;
if bsSkinCheckRadioBox3.Checked then begin
if memtblrpt_total.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger=1 then begin
if mem_total_sales.Locate('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').asstring,memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsStRING,true]),[]) then begin
mem_total_sales.Edit;
mem_total_sales.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=mem_total_sales.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_sales.FieldByName('Ƿ<><C7B7>USD').AsFloat:=mem_total_sales.FieldByName('Ƿ<><C7B7>USD').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_total_sales.FieldByName('Ƿ<><C7B7>RMB').AsFloat:=mem_total_sales.FieldByName('Ƿ<><C7B7>RMB').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_sales.Post;
end else begin
mem_total_sales.Insert;
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_total_sales.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString;
mem_total_sales.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_sales.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').Asboolean:=true;
mem_total_sales.FieldByName('Ƿ<><C7B7>USD').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_total_sales.FieldByName('Ƿ<><C7B7>RMB').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_sales.Post;
end;
if mem_total_dept.Locate('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>;<3B>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').asstring,true]),[]) then begin
mem_total_dept.Edit;
mem_total_dept.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=mem_total_dept.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_dept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_dept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_dept.Post;
end else begin
mem_total_dept.Insert;
mem_total_dept.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString;
mem_total_dept.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_dept.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').Asboolean:=true;
mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_dept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_dept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_dept.Post;
end;
if mem_total_client.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsStRING,true]),[]) then begin
mem_total_client.Edit;
mem_total_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=mem_total_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_client.FieldByName('Ƿ<><C7B7>USD').AsFloat:=mem_total_client.FieldByName('Ƿ<><C7B7>USD').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_total_client.FieldByName('Ƿ<><C7B7>RMB').AsFloat:=mem_total_client.FieldByName('Ƿ<><C7B7>RMB').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
if (bsSkinCheckRadioBox4.Checked) then begin
S:=mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString;
if Pos(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>').AsString,S)=0 then
mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString:=mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString+','+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>').AsString;
end else begin
S:=mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString;
if Pos(memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsString,S)=0 then
mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString:=mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString+','+memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsString;
end;
mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_client.Post;
end else begin
mem_total_client.Insert;
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_total_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_total_client.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString:=memtblrpt_total.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString;
mem_total_client.FieldByName('<27><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>').AsString;
mem_total_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_client.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').Asboolean:=true;
if (bsSkinCheckRadioBox4.Checked) then begin
mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>').AsString;
end else
mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString:=memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsString;
mem_total_client.FieldByName('Ƿ<><C7B7>USD').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_total_client.FieldByName('Ƿ<><C7B7>RMB').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
mem_total_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=GetZhangQi(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring);
mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_client.Post;
end;
end else begin
if mem_total_sales.Locate('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').asstring,memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsStRING,false]),[]) then begin
mem_total_sales.Edit;
mem_total_sales.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=mem_total_sales.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_sales.FieldByName('Ƿ<><C7B7>USD').AsFloat:=mem_total_sales.FieldByName('Ƿ<><C7B7>USD').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_total_sales.FieldByName('Ƿ<><C7B7>RMB').AsFloat:=mem_total_sales.FieldByName('Ƿ<><C7B7>RMB').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_sales.Post;
end else begin
mem_total_sales.Insert;
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_total_sales.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString;
mem_total_sales.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_sales.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').Asboolean:=false;
mem_total_sales.FieldByName('Ƿ<><C7B7>USD').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_total_sales.FieldByName('Ƿ<><C7B7>RMB').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_sales.Post;
end;
if mem_total_dept.Locate('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>;<3B>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').asstring,false]),[]) then begin
mem_total_dept.Edit;
mem_total_dept.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=mem_total_dept.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_dept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_dept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_dept.Post;
end else begin
mem_total_dept.Insert;
mem_total_dept.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString;
mem_total_dept.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_dept.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').Asboolean:=false;
mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_dept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_dept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_dept.Post;
end;
if mem_total_client.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsStRING,false]),[]) then begin
mem_total_client.Edit;
mem_total_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=mem_total_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_client.FieldByName('Ƿ<><C7B7>USD').AsFloat:=mem_total_client.FieldByName('Ƿ<><C7B7>USD').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_total_client.FieldByName('Ƿ<><C7B7>RMB').AsFloat:=mem_total_client.FieldByName('Ƿ<><C7B7>RMB').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
if (bsSkinCheckRadioBox4.Checked) then begin
S:=mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString;
if Pos(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>').AsString,S)=0 then
mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString:=mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString+','+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>').AsString;
end else begin
S:=mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString;
if Pos(memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsString,S)=0 then
mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString:=mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString+','+memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsString;
end;
mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_client.Post;
end else begin
mem_total_client.Insert;
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_total_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_total_client.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString:=memtblrpt_total.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString;
mem_total_client.FieldByName('<27><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>').AsString;
mem_total_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_client.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').Asboolean:=false;
mem_total_client.FieldByName('Ƿ<><C7B7>USD').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_total_client.FieldByName('Ƿ<><C7B7>RMB').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
if (bsSkinCheckRadioBox4.Checked) then begin
mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>').AsString;
end else begin
mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString:=memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsString;
end;
mem_total_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=GetZhangQi(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring);
mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_client.Post;
end;
end;
end else begin
if mem_total_sales.Locate('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').asstring,memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsStRING]),[]) then begin
mem_total_sales.Edit;
mem_total_sales.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=mem_total_sales.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_sales.FieldByName('Ƿ<><C7B7>USD').AsFloat:=mem_total_sales.FieldByName('Ƿ<><C7B7>USD').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_total_sales.FieldByName('Ƿ<><C7B7>RMB').AsFloat:=mem_total_sales.FieldByName('Ƿ<><C7B7>RMB').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_sales.Post;
end else begin
mem_total_sales.Insert;
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_total_sales.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString;
mem_total_sales.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_sales.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').Asboolean:=false;
mem_total_sales.FieldByName('Ƿ<><C7B7>USD').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_total_sales.FieldByName('Ƿ<><C7B7>RMB').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_sales.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_sales.Post;
end;
if mem_total_dept.Locate('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').asstring]),[]) then begin
mem_total_dept.Edit;
mem_total_dept.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=mem_total_dept.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_dept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_dept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_dept.Post;
end else begin
mem_total_dept.Insert;
mem_total_dept.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString;
mem_total_dept.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_dept.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').Asboolean:=false;
mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_dept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_dept.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_dept.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_dept.Post;
end;
if mem_total_client.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsStRING]),[]) then begin
mem_total_client.Edit;
mem_total_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=mem_total_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_client.FieldByName('Ƿ<><C7B7>USD').AsFloat:=mem_total_client.FieldByName('Ƿ<><C7B7>USD').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_total_client.FieldByName('Ƿ<><C7B7>RMB').AsFloat:=mem_total_client.FieldByName('Ƿ<><C7B7>RMB').AsFloat+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
if (bsSkinCheckRadioBox4.Checked) then begin
S:=mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString;
if Pos(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>').AsString,S)=0 then
mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString:=mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString+','+memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>').AsString;
end else begin
S:=mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString;
if Pos(memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsString,S)=0 then
mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString:=mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString+','+memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsString;
end;
mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_client.Post;
end else begin
mem_total_client.Insert;
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_total_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
mem_total_client.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString:=memtblrpt_total.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString;
mem_total_client.FieldByName('<27><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>').AsString;
mem_total_client.FieldByName('Ƿ<>Ѻϼ<D1BA>').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat;
mem_total_client.FieldByName('Ƿ<><C7B7>USD').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>USD').AsFloat;
mem_total_client.FieldByName('Ƿ<><C7B7>RMB').AsFloat:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD>RMB').AsFloat;
mem_total_client.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').Asboolean:=false;
if (bsSkinCheckRadioBox4.Checked) then begin
mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>').AsString;
end else begin
mem_total_client.FieldByName('Ƿ<><C7B7>˵<EFBFBD><CBB5>').AsString:=memtblrpt_total.FieldByName('<27>·<EFBFBD>').AsString;
end;
mem_total_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=GetZhangQi(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring);
mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat:=mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat+memtblrpt_total.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat;
if (mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat=0) then
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'
else
mem_total_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatFloat('0.00;-0.00;0',(mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat-mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat)/mem_total_client.FieldByName('<27>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat*100)+'%';
mem_total_client.Post;
end;
end;
{
sDate:=FormatDateTime('YYYYMM',memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
if memtblDetail.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',VarArrayOf([memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsStRING]),[]) THEN begin
memtblDetail.edit;
memtblDetail.FieldByName(sDate+'USD').AsFloat:=memtblDetail.FieldByName(sDate+'USD').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'RMB').AsFloat:=memtblDetail.FieldByName(sDate+'RMB').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'<27>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'<27>ϼ<EFBFBD>').AsFloat+memtblrpt_total.FieldByName('δ<>պϼ<D5BA>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>USD').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>RMB').AsFloat+memtblrpt_total.FieldByName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>').AsFloat+memtblrpt_total.FieldByName('δ<>պϼ<D5BA>').AsFloat;
memtblDetail.Post;
end else begin
memtblDetail.Insert;
memtblDetail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblDetail.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString:=memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtblDetail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=GetZhangQi(memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,memtblrpt_total.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
memtblDetail.FieldByName(sDate+'USD').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'RMB').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'<27>ϼ<EFBFBD>').AsFloat:=memtblrpt_total.FieldByName('δ<>պϼ<D5BA>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>USD').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>RMB').AsFloat:=memtblrpt_total.FieldByName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>').AsFloat:=memtblrpt_total.FieldByName('δ<>պϼ<D5BA>').AsFloat;
memtblDetail.Post;
end;
}
next;
end;
end;
dxDBGrid2.FullExpand;
dxDBGrid4.FullExpand;
dxDBGrid6.FullExpand;
dxDBGrid7.FullExpand;
// memtblDetail.SortOn('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',[mtcoDescending]);
finally
freeAndNil(aQuery);
freeAndNil(aQuery2);
freeAndNil(frm_sys_progress);
memtblrpt_total.EnableControls;
end;
end;
procedure Tfrm_rp_no_selfno.Creatememtbl;
var
aDate,aToDate:TDate;
sDate,aYear,aMonth:String;
aColumn:TdxDBTreeListColumn;
aBand:TdxTreeListBand;
i:integer;
begin
if (fmDate='') or (ToDate='') then exit;
dxDBGrid1.Bands.Clear;
// dxDBGrid1.DestroyColumns;
while dxDBGrid1.columncount>0 do
begin
dxDBGrid1.Columns[0].Destroy;
end;
memtblDetail.Close;
memtblDetail.EmptyTable;
memtblDetail.Fields.Clear;
memtblDetail.FieldDefs.Clear;
memtblDetail.FieldDefs.Add('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>', ftString, 20, false);
memtblDetail.FieldDefs.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', ftString, 10, false);
memtblDetail.FieldDefs.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', ftString, 100, false);
aBand:=dxDBGrid1.Bands.Add;
aBand.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ';
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
aColumn.BandIndex:=0;
aColumn.FieldName:='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.BandIndex:=0;
aColumn.FieldName:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.FieldName:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.BandIndex:=0;
i:=1;
aDate:=strtodate(FmDate);
aToDate:=strtodate(ToDate);
while not (aDate>aToDate) do begin
sDate:=FormatDateTime('YYYYMM',aDate);
aYear:=FormatDateTime('YYYY',aDate);
aMonth:=FormatDateTime('MM',aDate);
aBand:=dxDBGrid1.Bands.Add;
aBand.Caption:=aYear+'<27><>'+aMonth+'<27><>';
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>USD';
aColumn.FieldName:=sDate+'USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>RMB';
aColumn.FieldName:=sDate+'RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<>պϼ<D5BA>';
aColumn.FieldName:=sDate+'<27>ϼ<EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add(sDate+'USD',ftFloat, 0, false);
memtblDetail.FieldDefs.Add(sDate+'RMB',ftFloat, 0, false);
memtblDetail.FieldDefs.Add(sDate+'<27>ϼ<EFBFBD>',ftFloat, 0, false);
aDate:=IncMonth(aDate,1);
Inc(i);
end;
aBand:=dxDBGrid1.Bands.Add;
aBand.Caption:='<27>ϼ<EFBFBD>';
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>USD';
aColumn.FieldName:='<27>ϼ<EFBFBD>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>RMB';
aColumn.FieldName:='<27>ϼ<EFBFBD>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<>պϼ<D5BA>';
aColumn.FieldName:='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>USD',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>RMB',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>',ftFloat, 0, false);
memtblDetail.CreateTable;
memtblDetail.Open;
end;
function Tfrm_rp_no_selfno.GetZhangQiNum(SaleID, Cust: String;
aetd: TDateTime;out zqstr:string): Double;
var
aQuery:TAdoQuery;
sub:string;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select * from t_crm_client_sales where ״̬=''<27><><EFBFBD><EFBFBD>'' and <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><='''+FormatDateTime('YYYY-MM-DD',aetd)+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+FormatDateTime('YYYY-MM-DD',aetd)+''' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Cust+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+SaleID+'''');
Open;
if not IsEmpty then begin
if FieldByName('<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>').IsNull or (FieldByName('<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>').AsFloat<=0) then begin
Result:=0;
end else begin
Result:=FieldByName('<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>').AsFloat;
end;
if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>' then begin
zqstr:=zqstr+'<27><><EFBFBD>½<EFBFBD><C2BD><EFBFBD>;';
end else if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then begin
zqstr:=zqstr+'Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,['+fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+']<5D><>';
end else if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Լ<><D4BC>ʱ<EFBFBD><CAB1>' then begin
if StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0)=0 then
sub:='<27><><EFBFBD><EFBFBD>'
else if StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0)=1 then
sub:='<27><>1<EFBFBD><31>'
else if StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0)=2 then
sub:='<27><>2<EFBFBD><32>'
else if StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0)=3 then
sub:='<27><>3<EFBFBD><33>'
else
sub:='<27><>'+inttostr(StrToIntDef(FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString,0))+'<27><>';
if FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString='<27>̶<EFBFBD>' then
zqstr:=sub+FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'<27><>'
else
zqstr:=sub;
end else if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='<27>ֽ׶θ<D7B6><CEB8><EFBFBD>' then begin
zqstr:=zqstr+'<27>ֽ׶θ<D7B6><CEB8><EFBFBD>;';
end;
end else begin
Result:=-1;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_rp_no_selfno.isChaoQi(SaleID, Cust: String): Boolean;
begin
end;
procedure Tfrm_rp_no_selfno.bsSkinCheckRadioBox3Click(Sender: TObject);
begin
GetNoFee;
end;
procedure Tfrm_rp_no_selfno.bsSkinCheckRadioBox2Click(Sender: TObject);
begin
GetNoFee;
end;
function Tfrm_rp_no_selfno.GetZhangQiStr(SaleID, Cust: String): String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
Result:='';
try
with aQuery do begin
Close;SQL.Clear;
sql.Add(' select distinct SUBSTRING(CONVERT(char(15), dbo.v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 111), 1, 7) from v_op_bscard left join t_ch_fee on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD> ');
sql.Add(sqlstr);
sql.Add(' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Cust+''' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+SaleID+'''');
Open;
if not IsEmpty then begin
first;
while not eof do begin
if Result='' then
result:=Fields[0].value
else
Result:=Result+','+Fields[0].value;
Next;
end;
Result:=Result+'<27><>Ƿ<EFBFBD><C7B7>'
end else
result:='';
end;
finally
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_rp_no_selfno.bsSkinButton12Click(Sender: TObject);
begin
if bsSkinButton12.Caption='չ<><D5B9>' then
begin
dxdbgrid2.FullExpand;
dxdbgrid4.FullExpand;
dxdbgrid6.FullExpand;
dxdbgrid7.FullExpand;
bsSkinButton12.Caption:='<27>ϲ<EFBFBD>';
end
else
begin
dxdbgrid2.FullCollapse;
dxdbgrid4.FullCollapse;
dxdbgrid6.FullCollapse;
dxdbgrid7.FullCollapse;
bsSkinButton12.Caption:='չ<><D5B9>';
end;
end;
procedure Tfrm_rp_no_selfno.N10Click(Sender: TObject);
begin
update_grid_view_no(dxDBGrid7);
exit;
end;
procedure Tfrm_rp_no_selfno.N14Click(Sender: TObject);
begin
update_grid_view_all(dxdbgrid7);
exit;
end;
procedure Tfrm_rp_no_selfno.N12Click(Sender: TObject);
begin
update_grid(dxdbgrid7,200);
exit;
end;
procedure Tfrm_rp_no_selfno.N16Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid7);
exit;
end;
procedure Tfrm_rp_no_selfno.dxDBGridColumn7CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
begin
if StrToFloatDef(ANode.strings[dxDBGridColumn7.Index],0)>0 then
AColor:=clRed
else AColor:=clWhite;
AFont.Color:=clblack;
end;
procedure Tfrm_rp_no_selfno.MenuItem1Click(Sender: TObject);
begin
update_grid_view_no(dxDBGrid5);
exit;
end;
procedure Tfrm_rp_no_selfno.MenuItem3Click(Sender: TObject);
begin
update_grid_view_all(dxdbgrid5);
exit;
end;
procedure Tfrm_rp_no_selfno.MenuItem5Click(Sender: TObject);
begin
update_grid(dxdbgrid5,201);
exit;
end;
procedure Tfrm_rp_no_selfno.MenuItem7Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid5);
exit;
end;
procedure Tfrm_rp_no_selfno.FormShow(Sender: TObject);
begin
loadreggrid(dxdbgrid1,false,caption+'1');
loadreggrid(dxdbgrid7,false,caption+'7');
loadreggrid(dxdbgrid5,false,caption+'5');
end;
end.