|
|
unit u_rp_dui_seae_accept;
|
|
|
|
|
|
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;
|
|
|
|
|
|
type
|
|
|
Tfrm_rp_dui_seae_accept = 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;
|
|
|
RxDBLookupCombo2: TRxDBLookupCombo;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
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;
|
|
|
Panel2: TPanel;
|
|
|
dxDBGrid4: TdxDBGrid;
|
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column5: TdxDBGridColumn;
|
|
|
dxDBGrid1Column3: TdxDBGridColumn;
|
|
|
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;
|
|
|
Label19: TLabel;
|
|
|
wwDBDateTimePicker7: TwwDBDateTimePicker;
|
|
|
dxDBGrid3Column19: TdxDBGridColumn;
|
|
|
dxDBGrid3Column20: TdxDBGridColumn;
|
|
|
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;
|
|
|
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;
|
|
|
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 bsSkinButton6Click(Sender: TObject);
|
|
|
procedure N5Click(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_rp_dui_seae_accept: Tfrm_rp_dui_seae_accept;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, my_sys_function, u_data_share, u_rp_dui_format, u_rp_dui_query;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.bsSkinButton8Click(Sender: TObject);
|
|
|
begin
|
|
|
RxDBLookupCombo2.ClearValue;
|
|
|
Edit4.text:='';
|
|
|
Edit3.Text:='';
|
|
|
Edit2.text:='';
|
|
|
wwDBDateTimePicker1.Clear;
|
|
|
wwDBDateTimePicker2.clear;
|
|
|
wwDBDateTimePicker3.clear;
|
|
|
wwDBDateTimePicker4.clear;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.bsSkinButton7Click(Sender: TObject);
|
|
|
var
|
|
|
str_fee,str_op:widestring;
|
|
|
begin
|
|
|
if NOT strtobool(get_parameters_value(47,'false')) then
|
|
|
begin
|
|
|
str_fee:='where (<28>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0 OR <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> IS NULL) and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str_fee:='where (<28>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>=0 OR <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> IS NULL) and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
|
|
|
end;
|
|
|
if RxDBLookupCombo2.DisplayValues[1]<>''then
|
|
|
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo2.DisplayValues[1]+'''';
|
|
|
|
|
|
str_op:='';
|
|
|
if Edit4.text<>''then
|
|
|
str_op:=str_op+' and ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''';
|
|
|
|
|
|
if Edit2.text<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
|
|
|
|
|
|
if Edit3.text<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit3.text+'%'+'''';
|
|
|
|
|
|
if wwDBDateTimePicker1.text<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
|
|
|
|
|
|
if wwDBDateTimePicker2.text<>''then
|
|
|
str_op:=str_op+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
|
|
|
|
|
|
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_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_op:='select * from t_op_seae '+str_op+default_sort(53,'t_op_seae','','desc');
|
|
|
|
|
|
str_fee:='select * 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;
|
|
|
|
|
|
t_ch_fee.sql.clear;
|
|
|
t_ch_fee.sql.add(str_fee);
|
|
|
t_ch_fee.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
frm_rp_dui_seae_accept.Hide;
|
|
|
frm_rp_dui_seae_accept.ManualFloat(frm_rp_dui_seae_accept.BoundsRect );
|
|
|
frm_main.freeTabs('frm_rp_dui_seae_accept');
|
|
|
action:=cafree;
|
|
|
frm_rp_dui_seae_accept:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.bsSkinPanel2Resize(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
i:=round(bsSkinPanel2.width/10);
|
|
|
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;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.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>']:=1;
|
|
|
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_seae_accept.t_ch_duiBeforePost(DataSet: TDataSet);
|
|
|
begin
|
|
|
table_before_post(t_ch_dui,'<27><><EFBFBD>ʿͻ<CABF>');
|
|
|
|
|
|
if t_ch_dui.State=dsinsert then
|
|
|
begin
|
|
|
t_ch_dui['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=get_no(date,'D1');
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.bsSkinButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_dui.insert;
|
|
|
Notebook1.PageIndex:=1;
|
|
|
bsSkinButton11.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.bsSkinButton2Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_ch_dui);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.bsSkinButton4Click(Sender: TObject);
|
|
|
var
|
|
|
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;
|
|
|
v_dui_bill.first;
|
|
|
while not v_dui_bill.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+'''';
|
|
|
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;
|
|
|
if t_op_seae.Active then
|
|
|
t_op_seae.Requery();
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
table_cancel(t_ch_dui);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.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_seae_accept.bsSkinButton12Click(Sender: TObject);
|
|
|
begin
|
|
|
try
|
|
|
if not assigned(frm_rp_dui_format) then
|
|
|
frm_rp_dui_format:=tfrm_rp_dui_format.Create (self);
|
|
|
dui_format_type:=1;
|
|
|
frm_rp_dui_format.showmodal;
|
|
|
finally
|
|
|
frm_rp_dui_format.free;
|
|
|
frm_rp_dui_format:=nil;
|
|
|
t_ch_dui_format.requery;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.FormShow(Sender: TObject);
|
|
|
var
|
|
|
str:widestring;
|
|
|
begin
|
|
|
t_ch_dui_format.Parameters[0].value:=1;
|
|
|
t_ch_dui_format.open;
|
|
|
str:='select top 50 * from t_ch_dui ';
|
|
|
str:=str+' where <20><><EFBFBD><EFBFBD>=1 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;
|
|
|
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;
|
|
|
Notebook1.PageIndex:=0;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.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_seae_accept.N1Click(Sender: TObject);
|
|
|
var
|
|
|
i,k:integer;
|
|
|
begin
|
|
|
if t_op_seae.IsEmpty then
|
|
|
exit;
|
|
|
if t_ch_dui.IsEmpty then
|
|
|
exit;
|
|
|
if t_ch_dui.FieldByName('<27><><EFBFBD>ʿͻ<CABF>').asstring='' 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]));
|
|
|
t_ch_fee.first;
|
|
|
while not t_ch_fee.Eof do
|
|
|
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;
|
|
|
t_ch_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_ch_fee.first;
|
|
|
while not t_ch_fee.Eof do
|
|
|
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;
|
|
|
t_ch_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
if (t_ch_dui.state=dsinsert)or(t_ch_dui.state=dsedit) then
|
|
|
t_ch_dui.Post;
|
|
|
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_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;
|
|
|
t_ch_fee.first;
|
|
|
while not t_ch_fee.Eof do
|
|
|
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;
|
|
|
t_ch_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if not t_ch_fee.IsEmpty 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;
|
|
|
t_ch_fee.first;
|
|
|
while not t_ch_fee.Eof do
|
|
|
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;
|
|
|
t_ch_fee.next;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
t_op_seae.requery;
|
|
|
v_dui_bill.requery;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.RxDBLookupCombo1Enter(Sender: TObject);
|
|
|
begin
|
|
|
if t_ch_dui_bill.IsEmpty then
|
|
|
RxDBLookupCombo1.ReadOnly:=false
|
|
|
else
|
|
|
RxDBLookupCombo1.ReadOnly:=true;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.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_seae_accept.bsSkinButton9Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_ch_dui.IsEmpty then
|
|
|
exit;
|
|
|
if t_ch_dui.fieldbyname('DM_ID').asstring='' then
|
|
|
exit;
|
|
|
if t_ch_dui.fieldbyname('DM_ID').asstring='0' then
|
|
|
exit;
|
|
|
dui_table(t_bill_fee_dong,t_ch_dui_format.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring,v_dui_bill,v_dui_fee);
|
|
|
if t_bill_fee_dong.FindField('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')<>nil then
|
|
|
t_bill_fee_dong.SortOnFields('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>Ӧ<EFBFBD>ն<EFBFBD><D5B6><EFBFBD>'+t_ch_dui.fieldbyname('DM_ID').asstring,2,t_ch_dui1,nil,nil,nil,t_bill_fee_dong1,NIL,NIL,NIL,nil,nil,nil);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.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:=1;
|
|
|
frm_rp_dui_query.showmodal;
|
|
|
finally
|
|
|
frm_rp_dui_query.free;
|
|
|
frm_rp_dui_query:=nil;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.bsSkinButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_ch_dui.IsEmpty then
|
|
|
exit;
|
|
|
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>Ӧ<EFBFBD>ն<EFBFBD><D5B6><EFBFBD>',2,t_ch_dui1,nil,nil,nil,v_dui_bill1,v_dui_fee1,NIL,NIL,nil,nil,nil);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_seae_accept.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;
|
|
|
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;
|
|
|
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;
|
|
|
|
|
|
end.
|