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

📄 mc_yjsgl.~pas

📁 腾龙餐饮管理软件
💻 ~PAS
字号:
unit MC_YJSGL;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, Buttons, Db, DBTables, Qrctrls, QuickRpt;

type
  TYJSGL = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Bevel1: TBevel;
    BitBtn3: TBitBtn;
    Image1: TImage;
    Label3: TLabel;
    Query1: TQuery;
    Query1BDEDesigner: TIntegerField;
    Query1BDEDesigner2: TIntegerField;
    Query1BDEDesigner3: TDateTimeField;
    Query1BDEDesigner4: TFloatField;
    Query1BDEDesigner5: TStringField;
    Query1BDEDesigner6: TStringField;
    Query1BDEDesigner7: TStringField;
    QuickRep1: TQuickRep;
    PageHeaderBand1: TQRBand;
    QRLabel1: TQRLabel;
    QRLabel10: TQRLabel;
    QRShape14: TQRShape;
    TitleBand1: TQRBand;
    QRShape1: TQRShape;
    QRLabel2: TQRLabel;
    QRLabel3: TQRLabel;
    QRLabel4: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel6: TQRLabel;
    QRLabel7: TQRLabel;
    QRShape2: TQRShape;
    QRShape3: TQRShape;
    QRShape4: TQRShape;
    QRShape5: TQRShape;
    QRShape6: TQRShape;
    QRShape15: TQRShape;
    QRLabel11: TQRLabel;
    DetailBand1: TQRBand;
    QRShape7: TQRShape;
    QRShape8: TQRShape;
    QRShape9: TQRShape;
    QRShape10: TQRShape;
    QRShape11: TQRShape;
    QRShape12: TQRShape;
    QRDBText1: TQRDBText;
    QRDBText2: TQRDBText;
    QRDBText3: TQRDBText;
    QRDBText4: TQRDBText;
    QRDBText5: TQRDBText;
    QRDBText6: TQRDBText;
    QRShape17: TQRShape;
    QRDBText7: TQRDBText;
    Query2: TQuery;
    SummaryBand1: TQRBand;
    QRShape13: TQRShape;
    QRLabel8: TQRLabel;
    QRLabel9: TQRLabel;
    QRExpr1: TQRExpr;
    QRLabel12: TQRLabel;
    QRExpr2: TQRExpr;
    QRSysData1: TQRSysData;
    QRLabel13: TQRLabel;
    QRLabel14: TQRLabel;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure QuickRep1Preview(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  YJSGL: TYJSGL;

implementation

uses MC_DYYLBrose;

{$R *.DFM}


procedure TYJSGL.FormShow(Sender: TObject);
begin
 ANimateWindow(handle,300,AW_SLIDE+AW_VER_NEGATIVE);
 YJSGL.Refresh;
 Panel1.Refresh;
 Bevel1.Refresh;
 Image1.Refresh;
end;
//报表打印
procedure TYJSGL.QuickRep1Preview(Sender: TObject);
begin
 DYYLBrose.QRPreview1.QRPrinter:=QuickRep1.QRPrinter;
end;

//打印本月结算数据
procedure TYJSGL.BitBtn2Click(Sender: TObject);
begin
 DYYLBrose.Show;
 QuickRep1.Preview;
end;
//系统初始化
procedure TYJSGL.FormCreate(Sender: TObject);
begin
 Query1.Open;
 If Query1.RecordCount = 0 Then
 begin
  BitBtn1.Enabled:=False;
  BitBtn2.Enabled:=False;
 end;
end;
//开始结算本月数据
procedure TYJSGL.BitBtn1Click(Sender: TObject);
var a,c:Real;
b:Integer;
begin
 if MessageDLg('确认结算本月数据吗?',mtCustom,[mbYes,mbNO],0)=mrYes then
 begin
  Query2.Close;
  Query2.SQL.Clear;
  Query2.SQL.Add('Select Sum(费用) From 月结算费用信息表 Where 结款方式<>''免单'''); //计算合计总费用
  Query2.Open;
  a:=Query2.Fields[0].AsFLoat;   //总费用
  Query2.Close;
  Query2.SQL.Clear;
  Query2.SQL.Add('select 资金,编号 from 公司资金表 order by 编号 ASC');  //选择资金、编号
  Query2.Open;
  Query2.Last;
  b:=Query2.FieldByName('编号').AsInteger;
  C:=Query2.FieldByName('资金').AsFloat;
  Query2.Close;
  Query2.SQL.Clear;
  Query2.SQl.Add('Insert 公司资金表(编号,更新日期,资金,更新说明)Values(:A,:B,:C,:D)');
  If Length(intToStr(b)) = 0 Then   //如果编号为空
   begin
    Query2.Params[0].AsInteger:=1; //编号为1
    Query2.Params[2].AsFloat:=A;  //资金为月结总费用
   End
  Else    //如果编号不为空
   begin
    Query2.Params[0].AsInteger:=b+1; //最后记录编号加1
    Query2.Params[2].AsFloat:=C+A;   //最后记录资金加总费用
   end;
  Query2.Params[1].AsDateTime:=Date;  //更新日期为系统日期
  Query2.Params[3].AsString:='月结算时系统自动录入'; //更新说明为月结自动录入
  Query2.ExecSQL;
  Query2.Close;
  Query2.SQL.Clear;
  Query2.SQL.Add('insert 点菜历史信息表(房间台号,类别,编号,名称,类型,单位,数量,价格,合计,服务员编号,服务员姓名,状态,点单日期,结单日期,结帐编号,是否结单)');
  Query2.SQL.Add('Select 房间台号,类别,编号,名称,类型,单位,数量,价格,合计,服务员编号,服务员姓名,状态,点单日期,结单日期,结帐编号,是否结单');
  Query2.SQl.Add('From 月点菜信息表');
  Query2.SQL.Add('Where 是否结单=''是''');
  Query2.ExecSQL;   //将月点菜信息保存到点菜历史系信息表
  Query2.Close;
  Query2.SQL.Clear;
  Query2.SQL.Add('Delete 月点菜信息表');  //删除月点菜信息
  Query2.ExecSQL;
  Query2.Close;
  Query2.SQL.Clear;
  Query2.SQL.Add('insert 结款费用历史信息表(结帐编号,房间台号,日期,费用,结款人,结款方式,结款说明)');
  Query2.SQL.Add('Select 结帐编号,房间台号,日期,费用,结款人,结款方式,结款说明');
  Query2.SQL.Add('From 月结算费用信息表');
  Query2.ExecSQL;    //将月结算费用信息表信息保存到结款费用历史信息表
  Query2.Close;
  Query2.SQL.Clear;
  Query2.SQL.Add('Delete 月结算费用信息表');   //删除月结算费用信息
  Query2.ExecSQL;
  ShowMessage('结算完毕!!');
  Close;
 end;
end;
procedure TYJSGL.FormClose(Sender: TObject; var Action: TCloseAction);
begin
 ANimateWindow(handle,300,AW_SLIDE+AW_HIDE+AW_VER_POSITIVE);
 YJSGL.Release;    //释放
 YJSGL:=Nil;
end;
//关闭系统
procedure TYJSGL.BitBtn3Click(Sender: TObject);
begin
 Close;     //退出月结算管理
end;

end.

⌨️ 快捷键说明

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