⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uremoveinputrep.pas

📁 天涯進銷存系統
💻 PAS
字号:
unit uRemoveInPutRep;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ActnList, LBCtrls, ExtCtrls, StdCtrls, FR_DSet, FR_DBSet,
  FR_Class, DB, DBClient, SimpleDS, LBDBScrollBar, Grids, LBDBGrid;

type
  TfrmRemoveInPutRep = class(TForm)
    Panel7: TPanel;
    Image2: TImage;
    Shape22: TShape;
    Shape23: TShape;
    Shape24: TShape;
    Shape25: TShape;
    LBSpeecButton1: TLBSpeecButton;
    LBSpeecButton3: TLBSpeecButton;
    ActionList1: TActionList;
    Action2: TAction;
    Action1: TAction;
    Panel3: TPanel;
    Label1: TLabel;
    Panel4: TPanel;
    Panel10: TPanel;
    Panel1: TPanel;
    Panel2: TPanel;
    Shape2: TShape;
    Shape3: TShape;
    Shape5: TShape;
    LBDBGrid1: TLBDBGrid;
    Panel5: TPanel;
    Panel6: TPanel;
    Panel8: TPanel;
    Panel13: TPanel;
    LBDBScrollBar1: TLBDBScrollBar;
    OpenView: TPanel;
    Image1: TImage;
    SelectInfoDs: TDataSource;
    Report: TfrReport;
    ReportDataSet: TfrDBDataSet;
    Label4: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label19: TLabel;
    Label20: TLabel;
    Label12: TLabel;
    SelectInfoData: TSimpleDataSet;
    SelectInfoDataPARTNAME: TStringField;
    SelectInfoDataQUANTITY: TBCDField;
    SelectInfoDataPRICE: TBCDField;
    SelectInfoDataCESS: TBCDField;
    SelectInfoDataAGIO: TBCDField;
    SelectInfoDataTOTALSUM: TBCDField;
    SelectInfoDataBILLCODE: TStringField;
    SelectInfoDataPROVIDERNAME: TStringField;
    Label8: TLabel;
    Label11: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    procedure FormShow(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Action1Execute(Sender: TObject);
    procedure Action2Execute(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    procedure GetSum;
  public
    { Public declarations }
  end;

var
  frmRemoveInPutRep: TfrmRemoveInPutRep;
  SelectSh :TShape;
  SType: integer;

const
  sql='SELECT A.PARTNAME, A.QUANTITY, A.PRICE, A.CESS, A.AGIO, A.TOTALSUM,'+
      'B.BILLCODE,'+
      'B.PROVIDERNAME FROM  PARTSINPUTBODY A, PARTSINPUTHAND B WHERE '+
      'A.BILLCODE=B.BILLCODE AND INPUTTYPE='''+'4'''+' AND B.ISAUDITING='''+'1''';

implementation

uses uPublicvar, uMain, uDataMo, Tools;

{$R *.dfm}

procedure TfrmRemoveInPutRep.GetSum;
var
  Sum1, Sum2: Double;
  s: string;
begin
  dmData.ExistData.Data:=SelectInfoData.Data;
  with dmData.ExistData do
  begin
    while not Eof do
    begin
      Sum1:=Sum1+Fieldbyname('QUANTITY').asfloat;
      Sum2:=Sum2+Fieldbyname('TOTALSUM').asfloat;
      Next;
    end;
    Data:=NULL;
  end;
  Label13.Caption:=FloatToStr(Sum1);
  s:=FloatToStr(Sum2);
  Label14.Caption:=Addradixpoint(S, 2);
end;

procedure TfrmRemoveInPutRep.FormShow(Sender: TObject);
begin
  Action2Execute(Sender);
end;

procedure TfrmRemoveInPutRep.FormActivate(Sender: TObject);
begin
  GetWindowsItem(Caption, Self);
end;

procedure TfrmRemoveInPutRep.FormDestroy(Sender: TObject);
begin
  WindowItem.Delete(WindowItem.IndexOfObject(Self));
  SelectInfoData.Close;
end;

procedure TfrmRemoveInPutRep.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  Action:=caFree;
  frmRemoveInPutRep:=Nil;
end;

procedure TfrmRemoveInPutRep.Action1Execute(Sender: TObject);
begin
  PrintView('RepRemoveInPutRep.frf', Report);
end;

procedure TfrmRemoveInPutRep.Action2Execute(Sender: TObject);
begin
  SelectBillType:=6;
  SelectBillinfo;
  if SelectSql<>'' then
  begin
    OpenData(Sql+SelectSql+' Order By B.BillCode Desc', SelectInfoData);
    GetSum;
  end;  
end;

procedure TfrmRemoveInPutRep.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key=27 then Close;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -