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.

144 lines
4.9 KiB
Plaintext

11 months ago
unit u_rp_in_fenlei;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxExEdtr, DB, ADODB, dxDBTLCl, dxGrClms, dxDBGrid, dxTL,
dxDBCtrl, dxCntner, ComCtrls, bsSkinTabs, StdCtrls, Mask, wwdbedit,
Wwdotdot, Wwdbcomb, RxLookup, wwdbdatetimepicker, bsSkinCtrls, ExtCtrls;
type
Tfrm_rp_in_fenlei = class(TForm)
Panel1: TPanel;
bsSkinPanel2: TbsSkinPanel;
Label10: TLabel;
Label5: TLabel;
Label9: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
wwDBDateTimePicker2: TwwDBDateTimePicker;
RxDBLookupCombo2: TRxDBLookupCombo;
p_shikai: TADOStoredProc;
p_daikai: TADOStoredProc;
p_daikai1: TDataSource;
p_chongxiao: TADOStoredProc;
p_chongxiao1: TDataSource;
p_shikai1: TDataSource;
bsSkinButton10: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinGroupBox1: TbsSkinGroupBox;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1USD: TdxDBGridColumn;
dxDBGrid1RMB: TdxDBGridColumn;
bsSkinGroupBox2: TbsSkinGroupBox;
dxDBGrid2: TdxDBGrid;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
dxDBGridColumn1: TdxDBGridColumn;
dxDBGridColumn2: TdxDBGridColumn;
bsSkinGroupBox3: TbsSkinGroupBox;
dxDBGrid3: TdxDBGrid;
dxDBGridMaskColumn2: TdxDBGridMaskColumn;
dxDBGridColumn3: TdxDBGridColumn;
dxDBGridColumn4: TdxDBGridColumn;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinPanel2Resize(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_in_fenlei: Tfrm_rp_in_fenlei;
implementation
uses u_main, u_data_share, my_sys_function;
{$R *.dfm}
procedure Tfrm_rp_in_fenlei.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_rp_in_fenlei.Hide;
frm_rp_in_fenlei.ManualFloat(frm_rp_in_fenlei.BoundsRect );
frm_main.freeTabs('frm_rp_in_fenlei');
action:=cafree;
frm_rp_in_fenlei:=nil;
end;
procedure Tfrm_rp_in_fenlei.bsSkinButton9Click(Sender: TObject);
begin
sys_print('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>',2,nil,nil,nil,nil,p_shikai1,p_daikai1,p_chongxiao1,nil,nil,nil,nil);
end;
procedure Tfrm_rp_in_fenlei.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_in_fenlei.bsSkinButton10Click(Sender: TObject);
var
str:widestring;
begin
str:='SELECT <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, SUM(CASE <20>ұ<EFBFBD> WHEN '+''''+'USD'+''''+' THEN <20>ϼƽ<CFBC><C6BD><EFBFBD> ELSE 0 END) '
+'AS USD<53><44><EFBFBD><EFBFBD>, SUM(CASE <20>ұ<EFBFBD> WHEN '+''''+'USD'+''''+' THEN 0 ELSE <20>ϼƽ<CFBC><C6BD><EFBFBD> END) '
+'AS RMB<4D><42><EFBFBD><EFBFBD> FROM t_ch_invoice WHERE <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> = 0 ';
if wwDBDateTimePicker1.text<>'' then
str:=str+' and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
if wwDBDateTimePicker2.text<>'' then
str:=str+' and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
if RxDBLookupCombo2.DisplayValue<>'' then
str:=str+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo2.DisplayValues[1]+'''';
str:=str+' GROUP BY <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> order by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
p_shikai.Close;
p_shikai.Parameters.ParamByName('SQLStr').value:=str;
p_shikai.open;
str:='SELECT <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, SUM(CASE <20>ұ<EFBFBD> WHEN '+''''+'USD'+''''+' THEN <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ELSE 0 END) '
+'AS USD<53><44><EFBFBD><EFBFBD>, SUM(CASE <20>ұ<EFBFBD> WHEN '+''''+'USD'+''''+' THEN 0 ELSE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> END) '
+'AS RMB<4D><42><EFBFBD><EFBFBD> FROM t_ch_invoice_shen WHERE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = '
+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ'+''''+' AND <20><><EFBFBD><EFBFBD>״̬ = '+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ'+''''+' ';
if wwDBDateTimePicker1.text<>'' then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
if wwDBDateTimePicker2.text<>'' then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
if RxDBLookupCombo2.DisplayValue<>'' then
str:=str+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo2.DisplayValues[1]+'''';
str:=str+' GROUP BY <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> order by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
p_daikai.Close;
p_daikai.Parameters.ParamByName('SQLStr').value:=str;
p_daikai.open;
str:='SELECT <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, SUM(CASE <20>ұ<EFBFBD> WHEN '+''''+'USD'+''''+' THEN <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ELSE 0 END) '
+'AS USD<53><44><EFBFBD><EFBFBD>, SUM(CASE <20>ұ<EFBFBD> WHEN '+''''+'USD'+''''+' THEN 0 ELSE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> END) '
+'AS RMB<4D><42><EFBFBD><EFBFBD> FROM t_ch_invoice_shen WHERE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = '
+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ'+''''+' AND <20><><EFBFBD><EFBFBD>״̬ = '+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ'+''''+' ';
if wwDBDateTimePicker1.text<>'' then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
if wwDBDateTimePicker2.text<>'' then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
if RxDBLookupCombo2.DisplayValue<>'' then
str:=str+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo2.DisplayValues[1]+'''';
str:=str+' GROUP BY <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> order by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
p_chongxiao.Close;
p_chongxiao.Parameters.ParamByName('SQLStr').value:=str;
p_chongxiao.open;
end;
procedure Tfrm_rp_in_fenlei.bsSkinPanel2Resize(Sender: TObject);
var
i:integer;
begin
i:=ROUND(bsSkinPanel2.Width/3);
bsSkinGroupBox1.Width:=i;
bsSkinGroupBox2.Width:=i;
end;
end.