190 lines
5.0 KiB
ObjectPascal
190 lines
5.0 KiB
ObjectPascal
![]() |
unit U_XXFPINVOICE_TJ;
|
|||
|
|
|||
|
interface
|
|||
|
|
|||
|
uses
|
|||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
|||
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, StdCtrls,
|
|||
|
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
|||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
|||
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
|||
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
|||
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
|||
|
IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit,
|
|||
|
cxTextEdit, Clipbrd, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
|
|||
|
DateUtils;
|
|||
|
|
|||
|
type
|
|||
|
TfrmXXFPInvoice_TJ = class(TForm)
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBRafresh: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
ADOQueryTemp: TADOQuery;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
Panel1: TPanel;
|
|||
|
ToolButton2: TToolButton;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
RM1: TRMGridReport;
|
|||
|
RMDB_Main: TRMDBDataSet;
|
|||
|
Label3: TLabel;
|
|||
|
ToFactoryName: TEdit;
|
|||
|
cxGrid2: TcxGrid;
|
|||
|
Tv2: TcxGridDBTableView;
|
|||
|
cxGridLevel1: TcxGridLevel;
|
|||
|
Label2: TLabel;
|
|||
|
Label6: TLabel;
|
|||
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
DS_HZ: TDataSource;
|
|||
|
CDS_HZ: TClientDataSet;
|
|||
|
VBBMoney: TcxGridDBColumn;
|
|||
|
v2FPMoney: TcxGridDBColumn;
|
|||
|
v2WFPMoney: TcxGridDBColumn;
|
|||
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
cxStyle1: TcxStyle;
|
|||
|
cxStyle2: TcxStyle;
|
|||
|
cxStyle_gridRow: TcxStyle;
|
|||
|
cxStyle_gridFoot: TcxStyle;
|
|||
|
cxStyle_gridHead: TcxStyle;
|
|||
|
cxStyle_gridGroupBox: TcxStyle;
|
|||
|
cxStyle_yellow: TcxStyle;
|
|||
|
cxStyle_Red: TcxStyle;
|
|||
|
cxStyle_fontBlack: TcxStyle;
|
|||
|
cxStyle_fontclFuchsia: TcxStyle;
|
|||
|
cxStyle_fontclPurple: TcxStyle;
|
|||
|
cxStyle_fontclGreen: TcxStyle;
|
|||
|
cxStyle_fontclBlue: TcxStyle;
|
|||
|
cxStyle_fontclTeal: TcxStyle;
|
|||
|
cxStyle_fontclOlive: TcxStyle;
|
|||
|
Label5: TLabel;
|
|||
|
BBMoney: TEdit;
|
|||
|
Label7: TLabel;
|
|||
|
v2FactoryName: TcxGridDBColumn;
|
|||
|
FactoryNameTJ: TEdit;
|
|||
|
Label1: TLabel;
|
|||
|
Label4: TLabel;
|
|||
|
ToFactoryNameTJ: TEdit;
|
|||
|
v2Column3: TcxGridDBColumn;
|
|||
|
v2Column1: TcxGridDBColumn;
|
|||
|
v2Column2: TcxGridDBColumn;
|
|||
|
cxStyle3: TcxStyle;
|
|||
|
Label8: TLabel;
|
|||
|
Label9: TLabel;
|
|||
|
Enddate: TDateTimePicker;
|
|||
|
FactoryName: TEdit;
|
|||
|
begdate: TDateTimePicker;
|
|||
|
Label10: TLabel;
|
|||
|
procedure FormDestroy(Sender: TObject);
|
|||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
procedure FormShow(Sender: TObject);
|
|||
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
procedure ToFactoryNameChange(Sender: TObject);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
procedure Tv2DblClick(Sender: TObject);
|
|||
|
private
|
|||
|
IsEdit: integer;
|
|||
|
{ Private declarations }
|
|||
|
procedure InitGrid();
|
|||
|
|
|||
|
public
|
|||
|
{ Public declarations }
|
|||
|
RKFlag, FCYID: string;
|
|||
|
fInvoiceFlag: string;
|
|||
|
IsHx: integer;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmXXFPInvoice_TJ: TfrmXXFPInvoice_TJ;
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
uses
|
|||
|
U_DataLink, U_Fun10;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
|
|||
|
procedure TfrmXXFPInvoice_TJ.InitGrid();
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('exec P_Get_XXinvoice ');
|
|||
|
sql.Add('@begDate=''' + trim(formatdateTime('yyyy-MM-dd', begdate.DateTime)) + '''');
|
|||
|
sql.Add(',@EndDate=''' + trim(formatdateTime('yyyy-MM-dd', enddate.DateTime + 1)) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_HZ);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_HZ);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmXXFPInvoice_TJ.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
frmXXFPInvoice_TJ := nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmXXFPInvoice_TJ.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
begin
|
|||
|
Action := caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmXXFPInvoice_TJ.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
WriteCxGrid(self.Caption, Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
Close;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmXXFPInvoice_TJ.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
ReadCxGrid(self.Caption, Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
Enddate.DateTime := SGetServerDate(ADOQueryTemp);
|
|||
|
begdate.DateTime := StartOfTheMonth(Now);
|
|||
|
//begdate.DateTime:=Enddate.DateTime-50;
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmXXFPInvoice_TJ.TBRafreshClick(Sender: TObject);
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmXXFPInvoice_TJ.ToolButton2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.Active then
|
|||
|
begin
|
|||
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_HZ);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_HZ);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmXXFPInvoice_TJ.ToFactoryNameChange(Sender: TObject);
|
|||
|
begin
|
|||
|
ToolButton2.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmXXFPInvoice_TJ.ToolButton1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.IsEmpty then
|
|||
|
Exit;
|
|||
|
TcxGridToExcel(self.Caption, cxgrid2);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmXXFPInvoice_TJ.Tv2DblClick(Sender: TObject);
|
|||
|
begin
|
|||
|
Clipboard.SetTextBuf(PChar(Trim(CDS_HZ.fieldbyname(TV2.Controller.FocusedColumn.DataBinding.FilterFieldName).AsString)));
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|