Clientes: descuento por defecto y etiqueta del nº del mes para realizar pagos.

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@272 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
David Arranz 2008-02-18 11:09:10 +00:00
parent fcc30d355e
commit fdbb2cf95c
11 changed files with 269 additions and 112 deletions

View File

@ -1504,7 +1504,8 @@ CREATE VIEW V_CLIENTES(
ID_TIPO_IVA,
ID_FORMA_PAGO,
TIENDA_WEB,
CODIGO_ASIGNADO)
CODIGO_ASIGNADO,
DESCUENTO)
AS
SELECT
V_CONTACTOS.ID,
@ -1540,7 +1541,8 @@ SELECT
CLIENTES_DATOS.ID_TIPO_IVA,
CLIENTES_DATOS.ID_FORMA_PAGO,
CLIENTES_DATOS.TIENDA_WEB,
CLIENTES_DATOS.CODIGO_ASIGNADO
CLIENTES_DATOS.CODIGO_ASIGNADO,
CLIENTES_DATOS.DESCUENTO
FROM
V_CONTACTOS
LEFT OUTER JOIN CLIENTES_DATOS ON (V_CONTACTOS.ID = CLIENTES_DATOS.ID_CLIENTE)

View File

@ -395,6 +395,10 @@ inherited DataModuleClientes: TDataModuleClientes
Name = 'CODIGO_ASIGNADO'
DataType = datString
Size = 255
end
item
Name = 'DESCUENTO'
DataType = datFloat
end>
Params = <>
StreamingOptions = [soDisableEventsWhileStreaming]

View File

@ -3,25 +3,25 @@ unit schContactosClient_Intf;
interface
uses
Classes, DB, schBase_Intf, SysUtils, uROClasses, uDADataTable, FmtBCD, uROXMLIntf;
Classes, DB, SysUtils, uROClasses, uDADataTable, FmtBCD, uROXMLIntf;
const
{ Data table rules ids
Feel free to change them to something more human readable
but make sure they are unique in the context of your application }
RID_Contactos = '{C115B421-4BB9-4A74-9C72-DC05360DB831}';
RID_GruposCliente = '{3445A902-A22B-4B61-A8AD-6757AFF10F12}';
RID_DatosBancarios = '{70368AEC-FBFA-4E34-9451-57BD7B9417CC}';
RID_Clientes = '{BF8CDD3B-FEB5-416F-8A10-050513FCB6B9}';
RID_Proveedores = '{C5E90BF8-A2BD-4D48-9E31-A8B6ACFB3F6B}';
RID_Empleados = '{57106E54-5E47-4FC6-959F-140B5B037456}';
RID_DireccionesContacto = '{B3F87076-62C7-4C8C-A75A-7D75A4E5676E}';
RID_ClientesDescuentos = '{BFC90D18-9C3E-48E2-9ECF-DEDE503C9840}';
RID_GruposProveedor = '{2D30AB4E-2FBA-4A98-98EC-B8B8F6CC4511}';
RID_GruposEmpleado = '{CB61D651-65EA-4C1E-B687-782E7B0913EF}';
RID_Contactos_Refresh = '{0FD3262C-7F50-488E-AA21-FF9544500886}';
RID_ContratosEmpleados = '{782086DB-6B6E-4A41-AD72-5B68A3E5D81A}';
RID_DescripcionesProveedores = '{311D75FD-C603-4AA2-846A-BAC7029441BD}';
RID_Contactos = '{A01DF458-CA42-490D-B20E-900420045A23}';
RID_GruposCliente = '{856B01A2-B957-42EF-922D-7B21671BBE74}';
RID_DatosBancarios = '{A805FC27-FB69-42D8-964D-E109662823EC}';
RID_Clientes = '{6D8EA837-CBD8-4CD6-B78F-3D6CBB862164}';
RID_Proveedores = '{81C670DC-5013-443F-94B8-8BDB6A45D0B9}';
RID_Empleados = '{F639F514-FA26-470A-9168-33B20AB0A5C6}';
RID_DireccionesContacto = '{84E91303-9464-453C-9D0D-B6018DE5C0E0}';
RID_ClientesDescuentos = '{FC4C2315-A1D2-44EC-8600-0596BCFF0D0B}';
RID_GruposProveedor = '{98B4C0FA-AAD3-4DC1-9C1A-277BE5D6A64C}';
RID_GruposEmpleado = '{443813CE-FC5E-409B-8CCA-2DDD27AA5DD0}';
RID_Contactos_Refresh = '{DFC7E7BE-F226-491E-87C9-5E4C80C6F900}';
RID_ContratosEmpleados = '{2F3CC454-F247-4FB4-8BA4-B91262485533}';
RID_DescripcionesProveedores = '{275FEFB5-D5C3-49BC-BE17-4B14ADCFCB99}';
{ Data table names }
nme_Contactos = 'Contactos';
@ -153,6 +153,7 @@ const
fld_ClientesID_FORMA_PAGO = 'ID_FORMA_PAGO';
fld_ClientesTIENDA_WEB = 'TIENDA_WEB';
fld_ClientesCODIGO_ASIGNADO = 'CODIGO_ASIGNADO';
fld_ClientesDESCUENTO = 'DESCUENTO';
{ Clientes field indexes }
idx_ClientesID = 0;
@ -189,6 +190,7 @@ const
idx_ClientesID_FORMA_PAGO = 31;
idx_ClientesTIENDA_WEB = 32;
idx_ClientesCODIGO_ASIGNADO = 33;
idx_ClientesDESCUENTO = 34;
{ Proveedores fields }
fld_ProveedoresID = 'ID';
@ -453,7 +455,7 @@ const
type
{ IContactos }
IContactos = interface(IDAStronglyTypedDataTable)
['{719844C6-2A70-424C-B789-FA36D4D6FDA6}']
['{442364C9-699A-42A2-BD2B-634824DB9D4C}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@ -598,7 +600,7 @@ type
end;
{ TContactosDataTableRules }
TContactosDataTableRules = class(TIntfObjectDADataTableRules, IContactos)
TContactosDataTableRules = class(TDADataTableRules, IContactos)
private
f_NOTAS: IROStrings;
procedure NOTAS_OnChange(Sender: TObject);
@ -752,7 +754,7 @@ type
{ IGruposCliente }
IGruposCliente = interface(IDAStronglyTypedDataTable)
['{732A532F-BB92-4DBA-9EE4-ECC2C34A43CF}']
['{35E7B4ED-6CB6-40E3-9440-84F5FC62866C}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@ -772,7 +774,7 @@ type
end;
{ TGruposClienteDataTableRules }
TGruposClienteDataTableRules = class(TIntfObjectDADataTableRules, IGruposCliente)
TGruposClienteDataTableRules = class(TDADataTableRules, IGruposCliente)
private
protected
{ Property getters and setters }
@ -799,7 +801,7 @@ type
{ IDatosBancarios }
IDatosBancarios = interface(IDAStronglyTypedDataTable)
['{3DD35211-F85E-4803-8A3E-950C72CEF7A4}']
['{1067D207-71F4-4FA3-A662-4980479F297A}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@ -861,7 +863,7 @@ type
end;
{ TDatosBancariosDataTableRules }
TDatosBancariosDataTableRules = class(TIntfObjectDADataTableRules, IDatosBancarios)
TDatosBancariosDataTableRules = class(TDADataTableRules, IDatosBancarios)
private
protected
{ Property getters and setters }
@ -930,7 +932,7 @@ type
{ IClientes }
IClientes = interface(IDAStronglyTypedDataTable)
['{6B82F05A-B609-4FBD-9F12-CD3BF7A9649A}']
['{F5CD5D3C-EF2D-4C2D-B033-369E7FF496FE}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@ -1067,6 +1069,10 @@ type
procedure SetCODIGO_ASIGNADOValue(const aValue: String);
function GetCODIGO_ASIGNADOIsNull: Boolean;
procedure SetCODIGO_ASIGNADOIsNull(const aValue: Boolean);
function GetDESCUENTOValue: Float;
procedure SetDESCUENTOValue(const aValue: Float);
function GetDESCUENTOIsNull: Boolean;
procedure SetDESCUENTOIsNull(const aValue: Boolean);
{ Properties }
@ -1138,10 +1144,12 @@ type
property TIENDA_WEBIsNull: Boolean read GetTIENDA_WEBIsNull write SetTIENDA_WEBIsNull;
property CODIGO_ASIGNADO: String read GetCODIGO_ASIGNADOValue write SetCODIGO_ASIGNADOValue;
property CODIGO_ASIGNADOIsNull: Boolean read GetCODIGO_ASIGNADOIsNull write SetCODIGO_ASIGNADOIsNull;
property DESCUENTO: Float read GetDESCUENTOValue write SetDESCUENTOValue;
property DESCUENTOIsNull: Boolean read GetDESCUENTOIsNull write SetDESCUENTOIsNull;
end;
{ TClientesDataTableRules }
TClientesDataTableRules = class(TIntfObjectDADataTableRules, IClientes)
TClientesDataTableRules = class(TDADataTableRules, IClientes)
private
f_NOTAS: IROStrings;
procedure NOTAS_OnChange(Sender: TObject);
@ -1282,6 +1290,10 @@ type
procedure SetCODIGO_ASIGNADOValue(const aValue: String); virtual;
function GetCODIGO_ASIGNADOIsNull: Boolean; virtual;
procedure SetCODIGO_ASIGNADOIsNull(const aValue: Boolean); virtual;
function GetDESCUENTOValue: Float; virtual;
procedure SetDESCUENTOValue(const aValue: Float); virtual;
function GetDESCUENTOIsNull: Boolean; virtual;
procedure SetDESCUENTOIsNull(const aValue: Boolean); virtual;
{ Properties }
property ID: Integer read GetIDValue write SetIDValue;
@ -1352,6 +1364,8 @@ type
property TIENDA_WEBIsNull: Boolean read GetTIENDA_WEBIsNull write SetTIENDA_WEBIsNull;
property CODIGO_ASIGNADO: String read GetCODIGO_ASIGNADOValue write SetCODIGO_ASIGNADOValue;
property CODIGO_ASIGNADOIsNull: Boolean read GetCODIGO_ASIGNADOIsNull write SetCODIGO_ASIGNADOIsNull;
property DESCUENTO: Float read GetDESCUENTOValue write SetDESCUENTOValue;
property DESCUENTOIsNull: Boolean read GetDESCUENTOIsNull write SetDESCUENTOIsNull;
public
constructor Create(aDataTable: TDADataTable); override;
@ -1361,7 +1375,7 @@ type
{ IProveedores }
IProveedores = interface(IDAStronglyTypedDataTable)
['{B54134B3-CB2B-4070-B699-9BBD573D3207}']
['{BBCE4DC0-BCDB-43F4-9184-A5738876A8B0}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@ -1566,7 +1580,7 @@ type
end;
{ TProveedoresDataTableRules }
TProveedoresDataTableRules = class(TIntfObjectDADataTableRules, IProveedores)
TProveedoresDataTableRules = class(TDADataTableRules, IProveedores)
private
f_NOTAS: IROStrings;
procedure NOTAS_OnChange(Sender: TObject);
@ -1780,7 +1794,7 @@ type
{ IEmpleados }
IEmpleados = interface(IDAStronglyTypedDataTable)
['{BE9A5BFB-4B2A-4D75-8443-81A62F176DBE}']
['{F6216CB9-7373-46E3-A4E1-94646AF537D9}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@ -1969,7 +1983,7 @@ type
end;
{ TEmpleadosDataTableRules }
TEmpleadosDataTableRules = class(TIntfObjectDADataTableRules, IEmpleados)
TEmpleadosDataTableRules = class(TDADataTableRules, IEmpleados)
private
f_NOTAS: IROStrings;
f_FORMACION_BASE: IROStrings;
@ -2175,7 +2189,7 @@ type
{ IDireccionesContacto }
IDireccionesContacto = interface(IDAStronglyTypedDataTable)
['{F7A5D42D-DA30-4AC0-B4A8-CB8C3DC64B5C}']
['{53FE106D-EC9A-4532-BEA8-CD41DAA2EB54}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@ -2278,7 +2292,7 @@ type
end;
{ TDireccionesContactoDataTableRules }
TDireccionesContactoDataTableRules = class(TIntfObjectDADataTableRules, IDireccionesContacto)
TDireccionesContactoDataTableRules = class(TDADataTableRules, IDireccionesContacto)
private
f_NOTAS: IROStrings;
procedure NOTAS_OnChange(Sender: TObject);
@ -2390,7 +2404,7 @@ type
{ IClientesDescuentos }
IClientesDescuentos = interface(IDAStronglyTypedDataTable)
['{E9DDB7B2-B15E-4AEE-A2A3-BA763DC98120}']
['{9759ECA3-182C-4CB0-938A-8554DFF4B1C2}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@ -2428,7 +2442,7 @@ type
end;
{ TClientesDescuentosDataTableRules }
TClientesDescuentosDataTableRules = class(TIntfObjectDADataTableRules, IClientesDescuentos)
TClientesDescuentosDataTableRules = class(TDADataTableRules, IClientesDescuentos)
private
protected
{ Property getters and setters }
@ -2473,7 +2487,7 @@ type
{ IGruposProveedor }
IGruposProveedor = interface(IDAStronglyTypedDataTable)
['{B151DCD3-F752-461E-AA83-46F24DBFB790}']
['{B498AC23-EBFE-4406-AD14-7C99C40A088D}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@ -2493,7 +2507,7 @@ type
end;
{ TGruposProveedorDataTableRules }
TGruposProveedorDataTableRules = class(TIntfObjectDADataTableRules, IGruposProveedor)
TGruposProveedorDataTableRules = class(TDADataTableRules, IGruposProveedor)
private
protected
{ Property getters and setters }
@ -2520,7 +2534,7 @@ type
{ IGruposEmpleado }
IGruposEmpleado = interface(IDAStronglyTypedDataTable)
['{61C86566-7AFA-4838-A56E-9E38E30ADC7F}']
['{973B4979-9390-4923-B95C-4C88C77F68C2}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@ -2540,7 +2554,7 @@ type
end;
{ TGruposEmpleadoDataTableRules }
TGruposEmpleadoDataTableRules = class(TIntfObjectDADataTableRules, IGruposEmpleado)
TGruposEmpleadoDataTableRules = class(TDADataTableRules, IGruposEmpleado)
private
protected
{ Property getters and setters }
@ -2567,7 +2581,7 @@ type
{ IContactos_Refresh }
IContactos_Refresh = interface(IDAStronglyTypedDataTable)
['{544611C3-BA00-43EF-B22E-90A364702420}']
['{917172A1-5EDB-43D8-B8C5-A708ADB8AA6B}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@ -2700,7 +2714,7 @@ type
end;
{ TContactos_RefreshDataTableRules }
TContactos_RefreshDataTableRules = class(TIntfObjectDADataTableRules, IContactos_Refresh)
TContactos_RefreshDataTableRules = class(TDADataTableRules, IContactos_Refresh)
private
f_NOTAS: IROStrings;
procedure NOTAS_OnChange(Sender: TObject);
@ -2842,7 +2856,7 @@ type
{ IContratosEmpleados }
IContratosEmpleados = interface(IDAStronglyTypedDataTable)
['{A6A978AC-03FD-4411-9A0B-9E0CBB512563}']
['{19938FAD-FE0E-4DBB-8754-1DD175921CE6}']
{ Property getters and setters }
function GetCONTRATOValue: String;
procedure SetCONTRATOValue(const aValue: String);
@ -2856,7 +2870,7 @@ type
end;
{ TContratosEmpleadosDataTableRules }
TContratosEmpleadosDataTableRules = class(TIntfObjectDADataTableRules, IContratosEmpleados)
TContratosEmpleadosDataTableRules = class(TDADataTableRules, IContratosEmpleados)
private
protected
{ Property getters and setters }
@ -2877,7 +2891,7 @@ type
{ IDescripcionesProveedores }
IDescripcionesProveedores = interface(IDAStronglyTypedDataTable)
['{C4B8E28F-E02E-4B73-ACF7-C7C25DDF5C94}']
['{663EDF89-9632-4999-8426-33DD3287B421}']
{ Property getters and setters }
function GetDESCRIPCION_PROVEEDORValue: String;
procedure SetDESCRIPCION_PROVEEDORValue(const aValue: String);
@ -2891,7 +2905,7 @@ type
end;
{ TDescripcionesProveedoresDataTableRules }
TDescripcionesProveedoresDataTableRules = class(TIntfObjectDADataTableRules, IDescripcionesProveedores)
TDescripcionesProveedoresDataTableRules = class(TDADataTableRules, IDescripcionesProveedores)
private
protected
{ Property getters and setters }
@ -4403,6 +4417,27 @@ begin
DataTable.Fields[idx_ClientesCODIGO_ASIGNADO].AsVariant := Null;
end;
function TClientesDataTableRules.GetDESCUENTOValue: Float;
begin
result := DataTable.Fields[idx_ClientesDESCUENTO].AsFloat;
end;
procedure TClientesDataTableRules.SetDESCUENTOValue(const aValue: Float);
begin
DataTable.Fields[idx_ClientesDESCUENTO].AsFloat := aValue;
end;
function TClientesDataTableRules.GetDESCUENTOIsNull: boolean;
begin
result := DataTable.Fields[idx_ClientesDESCUENTO].IsNull;
end;
procedure TClientesDataTableRules.SetDESCUENTOIsNull(const aValue: Boolean);
begin
if aValue then
DataTable.Fields[idx_ClientesDESCUENTO].AsVariant := Null;
end;
{ TProveedoresDataTableRules }
constructor TProveedoresDataTableRules.Create(aDataTable: TDADataTable);

View File

@ -3,31 +3,30 @@ unit schContactosServer_Intf;
interface
uses
Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, FmtBCD, uROXMLIntf,
schContactosClient_Intf;
Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, FmtBCD, uROXMLIntf, schContactosClient_Intf;
const
{ Delta rules ids
Feel free to change them to something more human readable
but make sure they are unique in the context of your application }
RID_ContactosDelta = '{25188B95-F041-4781-A357-50DAC38D4CE2}';
RID_GruposClienteDelta = '{AECDD262-DF71-427E-B7E9-73E8D23ECC47}';
RID_DatosBancariosDelta = '{2803B9AB-C984-4BFB-9FB5-179343CC74BB}';
RID_ClientesDelta = '{1AB55D90-E9A6-42D1-9708-458EAA358CD7}';
RID_ProveedoresDelta = '{91961AA7-2E89-4833-89E2-633B80BE3383}';
RID_EmpleadosDelta = '{38129037-CCCD-4E3D-83A1-8F9B31FF3D05}';
RID_DireccionesContactoDelta = '{E2A1E6A4-09FD-4E0A-B26A-B7827984C26D}';
RID_ClientesDescuentosDelta = '{9418EBB5-5197-4AB9-8526-BDAE38276700}';
RID_GruposProveedorDelta = '{BDB82401-1178-492A-ABDF-240FA1B8D99A}';
RID_GruposEmpleadoDelta = '{C5CBE45F-F25F-46E4-94B2-05526873408D}';
RID_Contactos_RefreshDelta = '{62A01664-1F25-49FC-B054-48FE8F8DF7DC}';
RID_ContratosEmpleadosDelta = '{1980411A-046A-4D73-BDC3-3F0496E25C2E}';
RID_DescripcionesProveedoresDelta = '{BC903E83-347B-4721-82CC-2DED553889C5}';
RID_ContactosDelta = '{48772AD3-B3EF-47A9-9A2E-4B73FBA9F204}';
RID_GruposClienteDelta = '{5CA21C80-5EE4-4BC4-A0AF-4EA4E0188770}';
RID_DatosBancariosDelta = '{97461A25-FB3D-49BA-989A-A2E864F15627}';
RID_ClientesDelta = '{5016B0EA-1E67-418C-A1D6-EF9F83F925A4}';
RID_ProveedoresDelta = '{6DC81353-DA9A-4A2C-A6AD-CFAA90594978}';
RID_EmpleadosDelta = '{03404F6B-31CE-4F3B-8D43-DAFFDC77CBBB}';
RID_DireccionesContactoDelta = '{066EBDC7-C2AD-4209-A7C3-23944DD103FC}';
RID_ClientesDescuentosDelta = '{413AE0E8-F254-4E30-ABED-EBE6F71364D1}';
RID_GruposProveedorDelta = '{C9615F62-830B-4D69-BBFB-30DE694AE18C}';
RID_GruposEmpleadoDelta = '{A377B6BA-5DDE-4A8E-9BAC-0902EDBAF875}';
RID_Contactos_RefreshDelta = '{EEC8A345-7AF4-457A-A883-D2AFDF07612D}';
RID_ContratosEmpleadosDelta = '{5E3050CF-49C5-47E4-909F-0B9E07569989}';
RID_DescripcionesProveedoresDelta = '{45A8AB79-936E-4D24-90FE-35C63BA77AB5}';
type
{ IContactosDelta }
IContactosDelta = interface(IContactos)
['{25188B95-F041-4781-A357-50DAC38D4CE2}']
['{48772AD3-B3EF-47A9-9A2E-4B73FBA9F204}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_CATEGORIAValue : Integer;
@ -326,7 +325,7 @@ type
{ IGruposClienteDelta }
IGruposClienteDelta = interface(IGruposCliente)
['{AECDD262-DF71-427E-B7E9-73E8D23ECC47}']
['{5CA21C80-5EE4-4BC4-A0AF-4EA4E0188770}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldDESCRIPCIONValue : String;
@ -372,7 +371,7 @@ type
{ IDatosBancariosDelta }
IDatosBancariosDelta = interface(IDatosBancarios)
['{2803B9AB-C984-4BFB-9FB5-179343CC74BB}']
['{97461A25-FB3D-49BA-989A-A2E864F15627}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_CONTACTOValue : Integer;
@ -502,7 +501,7 @@ type
{ IClientesDelta }
IClientesDelta = interface(IClientes)
['{1AB55D90-E9A6-42D1-9708-458EAA358CD7}']
['{5016B0EA-1E67-418C-A1D6-EF9F83F925A4}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_CATEGORIAValue : Integer;
@ -538,6 +537,7 @@ type
function GetOldID_FORMA_PAGOValue : Integer;
function GetOldTIENDA_WEBValue : SmallInt;
function GetOldCODIGO_ASIGNADOValue : String;
function GetOldDESCUENTOValue : Float;
{ Properties }
property OldID : Integer read GetOldIDValue;
@ -574,6 +574,7 @@ type
property OldID_FORMA_PAGO : Integer read GetOldID_FORMA_PAGOValue;
property OldTIENDA_WEB : SmallInt read GetOldTIENDA_WEBValue;
property OldCODIGO_ASIGNADO : String read GetOldCODIGO_ASIGNADOValue;
property OldDESCUENTO : Float read GetOldDESCUENTOValue;
end;
{ TClientesBusinessProcessorRules }
@ -786,6 +787,12 @@ type
function GetOldCODIGO_ASIGNADOIsNull: Boolean; virtual;
procedure SetCODIGO_ASIGNADOValue(const aValue: String); virtual;
procedure SetCODIGO_ASIGNADOIsNull(const aValue: Boolean); virtual;
function GetDESCUENTOValue: Float; virtual;
function GetDESCUENTOIsNull: Boolean; virtual;
function GetOldDESCUENTOValue: Float; virtual;
function GetOldDESCUENTOIsNull: Boolean; virtual;
procedure SetDESCUENTOValue(const aValue: Float); virtual;
procedure SetDESCUENTOIsNull(const aValue: Boolean); virtual;
{ Properties }
property ID : Integer read GetIDValue write SetIDValue;
@ -924,6 +931,10 @@ type
property CODIGO_ASIGNADOIsNull : Boolean read GetCODIGO_ASIGNADOIsNull write SetCODIGO_ASIGNADOIsNull;
property OldCODIGO_ASIGNADO : String read GetOldCODIGO_ASIGNADOValue;
property OldCODIGO_ASIGNADOIsNull : Boolean read GetOldCODIGO_ASIGNADOIsNull;
property DESCUENTO : Float read GetDESCUENTOValue write SetDESCUENTOValue;
property DESCUENTOIsNull : Boolean read GetDESCUENTOIsNull write SetDESCUENTOIsNull;
property OldDESCUENTO : Float read GetOldDESCUENTOValue;
property OldDESCUENTOIsNull : Boolean read GetOldDESCUENTOIsNull;
public
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
@ -933,7 +944,7 @@ type
{ IProveedoresDelta }
IProveedoresDelta = interface(IProveedores)
['{91961AA7-2E89-4833-89E2-633B80BE3383}']
['{6DC81353-DA9A-4A2C-A6AD-CFAA90594978}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_CATEGORIAValue : Integer;
@ -1352,7 +1363,7 @@ type
{ IEmpleadosDelta }
IEmpleadosDelta = interface(IEmpleados)
['{38129037-CCCD-4E3D-83A1-8F9B31FF3D05}']
['{03404F6B-31CE-4F3B-8D43-DAFFDC77CBBB}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_CATEGORIAValue : Integer;
@ -1751,7 +1762,7 @@ type
{ IDireccionesContactoDelta }
IDireccionesContactoDelta = interface(IDireccionesContacto)
['{E2A1E6A4-09FD-4E0A-B26A-B7827984C26D}']
['{066EBDC7-C2AD-4209-A7C3-23944DD103FC}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_CONTACTOValue : Integer;
@ -1966,7 +1977,7 @@ type
{ IClientesDescuentosDelta }
IClientesDescuentosDelta = interface(IClientesDescuentos)
['{9418EBB5-5197-4AB9-8526-BDAE38276700}']
['{413AE0E8-F254-4E30-ABED-EBE6F71364D1}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_CLIENTEValue : Integer;
@ -2048,7 +2059,7 @@ type
{ IGruposProveedorDelta }
IGruposProveedorDelta = interface(IGruposProveedor)
['{BDB82401-1178-492A-ABDF-240FA1B8D99A}']
['{C9615F62-830B-4D69-BBFB-30DE694AE18C}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldDESCRIPCIONValue : String;
@ -2094,7 +2105,7 @@ type
{ IGruposEmpleadoDelta }
IGruposEmpleadoDelta = interface(IGruposEmpleado)
['{C5CBE45F-F25F-46E4-94B2-05526873408D}']
['{A377B6BA-5DDE-4A8E-9BAC-0902EDBAF875}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldDESCRIPCIONValue : String;
@ -2140,7 +2151,7 @@ type
{ IContactos_RefreshDelta }
IContactos_RefreshDelta = interface(IContactos_Refresh)
['{62A01664-1F25-49FC-B054-48FE8F8DF7DC}']
['{EEC8A345-7AF4-457A-A883-D2AFDF07612D}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldNIF_CIFValue : String;
@ -2415,7 +2426,7 @@ type
{ IContratosEmpleadosDelta }
IContratosEmpleadosDelta = interface(IContratosEmpleados)
['{1980411A-046A-4D73-BDC3-3F0496E25C2E}']
['{5E3050CF-49C5-47E4-909F-0B9E07569989}']
{ Property getters and setters }
function GetOldCONTRATOValue : String;
@ -2449,7 +2460,7 @@ type
{ IDescripcionesProveedoresDelta }
IDescripcionesProveedoresDelta = interface(IDescripcionesProveedores)
['{BC903E83-347B-4721-82CC-2DED553889C5}']
['{45A8AB79-936E-4D24-90FE-35C63BA77AB5}']
{ Property getters and setters }
function GetOldDESCRIPCION_PROVEEDORValue : String;
@ -4657,6 +4668,37 @@ begin
BusinessProcessor.CurrentChange.NewValueByName[fld_ClientesCODIGO_ASIGNADO] := Null;
end;
function TClientesBusinessProcessorRules.GetDESCUENTOValue: Float;
begin
result := BusinessProcessor.CurrentChange.NewValueByName[fld_ClientesDESCUENTO];
end;
function TClientesBusinessProcessorRules.GetDESCUENTOIsNull: Boolean;
begin
result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ClientesDESCUENTO]);
end;
function TClientesBusinessProcessorRules.GetOldDESCUENTOValue: Float;
begin
result := BusinessProcessor.CurrentChange.OldValueByName[fld_ClientesDESCUENTO];
end;
function TClientesBusinessProcessorRules.GetOldDESCUENTOIsNull: Boolean;
begin
result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ClientesDESCUENTO]);
end;
procedure TClientesBusinessProcessorRules.SetDESCUENTOValue(const aValue: Float);
begin
BusinessProcessor.CurrentChange.NewValueByName[fld_ClientesDESCUENTO] := aValue;
end;
procedure TClientesBusinessProcessorRules.SetDESCUENTOIsNull(const aValue: Boolean);
begin
if aValue then
BusinessProcessor.CurrentChange.NewValueByName[fld_ClientesDESCUENTO] := Null;
end;
{ TProveedoresBusinessProcessorRules }
constructor TProveedoresBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);

View File

@ -103,6 +103,7 @@ begin
ParamByName('ID_FORMA_PAGO').Value := aChange.NewValueByName[fld_ClientesID_FORMA_PAGO];
ParamByName('TIENDA_WEB').Value := aChange.NewValueByName[fld_ClientesTIENDA_WEB];
ParamByName('CODIGO_ASIGNADO').Value := aChange.NewValueByName[fld_ClientesCODIGO_ASIGNADO];
ParamByName('DESCUENTO').Value := aChange.NewValueByName[fld_ClientesDESCUENTO];
Execute;
end;
@ -141,6 +142,7 @@ begin
ParamByName('ID_FORMA_PAGO').Value := aChange.NewValueByName[fld_ClientesID_FORMA_PAGO];
ParamByName('TIENDA_WEB').Value := aChange.NewValueByName[fld_ClientesTIENDA_WEB];
ParamByName('CODIGO_ASIGNADO').Value := aChange.NewValueByName[fld_ClientesCODIGO_ASIGNADO];
ParamByName('DESCUENTO').Value := aChange.NewValueByName[fld_ClientesDESCUENTO];
Execute;
end;
finally

View File

@ -528,6 +528,10 @@ object srvContactos: TsrvContactos
item
DatasetField = 'CODIGO_ASIGNADO'
TableField = 'CODIGO_ASIGNADO'
end
item
DatasetField = 'DESCUENTO'
TableField = 'DESCUENTO'
end>
end>
Name = 'Clientes'
@ -725,6 +729,10 @@ object srvContactos: TsrvContactos
Name = 'CODIGO_ASIGNADO'
DataType = datString
Size = 255
end
item
Name = 'DESCUENTO'
DataType = datFloat
end>
end
item
@ -2639,6 +2647,10 @@ object srvContactos: TsrvContactos
item
Name = 'CODIGO_ASIGNADO'
Value = ''
end
item
Name = 'DESCUENTO'
Value = ''
end>
Statements = <
item
@ -2648,11 +2660,11 @@ object srvContactos: TsrvContactos
'INSERT'#10' INTO CLIENTES_DATOS'#10' (ID_CLIENTE, GRUPO_CLIENTE, REC' +
'ARGO_EQUIVALENCIA,'#10' NOMBRE_COMERCIAL, VENCIMIENTO_FACTURAS, ' +
'BLOQUEADO, MOTIVO_BLOQUEO,'#10' REGIMEN_IVA, ID_TIPO_IVA, ID_FOR' +
'MA_PAGO, TIENDA_WEB, CODIGO_ASIGNADO)'#10' VALUES'#10' (:ID_CLIENTE,' +
' :GRUPO_CLIENTE, :RECARGO_EQUIVALENCIA,'#10' :NOMBRE_COMERCIAL, ' +
':VENCIMIENTO_FACTURAS,'#10' :BLOQUEADO, :MOTIVO_BLOQUEO, :REGIME' +
'N_IVA,'#10' :ID_TIPO_IVA, :ID_FORMA_PAGO, :TIENDA_WEB, :CODIGO_A' +
'SIGNADO)'#10
'MA_PAGO, TIENDA_WEB, CODIGO_ASIGNADO,'#10' DESCUENTO)'#10' VALUES'#10' ' +
' (:ID_CLIENTE, :GRUPO_CLIENTE, :RECARGO_EQUIVALENCIA,'#10' :NO' +
'MBRE_COMERCIAL, :VENCIMIENTO_FACTURAS,'#10' :BLOQUEADO, :MOTIVO_' +
'BLOQUEO, :REGIMEN_IVA,'#10' :ID_TIPO_IVA, :ID_FORMA_PAGO, :TIEND' +
'A_WEB, :CODIGO_ASIGNADO,'#10' :DESCUENTO)'#10
StatementType = stSQL
ColumnMappings = <>
end>
@ -2728,6 +2740,10 @@ object srvContactos: TsrvContactos
Name = 'CODIGO_ASIGNADO'
Value = ''
end
item
Name = 'DESCUENTO'
Value = ''
end
item
Name = 'OLD_ID_CLIENTE'
Value = ''
@ -2744,8 +2760,8 @@ object srvContactos: TsrvContactos
'NCIMIENTO_FACTURAS,'#10' BLOQUEADO = :BLOQUEADO,'#10' REGIMEN_IVA ' +
'= :REGIMEN_IVA,'#10' ID_TIPO_IVA = :ID_TIPO_IVA,'#10' ID_FORMA_PAG' +
'O = :ID_FORMA_PAGO,'#10' TIENDA_WEB = :TIENDA_WEB,'#10' CODIGO_ASI' +
'GNADO = :CODIGO_ASIGNADO'#10' WHERE'#10' (ID_CLIENTE = :OLD_ID_CLIEN' +
'TE)'#10
'GNADO = :CODIGO_ASIGNADO,'#10' DESCUENTO = :DESCUENTO'#10' WHERE'#10' ' +
' (ID_CLIENTE = :OLD_ID_CLIENTE)'#10
StatementType = stSQL
ColumnMappings = <>
end>

View File

@ -53,7 +53,7 @@ uses
uDataModuleServer, uDatabaseUtils, uUsersManager,
schContactosClient_Intf, uBizEmpleadosServer,
uBizClientesServer, uBizProveedoresServer, uRestriccionesUsuarioUtils,
uStringsUtils,
uStringsUtils, Variants,
uRptFichasEmpleado_Server, uRptEtiquetasContacto_Server;
procedure Create_srvContactos(out anInstance : IUnknown);
@ -102,6 +102,7 @@ begin
try
while not dsContratos.EOF do
begin
if not VarIsNull(dsContratos.FieldValues[0]) then
Aux.Add(dsContratos.FieldValues[0]);
dsContratos.Next;
end;
@ -123,6 +124,7 @@ begin
try
while not dsDescripciones.EOF do
begin
if not VarIsNull(dsDescripciones.FieldValues[0]) then
Aux.Add(dsDescripciones.FieldValues[0]);
dsDescripciones.Next;
end;

View File

@ -65,7 +65,7 @@ inherited fEditorCliente: TfEditorCliente
inherited pgPaginas: TPageControl
Width = 650
Height = 484
ActivePage = pagDirecciones
ActivePage = pagDescuentos
ExplicitWidth = 650
ExplicitHeight = 484
inherited pagGeneral: TTabSheet
@ -180,9 +180,9 @@ inherited fEditorCliente: TfEditorCliente
Top = 315
ExplicitLeft = 431
ExplicitTop = 315
ExplicitWidth = 192
ExplicitWidth = 189
ExplicitHeight = 34
Width = 192
Width = 189
end
inherited eTlfParticular: TcxDBTextEdit
Left = 526
@ -338,20 +338,24 @@ inherited fEditorCliente: TfEditorCliente
LookAndFeel = dxLayoutOfficeLookAndFeel
ExplicitWidth = 642
inherited Label1: TLabel
Left = 393
Left = 397
Top = 30
Width = 206
Height = 39
ExplicitLeft = 393
Width = 196
ExplicitLeft = 397
ExplicitTop = 30
ExplicitWidth = 206
ExplicitHeight = 39
ExplicitWidth = 196
end
inherited Bevel1: TBevel
Top = 138
Width = 263
ExplicitTop = 138
ExplicitWidth = 263
end
inherited eDiasVencimiento: TcxDBSpinEdit
Left = 460
Top = 75
Top = 62
ExplicitLeft = 460
ExplicitTop = 75
ExplicitTop = 62
ExplicitWidth = 160
Width = 160
end
@ -374,9 +378,9 @@ inherited fEditorCliente: TfEditorCliente
Width = 121
end
inherited bFormasPago: TButton
Left = 233
Left = 237
Top = 57
ExplicitLeft = 233
ExplicitLeft = 237
ExplicitTop = 57
end
inherited eIVA: TcxDBLookupComboBox
@ -386,11 +390,15 @@ inherited fEditorCliente: TfEditorCliente
Width = 121
end
inherited bTiposIVA: TButton
Left = 233
Left = 237
Top = 84
ExplicitLeft = 233
ExplicitLeft = 237
ExplicitTop = 84
end
inherited eDescuento: TcxDBSpinEdit
Top = 149
ExplicitTop = 149
end
end
end
end

View File

@ -15,23 +15,31 @@ inherited frViewClienteDatosComerciales: TfrViewClienteDatosComerciales
TabOrder = 0
AutoContentSizes = [acsWidth]
object Label1: TLabel
Left = 353
Left = 412
Top = 28
Width = 299
Width = 196
Height = 26
Caption =
'Puede indicar los d'#237'as de vencimiento predeterminados que se uti' +
'lizar'#225'n para las facturas de este cliente.'
'Puede indicar el d'#237'a del mes en el cual es cliente realiza los p' +
'agos.'
Transparent = True
WordWrap = True
end
object Bevel1: TBevel
Left = 22
Top = 136
Width = 263
Height = 5
Shape = bsBottomLine
end
object eDiasVencimiento: TcxDBSpinEdit
Left = 420
Left = 475
Top = 60
DataBinding.DataField = 'VENCIMIENTO_FACTURAS'
DataBinding.DataSource = dsDatosComerciales
Properties.AssignedValues.MinValue = True
Properties.ImmediatePost = True
Properties.SpinButtons.Visible = False
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
Style.HotTrack = False
@ -44,11 +52,11 @@ inherited frViewClienteDatosComerciales: TfrViewClienteDatosComerciales
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 6
TabOrder = 7
Width = 79
end
object cbRegimenIVA: TcxDBComboBox
Left = 107
Left = 111
Top = 28
DataBinding.DataField = 'REGIMEN_IVA'
DataBinding.DataSource = dsDatosComerciales
@ -73,7 +81,7 @@ inherited frViewClienteDatosComerciales: TfrViewClienteDatosComerciales
Width = 121
end
object cbRecargoEquivalencia: TcxDBCheckBox
Left = 107
Left = 111
Top = 109
Caption = 'Aplicar recargo de equivalencia'
DataBinding.DataField = 'RECARGO_EQUIVALENCIA'
@ -97,7 +105,7 @@ inherited frViewClienteDatosComerciales: TfrViewClienteDatosComerciales
Width = 121
end
object cbFormaPago: TcxDBLookupComboBox
Left = 107
Left = 111
Top = 55
DataBinding.DataField = 'ID_FORMA_PAGO'
DataBinding.DataSource = dsDatosComerciales
@ -128,7 +136,7 @@ inherited frViewClienteDatosComerciales: TfrViewClienteDatosComerciales
Width = 121
end
object bFormasPago: TButton
Left = 191
Left = 250
Top = 55
Width = 132
Height = 21
@ -137,7 +145,7 @@ inherited frViewClienteDatosComerciales: TfrViewClienteDatosComerciales
OnClick = bFormasPagoClick
end
object eIVA: TcxDBLookupComboBox
Left = 107
Left = 111
Top = 82
DataBinding.DataField = 'ID_TIPO_IVA'
DataBinding.DataSource = dsDatosComerciales
@ -168,7 +176,7 @@ inherited frViewClienteDatosComerciales: TfrViewClienteDatosComerciales
Width = 121
end
object bTiposIVA: TButton
Left = 191
Left = 250
Top = 82
Width = 132
Height = 21
@ -176,6 +184,28 @@ inherited frViewClienteDatosComerciales: TfrViewClienteDatosComerciales
TabOrder = 4
OnClick = bTiposIVAClick
end
object eDescuento: TcxDBSpinEdit
Left = 111
Top = 147
DataBinding.DataField = 'DESCUENTO'
DataBinding.DataSource = dsDatosComerciales
Properties.AssignedValues.MinValue = True
Properties.ImmediatePost = True
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
Style.ButtonStyle = bts3D
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 6
Width = 133
end
object dxLayoutGroup1: TdxLayoutGroup
ShowCaption = False
Hidden = True
@ -240,6 +270,18 @@ inherited frViewClienteDatosComerciales: TfrViewClienteDatosComerciales
Control = cbRecargoEquivalencia
ControlOptions.ShowBorder = False
end
object dxLayoutControl1Item10: TdxLayoutItem
Caption = 'Bevel1'
ShowCaption = False
Control = Bevel1
ControlOptions.ShowBorder = False
end
object dxLayoutControl1Item1: TdxLayoutItem
AutoAligns = [aaVertical]
Caption = 'Dto. por defecto:'
Control = eDescuento
ControlOptions.ShowBorder = False
end
end
object dxLayoutControl1Group5: TdxLayoutGroup
AutoAligns = [aaVertical]
@ -256,7 +298,7 @@ inherited frViewClienteDatosComerciales: TfrViewClienteDatosComerciales
end
object dxLayoutControl1Item2: TdxLayoutItem
AutoAligns = [aaVertical]
Caption = 'D'#237'as de vto.:'
Caption = 'D'#237'a del mes:'
Control = eDiasVencimiento
ControlOptions.ShowBorder = False
end

View File

@ -8,7 +8,7 @@ uses
cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxLookupEdit,
cxDBLookupEdit, cxDBLookupComboBox, cxControls, cxSpinEdit, cxDBEdit,
uBizContactos, cxCheckBox, StdCtrls, uFormasPagoController, uTiposIVAController,
uDAInterfaces, uBizFormasPago, uBizTiposIVA;
uDAInterfaces, uBizFormasPago, uBizTiposIVA, ExtCtrls;
type
IViewClienteDatosComerciales = interface(IViewBase)
@ -45,6 +45,10 @@ type
dsTiposIVA: TDADataSource;
dxLayoutControl1Group1: TdxLayoutGroup;
dxLayoutControl1Group2: TdxLayoutGroup;
dxLayoutControl1Item1: TdxLayoutItem;
eDescuento: TcxDBSpinEdit;
Bevel1: TBevel;
dxLayoutControl1Item10: TdxLayoutItem;
procedure CustomViewCreate(Sender: TObject);
procedure CustomViewDestroy(Sender: TObject);
procedure cbRegimenIVAPropertiesInitPopup(Sender: TObject);