unit uBizDetallesAlbaranProveedor;

interface

uses
  uDADataTable, schAlbaranesProveedorClient_Intf, uDataTableUtils;

const
  BIZ_CLIENT_DETALLES_ALBARAN_PROVEEDOR = 'Client.DetallesAlbaran.Proveedor';


type
  IBizDetallesAlbaranProveedor = interface(IAlbaranesProveedor_Detalles)
  ['{B0D734DF-6734-4959-B200-1574E10D7673}']
  end;

  TBizDetallesAlbaranProveedor = class(TAlbaranesProveedor_DetallesDataTableRules, IBizDetallesAlbaranProveedor)
  protected
    procedure OnNewRecord(Sender: TDADataTable); override;
	procedure BeforeInsert(Sender: TDADataTable); override;
  end;

implementation

{ TBizDetallesAlbaranProveedor }

uses
	DB;

procedure TBizDetallesAlbaranProveedor.BeforeInsert(Sender: TDADataTable);
var
  AMasterTable : TDADataTable;
begin
  inherited;
  AMasterTable := DataTable.GetMasterDataTable;
  if Assigned(AMasterTable) and (AMasterTable.State = dsInsert) then
    AMasterTable.Post;
end;

procedure TBizDetallesAlbaranProveedor.OnNewRecord(Sender: TDADataTable);
begin
  inherited;
  VISIBLE := 1;
end;

initialization
  RegisterDataTableRules(BIZ_CLIENT_DETALLES_ALBARAN_PROVEEDOR, TBizDetallesAlbaranProveedor);

end.
