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.

6550 lines
260 KiB
Plaintext

This file contains ambiguous Unicode characters!

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

unit u_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,
bsSkinBoxCtrls;
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;
dxDBGrid19: TdxDBGrid;
dxDBGridMaskColumn46: TdxDBGridMaskColumn;
dxDBGridMaskColumn47: TdxDBGridMaskColumn;
dxDBGridMaskColumn49: TdxDBGridMaskColumn;
dxDBGridColumn116: TdxDBGridColumn;
dxDBGridColumn117: TdxDBGridColumn;
dxDBGridMaskColumn50: TdxDBGridMaskColumn;
dxDBGridDateColumn7: TdxDBGridDateColumn;
dxDBGridDateColumn8: TdxDBGridDateColumn;
dxDBGridMaskColumn51: TdxDBGridMaskColumn;
dxDBGridColumn118: TdxDBGridColumn;
dxDBGridMaskColumn52: TdxDBGridMaskColumn;
dxDBGridMaskColumn53: TdxDBGridMaskColumn;
dxDBGridMaskColumn54: TdxDBGridMaskColumn;
dxDBGridMaskColumn55: TdxDBGridMaskColumn;
dxDBGridColumn119: TdxDBGridColumn;
dxDBGridColumn120: TdxDBGridColumn;
dxDBGridMaskColumn56: TdxDBGridMaskColumn;
dxDBGridMaskColumn57: TdxDBGridMaskColumn;
dxDBGridMaskColumn58: TdxDBGridMaskColumn;
v_op_bscard: TADOQuery;
v_op_bscard1: TDataSource;
dxDBGrid19Column21: TdxDBGridColumn;
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;
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox3: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox4: TbsSkinCheckRadioBox;
bsSkinPanel12: TbsSkinPanel;
bsSkinCheckRadioBox5: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox6: TbsSkinCheckRadioBox;
bsSkinPanel13: TbsSkinPanel;
Label77: TLabel;
ComboBoxCurry: TComboBox;
Label78: TLabel;
Edit34: TEdit;
dxDBGrid19Column22: TdxDBGridColumn;
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;
dxDBGrid19Column23: TdxDBGridColumn;
dxDBGrid19Column24: TdxDBGridColumn;
dxDBGrid19Column25: TdxDBGridColumn;
Label80: TLabel;
Edit35: TEdit;
Splitter1: TSplitter;
dxDBGrid19Column26: TdxDBGridColumn;
dxDBGrid19Column27: TdxDBGridColumn;
dxDBGrid19Column28: TdxDBGridColumn;
dxDBGrid19Column29: TdxDBGridColumn;
bsSkinButton12: TbsSkinButton;
dxDBGrid19Column31: TdxDBGridMaskColumn;
Label81: TLabel;
ComboBoxObjBs: TComboBox;
N12: TMenuItem;
dxDBGrid19Column32: TdxDBGridColumn;
dxDBGrid19Column33: TdxDBGridColumn;
ComboBox1: TComboBox;
Label83: TLabel;
Edit36: TEdit;
dxDBGrid17Column7: TdxDBGridColumn;
dxDBGrid17Column8: TdxDBGridColumn;
bsSkinComboBox1: TbsSkinComboBox;
do_ban_fee1: TDataSource;
dxDBGrid17Column9: TdxDBGridColumn;
t_ch_fee_sum_all: TADOQuery;
t_ch_fee_sum_all1: TDataSource;
t_ch_fee_sum_ttl: TADOQuery;
t_ch_fee_sum_ttl1: TDataSource;
Panel6: TPanel;
dxDBGrid18: TdxDBGrid;
dxDBGridColumn113: TdxDBGridColumn;
dxDBGridMaskColumn45: TdxDBGridMaskColumn;
dxDBGridColumn114: TdxDBGridColumn;
dxDBGridColumn115: TdxDBGridColumn;
dxDBGrid20: TdxDBGrid;
dxDBGridColumn121: TdxDBGridColumn;
dxDBGridMaskColumn48: TdxDBGridMaskColumn;
dxDBGridColumn123: TdxDBGridColumn;
bsSkinComboBox2: TbsSkinComboBox;
dxDBGrid19Column34: TdxDBGridColumn;
dxDBGrid17Column10: TdxDBGridColumn;
Label82: TLabel;
dxDBGrid19Column35: TdxDBGridColumn;
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 v_op_bscardBeforeScroll(DataSet: TDataSet);
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 ComboBox1Enter(Sender: TObject);
procedure dxDBGrid19SelectedCountChange(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>
function CheckDrFeeExsit(bsno:string) : string; //
function CheckDrFeeExsitItems(bsno:string) : string; //
{ Private declarations }
public
{ Public declarations }
old_sum_str,sum_str:WideString;
acust_sum:string;
end;
implementation
uses u_main, my_sys_function, u_data_share, FindListu;
{$R *.dfm}
function Tfra_ch_add_do.CheckDrFeeExsit(bsno:string) : string; //
var aAdoQueryDr:TAdoQuery;
begin
result:='';
if strtobool(get_parameters_value(319,'false')) then
begin
if (bs_text.text='2') then
begin
aAdoQueryDr:=CreateAdoQuery;
with aAdoQueryDr do
try
Close;Sql.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee');
SQL.Add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD>=''<27><>''');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=bsno;
Open;First;
with t_ch_fee_detail do
begin
t_ch_fee_detail.First;
while not t_ch_fee_detail.Eof do
begin
if not aAdoQueryDr.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',t_ch_fee_detail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,[]) then
begin
if result='' then
result:=t_ch_fee_detail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString
else
if pos(t_ch_fee_detail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,result)<=0 then
result:=result+','+t_ch_fee_detail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
t_ch_fee_detail.Next;
end;
end;
finally
free;
end;
end;
end;
end;
function Tfra_ch_add_do.CheckDrFeeExsitItems(bsno:string) : string; //
var aAdoQueryDr:TAdoQuery;
begin
result:='';
if strtobool(get_parameters_value(319,'false')) then
begin
if (bs_text.text='2') then
begin
aAdoQueryDr:=CreateAdoQuery;
with aAdoQueryDr do
try
Close;Sql.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee');
SQL.Add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD>=''<27><>''');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=bsno;
Open;First;
if not aAdoQueryDr.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,[]) then
begin
if result='' then
result:=t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString
else
if pos(t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,result)<=0 then
result:=result+','+t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
finally
free;
end;
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(ComboBoxObjBsCard.Text);
if (S<>'') and (length(S)>10) then begin
// if ComboBoxObjBsCard.items.
aCustID:=Trim(Copy(S,11,length(S)-10));
acust_sum:=aCustID;
result:=true;
exit;
end;
if S='' then begin
aCustID:='';
acust_sum:=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;
acust_sum:=aCustID;
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;
acust_sum:=aCustID;
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><><CBB0>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<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><><CBB0>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<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)+''')';
fee_str:=fee_str+' and EXISTS (select 1 from v_dui_fee where v_dui_fee.CH_ID=t_ch_fee.CH_ID AND v_dui_fee.<2E><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
if Trim(Edit36.Text)<>'' then begin
fee_str:=fee_str+' and EXISTS (select 1 from t_ch_fee_do where t_ch_fee_do.CH_ID=t_ch_fee.CH_ID AND t_ch_fee_do.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.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><><CBB0>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<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><><CBB0>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<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><><CBB0>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<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><><CBB0>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<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><><CBB0>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<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;
aLlist:TStringList;
vatrate:double;
s:string;
begin
//ҵ<><D2B5><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
s:='';
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
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;
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,do_ban_fee1)
else
shen_yewwu(t_op_seae,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid2,i,j,do_ban_fee1);
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,do_ban_fee1)
else
shen_yewwu(t_op_seai,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid4,i,j,do_ban_fee1);
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,do_ban_fee1)
else
shen_yewwu(t_op_aire,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid7,i,j,do_ban_fee1);
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,do_ban_fee1)
else
shen_yewwu(t_op_airi,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid10,i,j,do_ban_fee1);
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;
v_op_bscard.DisableControls;
try
if dxDBGrid19.SelectedCount>=1 then
begin
t_ch_fee.DataSource:=t_op_bscard_all1;
{
try
if dxDBGrid19.SelectedCount>1 then
begin
t_ch_fee_sum.close;
t_ch_fee_sum.DataSource:=nil;
t_ch_fee_sum.sql.clear;
t_ch_fee_sum.sql.add(sum_str);
t_ch_fee_sum.open;
end
else
begin
t_ch_fee_sum.close;
t_ch_fee_sum.DataSource:=v_op_bscard1;
t_ch_fee_sum.sql.clear;
t_ch_fee_sum.sql.add(sum_str);
t_ch_fee_sum.open;
end;
finally
end;
}
t_ch_fee_sum.DataSource:=t_op_bscard_all1;
for f:=0 to dxDBGrid19.SelectedCount-1 do
begin
v_op_bscard.GotoBookmark(pointer(dxDBGrid19.selectedrows[f]));
if str='' then
str:='<27><><EFBFBD><EFBFBD>='+''''+v_op_bscard.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
else
str:=str+' or <20><><EFBFBD><EFBFBD>='+''''+v_op_bscard.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
end;
dxDBGrid19.ClearSelection;
str:='and ('+str+')';
t_ch_fee_detail.close;
if Trim(Edit36.Text)<>'' then
t_ch_fee_detail.sql.text:=StringReplace(feestr,'and t_ch_fee.<2E><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>',str,[rfReplaceAll])
else t_ch_fee_detail.sql.text:=StringReplace(feestr,'and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>',str,[rfReplaceAll]);
// t_ch_fee_detail.sql.text:=StringReplace(feestr,'and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>',str,[rfReplaceAll]);
t_ch_fee_detail.open;
if (bs_text.text='7') or (bs_text.text='1') then
begin
aLlist:=TStringList.Create;
with t_ch_fee_detail do
try
First;
while not eof do
begin
vatrate:=t_ch_fee_detail.FieldByName('<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').AsFloat;
if aLlist.IndexOf(FloatToStr(vatrate))<0 then
begin
aLlist.Add(FloatToStr(vatrate));
end;
Next;
end;
if aLlist.Count>1 then
begin
if strtobool(get_parameters_value(322,'false')) then
begin
if wwDBComboBox31.text='<27><>' then
begin
if MessageDlg('ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ͬ<EFBFBD><CDAC>˰<EFBFBD><CBB0>:'+aLlist.CommaText+' <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
begin
Exit;
end;
end
else
begin
showmessage('ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ͬ<EFBFBD><CDAC>˰<EFBFBD><CBB0>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뷢Ʊ');
exit;
end;
end
else
if MessageDlg('ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ͬ<EFBFBD><CDAC>˰<EFBFBD><CBB0>:'+aLlist.CommaText+' <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
begin
Exit;
end;
end;
if do_ban_fee1.DataSet.RecordCount>=1 then
begin
if aLlist.Count=1 then
begin
if strtobool(get_parameters_value(322,'false')) then
begin
if vatrate<>do_ban1.DataSet.FieldByName('˰<><CBB0>').AsFloat then
begin
if wwDBComboBox31.text='<27><>' then
begin
if MessageDlg('ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ͬ<EFBFBD><CDAC>˰<EFBFBD><CBB0>:'+aLlist.CommaText+' <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
begin
Exit;
end;
end
else
begin
showmessage('<27><>ͬ<EFBFBD><CDAC>˰<EFBFBD><CBB0>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬһ<CDAC>ŷ<EFBFBD>Ʊ');
exit;
end;
end;
end
end;
end;
finally
aLlist.Free;
end;
end;
s:=CheckDrFeeExsit(v_op_bscard.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
if s<>'' then
begin
if MessageDlg('<27><><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>,<2C>շѲ<D5B7><D1B2><EFBFBD><EFBFBD>ڵķ<DAB5><C4B7><EFBFBD>Ϊ:'+#13#10+s+' <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
begin
Exit;
end;
end;
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_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j,c,ComboBoxCurry.text,do_ban_fee1) //v_op_bscard
else
shen_yewwu(v_op_bscard,bs_text.Text,t_ch_fee_detail,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j,do_ban_fee1);
t_ch_fee_detail.close;
v_op_bscard.close;
v_op_bscard.open;
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,do_ban_fee1)
else
shen_yewwu(v_op_bscard,bs_text.Text,t_ch_fee,t_ch_fee_do,t_rate,do_ban1,dxDBGrid19,i,j,do_ban_fee1);
t_ch_fee_detail.close;
v_op_bscard.close;
v_op_bscard.open;
end;
finally
v_op_bscard.EnableControls;
t_ch_fee.DataSource:=v_op_bscard1;
{
try
if dxDBGrid19.SelectedCount>1 then
begin
t_ch_fee_sum.close;
t_ch_fee_sum.DataSource:=nil;
t_ch_fee_sum.sql.clear;
t_ch_fee_sum.sql.add(sum_str);
t_ch_fee_sum.open;
end
else
begin
t_ch_fee_sum.close;
t_ch_fee_sum.DataSource:=v_op_bscard1;
t_ch_fee_sum.sql.clear;
t_ch_fee_sum.sql.add(sum_str);
t_ch_fee_sum.open;
end;
finally
end;
}
t_ch_fee_sum.DataSource:=v_op_bscard1;
end;
end;
t_rate.close;
{
except
on e:exception do
begin
ShowMessage(e.Message);
end;
end;
}
finally
t_ch_fee.EnableControls;
t_ch_fee_sum.EnableControls;
do_ban1.DataSet.Refresh;
end;
end;
procedure Tfra_ch_add_do.MenuItem1Click(Sender: TObject);
var
i,j,c,k:integer;
RE:boolean;
aLlist:TStringList;
vatrate:double;
s:string;
begin
//<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 fra_ch_add_do1.dxgrid.SelectedCount<=0 then 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
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;
// 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,do_ban_fee1)
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,do_ban_fee1);
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,do_ban_fee1)
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,do_ban_fee1);
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,do_ban_fee1)
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,do_ban_fee1);
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,do_ban_fee1)
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,do_ban_fee1);
end;
if bsSkinTabSheet5.Showing then
begin
if (bs_text.text='7') or (bs_text.text='1') then
begin
aLlist:=TStringList.Create;
try
if dxDBGrid17.SelectedCount>=1 then
begin
for k:=0 to dxDBGrid17.SelectedCount-1 do
begin
t_ch_fee.GotoBookmark(pointer(dxDBGrid17.selectedrows[k]));
vatrate:=t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>').AsFloat;
if aLlist.IndexOf(FloatToStr(vatrate))<0 then
begin
aLlist.Add(FloatToStr(vatrate));
end;
end;
end;
if aLlist.Count>1 then
begin
if strtobool(get_parameters_value(322,'false')) then
begin
if wwDBComboBox31.text='<27><>' then
begin
if MessageDlg('ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ͬ<EFBFBD><CDAC>˰<EFBFBD><CBB0>:'+aLlist.CommaText+' <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
begin
Exit;
end;
end
else
begin
showmessage('ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ͬ<EFBFBD><CDAC>˰<EFBFBD><CBB0>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뷢Ʊ');
exit;
end;
end
else
if MessageDlg('ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ͬ<EFBFBD><CDAC>˰<EFBFBD><CBB0>:'+aLlist.CommaText+' <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
begin
Exit;
end;
end;
if do_ban_fee1.DataSet.RecordCount>=1 then
begin
if aLlist.Count=1 then
begin
if strtobool(get_parameters_value(322,'false')) then
begin
if vatrate<>do_ban1.DataSet.FieldByName('˰<><CBB0>').AsFloat then
begin
if wwDBComboBox31.text='<27><>' then
begin
if MessageDlg('ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ͬ<EFBFBD><CDAC>˰<EFBFBD><CBB0>:'+aLlist.CommaText+' <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
begin
Exit;
end;
end
else
begin
showmessage('ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ͬ<EFBFBD><CDAC>˰<EFBFBD><CBB0>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뷢Ʊ');
exit;
end;
end;
end
end;
end;
finally
aLlist.Free;
end;
end;
s:=CheckDrFeeExsitItems(v_op_bscard.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
if s<>'' then
begin
if MessageDlg('<27><><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>,<2C>շѲ<D5B7><D1B2><EFBFBD><EFBFBD>ڵķ<DAB5><C4B7><EFBFBD>Ϊ:'+#13#10+s+' <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
begin
Exit;
end;
end;
if dxDBGrid17.SelectedCount>0 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
begin
shen_fee_selectsb(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,do_ban_fee1)
end
else
begin
shen_fee_select(bs_text.text,v_op_bscard,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,dxDBGrid17,i,j,do_ban_fee1);
end;
end
else
begin
end;
end;
finally
t_rate.close;
t_ch_fee.Requery();
t_ch_fee_sum.Requery();
t_ch_fee.EnableControls;
t_ch_fee_sum.EnableControls;
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;
}
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><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 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><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:
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><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 '
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><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 '
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;
s:string;
begin
//<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
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;
// 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;
{
if (bs_text.Text='2') and (t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>') then
begin
try
ShowMessage('<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>ܲ<EFBFBD><DCB2>ֳ<EFBFBD><D6B3><EFBFBD>');
Exit;
finally
t_rate.close;
t_ch_fee.Requery();
t_ch_fee_sum.Requery();
t_ch_fee.EnableControls;
t_ch_fee_sum.EnableControls;
end;
end;
}
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,do_ban_fee1)
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,do_ban_fee1);
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,do_ban_fee1)
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,do_ban_fee1);
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,do_ban_fee1)
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,do_ban_fee1);
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,do_ban_fee1)
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,do_ban_fee1);
end;
if bsSkinTabSheet5.Showing then
begin
s:=CheckDrFeeExsitItems(v_op_bscard.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
if s<>'' then
begin
if MessageDlg('<27><><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>,<2C>շѲ<D5B7><D1B2><EFBFBD><EFBFBD>ڵķ<DAB5><C4B7><EFBFBD>Ϊ:'+#13#10+s+' <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
begin
Exit;
end;
end;
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_fee_fensb(bs_text.text,v_op_bscard,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,c,ComboBoxCurry.text,do_ban_fee1)
else
shen_fee_select_fee_fen(bs_text.text,v_op_bscard,t_ch_fee,t_ch_fee_sum,t_ch_fee_do,t_rate,do_ban1,i,do_ban_fee1);
end;
finally
t_rate.close;
t_ch_fee.Requery();
t_ch_fee_sum.Requery();
t_ch_fee.EnableControls;
t_ch_fee_sum.EnableControls;
end;
end;
procedure Tfra_ch_add_do.bsSkinButton8Click(Sender: TObject);
var
str_fee,str_fee_I,str_op:widestring;
op_str,fee_str,sum_str,Str_bill:widestring;
Str,aCust,aCuster:String;
begin
// v_op_bscard.BeforeScroll:=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;
case strtoint(bs_text.text) of
1: //<2F><>Ʊ
begin
if (strtobool(get_parameters_value(87,'false'))=true) then
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>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+')';
if Trim(Edit36.Text)<>'' then
begin
// fee_str:=fee_str+' and CH_ID in (select CH_ID from t_ch_fee_do where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.Text)+''')';
fee_str:=fee_str+' and EXISTS (select 1 from t_ch_fee_do where t_ch_fee_do.CH_ID=t_ch_fee.CH_ID AND t_ch_fee_do.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.Text)+''')';
end;
str_fee_I:='where t_ch_fee.<2E><><EFBFBD><EFBFBD><>(t_ch_fee.<2E><><EFBFBD>뿪Ʊ+t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1'
+' 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>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+')';
end
else
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>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if Trim(Edit36.Text)<>'' then begin
// fee_str:=fee_str+' and CH_ID in (select CH_ID from t_ch_fee_do where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.Text)+''')';
fee_str:=fee_str+' and EXISTS (select 1 from t_ch_fee_do where t_ch_fee_do.CH_ID=t_ch_fee.CH_ID AND t_ch_fee_do.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.Text)+''')';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
str_fee_I:=str_fee_I+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
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 (<28><><EFBFBD><EFBFBD>=0 or <20><><EFBFBD><EFBFBD> is null)';
str_fee_I:=str_fee_I+' and (t_ch_fee.<2E><><EFBFBD><EFBFBD>=0 or t_ch_fee.<2E><><EFBFBD><EFBFBD> is null) ';
end;
end;
end;
7: //<2F><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>
begin
if (strtobool(get_parameters_value(87,'false'))=true) then
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>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+')';
end
else
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>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
end;
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 (<28><><EFBFBD><EFBFBD>=0 or <20><><EFBFBD><EFBFBD> is null)';
end;
end;
end;
2: //ҵ<><D2B5>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
if strtobool(get_parameters_value(323,'false')) then
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><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
end
else
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>'+''''+')';
end;
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 (<28><><EFBFBD><EFBFBD>=0 or <20><><EFBFBD><EFBFBD> is null)';
end;
end;
if strtobool(get_parameters_value(175,'false')) then
str_fee:=str_fee+ ' and '+ open_data('7000','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no');
{
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><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>'+''''+')';
{ 20130525 ljp
}
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 (<28><><EFBFBD><EFBFBD>=0 or <20><><EFBFBD><EFBFBD> is null)';
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><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 (<28><><EFBFBD><EFBFBD>=0 or <20><><EFBFBD><EFBFBD> is null)';
end;
end;
end;
6: //ҵ<><D2B5><EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD> 2123
begin
if strtobool(get_parameters_value(323,'false')) then
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><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
end
else
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>'+''''+')';
end;
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 (<28><><EFBFBD><EFBFBD>=0 or <20><><EFBFBD><EFBFBD> is null)';
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
begin
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+acust+'''';
str_fee_i:=str_fee_i+' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+acust+'''';
end;
if RxDBLookupCombo15.DisplayValues[1]<>''then
begin
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
str_fee_i:=str_fee_i+' and t_ch_fee.<2E>ұ<EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
end;
if RxDBLookupCombo16.DisplayValues[1]<>''then
begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
str_fee_I:=str_fee_I+' and t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
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><D5B5><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 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 ComboBox1.text<>''then
str_op:=str_op+' and v_op_bscard_all.'+bsSkinComboBox1.text+'='+''''+ComboBox1.text+'''';
{
if Edit18.text<>''then
str_op:=str_op+' and v_op_bscard.'+Label2.Caption+' like '+''''+'%'+Edit18.text+'%'+'''';
}
case bsSkinComboBox2.ItemIndex of
0:
begin
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+'''';
end;
1:
begin
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+'''';
end;
2:
begin
if wwDBDateTimePicker17.text<>''then
str_op:=str_op+' and v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker17.text+'''';
if wwDBDateTimePicker19.text<>''then
str_op:=str_op+' and v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker19.text+'''';
end;
3:
begin
if wwDBDateTimePicker17.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker17.text+'''';
if wwDBDateTimePicker19.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker19.text+'''';
end;
end;
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(Edit36.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><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.Text)+''')';
end;
//ShowMessage(str_op);
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)=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 (v_op_bscard_all.<2E><><EFBFBD>۸<EFBFBD><DBB8><EFBFBD>=0 OR v_op_bscard_all.<2E><><EFBFBD>۸<EFBFBD><DBB8><EFBFBD> IS NULL) ';
end;
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;
case strtoint(bs_text.text) of
3,6: begin //3 Ӧ<>շ<EFBFBD><D5B7>ý<EFBFBD><C3BD><EFBFBD>
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><D5B5><EFBFBD>'
+',v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ'
+',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.<2E>ͷ<EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10,'
+'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 ';
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>'') 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>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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><D5B5><EFBFBD>'
+',v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ'
+',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.<2E>ͷ<EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10'
+default_sort(53,'v_op_bscard_all','','desc');
end;
2,4: begin //2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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><D5B5><EFBFBD>'
+',v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ'
+',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.<2E>ͷ<EFBFBD>Ա,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10,'
+'t_op_gain.Ӧ<><D3A6>USD-t_op_gain.<2E><><EFBFBD><EFBFBD>USD as δ<><CEB4>USD '
+','
+'t_op_gain.Ӧ<><D3A6>RMB-t_op_gain.<2E><><EFBFBD><EFBFBD>RMB 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 '
+' Left Join t_op_gain on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_op_gain.<2E><><EFBFBD><EFBFBD>';
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>'') 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>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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><D5B5><EFBFBD>'
+',v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ'
+',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.<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 '
+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.<2E><><EFBFBD>յ<EFBFBD><D5B5><EFBFBD>'
+',v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ'
+',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.<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 '+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: //<2F><>Ʊ
begin
if Trim(Edit36.Text)<>'' then
begin
fee_str:='select t_ch_fee.<2E><><EFBFBD><EFBFBD>,t_ch_fee.CH_ID,t_ch_fee.<2E><><EFBFBD><EFBFBD>,t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'
+',t_ch_fee.<2E>ұ<EFBFBD>,t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.˰<><CBB0>,<2C><>ע,t_ch_fee.<2E><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>,t_ch_fee.<2E><><EFBFBD><EFBFBD>,(t_ch_fee_do.ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
+' from t_ch_fee_do '
+' left join t_ch_fee on t_ch_fee_do.ch_id=t_ch_fee.ch_id '
+str_fee_i+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit36.Text)<>'' then
begin
fee_str:=fee_str+' and t_ch_fee_do.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.Text)+'''';
end;
fee_str:=fee_str+' order by t_ch_fee.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
else
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><>ע,˰<><CBB0>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<2C><>Ʊ<EFBFBD><C6B1><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;
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;
if Trim(Edit36.Text)<>'' then begin
// fee_str:=fee_str+' and CH_ID in (select CH_ID from t_ch_fee_do where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.Text)+''')';
fee_str:=fee_str+' and EXISTS (select 1 from t_ch_fee_do where t_ch_fee_do.CH_ID=t_ch_fee.CH_ID AND t_ch_fee_do.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.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;
end;
7: //<2F><>Ʊ<EFBFBD><C6B1><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><>ע,<2C><><EFBFBD><EFBFBD><><CBB0>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><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;
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: //ҵ<><D2B5>֧<EFBFBD><D6A7><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><>ע,˰<><CBB0>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<2C><>Ʊ<EFBFBD><C6B1><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(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';
// showmessage(fee_str);
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;
{
<20><>ʷ
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: //3 Ӧ<>շ<EFBFBD><D5B7>ý<EFBFBD><C3BD><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><>ע,˰<><CBB0>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<2C><>Ʊ<EFBFBD><C6B1><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(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;
4: // Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><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><><CBB0>,<2C><>ע,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<2C><>Ʊ<EFBFBD><C6B1><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(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;
6: //ҵ<><D2B5><EFBFBD>շ<EFBFBD><D5B7><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><>ע,<2C><><EFBFBD><EFBFBD><><CBB0>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<2C><>Ʊ<EFBFBD><C6B1><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(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: // Ӧ<>շ<EFBFBD><D5B7>ý<EFBFBD><C3BD><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><><CBB0>,<2C><>ע,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,<2C><>Ʊ<EFBFBD><C6B1><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 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;
// v_op_bscard.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;
old_sum_str:=sum_str;
t_ch_fee_sum.sql.clear;
t_ch_fee_sum.sql.add(sum_str);
t_ch_fee_sum.open;
// ShowMessage(sum_str);
// v_op_bscard.BeforeScroll:=v_op_bscardBeforeScroll;
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
if (strtobool(get_parameters_value(87,'false'))=true) then
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><><EFBFBD>뿪Ʊ+c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1'
+' 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>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+')';
end
else
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><><EFBFBD>뿪Ʊ+c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1'
+' 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>'+''''+')';
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
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 (c.<2E><><EFBFBD><EFBFBD>=0 or c.<2E><><EFBFBD><EFBFBD> is null)';
end;
end;
end;
7:
begin
if (strtobool(get_parameters_value(87,'false'))=true) then
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><><EFBFBD>뿪Ʊ+c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1'
+' 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>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+')';
end
else
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><><EFBFBD>뿪Ʊ+c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1'
+' 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>'+''''+')';
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
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 (c.<2E><><EFBFBD><EFBFBD>=0 or c.<2E><><EFBFBD><EFBFBD> is null)';
end;
end;
end;
2:
begin
if strtobool(get_parameters_value(323,'false')) then
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 (<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 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><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
end
else
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>'+''''+')';
end;
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then
begin
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<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 (c.<2E><><EFBFBD><EFBFBD>=0 or c.<2E><><EFBFBD><EFBFBD> is null)';
end;
end;
if strtobool(get_parameters_value(175,'false')) then
str_fee:=str_fee+ ' and '+ open_data('7000','c.¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no');
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><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><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<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 (c.<2E><><EFBFBD><EFBFBD>=0 or c.<2E><><EFBFBD><EFBFBD> is null)';
end;
end;
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><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>>0 and c.<2E><><EFBFBD><EFBFBD>>=c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (c.<2E><><EFBFBD><EFBFBD><0 and c.<2E><><EFBFBD><EFBFBD><=c.<2E><><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><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<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 (c.<2E><><EFBFBD><EFBFBD>=0 or c.<2E><><EFBFBD><EFBFBD> is null)';
end;
end;
end;
6:
begin
if strtobool(get_parameters_value(323,'false')) then
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><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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><EFBFBD><EFBFBD><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((c.<2E><><EFBFBD><EFBFBD>>0 and c.<2E><><EFBFBD><EFBFBD>>=c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (c.<2E><><EFBFBD><EFBFBD><0 and c.<2E><><EFBFBD><EFBFBD><=c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
end
else
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><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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><EFBFBD><EFBFBD><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) '
+'end)<>0 and ((c.<2E><><EFBFBD><EFBFBD>>0 and c.<2E><><EFBFBD><EFBFBD>>=c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (c.<2E><><EFBFBD><EFBFBD><0 and c.<2E><><EFBFBD><EFBFBD><=c.<2E><><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>'+''''+')';
end;
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<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 (c.<2E><><EFBFBD><EFBFBD>=0 or c.<2E><><EFBFBD><EFBFBD> is null)';
end;
end;
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+'%'+'''';
case bsSkinComboBox2.ItemIndex of
0:
begin
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+'''';
end;
1:begin
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+'''';
end;
end;
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 u.<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;
{ 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> and not u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> is null ');
SQL.Add(str_fee);
SQL.Add(' order by u.<2E><><EFBFBD><EFBFBD>');
}
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:='';
wwDBComboBox46.Text:='';
wwDBComboBox31.Text:='';
ComboBox1.Text:='';
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
if EmpProfit then
fee_view(v_op_bscard.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+'%'+'''';
case bsSkinComboBox2.ItemIndex of
0:
begin
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+'''';
end;
1:
begin
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+'''';
end;
end;
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.v_op_bscardBeforeScroll(DataSet: TDataSet);
var amtDr,usdamtDr,amtcr,usdamtcr:Double;
begin
{
if v_op_bscard.FieldByName('<27><><EFBFBD><EFBFBD>10').AsInteger=1 then
begin
amtDr:=amtDr+v_op_bscard.FieldByName('δ<><CEB4>RMB').AsFloat;
usdamtDr:=usdamtDr+v_op_bscard.FieldByName('δ<><CEB4>USD').AsFloat;
amtcr:=amtcr+v_op_bscard.FieldByName('δ<><CEB4>RMB').AsFloat;
usdamtcr:=usdamtcr+v_op_bscard.FieldByName('δ<><CEB4>USD').AsFloat;
end
else
begin
amtDr:=amtDr-v_op_bscard.FieldByName('δ<><CEB4>RMB').AsFloat;
usdamtDr:=usdamtDr-v_op_bscard.FieldByName('δ<><CEB4>USD').AsFloat;
amtcr:=amtcr-v_op_bscard.FieldByName('δ<><CEB4>RMB').AsFloat;
usdamtcr:=usdamtcr-v_op_bscard.FieldByName('δ<><CEB4>USD').AsFloat;
end;
Label81.Caption:='δ<><CEB4>RMB:'+FormatFloat('0.00;-0.00;0',amtDr)+'δ<><CEB4>USD:'+FormatFloat('0.00;-0.00;0',usdamtDr);
}
end;
procedure Tfra_ch_add_do.Edit34KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
v_op_bscard.Locate('<27><><EFBFBD><EFBFBD><E1B5A5>',Trim(Edit34.text),[]);
end;
end;
procedure Tfra_ch_add_do.bsSkinButton12Click(Sender: TObject);
begin
if v_op_bscard.RecordCount>0 then
v_op_bscard.Locate('<27><><EFBFBD><EFBFBD><E1B5A5>',Trim(Edit34.text),[]);
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.ComboBox1Enter(Sender: TObject);
var AdoQuery1:TAdoQuery;
begin
ComboBox1.items.clear;
AdoQuery1:=CreateAdoQuery;
with AdoQuery1 do
try
Close;sql.Clear;
SQL.Add('select * from t_sys_employee where ״̬=''<27><>ְ''');
SQL.Add('Order by <20><><EFBFBD><EFBFBD>');
Open;first;
while not Eof do
begin
ComboBox1.Items.Add(AdoQuery1.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
Next;
end;
finally
Free;
end;
end;
procedure Tfra_ch_add_do.dxDBGrid19SelectedCountChange(Sender: TObject);
var i:Integer;
str_fee,str_fee_I,fee_str:widestring;
aAdoQuery:TAdoQuery;
aAdoQuery1:TDataSource;
absnos:string;
begin
if v_op_bscard.IsEmpty then
exit;
// if not GetCustID(acust) then exit;
absnos:='';
if dxDBGrid19.SelectedCount>=1 then
begin
for i:=0 to dxDBGrid19.SelectedCount-1 do
begin
v_op_bscard.GotoBookmark(pointer(dxDBGrid19.selectedrows[i]));
if absnos='' then
absnos:=''''+v_op_bscard.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
else absnos:=absnos+','+''''+v_op_bscard.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'''';
end;
end
else
begin
absnos:=''''+v_op_bscard.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''''
end;
// dxDBGrid19.ClearSelection;
case strtoint(bs_text.text) of
1: //<2F><>Ʊ
begin
if (strtobool(get_parameters_value(87,'false'))=true) then
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>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+')';
if Trim(Edit36.Text)<>'' then
begin
// fee_str:=fee_str+' and CH_ID in (select CH_ID from t_ch_fee_do where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.Text)+''')';
fee_str:=fee_str+' and EXISTS (select 1 from t_ch_fee_do where t_ch_fee_do.CH_ID=t_ch_fee.CH_ID AND t_ch_fee_do.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.Text)+''')';
end;
str_fee_I:='where t_ch_fee.<2E><><EFBFBD><EFBFBD><>(t_ch_fee.<2E><><EFBFBD>뿪Ʊ+t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1'
+' 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>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+')';
end
else
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>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
if Trim(Edit36.Text)<>'' then begin
// fee_str:=fee_str+' and CH_ID in (select CH_ID from t_ch_fee_do where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.Text)+''')';
fee_str:=fee_str+' and EXISTS (select 1 from t_ch_fee_do where t_ch_fee_do.CH_ID=t_ch_fee.CH_ID AND t_ch_fee_do.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(Edit36.Text)+''')';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
str_fee_I:=str_fee_I+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
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 (<28><><EFBFBD><EFBFBD>=0 or <20><><EFBFBD><EFBFBD> is null)';
str_fee_I:=str_fee_I+' and (t_ch_fee.<2E><><EFBFBD><EFBFBD>=0 or t_ch_fee.<2E><><EFBFBD><EFBFBD> is null) ';
end;
end;
end;
7: //<2F><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>
begin
if (strtobool(get_parameters_value(87,'false'))=true) then
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>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+')';
end
else
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>'+''''
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+')';
end;
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 (<28><><EFBFBD><EFBFBD>=0 or <20><><EFBFBD><EFBFBD> is null)';
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 (<28><><EFBFBD><EFBFBD>=0 or <20><><EFBFBD><EFBFBD> is null)';
end;
end;
if strtobool(get_parameters_value(175,'false')) then
str_fee:=str_fee+ ' and '+ open_data('7000','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no');
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><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 (<28><><EFBFBD><EFBFBD>=0 or <20><><EFBFBD><EFBFBD> is null)';
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><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 (<28><><EFBFBD><EFBFBD>=0 or <20><><EFBFBD><EFBFBD> is null)';
end;
end;
end;
6: //ҵ<><D2B5><EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD> 2123
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>'+''''+')';
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 (<28><><EFBFBD><EFBFBD>=0 or <20><><EFBFBD><EFBFBD> is null)';
end;
end;
end;
end;
if acust_sum<>'' then
begin
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+acust_sum+'''';
str_fee_i:=str_fee_i+' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+acust_sum+'''';
end;
if RxDBLookupCombo15.DisplayValues[1]<>''then
begin
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
str_fee_i:=str_fee_i+' and t_ch_fee.<2E>ұ<EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
end;
if RxDBLookupCombo16.DisplayValues[1]<>''then
begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
str_fee_I:=str_fee_I+' and t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
end;
// showmessage(acust);
// showmessage(str_fee);
case strtoint(bs_text.text) of
1: //<2F><>Ʊ
begin
if Trim(Edit36.Text)<>'' then
begin
if 1=1 then
begin
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> in ('+absnos+') group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end
else
begin
sum_str:=old_sum_str;
end;
end
else
begin
if 1=1 then
begin
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> in ('+absnos+') group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end
else
begin
sum_str:=old_sum_str
end;
end;
end;
7: //<2F><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>
begin
if 1=1 then
begin
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> in ('+absnos+') group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>'
end
else
begin
sum_str:=old_sum_str;
end;
end;
2: //ҵ<><D2B5>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
if 1=1 then
begin
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> in ('+absnos+') group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end
else
begin
sum_str:=old_sum_str;
end;
end;
3: //3 Ӧ<>շ<EFBFBD><D5B7>ý<EFBFBD><C3BD><EFBFBD>
begin
if 1=1 then
begin
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> in ('+absnos+') group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end
else
begin
sum_str:=old_sum_str;
end;
end;
4: // Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
begin
if 1=1 then
begin
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> in ('+absnos+') group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end
else
begin
sum_str:=old_sum_str;
end;
end;
6: //ҵ<><D2B5><EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD>
begin
if 1=1 then
begin
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> in ('+absnos+') group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end
else
begin
sum_str:=old_sum_str;
end;
end;
8: // Ӧ<>շ<EFBFBD><D5B7>ý<EFBFBD><C3BD><EFBFBD>
begin
if 1=1 then
begin
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> in ('+absnos+')) group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end
else
begin
sum_str:=old_sum_str;
end;
end;
end;
if dxDBGrid19.SelectedCount>1 then
begin
t_ch_fee_sum_ttl.close;
t_ch_fee_sum_ttl.sql.clear;
t_ch_fee_sum_ttl.sql.add(sum_str);
t_ch_fee_sum_ttl.open;t_ch_fee_sum_ttl.First;
dxDBGrid20.DataSource:=t_ch_fee_sum_ttl1;
end
else
begin
dxDBGrid20.DataSource:=t_ch_fee_sum1;
end;
end;
end.