This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
LuisLeon_FactuGES/Source/Modulos/Formas de pago/Model/uBizFormasPagoPlazos.pas

69 lines
1.5 KiB
ObjectPascal

unit uBizFormasPagoPlazos;
interface
uses
uDAInterfaces, uDADataTable, schFormasPagoClient_Intf;
const
BIZ_CLIENT_FORMAPAGOPLAZOS = 'Client.FormaPagoPlazos';
type
IBizFormaPagoPlazos = interface(IFormasPagoPlazos)
['{F90A56C5-F63E-4501-8855-B3967CF15A8A}']
function EsNuevo : Boolean;
end;
TBizFormasPagoPlazos = class(TFormasPagoPlazosDataTableRules, IBizFormaPagoPlazos)
protected
procedure OnNewRecord(Sender: TDADataTable); override;
procedure BeforeInsert(Sender: TDADataTable); override;
public
procedure IniciarValoresPlazoNuevo;
function EsNuevo : Boolean;
end;
implementation
{ TBizFormasPagoPlazos }
uses
Dialogs, DB;
procedure TBizFormasPagoPlazos.BeforeInsert(Sender: TDADataTable);
{var
AMasterTable : TDADataTable;}
begin
inherited;
//En este caso no se debe hacer porque falla el maestro-detalle al añadir los plazos de una nueva forma de pago desde una factura
// AMasterTable := DataTable.GetMasterDataTable;
// if Assigned(AMasterTable) and (AMasterTable.State = dsInsert) then
// AMasterTable.Post;
end;
function TBizFormasPagoPlazos.EsNuevo: Boolean;
begin
Result := (ID < 0);
end;
procedure TBizFormasPagoPlazos.IniciarValoresPlazoNuevo;
begin
//
end;
procedure TBizFormasPagoPlazos.OnNewRecord(Sender: TDADataTable);
begin
inherited;
ID := GetRecNo; // -1, -2, -3...
IniciarValoresPlazoNuevo
end;
initialization
RegisterDataTableRules(BIZ_CLIENT_FORMAPAGOPLAZOS, TBizFormasPagoPlazos);
finalization
end.