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.

6693 lines
263 KiB
Plaintext

11 months ago
unit u_ch_add_do;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, bsSkinTabs, bsSkinCtrls, wwdbdatetimepicker, StdCtrls, RxLookup,
dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, ExtCtrls, DB, ADODB,
dxDBTLCl, dxGrClms, Menus, RxMemDS, Grids, DBGrids, XPMenu, Mask,
wwdbedit, Wwdotdot, Wwdbcomb, wwdblook, DBGridEh, kbmMemTable, DBCtrlsEh,ComObj,Variants;
type
Tfra_ch_add_do = class(TFrame)
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
bsSkinTabSheet2: TbsSkinTabSheet;
bsSkinTabSheet3: TbsSkinTabSheet;
bsSkinTabSheet4: TbsSkinTabSheet;
bsSkinPanel1: TbsSkinPanel;
bsSkinPanel2: TbsSkinPanel;
Edit4: TEdit;
Label1: TLabel;
Edit2: TEdit;
Edit3: TEdit;
Label2: TLabel;
Label3: TLabel;
Label8: TLabel;
Label10: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
wwDBDateTimePicker3: TwwDBDateTimePicker;
Label5: TLabel;
Label11: TLabel;
wwDBDateTimePicker2: TwwDBDateTimePicker;
wwDBDateTimePicker4: TwwDBDateTimePicker;
Label9: TLabel;
RxDBLookupCombo2: TRxDBLookupCombo;
bsSkinButton10: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
dxDBGrid2: TdxDBGrid;
Panel1: TPanel;
dxDBGrid1: TdxDBGrid;
dxDBGrid3: TdxDBGrid;
t_op_seae: TADOQuery;
t_op_seae1: TDataSource;
dxDBGrid2Column1: TdxDBGridMaskColumn;
dxDBGrid2Column2: TdxDBGridMaskColumn;
dxDBGrid2Column3: TdxDBGridMaskColumn;
dxDBGrid2Column4: TdxDBGridMaskColumn;
dxDBGrid2Column5: TdxDBGridMaskColumn;
dxDBGrid2Column6: TdxDBGridDateColumn;
dxDBGrid2Column7: TdxDBGridMaskColumn;
dxDBGrid2Column8: TdxDBGridMaskColumn;
dxDBGrid2Column9: TdxDBGridDateColumn;
dxDBGrid2Column10: TdxDBGridMaskColumn;
dxDBGrid2Column11: TdxDBGridMaskColumn;
dxDBGrid2Column14: TdxDBGridMaskColumn;
dxDBGrid2Column15: TdxDBGridMaskColumn;
dxDBGrid2Column16: TdxDBGridMaskColumn;
dxDBGrid2Column17: TdxDBGridMaskColumn;
dxDBGrid2Column18: TdxDBGridColumn;
dxDBGrid2Column13: TdxDBGridColumn;
dxDBGrid2Column12: TdxDBGridColumn;
t_ch_fee1: TDataSource;
t_ch_fee: TADOQuery;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridMaskColumn;
dxDBGrid1Column4: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
t_ch_fee_sum: TADOQuery;
t_ch_fee_sum1: TDataSource;
dxDBGrid3Column1: TdxDBGridMaskColumn;
dxDBGrid3Column2: TdxDBGridColumn;
dxDBGrid3Column3: TdxDBGridColumn;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
PopupMenu2: TPopupMenu;
MenuItem1: TMenuItem;
bs_text: TEdit;
dxDBGrid1Column5: TdxDBGridColumn;
do_ban1: TDataSource;
t_ch_fee_do: TADOQuery;
t_rate: TRxMemoryData;
XPMenu1: TXPMenu;
bsSkinPanel3: TbsSkinPanel;
Label4: TLabel;
Label6: TLabel;
Label7: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Edit1: TEdit;
Edit5: TEdit;
Edit6: TEdit;
wwDBDateTimePicker5: TwwDBDateTimePicker;
wwDBDateTimePicker6: TwwDBDateTimePicker;
wwDBDateTimePicker7: TwwDBDateTimePicker;
wwDBDateTimePicker8: TwwDBDateTimePicker;
RxDBLookupCombo1: TRxDBLookupCombo;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinPanel4: TbsSkinPanel;
dxDBGrid4: TdxDBGrid;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
dxDBGridMaskColumn2: TdxDBGridMaskColumn;
dxDBGridMaskColumn3: TdxDBGridMaskColumn;
dxDBGridMaskColumn4: TdxDBGridMaskColumn;
dxDBGridMaskColumn5: TdxDBGridMaskColumn;
dxDBGridDateColumn1: TdxDBGridDateColumn;
dxDBGridDateColumn2: TdxDBGridDateColumn;
dxDBGridMaskColumn6: TdxDBGridMaskColumn;
dxDBGridColumn1: TdxDBGridColumn;
dxDBGridMaskColumn7: TdxDBGridMaskColumn;
dxDBGridMaskColumn8: TdxDBGridMaskColumn;
dxDBGridMaskColumn9: TdxDBGridMaskColumn;
dxDBGridMaskColumn10: TdxDBGridMaskColumn;
dxDBGridColumn2: TdxDBGridColumn;
dxDBGridColumn3: TdxDBGridColumn;
dxDBGridMaskColumn11: TdxDBGridMaskColumn;
dxDBGridMaskColumn12: TdxDBGridMaskColumn;
dxDBGridMaskColumn13: TdxDBGridMaskColumn;
Panel2: TPanel;
dxDBGrid5: TdxDBGrid;
dxDBGridMaskColumn14: TdxDBGridMaskColumn;
dxDBGridMaskColumn15: TdxDBGridMaskColumn;
dxDBGridColumn4: TdxDBGridColumn;
dxDBGridColumn5: TdxDBGridColumn;
dxDBGridColumn6: TdxDBGridColumn;
dxDBGrid6: TdxDBGrid;
dxDBGridMaskColumn16: TdxDBGridMaskColumn;
dxDBGridColumn7: TdxDBGridColumn;
dxDBGridColumn8: TdxDBGridColumn;
t_op_seai: TADOQuery;
t_op_seai1: TDataSource;
t_op_aire: TADOQuery;
t_op_aire1: TDataSource;
bsSkinPanel5: TbsSkinPanel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
Label24: TLabel;
Edit8: TEdit;
Edit9: TEdit;
Edit10: TEdit;
wwDBDateTimePicker9: TwwDBDateTimePicker;
wwDBDateTimePicker10: TwwDBDateTimePicker;
wwDBDateTimePicker11: TwwDBDateTimePicker;
wwDBDateTimePicker12: TwwDBDateTimePicker;
RxDBLookupCombo3: TRxDBLookupCombo;
bsSkinButton4: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinPanel6: TbsSkinPanel;
dxDBGrid7: TdxDBGrid;
dxDBGridMaskColumn17: TdxDBGridMaskColumn;
dxDBGridMaskColumn18: TdxDBGridMaskColumn;
dxDBGridMaskColumn19: TdxDBGridMaskColumn;
dxDBGridMaskColumn20: TdxDBGridMaskColumn;
dxDBGridMaskColumn21: TdxDBGridMaskColumn;
dxDBGridDateColumn3: TdxDBGridDateColumn;
dxDBGridDateColumn4: TdxDBGridDateColumn;
dxDBGridColumn9: TdxDBGridColumn;
dxDBGridMaskColumn24: TdxDBGridMaskColumn;
dxDBGridMaskColumn26: TdxDBGridMaskColumn;
dxDBGridColumn10: TdxDBGridColumn;
dxDBGridColumn11: TdxDBGridColumn;
dxDBGridMaskColumn27: TdxDBGridMaskColumn;
dxDBGridMaskColumn28: TdxDBGridMaskColumn;
dxDBGridMaskColumn29: TdxDBGridMaskColumn;
Panel3: TPanel;
dxDBGrid8: TdxDBGrid;
dxDBGridMaskColumn30: TdxDBGridMaskColumn;
dxDBGridMaskColumn31: TdxDBGridMaskColumn;
dxDBGridColumn12: TdxDBGridColumn;
dxDBGridColumn13: TdxDBGridColumn;
dxDBGridColumn14: TdxDBGridColumn;
dxDBGrid9: TdxDBGrid;
dxDBGridMaskColumn32: TdxDBGridMaskColumn;
dxDBGridColumn15: TdxDBGridColumn;
dxDBGridColumn16: TdxDBGridColumn;
edit_open: TEdit;
bsSkinPanel7: TbsSkinPanel;
Label25: TLabel;
Label26: TLabel;
Label27: TLabel;
Label28: TLabel;
Label29: TLabel;
Label30: TLabel;
Label31: TLabel;
Label32: TLabel;
Edit7: TEdit;
Edit11: TEdit;
Edit12: TEdit;
wwDBDateTimePicker13: TwwDBDateTimePicker;
wwDBDateTimePicker14: TwwDBDateTimePicker;
wwDBDateTimePicker15: TwwDBDateTimePicker;
wwDBDateTimePicker16: TwwDBDateTimePicker;
RxDBLookupCombo4: TRxDBLookupCombo;
bsSkinButton6: TbsSkinButton;
bsSkinButton7: TbsSkinButton;
bsSkinPanel8: TbsSkinPanel;
dxDBGrid10: TdxDBGrid;
dxDBGridMaskColumn22: TdxDBGridMaskColumn;
dxDBGridMaskColumn23: TdxDBGridMaskColumn;
dxDBGridMaskColumn25: TdxDBGridMaskColumn;
dxDBGridMaskColumn33: TdxDBGridMaskColumn;
dxDBGridMaskColumn34: TdxDBGridMaskColumn;
dxDBGridDateColumn5: TdxDBGridDateColumn;
dxDBGridDateColumn6: TdxDBGridDateColumn;
dxDBGridColumn17: TdxDBGridColumn;
dxDBGridMaskColumn35: TdxDBGridMaskColumn;
dxDBGridMaskColumn36: TdxDBGridMaskColumn;
dxDBGridColumn18: TdxDBGridColumn;
dxDBGridColumn19: TdxDBGridColumn;
dxDBGridMaskColumn37: TdxDBGridMaskColumn;
dxDBGridMaskColumn38: TdxDBGridMaskColumn;
dxDBGridMaskColumn39: TdxDBGridMaskColumn;
Panel4: TPanel;
dxDBGrid11: TdxDBGrid;
dxDBGridMaskColumn40: TdxDBGridMaskColumn;
dxDBGridMaskColumn41: TdxDBGridMaskColumn;
dxDBGridColumn20: TdxDBGridColumn;
dxDBGridColumn21: TdxDBGridColumn;
dxDBGridColumn22: TdxDBGridColumn;
dxDBGrid12: TdxDBGrid;
dxDBGridMaskColumn42: TdxDBGridMaskColumn;
dxDBGridColumn23: TdxDBGridColumn;
dxDBGridColumn24: TdxDBGridColumn;
t_op_airi: TADOQuery;
t_op_airi1: TDataSource;
dxDBGrid4Column19: TdxDBGridColumn;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid3Column4: TdxDBGridColumn;
dxDBGrid5Column6: TdxDBGridColumn;
dxDBGrid6Column4: TdxDBGridColumn;
dxDBGrid8Column6: TdxDBGridColumn;
dxDBGrid9Column4: TdxDBGridColumn;
dxDBGrid11Column6: TdxDBGridColumn;
dxDBGrid12Column4: TdxDBGridColumn;
N10: TMenuItem;
N11: TMenuItem;
dxDBGrid2Column19: TdxDBGridColumn;
dxDBGrid2Column20: TdxDBGridColumn;
dxDBGrid4Column20: TdxDBGridColumn;
dxDBGrid4Column21: TdxDBGridColumn;
dxDBGrid13: TdxDBGrid;
dxDBGridColumn59: TdxDBGridColumn;
dxDBGridColumn60: TdxDBGridColumn;
dxDBGridColumn61: TdxDBGridColumn;
dxDBGridColumn62: TdxDBGridColumn;
dxDBGridColumn63: TdxDBGridColumn;
dxDBGridColumn64: TdxDBGridColumn;
dxDBGridColumn65: TdxDBGridColumn;
dxDBGridColumn66: TdxDBGridColumn;
dxDBGridColumn67: TdxDBGridColumn;
dxDBGridColumn68: TdxDBGridColumn;
dxDBGridColumn69: TdxDBGridColumn;
dxDBGridColumn70: TdxDBGridColumn;
dxDBGridColumn71: TdxDBGridColumn;
dxDBGridColumn72: TdxDBGridColumn;
dxDBGridColumn73: TdxDBGridColumn;
dxDBGridColumn74: TdxDBGridColumn;
dxDBGridColumn75: TdxDBGridColumn;
dxDBGridColumn76: TdxDBGridColumn;
dxDBGridColumn77: TdxDBGridColumn;
dxDBGridColumn78: TdxDBGridColumn;
dxDBGridColumn79: TdxDBGridColumn;
dxDBGrid14: TdxDBGrid;
dxDBGridColumn25: TdxDBGridColumn;
dxDBGridColumn26: TdxDBGridColumn;
dxDBGridColumn27: TdxDBGridColumn;
dxDBGridColumn28: TdxDBGridColumn;
dxDBGridColumn29: TdxDBGridColumn;
dxDBGridColumn30: TdxDBGridColumn;
dxDBGridColumn31: TdxDBGridColumn;
dxDBGridColumn32: TdxDBGridColumn;
dxDBGridColumn33: TdxDBGridColumn;
dxDBGridColumn34: TdxDBGridColumn;
dxDBGridColumn35: TdxDBGridColumn;
dxDBGridColumn36: TdxDBGridColumn;
dxDBGridColumn37: TdxDBGridColumn;
dxDBGridColumn38: TdxDBGridColumn;
dxDBGridColumn39: TdxDBGridColumn;
dxDBGridColumn40: TdxDBGridColumn;
dxDBGridColumn41: TdxDBGridColumn;
dxDBGridColumn42: TdxDBGridColumn;
dxDBGridColumn43: TdxDBGridColumn;
dxDBGridColumn44: TdxDBGridColumn;
dxDBGridColumn45: TdxDBGridColumn;
dxDBGrid15: TdxDBGrid;
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;
dxDBGridColumn80: TdxDBGridColumn;
dxDBGridColumn81: TdxDBGridColumn;
dxDBGridColumn82: TdxDBGridColumn;
dxDBGridColumn83: TdxDBGridColumn;
dxDBGridColumn84: TdxDBGridColumn;
dxDBGridColumn85: TdxDBGridColumn;
dxDBGridColumn86: TdxDBGridColumn;
dxDBGridColumn87: TdxDBGridColumn;
dxDBGrid16: TdxDBGrid;
dxDBGridColumn88: 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;
dxDBGridColumn107: TdxDBGridColumn;
dxDBGridColumn108: TdxDBGridColumn;
Label34: TLabel;
Edit14: TEdit;
Label33: TLabel;
Edit13: TEdit;
bsSkinTabSheet5: TbsSkinTabSheet;
bsSkinPanel10: TbsSkinPanel;
Label35: TLabel;
Label36: TLabel;
Label37: TLabel;
Label38: TLabel;
Label39: TLabel;
Label40: TLabel;
Label41: TLabel;
Label42: TLabel;
Label43: TLabel;
Edit15: TEdit;
Edit16: TEdit;
Edit17: TEdit;
wwDBDateTimePicker17: TwwDBDateTimePicker;
wwDBDateTimePicker18: TwwDBDateTimePicker;
wwDBDateTimePicker19: TwwDBDateTimePicker;
wwDBDateTimePicker20: TwwDBDateTimePicker;
RxDBLookupCombo5: TRxDBLookupCombo;
bsSkinButton8: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
Edit18: TEdit;
Panel5: TPanel;
dxDBGrid17: TdxDBGrid;
dxDBGridColumn109: TdxDBGridColumn;
dxDBGridMaskColumn43: TdxDBGridMaskColumn;
dxDBGridMaskColumn44: TdxDBGridMaskColumn;
dxDBGridColumn110: TdxDBGridColumn;
dxDBGridColumn111: TdxDBGridColumn;
dxDBGridColumn112: TdxDBGridColumn;
dxDBGrid18: TdxDBGrid;
dxDBGridColumn113: TdxDBGridColumn;
dxDBGridMaskColumn45: TdxDBGridMaskColumn;
dxDBGridColumn114: TdxDBGridColumn;
dxDBGridColumn115: TdxDBGridColumn;
dxDBGrid19: TdxDBGrid;
dxDBGridMaskColumn47: TdxDBGridMaskColumn;
dxDBGridMaskColumn50: TdxDBGridMaskColumn;
dxDBGridDateColumn7: TdxDBGridDateColumn;
dxDBGridColumn118: TdxDBGridColumn;
dxDBGridMaskColumn52: TdxDBGridMaskColumn;
dxDBGridMaskColumn56: TdxDBGridMaskColumn;
dxDBGridMaskColumn57: TdxDBGridMaskColumn;
v_op_bscard: TADOQuery;
v_op_bscard1: TDataSource;
wwDBComboBox46: TwwDBComboBox;
Label44: TLabel;
Label45: TLabel;
RxDBLookupCombo15: TRxDBLookupCombo;
Label46: TLabel;
RxDBLookupCombo16: TRxDBLookupCombo;
ComboBoxObjBsCard: TComboBox;
ComboBoxObjairi: TComboBox;
ComboBoxObjAire: TComboBox;
ComboBoxObjSeai: TComboBox;
ComboBoxObjSeae: TComboBox;
Label47: TLabel;
Edit19: TEdit;
Label48: TLabel;
Edit20: TEdit;
Label49: TLabel;
Edit21: TEdit;
Label50: TLabel;
RxDBLookupCombo6: TRxDBLookupCombo;
Label51: TLabel;
RxDBLookupCombo7: TRxDBLookupCombo;
Edit22: TEdit;
Label52: TLabel;
Label53: TLabel;
Edit23: TEdit;
Label54: TLabel;
RxDBLookupCombo8: TRxDBLookupCombo;
Label55: TLabel;
RxDBLookupCombo9: TRxDBLookupCombo;
Label56: TLabel;
Edit24: TEdit;
Label57: TLabel;
Edit25: TEdit;
Label58: TLabel;
Edit26: TEdit;
Label59: TLabel;
RxDBLookupCombo10: TRxDBLookupCombo;
Label60: TLabel;
RxDBLookupCombo11: TRxDBLookupCombo;
Label61: TLabel;
Edit27: TEdit;
Label62: TLabel;
Edit28: TEdit;
Label63: TLabel;
Edit29: TEdit;
Label64: TLabel;
RxDBLookupCombo12: TRxDBLookupCombo;
Label65: TLabel;
RxDBLookupCombo13: TRxDBLookupCombo;
wwDBLookupCombo49: TwwDBLookupCombo;
Edit30: TEdit;
Label66: TLabel;
Label67: TLabel;
Label68: TLabel;
wwDBComboBox31: TwwDBComboBox;
Label69: TLabel;
wwDBLookupCombo1: TwwDBLookupCombo;
Label70: TLabel;
Edit31: TEdit;
Label71: TLabel;
wwDBComboBox1: TwwDBComboBox;
Label72: TLabel;
wwDBComboBox2: TwwDBComboBox;
Label73: TLabel;
wwDBComboBox3: TwwDBComboBox;
Label74: TLabel;
wwDBComboBox4: TwwDBComboBox;
Label75: TLabel;
Edit32: TEdit;
Label76: TLabel;
Edit33: TEdit;
bsSkinPanel11: TbsSkinPanel;
bsSkinPanel9: TbsSkinPanel;
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox3: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox4: TbsSkinCheckRadioBox;
bsSkinPanel12: TbsSkinPanel;
bsSkinCheckRadioBox5: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox6: TbsSkinCheckRadioBox;
bsSkinPanel13: TbsSkinPanel;
Label77: TLabel;
ComboBoxCurry: TComboBox;
Label78: TLabel;
Edit34: TEdit;
t_ch_cust: TADOQuery;
t_ch_cust1: TDataSource;
t_ch_fee_detail: TADOQuery;
t_op_bscard_all: TADOQuery;
t_op_bscard_all1: TDataSource;
Label79: TLabel;
wwDBComboBox5: TwwDBComboBox;
Label80: TLabel;
Edit35: TEdit;
Splitter1: TSplitter;
dxDBGrid19Column26: TdxDBGridColumn;
dxDBGrid19Column27: TdxDBGridColumn;
dxDBGrid19Column28: TdxDBGridColumn;
dxDBGrid19Column29: TdxDBGridColumn;
dxDBGrid19Column30: TdxDBGridCheckColumn;
kbmMemTable1: TkbmMemTable;
bsSkinButton11: TbsSkinButton;
bsSkinCheckRadioBox7: TbsSkinCheckRadioBox;
bsSkinButton12: TbsSkinButton;
dxDBGrid19Column31: TdxDBGridMaskColumn;
Label81: TLabel;
ComboBoxObjBs: TComboBox;
N12: TMenuItem;
N13: TMenuItem;
Label82: TLabel;
DBComboBoxEh2: TDBComboBoxEh;
Label83: TLabel;
bsSkinButton13: TbsSkinButton;
bsSkinButton14: TbsSkinButton;
bsSkinButton15: TbsSkinButton;
bsSkinButton16: TbsSkinButton;
dxDBGrid19Column14: TdxDBGridColumn;
dxDBGrid19Column15: TdxDBGridColumn;
lblSum: TLabel;
lblSum1: TLabel;
wwDBDateTimePicker21: TwwDBDateTimePicker;
wwDBDateTimePicker22: TwwDBDateTimePicker;
bsSkinLabel1: TbsSkinLabel;
dxDBGrid19Column16: TdxDBGridColumn;
bsSkinButton17: TbsSkinButton;
OpenDialog1: TOpenDialog;
kbmtblbs: TkbmMemTable;
kbmtblbsOrdNo: TIntegerField;
kbmtblbsMBLNO: TStringField;
kbmtblbsAMT: TStringField;
bsSkinButton18: TbsSkinButton;
kbmbscard: TkbmMemTable;
IntegerField1: TIntegerField;
StringField1: TStringField;
StringField2: TStringField;
kbmbscardETD: TStringField;
kbmbscardFeeName: TStringField;
kbmbscardCURRENCY: TStringField;
kbmbscardISOK: TBooleanField;
SaveDialog1: TSaveDialog;
PopupMenu3: TPopupMenu;
N14: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
kbmbscardUSDAMT: TStringField;
kbmbscardFeeNames: TStringField;
kbmbscardFee: TkbmMemTable;
IntegerField2: TIntegerField;
StringField3: TStringField;
StringField9: TStringField;
kbmbscardCTN: TStringField;
kbmbscardDIFFAMT: TStringField;
kbmbscardDIFFUSDAMT: TStringField;
kbmbscardttl: TkbmMemTable;
IntegerField3: TIntegerField;
StringField4: TStringField;
StringField8: TStringField;
StringField11: TStringField;
BooleanField1: TBooleanField;
StringField13: TStringField;
StringField14: TStringField;
kbmbscardSALE: TStringField;
kbmbscardOP: TStringField;
kbmbscardttlOP: TStringField;
kbmbscardttlSALE: TStringField;
dxDBGrid19Column17: TdxDBGridColumn;
dxDBGrid19Column18: TdxDBGridColumn;
N17: TMenuItem;
N18: TMenuItem;
kbmVsl: TkbmMemTable;
StringField5: TStringField;
StringField6: TStringField;
StringField20: TStringField;
StringField21: TStringField;
kbmVslVESSEL: TStringField;
kbmVslVOY: TStringField;
kbmVslFEESTATUS: TStringField;
dxDBGrid19Column19: TdxDBGridColumn;
dxDBGrid19Column20: TdxDBGridColumn;
dxDBGrid17Column7: TdxDBGridColumn;
Edit36: TEdit;
Label84: TLabel;
procedure bsSkinButton3Click(Sender: TObject);
procedure bs_textChange(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure MenuItem1Click(Sender: TObject);
procedure Edit4KeyPress(Sender: TObject; var Key: Char);
procedure FrameEnter(Sender: TObject);
procedure bsSkinPageControl1Change(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton7Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N7Click(Sender: TObject);
procedure N9Click(Sender: TObject);
procedure RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo3KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo4KeyPress(Sender: TObject; var Key: Char);
procedure dxDBGrid2DblClick(Sender: TObject);
procedure dxDBGrid4DblClick(Sender: TObject);
procedure dxDBGrid7DblClick(Sender: TObject);
procedure dxDBGrid10DblClick(Sender: TObject);
procedure N11Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure ComboBoxObjBsCardEnter(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure ComboBoxObjairiEnter(Sender: TObject);
procedure ComboBoxObjAireEnter(Sender: TObject);
procedure ComboBoxObjSeaiEnter(Sender: TObject);
procedure ComboBoxObjSeaeEnter(Sender: TObject);
procedure dxDBGrid19DblClick(Sender: TObject);
procedure bsSkinCheckRadioBox5Click(Sender: TObject);
procedure wwDBLookupCombo49KeyPress(Sender: TObject; var Key: Char);
procedure dxDBGrid19Column22CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean;
var ADone: Boolean);
procedure RxDBLookupCombo14Enter(Sender: TObject);
procedure dxDBGrid19Column24CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean;
var ADone: Boolean);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinCheckRadioBox7Click(Sender: TObject);
procedure Edit34KeyPress(Sender: TObject; var Key: Char);
procedure bsSkinButton12Click(Sender: TObject);
procedure ComboBoxObjBsEnter(Sender: TObject);
procedure ComboBoxObjBsKeyPress(Sender: TObject; var Key: Char);
procedure N13Click(Sender: TObject);
procedure DBComboBoxEh2DropDown(Sender: TObject);
procedure dxDBGrid19Column30Change(Sender: TObject);
procedure kbmMemTable1Field10Change(Sender: TField);
procedure bsSkinButton13Click(Sender: TObject);
procedure bsSkinButton14Click(Sender: TObject);
procedure bsSkinButton16Click(Sender: TObject);
procedure bsSkinButton15Click(Sender: TObject);
procedure dxDBGrid17SelectedCountChange(Sender: TObject);
procedure bsSkinButton17Click(Sender: TObject);
procedure bsSkinButton18Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure v_op_bscard1DataChange(Sender: TObject; Field: TField);
procedure N18Click(Sender: TObject);
private
function GetCustID(var aCustID : String) : Boolean; //<2F><>ȡ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
function _GetCustID(var aCustID : String) : Boolean; //<2F><>ȡ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
Procedure ExportExcelFile(FileName: string; bWriteTitle: Boolean; aDataSet: TDataSet);
{ Private declarations }
public
{ Public declarations }
amtDr,usdDr,amtcr,usdcr:Double;
mblNos,mblNosOK:WideString;
Procedure balance_dms;
Procedure balance_haier;
Procedure expvsl;
procedure update_tablesb(bs_text,sno:string;do_ban1:TDataSource;table:TADOQuery);
end;
var
arXlsBegin: array[0..5] of Word = ($809, 8, 0, $10, 0,0);
arXlsEnd: array[0..1] of Word = ($0A, 00);
arXlsString: array[0..5] of Word = ($204, 0, 0, 0, 0, 0);
arXlsNumber: array[0..4] of Word = ($203, 14, 0, 0, 0);
arXlsInteger: array[0..4] of Word = ($27E, 10, 0, 0, 0);
arXlsBlank: array[0..4] of Word = ($201, 6, 0, 0, $17);
implementation
uses u_main, my_sys_function, u_data_share, FindListu;
{$R *.dfm}
Procedure Tfra_ch_add_do.ExportExcelFile(FileName: string; bWriteTitle: Boolean; aDataSet: TDataSet);
var
i,j: integer;
Col , row: word;
ABookMark: TBookMark;
aFileStream: TFileStream;
procedure incColRow; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>
begin
if Col = ADataSet.FieldCount - 1 then
begin
Inc(Row);
Col :=0;
end
else
Inc(Col);
end;
procedure WriteStringCell(AValue: string);//д<>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
var
L: Word;
begin
L := Length(AValue);
arXlsString[1] := 8 + L;
arXlsString[2] := Row;
arXlsString[3] := Col;
arXlsString[5] := L;
aFileStream.WriteBuffer(arXlsString, SizeOf (arXlsString));
aFileStream.WriteBuffer(Pointer(AValue)^, L);
IncColRow;
end;
procedure WriteIntegerCell(AValue: integer);//д<><D0B4><EFBFBD><EFBFBD>
var
V: Integer;
begin
arXlsInteger[2] := Row;
arXlsInteger[3] := Col;
aFileStream.WriteBuffer(arXlsInteger, SizeOf(arXlsInteger));
V := (AValue shl 2) or 2;
aFileStream.WriteBuffer(V, 4);
IncColRow;
end;
procedure WriteFloatCell(AValue: double );//д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
arXlsNumber[2] := Row;
arXlsNumber[3] := Col;
aFileStream.WriteBuffer(arXlsNumber, SizeOf(arXlsNumber));
aFileStream.WriteBuffer(AValue, 8);
IncColRow;
end;
begin
if FileExists(FileName) then DeleteFile(FileName); //<2F>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD>ɾ<EFBFBD><C9BE>
aFileStream := TFileStream.Create(FileName, fmCreate);
Try //д<>ļ<EFBFBD>ͷ<EFBFBD><CDB7>
aFileStream.WriteBuffer(arXlsBegin, SizeOf(arXlsBegin)); //д<><D0B4>ͷ <20><>
Col := 0; Row := 0;
if bWriteTitle then
begin
for i := 0 to aDataSet.FieldCount - 1 do
WriteStringCell(aDataSet.Fields[i].FieldName);
end;
//д<><D0B4><EFBFBD>ݼ<EFBFBD><DDBC>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
aDataSet.DisableControls;
//ABookMark := aDataSet.GetBookmark;
aDataSet.First ;
while not aDataSet.Eof do
begin
for i := 0 to aDataSet.FieldCount - 1 do
case ADataSet.Fields[i].DataType of
ftSmallint, ftInteger, ftWord, ftAutoInc, ftBytes:
WriteIntegerCell(aDataSet.Fields[i].AsInteger);
ftFloat, ftCurrency, ftBCD:
WriteFloatCell(StrToFloat(FormatFloat('0.00;-0.00;0',aDataSet.Fields[i].AsFloat)))
else
WriteStringCell(aDataSet.Fields[i].AsString);
end;
aDataSet.Next;
Application.ProcessMessages;
end;
//д<>ļ<EFBFBD>β <20><>
AFileStream.WriteBuffer(arXlsEnd, SizeOf(arXlsEnd));
//if ADataSet.BookmarkValid(ABookMark) then aDataSet.GotoBookmark(ABookMark);
Finally
AFileStream.Free;
ADataSet.EnableControls;
end;
end;
function Tfra_ch_add_do.GetCustID(var aCustID : String) : Boolean;
var aQuery : TAdoQuery;
S : String;
begin
//<2F><>ȡ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
Result:=false;
S:=Trim(ComboBoxObjBsCard.Text);
if (S<>'') and (length(S)>10) then begin
// if ComboBoxObjBsCard.items.
aCustID:=Trim(Copy(S,11,length(S)-10));
result:=true;
exit;
end;
if S='' then begin
aCustID:='';
Result:=true;
end else begin
aQuery:=CreateAdoQuery;
with aQuery do
try
SQL.Add('Select <20><><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>');
SQL.Add('from t_crm_client');
SQL.Add('where <20><><EFBFBD><EFBFBD> like ''%'+S+'%''');
SQL.Add('or <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> like ''%'+S+'%''');
SQL.Add('Order By <20><><EFBFBD><EFBFBD>');
Open;
if RecordCount=0 then begin
MessageDlg('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>ȷ<EFBFBD><C8B7>',mtWarning,[mbOK],0);
end else if RecordCount=1 then begin
ComboBoxObjBsCard.Text:=FixLenStr(FieldByName('<27><><EFBFBD><EFBFBD>').AsString,10)
+' '+FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
aCustID:=FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
Result:=true;
end else begin
S:=SQL.Text;
frmFindList:=TfrmFindList.Create(Self);
try
with frmFindList, qryCust, SQL do begin
Close;Clear;
Text:=S;
Open;
if ShowModal=mrOK then begin
ComboBoxObjBsCard.Text:=FixLenStr(FieldByName('<27><><EFBFBD><EFBFBD>').AsString,10)
+' '+FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
aCustID:=FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
Result:=true;
end;
Close;
end;
finally
FreeAndNil(frmFindList);
end;
end;
finally
Close;
FreeAndNil(aQuery);
end;
end;
end;
function Tfra_ch_add_do._GetCustID(var aCustID : String) : Boolean;
var aQuery : TAdoQuery;
S : String;
begin
//<2F><>ȡ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
Result:=false;
S:=Trim(ComboBoxObjBs.Text);
if (S<>'') and (length(S)>10) then begin
aCustID:=Trim(Copy(S,11,length(S)-10));
result:=true;
exit;
end;
if S='' then begin
aCustID:='';
Result:=true;
end else begin
aQuery:=CreateAdoQuery;
with aQuery do
try
SQL.Add('Select <20><><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>');
SQL.Add('from t_crm_client');
SQL.Add('where <20><><EFBFBD><EFBFBD> like ''%'+S+'%''');
SQL.Add('or <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> like ''%'+S+'%''');
SQL.Add('Order By <20><><EFBFBD><EFBFBD>');
Open;
if RecordCount=0 then begin
MessageDlg('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>ȷ<EFBFBD><C8B7>',mtWarning,[mbOK],0);
end else if RecordCount=1 then begin
ComboBoxObjBs.Text:=FixLenStr(FieldByName('<27><><EFBFBD><EFBFBD>').AsString,10)
+' '+FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
aCustID:=FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
Result:=true;
end else begin
S:=SQL.Text;
frmFindList:=TfrmFindList.Create(Self);
try
with frmFindList, qryCust, SQL do begin
Close;Clear;
Text:=S;
Open;
if ShowModal=mrOK then begin
ComboBoxObjBs.Text:=FixLenStr(FieldByName('<27><><EFBFBD><EFBFBD>').AsString,10)
+' '+FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
aCustID:=FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
Result:=true;
end;
Close;
end;
finally
FreeAndNil(frmFindList);
end;
end;
finally
Close;
FreeAndNil(aQuery);
end;
end;
end;
procedure Tfra_ch_add_do.bsSkinButton3Click(Sender: TObject);
begin
ComboBoxObjSeae.Text:='';
Edit4.text:='';
Edit3.Text:='';
Edit2.text:='';
wwDBDateTimePicker1.Clear;
wwDBDateTimePicker2.clear;
wwDBDateTimePicker3.clear;
wwDBDateTimePicker4.clear;
end;
procedure Tfra_ch_add_do.bs_textChange(Sender: TObject);
begin
if bs_text.text='' then
exit;
case strtoint(bs_text.text) of
1,7: //<2F><>Ʊ<EFBFBD>ͷ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>
begin
dxDBGrid1Column3.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGrid1Column4.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid1Column4.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid3Column2.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGrid3Column3.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid3Column3.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn5.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn6.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn6.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn7.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn8.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn8.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn13.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn14.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn14.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn15.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn16.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn16.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn21.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn22.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn22.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn23.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn24.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn24.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn111.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn112.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn112.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn114.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn115.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn115.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid1Column6.Visible:=false;
dxDBGrid3Column4.Visible:=false;
dxDBGrid5Column6.Visible:=false;
dxDBGrid6Column4.Visible:=false;
dxDBGrid8Column6.Visible:=false;
dxDBGrid9Column4.Visible:=false;
dxDBGrid11Column6.Visible:=false;
dxDBGrid12Column4.Visible:=false;
dxDBGridColumn109.Visible:=true;
dxDBGridColumn113.Visible:=true;
end;
2: //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
dxDBGrid1Column3.Caption:='Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid1Column4.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid1Column4.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid3Column2.Caption:='Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid3Column3.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid3Column3.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn5.Caption:='Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn6.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn6.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn7.Caption:='Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn8.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn8.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn13.Caption:='Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn14.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn14.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn15.Caption:='Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn16.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn16.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn21.Caption:='Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn22.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn22.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn23.Caption:='Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn24.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn24.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn111.Caption:='Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn112.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn112.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn114.Caption:='Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn115.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn115.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid1Column6.Visible:=true;
dxDBGrid3Column4.Visible:=true;
dxDBGrid5Column6.Visible:=true;
dxDBGrid6Column4.Visible:=true;
dxDBGrid8Column6.Visible:=true;
dxDBGrid9Column4.Visible:=true;
dxDBGrid11Column6.Visible:=true;
dxDBGrid12Column4.Visible:=true;
dxDBGridColumn109.Visible:=True;
dxDBGridColumn113.Visible:=True;
end;
3: //<2F>շѽ<D5B7><D1BD><EFBFBD>
begin
dxDBGrid1Column3.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGrid1Column4.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid1Column4.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid3Column2.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGrid3Column3.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid3Column3.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn5.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn6.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn6.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn7.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn8.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn8.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn13.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn14.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn14.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn15.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn16.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn16.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn21.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn22.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn22.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn23.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn24.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn24.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn111.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn112.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn112.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn114.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn115.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn115.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid1Column6.Visible:=true;
dxDBGrid3Column4.Visible:=true;
dxDBGrid5Column6.Visible:=true;
dxDBGrid6Column4.Visible:=true;
dxDBGrid8Column6.Visible:=true;
dxDBGrid9Column4.Visible:=true;
dxDBGrid11Column6.Visible:=true;
dxDBGrid12Column4.Visible:=true;
dxDBGridColumn109.Visible:=True;
dxDBGridColumn113.Visible:=True;
end;
4: //<2F><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>
begin
dxDBGrid1Column3.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGrid1Column4.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid1Column4.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid3Column2.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGrid3Column3.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid3Column3.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn5.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn6.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn6.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn7.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn8.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn8.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn13.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn14.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn14.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn15.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn16.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn16.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn21.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn22.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn22.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn23.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn24.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn24.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn111.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn112.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn112.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn114.Caption:='<27><><EFBFBD><EFBFBD>';
dxDBGridColumn115.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn115.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid1Column6.Visible:=true;
dxDBGrid3Column4.Visible:=true;
dxDBGrid5Column6.Visible:=true;
dxDBGrid6Column4.Visible:=true;
dxDBGrid8Column6.Visible:=true;
dxDBGrid9Column4.Visible:=true;
dxDBGrid11Column6.Visible:=true;
dxDBGrid12Column4.Visible:=true;
dxDBGridColumn109.Visible:=True;
dxDBGridColumn113.Visible:=True;
end;
6: //<2F>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD>
begin
dxDBGrid1Column3.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGrid1Column4.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid1Column4.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid3Column2.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGrid3Column3.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid3Column3.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn5.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn6.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn6.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn7.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn8.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn8.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn13.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn14.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn14.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn15.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn16.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn16.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn21.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn22.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn22.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn23.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn24.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn24.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn111.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn112.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn112.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn114.Caption:='Ӧ<>ս<EFBFBD><D5BD><EFBFBD>';
dxDBGridColumn115.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGridColumn115.FieldName:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
dxDBGrid1Column6.Visible:=true;
dxDBGrid3Column4.Visible:=true;
dxDBGrid5Column6.Visible:=true;
dxDBGrid6Column4.Visible:=true;
dxDBGrid8Column6.Visible:=true;
dxDBGrid9Column4.Visible:=true;
dxDBGrid11Column6.Visible:=true;
dxDBGrid12Column4.Visible:=true;
dxDBGridColumn109.Visible:=True;
dxDBGridColumn113.Visible:=True;
end;
end;
end;
procedure Tfra_ch_add_do.bsSkinButton10Click(Sender: TObject);
var
str_fee,str_op:widestring;
op_str,fee_str,sum_str,Str_bill:widestring;
str:String;
begin
//<2F><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>ѯ
if not t_op_bscard_all.active then
t_op_bscard_all.Open;
t_ch_fee.close;
t_ch_fee_sum.close;
t_op_seae.Close;
t_ch_fee.DataSource:=t_op_seae1;
t_ch_fee_sum.DataSource:=t_op_seae1;
case strtoint(bs_text.text) of
1:
begin
str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+<2B><><EFBFBD>뿪Ʊ) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1 and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+<2B><><EFBFBD>뿪Ʊ) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1 and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2: //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox1.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox1.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3,8:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox1.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox1.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox1.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox1.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6: //<2F>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD>
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
// if not strtobool(get_parameters_value(46,'true')) then
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
{
if RxDBLookupCombo2.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo2.DisplayValues[1]+'''';
}
str:=Trim(ComboBoxObjseae.Text);
if (Str<>'') and (length(Str)>10) then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+Trim(Copy(Str,11,length(Str)-10))+'''';
if RxDBLookupCombo6.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo6.DisplayValues[0]+'''';
if RxDBLookupCombo7.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo7.DisplayValues[1]+'''';
{
if Trim(Edit20.Text)<>'' then begin
str_fee:=str_fee+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
}
str_op:='';
if Edit4.text<>''then
str_op:=str_op+' and t_op_seae.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''';
if Edit2.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
if Edit13.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><ECB5A5> like '+''''+'%'+Edit13.text+'%'+'''';
if Edit32.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit32.text+'%'+'''';
if Edit3.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit3.text+'%'+'''';
if Edit21.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit21.text+'%'+'''';
if wwDBLookupCombo1.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo1.text+'%'+'''';
if Edit31.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+Edit31.text+'%'+'''';
if wwDBDateTimePicker1.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
if wwDBDateTimePicker2.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
if wwDBDateTimePicker3.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker3.text+'''';
if wwDBDateTimePicker4.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker4.text+'''';
if Trim(Edit20.Text)<>'' then begin
str_op:=str_op+' and <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
if strtoint(bs_text.text)=8 then
str_op:='where t_op_seae.<2E><><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and t_op_seae.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op
else begin
str_op:='where t_op_seae.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op;
end;
case strtoint(bs_text.text) of
1,7:
begin
str_op:=str_op+' and '+open_data('1002','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
2,6:
begin
str_op:=str_op+' and '+open_data('1004','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
3,4:
begin
str_op:=str_op+' and '+open_data('1003','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
end;
op_str:='select * from t_op_seae '+str_op
+default_sort(53,'t_op_seae','','desc');
case strtoint(bs_text.text) of
1:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
7:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit20.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
2:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit20.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
3:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit20.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
4:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit20.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
6:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit20.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
8:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_seae where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>) order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_seae where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>) group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
end;
t_ch_fee.Close;
t_ch_fee_sum.close;
t_op_seae.close;
t_op_seae.sql.clear;
t_op_seae.sql.add(op_str);
t_op_seae.open;
//ShowMessage(op_str);
t_ch_fee.sql.clear;
t_ch_fee.sql.add(fee_str);
t_ch_fee.open;
// ShowMessage(fee_str);
t_ch_fee_sum.sql.clear;
t_ch_fee_sum.sql.add(sum_str);
t_ch_fee_sum.open;
end;
procedure Tfra_ch_add_do.N1Click(Sender: TObject);
var
i,j,c,f:integer;
RE:Boolean;
str,feestr,sumstr:widestring;
begin
Label83.Caption:='';
amtDr:=0;
usdDr:=0;
amtcr:=0;
usdcr:=0;
//ҵ<><D2B5><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
if bsSkinTabSheet1.Showing then
begin
if not t_op_seae.Active then exit;
if t_op_seae.IsEmpty then exit;
end;
if bsSkinTabSheet2.Showing then
begin
if not t_op_seai.Active then exit;
if t_op_seai.IsEmpty then exit;
end;
if bsSkinTabSheet3.Showing then
begin
if not t_op_aire.Active then exit;
if t_op_aire.IsEmpty then exit;
end;
if bsSkinTabSheet4.Showing then
begin
if not t_op_airi.Active then exit;
if t_op_airi.IsEmpty then exit;
end;
if bsSkinTabSheet5.Showing then
begin
if not v_op_bscard.Active then exit;
if v_op_bscard.IsEmpty then exit;
end;
if bsSkinCheckRadioBox6.Checked then
c:=1
else
c:=0;
t_ch_fee.DisableControls;
t_ch_fee_sum.DisableControls;
try
if bsSkinPanel9.Visible then
begin
i:=1;
if bsSkinCheckRadioBox3.Checked then
j:=1
else
j:=0;
end
else
begin
i:=0;
j:=0;
end;
RE:=false;
t_rate.open;
feestr:=t_ch_fee.SQL.text;
if bsSkinTabSheet1.Showing then
begin
delete_do_type_num:=1;
t_op_seae.DisableControls;
try
if dxDBGrid2.SelectedCount>=1 then
begin
t_ch_fee.DataSource:=t_op_bscard_all1;
t_ch_fee_sum.DataSource:=t_op_bscard_all1;
for f:=0 to dxDBGrid2.SelectedCount-1 do
begin
t_op_seae.GotoBookmark(pointer(dxDBGrid2.selectedrows[f]));
if str='' then
str:='<27><><EFBFBD><EFBFBD>='+''''+t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
else
str:=str+' or <20><><EFBFBD><EFBFBD>='+''''+t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
end;
dxDBGrid2.ClearSelection;
str:='and ('+str+')';
t_ch_fee_detail.close;
t_ch_fee_detail.sql.text:=StringReplace(feestr,'and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>',str,[rfReplaceAll]);
t_ch_fee_detail.open;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_yewwusb(t_op_seae,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid2,i,j,c,ComboBoxCurry.text,Edit19.text)
else
shen_yewwu(t_op_seae,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid2,i,j,Edit19.text);
t_ch_fee_detail.close;
t_op_seae.close;
t_op_seae.open;
end else begin
{
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_yewwusb(t_op_seae,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid2,i,j,c,ComboBoxCurry.text)
else
shen_yewwu(t_op_seae,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid2,i,j);
<20>ƽ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>û<EFBFBD>б<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݾ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
end;
finally
t_op_seae.EnableControls;
t_ch_fee.DataSource:=t_op_seae1;
t_ch_fee_sum.DataSource:=t_op_seae1;
end;
end;
if bsSkinTabSheet2.Showing then
begin
delete_do_type_num:=2;
t_op_seai.DisableControls;
try
if dxDBGrid4.SelectedCount>=1 then
begin
t_ch_fee.DataSource:=t_op_bscard_all1;
t_ch_fee_sum.DataSource:=t_op_bscard_all1;
for f:=0 to dxDBGrid4.SelectedCount-1 do
begin
t_op_seai.GotoBookmark(pointer(dxDBGrid4.selectedrows[f]));
if str='' then
str:='<27><><EFBFBD><EFBFBD>='+''''+t_op_seai.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
else
str:=str+' or <20><><EFBFBD><EFBFBD>='+''''+t_op_seai.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
end;
dxDBGrid4.ClearSelection;
str:='and ('+str+')';
t_ch_fee_detail.close;
t_ch_fee_detail.sql.text:=StringReplace(feestr,'and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>',str,[rfReplaceAll]);
t_ch_fee_detail.open;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_yewwusb(t_op_seai,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid4,i,j,c,ComboBoxCurry.text,Edit19.text)
else
shen_yewwu(t_op_seai,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid4,i,j,Edit19.text);
t_ch_fee_detail.close;
t_op_seai.close;
t_op_seai.open;
end else begin
{
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_yewwusb(t_op_seai,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid4,i,j,c,ComboBoxCurry.text)
else
shen_yewwu(t_op_seai,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid4,i,j);
<20>ƽ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>û<EFBFBD>б<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݾ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
end;
finally
t_op_seai.EnableControls;
t_ch_fee.DataSource:=t_op_seai1;
t_ch_fee_sum.DataSource:=t_op_seai1;
end;
end;
if bsSkinTabSheet3.Showing then
begin
delete_do_type_num:=3;
t_op_aire.DisableControls;
try
if dxDBGrid7.SelectedCount>=1 then
begin
t_ch_fee.DataSource:=t_op_bscard_all1;
t_ch_fee_sum.DataSource:=t_op_bscard_all1;
for f:=0 to dxDBGrid7.SelectedCount-1 do
begin
t_op_aire.GotoBookmark(pointer(dxDBGrid7.selectedrows[f]));
if str='' then
str:='<27><><EFBFBD><EFBFBD>='+''''+t_op_aire.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
else
str:=str+' or <20><><EFBFBD><EFBFBD>='+''''+t_op_aire.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
end;
dxDBGrid7.ClearSelection;
str:='and ('+str+')';
t_ch_fee_detail.close;
t_ch_fee_detail.sql.text:=StringReplace(feestr,'and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>',str,[rfReplaceAll]);
t_ch_fee_detail.open;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_yewwusb(t_op_aire,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid7,i,j,c,ComboBoxCurry.text,Edit19.text)
else
shen_yewwu(t_op_aire,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid7,i,j,Edit19.text);
t_ch_fee_detail.close;
t_op_aire.close;
t_op_aire.open;
end else begin
{
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_yewwusb(t_op_aire,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid7,i,j,c,ComboBoxCurry.text)
else
shen_yewwu(t_op_aire,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid7,i,j);
<20>ƽ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>û<EFBFBD>б<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݾ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
end;
finally
t_op_aire.EnableControls;
t_ch_fee.DataSource:=t_op_aire1;
t_ch_fee_sum.DataSource:=t_op_aire1;
end;
end;
if bsSkinTabSheet4.Showing then
begin
delete_do_type_num:=4;
t_op_airi.DisableControls;
try
if dxDBGrid10.SelectedCount>=1 then
begin
t_ch_fee.DataSource:=t_op_bscard_all1;
t_ch_fee_sum.DataSource:=t_op_bscard_all1;
for f:=0 to dxDBGrid10.SelectedCount-1 do
begin
t_op_airi.GotoBookmark(pointer(dxDBGrid10.selectedrows[f]));
if str='' then
str:='<27><><EFBFBD><EFBFBD>='+''''+t_op_airi.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
else
str:=str+' or <20><><EFBFBD><EFBFBD>='+''''+t_op_airi.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
end;
dxDBGrid10.ClearSelection;
str:='and ('+str+')';
t_ch_fee_detail.close;
t_ch_fee_detail.sql.text:=StringReplace(feestr,'and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>',str,[rfReplaceAll]);
t_ch_fee_detail.open;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_yewwusb(t_op_airi,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid10,i,j,c,ComboBoxCurry.text,Edit19.text)
else
shen_yewwu(t_op_airi,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid10,i,j,Edit19.text);
t_ch_fee_detail.close;
t_op_airi.close;
t_op_airi.open;
end else begin
{
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_yewwusb(t_op_airi,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid10,i,j,c,ComboBoxCurry.text)
else
shen_yewwu(t_op_airi,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid10,i,j);
<20>ƽ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>û<EFBFBD>б<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݾ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
end;
finally
t_op_airi.EnableControls;
t_ch_fee.DataSource:=t_op_airi1;
t_ch_fee_sum.DataSource:=t_op_airi1;
end;
end;
if bsSkinTabSheet5.Showing then
begin
delete_do_type_num:=5;
// kbmMemTable1.DisableControls;
try
if dxDBGrid19.SelectedCount>=1 then
begin
t_ch_fee.DataSource:=t_op_bscard_all1;
t_ch_fee_sum.DataSource:=t_op_bscard_all1;
for f:=0 to dxDBGrid19.SelectedCount-1 do
begin
kbmMemTable1.GotoBookmark(pointer(dxDBGrid19.selectedrows[f]));
// v_op_bscard.GotoBookmark(pointer(dxDBGrid19.selectedrows[f]));
if str='' then
str:='<27><><EFBFBD><EFBFBD>='+''''+kbmMemTable1.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
else
str:=str+' or <20><><EFBFBD><EFBFBD>='+''''+kbmMemTable1.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
end;
dxDBGrid19.ClearSelection;
str:='and ('+str+')';
t_ch_fee_detail.close;
t_ch_fee_detail.sql.text:=StringReplace(feestr,'and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>',str,[rfReplaceAll]);
t_ch_fee_detail.open;
if strtobool(get_parameters_value(83,'false')) then
// if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_yewwusb(TADOQuery(kbmMemTable1),bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j,c,ComboBoxCurry.text,Edit19.text) //v_op_bscard
else
shen_yewwu(TADOQuery(kbmMemTable1),bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j,Edit19.text);
t_ch_fee_detail.close;
v_op_bscard.close;
v_op_bscard.open;
kbmMemTable1.LoadFromDataSet(v_op_bscard,[mtcpostructure,mtcpoProperties,mtcpoFieldIndex]);
end else begin
if strtobool(get_parameters_value(83,'false')) then
// if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_yewwusb(TADOQuery(kbmMemTable1),bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j,c,ComboBoxCurry.text,Edit19.text)
else
shen_yewwu(TADOQuery(kbmMemTable1),bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j,Edit19.text);
t_ch_fee_detail.close;
v_op_bscard.close;
v_op_bscard.open;
kbmMemTable1.LoadFromDataSet(v_op_bscard,[mtcpostructure,mtcpoProperties,mtcpoFieldIndex]);
end;
finally
// kbmMemTable1.EnableControls;
t_ch_fee.DataSource:=v_op_bscard1;
t_ch_fee_sum.DataSource:=v_op_bscard1;
end;
end;
t_rate.close;
finally
t_ch_fee.EnableControls;
t_ch_fee_sum.EnableControls;
Edit34.SetFocus;
end;
end;
procedure Tfra_ch_add_do.MenuItem1Click(Sender: TObject);
var
i,j,c:integer;
RE:boolean;
begin
Label83.Caption:='';
amtDr:=0;
usdDr:=0;
amtcr:=0;
usdcr:=0;
//<2F><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
if not t_ch_fee.active then exit;
if t_ch_fee.IsEmpty then exit;
if bsSkinCheckRadioBox6.Checked then
c:=1
else
c:=0;
t_ch_fee.DisableControls;
t_ch_fee_sum.DisableControls;
if bsSkinPanel9.Visible then
begin
i:=1;
if bsSkinCheckRadioBox3.Checked then
j:=1
else
j:=0;
end
else
begin
i:=0;
j:=0;
end;
// RE:=false;
// if (bs_text.Text<>'3') and (do_ban1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring<>'<27><><EFBFBD><EFBFBD>') then
// RE:=true;
try
t_rate.open;
if bsSkinTabSheet1.Showing then
begin
delete_do_type_num:=1;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_fee_selectsb(bs_text.text,t_op_seae,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid1,i,j,c,ComboBoxCurry.text,Edit19.text)
else
shen_fee_select(bs_text.text,t_op_seae,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid1,i,j,Edit19.text);
end;
if bsSkinTabSheet2.Showing then
begin
delete_do_type_num:=2;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_fee_selectsb(bs_text.text,t_op_seai,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid5,i,j,c,ComboBoxCurry.text,Edit19.text)
else
shen_fee_select(bs_text.text,t_op_seai,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid5,i,j,Edit19.text);
end;
if bsSkinTabSheet3.Showing then
begin
delete_do_type_num:=3;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_fee_selectsb(bs_text.text,t_op_aire,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid8,i,j,c,ComboBoxCurry.text,Edit19.text)
else
shen_fee_select(bs_text.text,t_op_aire,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid8,i,j,Edit19.text);
end;
if bsSkinTabSheet4.Showing then
begin
delete_do_type_num:=4;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_fee_selectsb(bs_text.text,t_op_airi,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid11,i,j,c,ComboBoxCurry.text,Edit19.text)
else
shen_fee_select(bs_text.text,t_op_airi,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid11,i,j,Edit19.text);
end;
if bsSkinTabSheet5.Showing then
begin
delete_do_type_num:=5;
if strtobool(get_parameters_value(83,'false')) then
// if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
begin
shen_fee_selectsb(bs_text.text,TADOQuery(kbmMemTable1),t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid17,i,j,c,ComboBoxCurry.text,Edit19.text)
end
else
begin
shen_fee_select(bs_text.text,TADOQuery(kbmMemTable1),t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid17,i,j,Edit19.text);
end;
end;
finally
t_rate.close;
t_ch_fee.Requery();
t_ch_fee_sum.Requery();
t_ch_fee.EnableControls;
t_ch_fee_sum.EnableControls;
Edit34.SetFocus;
end;
end;
procedure Tfra_ch_add_do.Edit4KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
bsSkinButton10Click(Sender);
end;
end;
procedure Tfra_ch_add_do.FrameEnter(Sender: TObject);
begin
{
edit_open.Text:='12341234';
if strtobool(get_parameters_value(66,'false'))then
begin
Label2.Caption:='<27><><EFBFBD><EFBFBD><ECB5A5>';
Label6.Caption:='<27><><EFBFBD><EFBFBD><ECB5A5>';
end;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') then begin
N3.Visible:=false;
N6.Visible:=false;
N5.Visible:=false;
N8.Visible:=false;
end;
}
//Edit35.SetFocus;
end;
procedure Tfra_ch_add_do.bsSkinPageControl1Change(Sender: TObject);
begin
if edit_open.Text='' then
exit;
{
t_ch_fee.close;
t_ch_fee_sum.close;
t_ch_fee.DataSource.DataSet.close;
}
end;
procedure Tfra_ch_add_do.bsSkinButton1Click(Sender: TObject);
var
str_fee,str_op:widestring;
op_str,fee_str,sum_str:widestring;
str:String;
begin
//<2F><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>ѯ
if not t_op_bscard_all.active then
t_op_bscard_all.Open;
t_ch_fee.close;
t_ch_fee_sum.close;
t_op_seai.Close;
t_ch_fee.DataSource:=t_op_seai1;
t_ch_fee_sum.DataSource:=t_op_seai1;
case strtoint(bs_text.text) of
1:
begin
str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+<2B><><EFBFBD>뿪Ʊ) and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+<2B><><EFBFBD>뿪Ʊ) and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2: //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox2.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox2.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox2.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox2.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox2.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox2.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
{
if RxDBLookupCombo1.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo1.DisplayValues[1]+'''';
}
str:=Trim(ComboBoxObjseai.Text);
if (Str<>'') and (length(Str)>10) then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+Trim(Copy(Str,11,length(Str)-10))+'''';
if RxDBLookupCombo9.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo9.DisplayValues[0]+'''';
if RxDBLookupCombo8.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo8.DisplayValues[1]+'''';
{
if Trim(Edit22.Text)<>'' then begin
str_fee:=str_fee+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
}
str_op:='';
if Edit1.text<>''then
str_op:=str_op+' and t_op_seai.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
if Edit5.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit5.text+'%'+'''';
if Edit14.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD><EFBFBD><ECB5A5> like '+''''+'%'+Edit14.text+'%'+'''';
if Edit23.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit23.text+'%'+'''';
if Edit6.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit6.text+'%'+'''';
if wwDBDateTimePicker5.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker5.text+'''';
if wwDBDateTimePicker7.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker7.text+'''';
if wwDBDateTimePicker6.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker6.text+'''';
if wwDBDateTimePicker8.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker8.text+'''';
if Trim(Edit22.Text)<>'' then begin
str_op:=str_op+' and <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
str_op:='where t_op_seai.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op;
case strtoint(bs_text.text) of
1,7:
begin
str_op:=str_op+' and '+open_data('1002','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
2:
begin
str_op:=str_op+' and '+open_data('1004','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
3,4:
begin
str_op:=str_op+' and '+open_data('1003','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
end;
op_str:='select * from t_op_seai '+str_op+default_sort(54,'t_op_seai','','desc');
case strtoint(bs_text.text) of
1:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit22.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
7:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit22.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
2: //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit22.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
3:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit22.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
4:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit22.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
6:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit22.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
end;
t_ch_fee.Close;
t_ch_fee_sum.close;
t_op_seai.close;
t_op_seai.sql.clear;
t_op_seai.sql.add(op_str);
t_op_seai.open;
t_ch_fee.sql.clear;
t_ch_fee.sql.add(fee_str);
t_ch_fee.open;
t_ch_fee_sum.sql.clear;
t_ch_fee_sum.sql.add(sum_str);
t_ch_fee_sum.open;
end;
procedure Tfra_ch_add_do.bsSkinButton2Click(Sender: TObject);
begin
ComboBoxObjSeai.Text:='';
Edit1.text:='';
Edit5.Text:='';
Edit6.text:='';
wwDBDateTimePicker5.Clear;
wwDBDateTimePicker6.clear;
wwDBDateTimePicker7.clear;
wwDBDateTimePicker8.clear;
end;
procedure Tfra_ch_add_do.bsSkinButton4Click(Sender: TObject);
var
str_fee,str_op:widestring;
op_str,fee_str,sum_str:widestring;
Str:String;
begin
//<2F><><EFBFBD>˳<EFBFBD><CBB3>ڲ<EFBFBD>ѯ
if not t_op_bscard_all.active then
t_op_bscard_all.Open;
t_ch_fee.close;
t_ch_fee_sum.close;
t_op_aire.Close;
t_ch_fee.DataSource:=t_op_aire1;
t_ch_fee_sum.DataSource:=t_op_aire1;
case strtoint(bs_text.text) of
1:
begin
str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+<2B><><EFBFBD>뿪Ʊ) and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+<2B><><EFBFBD>뿪Ʊ) and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox3.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox3.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))'
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox3.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox3.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox3.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox3.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))'
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
// if not strtobool(get_parameters_value(46,'true')) then
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
{
if RxDBLookupCombo3.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo3.DisplayValues[1]+'''';
}
str:=Trim(ComboBoxObjaire.Text);
if (Str<>'') and (length(Str)>10) then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+Trim(Copy(Str,11,length(Str)-10))+'''';
if RxDBLookupCombo11.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo11.DisplayValues[0]+'''';
if RxDBLookupCombo10.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo10.DisplayValues[1]+'''';
{
if Trim(Edit24.Text)<>'' then begin
str_fee:=str_fee+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
}
str_op:='';
if Edit8.text<>''then
str_op:=str_op+' and t_op_aire.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit8.text+'%'+'''';
if Edit9.text<>''then
str_op:=str_op+' and t_op_aire.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit9.text+'%'+'''';
if Edit10.text<>''then
str_op:=str_op+' and t_op_aire.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit10.text+'%'+'''';
if Edit25.text<>''then
str_op:=str_op+' and t_op_aire.<2E><><EFBFBD><EFBFBD><ECB5A5> like '+''''+'%'+Edit25.text+'%'+'''';
if Edit26.text<>''then
str_op:=str_op+' and t_op_aire.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit26.text+'%'+'''';
if wwDBDateTimePicker9.text<>''then
str_op:=str_op+' and t_op_aire.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker9.text+'''';
if wwDBDateTimePicker11.text<>''then
str_op:=str_op+' and t_op_aire.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker11.text+'''';
if wwDBDateTimePicker10.text<>''then
str_op:=str_op+' and t_op_aire.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker10.text+'''';
if wwDBDateTimePicker12.text<>''then
str_op:=str_op+' and t_op_aire.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker12.text+'''';
if Trim(Edit24.Text)<>'' then begin
str_op:=str_op+' and <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
str_op:='where t_op_aire.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op;
case strtoint(bs_text.text) of
1,7:
begin
str_op:=str_op+' and '+open_data('1002','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','no','no');
end;
2:
begin
str_op:=str_op+' and '+open_data('1004','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','no','no');
end;
3,4:
begin
str_op:=str_op+' and '+open_data('1003','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
end;
op_str:='select * from t_op_aire '+str_op+default_sort(55,'t_op_aire','','desc');
case strtoint(bs_text.text) of
1:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit24.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
7:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit24.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
2:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit24.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
3:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit24.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
4:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit24.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
6:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit24.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
end;
t_ch_fee.Close;
t_ch_fee_sum.close;
t_op_aire.close;
t_op_aire.sql.clear;
t_op_aire.sql.add(op_str);
t_op_aire.open;
t_ch_fee.sql.clear;
t_ch_fee.sql.add(fee_str);
t_ch_fee.open;
t_ch_fee_sum.sql.clear;
t_ch_fee_sum.sql.add(sum_str);
t_ch_fee_sum.open;
end;
procedure Tfra_ch_add_do.bsSkinButton5Click(Sender: TObject);
begin
ComboBoxObjAire.text:='';
Edit8.text:='';
Edit9.Text:='';
Edit10.text:='';
wwDBDateTimePicker9.Clear;
wwDBDateTimePicker10.clear;
wwDBDateTimePicker11.clear;
wwDBDateTimePicker12.clear;
end;
procedure Tfra_ch_add_do.bsSkinButton6Click(Sender: TObject);
var
str_fee,str_op:widestring;
op_str,fee_str,sum_str:widestring;
Str:String;
begin
//<2F><><EFBFBD>˽<EFBFBD><CBBD>ڲ<EFBFBD>ѯ
if not t_op_bscard_all.active then
t_op_bscard_all.Open;
t_ch_fee.close;
t_ch_fee_sum.close;
t_op_airi.Close;
t_ch_fee.DataSource:=t_op_airi1;
t_ch_fee_sum.DataSource:=t_op_airi1;
case strtoint(bs_text.text) of
1:
begin
str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+<2B><><EFBFBD>뿪Ʊ) and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 '
else begin
if wwDBComboBox4.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox4.Text+'''';
end;
end;
end;
7:
begin
str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+<2B><><EFBFBD>뿪Ʊ) and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 '
else begin
if wwDBComboBox4.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox4.Text+'''';
end;
end;
end;
2:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox4.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox4.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox4.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox4.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox4.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox4.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
// if not strtobool(get_parameters_value(46,'true')) then
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
{
if RxDBLookupCombo4.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo4.DisplayValues[1]+'''';
}
str:=Trim(ComboBoxObjairi.Text);
if (Str<>'') and (length(Str)>10) then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+Trim(Copy(Str,11,length(Str)-10))+'''';
if RxDBLookupCombo13.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo13.DisplayValues[0]+'''';
if RxDBLookupCombo12.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo12.DisplayValues[1]+'''';
{
if Trim(Edit27.Text)<>'' then begin
str_fee:=str_fee+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
}
str_op:='';
if Edit7.text<>''then
str_op:=str_op+' and t_op_airi.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit7.text+'%'+'''';
if Edit11.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit11.text+'%'+'''';
if Edit12.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit12.text+'%'+'''';
if Edit28.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD><EFBFBD><ECB5A5> like '+''''+'%'+Edit28.text+'%'+'''';
if Edit29.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit29.text+'%'+'''';
if wwDBDateTimePicker13.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker13.text+'''';
if wwDBDateTimePicker15.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker15.text+'''';
if wwDBDateTimePicker14.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker14.text+'''';
if wwDBDateTimePicker16.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker16.text+'''';
if Trim(Edit27.Text)<>'' then begin
str_op:=str_op+' and <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
str_op:='where t_op_airi.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op;
case strtoint(bs_text.text) of
1,7:
begin
str_op:=str_op+' and '+open_data('1002','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','no','no');
end;
2:
begin
str_op:=str_op+' and '+open_data('1004','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','no','no');
end;
3,4:
begin
str_op:=str_op+' and '+open_data('1003','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
end;
op_str:='select * from t_op_airi '+str_op+default_sort(56,'t_op_airi','','desc');
case strtoint(bs_text.text) of
1:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit27.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
7:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit27.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
2:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit27.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
3:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit27.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
4:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit27.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
6:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit27.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
end;
t_ch_fee.Close;
t_ch_fee_sum.close;
t_op_airi.close;
t_op_airi.sql.clear;
t_op_airi.sql.add(op_str);
t_op_airi.open;
t_ch_fee.sql.clear;
t_ch_fee.sql.add(fee_str);
t_ch_fee.open;
t_ch_fee_sum.sql.clear;
t_ch_fee_sum.sql.add(sum_str);
t_ch_fee_sum.open;
end;
procedure Tfra_ch_add_do.bsSkinButton7Click(Sender: TObject);
begin
ComboBoxObjairi.Text:='';
Edit7.text:='';
Edit11.Text:='';
Edit12.text:='';
wwDBDateTimePicker13.Clear;
wwDBDateTimePicker14.clear;
wwDBDateTimePicker15.clear;
wwDBDateTimePicker16.clear;
end;
procedure Tfra_ch_add_do.N3Click(Sender: TObject);
var
i,j,c:integer;
begin
{
if bsSkinCheckRadioBox6.Checked then
c:=1
else
c:=0;
t_ch_fee.DisableControls;
t_ch_fee_sum.DisableControls;
try
frm_main.db.BeginTrans;
try
if bsSkinPanel9.Visible then
begin
if bsSkinCheckRadioBox1.Checked then
i:=2
else
i:=1;
if bsSkinCheckRadioBox3.Checked then
j:=1
else
j:=0;
end
else
begin
i:=0;
j:=0;
end;
t_rate.open;
if bsSkinTabSheet1.Showing then
begin
delete_do_type_num:=1;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_yewwu_cursb(t_op_seae,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid2,i,j,c,ComboBoxCurry.Text)
else
shen_yewwu_cur(t_op_seae,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid2,i,j);
end;
if bsSkinTabSheet2.Showing then
begin
delete_do_type_num:=2;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_yewwu_cursb(t_op_seai,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid4,i,j,c,ComboBoxCurry.Text)
else
shen_yewwu_cur(t_op_seai,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid4,i,j);
end;
if bsSkinTabSheet3.Showing then
begin
delete_do_type_num:=3;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_yewwu_cursb(t_op_aire,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid7,i,j,c,ComboBoxCurry.Text)
else
shen_yewwu_cur(t_op_aire,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid7,i,j);
end;
if bsSkinTabSheet4.Showing then
begin
delete_do_type_num:=4;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_yewwu_cursb(t_op_airi,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid10,i,j,c,ComboBoxCurry.Text)
else
shen_yewwu_cur(t_op_airi,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid10,i,j);
end;
if bsSkinTabSheet5.Showing then
begin
delete_do_type_num:=5;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_yewwu_cursb(v_op_bscard,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j,c,ComboBoxCurry.Text)
else
shen_yewwu_cur(v_op_bscard,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j);
end;
frm_main.db.CommitTrans;
except
MessageDlg('<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><CBA2><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>',mterror,[mbok],0);
frm_main.db.RollbackTrans;
end;
t_rate.close;
t_ch_fee.Requery();
t_ch_fee_sum.Requery();
finally
t_ch_fee.EnableControls;
t_ch_fee_sum.EnableControls;
end;
}
end;
procedure Tfra_ch_add_do.N5Click(Sender: TObject);
var
i,j,c:integer;
begin
{
if bsSkinCheckRadioBox6.Checked then
c:=1
else
c:=0;
if bsSkinPanel9.Visible then
begin
if bsSkinCheckRadioBox1.Checked then
i:=2
else
i:=1;
if bsSkinCheckRadioBox3.Checked then
j:=1
else
j:=0;
end
else
begin
i:=0;
j:=0;
end;
t_rate.open;
if bsSkinTabSheet1.Showing then
begin
delete_do_type_num:=1;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_fee_select_cursb(bs_text.text,t_op_seae,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid1,i,j,c,ComboBoxCurry.text)
else
shen_fee_select_cur(bs_text.text,t_op_seae,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid1,i,j);
end;
if bsSkinTabSheet2.Showing then
begin
delete_do_type_num:=2;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_fee_select_cursb(bs_text.text,t_op_seai,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid5,i,j,c,ComboBoxCurry.text)
else
shen_fee_select_cur(bs_text.text,t_op_seai,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid5,i,j);
end;
if bsSkinTabSheet3.Showing then
begin
delete_do_type_num:=3;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_fee_select_cursb(bs_text.text,t_op_aire,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid8,i,j,c,ComboBoxCurry.text)
else
shen_fee_select_cur(bs_text.text,t_op_aire,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid8,i,j);
end;
if bsSkinTabSheet4.Showing then
begin
delete_do_type_num:=4;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_fee_select_cursb(bs_text.text,t_op_airi,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid11,i,j,c,ComboBoxCurry.text)
else
shen_fee_select_cur(bs_text.text,t_op_airi,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid11,i,j);
end;
if bsSkinTabSheet5.Showing then
begin
delete_do_type_num:=5;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_fee_select_cursb(bs_text.text,v_op_bscard,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid17,i,j,c,ComboBoxCurry.text)
else
shen_fee_select_cur(bs_text.text,v_op_bscard,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid17,i,j);
end;
t_rate.close;
t_ch_fee.Requery();
t_ch_fee_sum.Requery();
}
end;
procedure Tfra_ch_add_do.N7Click(Sender: TObject);
var
i,j,c:integer;
begin
{
if bsSkinCheckRadioBox6.Checked then
c:=1
else
c:=0;
t_ch_fee.DisableControls;
t_ch_fee_sum.DisableControls;
try
frm_main.db.BeginTrans;
try
if bsSkinPanel9.Visible then
begin
if bsSkinCheckRadioBox1.Checked then
i:=2
else
i:=1;
if bsSkinCheckRadioBox3.Checked then
j:=1
else
j:=0;
end
else
begin
i:=0;
j:=0;
end;
t_rate.open;
if bsSkinTabSheet1.Showing then
begin
delete_do_type_num:=1;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_yewwu_feesb(t_op_seae,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid2,i,j,c,ComboBoxCurry.Text)
else
shen_yewwu_fee(t_op_seae,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid2,i,j);
end;
if bsSkinTabSheet2.Showing then
begin
delete_do_type_num:=2;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_yewwu_feesb(t_op_seai,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid4,i,j,c,ComboBoxCurry.Text)
else
shen_yewwu_fee(t_op_seai,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid4,i,j);
end;
if bsSkinTabSheet3.Showing then
begin
delete_do_type_num:=3;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_yewwu_feesb(t_op_aire,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid7,i,j,c,ComboBoxCurry.Text)
else
shen_yewwu_fee(t_op_aire,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid7,i,j);
end;
if bsSkinTabSheet4.Showing then
begin
delete_do_type_num:=4;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_yewwu_feesb(t_op_airi,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid10,i,j,c,ComboBoxCurry.Text)
else
shen_yewwu_fee(t_op_airi,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid10,i,j);
end;
if bsSkinTabSheet5.Showing then
begin
delete_do_type_num:=5;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_yewwu_feesb(v_op_bscard,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j,c,ComboBoxCurry.Text)
else
shen_yewwu_fee(v_op_bscard,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j);
end;
frm_main.db.CommitTrans;
except
MessageDlg('<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><CBA2><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>',mterror,[mbok],0);
frm_main.db.RollbackTrans;
end;
t_rate.close;
t_ch_fee.Requery();
t_ch_fee_sum.Requery();
finally
t_ch_fee.EnableControls;
t_ch_fee_sum.EnableControls;
end;
}
end;
procedure Tfra_ch_add_do.N9Click(Sender: TObject);
var
i,j,c:integer;
begin
{
if bsSkinCheckRadioBox6.Checked then
c:=1
else
c:=0;
t_ch_fee.DisableControls;
t_ch_fee_sum.DisableControls;
try
if bsSkinPanel9.Visible then
begin
if bsSkinCheckRadioBox1.Checked then
i:=2
else
i:=1;
if bsSkinCheckRadioBox3.Checked then
j:=1
else
j:=0;
end
else
begin
i:=0;
j:=0;
end;
t_rate.open;
if bsSkinTabSheet1.Showing then
begin
delete_do_type_num:=1;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_fee_select_feesb(bs_text.text,t_op_seae,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid1,i,j,c,ComboBoxCurry.text)
else
shen_fee_select_fee(bs_text.text,t_op_seae,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid1,i,j);
end;
if bsSkinTabSheet2.Showing then
begin
delete_do_type_num:=2;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_fee_select_feesb(bs_text.text,t_op_seai,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid5,i,j,c,ComboBoxCurry.text)
else
shen_fee_select_fee(bs_text.text,t_op_seai,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid5,i,j);
end;
if bsSkinTabSheet3.Showing then
begin
delete_do_type_num:=3;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_fee_select_feesb(bs_text.text,t_op_aire,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid8,i,j,c,ComboBoxCurry.text)
else
shen_fee_select_fee(bs_text.text,t_op_aire,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid8,i,j);
end;
if bsSkinTabSheet4.Showing then
begin
delete_do_type_num:=4;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_fee_select_feesb(bs_text.text,t_op_airi,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid11,i,j,c,ComboBoxCurry.text)
else
shen_fee_select_fee(bs_text.text,t_op_airi,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid11,i,j);
end;
if bsSkinTabSheet5.Showing then
begin
delete_do_type_num:=5;
if (strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then
shen_fee_select_feesb(bs_text.text,v_op_bscard,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid17,i,j,c,ComboBoxCurry.text)
else
shen_fee_select_fee(bs_text.text,v_op_bscard,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid17,i,j);
end;
t_rate.close;
t_ch_fee.Requery();
t_ch_fee_sum.Requery();
finally
t_ch_fee.EnableControls;
t_ch_fee_sum.EnableControls;
end;
}
end;
procedure Tfra_ch_add_do.RxDBLookupCombo2KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
bsSkinButton10Click(Sender);
end;
end;
procedure Tfra_ch_add_do.RxDBLookupCombo1KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
bsSkinButton1Click(Sender);
end;
end;
procedure Tfra_ch_add_do.RxDBLookupCombo3KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
bsSkinButton4Click(Sender);
end;
end;
procedure Tfra_ch_add_do.RxDBLookupCombo4KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
bsSkinButton6Click(Sender);
end;
end;
procedure Tfra_ch_add_do.dxDBGrid2DblClick(Sender: TObject);
begin
fee_view(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfra_ch_add_do.dxDBGrid4DblClick(Sender: TObject);
begin
fee_view(t_op_seai.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfra_ch_add_do.dxDBGrid7DblClick(Sender: TObject);
begin
fee_view(t_op_aire.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfra_ch_add_do.dxDBGrid10DblClick(Sender: TObject);
begin
fee_view(t_op_airi.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfra_ch_add_do.N11Click(Sender: TObject);
var
i,j,c:integer;
RE:Boolean;
begin
Label83.Caption:='';
amtDr:=0;
usdDr:=0;
amtcr:=0;
usdcr:=0;
//<2F><><EFBFBD>ò<EFBFBD><C3B2>ּ<EFBFBD><D6BC><EFBFBD>
if not t_ch_fee.active then exit;
if t_ch_fee.IsEmpty then exit;
if bsSkinCheckRadioBox6.Checked then
c:=1
else
c:=0;
t_ch_fee.DisableControls;
t_ch_fee_sum.DisableControls;
if t_ch_fee.IsEmpty then
exit;
if bsSkinPanel9.Visible then
begin
i:=1;
if bsSkinCheckRadioBox3.Checked then
j:=1
else
j:=0;
end
else
begin
i:=0;
j:=0;
end;
// RE:=false;
// if (bs_text.Text<>'3') and (do_ban1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring<>'<27><><EFBFBD><EFBFBD>') then
// RE:=true;
try
t_rate.open;
if bsSkinTabSheet1.Showing then
begin
delete_do_type_num:=1;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_fee_select_fee_fensb(bs_text.text,t_op_seae,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,c,ComboBoxCurry.text,Edit19.text)
else
shen_fee_select_fee_fen(bs_text.text,t_op_seae,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,i,Edit19.text);
end;
if bsSkinTabSheet2.Showing then
begin
delete_do_type_num:=2;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_fee_select_fee_fensb(bs_text.text,t_op_seai,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,c,ComboBoxCurry.text,Edit19.text)
else
shen_fee_select_fee_fen(bs_text.text,t_op_seai,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,i,Edit19.text);
end;
if bsSkinTabSheet3.Showing then
begin
delete_do_type_num:=3;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_fee_select_fee_fensb(bs_text.text,t_op_aire,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,c,ComboBoxCurry.text,Edit19.text)
else
shen_fee_select_fee_fen(bs_text.text,t_op_aire,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,i,Edit19.text);
end;
if bsSkinTabSheet4.Showing then
begin
delete_do_type_num:=4;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_fee_select_fee_fensb(bs_text.text,t_op_airi,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,c,ComboBoxCurry.text,Edit19.text)
else
shen_fee_select_fee_fen(bs_text.text,t_op_airi,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,i,Edit19.text);
end;
if bsSkinTabSheet5.Showing then
begin
delete_do_type_num:=5;
if strtobool(get_parameters_value(83,'false')) then
// if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_fee_select_fee_fensb(bs_text.text,TADOQuery(kbmMemTable1),t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,c,ComboBoxCurry.text,Edit19.text)
else
shen_fee_select_fee_fen(bs_text.text,TADOQuery(kbmMemTable1),t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,i,Edit19.text);
end;
finally
t_rate.close;
t_ch_fee.Requery();
t_ch_fee_sum.Requery();
t_ch_fee.EnableControls;
t_ch_fee_sum.EnableControls;
Edit34.SetFocus;
end;
end;
procedure Tfra_ch_add_do.bsSkinButton8Click(Sender: TObject);
var
str_fee,str_op:widestring;
op_str,fee_str,sum_str,Str_bill:widestring;
Str,aCust,aCuster,sDate:String;
nyear:Integer;
begin
Label83.Caption:='';
amtDr:=0;
usdDr:=0;
amtcr:=0;
usdcr:=0;
if (Edit34.Text<>'') or (Edit19.Text<>'') then
begin
kbmbscard.EmptyTable;
kbmbscard.Open;
kbmbscardFee.EmptyTable;
kbmbscardFee.Open;
end;
// kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>10').OnChange:=nil;
//<2F><>ҵ<EFBFBD><D2B5><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD>ѯ
if not t_op_bscard_all.active then
t_op_bscard_all.Open;
if not GetCustID(aCust) then exit;
if not _GetCustID(aCuster) then exit;
t_ch_fee.close;
t_ch_fee_sum.close;
v_op_bscard.Close;
t_ch_fee.DataSource:=v_op_bscard1;
t_ch_fee_sum.DataSource:=v_op_bscard1;
// if (bs_text.Text='') then bs_text.text:='1';
case strtoint(bs_text.text) of
1: //<2F><>Ʊ
begin
str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><><EFBFBD>뿪Ʊ+<2B><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1'
// str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><><EFBFBD>뿪Ʊ+<2B><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1 and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
6 months ago
+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
11 months ago
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if (strtobool(get_parameters_value(64,'false'))=true) then begin
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
end else begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
end;
end;
end;
7: //<2F><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>
begin
str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><><EFBFBD>뿪Ʊ+<2B><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1'
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
6 months ago
+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
11 months ago
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if (strtobool(get_parameters_value(64,'false'))=true) then begin
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
end else begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
end;
end;
end;
2: //ҵ<><D2B5>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
if (strtobool(get_parameters_value(64,'false'))=true) then begin
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
end else begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
end;
end;
{
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
if (strtobool(get_parameters_value(64,'false'))=true) then begin
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
end else begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
end;
end;
}
end;
3,8: //3 Ӧ<>շ<EFBFBD><D5B7>ý<EFBFBD><C3BD><EFBFBD>
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
if (strtobool(get_parameters_value(64,'false'))=true) then begin
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
end else begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
end;
end;
end;
4: //Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))'
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
if (strtobool(get_parameters_value(64,'false'))=true) then begin
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
end else begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
end;
end;
end;
6: //ҵ<><D2B5><EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD>
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
{ str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
}
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
if (strtobool(get_parameters_value(64,'false'))=true) then begin
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
end else begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
end;
end;
end;
end;
{
if RxDBLookupCombo5.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo5.DisplayValues[1]+'''';
}
{
str:=Trim(ComboBoxObjbscard.Text);
if (Str<>'') and (length(Str)>10) then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+Trim(Copy(Str,11,length(Str)-10))+'''';
}
if acust<>'' then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+acust+'''';
if RxDBLookupCombo15.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
if RxDBLookupCombo16.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
if wwDBDateTimePicker21.text<>''then
str_fee:=str_fee+' and ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker21.text+'''';
if wwDBDateTimePicker22.text<>''then
str_fee:=str_fee+' and ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker22.text+'''';
if Trim(Edit36.Text)<>'' then begin
str_fee:=str_fee+' and EXISTS (select 1 from t_ch_fee_do d left join t_ch_invoice i on (i.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=d.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) where t_ch_fee.CH_ID=d.CH_ID AND d.<2E><><EFBFBD><EFBFBD>=1 and i.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit36.Text)+''')';
end;
str_op:='';
if Edit15.text<>''then
str_op:=str_op+' and v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit15.text+'%'+'''';
if Edit34.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit34.text+'%'+'''';
if Edit16.text<>''then
str_op:=str_op+' and (v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''' or v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit16.text+'%'+''' or v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit16.text+'%'+''' or v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''' or v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''')';
if Edit17.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit17.text+'%'+'''';
if Edit18.text<>''then
str_op:=str_op+' and (v_op_bscard_all.<2E><><EFBFBD><EFBFBD><ECB5A5> like '+''''+'%'+Edit18.text+'%'+''' or v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit18.text+'%'+''')';
if Edit33.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit33.text+'%'+'''';
if wwDBComboBox46.text<>''then
str_op:=str_op+' and v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox46.text+'''';
if DBComboBoxEh2.Text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><>Դ<EFBFBD><D4B4>ϸ='+''''+DBComboBoxEh2.Text+'''';
if Mblnos<>'' then
begin
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5> in ('+Mblnos+')';
end;
if wwDBLookupCombo49.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo49.text+'%'+'''';
if Edit30.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+Edit30.text+'%'+'''';
if aCuster<>'' then
str_op:=str_op+' and v_op_bscard_all.ί<>е<EFBFBD>λ like '+''''+'%'+aCuster+'%'+'''';
{
if Edit18.text<>''then
str_op:=str_op+' and v_op_bscard.'+Label2.Caption+' like '+''''+'%'+Edit18.text+'%'+'''';
}
if wwDBDateTimePicker17.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker17.text+'''';
if wwDBDateTimePicker19.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker19.text+'''';
if wwDBDateTimePicker18.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker18.text+'''';
if wwDBDateTimePicker20.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker20.text+'''';
if wwDBComboBox5.text='<27><>' then
str_op:=str_op+' and v_op_bscard_all.<2E>Ƿ<EFBFBD><C7B7>˲<EFBFBD>=1 ';
if wwDBComboBox5.text='<27><>' then
str_op:=str_op+' and (v_op_bscard_all.<2E>Ƿ<EFBFBD><C7B7>˲<EFBFBD>=0 OR v_op_bscard_all.<2E>Ƿ<EFBFBD><C7B7>˲<EFBFBD> IS NULL) ';
if Trim(Edit19.Text)<>'' then
begin
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then
begin
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD> in (select distinct ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
if (strtoint(bs_text.text)=2) and strtobool(get_parameters_value(152,'true')) then
begin
str_op:=str_op+' and ((v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬=''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'') or v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>''<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'')';
end;
{
if strtoint(bs_text.text)=7 then
begin
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬ in(''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'',''<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'') ';
end;
}
if strtoint(bs_text.text)=8 then
str_op:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard_all.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op
else
begin
str_op:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op;
end;
case strtoint(bs_text.text) of
1,7:
begin
str_op:=str_op+' and '+open_data('1002','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sDate:=FormatDateTime('yyyy',Now);
nyear:=StrToInt64Def(sDate,2019);
nyear:=nyear+1;
sDate:=inttostr(nyear)+'-'+'01'+'-'+'01';
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><'''+sDate+'''';
end;
2,6:
begin
str_op:=str_op+' and '+open_data('1004','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
3,4:
begin
str_op:=str_op+' and '+open_data('1003','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
end;
case strtoint(bs_text.text) of
3,4: begin
op_str:='select v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬'
+',v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>'
+',v_op_bscard_all.<2E><><EFBFBD><EFBFBD><ECB5A5>, v_op_bscard_all.<2E><>׼<EFBFBD>ĺ<EFBFBD> as <20><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><>׼<EFBFBD>ĺ<EFBFBD> as USD,v_op_bscard_all.<2E><>׼<EFBFBD>ĺ<EFBFBD> as RMB'
+',v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾,v_op_bscard_all.<2E><>TEU'
+',v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>,v_op_bscard_all.װ<>˷<EFBFBD>ʽ,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>,v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>'
+',v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.¼<><C2BC><EFBFBD><EFBFBD>'
+',v_op_bscard_all.<2E>ͷ<EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10,t_op_gain.Ӧ<><D3A6>USD-t_op_gain.<2E><><EFBFBD><EFBFBD>USD <20>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD,t_op_gain.Ӧ<><D3A6>RMB-t_op_gain.<2E><><EFBFBD><EFBFBD>RMB <20>ϼ<EFBFBD>δ<EFBFBD><CEB4>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>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as δ<><CEB4>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>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>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>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as δ<><CEB4>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>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as δ<><CEB4>RMB '
+' from v_op_bscard_all v_op_bscard_all With(NoLock) ';
if acust<>'' then
op_str:=op_str+' Left Join t_ch_fee t_ch_fee on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in(''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><>ֹ<EFBFBD>޸<EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+acust+''''
else
op_str:=op_str+' Left Join t_ch_fee t_ch_fee on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in(''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><>ֹ<EFBFBD>޸<EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ';
op_str:=op_str+' Left Join t_op_gain t_op_gain on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_op_gain.<2E><><EFBFBD><EFBFBD> ';
op_str:=op_str
+str_op
+' group by v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬'
+',v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>'
+',v_op_bscard_all.<2E><><EFBFBD><EFBFBD><ECB5A5>, v_op_bscard_all.<2E><>׼<EFBFBD>ĺ<EFBFBD> '
+',v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾,v_op_bscard_all.<2E><>TEU'
+',v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>,v_op_bscard_all.װ<>˷<EFBFBD>ʽ,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>,v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>'
+',v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.¼<><C2BC><EFBFBD><EFBFBD>'
+',v_op_bscard_all.<2E>ͷ<EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10, t_op_gain.Ӧ<><D3A6>USD-t_op_gain.<2E><><EFBFBD><EFBFBD>USD,t_op_gain.Ӧ<><D3A6>RMB-t_op_gain.<2E><><EFBFBD><EFBFBD>RMB'
+' order by v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5>'
// +default_sort(53,'v_op_bscard_all','','desc');
end;
1,7: begin
op_str:='select v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬'
+',v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>'
+',v_op_bscard_all.<2E><><EFBFBD><EFBFBD><ECB5A5>, v_op_bscard_all.<2E><>׼<EFBFBD>ĺ<EFBFBD> as <20><><EFBFBD><EFBFBD>'
+',v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾,v_op_bscard_all.<2E><>TEU'
+',v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>,v_op_bscard_all.װ<>˷<EFBFBD>ʽ,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>,v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>'
+',v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.¼<><C2BC><EFBFBD><EFBFBD>'
+',v_op_bscard_all.<2E>ͷ<EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10,t_op_gain.Ӧ<><D3A6>USD-t_op_gain.<2E><><EFBFBD><EFBFBD>USD <20>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD,t_op_gain.Ӧ<><D3A6>RMB-t_op_gain.<2E><><EFBFBD><EFBFBD>RMB <20>ϼ<EFBFBD>δ<EFBFBD><CEB4>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>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as δ<><CEB4>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>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>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>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as δ<><CEB4>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>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as δ<><CEB4>RMB '
+' from v_op_bscard_all v_op_bscard_all With(NoLock) ';
if acust<>'' then
op_str:=op_str+' Left Join t_ch_fee t_ch_fee on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in(''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹ<EFBFBD>޸<EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD><>(t_ch_fee.<2E><><EFBFBD>뿪Ʊ+t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+acust+''''
else
op_str:=op_str+' Left Join t_ch_fee t_ch_fee on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in(''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹ<EFBFBD>޸<EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD><>(t_ch_fee.<2E><><EFBFBD>뿪Ʊ+t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '; //<2F><><EFBFBD><EFBFBD><>(<28><><EFBFBD>뿪Ʊ+<2B><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)
op_str:=op_str+' Left Join t_op_gain t_op_gain on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_op_gain.<2E><><EFBFBD><EFBFBD> ';
op_str:=op_str
+str_op
+' group by v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬'
+',v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>'
+',v_op_bscard_all.<2E><><EFBFBD><EFBFBD><ECB5A5>, v_op_bscard_all.<2E><>׼<EFBFBD>ĺ<EFBFBD>'
+',v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾,v_op_bscard_all.<2E><>TEU'
+',v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>,v_op_bscard_all.װ<>˷<EFBFBD>ʽ,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>,v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>'
+',v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.¼<><C2BC><EFBFBD><EFBFBD>'
+',v_op_bscard_all.<2E>ͷ<EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10, t_op_gain.Ӧ<><D3A6>USD-t_op_gain.<2E><><EFBFBD><EFBFBD>USD,t_op_gain.Ӧ<><D3A6>RMB-t_op_gain.<2E><><EFBFBD><EFBFBD>RMB'
+' order by v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5>'
// +default_sort(53,'v_op_bscard_all','','desc');
end;
else
begin
op_str:='select v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬'
+',v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><E1B5A5>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>'
+',v_op_bscard_all.<2E><><EFBFBD><EFBFBD><ECB5A5>'
+',v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾,v_op_bscard_all.<2E><>TEU'
+',v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>,v_op_bscard_all.װ<>˷<EFBFBD>ʽ,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>,v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>'
+',v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.¼<><C2BC><EFBFBD><EFBFBD>'
+',v_op_bscard_all.<2E>ͷ<EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10,'
+'0 ASδ<53><CEB4>USD '
+','
+'0 δ<><CEB4>RMB '
+','
+'0 as δ<><CEB4>USD '
+','
+'0 as δ<><CEB4>RMB '
+' from v_op_bscard_all v_op_bscard_all With(NoLock) '+str_op
+default_sort(53,'v_op_bscard_all','','desc');
end;
end;
{
op_str:='select * from v_op_bscard_all '+str_op
+default_sort(53,'v_op_bscard_all','','desc');
}
case strtoint(bs_text.text) of
1:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ע from t_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select ch_id from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
7:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ע from t_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select ch_id from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
2:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end),<2C><>ע from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select ch_id from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
{ fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
}
3:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end),<2C><>ע from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select ch_id from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
4:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end),<2C><>ע from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select ch_id from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
6:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end),<2C><>ע from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select ch_id from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
8:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end),<2C><>ע from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from v_op_bscard_all where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>) order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from v_op_bscard_all where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>) group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
end;
t_ch_fee.Close;
t_ch_fee_sum.close;
v_op_bscard.close;
v_op_bscard.sql.clear;
v_op_bscard.sql.add(op_str);
v_op_bscard.open;
kbmMemTable1.LoadFromDataSet(v_op_bscard,[mtcpostructure,mtcpoProperties,mtcpoFieldIndex]);
t_ch_fee.sql.clear;
t_ch_fee.sql.add(fee_str);
// ShowMessage(fee_str);
t_ch_fee.open;
t_ch_fee_sum.sql.clear;
t_ch_fee_sum.sql.add(sum_str);
t_ch_fee_sum.open;
// kbmMemTable1.BeforeScroll:=kbmMemTable1BeforeScroll;
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>10').OnChange:=kbmMemTable1Field10Change;
try
kbmMemTable1.DisableControls;
if (kbmtblbs.Active) and (kbmtblbs.RecordCount>0) then
begin
kbmtblbs.First;
while not kbmtblbs.Eof do
begin
if kbmMemTable1.Locate('<27><><EFBFBD><EFBFBD><E1B5A5>',kbmtblbs.FieldByName('MBLNO').AsString,[]) then
begin
kbmMemTable1.Edit;
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=kbmtblbs.FieldByName('AMT').AsString;
kbmMemTable1.Post;
end;
kbmtblbs.Next;
end;
end;
finally
kbmMemTable1.EnableControls;
end;
Edit34.SetFocus;
end;
procedure Tfra_ch_add_do.ComboBoxObjBsCardEnter(Sender: TObject);
var
str_fee,str_op:widestring;
aQuery:TADOQuery;
begin
//<2F>пͻ<D0BF><CDBB><EFBFBD><EFBFBD><EFBFBD>
case strtoint(bs_text.text) of
1:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><><EFBFBD>뿪Ʊ+c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3,8:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))'
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
end;
if RxDBLookupCombo15.DisplayValues[1]<>''then
str_fee:=str_fee+' and c.<2E>ұ<EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
if RxDBLookupCombo16.DisplayValues[1]<>''then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
if Edit15.text<>''then
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit15.text+'%'+'''';
if Edit34.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit34.text+'%'+'''';
if Edit16.text<>''then
str_fee:=str_fee+' and (b.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit16.text+'%'+''' or b.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit16.text+'%'+''' or b.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''' or b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''')';
if Edit17.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><ECB5A5> like '+''''+'%'+Edit17.text+'%'+'''';
if wwDBComboBox46.text<>''then
str_fee:=str_fee+' and b.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox46.text+'''';
if Edit18.text<>''then
str_fee:=str_fee+' and b.'+Label2.Caption+' like '+''''+'%'+Edit18.text+'%'+'''';
if wwDBLookupCombo49.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo49.text+'%'+'''';
if Edit30.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+Edit30.text+'%'+'''';
if wwDBDateTimePicker17.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker17.text+'''';
if wwDBDateTimePicker19.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker19.text+'''';
if wwDBDateTimePicker18.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker18.text+'''';
if wwDBDateTimePicker20.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker20.text+'''';
ComboBoxObjBsCard.Items.Clear;
aQuery:=CreateAdoQuery;
with aQuery do
try
Close;SQL.Clear;
SQL.Add('Select distinct u.<2E><><EFBFBD><EFBFBD>, u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add('from t_ch_fee c');
SQL.Add('Left Join t_crm_client u on (u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>)');
SQL.Add('Left Join v_op_bscard_all b on b.<2E><><EFBFBD><EFBFBD>=c.<2E><><EFBFBD><EFBFBD>');
SQL.Add('where not c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> is null ');
SQL.Add(str_fee);
SQL.Add(' order by u.<2E><><EFBFBD><EFBFBD>');
Open;
First;
while not Eof do begin
ComboBoxObjBsCard.Items.Add(FixLenStr(FieldByName('<27><><EFBFBD><EFBFBD>').AsString,10)
+' '+FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
Next;
end;
finally
Close;
FreeAndNil(aQuery);
end;
end;
procedure Tfra_ch_add_do.bsSkinButton9Click(Sender: TObject);
begin
// ComboBoxObjBsCard.text:='';
ComboBoxObjBs.text:='';
Edit15.text:='';
Edit16.Text:='';
Edit17.text:='';
Edit18.text:='';
Edit19.text:='';
Edit35.text:='';
wwDBDateTimePicker17.Clear;
wwDBDateTimePicker18.clear;
wwDBDateTimePicker19.clear;
wwDBDateTimePicker20.clear;
RxDBLookupCombo15.ClearValue;
RxDBLookupCombo16.ClearValue;
wwDBLookupCombo49.Text:='';
Edit30.Text:='';
Edit33.Text:='';
Edit34.Text:='';
wwDBComboBox46.Text:='';
wwDBComboBox31.Text:='';
DBComboBoxEh2.Text:='';
Edit34.SetFocus;
end;
procedure Tfra_ch_add_do.ComboBoxObjairiEnter(Sender: TObject);
var
str_fee:widestring;
aQuery:TADOQuery;
begin
//<2F>пͻ<D0BF><CDBB><EFBFBD><EFBFBD><EFBFBD>
case strtoint(bs_text.text) of
1:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
// if not strtobool(get_parameters_value(46,'true')) then
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
if Edit7.text<>''then
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit7.text+'%'+'''';
if Edit11.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit11.text+'%'+'''';
if Edit12.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit12.text+'%'+'''';
if wwDBDateTimePicker13.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker13.text+'''';
if wwDBDateTimePicker15.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker15.text+'''';
if wwDBDateTimePicker14.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker14.text+'''';
if wwDBDateTimePicker16.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker16.text+'''';
ComboBoxObjairi.Items.Clear;
aQuery:=CreateAdoQuery;
with aQuery do
try
Close;SQL.Clear;
SQL.Add('Select distinct u.<2E><><EFBFBD><EFBFBD>, u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add('from t_ch_fee c');
SQL.Add('Left Join t_crm_client u on (u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>)');
SQL.Add(', t_op_airi b');
SQL.Add('where b.<2E><><EFBFBD><EFBFBD>=c.<2E><><EFBFBD><EFBFBD> ');
SQL.Add(str_fee);
SQL.Add(' order by u.<2E><><EFBFBD><EFBFBD>');
Open;
First;
while not Eof do begin
ComboBoxObjairi.Items.Add(FixLenStr(FieldByName('<27><><EFBFBD><EFBFBD>').AsString,10)
+' '+FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
Next;
end;
finally
Close;
FreeAndNil(aQuery);
end;
end;
procedure Tfra_ch_add_do.ComboBoxObjAireEnter(Sender: TObject);
var
str_fee:widestring;
aQuery:TADOQuery;
begin
//<2F>пͻ<D0BF><CDBB><EFBFBD><EFBFBD><EFBFBD>
case strtoint(bs_text.text) of
1:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
// if not strtobool(get_parameters_value(46,'true')) then
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
if Edit8.text<>''then
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit8.text+'%'+'''';
if Edit9.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit9.text+'%'+'''';
if Edit10.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit10.text+'%'+'''';
if wwDBDateTimePicker9.text<>''then
str_fee:=str_fee+' and b.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker9.text+'''';
if wwDBDateTimePicker11.text<>''then
str_fee:=str_fee+' and b.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker11.text+'''';
if wwDBDateTimePicker10.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker10.text+'''';
if wwDBDateTimePicker12.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker12.text+'''';
ComboBoxObjaire.Items.Clear;
aQuery:=CreateAdoQuery;
with aQuery do
try
Close;SQL.Clear;
SQL.Add('Select distinct u.<2E><><EFBFBD><EFBFBD>, u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add('from t_ch_fee c');
SQL.Add('Left Join t_crm_client u on (u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>)');
SQL.Add(', t_op_aire b');
SQL.Add('where b.<2E><><EFBFBD><EFBFBD>=c.<2E><><EFBFBD><EFBFBD> ');
SQL.Add(str_fee);
SQL.Add(' order by u.<2E><><EFBFBD><EFBFBD>');
Open;
First;
while not Eof do begin
ComboBoxObjaire.Items.Add(FixLenStr(FieldByName('<27><><EFBFBD><EFBFBD>').AsString,10)
+' '+FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
Next;
end;
finally
Close;
FreeAndNil(aQuery);
end;
end;
procedure Tfra_ch_add_do.ComboBoxObjSeaiEnter(Sender: TObject);
var
str_fee:widestring;
aQuery:TAdoQuery;
begin
//<2F>пͻ<D0BF><CDBB><EFBFBD><EFBFBD><EFBFBD>
case strtoint(bs_text.text) of
1:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
if Edit1.text<>''then
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
if Edit5.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit5.text+'%'+'''';
if Edit14.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><ECB5A5> like '+''''+'%'+Edit14.text+'%'+'''';
if Edit6.text<>''then
str_fee:=str_fee+' and b.'+Label6.Caption+' like '+''''+'%'+Edit6.text+'%'+'''';
if wwDBDateTimePicker5.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker5.text+'''';
if wwDBDateTimePicker7.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker7.text+'''';
if wwDBDateTimePicker6.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker6.text+'''';
if wwDBDateTimePicker8.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker8.text+'''';
ComboBoxObjseai.Items.Clear;
aQuery:=CreateAdoQuery;
with aQuery do
try
Close;SQL.Clear;
SQL.Add('Select distinct u.<2E><><EFBFBD><EFBFBD>, u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add('from t_ch_fee c');
SQL.Add('Left Join t_crm_client u on (u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>)');
SQL.Add(', t_op_seai b');
SQL.Add('where b.<2E><><EFBFBD><EFBFBD>=c.<2E><><EFBFBD><EFBFBD> ');
SQL.Add(str_fee);
SQL.Add(' order by u.<2E><><EFBFBD><EFBFBD>');
Open;
First;
while not Eof do begin
ComboBoxObjseai.Items.Add(FixLenStr(FieldByName('<27><><EFBFBD><EFBFBD>').AsString,10)
+' '+FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
Next;
end;
finally
Close;
FreeAndNil(aQuery);
end;
end;
procedure Tfra_ch_add_do.ComboBoxObjSeaeEnter(Sender: TObject);
var
str_fee:widestring;
aQuery:TAdoQuery;
begin
//<2F>пͻ<D0BF><CDBB><EFBFBD><EFBFBD><EFBFBD>
case strtoint(bs_text.text) of
1:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3,8:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
// if not strtobool(get_parameters_value(46,'true')) then
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
if Edit4.text<>''then
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''';
if Edit2.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
if Edit13.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><ECB5A5> like '+''''+'%'+Edit13.text+'%'+'''';
if Edit3.text<>''then
str_fee:=str_fee+' and b.'+Label2.Caption+' like '+''''+'%'+Edit3.text+'%'+'''';
if wwDBDateTimePicker1.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
if wwDBDateTimePicker2.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
if wwDBDateTimePicker3.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker3.text+'''';
if wwDBDateTimePicker4.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker4.text+'''';
ComboBoxObjseae.Items.Clear;
aQuery:=CreateAdoQuery;
with aQuery do
try
Close;SQL.Clear;
SQL.Add('Select distinct u.<2E><><EFBFBD><EFBFBD>, u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add('from t_ch_fee c');
SQL.Add('Left Join t_crm_client u on (u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>)');
SQL.Add(', t_op_seae b');
SQL.Add('where b.<2E><><EFBFBD><EFBFBD>=c.<2E><><EFBFBD><EFBFBD> ');
SQL.Add(str_fee);
SQL.Add(' order by u.<2E><><EFBFBD><EFBFBD>');
Open;
First;
while not Eof do begin
ComboBoxObjseae.Items.Add(FixLenStr(FieldByName('<27><><EFBFBD><EFBFBD>').AsString,10)
+' '+FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
Next;
end;
finally
Close;
FreeAndNil(aQuery);
end;
end;
procedure Tfra_ch_add_do.dxDBGrid19DblClick(Sender: TObject);
begin
fee_view(kbmMemTable1.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfra_ch_add_do.bsSkinCheckRadioBox5Click(Sender: TObject);
begin
bsSkinPanel13.Visible:=bsSkinCheckRadioBox6.Checked;
end;
procedure Tfra_ch_add_do.wwDBLookupCombo49KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
bsSkinButton8Click(Sender);
end;
end;
procedure Tfra_ch_add_do.dxDBGrid19Column22CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
begin
{
if Trim(ANode.Strings[dxDBGrid19Column22.Index])='<27><><EFBFBD>ĵ<EFBFBD>' then
AColor:=clred;
AFont.Color:=clblack;
}
end;
procedure Tfra_ch_add_do.RxDBLookupCombo14Enter(Sender: TObject);
var
str_fee,str_op:widestring;
aQuery:TADOQuery;
begin
//<2F>пͻ<D0BF><CDBB><EFBFBD><EFBFBD><EFBFBD>
case strtoint(bs_text.text) of
1:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3,8:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
end;
if RxDBLookupCombo15.DisplayValues[1]<>''then
str_fee:=str_fee+' and c.<2E>ұ<EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
if RxDBLookupCombo16.DisplayValues[1]<>''then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
if Edit15.text<>''then
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit15.text+'%'+'''';
if Edit16.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit16.text+'%'+'''';
if Edit17.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><ECB5A5> like '+''''+'%'+Edit17.text+'%'+'''';
if wwDBComboBox46.text<>''then
str_fee:=str_fee+' and b.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox46.text+'''';
if Edit18.text<>''then
str_fee:=str_fee+' and b.'+Label2.Caption+' like '+''''+'%'+Edit18.text+'%'+'''';
if wwDBDateTimePicker17.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker17.text+'''';
if wwDBDateTimePicker19.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker19.text+'''';
if wwDBDateTimePicker18.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker18.text+'''';
if wwDBDateTimePicker20.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker20.text+'''';
with t_ch_cust do begin
Close;SQL.Clear;
SQL.Add('Select distinct u.<2E><><EFBFBD><EFBFBD>, u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add('from t_ch_fee c');
SQL.Add('Left Join t_crm_client u on (u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>)');
SQL.Add(', v_op_bscard_all b');
SQL.Add('where b.<2E><><EFBFBD><EFBFBD>=c.<2E><><EFBFBD><EFBFBD> ');
SQL.Add(str_fee);
SQL.Add(' order by u.<2E><><EFBFBD><EFBFBD>');
Open;
end;
end;
procedure Tfra_ch_add_do.dxDBGrid19Column24CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
begin
{
AColor:=dxgrid_color(ANode.Strings[dxDBGrid19Column21.Index],ANode.Strings[dxDBGrid19Column24.Index]);
AFont.Color:=clblack;
}
end;
procedure Tfra_ch_add_do.bsSkinButton11Click(Sender: TObject);
var
i,j,c,f:integer;
RE:Boolean;
str,feestr,sumstr:widestring;
begin
Label83.Caption:='';
amtDr:=0;
usdDr:=0;
amtcr:=0;
usdcr:=0;
if bsSkinTabSheet5.Showing then
begin
if not v_op_bscard.Active then exit;
if v_op_bscard.IsEmpty then exit;
end;
if bsSkinCheckRadioBox6.Checked then
c:=1
else
c:=0;
t_ch_fee.DisableControls;
t_ch_fee_sum.DisableControls;
try
if bsSkinPanel9.Visible then
begin
i:=1;
if bsSkinCheckRadioBox3.Checked then
j:=1
else
j:=0;
end
else
begin
i:=0;
j:=0;
end;
RE:=false;
t_rate.open;
feestr:=t_ch_fee.SQL.text;
if bsSkinTabSheet5.Showing then
begin
delete_do_type_num:=5;
kbmMemTable1.DisableControls;
try
if kbmMemTable1.RecordCount>=1 then
begin
t_ch_fee.DataSource:=t_op_bscard_all1;
t_ch_fee_sum.DataSource:=t_op_bscard_all1;
kbmMemTable1.First;
while not kbmMemTable1.Eof do
begin
if kbmMemTable1.fieldbyname('<27><><EFBFBD><EFBFBD>10').AsInteger=1 then
begin
if str='' then
str:='<27><><EFBFBD><EFBFBD>='+''''+kbmMemTable1.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
else
str:=str+' or <20><><EFBFBD><EFBFBD>='+''''+kbmMemTable1.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
end;
kbmMemTable1.Next;
end;
dxDBGrid19.ClearSelection;
str:='and ('+str+')';
t_ch_fee_detail.close;
t_ch_fee_detail.sql.text:=StringReplace(feestr,'and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>',str,[rfReplaceAll]);
t_ch_fee_detail.open;
if strtobool(get_parameters_value(83,'false')) then
// if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_yewwusb(TADOQuery(kbmMemTable1),bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j,c,ComboBoxCurry.text,Edit19.text) //v_op_bscard
else
shen_yewwu(TADOQuery(kbmMemTable1),bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j,Edit19.text);
t_ch_fee_detail.close;
v_op_bscard.close;
v_op_bscard.open;
kbmMemTable1.LoadFromDataSet(v_op_bscard,[mtcpostructure,mtcpoProperties,mtcpoFieldIndex]);
end else begin
{
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
shen_yewwusb(v_op_bscard,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j,c,ComboBoxCurry.text)
else
shen_yewwu(v_op_bscard,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j);
<20>ƽ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>û<EFBFBD>б<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݾ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
end;
finally
kbmMemTable1.EnableControls;
t_ch_fee.DataSource:=v_op_bscard1;
t_ch_fee_sum.DataSource:=v_op_bscard1;
end;
end;
finally
t_rate.close;
t_ch_fee.Requery();
t_ch_fee_sum.Requery();
t_ch_fee.EnableControls;
t_ch_fee_sum.EnableControls;
Edit34.SetFocus;
{
t_ch_fee.EnableControls;
t_ch_fee_sum.EnableControls;
}
end;
///
end;
procedure Tfra_ch_add_do.bsSkinCheckRadioBox7Click(Sender: TObject);
begin
if bsSkinCheckRadioBox7.Checked then
begin
with kbmMemTable1 do
try
DisableControls;
First;
while not Eof do
begin
Edit;
FieldByName('<27><><EFBFBD><EFBFBD>10').AsInteger:=1;
Next;
end;
finally
First;
EnableControls;
end;
end
else
with kbmMemTable1 do
try
DisableControls;
First;
while not Eof do
begin
Edit;
FieldByName('<27><><EFBFBD><EFBFBD>10').AsInteger:=0;
Next;
end;
finally
First;
EnableControls;
end;
end;
procedure Tfra_ch_add_do.Edit34KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
kbmMemTable1.Locate('<27><><EFBFBD><EFBFBD><E1B5A5>',Trim(Edit34.text),[]);
end;
end;
procedure Tfra_ch_add_do.bsSkinButton12Click(Sender: TObject);
var RecNoList: TStringList;
begin
with kbmMemTable1 do
try
DisableControls; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>Ч<EFBFBD>ʣ<EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD>
First;
While not Eof do
begin
if pos(trim(Edit34.text),FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString)>0 then
begin
Break;
end;
Next;
end;
finally
EnableControls;
end;
end;
procedure Tfra_ch_add_do.ComboBoxObjBsEnter(Sender: TObject);
var
aQuery:TADOQuery;
begin
ComboBoxObjBs.Items.Clear;
aQuery:=CreateAdoQuery;
with aQuery do
try
Close;SQL.Clear;
SQL.Add('Select <20><><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add('From t_crm_client');
SQL.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><>''Ŀ<><C4BF>'' and ί<>е<EFBFBD>λ=1');
SQL.Add(' order by <20><><EFBFBD><EFBFBD>');
Open;
First;
while not Eof do begin
ComboBoxObjBs.Items.Add(FixLenStr(FieldByName('<27><><EFBFBD><EFBFBD>').AsString,10)
+' '+FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
Next;
end;
finally
Close;
FreeAndNil(aQuery);
end;
end;
procedure Tfra_ch_add_do.ComboBoxObjBsKeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
bsSkinButton8Click(Sender);
end;
end;
procedure Tfra_ch_add_do.N13Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid19);
end;
procedure Tfra_ch_add_do.DBComboBoxEh2DropDown(Sender: TObject);
var AdoQuery1:TAdoQuery;
begin
AdoQuery1:=CreateAdoQuery;
with AdoQuery1 do
try
Close;
sql.Clear;
SQL.Add('select distinct <20><>Դ<EFBFBD><D4B4>ϸ from v_op_bscard_ALL where <20><>Դ<EFBFBD><D4B4>ϸ<>''''');
Open;
first;
DBComboBoxEh2.Items.Clear;
while not AdoQuery1.Eof do begin
DBComboBoxEh2.Items.Add(fieldbyname('<27><>Դ<EFBFBD><D4B4>ϸ').AsString);
Next;
end;
finally
Free;
end;
end;
procedure Tfra_ch_add_do.dxDBGrid19Column30Change(Sender: TObject);
var amtdr,usddr,amtcr,usdcr:Double;
s:string;
begin
{
try
kbmMemTable1.DisableControls;
with kbmMemTable1 do
begin
First;
while not eof do
begin
if kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>10').AsString='T' then
begin
amtdr:=amtdr+FieldByName('δ<><CEB4>RMB').AsFloat;
usddr:=usddr+FieldByName('δ<><CEB4>USD').AsFloat;
amtcr:=amtcr++FieldByName('δ<><CEB4>RMB').AsFloat;
usdcr:=usdcr++FieldByName('δ<><CEB4>USD').AsFloat;
end;
Next;
end;
end;
finally
kbmMemTable1.EnableControls;
Label83.Caption:='δ<><CEB4>RMB:'+FormatFloat(';;',amtdr)+' δ<><CEB4>USD:'+FormatFloat(';;',usddr)+' δ<><CEB4>RMB:'+FormatFloat(';;',amtcr)+' δ<><CEB4>USD:'+FormatFloat(';;',usdcr);
end;
}
end;
procedure Tfra_ch_add_do.kbmMemTable1Field10Change(Sender: TField);
begin
if kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>10').AsInteger=1 then
begin
amtDr:=amtDr+kbmMemTable1.FieldByName('δ<><CEB4>RMB').AsFloat;
usdDr:=usdDr+kbmMemTable1.FieldByName('δ<><CEB4>USD').AsFloat;
amtcr:=amtcr+kbmMemTable1.FieldByName('δ<><CEB4>RMB').AsFloat;
usdcr:=usdcr+kbmMemTable1.FieldByName('δ<><CEB4>USD').AsFloat;
end
else
begin
amtDr:=amtDr-kbmMemTable1.FieldByName('δ<><CEB4>RMB').AsFloat;
usdDr:=usdDr-kbmMemTable1.FieldByName('δ<><CEB4>USD').AsFloat;
amtcr:=amtcr-kbmMemTable1.FieldByName('δ<><CEB4>RMB').AsFloat;
usdcr:=usdcr-kbmMemTable1.FieldByName('δ<><CEB4>USD').AsFloat;
end;
Label83.Caption:='<27><>RMB:'+FormatFloat('0.00;-0.00;0',amtdr)+' <20><>USD:'+FormatFloat('0.00;-0.00;0',usddr)+' <20><>RMB:'+FormatFloat('0.00;-0.00;0',amtcr)+' <20><>USD:'+FormatFloat('0.00;-0.00;0',usdcr);
end;
procedure Tfra_ch_add_do.bsSkinButton13Click(Sender: TObject);
begin
with kbmMemTable1 do
try
DisableControls;
First;
while not Eof do
begin
Edit;
FieldByName('<27><><EFBFBD><EFBFBD>10').AsInteger:=1;
Next;
end;
finally
First;
EnableControls;
Edit34.SetFocus;
end;
end;
procedure Tfra_ch_add_do.bsSkinButton14Click(Sender: TObject);
begin
with kbmMemTable1 do
try
DisableControls;
First;
while not Eof do
begin
Edit;
FieldByName('<27><><EFBFBD><EFBFBD>10').AsInteger:=0;
Next;
end;
finally
First;
EnableControls;
Edit34.SetFocus;
end;
end;
procedure Tfra_ch_add_do.bsSkinButton16Click(Sender: TObject);
begin
ComboBoxObjBsCard.SetFocus;
end;
procedure Tfra_ch_add_do.bsSkinButton15Click(Sender: TObject);
begin
Edit34.SetFocus;
end;
procedure Tfra_ch_add_do.dxDBGrid17SelectedCountChange(Sender: TObject);
var
i,k:integer;
DR,CR,USDDR,USDCR,NDR,NCR,NUSDDR,NUSDCR,OTDR,OTCR,NOTDR,NOTCR:Double;
begin
case strtoint(bs_text.text) of
3,4 : begin
DR:=0;
CR:=0;
USDDR:=0;
USDCR:=0;
NDR:=0;
NCR:=0;
NUSDDR:=0;
NUSDCR:=0;
OTDR:=0;
OTCR:=0;
NOTDR:=0;
NOTCR:=0;
if t_ch_fee.IsEmpty then
exit;
if dxDBGrid17.SelectedCount>=1 then
begin
for i:=0 to dxDBGrid17.SelectedCount-1 do
begin
t_ch_fee.GotoBookmark(pointer(dxDBGrid17.selectedrows[i]));
if t_ch_fee.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then
begin
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then
begin
USDDR:=USDDR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
NUSDDR:=NUSDDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end
else
begin
USDCR:=USDCR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
NUSDCR:=NUSDCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
end
else
if t_ch_fee.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then
begin
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
DR:=DR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
NDR:=NDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end
else
begin
CR:=CR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
NCR:=NCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
end
else
begin
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
OTDR:=OTDR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
NOTDR:=NOTDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end
else
begin
OTCR:=OTCR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
NOTCR:=NOTCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
end;
end;
end;
lblSum.Caption:='<27><>USD:'+FormatFloat('#,##,0.00;-0.00',NUSDDR)+';<3B><>USD:'+FormatFloat('#,##,0.00;-0.00',NUSDCR);
lblSum1.Caption:='<27><>RMB:'+FormatFloat('#,##,0.00;-0.00',NDR)+';<3B><>RMB:'+FormatFloat('#,##,0.00;-0.00',NCR);
end;
end;
end;
procedure Tfra_ch_add_do.bsSkinButton17Click(Sender: TObject);
var
Ext,adate,bsno,corp,vslvoy:String;
ExcelTemplet:Variant;
i,j:integer;
M,D,Y:Word;
imp:boolean;
begin
kbmtblbs.EmptyTable;
kbmtblbs.Open;
if OpenDialog1.Execute then
begin
Ext:=lowercase(ExtractFileExt(OpenDialog1.FileName));
if Ext='.xls' then
begin
ExcelTemplet:= CreateOleObject('Excel.Application');
try
kbmtblbs.DisableControls;
ExcelTemplet.Workbooks.Open(OpenDialog1.FileName);
imp:=true;
if imp then
begin
I:=2;
while VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value)<>'' do
begin
if Mblnos='' then
Mblnos:=''''+VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value)+''''
else Mblnos:=Mblnos+','+''''+VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value)+'''';
kbmtblbs.Insert;
kbmtblbs.FieldByName('OrdNo').AsInteger:=i;
kbmtblbs.FieldByName('MBLNO').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value);
kbmtblbs.FieldByName('AMT').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,2].Value);
kbmtblbs.Post;
i:=i+1;
end;
end;
finally
kbmtblbs.EnableControls;
ExcelTemplet.DisplayAlerts := false;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
ExcelTemplet.Quit;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>
end;
end;
end;
try
if Mblnos<>'' then
bsSkinButton8Click(Sender);
finally
Mblnos:='';
kbmtblbs.EmptyTable;
end;
end;
procedure Tfra_ch_add_do.update_tablesb(bs_text,sno:string;do_ban1:TDataSource;table:TADOQuery);
var
aQuery:TAdoQuery;
sumnum,sumnumusd:real;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do
begin
Close;SQL.Clear;
SQL.Add('Select <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> from v_fee_do_dc where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+sno+'''');
Open;
if Recordset.RecordCount=0 then
begin
case strtoint(bs_text) of
1,7:
begin
do_ban1.DataSet.edit;
do_ban1.DataSet.fieldbyname('ʵ<>ʽ<EFBFBD><CABD><EFBFBD>').AsFloat:=0;
if 1=1 then
begin
if do_ban1.DataSet['<27>ұ<EFBFBD>']='USD' then
do_ban1.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring:=get_parameters_value(7,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD>')
else
do_ban1.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring:=get_parameters_value(147,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD>');
do_ban1.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring:=floattostr(do_ban1.DataSet['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']);
end;
if 1=1 then
begin
try
do_ban1.DataSet.fieldbyname('<27><EFBFBD><E1B5A5>').asstring:=table.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
do_ban1.DataSet.fieldbyname('ί<>б<EFBFBD><D0B1><EFBFBD>').asstring:=table.fieldbyname('ί<>б<EFBFBD><D0B1><EFBFBD>').asstring;
do_ban1.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring:=table.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
do_ban1.DataSet.fieldbyname('<27><><EFBFBD>˸<EFBFBD>').asstring:=table.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring;
do_ban1.DataSet.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring:=table.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring;
do_ban1.DataSet.fieldbyname('Ŀ<>ĸ<EFBFBD>').asstring:=table.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring;
do_ban1.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring:=table.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+' '+table.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
except
;
end;
end;
do_ban1.DataSet.post;
end;
end;
end
else
begin
sumnum:=0;
sumnumusd:=0;
first;
while not eof do
begin
sumnum:=sumnum+fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
Next;
end;
case strtoint(bs_text) of
1,7:
begin
do_ban1.DataSet.edit;
do_ban1.DataSet.fieldbyname('ʵ<>ʽ<EFBFBD><CABD><EFBFBD>').asFloat:=sumnum;
if 1=1 then
begin
if do_ban1.DataSet.fieldbyname('<27>ұ<EFBFBD>').asstring='USD' then
do_ban1.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring:=get_parameters_value(7,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD>')
else
do_ban1.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring:=get_parameters_value(147,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD>');
do_ban1.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring:=floattostr(do_ban1.DataSet['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']);
end;
if 1=1 then
begin
try
do_ban1.DataSet.fieldbyname('<27><EFBFBD><E1B5A5>').asstring:=table.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
do_ban1.DataSet.fieldbyname('ί<>б<EFBFBD><D0B1><EFBFBD>').asstring:=table.fieldbyname('ί<>б<EFBFBD><D0B1><EFBFBD>').asstring;
do_ban1.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring:=table.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
do_ban1.DataSet.fieldbyname('<27><><EFBFBD>˸<EFBFBD>').asstring:=table.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring;
do_ban1.DataSet.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring:=table.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring;
do_ban1.DataSet.fieldbyname('Ŀ<>ĸ<EFBFBD>').asstring:=table.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring;
do_ban1.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring:=table.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+' '+table.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
except
;
end;
end;
do_ban1.DataSet.post;
end;
end;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
Procedure Tfra_ch_add_do.balance_dms;
var
Ext,adate,bsno,corp,vslvoy,s:String;
ExcelTemplet:Variant;
i,j:integer;
M,D,Y:Word;
imp:boolean;
aAdoQuery,aAdoQueryInsert:TAdoQuery;
book1:Tbookmark;
begin
kbmbscard.EmptyTable;
kbmbscard.Open;
kbmbscardFee.EmptyTable;
kbmbscardFee.Open;
if OpenDialog1.Execute then
begin
Ext:=lowercase(ExtractFileExt(OpenDialog1.FileName));
if Ext='.xls' then
begin
ExcelTemplet:= CreateOleObject('Excel.Application');
try
kbmbscard.DisableControls;
ExcelTemplet.Workbooks.Open(OpenDialog1.FileName);
imp:=true;
if imp then
begin
I:=2;
while VartoStr(ExcelTemplet.ActiveSheet.Cells[I,2].Value)<>'' do
begin
if Mblnos='' then
Mblnos:=''''+VartoStr(ExcelTemplet.ActiveSheet.Cells[I,2].Value)+''''
else Mblnos:=Mblnos+','+''''+VartoStr(ExcelTemplet.ActiveSheet.Cells[I,2].Value)+'''';
kbmbscard.Insert;
kbmbscard.FieldByName('OrdNo').AsInteger:=i;
kbmbscard.FieldByName('MBLNO').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,2].Value);
if not kbmbscardFee.Locate('MBLNO',VartoStr(ExcelTemplet.ActiveSheet.Cells[I,2].Value),[]) then
begin
kbmbscardFee.Insert;
kbmbscardFee.FieldByName('MBLNO').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,2].Value);
kbmbscardFee.Post;
end;
// showmessage(kbmbscard.FieldByName('MBLNO').AsString);
kbmbscard.FieldByName('Etd').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,3].Value);
kbmbscard.FieldByName('FeeName').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,5].Value);
kbmbscard.FieldByName('AMT').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,6].Value);
if VartoStr(ExcelTemplet.ActiveSheet.Cells[I,7].Value)='CNY' then
kbmbscard.FieldByName('CURRENCY').AsString:='RMB'
else kbmbscard.FieldByName('CURRENCY').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,7].Value);
kbmbscard.FieldByName('ISOK').AsBoolean:=False;
kbmbscard.Post;
i:=i+1;
end;
end;
finally
kbmbscard.EnableControls;
ExcelTemplet.DisplayAlerts := true;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
ExcelTemplet.Quit;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>
end;
end;
end;
S:=do_ban1.DataSet.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
aAdoQuery:=CreateAdoQuery;
aAdoQueryInsert:=CreateAdoQuery;
aAdoQueryInsert.Close;
aAdoQueryInsert.SQL.Clear;
aAdoQueryInsert.SQL.Add(' Insert Into t_ch_fee_do ( <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,CH_ID ,<2C>ұ<EFBFBD> ,<2C><><EFBFBD><EFBFBD>ʼ<D4AD><CABC><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>)');
aAdoQueryInsert.SQL.Add(' values ( :<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,:ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,:CH_ID,:<3A>ұ<EFBFBD>,:<3A><><EFBFBD><EFBFBD>,:ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,:<3A><><EFBFBD><EFBFBD>)');
with aAdoQuery do
try
Close;sql.clear;
sql.add('Select t_op_seae.<2E><><EFBFBD><EFBFBD>,t_op_seae.<2E><><EFBFBD><EFBFBD><E1B5A5><>б<EFBFBD><D0B1><EFBFBD><><D7B0><EFBFBD><EFBFBD><><D0B6><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.add(', t_ch_fee.CH_ID,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ) <20><><EFBFBD><EFBFBD>,t_ch_fee.<2E>ұ<EFBFBD>,');
sql.add('case');
sql.add('when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in (''<27><><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD>'',''ŷ<>޷<EFBFBD><DEB7><EFBFBD><EFBFBD>뾳ժҪ<D5AA>յ<EFBFBD><D5B5><EFBFBD>'',''ŷ<>˷<EFBFBD><CBB7><EFBFBD><EFBFBD>뾳ժҪ<D5AA>ֵ<EFBFBD><D6B5><EFBFBD>'',''<27><><EFBFBD><EFBFBD>˾<EFBFBD>յ<EFBFBD><D5B5><EFBFBD>'') then ''<27>յ<EFBFBD><D5B5><EFBFBD>''');
sql.add('else case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''CFS<46><53>'' then ''<27><>վ<EFBFBD><D5BE>''');
sql.add(' else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.add(' end');
sql.add('end <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.add('from t_op_seae ');
sql.add('Left Join t_ch_fee on t_op_seae.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD>');
sql.add('where <20><><EFBFBD><EFBFBD><E1B5A5> in('+Mblnos+')');
sql.add('and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+s+'''');
sql.add('and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>''');
case strtoint(bs_text.text) of
7: begin
sql.add('and t_ch_fee.<2E><><EFBFBD><EFBFBD><>(t_ch_fee.<2E><><EFBFBD>뿪Ʊ+t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)');
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹɾ<D6B9><C9BE>'',''<27><>ֹ<EFBFBD>޸<EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' ');
{
sDate:=FormatDateTime('YYYY',Now);
nyear:=StrToInt64(sDate);
nyear:=nyear+1;
sDate:=inttostr(nyear)+'-'+'01'+'01';
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><'''+sDate+'''';
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD><>(t_ch_fee.<2E><><EFBFBD>뿪Ʊ+t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)');
}
end;
3: begin
sql.add('and ');
sql.add('(case <20><><EFBFBD><EFBFBD> when ''<27><>'' then (case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add('(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) ');
sql.add(' else(case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add(' (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) ');
sql.add('end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) ');
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹɾ<D6B9><C9BE>'',''<27><>ֹ<EFBFBD>޸<EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' ');
end;
4: begin
sql.add('and ');
sql.add('(case <20><><EFBFBD><EFBFBD> when ''<27><>'' then (case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add('(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) ');
sql.add(' else(case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add(' (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) ');
sql.add('end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) ');
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹɾ<D6B9><C9BE>'',''<27><>ֹ<EFBFBD>޸<EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' ');
end
end;
open;First;
while not Eof do
begin
if kbmbscard.Locate('MBLNO;FeeName;AMT;CURRENCY;ISOK',vararrayof([trim(FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString),FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,FieldByName('<27><><EFBFBD><EFBFBD>').AsString,FieldByName('<27>ұ<EFBFBD>').AsString,false]),[]) then
begin
kbmbscard.Edit;
kbmbscard.FieldByName('ISOK').AsBoolean:=true;
kbmbscard.Post;
aAdoQueryInsert.Close;
aAdoQueryInsert.Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=do_ban1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
aAdoQueryInsert.Parameters.ParamByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
aAdoQueryInsert.Parameters.ParamByName('CH_ID').Value:=FieldByName('CH_ID').AsInteger;
aAdoQueryInsert.Parameters.ParamByName('<27>ұ<EFBFBD>').Value:=FieldByName('<27>ұ<EFBFBD>').AsString;
aAdoQueryInsert.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
aAdoQueryInsert.Parameters.ParamByName('ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
aAdoQueryInsert.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=7;
aAdoQueryInsert.ExecSQL;
update_tablesb('7',do_ban1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,do_ban1,aAdoQuery);
end;
Next;
end;
finally
Free;
end;
SaveDialog1.FileName:='balance_dms';
if SaveDialog1.Execute then
begin
ExportExcelFile(SaveDialog1.FileName+'.xls',true,TDataSet(kbmbscard));
end
else
begin
end;
Mblnos:='';
Mblnos:=MblnosOk;
try
// if Mblnos<>'' then
// bsSkinButton8Click(bsSkinButton8);
finally
Mblnos:='';
kbmbscard.EmptyTable;
do_ban1.DataSet.ReFresh;
book1:=do_ban1.DataSet.GetBookmark;
TADOQuery(do_ban1.DataSet).Requery;
do_ban1.DataSet.GotoBookmark(book1);
end;
end;
Procedure Tfra_ch_add_do.balance_haier;
var
Ext,adate,bsno,corp,vslvoy,s:String;
ExcelTemplet:Variant;
i,j:integer;
M,D,Y:Word;
imp:boolean;
aAdoQuery:TAdoQuery;
begin
if Trim(ComboBoxObjBsCard.Text)='' then
begin
ShowMessage('<27><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
exit;
end;
kbmbscardttl.EmptyTable;
kbmbscardttl.Open;
if OpenDialog1.Execute then
begin
Ext:=lowercase(ExtractFileExt(OpenDialog1.FileName));
if Ext='.xls' then
begin
ExcelTemplet:= CreateOleObject('Excel.Application');
try
kbmbscardttl.DisableControls;
ExcelTemplet.Workbooks.Open(OpenDialog1.FileName);
imp:=true;
if imp then
begin
I:=2;
while VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value)<>'' do
begin
if Mblnos='' then
Mblnos:=''''+Trim(VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value))+''''
else Mblnos:=Mblnos+','+''''+Trim(VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value))+'''';
kbmbscardttl.Insert;
kbmbscardttl.FieldByName('OrdNo').AsInteger:=i;
kbmbscardttl.FieldByName('MBLNO').AsString:=Trim(VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value));
if VartoStr(ExcelTemplet.ActiveSheet.Cells[I,3].Value)<>'' then
kbmbscardttl.FieldByName('AMT').AsString:=FormatFloat('0.00;-0.00;0.00',StrtoFloat(VartoStr(ExcelTemplet.ActiveSheet.Cells[I,3].Value)))
else kbmbscardttl.FieldByName('AMT').AsString:='0.00';
if VartoStr(ExcelTemplet.ActiveSheet.Cells[I,2].Value)<>'' then
kbmbscardttl.FieldByName('USDAMT').AsString:=FormatFloat('0.00;-0.00;0.00',StrtoFloat(VartoStr(ExcelTemplet.ActiveSheet.Cells[I,2].Value)))
else kbmbscardttl.FieldByName('USDAMT').AsString:='0.00';
kbmbscardttl.FieldByName('ISOK').AsBoolean:=False;
kbmbscardttl.Post;
i:=i+1;
end;
end;
finally
kbmbscardttl.EnableControls;
ExcelTemplet.DisplayAlerts := true;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
ExcelTemplet.Quit;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>
end;
end;
end;
S:=Trim(ComboBoxObjBsCard.Text);
if (S<>'') and (length(S)>10) then
s:=Trim(Copy(S,11,length(S)-10));
aAdoQuery:=CreateAdoQuery;
with aAdoQuery do
try
Close;sql.clear;
sql.add('Select t_op_seae.<2E><><EFBFBD><EFBFBD><E1B5A5>,t_op_seae.<2E><><EFBFBD><EFBFBD>Ա,t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
case strtoint(bs_text.text) of
7: begin
sql.add(', 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>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ else 0 end) ELSE 0 END ) as <20><><EFBFBD><EFBFBD> ');
sql.add(',');
sql.add('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>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ else 0 end) ELSE 0 END) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD> ');
end;
3: begin
sql.add(', 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>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20><><EFBFBD><EFBFBD> ');
sql.add(',');
sql.add('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>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD> ');
end;
4: begin
sql.add(', 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>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20><><EFBFBD><EFBFBD> ');
sql.add(',');
sql.add('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>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD> ');
end;
end;
sql.add('from t_op_seae ');
sql.add('Left Join t_ch_fee on t_op_seae.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD>');
sql.add('where <20><><EFBFBD><EFBFBD><E1B5A5> in('+Mblnos+')');
sql.add('and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+s+'''');
case strtoint(bs_text.text) of
7: begin
sql.add('and t_ch_fee.<2E><><EFBFBD><EFBFBD><>(t_ch_fee.<2E><><EFBFBD>뿪Ʊ+t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)');
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹɾ<D6B9><C9BE>'',''<27><>ֹ<EFBFBD>޸<EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' ');
end;
3: begin
sql.add('and ');
sql.add('(case <20><><EFBFBD><EFBFBD> when ''<27><>'' then (case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add('(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) ');
sql.add(' else(case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add(' (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) ');
sql.add('end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) ');
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹɾ<D6B9><C9BE>'',''<27><>ֹ<EFBFBD>޸<EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' ');
end;
4: begin
sql.add('and ');
sql.add('(case <20><><EFBFBD><EFBFBD> when ''<27><>'' then (case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add('(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) ');
sql.add(' else(case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add(' (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) ');
sql.add('end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) ');
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹɾ<D6B9><C9BE>'',''<27><>ֹ<EFBFBD>޸<EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' ');
end
end;
sql.add('Group by t_op_seae.<2E><><EFBFBD><EFBFBD><E1B5A5>,t_op_seae.<2E><><EFBFBD><EFBFBD>Ա,t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
// showmessage(SQL.Text);
open;First;
while not Eof do
begin
if kbmbscardttl.Locate('MBLNO;AMT;USDAMT',vararrayof([FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString,FormatFloat('0.00;-0.00;0.00',FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat),FormatFloat('0.00;-0.00;0.00',FieldByName('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat)]),[]) then
begin
if MblnosOk='' then
MblnosOk:=''''+FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString+''''
else MblnosOk:=MblnosOk+','+''''+FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString+'''';
kbmbscardttl.Edit;
kbmbscardttl.FieldByName('ISOK').AsBoolean:=true;
kbmbscardttl.FieldByName('OP').AsString:=FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString;
kbmbscardttl.FieldByName('SALE').AsString:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
kbmbscardttl.Post;
end
else if kbmbscardttl.Locate('MBLNO',FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString,[]) then
begin
kbmbscardttl.Edit;
kbmbscardttl.FieldByName('DIFFAMT').AsString:=FormatFloat('0.00;-0.00;0.00',FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
kbmbscardttl.FieldByName('DIFFUSDAMT').AsString:=FormatFloat('0.00;-0.00;0.00',FieldByName('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat);
kbmbscardttl.FieldByName('OP').AsString:=FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString;
kbmbscardttl.FieldByName('SALE').AsString:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
kbmbscardttl.Post;
end;
Next;
end;
finally
Free;
end;
SaveDialog1.FileName:='balance_cy';
if SaveDialog1.Execute then
begin
ExportExcelFile(SaveDialog1.FileName+'.xls',true,TDataSet(kbmbscardttl));
end
else
begin
end;
Mblnos:='';
Mblnos:=MblnosOk;
try
if Mblnos<>'' then
bsSkinButton8Click(bsSkinButton8);
finally
Mblnos:='';
kbmbscardttl.EmptyTable;
end;
end;
procedure Tfra_ch_add_do.bsSkinButton18Click(Sender: TObject);
var
Pnt:Tpoint;
begin
Pnt:=bsSkinButton18.ClientToScreen(Point(0,bsSkinButton18.Height));
PopupMenu3.Popup(Pnt.x,Pnt.y);
end;
procedure Tfra_ch_add_do.N14Click(Sender: TObject);
begin
if bs_text.text<>'7' then
begin
ShowMessage('ֻ<>з<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> <20>ſ<EFBFBD><C5BF><EFBFBD>ʹ<EFBFBD>øù<C3B8><C3B9><EFBFBD>');
exit;
end;
if bs_text.text='7' then
begin
if do_ban1.DataSet.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring='' then
begin
ShowMessage('<27><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
end;
if do_ban1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='' then
begin
ShowMessage('<27><><EFBFBD>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
end;
balance_dms;
end;
procedure Tfra_ch_add_do.N16Click(Sender: TObject);
begin
balance_haier;
end;
procedure Tfra_ch_add_do.v_op_bscard1DataChange(Sender: TObject;Field: TField);
var fee_str,str_fee,sum_str:string;
begin
{
//showmessage(v_op_bscard1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString);
if bs_text.text='7' then
begin
t_ch_fee.DataSource:=nil;
// t_ch_fee_sum.DataSource:=nil;
try
if kbmbscardFee.Active then
begin
if kbmbscardFee.Locate('MBLNO',v_op_bscard1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString,[]) then
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>, δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) from v_ch_fee '
+' where <20><><EFBFBD><EFBFBD>='+''''+v_op_bscard1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+''''
+'and <20><><EFBFBD><EFBFBD><>(<28><><EFBFBD>뿪Ʊ+<2B><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1'
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')'
+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''' ;
if kbmbscardFee.FieldByName('FeeNames').AsString<>'' then
begin
fee_str:=fee_str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ('+kbmbscardFee.FieldByName('FeeNames').AsString+')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) '
+'else(case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+' where <20><><EFBFBD><EFBFBD>='+''''+v_op_bscard1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+''''
+'and <20><><EFBFBD><EFBFBD><>(<28><><EFBFBD>뿪Ʊ+<2B><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1'
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')'
+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''' ;
if kbmbscardFee.FieldByName('FeeNames').AsString<>'' then
begin
sum_str:=sum_str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ('+kbmbscardFee.FieldByName('FeeNames').AsString+')';
end;
sum_str:=sum_str+' group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
t_ch_fee.Close;
t_ch_fee.sql.clear;
t_ch_fee.sql.add(fee_str);
t_ch_fee.open;
{
t_ch_fee_sum.Close;
t_ch_fee_sum.sql.clear;
t_ch_fee_sum.sql.add(sum_str);
t_ch_fee_sum.open;
end;
end;
finally
t_ch_fee.DataSource:=v_op_bscard1;
// t_ch_fee_sum.DataSource:=v_op_bscard1;
end;
end;
}
end;
procedure Tfra_ch_add_do.expvsl;
var
Ext,adate,bsno,corp,vslvoy,s:String;
ExcelTemplet:Variant;
i,j:integer;
M,D,Y:Word;
imp:boolean;
aAdoQuery:TAdoQuery;
begin
kbmVsl.EmptyTable;
kbmVsl.Open;
if OpenDialog1.Execute then
begin
Ext:=lowercase(ExtractFileExt(OpenDialog1.FileName));
if Ext='.xls' then
begin
ExcelTemplet:= CreateOleObject('Excel.Application');
aAdoQuery:=CreateAdoQuery;
try
kbmVsl.DisableControls;
ExcelTemplet.Workbooks.Open(OpenDialog1.FileName);
imp:=true;
if imp then
begin
I:=2;
while VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value)<>'' do
begin
if Mblnos='' then
Mblnos:=''''+Trim(VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value))+''''
else Mblnos:=Mblnos+','+''''+Trim(VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value))+'''';
kbmVsl.Insert;
kbmVsl.FieldByName('MBLNO').AsString:=Trim(VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value));
aAdoQuery.close;
aAdoQuery.SQL.Text:='select <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ա,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>״̬ from t_op_seae where <20><><EFBFBD><EFBFBD><E1B5A5>='''+kbmVsl.FieldByName('MBLNO').AsString+''' AND ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' ';
aAdoQuery.Open;
if not aAdoQuery.IsEmpty then begin
kbmVsl.FieldByName('VESSEL').AsString:=aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
kbmVsl.FieldByName('VOY').AsString:=aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
kbmVsl.FieldByName('SALE').AsString:=aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
kbmVsl.FieldByName('OP').AsString:=aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD>Ա').AsString;
kbmVsl.FieldByName('ETD').AsString:=aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
kbmVsl.FieldByName('FEESTATUS').AsString:=aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').AsString;
end;
kbmVsl.Post;
i:=i+1;
end;
end;
finally
FreeAndNil(aAdoQuery);
kbmVsl.EnableControls;
ExcelTemplet.DisplayAlerts := true;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
ExcelTemplet.Quit;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>
end;
end;
end;
SaveDialog1.FileName:='mbl_vsl';
if SaveDialog1.Execute then
begin
ExportExcelFile(SaveDialog1.FileName+'.xls',true,TDataSet(kbmVsl));
end
else
begin
end;
Mblnos:='';
Mblnos:=MblnosOk;
try
finally
Mblnos:='';
kbmbscardttl.EmptyTable;
end;
end;
procedure Tfra_ch_add_do.N18Click(Sender: TObject);
begin
expvsl;
end;
end.