|
|
unit u_rp_dui_accepttotal;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, ExtCtrls, bsSkinCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl,
|
|
|
dxDBGrid, DB, ADODB, StdCtrls, Mask, DBCtrls, dxDBTLCl, dxGrClms,
|
|
|
RxLookup, wwdbdatetimepicker, Menus, XPMenu, ComCtrls, bsSkinTabs,
|
|
|
RxMemDS, wwdbedit, Wwdotdot, Wwdbcomb, Grids, DBGrids, wwdblook,
|
|
|
kbmMemTable, bsdbctrls, DBCtrlsEh, cxFontNameComboBox, cxControls,
|
|
|
cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, dximctrl,
|
|
|
bsSkinBoxCtrls;
|
|
|
|
|
|
type
|
|
|
Tfrm_rp_dui_accepttotal = class(TForm)
|
|
|
Panel1: TPanel;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
bsSkinButton11: TbsSkinButton;
|
|
|
Notebook1: TNotebook;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
t_ch_dui: TADOQuery;
|
|
|
t_ch_dui1: TDataSource;
|
|
|
bsSkinPanel4: TbsSkinPanel;
|
|
|
Label1: TLabel;
|
|
|
Label8: TLabel;
|
|
|
Label9: TLabel;
|
|
|
Label10: TLabel;
|
|
|
Label11: TLabel;
|
|
|
Label12: TLabel;
|
|
|
Label13: TLabel;
|
|
|
Label14: TLabel;
|
|
|
Edit4: TEdit;
|
|
|
Edit2: TEdit;
|
|
|
Edit3: TEdit;
|
|
|
wwDBDateTimePicker1: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker3: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker2: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker4: TwwDBDateTimePicker;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
t_op_seae: TADOQuery;
|
|
|
t_op_seae1: TDataSource;
|
|
|
t_ch_fee: TADOQuery;
|
|
|
t_ch_fee1: TDataSource;
|
|
|
PopupMenu1: TPopupMenu;
|
|
|
N1: TMenuItem;
|
|
|
dxDBGrid1Column4: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column6: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column7: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column8: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column9: TdxDBGridDateColumn;
|
|
|
bsSkinButton12: TbsSkinButton;
|
|
|
t_ch_dui_format1: TDataSource;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
bsSkinPanel6: TbsSkinPanel;
|
|
|
Label2: TLabel;
|
|
|
DBEdit2: TDBEdit;
|
|
|
DBEdit5: TDBEdit;
|
|
|
Label5: TLabel;
|
|
|
Label6: TLabel;
|
|
|
Label15: TLabel;
|
|
|
RxDBLookupCombo3: TRxDBLookupCombo;
|
|
|
DBEdit6: TDBEdit;
|
|
|
Label3: TLabel;
|
|
|
RxDBLookupCombo1: TRxDBLookupCombo;
|
|
|
DBEdit7: TDBEdit;
|
|
|
Label7: TLabel;
|
|
|
Label4: TLabel;
|
|
|
DBEdit4: TDBEdit;
|
|
|
t_ch_dui_format: TADOQuery;
|
|
|
t_ch_dui_bill: TADOQuery;
|
|
|
p_update: TADOStoredProc;
|
|
|
v_dui_bill: TADOQuery;
|
|
|
v_dui_bill1: TDataSource;
|
|
|
v_dui_fee: TADOQuery;
|
|
|
v_dui_fee1: TDataSource;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
PopupMenu2: TPopupMenu;
|
|
|
N5: TMenuItem;
|
|
|
XPMenu1: TXPMenu;
|
|
|
wwDBDateTimePicker5: TwwDBDateTimePicker;
|
|
|
Label16: TLabel;
|
|
|
wwDBDateTimePicker6: TwwDBDateTimePicker;
|
|
|
Label17: TLabel;
|
|
|
Label18: TLabel;
|
|
|
DBEdit1: TDBEdit;
|
|
|
t_bill_fee_dong: TRxMemoryData;
|
|
|
t_bill_fee_dong1: TDataSource;
|
|
|
Panel3: TPanel;
|
|
|
dxDBGrid5: TdxDBGrid;
|
|
|
dxDBGrid5Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid5Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid5Column6: TdxDBGridMaskColumn;
|
|
|
dxDBGrid5Column7: TdxDBGridColumn;
|
|
|
dxDBGrid5Column8: TdxDBGridColumn;
|
|
|
dxDBGrid5Column9: TdxDBGridColumn;
|
|
|
bsSkinPageControl1: TbsSkinPageControl;
|
|
|
bsSkinTabSheet1: TbsSkinTabSheet;
|
|
|
bsSkinTabSheet2: TbsSkinTabSheet;
|
|
|
dxDBGrid6: TdxDBGrid;
|
|
|
dxDBGrid6Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column3: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6RMB: TdxDBGridColumn;
|
|
|
dxDBGrid6Column20: TdxDBGridColumn;
|
|
|
dxDBGrid6Column21: TdxDBGridColumn;
|
|
|
dxDBGrid6USD: TdxDBGridColumn;
|
|
|
dxDBGrid6Column23: TdxDBGridColumn;
|
|
|
dxDBGrid6Column24: TdxDBGridColumn;
|
|
|
dxDBGrid6Column4: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column5: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column6: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column7: TdxDBGridDateColumn;
|
|
|
dxDBGrid6Column8: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column9: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column10: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column11: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column12: TdxDBGridColumn;
|
|
|
dxDBGrid6Column13: TdxDBGridColumn;
|
|
|
dxDBGrid6Column14: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column15: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column16: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column17: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column18: TdxDBGridMaskColumn;
|
|
|
dxDBGrid6Column25: TdxDBGridColumn;
|
|
|
dxDBGrid6Column26: TdxDBGridColumn;
|
|
|
dxDBGrid2: TdxDBGrid;
|
|
|
dxDBGridColumn4: TdxDBGridColumn;
|
|
|
dxDBGridMaskColumn95: TdxDBGridMaskColumn;
|
|
|
PopupMenu3: TPopupMenu;
|
|
|
N2: TMenuItem;
|
|
|
dxDBGrid5Column10: TdxDBGridColumn;
|
|
|
dxDBGrid6Column27: TdxDBGridColumn;
|
|
|
dxDBGrid6Column28: TdxDBGridColumn;
|
|
|
dxDBGrid6Column29: TdxDBGridColumn;
|
|
|
dxDBGrid6Column30: TdxDBGridColumn;
|
|
|
dxDBGrid6Column31: TdxDBGridColumn;
|
|
|
dxDBGrid6Column32: TdxDBGridColumn;
|
|
|
Label25: TLabel;
|
|
|
wwDBComboBox31: TwwDBComboBox;
|
|
|
Label20: TLabel;
|
|
|
RxDBLookupCombo16: TRxDBLookupCombo;
|
|
|
Label41: TLabel;
|
|
|
wwDBComboBox46: TwwDBComboBox;
|
|
|
PopupMenu4: TPopupMenu;
|
|
|
MenuItem1: TMenuItem;
|
|
|
PopupMenu5: TPopupMenu;
|
|
|
MenuItem2: TMenuItem;
|
|
|
Label22: TLabel;
|
|
|
RxDBLookupCombo10: TRxDBLookupCombo;
|
|
|
wwDBComboBox1: TwwDBComboBox;
|
|
|
Label21: TLabel;
|
|
|
wwDBComboBox2: TwwDBComboBox;
|
|
|
Label23: TLabel;
|
|
|
bsSkinPageControl2: TbsSkinPageControl;
|
|
|
bsSkinPanel5: TbsSkinPanel;
|
|
|
dxDBGrid3: 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;
|
|
|
dxDBGrid3Column19: TdxDBGridColumn;
|
|
|
dxDBGrid3Column20: TdxDBGridColumn;
|
|
|
Panel2: TPanel;
|
|
|
dxDBGrid4: TdxDBGrid;
|
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid4Column5: TdxDBGridColumn;
|
|
|
dxDBGrid1Column5: TdxDBGridColumn;
|
|
|
dxDBGrid1Column3: TdxDBGridColumn;
|
|
|
dxDBGrid4Column6: TdxDBGridColumn;
|
|
|
bsSkinPanel7: TbsSkinPanel;
|
|
|
lblSum: TLabel;
|
|
|
bstab1: TbsSkinTabSheet;
|
|
|
bstab2: TbsSkinTabSheet;
|
|
|
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
|
|
|
dxDBGrid7: TdxDBGrid;
|
|
|
dxDBGridMaskColumn14: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn15: TdxDBGridMaskColumn;
|
|
|
dxDBGridColumn5: TdxDBGridColumn;
|
|
|
dxDBGridMaskColumn16: TdxDBGridMaskColumn;
|
|
|
dxDBGridColumn6: TdxDBGridColumn;
|
|
|
dxDBGridColumn7: TdxDBGridColumn;
|
|
|
dxDBGridColumn8: TdxDBGridColumn;
|
|
|
bsSkinPanel8: TbsSkinPanel;
|
|
|
dxDBGrid8: TdxDBGrid;
|
|
|
dxDBGridMaskColumn17: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn18: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn19: TdxDBGridMaskColumn;
|
|
|
dxDBGridColumn9: TdxDBGridColumn;
|
|
|
dxDBGridColumn10: TdxDBGridColumn;
|
|
|
dxDBGridColumn11: TdxDBGridColumn;
|
|
|
dxDBGridColumn12: TdxDBGridColumn;
|
|
|
dxDBGridColumn13: TdxDBGridColumn;
|
|
|
dxDBGridColumn14: TdxDBGridColumn;
|
|
|
dxDBGridColumn15: TdxDBGridColumn;
|
|
|
dxDBGridColumn16: TdxDBGridColumn;
|
|
|
dxDBGridColumn17: TdxDBGridColumn;
|
|
|
dxDBGridColumn18: TdxDBGridColumn;
|
|
|
dxDBGridColumn19: TdxDBGridColumn;
|
|
|
dxDBGridColumn20: TdxDBGridColumn;
|
|
|
dxDBGridMaskColumn20: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn21: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn22: TdxDBGridMaskColumn;
|
|
|
dxDBGridDateColumn3: TdxDBGridDateColumn;
|
|
|
dxDBGridMaskColumn23: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn24: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn25: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn26: TdxDBGridMaskColumn;
|
|
|
dxDBGridColumn21: TdxDBGridColumn;
|
|
|
dxDBGridColumn22: TdxDBGridColumn;
|
|
|
dxDBGridMaskColumn27: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn28: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn29: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn30: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn31: TdxDBGridMaskColumn;
|
|
|
dxDBGridColumn23: TdxDBGridColumn;
|
|
|
dxDBGridColumn24: TdxDBGridColumn;
|
|
|
t_dui_b: TADOQuery;
|
|
|
t_dui_b_fee: TADOQuery;
|
|
|
t_dui_b1: TDataSource;
|
|
|
t_dui_b_fee1: TDataSource;
|
|
|
dxDBGrid8Column33: TdxDBGridColumn;
|
|
|
PopupMenu6: TPopupMenu;
|
|
|
N3: TMenuItem;
|
|
|
PopupMenu7: TPopupMenu;
|
|
|
MenuItem3: TMenuItem;
|
|
|
t_ch_dui_detail: TADOQuery;
|
|
|
dxDBGrid4Column7: TdxDBGridColumn;
|
|
|
dxDBGrid7Column8: TdxDBGridColumn;
|
|
|
dxDBGrid5Column11: TdxDBGridColumn;
|
|
|
Label125: TLabel;
|
|
|
wwDBLookupCombo49: TwwDBLookupCombo;
|
|
|
Label30: TLabel;
|
|
|
Edit7: TEdit;
|
|
|
Label45: TLabel;
|
|
|
RxDBLookupCombo15: TRxDBLookupCombo;
|
|
|
Label24: TLabel;
|
|
|
Edit1: TEdit;
|
|
|
Edit5: TEdit;
|
|
|
Label26: TLabel;
|
|
|
Edit6: TEdit;
|
|
|
Label27: TLabel;
|
|
|
Label28: TLabel;
|
|
|
RxDBLookupCombo2: TRxDBLookupCombo;
|
|
|
mem_v_dui_fee1: TDataSource;
|
|
|
mem_v_dui_fee: TADOQuery;
|
|
|
mem_v_dui_feeCr: TADOQuery;
|
|
|
mem_v_dui_feeCr1: TDataSource;
|
|
|
lblsum1: TLabel;
|
|
|
lblsum2: TLabel;
|
|
|
dxDBGrid6Column33: TdxDBGridColumn;
|
|
|
dxDBGrid3Column21: TdxDBGridColumn;
|
|
|
RxDBLookupCombo4: TRxDBLookupCombo;
|
|
|
t_dui_cust: TADOQuery;
|
|
|
t_dui_cust1: TDataSource;
|
|
|
bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinButton38: TbsSkinButton;
|
|
|
PopupMenu8: TPopupMenu;
|
|
|
MenuItem4: TMenuItem;
|
|
|
MenuItem5: TMenuItem;
|
|
|
N21: TMenuItem;
|
|
|
N22: TMenuItem;
|
|
|
N20: TMenuItem;
|
|
|
PopupMenu9: TPopupMenu;
|
|
|
MenuItem6: TMenuItem;
|
|
|
MenuItem7: TMenuItem;
|
|
|
MenuItem8: TMenuItem;
|
|
|
MenuItem9: TMenuItem;
|
|
|
MenuItem10: TMenuItem;
|
|
|
dxDBGrid3Column22: TdxDBGridColumn;
|
|
|
dxDBGrid3Column23: TdxDBGridColumn;
|
|
|
Label29: TLabel;
|
|
|
wwDBComboBox3: TwwDBComboBox;
|
|
|
Label35: TLabel;
|
|
|
Edit16: TEdit;
|
|
|
dxDBGrid1Column10: TdxDBGridColumn;
|
|
|
dxDBGrid1Column11: TdxDBGridColumn;
|
|
|
bsSkinButton13: TbsSkinButton;
|
|
|
dxDBGrid3Column24: TdxDBGridColumn;
|
|
|
RxDBLookupCombo20: TRxDBLookupCombo;
|
|
|
Label31: TLabel;
|
|
|
Splitter1: TSplitter;
|
|
|
DBComboBoxEh1: TDBComboBoxEh;
|
|
|
Label19: TLabel;
|
|
|
Label32: TLabel;
|
|
|
dxDBGrid1Column12: TdxDBGridColumn;
|
|
|
dxDBGrid1Column13: TdxDBGridColumn;
|
|
|
dxImageComboBox1: TdxImageComboBox;
|
|
|
Label33: TLabel;
|
|
|
dxDBGrid4Column8: TdxDBGridColumn;
|
|
|
dxDBGrid5Column12: TdxDBGridColumn;
|
|
|
dxDBGrid6Column34: TdxDBGridColumn;
|
|
|
dxDBGrid6Column35: TdxDBGridColumn;
|
|
|
dxDBGrid6Column36: TdxDBGridColumn;
|
|
|
dxDBGrid6Column37: TdxDBGridColumn;
|
|
|
bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox;
|
|
|
dxDBGrid4Column9: TdxDBGridColumn;
|
|
|
dxDBGrid4Column10: TdxDBGridColumn;
|
|
|
dxDBGrid5Column13: TdxDBGridColumn;
|
|
|
dxDBGrid5Column14: TdxDBGridColumn;
|
|
|
dxDBGrid1Column14: TdxDBGridColumn;
|
|
|
dxDBGrid1Column15: TdxDBGridColumn;
|
|
|
dxDBGrid1Column16: TdxDBGridColumn;
|
|
|
dxDBGrid1Column17: TdxDBGridColumn;
|
|
|
dxDBGrid1Column18: TdxDBGridColumn;
|
|
|
wwDBLookupCombo52: TwwDBLookupCombo;
|
|
|
Label34: TLabel;
|
|
|
bsSkinButton14: TbsSkinButton;
|
|
|
Label36: TLabel;
|
|
|
wwDBComboBox4: TwwDBComboBox;
|
|
|
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
|
|
|
bsSkinComboBox2: TbsSkinComboBox;
|
|
|
PopupMenu10: TPopupMenu;
|
|
|
N10: TMenuItem;
|
|
|
N11: TMenuItem;
|
|
|
N14: TMenuItem;
|
|
|
N15: TMenuItem;
|
|
|
N16: TMenuItem;
|
|
|
dxDBGrid4Column11: TdxDBGridColumn;
|
|
|
bsSkinComboBox1: TbsSkinComboBox;
|
|
|
bsSkinComboBox3: TbsSkinComboBox;
|
|
|
bsSkinComboBox4: TbsSkinComboBox;
|
|
|
procedure bsSkinButton8Click(Sender: TObject);
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure bsSkinPanel2Resize(Sender: TObject);
|
|
|
procedure t_ch_duiAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_ch_duiBeforePost(DataSet: TDataSet);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
procedure bsSkinButton11Click(Sender: TObject);
|
|
|
procedure bsSkinButton12Click(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure t_ch_duiAfterScroll(DataSet: TDataSet);
|
|
|
procedure N1Click(Sender: TObject);
|
|
|
procedure RxDBLookupCombo1Enter(Sender: TObject);
|
|
|
procedure dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure N5Click(Sender: TObject);
|
|
|
procedure N2Click(Sender: TObject);
|
|
|
procedure bsSkinPageControl1Change(Sender: TObject);
|
|
|
procedure MenuItem1Click(Sender: TObject);
|
|
|
procedure MenuItem2Click(Sender: TObject);
|
|
|
procedure dxDBGrid3SelectedCountChange(Sender: TObject);
|
|
|
procedure dxDBGrid3Click(Sender: TObject);
|
|
|
procedure N3Click(Sender: TObject);
|
|
|
procedure MenuItem3Click(Sender: TObject);
|
|
|
procedure dxDBGrid3Column21CustomDraw(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 ComboBoxObj1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure dxDBGrid6ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
procedure dxDBGrid2ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
procedure RxDBLookupCombo4Enter(Sender: TObject);
|
|
|
procedure bsSkinButton38Click(Sender: TObject);
|
|
|
procedure MenuItem4Click(Sender: TObject);
|
|
|
procedure MenuItem10Click(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure dxDBGrid3Column22CustomDraw(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 dxDBGrid3Column23CustomDraw(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 bsSkinButton13Click(Sender: TObject);
|
|
|
procedure DBComboBoxEh1DropDown(Sender: TObject);
|
|
|
procedure dxDBGrid1CustomDraw(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 dxDBGrid6DblClick(Sender: TObject);
|
|
|
procedure dxDBGrid3DblClick(Sender: TObject);
|
|
|
procedure dxDBGrid1Column18CustomDraw(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 bsSkinButton14Click(Sender: TObject);
|
|
|
procedure N10Click(Sender: TObject);
|
|
|
procedure N14Click(Sender: TObject);
|
|
|
procedure N16Click(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_rp_dui_accepttotal: Tfrm_rp_dui_accepttotal;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, my_sys_function, u_data_share, u_rp_dui_format, u_rp_dui_query,
|
|
|
u_rp_dui_formatrpt, u_rp_op_ttl;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton8Click(Sender: TObject);
|
|
|
begin
|
|
|
dxImageComboBox1.ItemIndex:=0;
|
|
|
RxDBLookupCombo4.ClearValue;
|
|
|
Edit4.text:='';
|
|
|
Edit3.Text:='';
|
|
|
Edit2.text:='';
|
|
|
wwDBDateTimePicker1.Clear;
|
|
|
wwDBDateTimePicker2.clear;
|
|
|
wwDBDateTimePicker3.clear;
|
|
|
wwDBDateTimePicker4.clear;
|
|
|
wwDBComboBox31.Text:='';
|
|
|
wwDBComboBox46.Text:='';
|
|
|
RxDBLookupCombo10.ClearValue;
|
|
|
RxDBLookupCombo16.ClearValue;
|
|
|
RxDBLookupCombo15.ClearValue;
|
|
|
RxDBLookupCombo2.ClearValue;
|
|
|
wwDBLookupCombo49.Text:='';
|
|
|
|
|
|
DBComboBoxEh1.Text:='';
|
|
|
edit7.Text:='';
|
|
|
edit1.Text:='';
|
|
|
edit5.Text:='';
|
|
|
edit6.Text:='';
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton7Click(Sender: TObject);
|
|
|
var
|
|
|
str_fee,str_op,str_zhfee,str_zhop:widestring;
|
|
|
Str:String;
|
|
|
begin
|
|
|
|
|
|
str_fee:='';
|
|
|
if RxDBLookupCombo4.DisplayValues[1]<>'' then begin
|
|
|
if strtobool(get_parameters_value(115,'false')) then
|
|
|
str_fee:=str_fee+' and (<28>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo4.DisplayValues[1]+''''+' or <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo4.DisplayValues[1]+''')'
|
|
|
else
|
|
|
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo4.DisplayValues[1]+'''';
|
|
|
|
|
|
end;
|
|
|
|
|
|
if wwDBComboBox31.Text<>''then
|
|
|
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
|
|
|
|
|
|
if RxDBLookupCombo15.DisplayValues[1]<>''then
|
|
|
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
|
|
|
|
|
|
|
|
|
if RxDBLookupCombo16.DisplayValues[1]<>''then
|
|
|
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
|
|
|
|
|
|
case dxImageComboBox1.ItemIndex of
|
|
|
0:;
|
|
|
1:str_fee:=str_fee+' and (<28>Ƿ<EFBFBD><C7B7>渶=0 OR <20>Ƿ<EFBFBD><C7B7>渶 IS NULL)';
|
|
|
2:str_fee:=str_fee+' and (<28>Ƿ<EFBFBD><C7B7>渶=1)';
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
str_zhfee:='where t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_dui_bscard.<2E><><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=v_dui_bscard.<2E><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD> '+str_fee;
|
|
|
str_fee:='where 1=1'+str_fee;
|
|
|
|
|
|
if NOT strtobool(get_parameters_value(84,'false')) then begin //<2F><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>״̬
|
|
|
// if NOT strtobool(get_parameters_value(47,'false')) then
|
|
|
if bsSkinCheckRadioBox2.Checked then
|
|
|
begin
|
|
|
str_fee:=str_fee+' and (<28>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0 OR <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> IS NULL) '
|
|
|
+' 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>'+''''+')';
|
|
|
|
|
|
str_zhfee:=str_zhfee+' and <20>Ƿ<EFBFBD><C7B7><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
|
|
|
else
|
|
|
begin
|
|
|
str_fee:=str_fee+' and (<28>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0 OR <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> IS NULL) '
|
|
|
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
|
|
|
str_zhfee:=str_zhfee+' and <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=1 '
|
|
|
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
|
|
|
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if bsSkinCheckRadioBox2.Checked then
|
|
|
begin
|
|
|
str_fee:=str_fee+' and (<28>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0 OR <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> IS NULL) '
|
|
|
+' 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>'+''''+','+''''+'¼<><C2BC>״̬'+''''+','+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
|
|
|
|
|
|
str_zhfee:=str_zhfee+' and <20>Ƿ<EFBFBD><C7B7><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>'+''''+','+''''+'¼<><C2BC>״̬'+''''+','+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
|
|
|
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str_fee:=str_fee+' and (<28>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0 OR <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> IS NULL) '
|
|
|
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''+','+''''+'¼<><C2BC>״̬'+''''+','+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
|
|
|
|
|
|
str_zhfee:=str_zhfee+' and <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=1 '
|
|
|
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''+','+''''+'¼<><C2BC>״̬'+''''+','+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if (strtobool(get_parameters_value(64,'false'))=true) then begin
|
|
|
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
|
|
|
|
|
|
end else begin
|
|
|
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
|
|
|
str_zhfee:=str_zhfee+' and <20><><EFBFBD><EFBFBD><>1 ';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if (not t_ch_dui.IsEmpty) and (t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').AsString<>'') then begin
|
|
|
str_zhfee:=str_zhfee+'and CH_ID not in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+t_ch_dui.fieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').AsString+''')'
|
|
|
end;
|
|
|
|
|
|
str_op:='';
|
|
|
if Edit4.text<>''then
|
|
|
str_op:=str_op+' and ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''';
|
|
|
|
|
|
if wwDBComboBox46.text<>''then
|
|
|
str_op:=str_op+' and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox46.text+'''';
|
|
|
|
|
|
if Edit2.text<>''then
|
|
|
// str_op:=str_op+' and (<28><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+''' or <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+''')';
|
|
|
str_op:=str_op+' and <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
|
|
|
|
|
|
if Edit3.text<>''then
|
|
|
str_op:=str_op+' and (<28><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit3.text+'%'+''' or <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_seae_assistant where <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Trim(Edit3.text)+'%'+'''))';
|
|
|
|
|
|
|
|
|
if Edit16.text<>''then
|
|
|
str_op:=str_op+' and (<28><><EFBFBD>յ<EFBFBD><D5B5><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''' or <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit16.text+'%'+''' or <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit16.text+'%'+''' or ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''' or ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''')';
|
|
|
|
|
|
if wwDBLookupCombo52.text<>''then
|
|
|
str_op:=str_op+' and (ж<><D0B6><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo52.text+'%'+''' or Ŀ<>ĵ<EFBFBD> like '+''''+'%'+wwDBLookupCombo52.text+'%'+''')';
|
|
|
|
|
|
|
|
|
if DBComboBoxEh1.Text<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD><EFBFBD>Ա='+''''+DBComboBoxEh1.Text+'''';
|
|
|
|
|
|
|
|
|
if wwDBComboBox4.Text<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD><EFBFBD>״̬='+''''+wwDBComboBox4.Text+'''';
|
|
|
|
|
|
|
|
|
|
|
|
if Edit1.text<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
|
|
|
|
|
|
if RxDBLookupCombo10.DisplayValues[0]<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='+''''+RxDBLookupCombo10.DisplayValues[0]+'''';
|
|
|
|
|
|
|
|
|
if wwDBComboBox3.text='<27><>' then
|
|
|
str_op:=str_op+' and <20>Ƿ<EFBFBD><C7B7>˲<EFBFBD>=1 ';
|
|
|
|
|
|
if wwDBComboBox3.text='<27><>' then
|
|
|
str_op:=str_op+' and (<28>Ƿ<EFBFBD><C7B7>˲<EFBFBD>=0 OR <20>Ƿ<EFBFBD><C7B7>˲<EFBFBD> IS NULL) ';
|
|
|
|
|
|
|
|
|
if RxDBLookupCombo20.DisplayValues[1]<>'' then
|
|
|
str_op:=str_op+' and <20><><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo20.DisplayValues[1]+'''';
|
|
|
|
|
|
|
|
|
|
|
|
if RxDBLookupCombo2.DisplayValues[0]<>''then
|
|
|
str_op:=str_op+' and <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo2.DisplayValues[0]+'''';
|
|
|
|
|
|
|
|
|
if (Edit5.text<>'') and (Edit6.text<>'') then begin
|
|
|
str_op:=str_op+' and (<28><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>>='+''''+Edit5.text+''''+' and <20><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><='+''''+Edit6.Text+''''+')';
|
|
|
end else begin
|
|
|
if Edit5.text<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit5.text+'%'+'''';
|
|
|
end;
|
|
|
|
|
|
|
|
|
if wwDBDateTimePicker1.text<>''then
|
|
|
str_op:=str_op+' and '+bsSkinComboBox2.Text+'>='+''''+wwDBDateTimePicker1.text+'''';
|
|
|
|
|
|
if wwDBDateTimePicker2.text<>''then
|
|
|
str_op:=str_op+' and '+bsSkinComboBox2.Text+'<='+''''+wwDBDateTimePicker2.text+'''';
|
|
|
|
|
|
if wwDBLookupCombo49.text<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo49.text+'%'+'''';
|
|
|
if Edit7.text<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD><EFBFBD> like '+''''+'%'+Edit7.text+'%'+'''';
|
|
|
|
|
|
if (((bsSkinComboBox1.ItemIndex=1) and (Edit2.Text<>'')) or ((bsSkinComboBox3.ItemIndex=1) and (wwDBLookupCombo49.Text<>''))
|
|
|
or ((bsSkinComboBox4.ItemIndex=1) and (Edit7.Text<>''))) then begin
|
|
|
str_op:=str_op+' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_sealocal where 1=1 ';
|
|
|
if ((bsSkinComboBox1.ItemIndex=1) and (Edit2.Text<>'')) then
|
|
|
str_op:=str_op+' and <20><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
|
|
|
if ((bsSkinComboBox3.ItemIndex=1) and (wwDBLookupCombo49.Text<>'')) then
|
|
|
str_op:=str_op+' and <20><><EFBFBD>մ<EFBFBD><D5B4><EFBFBD> like '+''''+'%'+wwDBLookupCombo49.text+'%'+'''';
|
|
|
if ((bsSkinComboBox4.ItemIndex=1) and (Edit7.Text<>'')) then
|
|
|
str_op:=str_op+' and <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD> like '+''''+'%'+Edit7.text+'%'+'''';
|
|
|
str_op:=str_op+')';
|
|
|
end;
|
|
|
|
|
|
if wwDBDateTimePicker3.text<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker3.text+'''';
|
|
|
|
|
|
if wwDBDateTimePicker4.text<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker4.text+'''';
|
|
|
|
|
|
|
|
|
str_zhop:='where exists (select 1 from t_ch_fee '+str_zhfee+') '+str_op;
|
|
|
|
|
|
|
|
|
|
|
|
str_op:='where <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from t_ch_fee '+str_fee+')'+str_op;
|
|
|
|
|
|
str_op:=str_op+' and '+open_data('0032','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
str_zhop:='select * from v_dui_bscard '+str_zhop+' and '+open_data('0032','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
|
|
|
|
|
|
str_op:='select * from v_op_bscard_ALL '+str_op+default_sort(53,'v_op_bscard_ALL','','desc');
|
|
|
|
|
|
str_fee:='select *,<2C><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee '
|
|
|
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> order by CH_ID';
|
|
|
|
|
|
|
|
|
|
|
|
t_ch_fee.Close;
|
|
|
t_op_seae.close;
|
|
|
t_op_seae.sql.clear;
|
|
|
t_op_seae.sql.add(str_op);
|
|
|
t_op_seae.open;
|
|
|
|
|
|
//ShowMessage(t_op_seae.sql.Text);
|
|
|
|
|
|
t_ch_fee.sql.clear;
|
|
|
t_ch_fee.sql.add(str_fee);
|
|
|
t_ch_fee.open;
|
|
|
// ShowMessage(t_ch_fee.sql.Text);
|
|
|
|
|
|
if bsSkinCheckRadioBox1.checked then
|
|
|
begin
|
|
|
t_dui_b_fee.Close;
|
|
|
t_dui_b.Close;
|
|
|
t_dui_b.SQL.Clear;
|
|
|
t_dui_b.SQL.Add(str_zhop);
|
|
|
t_dui_b.Open;
|
|
|
t_dui_b_fee.Open;
|
|
|
end;
|
|
|
|
|
|
//ShowMessage(t_dui_b.sql.Text);
|
|
|
|
|
|
|
|
|
// ShowMessage(t_dui_b_fee.sql.Text);
|
|
|
if not t_dui_b.IsEmpty then begin
|
|
|
|
|
|
bstab2.Caption:='<27>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD>ϸ'+'ע<><D7A2>:<3A>˷<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD>Ѷ<EFBFBD><D1B6><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>';
|
|
|
bstab2.Font.Color:=clRed;
|
|
|
// lblzh.Caption:='ע<><D7A2>:<3A>˷<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD>Ѷ<EFBFBD><D1B6><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>';
|
|
|
end else begin
|
|
|
bstab2.Caption:='<27>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD>ϸ';
|
|
|
// lblzh.Caption:='';
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
savereggrid(dxdbgrid1,caption+'1');
|
|
|
savereggrid(dxdbgrid3,caption+'3');
|
|
|
savereggrid(dxdbgrid4,caption+'4');
|
|
|
savereggrid(dxdbgrid6,caption+'6');
|
|
|
savereggrid(dxdbgrid7,caption+'7');
|
|
|
savereggrid(dxdbgrid8,caption+'8');
|
|
|
|
|
|
frm_rp_dui_accepttotal.Hide;
|
|
|
frm_rp_dui_accepttotal.ManualFloat(frm_rp_dui_accepttotal.BoundsRect );
|
|
|
frm_main.freeTabs('frm_rp_dui_accepttotal');
|
|
|
action:=cafree;
|
|
|
frm_rp_dui_accepttotal:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinPanel2Resize(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
if strtobool(get_parameters_value(187,'false')) then
|
|
|
begin
|
|
|
i:=round(bsSkinPanel2.width/13);
|
|
|
bsSkinButton9.width:=i;
|
|
|
bsSkinButton12.width:=i;
|
|
|
bsSkinButton10.width:=i;
|
|
|
bsSkinButton1.width:=i;
|
|
|
bsSkinButton2.width:=i;
|
|
|
bsSkinButton4.width:=i;
|
|
|
bsSkinButton3.width:=i;
|
|
|
bsSkinButton11.width:=i;
|
|
|
bsSkinButton6.width:=i;
|
|
|
bsSkinButton38.width:=i;
|
|
|
bsSkinButton13.width:=i;
|
|
|
bsSkinButton14.width:=i;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
i:=round(bsSkinPanel2.width/12);
|
|
|
bsSkinButton9.width:=i;
|
|
|
bsSkinButton12.width:=i;
|
|
|
bsSkinButton10.width:=i;
|
|
|
bsSkinButton1.width:=i;
|
|
|
bsSkinButton2.width:=i;
|
|
|
bsSkinButton4.width:=i;
|
|
|
bsSkinButton3.width:=i;
|
|
|
bsSkinButton11.width:=i;
|
|
|
bsSkinButton6.width:=i;
|
|
|
bsSkinButton38.width:=i;
|
|
|
bsSkinButton13.width:=i;
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.t_ch_duiAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_ch_dui['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
|
|
|
t_ch_dui['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=employee;
|
|
|
t_ch_dui['<27><><EFBFBD><EFBFBD>']:=9;
|
|
|
t_ch_dui['<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>']:='ȫ<><C8AB>';
|
|
|
t_ch_dui['<27><><EFBFBD>÷<EFBFBD>Χ']:='<27><>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
{
|
|
|
if not t_ch_fee.IsEmpty then
|
|
|
t_ch_dui['<27><><EFBFBD>ʿͻ<CABF>']:=t_ch_fee.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.t_ch_duiBeforePost(DataSet: TDataSet);
|
|
|
var aAdoQuery:TAdoQuery;
|
|
|
begin
|
|
|
table_before_post(t_ch_dui,'<27><><EFBFBD>ʿͻ<CABF>');
|
|
|
|
|
|
if t_ch_dui.State=dsinsert then
|
|
|
begin
|
|
|
if bsSkinDBCheckRadioBox1.Checked then
|
|
|
t_ch_dui['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=getDCno(1,subComp,department,employee,date)
|
|
|
else
|
|
|
t_ch_dui['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=get_no(date,'D1');
|
|
|
end;
|
|
|
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select sum(Ӧ<><D3A6>RMB<4D><42><EFBFBD><EFBFBD>) Ӧ<><D3A6>RMB,sum(Ӧ<><D3A6>USD<53><44><EFBFBD><EFBFBD>) Ӧ<><D3A6>USD,sum(Ӧ<><D3A6>RMB<4D><42><EFBFBD><EFBFBD>) Ӧ<><D3A6>RMB,sum(Ӧ<><D3A6>USD<53><44><EFBFBD><EFBFBD>) Ӧ<><D3A6>USD');
|
|
|
SQL.Add('from v_dui_bscard');
|
|
|
SQL.Add('where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=:<3A><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>');
|
|
|
Parameters.ParamByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').Value:=t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
open;
|
|
|
t_ch_dui.FieldByName('Ӧ<><D3A6>RMB').AsFloat:=FieldByName('Ӧ<><D3A6>RMB').AsFloat;
|
|
|
t_ch_dui.FieldByName('Ӧ<><D3A6>USD').AsFloat:=FieldByName('Ӧ<><D3A6>USD').AsFloat;
|
|
|
t_ch_dui.FieldByName('Ӧ<><D3A6>RMB').AsFloat:=FieldByName('Ӧ<><D3A6>RMB').AsFloat;
|
|
|
t_ch_dui.FieldByName('Ӧ<><D3A6>USD').AsFloat:=FieldByName('Ӧ<><D3A6>USD').AsFloat;
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_dui.insert;
|
|
|
Notebook1.PageIndex:=1;
|
|
|
bsSkinButton11.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton2Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_ch_dui);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton4Click(Sender: TObject);
|
|
|
var aAdoQuery:TAdoQuery;
|
|
|
str:widestring;
|
|
|
begin
|
|
|
if t_ch_dui.IsEmpty then
|
|
|
exit;
|
|
|
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)<>IDOK then
|
|
|
exit;
|
|
|
try
|
|
|
frm_main.db.BeginTrans;
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select ch_id from t_ch_fee where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=1 and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=:<3A><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>');
|
|
|
end;
|
|
|
v_dui_bill.first;
|
|
|
while not v_dui_bill.eof do
|
|
|
begin
|
|
|
|
|
|
aAdoQuery.Close;
|
|
|
aAdoQuery.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
aAdoQuery.Parameters.ParamByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').Value:=t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
aAdoQuery.Open;
|
|
|
aAdoQuery.First;
|
|
|
while not aAdoQuery.Eof do
|
|
|
begin
|
|
|
str:='update t_ch_fee set <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0,<2C><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=null'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+''''
|
|
|
+' and ch_id='+''''+aAdoQuery.fieldbyname('ch_id').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
aAdoQuery.Next;
|
|
|
end;
|
|
|
{ str:='update t_ch_fee set <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0,<2C><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=null'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
}
|
|
|
str:='delete from t_ch_dui_detail'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
|
|
|
if t_ch_dui_bill.Locate('<27><><EFBFBD><EFBFBD>',v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,[])then
|
|
|
t_ch_dui_bill.delete;
|
|
|
v_dui_bill.next;
|
|
|
end;
|
|
|
t_ch_dui.delete;
|
|
|
frm_main.db.CommitTrans;
|
|
|
finally
|
|
|
if frm_main.db.InTransaction then
|
|
|
begin
|
|
|
frm_main.db.RollbackTrans;
|
|
|
MessageDlg('ɾ<><C9BE>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><D8B1><EFBFBD><EFBFBD>ԣ<EFBFBD>',mterror,[mbok],0);
|
|
|
end;
|
|
|
|
|
|
aAdoQuery.Free;
|
|
|
if t_op_seae.Active then
|
|
|
t_op_seae.Requery();
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
table_cancel(t_ch_dui);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton11Click(Sender: TObject);
|
|
|
var
|
|
|
answer:TModalResult;
|
|
|
begin
|
|
|
if bsSkinButton11.Caption='<27>༭<EFBFBD><EFBFBD>' then
|
|
|
begin
|
|
|
Notebook1.PageIndex:=1;
|
|
|
bsSkinButton11.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if (t_ch_dui.State=dsinsert)or(t_ch_dui.State=dsedit) then
|
|
|
BEGIN
|
|
|
answer:=messagedlg( '<27><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE>ģ<DEB8><C4A3>Ƿ棿',mtWarning,mbYesNoCancel,0);
|
|
|
if answer=mrYes then
|
|
|
begin
|
|
|
t_ch_dui.post;
|
|
|
end;
|
|
|
if answer=mrNo then
|
|
|
begin
|
|
|
t_ch_dui.cancel;
|
|
|
end;
|
|
|
if answer=mrCancel then
|
|
|
begin
|
|
|
exit;
|
|
|
end;
|
|
|
END;
|
|
|
Notebook1.PageIndex:=0;
|
|
|
bsSkinButton11.Caption:='<27>༭<EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton12Click(Sender: TObject);
|
|
|
begin
|
|
|
try
|
|
|
if not assigned(frm_rp_dui_formatrpt) then
|
|
|
frm_rp_dui_formatrpt:=tfrm_rp_dui_formatrpt.Create (self);
|
|
|
dui_format_type:=9;
|
|
|
frm_rp_dui_formatrpt.showmodal;
|
|
|
finally
|
|
|
frm_rp_dui_formatrpt.free;
|
|
|
frm_rp_dui_formatrpt:=nil;
|
|
|
t_ch_dui_format.requery;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.FormShow(Sender: TObject);
|
|
|
var
|
|
|
str:widestring;
|
|
|
begin
|
|
|
Notebook1.PageIndex:=0;
|
|
|
dxImageComboBox1.ItemIndex:=0;
|
|
|
|
|
|
if strtobool(get_parameters_value(187,'false')) then
|
|
|
begin
|
|
|
bsSkinButton14.Visible:=true;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
bsSkinButton14.Visible:=false;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
loadreggrid(dxdbgrid1,false,caption+'1');
|
|
|
|
|
|
loadreggrid(dxdbgrid3,false,caption+'3');
|
|
|
loadreggrid(dxdbgrid4,false,caption+'4');
|
|
|
loadreggrid(dxdbgrid6,false,caption+'6');
|
|
|
loadreggrid(dxdbgrid7,false,caption+'7');
|
|
|
loadreggrid(dxdbgrid8,false,caption+'8');
|
|
|
t_ch_dui_format.Parameters[0].value:=9;
|
|
|
t_ch_dui_format.open;
|
|
|
str:='select top 50 * from t_ch_dui ';
|
|
|
str:=str+' where <20><><EFBFBD><EFBFBD>=9 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+employee+''''+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc';
|
|
|
t_ch_dui.close;
|
|
|
t_ch_dui.SQL.clear;
|
|
|
t_ch_dui.sql.Add(str);
|
|
|
t_ch_dui.open;
|
|
|
|
|
|
t_ch_dui_bill.open;
|
|
|
t_ch_dui_detail.open;
|
|
|
v_dui_bill.open;
|
|
|
v_dui_fee.Parameters.ParamByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').value:=t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
v_dui_fee.open;
|
|
|
|
|
|
|
|
|
frm_data_share.t_crm_client_all.requery;
|
|
|
t_dui_cust.open;
|
|
|
|
|
|
except
|
|
|
on e : exception do begin
|
|
|
showmessage(e.Message);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.t_ch_duiAfterScroll(DataSet: TDataSet);
|
|
|
begin
|
|
|
if v_dui_fee.active then
|
|
|
begin
|
|
|
v_dui_fee.close;
|
|
|
v_dui_fee.Parameters.ParamByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').value:=t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
v_dui_fee.open;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.N1Click(Sender: TObject);
|
|
|
var
|
|
|
i,k:integer;
|
|
|
aMblNo:string;
|
|
|
function GetFeeStatus(bsNo:string):boolean;
|
|
|
var aAdoQuery:TAdoQuery;
|
|
|
begin
|
|
|
result:=false;
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
close;sql.clear;
|
|
|
sql.Add('select * From t_ch_fee');
|
|
|
sql.Add('where <20><><EFBFBD><EFBFBD>=:bsNo and <20><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>'')');
|
|
|
Parameters.ParamByName('bsNo').Value:=bsNo;
|
|
|
open;
|
|
|
result:=not IsEmpty;
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
end;
|
|
|
begin
|
|
|
if t_op_seae.IsEmpty then
|
|
|
exit;
|
|
|
if t_ch_dui.IsEmpty then
|
|
|
exit;
|
|
|
if (t_ch_dui.FieldByName('<27><><EFBFBD>ʿͻ<CABF>').asstring='') and (not strtobool(get_parameters_value(115,'false'))) then
|
|
|
begin
|
|
|
t_ch_dui.edit;
|
|
|
t_ch_dui['<27><><EFBFBD>ʿͻ<CABF>']:=t_ch_fee.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui.post;
|
|
|
end;
|
|
|
if dxDBGrid3.SelectedCount>=1 then
|
|
|
begin
|
|
|
for i:=0 to dxDBGrid3.SelectedCount-1 do
|
|
|
begin
|
|
|
t_op_seae.GotoBookmark(pointer(dxDBGrid3.selectedrows[i]));
|
|
|
if GetFeeStatus(t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) then
|
|
|
ShowMessage('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>:'+t_op_seae.FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString+' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ɾ<><C9BE><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>');
|
|
|
t_ch_fee.first;
|
|
|
while not t_ch_fee.Eof do
|
|
|
begin
|
|
|
if strtobool(get_parameters_value(115,'false')) then begin
|
|
|
|
|
|
end else begin
|
|
|
if t_ch_dui.FieldByName('<27><><EFBFBD>ʿͻ<CABF>').asstring<>t_ch_fee.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring then
|
|
|
begin
|
|
|
showmessage('<27><>ǰ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʿͻ<CABF><CDBB><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
t_ch_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_ch_fee.first;
|
|
|
while not t_ch_fee.Eof do
|
|
|
begin
|
|
|
if strtobool(get_parameters_value(115,'false')) then begin
|
|
|
end else begin
|
|
|
if t_ch_dui.FieldByName('<27><><EFBFBD>ʿͻ<CABF>').asstring<>t_ch_fee.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring then
|
|
|
begin
|
|
|
showmessage('<27><>ǰ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʿͻ<CABF><CDBB><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
t_ch_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
if (t_ch_dui.state=dsinsert)or(t_ch_dui.state=dsedit) then
|
|
|
t_ch_dui.Post;
|
|
|
try
|
|
|
t_ch_dui_bill.DisableControls;
|
|
|
if dxDBGrid3.SelectedCount>=1 then
|
|
|
begin
|
|
|
for i:=0 to dxDBGrid3.SelectedCount-1 do
|
|
|
begin
|
|
|
t_op_seae.GotoBookmark(pointer(dxDBGrid3.selectedrows[i]));
|
|
|
if not t_ch_fee.IsEmpty then
|
|
|
begin
|
|
|
if not t_ch_dui_bill.Locate('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring,t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring]),[]) then begin
|
|
|
t_ch_dui_bill.insert;
|
|
|
t_ch_dui_bill['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_dui_bill['<27><><EFBFBD><EFBFBD>']:=t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui_bill.post;
|
|
|
end;
|
|
|
t_ch_fee.first;
|
|
|
while not t_ch_fee.Eof do
|
|
|
begin
|
|
|
if (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString='ȫ<><C8AB>') or (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString=t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) then begin
|
|
|
t_ch_fee.edit;
|
|
|
t_ch_fee['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=1;
|
|
|
t_ch_fee['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_fee.post;
|
|
|
end;
|
|
|
t_ch_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if not t_ch_fee.IsEmpty then
|
|
|
begin
|
|
|
if not t_ch_dui_bill.Locate('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring,t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring]),[]) then begin
|
|
|
t_ch_dui_bill.insert;
|
|
|
t_ch_dui_bill['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_dui_bill['<27><><EFBFBD><EFBFBD>']:=t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui_bill.post;
|
|
|
end;
|
|
|
t_ch_fee.first;
|
|
|
while not t_ch_fee.Eof do
|
|
|
begin
|
|
|
if (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString='ȫ<><C8AB>') or (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString=t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) then begin
|
|
|
t_ch_fee.edit;
|
|
|
t_ch_fee['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=1;
|
|
|
t_ch_fee['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_fee.post;
|
|
|
end;
|
|
|
t_ch_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
t_ch_dui.edit;
|
|
|
t_ch_dui.post;
|
|
|
|
|
|
t_op_seae.requery;
|
|
|
v_dui_bill.requery;
|
|
|
finally
|
|
|
t_ch_dui_bill.EnableControls;
|
|
|
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.RxDBLookupCombo1Enter(Sender: TObject);
|
|
|
begin
|
|
|
if t_ch_dui_bill.IsEmpty then
|
|
|
RxDBLookupCombo1.ReadOnly:=false
|
|
|
else
|
|
|
RxDBLookupCombo1.ReadOnly:=true;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
begin
|
|
|
Column_sort(Column,t_ch_dui,'<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton9Click(Sender: TObject);
|
|
|
var
|
|
|
Pnt:Tpoint;
|
|
|
begin
|
|
|
Pnt:=bsSkinButton9.ClientToScreen(Point(0,bsSkinButton9.Height));
|
|
|
PopupMenu8.Popup(Pnt.x,Pnt.y);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton10Click(Sender: TObject);
|
|
|
begin
|
|
|
try
|
|
|
if not assigned(frm_rp_dui_query) then
|
|
|
frm_rp_dui_query:=tfrm_rp_dui_query.Create (self);
|
|
|
dui_query_num:=9;
|
|
|
frm_rp_dui_query.showmodal;
|
|
|
finally
|
|
|
frm_rp_dui_query.free;
|
|
|
frm_rp_dui_query:=nil;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.N5Click(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
str:widestring;
|
|
|
aAdoQuery:TAdoQuery;
|
|
|
begin
|
|
|
if v_dui_bill.IsEmpty then
|
|
|
exit;
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select ch_id from t_ch_fee where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=1 and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=:<3A><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
if dxDBGrid6.SelectedCount>=1 then
|
|
|
begin
|
|
|
for i:=0 to dxDBGrid6.SelectedCount-1 do
|
|
|
begin
|
|
|
v_dui_bill.GotoBookmark(pointer(dxDBGrid6.selectedrows[i]));
|
|
|
|
|
|
aAdoQuery.Close;
|
|
|
aAdoQuery.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
aAdoQuery.Parameters.ParamByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').Value:=t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
aAdoQuery.Open;
|
|
|
aAdoQuery.First;
|
|
|
while not aAdoQuery.Eof do
|
|
|
begin
|
|
|
str:='update t_ch_fee set <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0,<2C><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=null'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+''''
|
|
|
+' and ch_id='+''''+aAdoQuery.fieldbyname('ch_id').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
aAdoQuery.Next;
|
|
|
end;
|
|
|
|
|
|
{
|
|
|
str:='update t_ch_fee set <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0,<2C><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=null'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
}
|
|
|
|
|
|
str:='delete from t_ch_dui_detail'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
|
|
|
if t_ch_dui_bill.Locate('<27><><EFBFBD><EFBFBD>',v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,[])then
|
|
|
t_ch_dui_bill.delete;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
|
|
|
aAdoQuery.Close;
|
|
|
aAdoQuery.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
aAdoQuery.Parameters.ParamByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').Value:=t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
aAdoQuery.Open;
|
|
|
aAdoQuery.First;
|
|
|
while not aAdoQuery.Eof do
|
|
|
begin
|
|
|
str:='update t_ch_fee set <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0,<2C><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=null'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+''''
|
|
|
+' and ch_id='+''''+aAdoQuery.fieldbyname('ch_id').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
aAdoQuery.Next;
|
|
|
end;
|
|
|
{
|
|
|
str:='update t_ch_fee set <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0,<2C><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=null'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
}
|
|
|
str:='delete from t_ch_dui_detail'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
|
|
|
if t_ch_dui_bill.Locate('<27><><EFBFBD><EFBFBD>',v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,[])then
|
|
|
t_ch_dui_bill.delete;
|
|
|
end;
|
|
|
t_ch_dui.edit;
|
|
|
t_ch_dui.post;
|
|
|
|
|
|
if t_op_seae.Active then
|
|
|
t_op_seae.Requery();
|
|
|
v_dui_bill.Requery();
|
|
|
aAdoQuery.Free;
|
|
|
end;
|
|
|
|
|
|
{procedure Tfrm_rp_dui_accepttotal.N5Click(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
str:widestring;
|
|
|
begin
|
|
|
if v_dui_bill.IsEmpty then
|
|
|
exit;
|
|
|
if dxDBGrid6.SelectedCount>=1 then
|
|
|
begin
|
|
|
for i:=0 to dxDBGrid6.SelectedCount-1 do
|
|
|
begin
|
|
|
v_dui_bill.GotoBookmark(pointer(dxDBGrid6.selectedrows[i]));
|
|
|
str:='update t_ch_fee set <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0,<2C><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=null'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
str:='delete from t_ch_dui_detail'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
|
|
|
if t_ch_dui_bill.Locate('<27><><EFBFBD><EFBFBD>',v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,[])then
|
|
|
t_ch_dui_bill.delete;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str:='update t_ch_fee set <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0,<2C><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=null'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
str:='delete from t_ch_dui_detail'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
|
|
|
if t_ch_dui_bill.Locate('<27><><EFBFBD><EFBFBD>',v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,[])then
|
|
|
t_ch_dui_bill.delete;
|
|
|
end;
|
|
|
if t_op_seae.Active then
|
|
|
t_op_seae.Requery();
|
|
|
v_dui_bill.Requery();
|
|
|
end;
|
|
|
}
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.N2Click(Sender: TObject);
|
|
|
begin
|
|
|
grid_save_xls(dxDBGrid2);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinPageControl1Change(
|
|
|
Sender: TObject);
|
|
|
var
|
|
|
str_list:TStringList;
|
|
|
i:integer;
|
|
|
str:String;
|
|
|
begin
|
|
|
if bsSkinPageControl1.ActivePage=bsSkinTabSheet1 then exit;
|
|
|
if t_ch_dui.IsEmpty then
|
|
|
exit;
|
|
|
if t_ch_dui.State in [dsedit,dsinsert] then
|
|
|
t_ch_dui.Post;
|
|
|
if t_ch_dui.fieldbyname('DM_ID').asstring='' then
|
|
|
exit;
|
|
|
if t_ch_dui.fieldbyname('DM_ID').asstring='0' then
|
|
|
exit;
|
|
|
t_ch_dui_format.Locate('DM_ID',t_ch_dui.fieldbyname('DM_ID').asstring,[]);
|
|
|
str_list:=Tstringlist.create();
|
|
|
try
|
|
|
str_list.Text:=trim(t_ch_dui_format.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>').AsString);
|
|
|
for i:=0 to str_list.Count-1 do
|
|
|
begin
|
|
|
if Str='' then
|
|
|
Str:=str_list.Strings[i]
|
|
|
else
|
|
|
Str:=Str+';'+str_list.Strings[i];
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(str_list);
|
|
|
end;
|
|
|
|
|
|
// v_dui_bill.Sort:='ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
|
dui_gridall(t_ch_dui_format.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring,dxdbgrid2,t_ch_dui.fieldbyname('DM_ID').AsInteger,t_ch_dui_format,t_ch_dui.fieldbyname('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
dui_tableAll(t_bill_fee_dong,t_ch_dui_format.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring,v_dui_bill,v_dui_fee,t_ch_dui.fieldbyname('DM_ID').AsInteger,str,t_ch_dui);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.MenuItem1Click(Sender: TObject);
|
|
|
var
|
|
|
i,k:integer;
|
|
|
book1:Tbookmark;
|
|
|
|
|
|
begin
|
|
|
if t_op_seae.IsEmpty then
|
|
|
exit;
|
|
|
if t_ch_dui.IsEmpty then
|
|
|
exit;
|
|
|
if (t_ch_dui.FieldByName('<27><><EFBFBD>ʿͻ<CABF>').asstring='') and (not strtobool(get_parameters_value(115,'false')))then
|
|
|
begin
|
|
|
t_ch_dui.edit;
|
|
|
t_ch_dui['<27><><EFBFBD>ʿͻ<CABF>']:=t_ch_fee.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui.post;
|
|
|
end;
|
|
|
if (t_ch_dui.state=dsinsert)or(t_ch_dui.state=dsedit) then
|
|
|
t_ch_dui.Post;
|
|
|
|
|
|
if strtobool(get_parameters_value(115,'false')) then begin
|
|
|
end else begin
|
|
|
if t_ch_dui.FieldByName('<27><><EFBFBD>ʿͻ<CABF>').asstring<>t_ch_fee.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring then
|
|
|
begin
|
|
|
showmessage('<27><>ǰ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʿͻ<CABF><CDBB><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if not t_ch_fee.IsEmpty then
|
|
|
begin
|
|
|
if not t_ch_dui_bill.Locate('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring,t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring]),[]) then begin
|
|
|
t_ch_dui_bill.insert;
|
|
|
t_ch_dui_bill['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_dui_bill['<27><><EFBFBD><EFBFBD>']:=t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui_bill.post;
|
|
|
end;
|
|
|
|
|
|
if dxDBGrid4.SelectedCount>=1 then
|
|
|
begin
|
|
|
for i:=0 to dxDBGrid4.SelectedCount-1 do
|
|
|
begin
|
|
|
t_ch_fee.GotoBookmark(pointer(dxDBGrid4.selectedrows[i]));
|
|
|
if (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString='ȫ<><C8AB>') or (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString=t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) then
|
|
|
begin
|
|
|
t_ch_fee.edit;
|
|
|
t_ch_fee['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=1;
|
|
|
t_ch_fee['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_fee.post;
|
|
|
end;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString='ȫ<><C8AB>') or (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString=t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) then
|
|
|
begin
|
|
|
t_ch_fee.edit;
|
|
|
t_ch_fee['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=1;
|
|
|
t_ch_fee['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_fee.post;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
v_dui_bill.requery;
|
|
|
t_ch_dui.edit;
|
|
|
t_ch_dui.post;
|
|
|
|
|
|
|
|
|
book1:=t_op_seae.GetBookmark;
|
|
|
t_op_seae.Refresh;
|
|
|
t_op_seae.GotoBookmark(book1);
|
|
|
|
|
|
// t_ch_fee.Requery;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.MenuItem2Click(Sender: TObject);
|
|
|
var
|
|
|
Str:String;
|
|
|
begin
|
|
|
if v_dui_bill.IsEmpty then
|
|
|
exit;
|
|
|
if v_dui_fee.IsEmpty then
|
|
|
exit;
|
|
|
str:='update t_ch_fee set <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0,<2C><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=null'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+''''
|
|
|
+' and CH_ID=' +v_dui_fee.fieldbyname('CH_ID').asstring;
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
str:='delete from t_ch_dui_detail'
|
|
|
+' where <20><><EFBFBD><EFBFBD>='+''''+v_dui_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+''''
|
|
|
+' and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+''''
|
|
|
+' and CH_ID='+v_dui_fee.fieldbyname('CH_ID').asstring;
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
|
|
|
t_ch_dui.edit;
|
|
|
t_ch_dui.post;
|
|
|
|
|
|
if t_op_seae.Active then
|
|
|
t_op_seae.Requery();
|
|
|
v_dui_bill.Requery();
|
|
|
v_dui_fee.Requery();
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.dxDBGrid3SelectedCountChange(
|
|
|
Sender: TObject);
|
|
|
var
|
|
|
i,k:integer;
|
|
|
DR,CR,USDDR,USDCR,NDR,NCR,NUSDDR,NUSDCR,OTDR,OTCR,NOTDR,NOTCR:Double;
|
|
|
aFieldName:string;
|
|
|
begin
|
|
|
|
|
|
|
|
|
if bsSkinDBCheckRadioBox2.Checked then
|
|
|
aFieldName:='<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>'
|
|
|
else aFieldName:='<27><><EFBFBD><EFBFBD>';
|
|
|
DR:=0;
|
|
|
CR:=0;
|
|
|
USDDR:=0;
|
|
|
USDCR:=0;
|
|
|
NDR:=0;
|
|
|
NCR:=0;
|
|
|
NUSDDR:=0;
|
|
|
NUSDCR:=0;
|
|
|
OTDR:=0;
|
|
|
OTCR:=0;
|
|
|
NOTDR:=0;
|
|
|
NOTCR:=0;
|
|
|
|
|
|
|
|
|
if t_op_seae.IsEmpty then
|
|
|
exit;
|
|
|
if dxDBGrid3.SelectedCount>=1 then
|
|
|
begin
|
|
|
for i:=0 to dxDBGrid3.SelectedCount-1 do
|
|
|
begin
|
|
|
t_op_seae.GotoBookmark(pointer(dxDBGrid3.selectedrows[i]));
|
|
|
if not t_ch_fee.IsEmpty then
|
|
|
begin
|
|
|
t_ch_fee.first;
|
|
|
while not t_ch_fee.Eof do
|
|
|
begin
|
|
|
if t_ch_fee.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
|
|
|
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
|
|
|
USDDR:=USDDR+t_ch_fee.fieldByName(aFieldName).AsFloat;
|
|
|
NUSDDR:=NUSDDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end else begin
|
|
|
USDCR:=USDCR+t_ch_fee.fieldByName(aFieldName).AsFloat;
|
|
|
NUSDCR:=NUSDCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end;
|
|
|
end else if t_ch_fee.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then begin
|
|
|
|
|
|
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
|
|
|
DR:=DR+t_ch_fee.fieldByName(aFieldName).AsFloat;
|
|
|
NDR:=NDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end else begin
|
|
|
CR:=CR+t_ch_fee.fieldByName(aFieldName).AsFloat;
|
|
|
NCR:=NCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end;
|
|
|
end else begin
|
|
|
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
|
|
|
OTDR:=OTDR+t_ch_fee.fieldByName(aFieldName).AsFloat;
|
|
|
NOTDR:=NOTDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end else begin
|
|
|
OTCR:=OTCR+t_ch_fee.fieldByName(aFieldName).AsFloat;
|
|
|
NOTCR:=NOTCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end;
|
|
|
end;
|
|
|
t_ch_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if not t_ch_fee.IsEmpty then
|
|
|
begin
|
|
|
t_ch_fee.first;
|
|
|
while not t_ch_fee.Eof do
|
|
|
begin
|
|
|
if t_ch_fee.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
|
|
|
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
|
|
|
USDDR:=USDDR+t_ch_fee.fieldByName(aFieldName).AsFloat;
|
|
|
NUSDDR:=NUSDDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end else begin
|
|
|
USDCR:=USDCR+t_ch_fee.fieldByName(aFieldName).AsFloat;
|
|
|
NUSDCR:=NUSDCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end;
|
|
|
end else if t_ch_fee.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then begin
|
|
|
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
|
|
|
DR:=DR+t_ch_fee.fieldByName(aFieldName).AsFloat;
|
|
|
NDR:=NDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end else begin
|
|
|
CR:=CR+t_ch_fee.fieldByName(aFieldName).AsFloat;
|
|
|
NCR:=NCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end;
|
|
|
end else begin
|
|
|
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
|
|
|
OTDR:=OTDR+t_ch_fee.fieldByName(aFieldName).AsFloat;
|
|
|
NOTDR:=NOTDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end else begin
|
|
|
OTCR:=OTCR+t_ch_fee.fieldByName(aFieldName).AsFloat;
|
|
|
NOTCR:=NOTCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end;
|
|
|
end;
|
|
|
t_ch_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
lblSum.Caption:='<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>'+inttostr(dxDBGrid3.SelectedCount)+'Ʊҵ<C6B1><D2B5>,'+'Ӧ<><D3A6> <20><>Ԫ:'+FormatFloat('#,##,0.00;-0.00',USDDR)+',δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',NUSDDR)+';Ӧ<><D3A6> <20><>Ԫ:'+FormatFloat('#,##,0.00;-0.00',USDCR)+',δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',NUSDCR);
|
|
|
lblSum1.Caption:='Ӧ<><D3A6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',DR)+',δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',NDR)+';Ӧ<><D3A6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',CR)+',δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',NCR);
|
|
|
lblSum2.Caption:='Ӧ<><D3A6> <20><><EFBFBD><EFBFBD><EFBFBD>ұ<EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',OTDR)+',δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',NOTDR)+';Ӧ<><D3A6> <20><><EFBFBD><EFBFBD><EFBFBD>ұ<EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',OTCR)+',δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',NOTCR);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.dxDBGrid3Click(Sender: TObject);
|
|
|
var
|
|
|
i,k:integer;
|
|
|
DR,CR,USDDR,USDCR,NDR,NCR,NUSDDR,NUSDCR:Double;
|
|
|
begin
|
|
|
{
|
|
|
DR:=0;
|
|
|
CR:=0;
|
|
|
USDDR:=0;
|
|
|
USDCR:=0;
|
|
|
NDR:=0;
|
|
|
NCR:=0;
|
|
|
NUSDDR:=0;
|
|
|
NUSDCR:=0;
|
|
|
|
|
|
|
|
|
if t_op_seae.IsEmpty then
|
|
|
exit;
|
|
|
if dxDBGrid3.SelectedCount>=1 then
|
|
|
begin
|
|
|
for i:=0 to dxDBGrid3.SelectedCount-1 do
|
|
|
begin
|
|
|
t_op_seae.GotoBookmark(pointer(dxDBGrid3.selectedrows[i]));
|
|
|
if not t_ch_fee.IsEmpty then
|
|
|
begin
|
|
|
t_ch_fee.first;
|
|
|
while not t_ch_fee.Eof do
|
|
|
begin
|
|
|
if t_ch_fee.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
|
|
|
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
|
|
|
USDDR:=USDDR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
NUSDDR:=NUSDDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end else begin
|
|
|
USDCR:=USDCR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
NUSDCR:=NUSDCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end;
|
|
|
end else begin
|
|
|
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
|
|
|
DR:=DR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
NDR:=NDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end else begin
|
|
|
CR:=CR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
NCR:=NCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end;
|
|
|
end;
|
|
|
t_ch_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if not t_ch_fee.IsEmpty then
|
|
|
begin
|
|
|
t_ch_fee.first;
|
|
|
while not t_ch_fee.Eof do
|
|
|
begin
|
|
|
if t_ch_fee.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then begin
|
|
|
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
|
|
|
USDDR:=USDDR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
NUSDDR:=NUSDDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end else begin
|
|
|
USDCR:=USDCR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
NUSDCR:=NUSDCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end;
|
|
|
end else begin
|
|
|
if t_ch_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='<27><>' then begin
|
|
|
DR:=DR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
NDR:=NDR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end else begin
|
|
|
CR:=CR+t_ch_fee.fieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
NCR:=NCR+t_ch_fee.fieldByName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
end;
|
|
|
end;
|
|
|
t_ch_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
lblSum.Caption:='<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>'+inttostr(dxDBGrid3.SelectedCount)+'Ʊҵ<C6B1><D2B5>,'+'Ӧ<><D3A6> <20><>Ԫ:'+FormatFloat('#,##,0.00;-0.00',USDDR)+',δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',NUSDDR)+';Ӧ<><D3A6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',DR)+',δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',NDR)+';Ӧ<><D3A6> <20><>Ԫ:'+FormatFloat('#,##,0.00;-0.00',USDCR)+',δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',NUSDCR)+';Ӧ<><D3A6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',CR)+',δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FormatFloat('#,##,0.00;-0.00',NCR);
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.N3Click(Sender: TObject);
|
|
|
var
|
|
|
i,k:integer;
|
|
|
begin
|
|
|
if t_dui_b.IsEmpty then
|
|
|
exit;
|
|
|
if t_ch_dui.IsEmpty then
|
|
|
exit;
|
|
|
if t_ch_dui.FieldByName('<27><><EFBFBD>ʿͻ<CABF>').asstring='' then
|
|
|
begin
|
|
|
if not strtobool(get_parameters_value(115,'false')) then begin
|
|
|
t_ch_dui.edit;
|
|
|
t_ch_dui['<27><><EFBFBD>ʿͻ<CABF>']:=t_dui_b_fee.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui.post;
|
|
|
end else begin
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if dxDBGrid8.SelectedCount>=1 then
|
|
|
begin
|
|
|
for i:=0 to dxDBGrid8.SelectedCount-1 do
|
|
|
begin
|
|
|
t_dui_b.GotoBookmark(pointer(dxDBGrid8.selectedrows[i]));
|
|
|
t_dui_b_fee.first;
|
|
|
while not t_dui_b_fee.Eof do
|
|
|
begin
|
|
|
if strtobool(get_parameters_value(115,'false')) then begin
|
|
|
end else begin
|
|
|
if t_ch_dui.FieldByName('<27><><EFBFBD>ʿͻ<CABF>').asstring<>t_dui_b_fee.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring then
|
|
|
begin
|
|
|
showmessage('<27><>ǰ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʿͻ<CABF><CDBB><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
t_dui_b_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_dui_b_fee.first;
|
|
|
while not t_dui_b_fee.Eof do
|
|
|
begin
|
|
|
if strtobool(get_parameters_value(115,'false')) then begin
|
|
|
end else begin
|
|
|
if t_ch_dui.FieldByName('<27><><EFBFBD>ʿͻ<CABF>').asstring<>t_dui_b_fee.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring then
|
|
|
begin
|
|
|
showmessage('<27><>ǰ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʿͻ<CABF><CDBB><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
t_dui_b_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
if (t_ch_dui.state=dsinsert)or(t_ch_dui.state=dsedit) then
|
|
|
t_ch_dui.Post;
|
|
|
if dxDBGrid8.SelectedCount>=1 then
|
|
|
begin
|
|
|
for i:=0 to dxDBGrid8.SelectedCount-1 do
|
|
|
begin
|
|
|
t_dui_b.GotoBookmark(pointer(dxDBGrid8.selectedrows[i]));
|
|
|
if not t_dui_b_fee.IsEmpty then
|
|
|
begin
|
|
|
if not t_ch_dui_bill.Locate('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring,t_dui_b.FieldByName('<27><><EFBFBD><EFBFBD>').asstring]),[]) then begin
|
|
|
t_ch_dui_bill.insert;
|
|
|
t_ch_dui_bill['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_dui_bill['<27><><EFBFBD><EFBFBD>']:=t_dui_b.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui_bill.post;
|
|
|
end;
|
|
|
t_dui_b_fee.first;
|
|
|
while not t_dui_b_fee.Eof do
|
|
|
begin
|
|
|
if (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString='ȫ<><C8AB>') or (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString=t_dui_b_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) then begin
|
|
|
if not t_ch_dui_detail.Locate('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>;CH_ID',VarArrayOf([t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring,t_dui_b_fee.FieldByName('CH_ID').asinteger]),[]) then begin
|
|
|
t_ch_dui_detail.insert;
|
|
|
t_ch_dui_detail['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_dui_detail['<27><><EFBFBD><EFBFBD>']:=t_dui_b.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui_detail['CH_ID']:=t_dui_b_fee.FieldByName('CH_ID').asinteger;
|
|
|
t_ch_dui_detail.post;
|
|
|
end;
|
|
|
end;
|
|
|
t_dui_b_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if not t_dui_b_fee.IsEmpty then
|
|
|
begin
|
|
|
if not t_ch_dui_bill.Locate('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring,t_dui_b.FieldByName('<27><><EFBFBD><EFBFBD>').asstring]),[]) then begin
|
|
|
t_ch_dui_bill.insert;
|
|
|
t_ch_dui_bill['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_dui_bill['<27><><EFBFBD><EFBFBD>']:=t_dui_b.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui_bill.post;
|
|
|
end;
|
|
|
t_dui_b_fee.first;
|
|
|
while not t_dui_b_fee.Eof do
|
|
|
begin
|
|
|
if (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString='ȫ<><C8AB>') or (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString=t_dui_b_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) then begin
|
|
|
if not t_ch_dui_detail.Locate('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>;CH_ID',VarArrayOf([t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring,t_dui_b_fee.FieldByName('CH_ID').asinteger]),[]) then begin
|
|
|
t_ch_dui_detail.insert;
|
|
|
t_ch_dui_detail['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_dui_detail['<27><><EFBFBD><EFBFBD>']:=t_dui_b.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui_detail['CH_ID']:=t_dui_b_fee.FieldByName('CH_ID').asinteger;
|
|
|
t_ch_dui_detail.post;
|
|
|
end;
|
|
|
end;
|
|
|
t_dui_b_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
bsSkinButton7.OnClick(nil);
|
|
|
// t_dui_b.requery;
|
|
|
v_dui_bill.requery;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.MenuItem3Click(Sender: TObject);
|
|
|
var
|
|
|
i,k:integer;
|
|
|
book1:Tbookmark;
|
|
|
|
|
|
begin
|
|
|
if t_dui_b.IsEmpty then
|
|
|
exit;
|
|
|
if t_ch_dui.IsEmpty then
|
|
|
exit;
|
|
|
if (t_ch_dui.FieldByName('<27><><EFBFBD>ʿͻ<CABF>').asstring='') and (not strtobool(get_parameters_value(115,'false'))) then
|
|
|
begin
|
|
|
t_ch_dui.edit;
|
|
|
t_ch_dui['<27><><EFBFBD>ʿͻ<CABF>']:=t_ch_fee.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui.post;
|
|
|
end;
|
|
|
if (t_ch_dui.state=dsinsert)or(t_ch_dui.state=dsedit) then
|
|
|
t_ch_dui.Post;
|
|
|
if strtobool(get_parameters_value(115,'false')) then begin
|
|
|
end else begin
|
|
|
if t_ch_dui.FieldByName('<27><><EFBFBD>ʿͻ<CABF>').asstring<>t_dui_b_fee.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring then
|
|
|
begin
|
|
|
showmessage('<27><>ǰ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʿͻ<CABF><CDBB><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if not t_dui_b_fee.IsEmpty then
|
|
|
begin
|
|
|
if not t_ch_dui_bill.Locate('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring,t_dui_b.FieldByName('<27><><EFBFBD><EFBFBD>').asstring]),[]) then begin
|
|
|
t_ch_dui_bill.insert;
|
|
|
t_ch_dui_bill['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_dui_bill['<27><><EFBFBD><EFBFBD>']:=t_dui_b.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui_bill.post;
|
|
|
end;
|
|
|
if (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString='ȫ<><C8AB>') or (t_ch_dui.FieldByName('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').AsString=t_dui_b_fee.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) then begin
|
|
|
if not t_ch_dui_detail.Locate('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>;CH_ID',VarArrayOf([t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring,t_dui_b_fee.FieldByName('CH_ID').asinteger]),[]) then begin
|
|
|
t_ch_dui_detail.insert;
|
|
|
t_ch_dui_detail['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=t_ch_dui.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
t_ch_dui_detail['<27><><EFBFBD><EFBFBD>']:=t_dui_b.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui_detail['CH_ID']:=t_dui_b_fee.FieldByName('CH_ID').asinteger;
|
|
|
t_ch_dui_detail.post;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
v_dui_bill.requery;
|
|
|
bsSkinButton7.OnClick(nil);
|
|
|
|
|
|
book1:=t_dui_b.GetBookmark;
|
|
|
t_dui_b.Refresh;
|
|
|
t_dui_b.GotoBookmark(book1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.dxDBGrid3Column21CustomDraw(
|
|
|
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[dxDBGrid3Column21.Index])='<27><><EFBFBD>ĵ<EFBFBD>' then
|
|
|
AColor:=clred;
|
|
|
AFont.Color:=clblack;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.ComboBoxObj1KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
if key=#13 then
|
|
|
begin
|
|
|
key:=#0;
|
|
|
bsSkinButton7Click(Sender);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.dxDBGrid6ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
begin
|
|
|
Column_sort(column,v_dui_bill,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.dxDBGrid2ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
begin
|
|
|
Column_sort_RxMemoryData(column,t_bill_fee_dong,'BILLID');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.RxDBLookupCombo4Enter(Sender: TObject);
|
|
|
var aParams : TParams;
|
|
|
aWithObjID : Boolean;
|
|
|
aQuery : TAdoQuery;
|
|
|
str_fee,str_op:widestring;
|
|
|
|
|
|
begin
|
|
|
|
|
|
if NOT strtobool(get_parameters_value(84,'false')) then
|
|
|
begin
|
|
|
if bsSkinCheckRadioBox2.Checked then
|
|
|
begin
|
|
|
str_fee:=' 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
|
|
|
else
|
|
|
begin
|
|
|
str_fee:=' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
|
|
|
end;
|
|
|
end else begin
|
|
|
if bsSkinCheckRadioBox2.Checked then
|
|
|
begin
|
|
|
str_fee:=' 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>'+''''+','+''''+'¼<><C2BC>״̬'+''''+','+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str_fee:=' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''+','+''''+'¼<><C2BC>״̬'+''''+','+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if wwDBComboBox31.Text<>''then
|
|
|
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
|
|
|
|
|
|
if RxDBLookupCombo16.DisplayValues[1]<>''then
|
|
|
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
|
|
|
|
|
|
|
|
|
|
|
|
if RxDBLookupCombo15.DisplayValues[1]<>''then
|
|
|
str_fee:=str_fee+' and c.<2E>ұ<EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
|
|
|
|
|
|
|
|
|
str_op:='';
|
|
|
if Edit4.text<>''then
|
|
|
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''';
|
|
|
|
|
|
if wwDBComboBox46.text<>''then
|
|
|
str_fee:=str_fee+' and b.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox46.text+'''';
|
|
|
|
|
|
if Edit2.text<>''then
|
|
|
str_fee:=str_fee+' and b.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
|
|
|
|
|
|
|
|
|
if DBComboBoxEh1.Text<>''then
|
|
|
str_op:=str_op+' and b.<2E><><EFBFBD><EFBFBD>Ա='+''''+DBComboBoxEh1.Text+'''';
|
|
|
|
|
|
|
|
|
if Edit3.text<>''then
|
|
|
str_fee:=str_fee+' and b.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit3.text+'%'+'''';
|
|
|
|
|
|
if Edit5.text<>''then
|
|
|
str_fee:=str_fee+' and <20><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit5.text+'%'+'''';
|
|
|
|
|
|
if Edit1.text<>''then
|
|
|
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
|
|
|
|
|
|
if wwDBLookupCombo49.text<>''then
|
|
|
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo49.text+'%'+'''';
|
|
|
if Edit7.text<>''then
|
|
|
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+Edit7.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+'''';
|
|
|
|
|
|
|
|
|
with t_dui_cust do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select distinct u.<2E><><EFBFBD><EFBFBD>, u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, u.<2E>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>');
|
|
|
SQL.Add('from t_ch_fee c');
|
|
|
if strtobool(get_parameters_value(115,'false')) then
|
|
|
SQL.Add('Left Join t_crm_client u on (u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> OR u.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)')
|
|
|
else
|
|
|
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 Tfrm_rp_dui_accepttotal.bsSkinButton38Click(Sender: TObject);
|
|
|
var
|
|
|
book1:Tbookmark;
|
|
|
begin
|
|
|
book1:=t_ch_dui.GetBookmark;
|
|
|
t_ch_dui.Requery;
|
|
|
t_ch_dui.GotoBookmark(book1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.MenuItem4Click(Sender: TObject);
|
|
|
var
|
|
|
str_list:TStringList;
|
|
|
i:integer;
|
|
|
str:String;
|
|
|
begin
|
|
|
if t_ch_dui.IsEmpty then
|
|
|
exit;
|
|
|
if t_ch_dui.State in [dsedit,dsinsert] then
|
|
|
t_ch_dui.Post;
|
|
|
if t_ch_dui.fieldbyname('DM_ID').asstring='' then
|
|
|
exit;
|
|
|
if t_ch_dui.fieldbyname('DM_ID').asstring='0' then
|
|
|
exit;
|
|
|
t_ch_dui_format.Locate('DM_ID',t_ch_dui.fieldbyname('DM_ID').asstring,[]);
|
|
|
|
|
|
str_list:=Tstringlist.create();
|
|
|
try
|
|
|
str_list.Text:=trim(t_ch_dui_format.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>').AsString);
|
|
|
for i:=0 to str_list.Count-1 do
|
|
|
begin
|
|
|
if Str='' then
|
|
|
Str:=str_list.Strings[i]
|
|
|
else
|
|
|
Str:=Str+';'+str_list.Strings[i];
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(str_list);
|
|
|
end;
|
|
|
// showmessage(str);
|
|
|
// v_dui_bill.Sort:=Str;
|
|
|
dui_gridall(t_ch_dui_format.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring,dxdbgrid2,t_ch_dui.fieldbyname('DM_ID').AsInteger,t_ch_dui_format,t_ch_dui.fieldbyname('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
dui_tableAll(t_bill_fee_dong,t_ch_dui_format.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring,v_dui_bill,v_dui_fee,t_ch_dui.fieldbyname('DM_ID').AsInteger,str,t_ch_dui);
|
|
|
sys_print('ҵ<><D2B5><EFBFBD>ۺ϶<DBBA><CFB6><EFBFBD>'+t_ch_dui.fieldbyname('DM_ID').asstring,TMenuItem(Sender).tag,t_ch_dui1,nil,nil,nil,t_bill_fee_dong1,NIL,NIL,NIL,nil,nil,nil);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.MenuItem10Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_ch_dui.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
mem_v_dui_fee.Close;
|
|
|
mem_v_dui_fee.sql.clear;
|
|
|
mem_v_dui_fee.sql.add('select * from v_dui_fee');
|
|
|
mem_v_dui_fee.sql.add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=:<3A><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD> and <20><><EFBFBD><EFBFBD>=''<27><>''');
|
|
|
mem_v_dui_fee.sql.add('order by ˳<><CBB3>,CH_ID');
|
|
|
mem_v_dui_fee.Open;
|
|
|
|
|
|
mem_v_dui_feeCr.Close;
|
|
|
mem_v_dui_feeCr.sql.clear;
|
|
|
mem_v_dui_feeCr.sql.add('select * from v_dui_fee');
|
|
|
mem_v_dui_feeCr.sql.add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>=:<3A><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD> and <20><><EFBFBD><EFBFBD>=''<27><>''');
|
|
|
mem_v_dui_feeCr.sql.add('order by ˳<><CBB3>,CH_ID');
|
|
|
mem_v_dui_feeCr.Open;
|
|
|
|
|
|
sys_print('ҵ<><D2B5><EFBFBD>ۺ϶<DBBA><CFB6><EFBFBD>',TMenuItem(Sender).tag,t_ch_dui1,nil,nil,nil,v_dui_bill1,v_dui_fee1,mem_v_dui_fee1,mem_v_dui_feeCr1,nil,nil,nil);
|
|
|
|
|
|
mem_v_dui_fee.close;
|
|
|
mem_v_dui_feeCr.close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton6Click(Sender: TObject);
|
|
|
var
|
|
|
Pnt:Tpoint;
|
|
|
begin
|
|
|
Pnt:=bsSkinButton6.ClientToScreen(Point(0,bsSkinButton6.Height));
|
|
|
PopupMenu9.Popup(Pnt.x,Pnt.y);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.dxDBGrid3Column22CustomDraw(
|
|
|
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('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>',ANode.Strings[dxDBGrid3Column22.Index]);
|
|
|
AFont.Color:=clblack;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.dxDBGrid3Column23CustomDraw(
|
|
|
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_fee(ANode.strings[dxDBGrid3Column23.Index]);
|
|
|
AFont.Color:=clblack;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton13Click(Sender: TObject);
|
|
|
var
|
|
|
str:widestring;
|
|
|
aAdoQuery,aAdoQueryFeeStatus:TAdoQuery;
|
|
|
begin
|
|
|
if not strtobool(get_parameters_value(133,'false')) then exit;
|
|
|
|
|
|
if t_ch_dui.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
if Trim(t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring)='' then
|
|
|
begin
|
|
|
ShowMessage('<27><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>Ϊ<EFBFBD><CEAA>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD><CBB7><EFBFBD>,<2C>뱣<EFBFBD><EBB1A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
Exit;
|
|
|
end;
|
|
|
|
|
|
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)<>IDOK then
|
|
|
exit;
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
aAdoQueryFeeStatus:=CreateAdoQuery;
|
|
|
with aAdoQueryFeeStatus do
|
|
|
begin
|
|
|
close;sql.clear;
|
|
|
sql.Add('select <20><><EFBFBD><EFBFBD>״̬ from t_ch_fee');
|
|
|
sql.Add('where ch_id=:ch_id');
|
|
|
end;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
close;sql.clear;
|
|
|
str:='select * from v_dui_fee'
|
|
|
+' where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+'''';
|
|
|
sql.text:=str;
|
|
|
Open;first;
|
|
|
while not eof do
|
|
|
begin
|
|
|
aAdoQueryFeeStatus.Close;
|
|
|
aAdoQueryFeeStatus.Parameters.ParamByName('ch_id').value:=fieldbyname('ch_id').AsInteger;
|
|
|
aAdoQueryFeeStatus.Open;
|
|
|
if (Trim(aAdoQueryFeeStatus.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString)='¼<><C2BC>״̬')
|
|
|
or (Trim(aAdoQueryFeeStatus.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString)='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>') then
|
|
|
begin
|
|
|
str:='update t_ch_fee set <20><><EFBFBD><EFBFBD>״̬=''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'' , <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+employee+''''+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+FormatDateTime('YYYY-MM-DD',date)+''''
|
|
|
+' where ch_id='+''''+fieldbyname('ch_id').asstring+''''
|
|
|
+' and <20><><EFBFBD><EFBFBD>״̬ in ( ''¼<><C2BC>״̬'',''<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'' ) and <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='+''''+t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
end;
|
|
|
next;
|
|
|
end;
|
|
|
finally
|
|
|
free;
|
|
|
aAdoQueryFeeStatus.Free;
|
|
|
end;
|
|
|
|
|
|
t_ch_dui.Edit;
|
|
|
t_ch_dui.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=employee;
|
|
|
t_ch_dui.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=date;
|
|
|
t_ch_dui.post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.DBComboBoxEh1DropDown(Sender: TObject);
|
|
|
var AdoQuery1:TAdoQuery;
|
|
|
begin
|
|
|
AdoQuery1:=CreateAdoQuery;
|
|
|
with AdoQuery1 do
|
|
|
try
|
|
|
AdoQuery1.Close;
|
|
|
AdoQuery1.sql.Clear;
|
|
|
AdoQuery1.SQL.Add('select * from t_sys_employee where ״̬=''<27><>ְ''');
|
|
|
AdoQuery1.Open;
|
|
|
AdoQuery1.first;
|
|
|
while not AdoQuery1.Eof do begin
|
|
|
DBComboBoxEh1.Items.Add(AdoQuery1.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
|
|
|
ADOQuery1.Next;
|
|
|
end;
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.dxDBGrid1CustomDraw(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 uppercase(ANode.Strings[dxDBGrid1Column12.Index])<>'' then begin
|
|
|
AColor:=clskyblue;
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.dxDBGrid6DblClick(Sender: TObject);
|
|
|
begin
|
|
|
fee_view(v_dui_bill1.dataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.dxDBGrid3DblClick(Sender: TObject);
|
|
|
begin
|
|
|
fee_view(t_op_seae1.dataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.dxDBGrid1Column18CustomDraw(
|
|
|
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[dxDBGrid1Column18.Index])='<27>Ѷ<EFBFBD><D1B6><EFBFBD>' then
|
|
|
AColor:=clred;
|
|
|
AFont.Color:=clblack;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.bsSkinButton14Click(Sender: TObject);
|
|
|
begin
|
|
|
if not assigned(frm_rp_op_ttl) then
|
|
|
frm_rp_op_ttl:=tfrm_rp_op_ttl.Create (self);
|
|
|
frm_rp_op_ttl.billno:=t_ch_dui.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
|
|
|
frm_rp_op_ttl.CorpName:=t_ch_dui.fieldbyname('<27><><EFBFBD>ʿͻ<CABF>').asstring;
|
|
|
frm_rp_op_ttl.show;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.N10Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid_view_no(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.N14Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid_view_all(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_accepttotal.N16Click(Sender: TObject);
|
|
|
begin
|
|
|
grid_save_xls(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
end.
|