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/Contactos/Model/uBizContactos.pas

775 lines
26 KiB
ObjectPascal

unit uBizContactos;
interface
uses
uDAInterfaces, uDADataTable,
schContactosClient_Intf, uBizContactosDatosBancarios, uBizCategoriasContacto,
uDBSelectionListUtils, uBizDireccionesContacto, uBizAgentesComisiones,
uBizClientesDescuentos;
const
BIZ_CLIENT_CONTACTO = 'Client.Contacto';
BIZ_CLIENT_CLIENTE = 'Client.Cliente';
BIZ_CLIENT_PROVEEDOR = 'Client.Proveedor';
BIZ_CLIENT_AGENTE = 'Client.Agente';
CATEGORIA_CLIENTE = 1;
CATEGORIA_PROVEEDOR = 2;
CATEGORIA_AGENTE = 3;
PROVEEDOR_REGIMEN_IVA = 'General';
CLIENTE_REGIMEN_IVA = 'General';
CLIENTE_DIAS_VENCIMIENTO = 5;
CLIENTE_RECARGO_EQUIVALENCIA = 0;
type
IBizContacto = interface (IContactos)
['{CD585680-26B6-47A4-B684-89C468670F4A}']
procedure SetDatosBancarios(AValue : IBizContactosDatosBancarios);
function GetDatosBancarios : IBizContactosDatosBancarios;
property DatosBancarios : IBizContactosDatosBancarios read GetDatosBancarios
write SetDatosBancarios;
function GetCategoria : String;
property Categoria : String read GetCategoria;
function _GetCategorias: IBizCategoriasContacto;
procedure _SetCategorias(const Value: IBizCategoriasContacto);
property _Categorias : IBizCategoriasContacto read _GetCategorias
write _SetCategorias;
function GetDirecciones: IBizDireccionesContacto;
procedure SetDirecciones(const Value: IBizDireccionesContacto);
property Direcciones : IBizDireccionesContacto read GetDirecciones
write SetDirecciones;
function EsNuevo : Boolean;
end;
IBizCliente = interface (IBizContacto)
['{EA48A6AA-AC96-4AD9-B383-F2FD4552EE76}']
function GetID_AGENTEValue: Integer;
procedure SetID_AGENTEValue(const aValue: Integer);
function GetGRUPO_CLIENTEValue: String;
procedure SetGRUPO_CLIENTEValue(const aValue: String);
function GetNOMBRE_COMERCIALValue: String;
procedure SetNOMBRE_COMERCIALValue(const aValue: String);
function GetVENCIMIENTO_FACTURAS_1Value: SmallInt;
procedure SetVENCIMIENTO_FACTURAS_1Value(const aValue: SmallInt);
function GetVENCIMIENTO_FACTURAS_2Value: SmallInt;
procedure SetVENCIMIENTO_FACTURAS_2Value(const aValue: SmallInt);
function GetVENCIMIENTO_FACTURAS_3Value: SmallInt;
procedure SetVENCIMIENTO_FACTURAS_3Value(const aValue: SmallInt);
function GetBLOQUEADOValue: Integer;
procedure SetBLOQUEADOValue(const aValue: Integer);
function GetRAPELValue: Integer;
procedure SetRAPELValue(const aValue: Integer);
function GetMOTIVO_BLOQUEOValue: String;
procedure SetMOTIVO_BLOQUEOValue(const aValue: String);
function GetRECARGO_EQUIVALENCIAValue: Integer;
procedure SetRECARGO_EQUIVALENCIAValue(const aValue: Integer);
function GetREGIMEN_IVAValue: String;
procedure SetREGIMEN_IVAValue(const aValue: String);
function GetID_TIPO_IVAValue: Integer;
procedure SetID_TIPO_IVAValue(const aValue: Integer);
function GetID_FORMA_PAGOValue: Integer;
procedure SetID_FORMA_PAGOValue(const aValue: Integer);
function GetTIENDA_WEBValue: Integer;
procedure SetTIENDA_WEBValue(const aValue: Integer);
function GetDescuentos: IBizClienteDescuentos;
procedure SetDescuentos(Value: IBizClienteDescuentos);
property Descuentos: IBizClienteDescuentos read GetDescuentos write SetDescuentos;
property ID_AGENTE: Integer read GetID_AGENTEValue write SetID_AGENTEValue;
property GRUPO_CLIENTE: String read GetGRUPO_CLIENTEValue write SetGRUPO_CLIENTEValue;
function GetEMAIL_ADMINISTRACIONValue: String;
procedure SetEMAIL_ADMINISTRACIONValue(const aValue: String);
property NOMBRE_COMERCIAL: String read GetNOMBRE_COMERCIALValue write SetNOMBRE_COMERCIALValue;
property VENCIMIENTO_FACTURAS_1: SmallInt read GetVENCIMIENTO_FACTURAS_1Value write SetVENCIMIENTO_FACTURAS_1Value;
property VENCIMIENTO_FACTURAS_2: SmallInt read GetVENCIMIENTO_FACTURAS_2Value write SetVENCIMIENTO_FACTURAS_2Value;
property VENCIMIENTO_FACTURAS_3: SmallInt read GetVENCIMIENTO_FACTURAS_3Value write SetVENCIMIENTO_FACTURAS_3Value;
property BLOQUEADO: Integer read GetBLOQUEADOValue write SetBLOQUEADOValue;
property RAPEL: Integer read GetRAPELValue write SetRAPELValue;
property MOTIVO_BLOQUEO: String read GetMOTIVO_BLOQUEOValue write SetMOTIVO_BLOQUEOValue;
property RECARGO_EQUIVALENCIA: Integer read GetRECARGO_EQUIVALENCIAValue write SetRECARGO_EQUIVALENCIAValue;
property REGIMEN_IVA: String read GetREGIMEN_IVAValue write SetREGIMEN_IVAValue;
property ID_TIPO_IVA: Integer read GetID_TIPO_IVAValue write SetID_TIPO_IVAValue;
property ID_FORMA_PAGO: Integer read GetID_FORMA_PAGOValue write SetID_FORMA_PAGOValue;
property TIENDA_WEB: Integer read GetTIENDA_WEBValue write SetTIENDA_WEBValue;
property EMAIL_ADMINISTRACION: String read GetEMAIL_ADMINISTRACIONValue write SetEMAIL_ADMINISTRACIONValue;
end;
IBizProveedor = interface (IBizContacto)
['{0CC1FBB8-C2F1-4E10-87B9-D4EEB1221299}']
function GetREGIMEN_IVAValue: String;
procedure SetREGIMEN_IVAValue(const aValue: String);
function GetDESCUENTOValue: Float;
procedure SetDESCUENTOValue(const aValue: Float);
function GetID_TIPO_IVAValue: Integer;
procedure SetID_TIPO_IVAValue(const aValue: Integer);
function GetID_FORMA_PAGOValue: Integer;
procedure SetID_FORMA_PAGOValue(const aValue: Integer);
function GetTIENDA_WEBValue: Integer;
procedure SetTIENDA_WEBValue(const aValue: Integer);
function GetVENCIMIENTO_FACTURAS_1Value: SmallInt;
procedure SetVENCIMIENTO_FACTURAS_1Value(const aValue: SmallInt);
function GetVENCIMIENTO_FACTURAS_2Value: SmallInt;
procedure SetVENCIMIENTO_FACTURAS_2Value(const aValue: SmallInt);
function GetVENCIMIENTO_FACTURAS_3Value: SmallInt;
procedure SetVENCIMIENTO_FACTURAS_3Value(const aValue: SmallInt);
function GetEMAIL_ADMINISTRACIONValue: String;
procedure SetEMAIL_ADMINISTRACIONValue(const aValue: String);
property REGIMEN_IVA: String read GetREGIMEN_IVAValue write SetREGIMEN_IVAValue;
property DESCUENTO: Float read GetDESCUENTOValue write SetDESCUENTOValue;
property ID_TIPO_IVA: Integer read GetID_TIPO_IVAValue write SetID_TIPO_IVAValue;
property ID_FORMA_PAGO: Integer read GetID_FORMA_PAGOValue write SetID_FORMA_PAGOValue;
property TIENDA_WEB: Integer read GetTIENDA_WEBValue write SetTIENDA_WEBValue;
property VENCIMIENTO_FACTURAS_1: SmallInt read GetVENCIMIENTO_FACTURAS_1Value write SetVENCIMIENTO_FACTURAS_1Value;
property VENCIMIENTO_FACTURAS_2: SmallInt read GetVENCIMIENTO_FACTURAS_2Value write SetVENCIMIENTO_FACTURAS_2Value;
property VENCIMIENTO_FACTURAS_3: SmallInt read GetVENCIMIENTO_FACTURAS_3Value write SetVENCIMIENTO_FACTURAS_3Value;
property EMAIL_ADMINISTRACION: String read GetEMAIL_ADMINISTRACIONValue write SetEMAIL_ADMINISTRACIONValue;
end;
IBizAgente = interface (IBizContacto)
['{C3288C4E-127F-4AC5-A668-4DA88B79683F}']
function GetComisiones: IBizAgenteComisiones;
procedure SetComisiones(Value: IBizAgenteComisiones);
property Comisiones: IBizAgenteComisiones read GetComisiones write SetComisiones;
end;
TBizContacto = class(TContactosDataTableRules, IBizContacto, ISeleccionable)
protected
FDatosBancarios : IBizContactosDatosBancarios;
FDatosBancariosLink : TDADataSource;
FCategorias : IBizCategoriasContacto;
FCategoriasLink : TDADataSource;
FDirecciones : IBizDireccionesContacto;
FDireccionesLink : TDADataSource;
FSeleccionableInterface : ISeleccionable;
function _GetCategorias: IBizCategoriasContacto;
procedure _SetCategorias(const Value: IBizCategoriasContacto);
procedure SetDatosBancarios(AValue : IBizContactosDatosBancarios);
function GetDatosBancarios : IBizContactosDatosBancarios;
function GetDirecciones: IBizDireccionesContacto;
procedure SetDirecciones(const Value: IBizDireccionesContacto);
function GetCategoria : String;
procedure OnNewRecord(Sender: TDADataTable); override;
public
function EsNuevo : Boolean;
procedure IniciarValoresContactoNuevo; virtual;
constructor Create(aDataTable: TDADataTable); override;
destructor Destroy; override;
property Categoria : String read GetCategoria;
property _Categorias : IBizCategoriasContacto read _GetCategorias
write _SetCategorias;
property DatosBancarios : IBizContactosDatosBancarios read GetDatosBancarios
write SetDatosBancarios;
property Direcciones : IBizDireccionesContacto read GetDirecciones
write SetDirecciones;
property SeleccionableInterface : ISeleccionable read FSeleccionableInterface
write FSeleccionableInterface implements ISeleccionable;
end;
TBizCliente = class(TBizContacto, IBizCliente)
protected
FDescuentos : IBizClienteDescuentos;
FDescuentosLink : TDADataSource;
function GetID_AGENTEValue: Integer;
procedure SetID_AGENTEValue(const aValue: Integer);
function GetGRUPO_CLIENTEValue: String;
procedure SetGRUPO_CLIENTEValue(const aValue: String);
function GetNOMBRE_COMERCIALValue: String;
procedure SetNOMBRE_COMERCIALValue(const aValue: String);
function GetVENCIMIENTO_FACTURAS_1Value: SmallInt;
procedure SetVENCIMIENTO_FACTURAS_1Value(const aValue: SmallInt);
function GetVENCIMIENTO_FACTURAS_2Value: SmallInt;
procedure SetVENCIMIENTO_FACTURAS_2Value(const aValue: SmallInt);
function GetVENCIMIENTO_FACTURAS_3Value: SmallInt;
procedure SetVENCIMIENTO_FACTURAS_3Value(const aValue: SmallInt);
function GetBLOQUEADOValue: Integer;
procedure SetBLOQUEADOValue(const aValue: Integer);
function GetRAPELValue: Integer;
procedure SetRAPELValue(const aValue: Integer);
function GetMOTIVO_BLOQUEOValue: String;
procedure SetMOTIVO_BLOQUEOValue(const aValue: String);
function GetRECARGO_EQUIVALENCIAValue: Integer;
procedure SetRECARGO_EQUIVALENCIAValue(const aValue: Integer);
function GetREGIMEN_IVAValue: String;
procedure SetREGIMEN_IVAValue(const aValue: String);
function GetID_TIPO_IVAValue: Integer;
procedure SetID_TIPO_IVAValue(const aValue: Integer);
function GetID_FORMA_PAGOValue: Integer;
procedure SetID_FORMA_PAGOValue(const aValue: Integer);
function GetTIENDA_WEBValue: Integer;
procedure SetTIENDA_WEBValue(const aValue: Integer);
function GetDescuentos: IBizClienteDescuentos;
procedure SetDescuentos(Value: IBizClienteDescuentos);
function GetEMAIL_ADMINISTRACIONValue: String;
procedure SetEMAIL_ADMINISTRACIONValue(const aValue: String);
public
procedure IniciarValoresContactoNuevo; override;
constructor Create(aDataTable: TDADataTable); override;
destructor Destroy; override;
property Descuentos: IBizClienteDescuentos read GetDescuentos write SetDescuentos;
property ID_AGENTE: Integer read GetID_AGENTEValue write SetID_AGENTEValue;
property GRUPO_CLIENTE: String read GetGRUPO_CLIENTEValue write SetGRUPO_CLIENTEValue;
property NOMBRE_COMERCIAL: String read GetNOMBRE_COMERCIALValue write SetNOMBRE_COMERCIALValue;
property VENCIMIENTO_FACTURAS_1: SmallInt read GetVENCIMIENTO_FACTURAS_1Value write SetVENCIMIENTO_FACTURAS_1Value;
property VENCIMIENTO_FACTURAS_2: SmallInt read GetVENCIMIENTO_FACTURAS_2Value write SetVENCIMIENTO_FACTURAS_2Value;
property VENCIMIENTO_FACTURAS_3: SmallInt read GetVENCIMIENTO_FACTURAS_3Value write SetVENCIMIENTO_FACTURAS_3Value;
property BLOQUEADO: Integer read GetBLOQUEADOValue write SetBLOQUEADOValue;
property RAPEL: Integer read GetRAPELValue write SetRAPELValue;
property MOTIVO_BLOQUEO: String read GetMOTIVO_BLOQUEOValue write SetMOTIVO_BLOQUEOValue;
property RECARGO_EQUIVALENCIA: Integer read GetRECARGO_EQUIVALENCIAValue write SetRECARGO_EQUIVALENCIAValue;
property REGIMEN_IVA: String read GetREGIMEN_IVAValue write SetREGIMEN_IVAValue;
property ID_TIPO_IVA: Integer read GetID_TIPO_IVAValue write SetID_TIPO_IVAValue;
property ID_FORMA_PAGO: Integer read GetID_FORMA_PAGOValue write SetID_FORMA_PAGOValue;
property TIENDA_WEB: Integer read GetTIENDA_WEBValue write SetTIENDA_WEBValue;
property EMAIL_ADMINISTRACION: String read GetEMAIL_ADMINISTRACIONValue write SetEMAIL_ADMINISTRACIONValue;
end;
TBizProveedor = class(TBizContacto, IBizProveedor)
protected
function GetDESCUENTOValue: Float;
procedure SetDESCUENTOValue(const aValue: Float);
function GetREGIMEN_IVAValue: String;
procedure SetREGIMEN_IVAValue(const aValue: String);
function GetID_TIPO_IVAValue: Integer;
procedure SetID_TIPO_IVAValue(const aValue: Integer);
function GetTIENDA_WEBValue: Integer;
procedure SetTIENDA_WEBValue(const aValue: Integer);
function GetID_FORMA_PAGOValue: Integer;
procedure SetID_FORMA_PAGOValue(const aValue: Integer);
function GetVENCIMIENTO_FACTURAS_1Value: SmallInt;
procedure SetVENCIMIENTO_FACTURAS_1Value(const aValue: SmallInt);
function GetVENCIMIENTO_FACTURAS_2Value: SmallInt;
procedure SetVENCIMIENTO_FACTURAS_2Value(const aValue: SmallInt);
function GetVENCIMIENTO_FACTURAS_3Value: SmallInt;
procedure SetVENCIMIENTO_FACTURAS_3Value(const aValue: SmallInt);
function GetEMAIL_ADMINISTRACIONValue: String;
procedure SetEMAIL_ADMINISTRACIONValue(const aValue: String);
public
procedure IniciarValoresContactoNuevo; override;
property DESCUENTO: Float read GetDESCUENTOValue write SetDESCUENTOValue;
property REGIMEN_IVA: String read GetREGIMEN_IVAValue write SetREGIMEN_IVAValue;
property ID_TIPO_IVA: Integer read GetID_TIPO_IVAValue write SetID_TIPO_IVAValue;
property ID_FORMA_PAGO: Integer read GetID_FORMA_PAGOValue write SetID_FORMA_PAGOValue;
property TIENDA_WEB: Integer read GetTIENDA_WEBValue write SetTIENDA_WEBValue;
property VENCIMIENTO_FACTURAS_1: SmallInt read GetVENCIMIENTO_FACTURAS_1Value write SetVENCIMIENTO_FACTURAS_1Value;
property VENCIMIENTO_FACTURAS_2: SmallInt read GetVENCIMIENTO_FACTURAS_2Value write SetVENCIMIENTO_FACTURAS_2Value;
property VENCIMIENTO_FACTURAS_3: SmallInt read GetVENCIMIENTO_FACTURAS_3Value write SetVENCIMIENTO_FACTURAS_3Value;
property EMAIL_ADMINISTRACION: String read GetEMAIL_ADMINISTRACIONValue write SetEMAIL_ADMINISTRACIONValue;
end;
TBizAgente = class(TBizContacto, IBizAgente)
protected
FComisiones : IBizAgenteComisiones;
FComisionesLink : TDADataSource;
function GetComisiones: IBizAgenteComisiones;
procedure SetComisiones(Value: IBizAgenteComisiones);
public
procedure IniciarValoresContactoNuevo; override;
constructor Create(aDataTable: TDADataTable); override;
destructor Destroy; override;
property Comisiones: IBizAgenteComisiones read GetComisiones write SetComisiones;
end;
implementation
uses
uDataTableUtils, Classes, DateUtils, SysUtils, uDataModuleUsuarios;
{ TBizContacto }
constructor TBizContacto.Create(aDataTable: TDADataTable);
begin
inherited;
FCategoriasLink := TDADataSource.Create(NIL);
FCategoriasLink.DataTable := aDataTable;
FDatosBancariosLink := TDADataSource.Create(NIL);
FDatosBancariosLink.DataTable := aDataTable;
FDireccionesLink := TDADataSource.Create(NIL);
FDireccionesLink.DataTable := aDataTable;
FSeleccionableInterface := TSeleccionable.Create(aDataTable);
end;
destructor TBizContacto.Destroy;
begin
FCategorias := NIL;
FCategoriasLink.Free;
FDatosBancarios := NIL;
FDatosBancariosLink.Free;
FDirecciones := NIL;
FDireccionesLink.Free;
FSeleccionableInterface := NIL;
inherited;
end;
function TBizContacto.EsNuevo: Boolean;
begin
Result := (ID < 0);
end;
function TBizContacto.GetCategoria: String;
begin
case ID_CATEGORIA of
1 : Result := 'Cliente';
2 : Result := 'Proveedor';
3 : Result := 'Agente';
end;
end;
function TBizContacto.GetDatosBancarios: IBizContactosDatosBancarios;
begin
Result := FDatosBancarios;
end;
function TBizContacto.GetDirecciones: IBizDireccionesContacto;
begin
Result := FDirecciones;
end;
procedure TBizContacto.IniciarValoresContactoNuevo;
begin
//
USUARIO := dmUsuarios.LoginInfo.Usuario;
end;
procedure TBizContacto.OnNewRecord(Sender: TDADataTable);
begin
inherited;
ID := GetRecNo; // -1, -2, -3...
IniciarValoresContactoNuevo;
end;
procedure TBizContacto.SetDatosBancarios(AValue: IBizContactosDatosBancarios);
begin
FDatosBancarios := AValue;
EnlazarMaestroDetalle(FDatosBancariosLink, FDatosBancarios);
end;
procedure TBizContacto.SetDirecciones(const Value: IBizDireccionesContacto);
begin
FDirecciones := Value;
EnlazarMaestroDetalle(FDireccionesLink, FDirecciones);
end;
function TBizContacto._GetCategorias: IBizCategoriasContacto;
begin
Result := FCategorias;
end;
procedure TBizContacto._SetCategorias(const Value: IBizCategoriasContacto);
begin
FCategorias := Value;
EnlazarMaestroDetalle(FCategoriasLink, FCategorias);
end;
{ TBizCliente }
constructor TBizCliente.Create(aDataTable: TDADataTable);
begin
inherited;
FDescuentos := NIL;
FDescuentosLink := TDADataSource.Create(NIL);
FDescuentosLink.DataTable := aDataTable;
end;
destructor TBizCliente.Destroy;
begin
FDescuentos := NIL;
FreeAndNIL(FDescuentosLink);
inherited;
end;
function TBizCliente.GetBLOQUEADOValue: Integer;
begin
result := DataTable.Fields[idx_ClientesBLOQUEADO].AsInteger;
end;
function TBizCliente.GetRAPELValue: Integer;
begin
result := DataTable.Fields[idx_ClientesRAPEL].AsInteger;
end;
function TBizCliente.GetDescuentos: IBizClienteDescuentos;
begin
Result := FDescuentos;
end;
function TBizCliente.GetEMAIL_ADMINISTRACIONValue: String;
begin
result := DataTable.Fields[idx_ClientesEMAIL_ADMINISTRACION].AsString;
end;
function TBizCliente.GetGRUPO_CLIENTEValue: String;
begin
result := DataTable.Fields[idx_ClientesGRUPO_CLIENTE].AsString;
end;
function TBizCliente.GetID_AGENTEValue: Integer;
begin
result := DataTable.Fields[idx_ClientesID_AGENTE].AsInteger;
end;
function TBizCliente.GetID_FORMA_PAGOValue: Integer;
begin
result := DataTable.Fields[idx_ClientesID_FORMA_PAGO].AsInteger;
end;
function TBizCliente.GetID_TIPO_IVAValue: Integer;
begin
result := DataTable.Fields[idx_ClientesID_TIPO_IVA].AsInteger;
end;
function TBizCliente.GetMOTIVO_BLOQUEOValue: String;
begin
result := DataTable.Fields[idx_ClientesMOTIVO_BLOQUEO].AsString;
end;
function TBizCliente.GetNOMBRE_COMERCIALValue: String;
begin
result := DataTable.Fields[idx_ClientesNOMBRE_COMERCIAL].AsString;
end;
procedure TBizCliente.SetBLOQUEADOValue(const aValue: Integer);
begin
DataTable.Fields[idx_ClientesBLOQUEADO].AsInteger := aValue;
end;
procedure TBizCliente.SetRAPELValue(const aValue: Integer);
begin
DataTable.Fields[idx_ClientesRAPEL].AsInteger := aValue;
end;
procedure TBizCliente.SetDescuentos(Value: IBizClienteDescuentos);
begin
FDescuentos := Value;
EnlazarMaestroDetalle(FDescuentosLink, FDescuentos);
end;
procedure TBizCliente.SetEMAIL_ADMINISTRACIONValue(const aValue: String);
begin
DataTable.Fields[idx_ClientesEMAIL_ADMINISTRACION].AsString := aValue;
end;
procedure TBizCliente.SetGRUPO_CLIENTEValue(const aValue: String);
begin
DataTable.Fields[idx_ClientesGRUPO_CLIENTE].AsString := aValue;
end;
procedure TBizCliente.SetID_AGENTEValue(const aValue: Integer);
begin
DataTable.Fields[idx_ClientesID_AGENTE].AsInteger := aValue;
end;
procedure TBizCliente.SetID_FORMA_PAGOValue(const aValue: Integer);
begin
DataTable.Fields[idx_ClientesID_FORMA_PAGO].AsInteger := aValue;
end;
procedure TBizCliente.SetID_TIPO_IVAValue(const aValue: Integer);
begin
DataTable.Fields[idx_ClientesID_TIPO_IVA].AsInteger := aValue;
end;
procedure TBizCliente.SetMOTIVO_BLOQUEOValue(const aValue: String);
begin
DataTable.Fields[idx_ClientesMOTIVO_BLOQUEO].AsString := aValue;
end;
procedure TBizCliente.SetNOMBRE_COMERCIALValue(const aValue: String);
begin
DataTable.Fields[idx_ClientesNOMBRE_COMERCIAL].AsString := aValue;
end;
function TBizCliente.GetRECARGO_EQUIVALENCIAValue: Integer;
begin
Result := DataTable.Fields[idx_ClientesRECARGO_EQUIVALENCIA].AsInteger;
end;
function TBizCliente.GetREGIMEN_IVAValue: String;
begin
Result := DataTable.Fields[idx_ClientesREGIMEN_IVA].AsString;
end;
function TBizCliente.GetTIENDA_WEBValue: Integer;
begin
result := DataTable.Fields[idx_ClientesTIENDA_WEB].AsInteger;
end;
function TBizCliente.GetVENCIMIENTO_FACTURAS_1Value: SmallInt;
begin
result := DataTable.Fields[idx_ClientesVENCIMIENTO_FACTURAS_1].AsInteger;
end;
function TBizCliente.GetVENCIMIENTO_FACTURAS_2Value: SmallInt;
begin
result := DataTable.Fields[idx_ClientesVENCIMIENTO_FACTURAS_2].AsInteger;
end;
function TBizCliente.GetVENCIMIENTO_FACTURAS_3Value: SmallInt;
begin
result := DataTable.Fields[idx_ClientesVENCIMIENTO_FACTURAS_3].AsInteger;
end;
procedure TBizCliente.SetRECARGO_EQUIVALENCIAValue(const aValue: Integer);
begin
DataTable.Fields[idx_ClientesRECARGO_EQUIVALENCIA].AsInteger := aValue;
end;
procedure TBizCliente.SetREGIMEN_IVAValue(const aValue: String);
begin
DataTable.Fields[idx_ClientesREGIMEN_IVA].AsString := aValue;
end;
procedure TBizCliente.SetTIENDA_WEBValue(const aValue: Integer);
begin
DataTable.Fields[idx_ClientesTIENDA_WEB].AsInteger := aValue;
end;
procedure TBizCliente.SetVENCIMIENTO_FACTURAS_1Value(const aValue: SmallInt);
begin
DataTable.Fields[idx_ClientesVENCIMIENTO_FACTURAS_1].AsInteger := aValue;
end;
procedure TBizCliente.SetVENCIMIENTO_FACTURAS_2Value(const aValue: SmallInt);
begin
DataTable.Fields[idx_ClientesVENCIMIENTO_FACTURAS_2].AsInteger := aValue;
end;
procedure TBizCliente.SetVENCIMIENTO_FACTURAS_3Value(const aValue: SmallInt);
begin
DataTable.Fields[idx_ClientesVENCIMIENTO_FACTURAS_3].AsInteger := aValue;
end;
procedure TBizCliente.IniciarValoresContactoNuevo;
begin
inherited;
ID_CATEGORIA := CATEGORIA_CLIENTE;
VENCIMIENTO_FACTURAS_1 := CLIENTE_DIAS_VENCIMIENTO;
BLOQUEADO := 0;
RAPEL := 0;
RECARGO_EQUIVALENCIA := CLIENTE_RECARGO_EQUIVALENCIA;
REGIMEN_IVA := CLIENTE_REGIMEN_IVA;
end;
{ TBizProveedor }
function TBizProveedor.GetID_FORMA_PAGOValue: Integer;
begin
result := DataTable.Fields[idx_ProveedoresID_FORMA_PAGO].AsInteger;
end;
function TBizProveedor.GetID_TIPO_IVAValue: Integer;
begin
result := DataTable.Fields[idx_ProveedoresID_TIPO_IVA].AsInteger;
end;
function TBizProveedor.GetREGIMEN_IVAValue: String;
begin
result := DataTable.Fields[idx_ProveedoresREGIMEN_IVA].AsString;
end;
function TBizProveedor.GetTIENDA_WEBValue: Integer;
begin
result := DataTable.Fields[idx_ProveedoresTIENDA_WEB].AsInteger;
end;
function TBizProveedor.GetVENCIMIENTO_FACTURAS_1Value: SmallInt;
begin
result := DataTable.Fields[idx_ProveedoresVENCIMIENTO_FACTURAS_1].AsInteger;
end;
function TBizProveedor.GetVENCIMIENTO_FACTURAS_2Value: SmallInt;
begin
result := DataTable.Fields[idx_ProveedoresVENCIMIENTO_FACTURAS_2].AsInteger;
end;
function TBizProveedor.GetVENCIMIENTO_FACTURAS_3Value: SmallInt;
begin
result := DataTable.Fields[idx_ProveedoresVENCIMIENTO_FACTURAS_3].AsInteger;
end;
procedure TBizProveedor.IniciarValoresContactoNuevo;
begin
inherited;
ID_CATEGORIA := CATEGORIA_PROVEEDOR;
REGIMEN_IVA := PROVEEDOR_REGIMEN_IVA;
end;
function TBizProveedor.GetDESCUENTOValue: Float;
begin
result := DataTable.Fields[idx_ProveedoresDESCUENTO].AsFloat;
end;
procedure TBizProveedor.SetDESCUENTOValue(const aValue: Float);
begin
DataTable.Fields[idx_ProveedoresDESCUENTO].AsFloat := aValue;
end;
procedure TBizProveedor.SetID_FORMA_PAGOValue(const aValue: Integer);
begin
DataTable.Fields[idx_ProveedoresID_FORMA_PAGO].AsInteger := aValue;
end;
procedure TBizProveedor.SetID_TIPO_IVAValue(const aValue: Integer);
begin
DataTable.Fields[idx_ProveedoresID_TIPO_IVA].AsInteger := aValue;
end;
procedure TBizProveedor.SetREGIMEN_IVAValue(const aValue: String);
begin
DataTable.Fields[idx_ProveedoresREGIMEN_IVA].AsString := aValue;
end;
procedure TBizProveedor.SetTIENDA_WEBValue(const aValue: Integer);
begin
DataTable.Fields[idx_ProveedoresTIENDA_WEB].AsInteger := aValue;
end;
procedure TBizProveedor.SetVENCIMIENTO_FACTURAS_1Value(const aValue: SmallInt);
begin
DataTable.Fields[idx_ProveedoresVENCIMIENTO_FACTURAS_1].AsInteger := aValue;
end;
procedure TBizProveedor.SetVENCIMIENTO_FACTURAS_2Value(const aValue: SmallInt);
begin
DataTable.Fields[idx_ProveedoresVENCIMIENTO_FACTURAS_2].AsInteger := aValue;
end;
procedure TBizProveedor.SetVENCIMIENTO_FACTURAS_3Value(const aValue: SmallInt);
begin
DataTable.Fields[idx_ProveedoresVENCIMIENTO_FACTURAS_3].AsInteger := aValue;
end;
function TBizProveedor.GetEMAIL_ADMINISTRACIONValue: String;
begin
result := DataTable.Fields[idx_ProveedoresEMAIL_ADMINISTRACION].AsString;
end;
procedure TBizProveedor.SetEMAIL_ADMINISTRACIONValue(const aValue: String);
begin
DataTable.Fields[idx_ProveedoresEMAIL_ADMINISTRACION].AsString := aValue;
end;
{ TBizAgente }
constructor TBizAgente.Create(aDataTable: TDADataTable);
begin
inherited;
FComisiones := NIL;
FComisionesLink := TDADataSource.Create(NIL);
FComisionesLink.DataTable := aDataTable;
end;
destructor TBizAgente.Destroy;
begin
FComisiones := NIL;
FComisionesLink.Free;
inherited;
end;
function TBizAgente.GetComisiones: IBizAgenteComisiones;
begin
Result := FComisiones;
end;
procedure TBizAgente.IniciarValoresContactoNuevo;
begin
inherited;
ID_CATEGORIA := CATEGORIA_AGENTE;
end;
procedure TBizAgente.SetComisiones(Value: IBizAgenteComisiones);
begin
FComisiones := Value;
EnlazarMaestroDetalle(FComisionesLink, FComisiones);
end;
initialization
RegisterDataTableRules(BIZ_CLIENT_CONTACTO, TBizContacto);
RegisterDataTableRules(BIZ_CLIENT_CLIENTE, TBizCliente);
RegisterDataTableRules(BIZ_CLIENT_PROVEEDOR, TBizProveedor);
RegisterDataTableRules(BIZ_CLIENT_AGENTE, TBizAgente);
finalization
end.