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.

2247 lines
116 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_zl_total2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxExEdtr, DB, ADODB, StdCtrls, wwdbdatetimepicker, bsSkinCtrls,
dxDBGrid, dxTL, dxDBCtrl, dxCntner, ComCtrls, bsSkinTabs, ExtCtrls, Menus,
dxDBTLCl, dxGrClms, RxLookup, kbmMemTable;
type
TRecordVar = Record
S1,S2,S3,S4 :String;
d1,d2,d3 :Double;
end;
Tfrm_rp_zl_total2 = class(TForm)
Panel1: TPanel;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
bsSkinPageControl2: TbsSkinPageControl;
bsSkinTabSheet3: TbsSkinTabSheet;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
dxDBGrid1Column4: TdxDBGridColumn;
dxDBGrid1Column5: TdxDBGridColumn;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
bsSkinTabSheet4: TbsSkinTabSheet;
bsSkinTabSheet2: TbsSkinTabSheet;
bsSkinPageControl3: TbsSkinPageControl;
bsSkinTabSheet5: TbsSkinTabSheet;
dxDBGrid3: TdxDBGrid;
dxDBGridMaskColumn2: TdxDBGridMaskColumn;
dxDBGridColumn8: TdxDBGridColumn;
dxDBGridColumn9: TdxDBGridColumn;
dxDBGridColumn10: TdxDBGridColumn;
dxDBGridColumn11: TdxDBGridColumn;
dxDBGridColumn12: TdxDBGridColumn;
dxDBGridColumn14: TdxDBGridColumn;
bsSkinTabSheet6: TbsSkinTabSheet;
bsSkinPanel2: TbsSkinPanel;
bsSkinButton10: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
bsSkinPanel1: TbsSkinPanel;
Label1: TLabel;
Label2: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
wwDBDateTimePicker2: TwwDBDateTimePicker;
p_accept_client: TADOStoredProc;
p_accept_client1: TDataSource;
p_accept_sales: TADOStoredProc;
p_accept_sales1: TDataSource;
p_pay_client: TADOStoredProc;
p_pay_client1: TDataSource;
p_pay_sales: TADOStoredProc;
p_pay_sales1: TDataSource;
PopupMenu2: TPopupMenu;
N16: TMenuItem;
SaveDialog: TSaveDialog;
dxDBGrid1Column9: TdxDBGridColumn;
dxDBGrid1Column10: TdxDBGridColumn;
dxDBGrid3Column9: TdxDBGridColumn;
tabs3: TbsSkinTabSheet;
tabs4: TbsSkinTabSheet;
p_accept_bill: TADOStoredProc;
p_accept_bill1: TDataSource;
p_pay_bill: TADOStoredProc;
p_pay_bill1: TDataSource;
dxDBGrid5: TdxDBGrid;
dxDBGridMaskColumn4: TdxDBGridMaskColumn;
dxDBGrid1Column54: TdxDBGridMaskColumn;
dxDBGrid1Column11: TdxDBGridMaskColumn;
dxDBGrid1Column13: TdxDBGridMaskColumn;
dxDBGrid1Column15: TdxDBGridMaskColumn;
dxDBGrid1USD: TdxDBGridColumn;
dxDBGridColumn22: TdxDBGridColumn;
dxDBGridColumn23: TdxDBGridColumn;
dxDBGrid1RMB: TdxDBGridColumn;
dxDBGridColumn24: TdxDBGridColumn;
dxDBGridColumn25: TdxDBGridColumn;
dxDBGridColumn26: TdxDBGridColumn;
dxDBGridColumn27: TdxDBGridColumn;
dxDBGridColumn28: TdxDBGridColumn;
dxDBGrid1Column12: TdxDBGridDateColumn;
dxDBGrid1Column63: TdxDBGridColumn;
dxDBGrid1Column14: TdxDBGridMaskColumn;
dxDBGrid1Column16: TdxDBGridMaskColumn;
dxDBGrid1Column21: TdxDBGridMaskColumn;
dxDBGrid1Column20: TdxDBGridMaskColumn;
dxDBGrid1Column22: TdxDBGridDateColumn;
dxDBGrid1Column23: TdxDBGridMaskColumn;
dxDBGrid1Column24: TdxDBGridMaskColumn;
dxDBGrid1Column26: TdxDBGridMaskColumn;
dxDBGrid1Column28: TdxDBGridColumn;
dxDBGrid1Column29: TdxDBGridColumn;
dxDBGrid11: TdxDBGridMaskColumn;
dxDBGrid12: TdxDBGridMaskColumn;
dxDBGrid13: TdxDBGridMaskColumn;
dxDBGrid14: TdxDBGridMaskColumn;
dxDBGrid15: TdxDBGridMaskColumn;
dxDBGrid16: TdxDBGridMaskColumn;
dxDBGrid17: TdxDBGridMaskColumn;
dxDBGrid18: TdxDBGridMaskColumn;
dxDBGrid19: TdxDBGridMaskColumn;
dxDBGrid110: TdxDBGridMaskColumn;
dxDBGrid1Column50: TdxDBGridMaskColumn;
dxDBGrid1TEU: TdxDBGridMaskColumn;
dxDBGrid1Column52: TdxDBGridMaskColumn;
dxDBGrid1Column53: TdxDBGridMaskColumn;
dxDBGrid1Column55: TdxDBGridMaskColumn;
dxDBGrid1Column56: TdxDBGridMaskColumn;
dxDBGrid1Column57: TdxDBGridMaskColumn;
dxDBGrid1Column58: TdxDBGridMaskColumn;
dxDBGrid1Column61: TdxDBGridColumn;
dxDBGrid1Column62: TdxDBGridColumn;
dxDBGrid6: TdxDBGrid;
dxDBGridMaskColumn5: TdxDBGridMaskColumn;
dxDBGridMaskColumn6: TdxDBGridMaskColumn;
dxDBGridMaskColumn7: TdxDBGridMaskColumn;
dxDBGridMaskColumn8: TdxDBGridMaskColumn;
dxDBGridMaskColumn9: TdxDBGridMaskColumn;
dxDBGridColumn29: TdxDBGridColumn;
dxDBGridColumn30: TdxDBGridColumn;
dxDBGridColumn31: TdxDBGridColumn;
dxDBGridColumn32: TdxDBGridColumn;
dxDBGridColumn33: TdxDBGridColumn;
dxDBGridColumn34: TdxDBGridColumn;
dxDBGridColumn35: TdxDBGridColumn;
dxDBGridColumn80: TdxDBGridColumn;
dxDBGridColumn81: TdxDBGridColumn;
dxDBGridDateColumn1: TdxDBGridDateColumn;
dxDBGridColumn82: TdxDBGridColumn;
dxDBGridMaskColumn10: TdxDBGridMaskColumn;
dxDBGridMaskColumn11: TdxDBGridMaskColumn;
dxDBGridMaskColumn12: TdxDBGridMaskColumn;
dxDBGridMaskColumn13: TdxDBGridMaskColumn;
dxDBGridMaskColumn14: TdxDBGridMaskColumn;
dxDBGridMaskColumn15: TdxDBGridMaskColumn;
dxDBGridDateColumn2: TdxDBGridDateColumn;
dxDBGridMaskColumn16: TdxDBGridMaskColumn;
dxDBGridMaskColumn17: TdxDBGridMaskColumn;
dxDBGridMaskColumn18: TdxDBGridMaskColumn;
dxDBGridMaskColumn19: TdxDBGridMaskColumn;
dxDBGridMaskColumn20: TdxDBGridMaskColumn;
dxDBGridColumn83: TdxDBGridColumn;
dxDBGridColumn84: TdxDBGridColumn;
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;
dxDBGridMaskColumn38: TdxDBGridMaskColumn;
dxDBGridMaskColumn39: TdxDBGridMaskColumn;
dxDBGridMaskColumn40: TdxDBGridMaskColumn;
dxDBGridColumn85: TdxDBGridColumn;
dxDBGridColumn86: TdxDBGridColumn;
dxDBGridColumn87: TdxDBGridColumn;
dxDBGridColumn88: TdxDBGridColumn;
bsSkinTbS3: TbsSkinTabSheet;
p_accept_cl: TADOStoredProc;
p_accept_cl1: TDataSource;
dxDBGrid1Column17: TdxDBGridColumn;
dxDBGrid1Column18: TdxDBGridColumn;
dxDBGrid1Column19: TdxDBGridColumn;
dxDBGrid1Column25: TdxDBGridColumn;
dxDBGrid1Column27: TdxDBGridColumn;
dxDBGrid1Column30: TdxDBGridColumn;
dxDBGrid1Column31: TdxDBGridColumn;
dxDBGrid1Column32: TdxDBGridColumn;
dxDBGrid1Column33: TdxDBGridColumn;
dxDBGrid1Column34: TdxDBGridColumn;
dxDBGrid1Column35: TdxDBGridColumn;
dxDBGrid1Column36: TdxDBGridColumn;
dxDBGrid1Column37: TdxDBGridColumn;
dxDBGrid1Column38: TdxDBGridColumn;
dxDBGrid1Column39: TdxDBGridColumn;
dxDBGrid1Column40: TdxDBGridColumn;
dxDBGrid2: TdxDBGrid;
dxDBGridColumn1: TdxDBGridColumn;
dxDBGridColumn2: TdxDBGridColumn;
dxDBGridColumn3: TdxDBGridColumn;
dxDBGridColumn4: TdxDBGridColumn;
dxDBGridColumn5: TdxDBGridColumn;
dxDBGridColumn6: TdxDBGridColumn;
dxDBGridColumn7: TdxDBGridColumn;
dxDBGridColumn36: TdxDBGridColumn;
dxDBGridColumn45: TdxDBGridColumn;
dxDBGridColumn46: TdxDBGridColumn;
dxDBGridColumn47: TdxDBGridColumn;
dxDBGridColumn48: TdxDBGridColumn;
dxDBGridColumn49: TdxDBGridColumn;
dxDBGridColumn50: TdxDBGridColumn;
dxDBGridColumn51: TdxDBGridColumn;
dxDBGridColumn52: TdxDBGridColumn;
dxDBGridColumn53: TdxDBGridColumn;
dxDBGridColumn54: TdxDBGridColumn;
dxDBGridColumn55: TdxDBGridColumn;
dxDBGridColumn56: TdxDBGridColumn;
dxDBGridColumn57: TdxDBGridColumn;
dxDBGridColumn58: TdxDBGridColumn;
dxDBGridColumn59: TdxDBGridColumn;
dxDBGridColumn60: TdxDBGridColumn;
dxDBGridColumn61: TdxDBGridColumn;
dxDBGrid7: TdxDBGrid;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
dxDBGridColumn38: TdxDBGridColumn;
dxDBGridColumn39: TdxDBGridColumn;
dxDBGridColumn40: TdxDBGridColumn;
dxDBGridColumn41: TdxDBGridColumn;
dxDBGridColumn42: TdxDBGridColumn;
dxDBGridColumn43: TdxDBGridColumn;
dxDBGridColumn44: 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;
dxDBGrid3Column10: TdxDBGridColumn;
dxDBGrid3Column11: TdxDBGridColumn;
dxDBGrid3Column12: TdxDBGridColumn;
dxDBGrid3Column13: TdxDBGridColumn;
dxDBGrid3Column14: TdxDBGridColumn;
dxDBGrid3Column15: TdxDBGridColumn;
dxDBGrid3Column16: TdxDBGridColumn;
dxDBGrid3Column17: TdxDBGridColumn;
dxDBGrid3Column18: TdxDBGridColumn;
dxDBGrid3Column19: TdxDBGridColumn;
dxDBGrid3Column20: TdxDBGridColumn;
dxDBGrid3Column21: TdxDBGridColumn;
dxDBGrid3Column24: TdxDBGridColumn;
dxDBGrid3Column25: TdxDBGridColumn;
dxDBGrid7Column26: TdxDBGridColumn;
dxDBGrid7Column27: TdxDBGridColumn;
dxDBGrid7Column28: TdxDBGridColumn;
dxDBGrid1Column41: TdxDBGridColumn;
dxDBGrid1Column42: TdxDBGridColumn;
dxDBGrid1Column43: TdxDBGridColumn;
dxDBGrid2Column26: TdxDBGridColumn;
dxDBGrid2Column27: TdxDBGridColumn;
dxDBGrid2Column28: TdxDBGridColumn;
dxDBGrid4: TdxDBGrid;
dxDBGridMaskColumn3: TdxDBGridMaskColumn;
dxDBGridColumn15: TdxDBGridColumn;
dxDBGridColumn16: TdxDBGridColumn;
dxDBGridColumn17: TdxDBGridColumn;
dxDBGridColumn18: TdxDBGridColumn;
dxDBGridColumn19: TdxDBGridColumn;
dxDBGridColumn20: TdxDBGridColumn;
dxDBGridColumn21: TdxDBGridColumn;
dxDBGridColumn37: TdxDBGridColumn;
dxDBGridColumn79: TdxDBGridColumn;
dxDBGridColumn89: TdxDBGridColumn;
dxDBGridColumn90: TdxDBGridColumn;
dxDBGridColumn91: TdxDBGridColumn;
dxDBGridColumn92: TdxDBGridColumn;
dxDBGridColumn93: TdxDBGridColumn;
dxDBGridColumn94: TdxDBGridColumn;
dxDBGridColumn95: TdxDBGridColumn;
dxDBGridColumn96: TdxDBGridColumn;
dxDBGridColumn97: TdxDBGridColumn;
dxDBGridColumn98: TdxDBGridColumn;
dxDBGridColumn99: TdxDBGridColumn;
dxDBGridColumn100: TdxDBGridColumn;
dxDBGridColumn101: TdxDBGridColumn;
dxDBGridColumn102: TdxDBGridColumn;
dxDBGridColumn103: TdxDBGridColumn;
dxDBGridColumn104: TdxDBGridColumn;
dxDBGridColumn105: TdxDBGridColumn;
dxDBGridColumn106: TdxDBGridColumn;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
t_sys_zlset: TADOQuery;
dsrcustomstatu: TDataSource;
bsskintabsheetys: TbsSkinTabSheet;
dxDBGrid8: TdxDBGrid;
dxDBGridMaskColumn41: TdxDBGridMaskColumn;
dxDBGrid8Column2: TdxDBGridColumn;
dxDBGrid8Column3: TdxDBGridColumn;
p_settling_D: TADOStoredProc;
p_settling_D1: TDataSource;
p_settling_C: TADOStoredProc;
p_settling_C1: TDataSource;
bsskintabsheetyf: TbsSkinTabSheet;
dxDBGrid9: TdxDBGrid;
dxDBGridMaskColumn42: TdxDBGridMaskColumn;
dxDBGridColumn107: TdxDBGridColumn;
dxDBGridColumn108: TdxDBGridColumn;
bsSkinTabSheet7: TbsSkinTabSheet;
p_settling_D_detail: TADOStoredProc;
p_settling_D_detail1: TDataSource;
p_settling_C_Detail: TADOStoredProc;
p_settling_C_Detail1: TDataSource;
dxDBGrid10: TdxDBGrid;
dxDBGridMaskColumn43: TdxDBGridMaskColumn;
dxDBGridMaskColumn46: TdxDBGridMaskColumn;
dxDBGridColumn111: TdxDBGridColumn;
dxDBGridColumn114: TdxDBGridColumn;
bsSkinTabSheet8: TbsSkinTabSheet;
dxDBGrid20: TdxDBGrid;
dxDBGridMaskColumn44: TdxDBGridMaskColumn;
dxDBGridMaskColumn45: TdxDBGridMaskColumn;
dxDBGridColumn109: TdxDBGridColumn;
dxDBGridColumn110: TdxDBGridColumn;
kbmcl: TkbmMemTable;
kbmclField: TStringField;
kbmclField2: TStringField;
kbmclUSD: TFloatField;
kbmclRMB: TFloatField;
kbmclField3: TFloatField;
kbmclUSD2: TFloatField;
kbmclRMB2: TFloatField;
kbmclField4: TFloatField;
kbmclUSD3: TFloatField;
kbmclRMB3: TFloatField;
kbmclField5: TFloatField;
kbmclUSD4: TFloatField;
kbmclRMB4: TFloatField;
kbmclField6: TFloatField;
kbmclUSD5: TFloatField;
kbmclRMB5: TFloatField;
kbmclField7: TFloatField;
kbmclUSD6: TFloatField;
kbmclRMB6: TFloatField;
kbmclField8: TFloatField;
kbmclUSD7: TFloatField;
kbmclRMB7: TFloatField;
kbmclField9: TFloatField;
kbmclUSD8: TFloatField;
kbmclRMB8: TFloatField;
kbmclField10: TFloatField;
kbmclUSD9: TFloatField;
kbmclRMB9: TFloatField;
kbmclField11: TFloatField;
ADOQuery1: TADOQuery;
dxDBGrid7Column29: TdxDBGridColumn;
kbmclField12: TStringField;
dxDBGrid7Column30: TdxDBGridColumn;
dxDBGrid1Column44: TdxDBGridColumn;
dxDBGrid1Column45: TdxDBGridColumn;
dxDBGrid3Column29: TdxDBGridColumn;
dxDBGrid10Column5: TdxDBGridColumn;
dxDBGrid20Column5: TdxDBGridColumn;
kbmclField13: TStringField;
dxDBGrid7Column31: TdxDBGridColumn;
bsSkinCheckRadioBox4: TbsSkinCheckRadioBox;
dxDBGrid8Column4: TdxDBGridColumn;
dxDBGrid9Column4: TdxDBGridColumn;
dxDBGrid10Column6: TdxDBGridColumn;
dxDBGrid20Column6: TdxDBGridColumn;
kbmCrm_OP: TkbmMemTable;
StringField1: TStringField;
StringField2: TStringField;
StringField3: TStringField;
StringField4: TStringField;
FloatField1: TFloatField;
FloatField2: TFloatField;
FloatField3: TFloatField;
FloatField4: TFloatField;
FloatField5: TFloatField;
FloatField6: TFloatField;
FloatField7: TFloatField;
FloatField8: TFloatField;
FloatField9: TFloatField;
FloatField10: TFloatField;
FloatField11: TFloatField;
FloatField12: TFloatField;
FloatField13: TFloatField;
FloatField14: TFloatField;
FloatField15: TFloatField;
FloatField16: TFloatField;
FloatField17: TFloatField;
FloatField18: TFloatField;
FloatField19: TFloatField;
FloatField20: TFloatField;
FloatField21: TFloatField;
FloatField22: TFloatField;
FloatField23: TFloatField;
FloatField24: TFloatField;
FloatField25: TFloatField;
FloatField26: TFloatField;
FloatField27: TFloatField;
kbmCrm_OPField: TStringField;
kbmCrm_OPField2: TStringField;
kbmCrm_OPORDNO: TIntegerField;
kbmCrm_OPField3: TStringField;
dxDBGrid1Column46: TdxDBGridColumn;
dxDBGrid1Column47: TdxDBGridColumn;
bsSkinCheckRadioBox3: TbsSkinCheckRadioBox;
wwDBDateTimePicker3: TwwDBDateTimePicker;
kbmclRMB10: TFloatField;
kbmclUSD10: TFloatField;
dxDBGrid7Column32: TdxDBGridColumn;
dxDBGrid7Column33: TdxDBGridColumn;
kbmCrm_OPRMB: TFloatField;
kbmCrm_OPUSD: TFloatField;
dxDBGrid1Column49: TdxDBGridColumn;
kbmCrm_OPField4: TFloatField;
kbmclField14: TFloatField;
bsSkinPanel3: TbsSkinPanel;
Label40: TLabel;
RxDBLookupCombo15: TRxDBLookupCombo;
RxDBLookupCombo16: TRxDBLookupCombo;
Label41: TLabel;
Label44: TLabel;
RxDBLookupCombo17: TRxDBLookupCombo;
kbmCrm_OPField5: TStringField;
dxDBGrid1Column51: TdxDBGridColumn;
kbmclField15: TStringField;
dxDBGrid7Column34: TdxDBGridColumn;
dxDBGrid3Column26: TdxDBGridColumn;
dxDBGrid10Column7: TdxDBGridColumn;
dxDBGrid20Column7: TdxDBGridColumn;
kbmclField16: TStringField;
kbmclField17: TStringField;
dxDBGrid7Column35: TdxDBGridColumn;
dxDBGrid7Column36: TdxDBGridColumn;
Button1: TButton;
kbmCrm_OPField6: TStringField;
kbmCrm_OPField7: TStringField;
dxDBGrid1Column59: TdxDBGridColumn;
dxDBGrid1Column60: TdxDBGridColumn;
dxDBGrid1Column48: TdxDBGridColumn;
p_accept_sum: TADOStoredProc;
p_accept_sum1: TDataSource;
memQuery: TkbmMemTable;
StringField5: TStringField;
StringField6: TStringField;
StringField7: TStringField;
memQuery1: TDataSource;
memQueryField: TStringField;
memQueryField2: TStringField;
dxDBGrid1Column64: TdxDBGridColumn;
kbmCrm_OPField8: TStringField;
bsSkinTabSheet10: TbsSkinTabSheet;
dxDBGrid21: TdxDBGrid;
dxDBGridMaskColumn47: TdxDBGridMaskColumn;
dxDBGridColumn13: TdxDBGridColumn;
dxDBGridColumn112: TdxDBGridColumn;
dxDBGridColumn113: TdxDBGridColumn;
dxDBGridColumn115: TdxDBGridColumn;
dxDBGridColumn116: TdxDBGridColumn;
dxDBGridColumn117: TdxDBGridColumn;
dxDBGridColumn118: TdxDBGridColumn;
dxDBGridColumn119: TdxDBGridColumn;
dxDBGridColumn120: TdxDBGridColumn;
dxDBGridColumn121: TdxDBGridColumn;
dxDBGridColumn122: TdxDBGridColumn;
dxDBGridColumn123: TdxDBGridColumn;
dxDBGridColumn124: TdxDBGridColumn;
dxDBGridColumn125: TdxDBGridColumn;
dxDBGridColumn126: TdxDBGridColumn;
dxDBGridColumn127: TdxDBGridColumn;
dxDBGridColumn128: TdxDBGridColumn;
dxDBGridColumn129: TdxDBGridColumn;
dxDBGridColumn130: TdxDBGridColumn;
dxDBGridColumn131: TdxDBGridColumn;
dxDBGridColumn132: TdxDBGridColumn;
dxDBGridColumn133: TdxDBGridColumn;
dxDBGridColumn134: TdxDBGridColumn;
dxDBGrid3Column27: TdxDBGridColumn;
p_pay_clientzl: TkbmMemTable;
StringField8: TStringField;
StringField9: TStringField;
StringField10: TStringField;
FloatField28: TFloatField;
FloatField29: TFloatField;
FloatField30: TFloatField;
FloatField31: TFloatField;
FloatField32: TFloatField;
FloatField33: TFloatField;
FloatField34: TFloatField;
FloatField35: TFloatField;
FloatField36: TFloatField;
FloatField37: TFloatField;
FloatField38: TFloatField;
FloatField39: TFloatField;
FloatField40: TFloatField;
FloatField41: TFloatField;
FloatField42: TFloatField;
FloatField43: TFloatField;
FloatField44: TFloatField;
FloatField45: TFloatField;
FloatField46: TFloatField;
FloatField47: TFloatField;
FloatField52: TFloatField;
FloatField53: TFloatField;
FloatField54: TFloatField;
StringField12: TStringField;
ADOQuery2: TADOQuery;
procedure bsSkinButton5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinPanel2Resize(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure dxDBGrid2ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure dxDBGrid3ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure dxDBGrid4ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure FormShow(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure dxDBGrid1DblClick(Sender: TObject);
procedure dxDBGrid2DblClick(Sender: TObject);
procedure dxDBGrid3DblClick(Sender: TObject);
procedure dxDBGrid4DblClick(Sender: TObject);
procedure dxDBGrid7DblClick(Sender: TObject);
procedure p_accept_clientAfterOpen(DataSet: TDataSet);
procedure p_accept_clAfterOpen(DataSet: TDataSet);
procedure dxDBGrid1Column37GetText(Sender: TObject;
ANode: TdxTreeListNode; var AText: String);
procedure N1Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
str_accept,str_pay:widestring;
zl1,zl2,zl3,zl4,zl5,zl6,zl7:string;
{ Private declarations }
public
{ Public declarations }
function getzq(cust: string;etdate:string): TRecordVar;
end;
var
frm_rp_zl_total2: Tfrm_rp_zl_total2;
implementation
uses u_main, my_sys_function, u_data_share;
{$R *.dfm}
function Tfrm_rp_zl_total2.getzq(cust: string;etdate:string): TRecordVar;
var
aQuery:TAdoQuery;
str:string;
begin
result.s1:='';
result.s2:='';
aQuery:=CreateAdoQuery;
try
with aQuery do
begin
close;sql.Clear;
sql.Add('select <20><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>');
sql.Add(',Case <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add('when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then <20><><EFBFBD><EFBFBD>ģʽ*30');
sql.Add('when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add('when ''<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>'' then 0');
sql.Add('end <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add(',Case <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add('when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then ''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''+<2B><><EFBFBD><EFBFBD>ģʽ+''<27><> ''+''ÿ<><C3BF>''+convert(varchar(20),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+''<27><>''');
sql.Add('when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then ''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''+convert(varchar(20),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+''<27><>''');
sql.Add('when ''<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>'' then ''<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>''');
sql.Add('end Э<><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add(',Case <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add('when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then convert(varchar(20),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ');
sql.Add('when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then convert(varchar(20),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ');
sql.Add('end <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add('from t_crm_client_sales');
sql.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+cust+''' ');
if (etdate<>'') then
sql.Add(' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+etdate+''' ');
open;
if IsEmpty then
begin
close;sql.Clear;
sql.Add('select <20><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>');
sql.Add(',Case <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add('when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then <20><><EFBFBD><EFBFBD>ģʽ*30');
sql.Add('when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add('when ''<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>'' then 0');
sql.Add('end <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add(',Case <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add('when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then ''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''+<2B><><EFBFBD><EFBFBD>ģʽ+''<27><> ''+''ÿ<><C3BF>''+convert(varchar(20),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+''<27><>''');
sql.Add('when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then ''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''+convert(varchar(20),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+''<27><>''');
sql.Add('when ''<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>'' then ''<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>''');
sql.Add('end Э<><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add(',Case <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add('when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then convert(varchar(20),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ');
sql.Add('when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then convert(varchar(20),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ');
sql.Add('end <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add('from t_crm_client_sales_tmp');
sql.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+cust+''' ');
if (etdate<>'') then
sql.Add(' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+etdate+''' and <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><='''+etdate+''' ');
open;
if not IsEmpty then
begin
result.s1:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' '+fieldbyname('Э<><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'(<28><>ʱ)';
result.s2:=fieldbyname('<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>').AsString;
result.s3:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
result.s4:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
end else begin
result.s1:='';
result.s2:='';
result.s3:='';
result.s4:='';
end;
end
else
begin
result.s1:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' '+fieldbyname('Э<><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
result.s2:=fieldbyname('<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>').AsString;
result.s3:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
result.s4:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
{function Tfrm_rp_zl_total.getzq(cust: string): string;
var
aQuery:TAdoQuery;
str:string;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
close;sql.Clear;
sql.Add('select * from t_crm_client_sales where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+cust+'''');
open;
if IsEmpty then
result:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
else begin
// str:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+',';
if fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Լ<><D4BC>ʱ<EFBFBD><CAB1>' then begin
str:=str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+fieldbyname('<27><><EFBFBD><EFBFBD>ģʽ').asstring+'<27><>,';
// str:=str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+fieldbyname('<27><><EFBFBD><EFBFBD>ģʽ').asstring+',';
str:=str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'';
end else if fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then begin
str:=str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'<27><>';
end;
result:=str+' <20><><EFBFBD><EFBFBD> '+fieldbyname('<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>').AsString;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
}
procedure Tfrm_rp_zl_total2.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_zl_total2.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_rp_zl_total2.Hide;
frm_rp_zl_total2.ManualFloat(frm_rp_zl_total2.BoundsRect );
frm_main.freeTabs('frm_rp_zl_total2');
action:=cafree;
frm_rp_zl_total2:=nil;
end;
procedure Tfrm_rp_zl_total2.bsSkinButton9Click(Sender: TObject);
var
str_date:string;
begin
if bsSkinCheckRadioBox1.Checked then
str_date:='ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD>'
else
str_date:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
memQuery.EmptyTable;
memQuery.Open;
memQuery.DisableControls;
memQuery.Insert;
memQuery.FieldByName('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').Value:=wwDBDateTimePicker1.Text;
memQuery.FieldByName('<27><>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>').Value:=wwDBDateTimePicker2.Text;
memQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=str_date;
if bsSkinCheckRadioBox4.Checked then
memQuery.FieldByName('<27>Ƿ<EFBFBD>ת<EFBFBD><D7AA>').Value:='1';
memQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=wwDBDateTimePicker3.Text;
memQuery.Post;
memQuery.EnableControls;
sys_print('<27><><EFBFBD><EFBFBD><EFBFBD>ۺϷ<DBBA><CFB7><EFBFBD>',2,p_accept_sum1,memQuery1,nil,nil,p_accept_cl1,p_accept_sales1,p_pay_client1,p_pay_sales1,p_accept_client1,nil,nil);
end;
procedure Tfrm_rp_zl_total2.bsSkinPanel2Resize(Sender: TObject);
var
i:integer;
begin
i:=round((bsSkinPanel2.Width-bsSkinPanel1.Width)/7);
bsSkinCheckRadioBox2.Width:=i;
bsSkinCheckRadioBox1.Width:=i;
bsSkinButton10.Width:=i;
bsSkinButton9.Width:=i;
bsSkinButton5.Width:=i;
bsSkinCheckRadioBox3.Width:=i;
bsSkinCheckRadioBox4.Width:=i;
end;
procedure Tfrm_rp_zl_total2.bsSkinButton10Click(Sender: TObject);
var
str_date,str_bsdate:string;
str_all:WideString;
aAdoQuery,bAdoQuery:TAdoQuery;
RecordVar:TRecordVar;
ordNo:integer;
exrate:double;
begin
if wwDBDateTimePicker2.Text='' then
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>');
Exit;
end;
aAdoQuery:=CreateAdoQuery_rpt;
bAdoQuery:=CreateAdoQuery_rpt;
with aAdoQuery do
try
Close;sql.Clear;
sql.Add('Select getdate() d');
open;
if bsSkinCheckRadioBox3.Checked then
str_bsdate:=''''+FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker3.Date)+''''
else str_bsdate:=''''+FormatDateTime('YYYY-MM-DD',FieldByName('d').AsDateTime)+'''';
finally
Free;
end;
with bAdoQuery do
try
Close;sql.Clear;
sql.Add('select distinct ί<>е<EFBFBD>λ <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ա,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_op_seae');
sql.Add('where ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>Getdate()-365 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=Getdate() and <20><><EFBFBD><EFBFBD>Ա in (select <20><><EFBFBD><EFBFBD> from t_sys_employee where ״̬=''<27><>ְ'')');
sql.Add('order by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ա,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
open;First;
finally
end;
exrate:=getUsdExRate(FormatDateTime('yyyy-mm-dd',date));
if bsSkinCheckRadioBox1.Checked then
str_date:='ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD>'
else
str_date:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
if bsSkinCheckRadioBox4.Checked then
begin
str_accept:='where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
str_pay:='where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end
else
begin
str_accept:='where v_op_bscard.<2E><><EFBFBD><EFBFBD>=1 and t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
str_pay:='where v_op_bscard.<2E><><EFBFBD><EFBFBD>=1 and t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
if wwDBDateTimePicker1.Text<>''then
begin
str_accept:=str_accept+' and not v_op_bscard.'+str_date +' is null and v_op_bscard.'+str_date+'>='+''''+wwDBDateTimePicker1.Text+'''';
str_pay:=str_pay+' and not v_op_bscard.'+str_date + ' is null and v_op_bscard.'+str_date+'>='+''''+wwDBDateTimePicker1.Text+'''';
end;
if wwDBDateTimePicker2.Text<>''then
begin
str_accept:=str_accept+' and not v_op_bscard.'+str_date + ' is null and v_op_bscard.'+str_date+'<='+''''+wwDBDateTimePicker2.Text+'''';
str_pay:=str_pay+' and not v_op_bscard.'+str_date + ' is null and v_op_bscard.'+str_date+'<='+''''+wwDBDateTimePicker2.Text+'''';
end;
if RxDBLookupCombo15.DisplayValues[0]<>'' then begin
str_accept:=str_accept+' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
str_pay:=str_pay+' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
end;
if RxDBLookupCombo16.DisplayValues[0]<>'' then begin
str_accept:=str_accept+' and v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD>Դ='+''''+RxDBLookupCombo16.DisplayValues[0]+'''';
str_pay:=str_pay+' and v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD>Դ='+''''+RxDBLookupCombo16.DisplayValues[0]+'''';
end;
if RxDBLookupCombo17.DisplayValues[0]<>'' then begin
str_accept:=str_accept+' and v_op_bscard.<2E><>Դ<EFBFBD><D4B4>ϸ='+''''+RxDBLookupCombo17.DisplayValues[0]+'''';
str_pay:=str_pay+' and v_op_bscard.<2E><>Դ<EFBFBD><D4B4>ϸ='+''''+RxDBLookupCombo17.DisplayValues[0]+'''';
end;
str_accept:=str_accept+' and '+open_data('0034','v_op_bscard.'+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','v_op_bscard.'+'<27><><EFBFBD><EFBFBD>Ա','v_op_bscard.'+'<27>ͷ<EFBFBD>Ա','v_op_bscard.<2E><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
str_pay:=str_pay+' and '+open_data('0034','v_op_bscard.'+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','v_op_bscard.'+'<27><><EFBFBD><EFBFBD>Ա','v_op_bscard.'+'<27>ͷ<EFBFBD>Ա','v_op_bscard.<2E><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
ADOQuery2.Close;
ADOQuery2.Open;
{
p_accept_client.close;
p_accept_client.Parameters.ParamByName('SQLStr').value:=
}
ADOQuery1.SQL.Text:=
'select v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD>Դ,v_op_bscard.<2E><>Դ<EFBFBD><D4B4>ϸ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>USD,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>RMB,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<>ն<EFBFBD><D5B6><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<>ն<EFBFBD><D5B6><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<>ն<EFBFBD><D5B6><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB,'
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>'
+' ,sum(case when (case when t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IS NULL then (DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))'
+' else (isnull(DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'+str_bsdate+')-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
+' ( DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'DATEADD(Day,-Day(v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))))) else 0 end) end),DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))) end)>0'
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as <20><><EFBFBD><EFBFBD>USD'
+' ,sum(case when (case when t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IS NULL then (DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))'
+' else (isnull(DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'+str_bsdate+')-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
+' ( DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'DATEADD(Day,-Day(v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))))) else 0 end) end),DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))) end)>0'
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as <20><><EFBFBD><EFBFBD>RMB'
+' ,sum(case when (case when t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IS NULL then (DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))'
+' else (isnull(DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'+str_bsdate+')-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
+' ( DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'DATEADD(Day,-Day(v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))))) else 0 end) end),DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))) end)>0'
+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> '
+' else 0 end) as <20><><EFBFBD>ںϼ<DABA>'
+' from t_ch_fee inner join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD> '
// +' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> and t_crm_client_sales.<2E><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><=v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
+str_accept
+' group by v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD>Դ,v_op_bscard.<2E><>Դ<EFBFBD><D4B4>ϸ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> order by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
/// p_accept_client.Open;
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ҵ<><D2B5><EFBFBD><EFBFBD>Դ <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
ordNo:=0;
kbmCrm_OP.EmptyTable;
kbmCrm_OP.Open;
kbmCrm_OP.DisableControls;
ADOQuery1.Open;
with ADOQuery1 do
begin
First;
while not eof do
begin
ordNo:=ordNo+1;
kbmCrm_OP.Insert;
kbmCrm_OP.FieldByName('ordNo').Value:=ordNo;
kbmCrm_OP.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').Value:=FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').Value;
kbmCrm_OP.FieldByName('<27><>Դ<EFBFBD><D4B4>ϸ').Value:=FieldByName('<27><>Դ<EFBFBD><D4B4>ϸ').Value;
kbmCrm_OP.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
if frm_data_share.t_crm_client.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value,[]) then
begin
kbmCrm_OP.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=Trim(frm_data_share.t_crm_client.FieldByName('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>').AsString)+Trim(frm_data_share.t_crm_client.FieldByName('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>').AsString);
kbmCrm_OP.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').Value:=frm_data_share.t_crm_client.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString;
end;
kbmCrm_OP.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value;
RecordVar:=getzq(FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value,wwDBDateTimePicker3.Text);
if bAdoQuery.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',vararrayof([FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value,FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value]),[]) then
kbmCrm_OP.FieldByName('<27><><EFBFBD><EFBFBD>Ա').Value:=bAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>Ա').Value;
kbmCrm_OP.FieldByName('<27><><EFBFBD><EFBFBD>').Value:=RecordVar.s1;
kbmCrm_OP.FieldByName('<27><><EFBFBD><EFBFBD>').Value:=RecordVar.s2;
kbmCrm_OP.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=RecordVar.s3;
kbmCrm_OP.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=RecordVar.s4;
kbmCrm_OP.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>USD').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>USD').Value;
kbmCrm_OP.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>RMB').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>RMB').Value;
kbmCrm_OP.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>').Value;
kbmCrm_OP.FieldByName('δ<>ն<EFBFBD><D5B6><EFBFBD>USD').Value:=FieldByName('δ<>ն<EFBFBD><D5B6><EFBFBD>USD').Value;
kbmCrm_OP.FieldByName('δ<>ն<EFBFBD><D5B6><EFBFBD>RMB').Value:=FieldByName('δ<>ն<EFBFBD><D5B6><EFBFBD>RMB').Value;
kbmCrm_OP.FieldByName('δ<>ն<EFBFBD><D5B6><EFBFBD>').Value:=FieldByName('δ<>ն<EFBFBD><D5B6><EFBFBD>').Value;
kbmCrm_OP.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
kbmCrm_OP.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
kbmCrm_OP.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
kbmCrm_OP.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
kbmCrm_OP.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
kbmCrm_OP.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
kbmCrm_OP.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
kbmCrm_OP.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
kbmCrm_OP.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
kbmCrm_OP.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
kbmCrm_OP.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
kbmCrm_OP.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
kbmCrm_OP.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>USD').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>USD').Value;
kbmCrm_OP.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>RMB').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>RMB').Value;
kbmCrm_OP.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>').Value;
kbmCrm_OP.FieldByName('һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
kbmCrm_OP.FieldByName('һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
kbmCrm_OP.FieldByName('һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
kbmCrm_OP.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD').Value:=FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD').Value;
kbmCrm_OP.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB').Value:=FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB').Value;
kbmCrm_OP.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>').Value;
kbmCrm_OP.FieldByName('<27><><EFBFBD><EFBFBD>USD').Value:=FieldByName('<27><><EFBFBD><EFBFBD>USD').Value;
kbmCrm_OP.FieldByName('<27><><EFBFBD><EFBFBD>RMB').Value:=FieldByName('<27><><EFBFBD><EFBFBD>RMB').Value;
kbmCrm_OP.FieldByName('<27><><EFBFBD>ںϼ<DABA>').Value:=FieldByName('<27><><EFBFBD>ںϼ<DABA>').Value;
kbmCrm_OP.post;
Next;
end;
end;
kbmCrm_OP.EnableControls;
///
ADOQuery1.SQL.Text:=
'select t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>USD,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>RMB,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<>ն<EFBFBD><D5B6><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<>ն<EFBFBD><D5B6><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<>ն<EFBFBD><D5B6><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB,'
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>'
+' ,sum(case when (case when t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IS NULL then (DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))'
+' else (isnull(DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'+str_bsdate+')-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
+' ( DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'DATEADD(Day,-Day(v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))))) else 0 end) end),DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))) end)>0'
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as <20><><EFBFBD><EFBFBD>USD'
+' ,sum(case when (case when t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IS NULL then (DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))'
+' else (isnull(DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'+str_bsdate+')-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
+' ( DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'DATEADD(Day,-Day(v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))))) else 0 end) end),DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))) end)>0'
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as <20><><EFBFBD><EFBFBD>RMB'
+' ,sum(case when (case when t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IS NULL then (DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))'
+' else (isnull(DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'+str_bsdate+')-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
+' ( DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'DATEADD(Day,-Day(v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))))) else 0 end) end),DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))) end)>0'
+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> '
+' else 0 end) as <20><><EFBFBD>ںϼ<DABA>'
+' from t_ch_fee inner join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD> '
// +' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> and t_crm_client_sales.<2E><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><=v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
+str_accept
+' group by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> order by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> ';
kbmcl.EmptyTable;
kbmcl.Open;
kbmcl.DisableControls;
ADOQuery1.Open;
with ADOQuery1 do
begin
First;
while not eof do
begin
kbmcl.Insert;
if frm_data_share.t_crm_client.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value,[]) then
begin
kbmcl.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=Trim(frm_data_share.t_crm_client.FieldByName('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>').AsString)+Trim(frm_data_share.t_crm_client.FieldByName('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>').AsString);
kbmcl.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').Value:=frm_data_share.t_crm_client.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString;
end;
kbmcl.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value;
RecordVar:=getzq(FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value,wwDBDateTimePicker3.Text);
kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>').Value:=RecordVar.s1;
kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>').Value:=RecordVar.s2;
kbmcl.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=RecordVar.s3;
kbmcl.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=RecordVar.s4;
kbmcl.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>USD').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>USD').Value;
kbmcl.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>RMB').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>RMB').Value;
kbmcl.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>').Value;
kbmcl.FieldByName('δ<>ն<EFBFBD><D5B6><EFBFBD>USD').Value:=FieldByName('δ<>ն<EFBFBD><D5B6><EFBFBD>USD').Value;
kbmcl.FieldByName('δ<>ն<EFBFBD><D5B6><EFBFBD>RMB').Value:=FieldByName('δ<>ն<EFBFBD><D5B6><EFBFBD>RMB').Value;
kbmcl.FieldByName('δ<>ն<EFBFBD><D5B6><EFBFBD>').Value:=FieldByName('δ<>ն<EFBFBD><D5B6><EFBFBD>').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
kbmcl.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>USD').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>USD').Value;
kbmcl.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>RMB').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>RMB').Value;
kbmcl.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>').Value;
kbmcl.FieldByName('һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
kbmcl.FieldByName('һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
kbmcl.FieldByName('һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD').Value:=FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD').Value;
kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB').Value:=FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB').Value;
kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>').Value;
if (ADOQuery2.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([kbmcl.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value,'<27><>']),[])) then begin
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value+ADOQuery2.fieldbyname('USDTTL').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value+ADOQuery2.fieldbyname('RMBTTL').Value;
kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=kbmcl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value+ADOQuery2.fieldbyname('USDTTL').Value*exrate+ADOQuery2.fieldbyname('RMBTTL').Value;
kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD').Value:=kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD').Value+ADOQuery2.fieldbyname('USDTTL').Value;
kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB').Value:=kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB').Value+ADOQuery2.fieldbyname('RMBTTL').Value;
kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>').Value:=kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>').Value+ADOQuery2.fieldbyname('USDTTL').Value*exrate+ADOQuery2.fieldbyname('RMBTTL').Value;
end;
kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>USD').Value:=FieldByName('<27><><EFBFBD><EFBFBD>USD').Value;
kbmcl.FieldByName('<27><><EFBFBD><EFBFBD>RMB').Value:=FieldByName('<27><><EFBFBD><EFBFBD>RMB').Value;
kbmcl.FieldByName('<27><><EFBFBD>ںϼ<DABA>').Value:=FieldByName('<27><><EFBFBD>ںϼ<DABA>').Value;
kbmcl.post;
Next;
end;
end;
kbmcl.EnableControls;
p_pay_client.close;
p_pay_client.Parameters.ParamByName('SQLStr').value:=
'select t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E><><EFBFBD><EFBFBD> <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>USD,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>RMB,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' '
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' '
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' '
+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB,'
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4> '
+' ,sum(case when (datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+') or (datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+') or datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD>ºϼ<C2BA>USD'
+' ,sum(case when (datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+') or (datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+') or datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD>ºϼ<C2BA>RMB '
+' from t_ch_fee '
+' left join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD> '
+' left join t_crm_client on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
+str_pay
+' group by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E><><EFBFBD><EFBFBD>,t_crm_client.<2E><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E>ͻ<EFBFBD>ȫ<EFBFBD><C8AB> order by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
p_pay_client.Open;
p_pay_clientzl.EmptyTable;
p_pay_clientzl.Open;
p_pay_clientzl.DisableControls;
with p_pay_client do
begin
First;
while not eof do
begin
p_pay_clientzl.Insert;
p_pay_clientzl.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value;
p_pay_clientzl.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value;
p_pay_clientzl.FieldByName('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>').Value;
p_pay_clientzl.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').Value:=FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').Value;
p_pay_clientzl.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>USD').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>USD').Value;
p_pay_clientzl.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>RMB').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>RMB').Value;
p_pay_clientzl.FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>').Value:=FieldByName('δ<><CEB4>һ<EFBFBD><D2BB>').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
p_pay_clientzl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD').Value:=FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD').Value;
p_pay_clientzl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB').Value:=FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB').Value;
p_pay_clientzl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>').Value;
if (ADOQuery2.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([p_pay_clientzl.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value,'<27><>']),[])) then begin
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value:=p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').Value+ADOQuery2.fieldbyname('USDTTL').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value:=p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').Value+ADOQuery2.fieldbyname('RMBTTL').Value;
p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=p_pay_clientzl.FieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value+ADOQuery2.fieldbyname('USDTTL').Value*exrate+ADOQuery2.fieldbyname('RMBTTL').Value;
p_pay_clientzl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD').Value:=p_pay_clientzl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD').Value+ADOQuery2.fieldbyname('USDTTL').Value;
p_pay_clientzl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB').Value:=p_pay_clientzl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB').Value+ADOQuery2.fieldbyname('RMBTTL').Value;
p_pay_clientzl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>').Value:=p_pay_clientzl.FieldByName('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>').Value+ADOQuery2.fieldbyname('USDTTL').Value*exrate+ADOQuery2.fieldbyname('RMBTTL').Value;
end;
p_pay_clientzl.post;
Next;
end;
end;
p_pay_clientzl.EnableControls;
p_accept_sales.close;
p_accept_sales.Parameters.ParamByName('SQLStr').value:=
'select v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>USD,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>RMB,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<>ն<EFBFBD><D5B6><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<>ն<EFBFBD><D5B6><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<>ն<EFBFBD><D5B6><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB,'
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>'
+' from t_ch_fee inner join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD> '
+str_accept
+' group by v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
p_accept_sales.Open;
p_pay_sales.close;
p_pay_sales.Parameters.ParamByName('SQLStr').value:=
'select v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>USD,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>RMB,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB,'
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>'
+' from t_ch_fee inner join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD> '
+str_pay
+' group by v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
p_pay_sales.Open;
p_settling_D.close;
p_settling_D.Parameters.ParamByName('SQLStr').value:=
'select t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>,'
+' SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20><><EFBFBD><EFBFBD>USD'
+','
+' SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB'
+','
+' SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20>Ѹ<EFBFBD>USD'
+','
+' SUM( CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20>Ѹ<EFBFBD>RMB'
+' from t_ch_fee inner join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD>'
+' left join t_crm_client on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
+' where v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD> is null and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>0 And t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'''
+' group by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD> order by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
p_settling_D.Open;
p_settling_C.close;
p_settling_C.Parameters.ParamByName('SQLStr').value:=
'select t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>,'
+' SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20><><EFBFBD><EFBFBD>USD'
+','
+' SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB'
+','
+' SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20>Ѹ<EFBFBD>USD'
+','
+' SUM( CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20>Ѹ<EFBFBD>RMB'
+' from t_ch_fee inner join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD>'
+' left join t_crm_client on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
+' where v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD> is null and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>0 And t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'''
+' group by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD> order by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
p_settling_C.Open;
p_settling_D_Detail.close;
p_settling_D_Detail.Parameters.ParamByName('SQLStr').value:=
'select t_ch_fee.<2E><><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,t_crm_client.<2E><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>,'
+' SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20><><EFBFBD><EFBFBD>USD'
+','
+' SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB'
+','
+' SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20>Ѹ<EFBFBD>USD'
+','
+' SUM( CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20>Ѹ<EFBFBD>RMB'
+' from t_ch_fee inner join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD>'
+' left join t_crm_client on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
+' where v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD> is null and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>0 And t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'''
+' group by t_ch_fee.<2E><><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,t_crm_client.<2E><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E>ͻ<EFBFBD>ȫ<EFBFBD><C8AB> order by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
p_settling_D_Detail.Open;
p_settling_C_Detail.close;
p_settling_C_Detail.Parameters.ParamByName('SQLStr').value:=
'select t_ch_fee.<2E><><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,t_crm_client.<2E><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>,'
+' SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20><><EFBFBD><EFBFBD>USD'
+','
+' SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB'
+','
+' SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20>Ѹ<EFBFBD>USD'
+','
+' SUM( CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20>Ѹ<EFBFBD>RMB'
+' from t_ch_fee inner join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD>'
+' left join t_crm_client on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
+' where v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD> is null and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>0 And t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'''
+' group by t_ch_fee.<2E><><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,t_crm_client.<2E><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>,t_crm_client.<2E>ͻ<EFBFBD>ȫ<EFBFBD><C8AB> order by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
p_settling_C_Detail.Open;
p_accept_sum.close;
p_accept_sum.Parameters.ParamByName('SQLStr').value:=
'select '
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>USD,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>RMB,'
+'sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl1+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<>ն<EFBFBD><D5B6><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<>ն<EFBFBD><D5B6><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl2+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl1+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<>ն<EFBFBD><D5B6><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl3+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl2+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl4+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl3+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl5+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl4+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl6+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl5+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')<='+zl7+''
+' and datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl6+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>һ<EFBFBD><D2BB>,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB,'
+' sum(case when datediff(day,v_op_bscard.'+str_date+','+str_bsdate+')>'+zl7+' '
+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' else 0 end) as һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end)) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB,'
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>) else 0 end)) as <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>USD,'
+' sum((case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>) end)) as <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>RMB,'
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>'
+' ,sum(case when (case when t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IS NULL then (DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))'
+' else (isnull(DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'+str_bsdate+')-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
+' ( DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'DATEADD(Day,-Day(v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))))) else 0 end) end),DATEDIFF([day],v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+'+pjday+','+str_bsdate+'))) end)>0'
+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> '
+' else 0 end) as <20><><EFBFBD>ںϼ<DABA>'
+' from t_ch_fee inner join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD> '
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
+str_accept;
p_accept_sum.Open;
end;
procedure Tfrm_rp_zl_total2.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_memtbl(Column,kbmCrm_OP,'');
end;
procedure Tfrm_rp_zl_total2.dxDBGrid2ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_pro(Column,p_accept_sales,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_rp_zl_total2.dxDBGrid3ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_pro(Column,p_pay_client,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_rp_zl_total2.dxDBGrid4ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_pro(Column,p_pay_sales,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_rp_zl_total2.FormShow(Sender: TObject);
begin
t_sys_zlset.open;
if frm_data_share.t_load_employee.FieldByName('Ӧ<><D3A6>').asboolean then
begin
bsSkinTabSheet1.TabVisible:=true;
tabs3.TabVisible:=true;
end
else
begin
bsSkinTabSheet1.TabVisible:=false;
tabs3.TabVisible:=false;
end;
if frm_data_share.t_load_employee.FieldByName('Ӧ<><D3A6>').asboolean then
begin
bsSkinTabSheet2.TabVisible:=true;
tabs4.TabVisible:=true;
end
else
begin
bsSkinTabSheet2.TabVisible:=false;
tabs4.TabVisible:=false;
end;
zl1:=inttostr(t_sys_zlset.fieldbyname('<27><>Ŀһ<C4BF><D2BB><EFBFBD><EFBFBD>').Asinteger);
zl2:=inttostr(t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asinteger);
zl3:=inttostr(t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asinteger);
zl4:=inttostr(t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asinteger);
zl5:=inttostr(t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asinteger);
zl6:=inttostr(t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asinteger);
zl7:=inttostr(t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Asinteger);
dxDBGrid7.Bands[1].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀһ<C4BF><D2BB><EFBFBD><EFBFBD>').AsString;
dxDBGrid7.Bands[2].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid7.Bands[3].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid7.Bands[4].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid7.Bands[5].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid7.Bands[6].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid7.Bands[7].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid7.Bands[8].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid1.Bands[1].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀһ<C4BF><D2BB><EFBFBD><EFBFBD>').AsString;
dxDBGrid1.Bands[2].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid1.Bands[3].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid1.Bands[4].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid1.Bands[5].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid1.Bands[6].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid1.Bands[7].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid1.Bands[8].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid2.Bands[1].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀһ<C4BF><D2BB><EFBFBD><EFBFBD>').AsString;
dxDBGrid2.Bands[2].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid2.Bands[3].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid2.Bands[4].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid2.Bands[5].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid2.Bands[6].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid2.Bands[7].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid2.Bands[8].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid3.Bands[1].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀһ<C4BF><D2BB><EFBFBD><EFBFBD>').AsString;
dxDBGrid3.Bands[2].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid3.Bands[3].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid3.Bands[4].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid3.Bands[5].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid3.Bands[6].Caption:='210---';
// dxDBGrid3.Bands[7].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
// dxDBGrid3.Bands[7].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid4.Bands[1].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀһ<C4BF><D2BB><EFBFBD><EFBFBD>').AsString;
dxDBGrid4.Bands[2].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid4.Bands[3].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid4.Bands[4].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid4.Bands[5].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid4.Bands[6].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid4.Bands[7].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
dxDBGrid4.Bands[8].Caption:=t_sys_zlset.fieldbyname('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
procedure Tfrm_rp_zl_total2.N16Click(Sender: TObject);
begin
with SaveDialog do
begin
DefaultExt :='xls';
Filter := '(*.xls)|*.xls';
if Execute then
begin
if bsSkinTabSheet1.Showing then
begin
if bsSkinTabSheet3.Showing then
dxDBGrid1.SaveToXLS(FileName,true)
else
if bsSkinTabSheet4.Showing then
dxDBGrid2.SaveToXLS(FileName,true)
else
if bsskintabsheetys.Showing then
dxDBGrid8.SaveToXLS(FileName,true)
else
if bsSkinTbS3.Showing then
dxDBGrid7.SaveToXLS(FileName,true);
end
else
if bsSkinTabSheet2.Showing then
begin
if bsSkinTabSheet5.Showing then
dxDBGrid3.SaveToXLS(FileName,true)
else
if bsskintabsheetyf.Showing then
dxDBGrid9.SaveToXLS(FileName,true)
else
if bsSkinTabSheet6.Showing then
dxDBGrid4.SaveToXLS(FileName,true);
end
else
if tabs3.Showing then
dxDBGrid5.SaveToXLS(FileName,true)
else
if tabs4.Showing then
begin
dxDBGrid6.SaveToXLS(FileName,true);
end
else
if bsSkinTabSheet7.Showing then
begin
dxDBGrid10.SaveToXLS(FileName,true);
end
else
if bsSkinTabSheet8.Showing then
begin
dxDBGrid20.SaveToXLS(FileName,true);
end;
end;
end;
end;
procedure Tfrm_rp_zl_total2.dxDBGrid1DblClick(Sender: TObject);
var
str_bill:widestring;
begin
str_bill:=str_accept+' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+p_accept_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+''''+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+p_accept_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''';
p_accept_bill.close;
p_accept_bill.Parameters.ParamByName('SQLStr').value:=
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' else 0 end) as <20><><EFBFBD><EFBFBD>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as Ӧ<><D3A6>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as <20><><EFBFBD><EFBFBD>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then 0'
+' else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as δ<><CEB4>RMB,sum(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as Ӧ<>պϼ<D5BA>,'
+' sum(t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD>պϼ<D5BA>,'
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as δ<>պϼ<D5BA>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾'
+' FROM t_ch_fee inner join v_op_bscard on v_op_bscard.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> left join t_crm_client '
+' on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾'
+default_sort_two(53,'v_op_bscard','t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>','','');
p_accept_bill.Open;
bsSkinPageControl1.ActivePage:=tabs3;
end;
procedure Tfrm_rp_zl_total2.dxDBGrid2DblClick(Sender: TObject);
var
str_bill:widestring;
begin
str_bill:=str_accept+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+p_accept_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''';
p_accept_bill.close;
p_accept_bill.Parameters.ParamByName('SQLStr').value:=
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' else 0 end) as <20><><EFBFBD><EFBFBD>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as Ӧ<><D3A6>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as <20><><EFBFBD><EFBFBD>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then 0'
+' else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as δ<><CEB4>RMB,sum(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as Ӧ<>պϼ<D5BA>,'
+' sum(t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD>պϼ<D5BA>,'
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as δ<>պϼ<D5BA>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾'
+' FROM t_ch_fee inner join v_op_bscard on v_op_bscard.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> left join t_crm_client '
+' on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾'
+default_sort_two(53,'v_op_bscard','t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>','','');
p_accept_bill.Open;
bsSkinPageControl1.ActivePage:=tabs3;
end;
procedure Tfrm_rp_zl_total2.dxDBGrid3DblClick(Sender: TObject);
var
str_bill:widestring;
sl:tstrings;
begin
str_bill:=str_pay+' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+p_pay_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''';
p_pay_bill.close;
p_pay_bill.Parameters.ParamByName('SQLStr').value:=
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' else 0 end) as <20>Ѹ<EFBFBD>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as Ӧ<><D3A6>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as <20>Ѹ<EFBFBD>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then 0'
+' else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as δ<><CEB4>RMB,sum(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
+' sum(t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾'
+' FROM t_ch_fee inner join v_op_bscard on v_op_bscard.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> left join t_crm_client '
+' on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾'
+default_sort_two(53,'v_op_bscard','t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>','','');
p_pay_bill.Open;
bsSkinPageControl1.ActivePage:=tabs4;
end;
procedure Tfrm_rp_zl_total2.dxDBGrid4DblClick(Sender: TObject);
var
str_bill:widestring;
begin
str_bill:=str_pay+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+p_pay_sales.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''';
p_pay_bill.close;
p_pay_bill.Parameters.ParamByName('SQLStr').value:=
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' else 0 end) as <20>Ѹ<EFBFBD>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as Ӧ<><D3A6>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as <20>Ѹ<EFBFBD>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then 0'
+' else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as δ<><CEB4>RMB,sum(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
+' sum(t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾'
+' FROM t_ch_fee inner join v_op_bscard on v_op_bscard.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> left join t_crm_client '
+' on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾'
+default_sort_two(53,'v_op_bscard','t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>','','');
p_pay_bill.Open;
bsSkinPageControl1.ActivePage:=tabs4;
end;
procedure Tfrm_rp_zl_total2.dxDBGrid7DblClick(Sender: TObject);
var
str_bill:widestring;
begin
str_bill:=str_accept+' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+p_accept_cl.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''';
p_accept_bill.close;
p_accept_bill.Parameters.ParamByName('SQLStr').value:=
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' else 0 end) as <20><><EFBFBD><EFBFBD>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' else 0 end) as δ<><CEB4>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as Ӧ<><D3A6>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as <20><><EFBFBD><EFBFBD>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then 0'
+' else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
+' end) as δ<><CEB4>RMB,sum(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as Ӧ<>պϼ<D5BA>,'
+' sum(t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD>պϼ<D5BA>,'
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as δ<>պϼ<D5BA>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾'
+' FROM t_ch_fee inner join v_op_bscard on v_op_bscard.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> left join t_crm_client '
+' on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾'
+default_sort_two(53,'v_op_bscard','t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>','','');
p_accept_bill.Open;
bsSkinPageControl1.ActivePage:=tabs3;
end;
procedure Tfrm_rp_zl_total2.p_accept_clientAfterOpen(DataSet: TDataSet);
begin
AdoFormatdxDBGrid(DataSet);
end;
procedure Tfrm_rp_zl_total2.p_accept_clAfterOpen(DataSet: TDataSet);
begin
AdoFormatdxDBGrid(DataSet);
end;
procedure Tfrm_rp_zl_total2.dxDBGrid1Column37GetText(Sender: TObject;
ANode: TdxTreeListNode; var AText: String);
begin
if AText='0.00' then AText:='';
end;
procedure Tfrm_rp_zl_total2.N1Click(Sender: TObject);
begin
if bsSkinTabSheet1.Showing then begin
if bsSkinTabSheet3.Showing then
update_grid_view_no(dxdbgrid1)
else if bsSkinTabSheet4.Showing then
update_grid_view_no(dxdbgrid2)
else if bsSkinTbS3.Showing then
update_grid_view_no(dxdbgrid7);
end else if bsSkinTabSheet2.Showing then begin
if bsSkinTabSheet5.Showing then
update_grid_view_no(dxdbgrid3)
else if bsSkinTabSheet6.Showing then
update_grid_view_no(dxdbgrid4);
end else if tabs3.Showing then
update_grid_view_no(dxdbgrid5)
else if tabs4.Showing then begin
update_grid_view_no(dxdbgrid6);
end;
end;
procedure Tfrm_rp_zl_total2.N3Click(Sender: TObject);
begin
if bsSkinTabSheet1.Showing then begin
if bsSkinTabSheet3.Showing then
update_grid_view_all(dxdbgrid1)
else if bsSkinTabSheet4.Showing then
update_grid_view_all(dxdbgrid2)
else if bsSkinTbS3.Showing then
update_grid_view_all(dxdbgrid7);
end else if bsSkinTabSheet2.Showing then begin
if bsSkinTabSheet5.Showing then
update_grid_view_all(dxdbgrid3)
else if bsSkinTabSheet6.Showing then
update_grid_view_all(dxdbgrid4);
end else if tabs3.Showing then
update_grid_view_all(dxdbgrid5)
else if tabs4.Showing then begin
update_grid_view_all(dxdbgrid6);
end;
end;
procedure Tfrm_rp_zl_total2.Button1Click(Sender: TObject);
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
With aQuery do begin
close;SQL.Clear;
sql.Text:='delete from t_ch_zlsales';
ExecSQL;
close;SQL.Clear;
SQL.Text:='select * from t_ch_zlsales';
Open;
kbmCrm_OP.First;
while not kbmCrm_OP.Eof do begin
aQuery.Insert;
aQuery['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=kbmCrm_OP['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'];
aQuery['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=kbmCrm_OP['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'];
aQuery['Ƿ<><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=kbmCrm_OP['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
aQuery['<27><><EFBFBD><EFBFBD>RMB']:=kbmCrm_OP['<27><><EFBFBD><EFBFBD>RMB'];
aQuery['<27><><EFBFBD><EFBFBD>USD']:=kbmCrm_OP['<27><><EFBFBD><EFBFBD>USD'];
aQuery['<27><><EFBFBD>ںϼ<DABA>']:=kbmCrm_OP['<27><><EFBFBD>ںϼ<DABA>'];
aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=kbmCrm_OP['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=kbmCrm_OP['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
aQuery.Post;
kbmCrm_OP.Next;
end;
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>');
end;
finally
FreeAndNil(aQuery);
end;
end;
end.