You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

334 lines
12 KiB
Plaintext

This file contains ambiguous Unicode characters!

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

unit u_rp_fenzhang;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, DB,
ADODB, dxDBTLCl, dxGrClms, ComCtrls, bsSkinTabs, wwdblook, RxLookup,
wwdbdatetimepicker, StdCtrls, Menus, ExtCtrls, XPMenu;
type
Tfrm_rp_fenzhang = class(TForm)
p_fenzhang: TADOStoredProc;
p_fenzhang1: TDataSource;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridColumn;
dxDBGrid1Column2: TdxDBGridColumn;
dxDBGrid1Column59: TdxDBGridColumn;
dxDBGrid1DEBIT: TdxDBGridColumn;
dxDBGrid1CREDIT: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
dxDBGrid1Column4: TdxDBGridColumn;
dxDBGrid1Column5: TdxDBGridColumn;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
dxDBGrid1Column9: TdxDBGridColumn;
dxDBGrid1Column10: TdxDBGridColumn;
dxDBGrid1Column11: TdxDBGridColumn;
dxDBGrid1Column12: TdxDBGridColumn;
dxDBGrid1Column13: TdxDBGridColumn;
dxDBGrid1Column14: TdxDBGridColumn;
dxDBGrid1Column15: TdxDBGridColumn;
dxDBGrid1Column16: TdxDBGridColumn;
dxDBGrid1Column17: TdxDBGridColumn;
dxDBGrid1Column18: TdxDBGridColumn;
dxDBGrid1Column19: TdxDBGridColumn;
dxDBGrid1Column20: TdxDBGridColumn;
dxDBGrid1Column21: TdxDBGridColumn;
dxDBGrid1Column22: TdxDBGridColumn;
dxDBGrid11: TdxDBGridColumn;
dxDBGrid12: TdxDBGridColumn;
dxDBGrid13: TdxDBGridColumn;
dxDBGrid14: TdxDBGridColumn;
dxDBGrid15: TdxDBGridColumn;
dxDBGrid16: TdxDBGridColumn;
dxDBGrid17: TdxDBGridColumn;
dxDBGrid18: TdxDBGridColumn;
dxDBGrid19: TdxDBGridColumn;
dxDBGrid110: TdxDBGridColumn;
dxDBGrid111: TdxDBGridColumn;
dxDBGrid112: TdxDBGridColumn;
dxDBGrid113: TdxDBGridColumn;
dxDBGrid114: TdxDBGridColumn;
dxDBGrid115: TdxDBGridColumn;
dxDBGrid116: TdxDBGridColumn;
dxDBGrid117: TdxDBGridColumn;
dxDBGrid118: TdxDBGridColumn;
dxDBGrid119: TdxDBGridColumn;
dxDBGrid120: TdxDBGridColumn;
dxDBGrid1Column43: TdxDBGridColumn;
dxDBGrid1TEU: TdxDBGridColumn;
dxDBGrid1Column45: TdxDBGridColumn;
dxDBGrid1Column58: TdxDBGridColumn;
dxDBGrid1Column48: TdxDBGridColumn;
dxDBGrid1Column49: TdxDBGridColumn;
dxDBGrid1Column50: TdxDBGridColumn;
dxDBGrid1Column57: TdxDBGridColumn;
dxDBGrid1Column56: TdxDBGridColumn;
dxDBGrid1Column46: TdxDBGridColumn;
dxDBGrid1Column47: TdxDBGridColumn;
dxDBGrid1Column51: TdxDBGridColumn;
dxDBGrid1Column52: TdxDBGridColumn;
dxDBGrid1Column53: TdxDBGridColumn;
dxDBGrid1Column54: TdxDBGridColumn;
dxDBGrid1Column55: TdxDBGridColumn;
bsSkinTabSheet2: TbsSkinTabSheet;
p_sum_daili: TADOStoredProc;
p_sum_daili1: TDataSource;
p_sum_currency: TADOStoredProc;
p_sum_currency1: TDataSource;
dxDBGrid2: TdxDBGrid;
dxDBGrid2Column1: TdxDBGridColumn;
dxDBGrid2DEBIT: TdxDBGridColumn;
dxDBGrid2CREDIT: TdxDBGridColumn;
dxDBGrid3: TdxDBGrid;
dxDBGridColumn1: TdxDBGridColumn;
dxDBGridColumn2: TdxDBGridColumn;
dxDBGridColumn3: TdxDBGridColumn;
dxDBGrid3Column4: TdxDBGridColumn;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
Panel1: TPanel;
bsSkinPanel1: TbsSkinPanel;
Label6: TLabel;
Label1: TLabel;
Label10: TLabel;
Label5: TLabel;
Label11: TLabel;
Label8: TLabel;
Label9: TLabel;
Label23: TLabel;
Label22: TLabel;
Label124: TLabel;
Label16: TLabel;
Label14: TLabel;
Label3: TLabel;
Label2: TLabel;
Label4: TLabel;
Label7: TLabel;
Edit1: TEdit;
Edit4: TEdit;
Edit3: TEdit;
Edit2: TEdit;
wwDBDateTimePicker1: TwwDBDateTimePicker;
wwDBDateTimePicker2: TwwDBDateTimePicker;
wwDBDateTimePicker4: TwwDBDateTimePicker;
wwDBDateTimePicker3: TwwDBDateTimePicker;
RxDBLookupCombo2: TRxDBLookupCombo;
RxDBLookupCombo10: TRxDBLookupCombo;
RxDBLookupCombo12: TRxDBLookupCombo;
wwDBLookupCombo52: TwwDBLookupCombo;
RxDBLookupCombo6: TRxDBLookupCombo;
RxDBLookupCombo3: TRxDBLookupCombo;
RxDBLookupCombo1: TRxDBLookupCombo;
wwDBLookupCombo3: TwwDBLookupCombo;
bsSkinPanel2: TbsSkinPanel;
bsSkinButton10: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
XPMenu1: TXPMenu;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure N10Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_fenzhang: Tfrm_rp_fenzhang;
implementation
uses u_main, u_data_share, my_sys_function;
{$R *.dfm}
procedure Tfrm_rp_fenzhang.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption);
frm_rp_fenzhang.Hide;
frm_rp_fenzhang.ManualFloat(frm_rp_fenzhang.BoundsRect );
frm_main.freeTabs('frm_rp_fenzhang');
action:=cafree;
frm_rp_fenzhang:=nil;
end;
procedure Tfrm_rp_fenzhang.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_fenzhang.bsSkinButton6Click(Sender: TObject);
begin
Edit1.text:='';
Edit4.text:='';
Edit2.text:='';
Edit3.text:='';
wwDBDateTimePicker1.text:='';
wwDBDateTimePicker2.text:='';
wwDBDateTimePicker3.text:='';
wwDBDateTimePicker4.text:='';
RxDBLookupCombo2.ClearValue;
RxDBLookupCombo1.ClearValue;
wwDBLookupCombo52.text:='';
wwDBLookupCombo3.text:='';
RxDBLookupCombo6.ClearValue;
RxDBLookupCombo12.ClearValue;
RxDBLookupCombo3.ClearValue;
RxDBLookupCombo10.ClearValue;
end;
procedure Tfrm_rp_fenzhang.bsSkinButton10Click(Sender: TObject);
var
str:widestring;
str_fields:widestring;
begin
str_fields:='t_op_seae.<2E><><EFBFBD><EFBFBD>, t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, t_op_seae.<2E>ܴ<EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD><E1B5A5>,';
str_fields:=str_fields+'t_op_seae.<2E><><EFBFBD><EFBFBD><E1B5A5>, t_op_seae.ί<>б<EFBFBD><D0B1><EFBFBD>, t_op_seae.װ<>˷<EFBFBD>ʽ, t_op_seae.ί<>е<EFBFBD>λ, ';
str_fields:=str_fields+'t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E>ջ<EFBFBD><D5BB><EFBFBD>, t_op_seae.֪ͨ<CDA8><D6AA>, t_op_seae.<2E><>վ, t_op_seae.<2E><><EFBFBD><EFBFBD>, ';
str_fields:=str_fields+'t_op_seae.<2E><><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ';
str_fields:=str_fields+'t_op_seae.װ<><D7B0><EFBFBD><EFBFBD>, t_op_seae.ж<><D0B6><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD>, t_op_seae.<2E><>װ, t_op_seae.<2E><><EFBFBD><EFBFBD>, ';
str_fields:=str_fields+'t_op_seae.<2E><><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD>1, t_op_seae.<2E><><EFBFBD><EFBFBD>2, t_op_seae.<2E><><EFBFBD><EFBFBD>3, t_op_seae.<2E><><EFBFBD><EFBFBD>4, ';
str_fields:=str_fields+'t_op_seae.<2E><><EFBFBD><EFBFBD>5, t_op_seae.<2E><><EFBFBD><EFBFBD>6, t_op_seae.<2E><><EFBFBD><EFBFBD>7, t_op_seae.<2E><><EFBFBD><EFBFBD>8, t_op_seae.<2E><><EFBFBD><EFBFBD>9, ';
str_fields:=str_fields+'t_op_seae.<2E><><EFBFBD><EFBFBD>10,t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E><>TEU, t_op_seae.<2E><>װ<EFBFBD><D7B0>, t_op_seae.¼<><C2BC><EFBFBD><EFBFBD>, ';
str_fields:=str_fields+'t_op_seae.¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD>Ա, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E>ͷ<EFBFBD>Ա, t_op_seae.<2E><><EFBFBD><EFBFBD>, ';
str_fields:=str_fields+'t_op_seae.<2E><><EFBFBD><EFBFBD>˾, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>, ';
str_fields:=str_fields+'t_op_seae.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ, t_ch_fee_fenzhang.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_ch_fee_fenzhang.<2E>ұ<EFBFBD>';
str:=' where '+open_data('0037','t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','t_op_seae.<2E><><EFBFBD><EFBFBD>Ա','t_op_seae.<2E>ͷ<EFBFBD>Ա','t_op_seae.<2E><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
if Edit1.text<>''then
str:=str+' and t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+Edit1.text+'''';
if Edit4.text<>''then
str:=str+' and t_op_seae.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+Edit4.text+'''';
if Edit2.text<>''then
str:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+Edit2.text+'''';
if Edit3.text<>''then
str:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD><E1B5A5> like '+''''+Edit3.text+'''';
if wwDBDateTimePicker1.text<>''then
str:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
if wwDBDateTimePicker2.text<>''then
str:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
if wwDBDateTimePicker3.text<>''then
str:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker3.text+'''';
if wwDBDateTimePicker4.text<>''then
str:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker4.text+'''';
if RxDBLookupCombo2.DisplayValue<>''then
str:=str+' and t_op_seae.ί<>е<EFBFBD>λ='+''''+RxDBLookupCombo2.DisplayValues[1]+'''';
if RxDBLookupCombo1.DisplayValue<>''then
str:=str+' and t_ch_fee_fenzhang.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo1.DisplayValues[1]+'''';
if RxDBLookupCombo6.DisplayValue<>''then
str:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD>Ա='+''''+RxDBLookupCombo6.DisplayValue+'''';
if RxDBLookupCombo12.DisplayValue<>''then
str:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo12.DisplayValue+'''';
if RxDBLookupCombo3.DisplayValue<>''then
str:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo3.DisplayValue+'''';
if RxDBLookupCombo10.DisplayValue<>''then
str:=str+' and t_op_seae.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='+''''+RxDBLookupCombo10.DisplayValue+'''';
if wwDBLookupCombo52.text<>''then
str:=str+' and t_op_seae.ж<><D0B6><EFBFBD><EFBFBD> like '+''''+wwDBLookupCombo52.text+'''';
if wwDBLookupCombo3.text<>''then
str:=str+' and t_ch_fee_fenzhang.<2E>ұ<EFBFBD>='+''''+wwDBLookupCombo3.text+'''';
p_fenzhang.close;
p_fenzhang.Parameters.ParamByName('SQLStr').value:='select '
+str_fields
+', SUM(t_ch_fee_fenzhang.Ӧ<>ս<EFBFBD><D5BD><EFBFBD>) AS DEBIT,'
+'SUM(t_ch_fee_fenzhang.Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) AS CREDIT '
+'FROM t_op_seae INNER JOIN '
+'t_ch_fee_fenzhang ON '
+'t_op_seae.<2E><><EFBFBD><EFBFBD> = t_ch_fee_fenzhang.<2E><><EFBFBD><EFBFBD>'
+str
+' group by '+str_fields
+default_sort(53,'t_op_seae','','desc');
p_fenzhang.open;
p_sum_daili.close;
p_sum_daili.Parameters.ParamByName('SQLStr').value:=
'select t_ch_fee_fenzhang.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_ch_fee_fenzhang.<2E>ұ<EFBFBD>'
+', SUM(t_ch_fee_fenzhang.Ӧ<>ս<EFBFBD><D5BD><EFBFBD>) AS DEBIT,'
+'SUM(t_ch_fee_fenzhang.Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) AS CREDIT '
+'FROM t_op_seae INNER JOIN '
+'t_ch_fee_fenzhang ON '
+'t_op_seae.<2E><><EFBFBD><EFBFBD> = t_ch_fee_fenzhang.<2E><><EFBFBD><EFBFBD>'
+str
+' group by t_ch_fee_fenzhang.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_ch_fee_fenzhang.<2E>ұ<EFBFBD>'
+' order by t_ch_fee_fenzhang.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_ch_fee_fenzhang.<2E>ұ<EFBFBD>';
p_sum_daili.open;
p_sum_currency.close;
p_sum_currency.Parameters.ParamByName('SQLStr').value:=
'select t_ch_fee_fenzhang.<2E>ұ<EFBFBD>'
+', SUM(t_ch_fee_fenzhang.Ӧ<>ս<EFBFBD><D5BD><EFBFBD>) AS DEBIT,'
+'SUM(t_ch_fee_fenzhang.Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) AS CREDIT '
+'FROM t_op_seae INNER JOIN '
+'t_ch_fee_fenzhang ON '
+'t_op_seae.<2E><><EFBFBD><EFBFBD> = t_ch_fee_fenzhang.<2E><><EFBFBD><EFBFBD>'
+str
+' group by t_ch_fee_fenzhang.<2E>ұ<EFBFBD>'
+' order by t_ch_fee_fenzhang.<2E>ұ<EFBFBD>';
p_sum_currency.open;
end;
procedure Tfrm_rp_fenzhang.bsSkinButton9Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD>˴<EFBFBD><CBB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>',2,nil,nil,nil,nil,p_fenzhang1,p_sum_daili1,p_sum_currency1,nil,nil,nil,nil);
end;
procedure Tfrm_rp_fenzhang.FormShow(Sender: TObject);
begin
loadreggrid(dxdbgrid1,true,caption);
end;
procedure Tfrm_rp_fenzhang.N10Click(Sender: TObject);
begin
update_grid_view_no(dxdbgrid1);
end;
procedure Tfrm_rp_fenzhang.N14Click(Sender: TObject);
begin
update_grid_view_all(dxdbgrid1);
end;
procedure Tfrm_rp_fenzhang.N12Click(Sender: TObject);
begin
update_grid(dxdbgrid1,97);
end;
procedure Tfrm_rp_fenzhang.N16Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid1);
end;
procedure Tfrm_rp_fenzhang.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
frm_rp_fenzhang.bsSkinButton10Click(Sender);
end;
end;
end.