D7FZaideng/应收应付/U_FPINVOICE_TJ.pas
DESKTOP-E401PHE\Administrator 82c6347dad ~
2025-04-30 16:21:22 +08:00

176 lines
4.5 KiB
ObjectPascal
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

unit U_FPINVOICE_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;
type
TfrmFPInvoice_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;
begdate: TDateTimePicker;
Enddate: TDateTimePicker;
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;
FactoryName: TEdit;
FactoryNameTJ: TEdit;
Label1: TLabel;
Label4: TLabel;
ToFactoryNameTJ: TEdit;
v2Column3: TcxGridDBColumn;
v2Column1: TcxGridDBColumn;
Label8: 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);
private
IsEdit:integer;
{ Private declarations }
procedure InitGrid();
public
{ Public declarations }
RKFlag,FCYID:String;
fInvoiceFlag:string;
IsHx:integer;
end;
var
frmFPInvoice_TJ: TfrmFPInvoice_TJ;
implementation
uses
U_DataLink,U_Fun,U_ZDYHelp, U_ProductOrderList, U_ProductOrderNewList,
U_ZdyAttachment, U_skHx;
{$R *.dfm}
procedure TfrmFPInvoice_TJ.InitGrid();
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Close;
SQL.Clear;
sql.Add('exec P_get_invoice ');
sql.Add('@InvoiceFlag='''+trim(fInvoiceFlag)+'''');
Open;
end;
SCreateCDS20(ADOQueryMain,CDS_HZ);
SInitCDSData20(ADOQueryMain,CDS_HZ);
finally
ADOQueryMain.EnableControls;
end;
end;
procedure TfrmFPInvoice_TJ.FormDestroy(Sender: TObject);
begin
frmFPInvoice_TJ:=nil;
end;
procedure TfrmFPInvoice_TJ.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=caFree;
end;
procedure TfrmFPInvoice_TJ.TBCloseClick(Sender: TObject);
begin
WriteCxGrid(self.Caption,Tv2,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
Close;
end;
procedure TfrmFPInvoice_TJ.FormShow(Sender: TObject);
begin
ReadCxGrid(self.Caption,Tv2,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
//Enddate.DateTime:=SGetServerDate(ADOQueryTemp);
//begdate.DateTime:=Enddate.DateTime-50;
InitGrid();
end;
procedure TfrmFPInvoice_TJ.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TfrmFPInvoice_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 TfrmFPInvoice_TJ.ToFactoryNameChange(Sender: TObject);
begin
ToolButton2.Click;
end;
procedure TfrmFPInvoice_TJ.ToolButton1Click(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then Exit;
SelExportData(Tv2,ADOQueryMain,'<27><>Ʊ<EFBFBD>б<EFBFBD>');
end;
end.