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.

316 lines
8.9 KiB
Plaintext

11 months ago
unit u_rp_no_accept;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, dxExEdtr, dxDBGrid, dxDBTLCl, dxGrClms, dxTL,
dxDBCtrl, dxCntner, ComCtrls, bsSkinTabs, bsSkinCtrls, ADODB, DB,DateUtils,
StdCtrls, XPMenu, Menus, kbmMemTable, kbmMemBinaryStreamFormat;
type
Tfrm_rp_no_accept = class(TForm)
Panel1: TPanel;
bsSkinPanel2: TbsSkinPanel;
bsSkinButton10: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
dxDBGrid1: TdxDBGrid;
p_accept_bill: TADOStoredProc;
p_accept_bill1: TDataSource;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column11: TdxDBGridMaskColumn;
dxDBGrid1Column12: TdxDBGridDateColumn;
dxDBGrid1Column13: TdxDBGridMaskColumn;
dxDBGrid1Column14: TdxDBGridMaskColumn;
dxDBGrid1Column15: TdxDBGridMaskColumn;
dxDBGrid1Column16: TdxDBGridMaskColumn;
dxDBGrid1Column18: TdxDBGridMaskColumn;
dxDBGrid1Column19: TdxDBGridMaskColumn;
dxDBGrid1Column20: TdxDBGridMaskColumn;
dxDBGrid1Column21: TdxDBGridMaskColumn;
dxDBGrid1Column22: TdxDBGridDateColumn;
dxDBGrid1Column23: TdxDBGridMaskColumn;
dxDBGrid1Column24: TdxDBGridMaskColumn;
dxDBGrid1Column25: TdxDBGridMaskColumn;
dxDBGrid1Column26: TdxDBGridMaskColumn;
dxDBGrid1Column27: TdxDBGridMaskColumn;
dxDBGrid11: TdxDBGridMaskColumn;
dxDBGrid12: TdxDBGridMaskColumn;
dxDBGrid13: TdxDBGridMaskColumn;
dxDBGrid14: TdxDBGridMaskColumn;
dxDBGrid15: TdxDBGridMaskColumn;
dxDBGrid16: TdxDBGridMaskColumn;
dxDBGrid17: TdxDBGridMaskColumn;
dxDBGrid18: TdxDBGridMaskColumn;
dxDBGrid19: TdxDBGridMaskColumn;
dxDBGrid110: TdxDBGridMaskColumn;
dxDBGrid1Column50: TdxDBGridMaskColumn;
dxDBGrid1TEU: TdxDBGridMaskColumn;
dxDBGrid1Column52: TdxDBGridMaskColumn;
dxDBGrid1Column53: TdxDBGridMaskColumn;
dxDBGrid1Column54: TdxDBGridMaskColumn;
dxDBGrid1Column55: TdxDBGridMaskColumn;
dxDBGrid1Column56: TdxDBGridMaskColumn;
dxDBGrid1Column57: TdxDBGridMaskColumn;
dxDBGrid1Column58: TdxDBGridMaskColumn;
dxDBGrid1Column59: TdxDBGridMaskColumn;
dxDBGrid1Column60: TdxDBGridMaskColumn;
dxDBGrid1USD: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
dxDBGrid1Column4: TdxDBGridColumn;
dxDBGrid1RMB: TdxDBGridColumn;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
dxDBGrid1Column9: TdxDBGridColumn;
dxDBGrid1Column10: TdxDBGridColumn;
dxDBGrid1Column28: TdxDBGridColumn;
dxDBGrid1Column29: TdxDBGridColumn;
SaveDialog: TSaveDialog;
dxDBGrid1Column61: TdxDBGridColumn;
dxDBGrid1Column62: TdxDBGridColumn;
dxDBGrid1Column63: TdxDBGridColumn;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
XPMenu1: TXPMenu;
dxDBGrid1Column65: TdxDBGridColumn;
dxDBGrid1Column66: TdxDBGridColumn;
dxDBGrid1Column67: TdxDBGridColumn;
dxDBGrid1Column68: TdxDBGridColumn;
dxDBGrid1Column69: TdxDBGridColumn;
dxDBGrid1Column70: TdxDBGridColumn;
dxDBGrid1Column71: TdxDBGridColumn;
dxDBGrid1Column72: TdxDBGridColumn;
dxDBGrid1Column73: TdxDBGridColumn;
memtblrpt_total: TkbmMemTable;
memtblrpt_total1: TDataSource;
kbmBinaryStreamFormat1: TkbmBinaryStreamFormat;
kbmThreadDataSet1: TkbmThreadDataSet;
procedure bsSkinButton5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure N10Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure dxDBGrid1DblClick(Sender: TObject);
procedure dxDBGrid1Column66CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean;
var ADone: Boolean);
private
procedure GetNoFee;
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_no_accept: Tfrm_rp_no_accept;
implementation
uses u_main, my_sys_function,u_data_share, u_rp_seae_query,
u_rp_total_query, u_sys_progress;
{$R *.dfm}
procedure Tfrm_rp_no_accept.GetNoFee;
var
aQuery,aQuery2:TAdoQuery;
sumbal:Double;
hvcg:Boolean;
aYear,aMonth,aDay,bDay:word;
begin
if not p_accept_bill.Active then Exit;
if p_accept_bill.IsEmpty then Exit;
memtblrpt_total.DisableControls;
memtblrpt_total.LoadFromDataSet(p_accept_bill,[mtcpostructure,mtcpoProperties,mtcpoFieldIndex]);
p_accept_bill.Close;
aQuery:=CreateAdoQuery;
aQuery2:=CreateAdoQuery;
try
if memtblrpt_total.IsEmpty then exit;
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(application);
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.MaxValue:=memtblrpt_total.RecordCount;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.Update;
memtblrpt_total.First;
with memtblrpt_total do begin
while not eof do begin
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
edit;
if memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger>0 then
memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=MonthsBetween(memtblrpt_total.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime,now)
else
memtblrpt_total.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=0;
post;
next;
end;
end;
memtblrpt_total.SortOn('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',[]);
finally
freeAndNil(aQuery);
freeAndNil(aQuery2);
freeAndNil(frm_sys_progress);
memtblrpt_total.EnableControls;
end;
end;
procedure Tfrm_rp_no_accept.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_no_accept.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption+'1');
frm_rp_no_accept.Hide;
frm_rp_no_accept.ManualFloat(frm_rp_no_accept.BoundsRect );
frm_main.freeTabs('frm_rp_no_accept');
action:=cafree;
frm_rp_no_accept:=nil;
end;
procedure Tfrm_rp_no_accept.bsSkinButton1Click(Sender: TObject);
begin
with SaveDialog do
begin
DefaultExt :='xls';
Filter := '(*.xls)|*.xls';
if Execute then
begin
if bsSkinTabSheet1.Showing then
dxDBGrid1.SaveToXLS(FileName,true);
end;
end;
end;
procedure Tfrm_rp_no_accept.FormShow(Sender: TObject);
begin
loadreggrid(dxdbgrid1,true,caption+'1');
end;
procedure Tfrm_rp_no_accept.bsSkinButton9Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>',2,nil,nil,nil,nil,p_accept_bill1,nil,nil,nil,nil,nil,nil);
end;
procedure Tfrm_rp_no_accept.bsSkinButton10Click(Sender: TObject);
begin
try
frm_rp_total_query:=tfrm_rp_total_query.Create (self);
rp_seae_query_type:=3;
rp_seae_query_limited:='0033';
rp_seae_query_num:=3;
rp_seae_query_str:='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>Ƿ<EFBFBD><C7B7>';
frm_rp_total_query.ShowModal;
finally
frm_rp_total_query.Free;
end;
GetNoFee;
end;
procedure Tfrm_rp_no_accept.N10Click(Sender: TObject);
begin
if bsSkinTabSheet1.showing then
begin
update_grid_view_no(dxdbgrid1);
exit;
end;
end;
procedure Tfrm_rp_no_accept.N14Click(Sender: TObject);
begin
if bsSkinTabSheet1.showing then
begin
update_grid_view_all(dxdbgrid1);
exit;
end;
end;
procedure Tfrm_rp_no_accept.N12Click(Sender: TObject);
begin
if bsSkinTabSheet1.showing then
begin
update_grid(dxdbgrid1,16);
exit;
end;
end;
procedure Tfrm_rp_no_accept.N16Click(Sender: TObject);
begin
if bsSkinTabSheet1.showing then
begin
grid_save_xls(dxdbgrid1);
exit;
end;
end;
procedure Tfrm_rp_no_accept.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_pro(Column,p_accept_bill,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_rp_no_accept.dxDBGrid1DblClick(Sender: TObject);
begin
fee_view(p_accept_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfrm_rp_no_accept.dxDBGrid1Column66CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
var
S:String;
begin
S:=ANode.strings[dxDBGrid1Column66.Index];
if Strtointdef(s,0)>0 then
AColor:=clred
else
AColor:=clWhite;
end;
end.