📄 prceceipt.pas
字号:
unit PRceceipt;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Unitmb, Grids, DBGridEh, StdCtrls, Buttons, ComCtrls, ExtCtrls, ToolWin;
type
TPRceceiptForm = class(TmbForm)
procedure cmdPriorClick(Sender: TObject);
procedure cmdSaveClick(Sender: TObject);
procedure cbIdExit(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
PRceceiptForm: TPRceceiptForm;
implementation
uses datamodule1;
{$R *.DFM}
procedure TPRceceiptForm.cmdPriorClick(Sender: TObject);
begin
inherited;
with datamodule2 do
if GetPrior('P_receipt',nBillId) then
begin
nBillId:=adoquery1.fieldbyname('billId').asinteger;
if setDetail.active then setdetail.close;
setDetail.commandtext:='select o.*,s.name from P_receiptD o,store s where o.billid= :billid and o.barcode=s.barcode';
setdetail.parameters[0].value:=nBillId;
setDetail.open;
end;
end;
procedure TPRceceiptForm.cmdSaveClick(Sender: TObject);
begin
inherited;
with datamodule2 do
begin
setDetail.updatebatch;
InsertPReceipt(nBillid,edtBillDate.date,'Comp','sUsrName','mktUsr','wUsr','sWhid');
end;
end;
procedure TPRceceiptForm.cbIdExit(Sender: TObject);
begin
inherited;
with datamodule2 do
begin
nBillId:=GetBillId('NEW');
if setDetail.active then setdetail.close;
setDetail.commandtext:='select o.*,s.name from P_receiptD o,store s where o.billid= :billid and o.barcode=s.barcode';
setdetail.parameters[0].value:=nBillId;
setDetail.open;
nId:=1;
end;
end;
procedure TPRceceiptForm.FormShow(Sender: TObject);
begin
inherited;
with datamodule2 do
begin
nBillId:=8888888;
if setDetail.active then setdetail.close;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -