Generacion automatica de subcuenta en clientes
git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@160 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
parent
c304b78a06
commit
2b113642b0
@ -82,6 +82,36 @@ object srvEjercicios: TsrvEjercicios
|
|||||||
DataDictionary = DataDictionary
|
DataDictionary = DataDictionary
|
||||||
Diagrams = Diagrams
|
Diagrams = Diagrams
|
||||||
Datasets = <
|
Datasets = <
|
||||||
|
item
|
||||||
|
Params = <
|
||||||
|
item
|
||||||
|
Name = 'ID_EMPRESA'
|
||||||
|
Value = ''
|
||||||
|
ParamType = daptInput
|
||||||
|
end>
|
||||||
|
Statements = <
|
||||||
|
item
|
||||||
|
Connection = 'IBX'
|
||||||
|
ConnectionType = 'Interbase'
|
||||||
|
Default = True
|
||||||
|
Name = 'IBX'
|
||||||
|
SQL =
|
||||||
|
'select ID'#10'from cont_ejercicios'#10'where cont_ejercicios.activo = 1'#10 +
|
||||||
|
'and cont_ejercicios.id_empresa = :ID_EMPRESA'#10
|
||||||
|
StatementType = stSQL
|
||||||
|
ColumnMappings = <
|
||||||
|
item
|
||||||
|
DatasetField = 'ID'
|
||||||
|
TableField = 'ID'
|
||||||
|
end>
|
||||||
|
end>
|
||||||
|
Name = 'darEjercicioActivo'
|
||||||
|
Fields = <
|
||||||
|
item
|
||||||
|
Name = 'ID'
|
||||||
|
DataType = datInteger
|
||||||
|
end>
|
||||||
|
end
|
||||||
item
|
item
|
||||||
Params = <>
|
Params = <>
|
||||||
Statements = <
|
Statements = <
|
||||||
|
|||||||
@ -31,14 +31,15 @@ type
|
|||||||
|
|
||||||
protected
|
protected
|
||||||
function GenerarPGC(const ID_EJERCICIO_COPIA: Integer; const ID_EJERCICIO: Integer): Boolean;
|
function GenerarPGC(const ID_EJERCICIO_COPIA: Integer; const ID_EJERCICIO: Integer): Boolean;
|
||||||
|
public
|
||||||
|
function DarEjercicioActivo(const ID_EMPRESA: Integer): Integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
uses
|
uses
|
||||||
{Generated:} FactuGES_Invk, uBizEjerciciosServer, uDataModuleServer, uROClasses,
|
{Generated:} FactuGES_Invk, uDAInterfaces, uBizEjerciciosServer, uDataModuleServer, uROClasses,
|
||||||
uDatabaseUtils;
|
uDatabaseUtils;
|
||||||
|
|
||||||
procedure Create_srvEjercicios(out anInstance : IUnknown);
|
procedure Create_srvEjercicios(out anInstance : IUnknown);
|
||||||
@ -47,6 +48,30 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ srvEjercicios }
|
{ srvEjercicios }
|
||||||
|
function TsrvEjercicios.DarEjercicioActivo(const ID_EMPRESA: Integer): Integer;
|
||||||
|
var
|
||||||
|
AConn : IDAConnection;
|
||||||
|
dsData: IDADataset;
|
||||||
|
|
||||||
|
begin
|
||||||
|
AConn := dmServer.ConnectionManager.NewConnection(dmServer.ConnectionManager.GetDefaultConnectionName);
|
||||||
|
|
||||||
|
try
|
||||||
|
try
|
||||||
|
dsData := schEjercicios.NewDataset(AConn, 'darEjercicioActivo', ['ID_EMPRESA'], [ID_EMPRESA]);
|
||||||
|
dsData.Active := True;
|
||||||
|
Result := dsData.FieldValues[0];
|
||||||
|
AConn.CommitTransaction;
|
||||||
|
|
||||||
|
except
|
||||||
|
RaiseError('Error al buscar ejercicio activo de la empresa');
|
||||||
|
AConn.RollbackTransaction;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
dsData := NIL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TsrvEjercicios.DARemoteServiceCreate(Sender: TObject);
|
procedure TsrvEjercicios.DARemoteServiceCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
SessionManager := dmServer.SessionManager;
|
SessionManager := dmServer.SessionManager;
|
||||||
|
|||||||
Binary file not shown.
@ -10,6 +10,7 @@
|
|||||||
<Projects Include="..\..\GUIBase\GUIBase.dproj" />
|
<Projects Include="..\..\GUIBase\GUIBase.dproj" />
|
||||||
<Projects Include="..\..\Servidor\FactuGES_Server.dproj" />
|
<Projects Include="..\..\Servidor\FactuGES_Server.dproj" />
|
||||||
<Projects Include="..\Articulos\Views\Articulos_view.dproj" />
|
<Projects Include="..\Articulos\Views\Articulos_view.dproj" />
|
||||||
|
<Projects Include="..\Contactos\Controller\Contactos_controller.dproj" />
|
||||||
<Projects Include="..\Contactos\Views\Contactos_view.dproj" />
|
<Projects Include="..\Contactos\Views\Contactos_view.dproj" />
|
||||||
<Projects Include="..\Facturas de cliente\Views\FacturasCliente_view.dproj" />
|
<Projects Include="..\Facturas de cliente\Views\FacturasCliente_view.dproj" />
|
||||||
<Projects Include="..\Facturas de proveedor\Views\FacturasProveedor_view.dproj" />
|
<Projects Include="..\Facturas de proveedor\Views\FacturasProveedor_view.dproj" />
|
||||||
@ -52,6 +53,15 @@
|
|||||||
<Target Name="ApplicationBase:Make">
|
<Target Name="ApplicationBase:Make">
|
||||||
<MSBuild Projects="..\..\ApplicationBase\ApplicationBase.dproj" Targets="Make" />
|
<MSBuild Projects="..\..\ApplicationBase\ApplicationBase.dproj" Targets="Make" />
|
||||||
</Target>
|
</Target>
|
||||||
|
<Target Name="Contactos_controller">
|
||||||
|
<MSBuild Projects="..\Contactos\Controller\Contactos_controller.dproj" Targets="" />
|
||||||
|
</Target>
|
||||||
|
<Target Name="Contactos_controller:Clean">
|
||||||
|
<MSBuild Projects="..\Contactos\Controller\Contactos_controller.dproj" Targets="Clean" />
|
||||||
|
</Target>
|
||||||
|
<Target Name="Contactos_controller:Make">
|
||||||
|
<MSBuild Projects="..\Contactos\Controller\Contactos_controller.dproj" Targets="Make" />
|
||||||
|
</Target>
|
||||||
<Target Name="Contactos_view">
|
<Target Name="Contactos_view">
|
||||||
<MSBuild Projects="..\Contactos\Views\Contactos_view.dproj" Targets="" />
|
<MSBuild Projects="..\Contactos\Views\Contactos_view.dproj" Targets="" />
|
||||||
</Target>
|
</Target>
|
||||||
@ -152,13 +162,13 @@
|
|||||||
<MSBuild Projects="..\Articulos\Views\Articulos_view.dproj" Targets="Make" />
|
<MSBuild Projects="..\Articulos\Views\Articulos_view.dproj" Targets="Make" />
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="Build">
|
<Target Name="Build">
|
||||||
<CallTarget Targets="Base;GUIBase;ApplicationBase;Contactos_view;Contabilidad_model;Contabilidad_data;Contabilidad_controller;Contabilidad_view;Contabilidad_plugin;FactuGES;FactuGES_Server;FacturasProveedor_view;FacturasCliente_view;Articulos_view" />
|
<CallTarget Targets="Base;GUIBase;ApplicationBase;Contactos_controller;Contactos_view;Contabilidad_model;Contabilidad_data;Contabilidad_controller;Contabilidad_view;Contabilidad_plugin;FactuGES;FactuGES_Server;FacturasProveedor_view;FacturasCliente_view;Articulos_view" />
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="Clean">
|
<Target Name="Clean">
|
||||||
<CallTarget Targets="Base:Clean;GUIBase:Clean;ApplicationBase:Clean;Contactos_view:Clean;Contabilidad_model:Clean;Contabilidad_data:Clean;Contabilidad_controller:Clean;Contabilidad_view:Clean;Contabilidad_plugin:Clean;FactuGES:Clean;FactuGES_Server:Clean;FacturasProveedor_view:Clean;FacturasCliente_view:Clean;Articulos_view:Clean" />
|
<CallTarget Targets="Base:Clean;GUIBase:Clean;ApplicationBase:Clean;Contactos_controller:Clean;Contactos_view:Clean;Contabilidad_model:Clean;Contabilidad_data:Clean;Contabilidad_controller:Clean;Contabilidad_view:Clean;Contabilidad_plugin:Clean;FactuGES:Clean;FactuGES_Server:Clean;FacturasProveedor_view:Clean;FacturasCliente_view:Clean;Articulos_view:Clean" />
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="Make">
|
<Target Name="Make">
|
||||||
<CallTarget Targets="Base:Make;GUIBase:Make;ApplicationBase:Make;Contactos_view:Make;Contabilidad_model:Make;Contabilidad_data:Make;Contabilidad_controller:Make;Contabilidad_view:Make;Contabilidad_plugin:Make;FactuGES:Make;FactuGES_Server:Make;FacturasProveedor_view:Make;FacturasCliente_view:Make;Articulos_view:Make" />
|
<CallTarget Targets="Base:Make;GUIBase:Make;ApplicationBase:Make;Contactos_controller:Make;Contactos_view:Make;Contabilidad_model:Make;Contabilidad_data:Make;Contabilidad_controller:Make;Contabilidad_view:Make;Contabilidad_plugin:Make;FactuGES:Make;FactuGES_Server:Make;FacturasProveedor_view:Make;FacturasCliente_view:Make;Articulos_view:Make" />
|
||||||
</Target>
|
</Target>
|
||||||
<Import Condition="Exists('$(MSBuildBinPath)\Borland.Group.Targets')" Project="$(MSBuildBinPath)\Borland.Group.Targets" />
|
<Import Condition="Exists('$(MSBuildBinPath)\Borland.Group.Targets')" Project="$(MSBuildBinPath)\Borland.Group.Targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@ -338,6 +338,110 @@ object srvContabilidad: TsrvContabilidad
|
|||||||
DataDictionary = DataDictionary
|
DataDictionary = DataDictionary
|
||||||
Diagrams = Diagrams
|
Diagrams = Diagrams
|
||||||
Datasets = <
|
Datasets = <
|
||||||
|
item
|
||||||
|
Params = <
|
||||||
|
item
|
||||||
|
Name = 'ID_EMPRESA'
|
||||||
|
Value = ''
|
||||||
|
ParamType = daptInput
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'ID_TIENDA'
|
||||||
|
Value = ''
|
||||||
|
ParamType = daptInput
|
||||||
|
end>
|
||||||
|
Statements = <
|
||||||
|
item
|
||||||
|
Connection = 'IBX'
|
||||||
|
ConnectionType = 'Interbase'
|
||||||
|
Default = True
|
||||||
|
Name = 'IBX'
|
||||||
|
SQL =
|
||||||
|
'select CODIGO_CONTABLE'#10'from empresas_tiendas'#10'where ID_EMPRESA = ' +
|
||||||
|
':ID_EMPRESA'#10'and ID = :ID_TIENDA'#10
|
||||||
|
StatementType = stSQL
|
||||||
|
ColumnMappings = <
|
||||||
|
item
|
||||||
|
DatasetField = 'CODIGO_CONTABLE'
|
||||||
|
TableField = 'CODIGO_CONTABLE'
|
||||||
|
end>
|
||||||
|
end>
|
||||||
|
Name = 'DarCodigoContableTienda'
|
||||||
|
Fields = <
|
||||||
|
item
|
||||||
|
Name = 'CODIGO_CONTABLE'
|
||||||
|
DataType = datString
|
||||||
|
Size = 2
|
||||||
|
end>
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Params = <
|
||||||
|
item
|
||||||
|
Name = 'ID_EJERCICIO'
|
||||||
|
Value = ''
|
||||||
|
ParamType = daptInput
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'REF_CUENTA'
|
||||||
|
Value = ''
|
||||||
|
ParamType = daptInput
|
||||||
|
end>
|
||||||
|
Statements = <
|
||||||
|
item
|
||||||
|
Connection = 'IBX'
|
||||||
|
ConnectionType = 'Interbase'
|
||||||
|
Default = True
|
||||||
|
Name = 'IBX'
|
||||||
|
SQL =
|
||||||
|
'select max(cast(substr(cont_subcuentas.ref_subcuenta, 6, 10) as ' +
|
||||||
|
'Integer))'#10'from cont_subcuentas'#10'left join cont_cuentas on cont_cu' +
|
||||||
|
'entas.id = cont_subcuentas.id_cuenta'#10'where cont_subcuentas.id_ej' +
|
||||||
|
'ercicio = :ID_EJERCICIO'#10'and cont_cuentas.ref_cuenta = :REF_CUENT' +
|
||||||
|
'A'#10
|
||||||
|
StatementType = stSQL
|
||||||
|
ColumnMappings = <
|
||||||
|
item
|
||||||
|
DatasetField = 'MAX'
|
||||||
|
TableField = 'MAX'
|
||||||
|
end>
|
||||||
|
end>
|
||||||
|
Name = 'DarMaxRefSubCuenta'
|
||||||
|
Fields = <
|
||||||
|
item
|
||||||
|
Name = 'MAX'
|
||||||
|
DataType = datInteger
|
||||||
|
end>
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Params = <
|
||||||
|
item
|
||||||
|
Name = 'ID_CONTACTO'
|
||||||
|
Value = ''
|
||||||
|
ParamType = daptInput
|
||||||
|
end>
|
||||||
|
Statements = <
|
||||||
|
item
|
||||||
|
Connection = 'IBX'
|
||||||
|
ConnectionType = 'Interbase'
|
||||||
|
Default = True
|
||||||
|
Name = 'IBX'
|
||||||
|
SQL =
|
||||||
|
'select COUNT(ID)'#10'from CONT_SUBCUENTAS'#10'where ID_CONTACTO = :ID_CO' +
|
||||||
|
'NTACTO'#10'and {where}'#10#10#10
|
||||||
|
StatementType = stSQL
|
||||||
|
ColumnMappings = <
|
||||||
|
item
|
||||||
|
DatasetField = 'COUNT'
|
||||||
|
TableField = 'COUNT'
|
||||||
|
end>
|
||||||
|
end>
|
||||||
|
Name = 'ExisteSubCuenta'
|
||||||
|
Fields = <
|
||||||
|
item
|
||||||
|
Name = 'COUNT'
|
||||||
|
DataType = datInteger
|
||||||
|
end>
|
||||||
|
end
|
||||||
item
|
item
|
||||||
Params = <>
|
Params = <>
|
||||||
Statements = <
|
Statements = <
|
||||||
@ -1117,6 +1221,44 @@ object srvContabilidad: TsrvContabilidad
|
|||||||
JoinDataTables = <>
|
JoinDataTables = <>
|
||||||
UnionDataTables = <>
|
UnionDataTables = <>
|
||||||
Commands = <
|
Commands = <
|
||||||
|
item
|
||||||
|
Params = <
|
||||||
|
item
|
||||||
|
Name = 'REFERENCIA'
|
||||||
|
Value = ''
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'DESCRIPCION'
|
||||||
|
Value = ''
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'ID_CUENTA'
|
||||||
|
Value = ''
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'ID_EJERCICIO'
|
||||||
|
Value = ''
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'ID_CONTACTO'
|
||||||
|
Value = ''
|
||||||
|
end>
|
||||||
|
Statements = <
|
||||||
|
item
|
||||||
|
Connection = 'IBX'
|
||||||
|
ConnectionType = 'Interbase'
|
||||||
|
Default = True
|
||||||
|
Name = 'IBX'
|
||||||
|
SQL =
|
||||||
|
'insert into CONT_SUBCUENTAS (ID, REF_SUBCUENTA, DESCRIPCION, ID_' +
|
||||||
|
'CUENTA, ID_EJERCICIO, ID_CONTACTO)'#10'values (GEN_ID(gen_cont_subcu' +
|
||||||
|
'entas_id, 1), :REFERENCIA, :DESCRIPCION, :ID_CUENTA, :ID_EJERCIC' +
|
||||||
|
'IO, :ID_CONTACTO)'#10
|
||||||
|
StatementType = stSQL
|
||||||
|
ColumnMappings = <>
|
||||||
|
end>
|
||||||
|
Name = 'AnadirSubCuenta'
|
||||||
|
end
|
||||||
item
|
item
|
||||||
Params = <
|
Params = <
|
||||||
item
|
item
|
||||||
|
|||||||
@ -16,7 +16,11 @@ uses
|
|||||||
{Used RODLs:} DataAbstract4_Intf,
|
{Used RODLs:} DataAbstract4_Intf,
|
||||||
{Generated:} FactuGES_Intf, uDADataTable, uDABINAdapter, uDAClasses,
|
{Generated:} FactuGES_Intf, uDADataTable, uDABINAdapter, uDAClasses,
|
||||||
uDAScriptingProvider, uDABusinessProcessor, uDADataStreamer,
|
uDAScriptingProvider, uDABusinessProcessor, uDADataStreamer,
|
||||||
uDABin2DataStreamer;
|
uDABin2DataStreamer, uDAInterfaces;
|
||||||
|
|
||||||
|
const
|
||||||
|
REFERENCIA_CLIENTES = 430;
|
||||||
|
REFERENCIA_PROVEEDORES = 400;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ TsrvContabilidad }
|
{ TsrvContabilidad }
|
||||||
@ -33,15 +37,21 @@ type
|
|||||||
procedure DARemoteServiceCreate(Sender: TObject);
|
procedure DARemoteServiceCreate(Sender: TObject);
|
||||||
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string);
|
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string);
|
||||||
private
|
private
|
||||||
protected
|
function darEjercicioActivo(const ID_EMPRESA: Integer): Integer;
|
||||||
|
|
||||||
|
public
|
||||||
|
function TieneCuentaAsociada(const ID_CONTACTO: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
function AnadirSubCuentaCliente(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
function AnadirSubCuentaProveedor(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
uses
|
uses
|
||||||
{Generated:} FactuGES_Invk, uDataModuleServer,
|
{Generated:} FactuGES_Invk, uROClasses, uDataModuleServer,
|
||||||
uDatabaseUtils;
|
uDatabaseUtils, srvEjercicios_Impl, Variants;
|
||||||
|
|
||||||
procedure Create_srvContabilidad(out anInstance : IUnknown);
|
procedure Create_srvContabilidad(out anInstance : IUnknown);
|
||||||
begin
|
begin
|
||||||
@ -49,6 +59,98 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ srvContabilidad }
|
{ srvContabilidad }
|
||||||
|
function TsrvContabilidad.AnadirSubCuentaCliente(const ID_CONTACTO, ID_TIENDA: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
var
|
||||||
|
AConn : IDAConnection;
|
||||||
|
dsData: IDADataset;
|
||||||
|
dsCommand: IDASQLCommand;
|
||||||
|
|
||||||
|
RefSubCuenta: String;
|
||||||
|
NumCuenta: Integer;
|
||||||
|
RefTienda: String;
|
||||||
|
NumTienda: Integer;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
|
||||||
|
AConn := dmServer.ConnectionManager.NewConnection(dmServer.ConnectionManager.GetDefaultConnectionName);
|
||||||
|
|
||||||
|
try
|
||||||
|
try
|
||||||
|
dsData := schContabilidad.NewDataset(AConn, 'DarMaxRefSubCuenta', ['ID_EJERCICIO', 'REF_CUENTA'], [darEjercicioActivo(ID_EMPRESA), REFERENCIA_CLIENTES]);
|
||||||
|
dsData.Active := True;
|
||||||
|
|
||||||
|
if VarIsNull(dsData.FieldValues[0]) then
|
||||||
|
NumCuenta := 0
|
||||||
|
else
|
||||||
|
NumCuenta := dsData.FieldValues[0];
|
||||||
|
|
||||||
|
Inc(NumCuenta);
|
||||||
|
RefSubCuenta := format('%.5d', [NumCuenta]);
|
||||||
|
dsData := NIL;
|
||||||
|
|
||||||
|
dsData := schContabilidad.NewDataset(AConn, 'DarCodigoContableTienda', ['ID_EMPRESA', 'ID_TIENDA'], [ID_EMPRESA, ID_TIENDA]);
|
||||||
|
dsData.Active := True;
|
||||||
|
|
||||||
|
if VarIsNull(dsData.FieldValues[0]) then
|
||||||
|
NumTienda := 0
|
||||||
|
else
|
||||||
|
NumTienda := dsData.FieldValues[0];
|
||||||
|
|
||||||
|
RefTienda := format('%.2d', [NumTienda]);
|
||||||
|
RefSubCuenta := IntToStr(REFERENCIA_CLIENTES) + RefTienda + RefSubCuenta;
|
||||||
|
dsData := NIL;
|
||||||
|
AConn.CommitTransaction;
|
||||||
|
|
||||||
|
except
|
||||||
|
RaiseError('Error al buscar nueva referencia para la subcuenta');
|
||||||
|
AConn.RollbackTransaction;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
dsData := NIL;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// AConn := dmServer.ConnectionManager.NewConnection(dmServer.ConnectionManager.GetDefaultConnectionName);
|
||||||
|
|
||||||
|
try
|
||||||
|
try
|
||||||
|
dsCommand := schContabilidad.NewCommand(AConn, 'AnadirSubCuenta');
|
||||||
|
with dsCommand do
|
||||||
|
begin
|
||||||
|
ParamByName('REFERENCIA').AsString := RefSubCuenta;
|
||||||
|
ParamByName('DESCRIPCION').AsString := 'Cuenta de Clieeeeeeeeeeeeeeeeeeeeeeente';
|
||||||
|
ParamByName('ID_CUENTA').AsInteger := 1;
|
||||||
|
ParamByName('ID_EJERCICIO').AsInteger := darEjercicioActivo(ID_EMPRESA);
|
||||||
|
ParamByName('ID_CONTACTO').AsInteger := ID_CONTACTO;
|
||||||
|
end;
|
||||||
|
dsCommand.Execute;
|
||||||
|
AConn.CommitTransaction;
|
||||||
|
Result := True;
|
||||||
|
except
|
||||||
|
RaiseError('Error al crear la nueva subcuenta en tablas');
|
||||||
|
AConn.RollbackTransaction;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
dsCommand := NIL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TsrvContabilidad.AnadirSubCuentaProveedor(const ID_CONTACTO, ID_TIENDA: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TsrvContabilidad.darEjercicioActivo(const ID_EMPRESA: Integer): Integer;
|
||||||
|
begin
|
||||||
|
with TsrvEjercicios.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := DarEjercicioActivo(ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TsrvContabilidad.DARemoteServiceCreate(Sender: TObject);
|
procedure TsrvContabilidad.DARemoteServiceCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
SessionManager := dmServer.SessionManager;
|
SessionManager := dmServer.SessionManager;
|
||||||
@ -60,6 +162,45 @@ begin
|
|||||||
ConnectionName := dmServer.ConnectionName;
|
ConnectionName := dmServer.ConnectionName;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TsrvContabilidad.TieneCuentaAsociada(const ID_CONTACTO: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
var
|
||||||
|
AConn : IDAConnection;
|
||||||
|
dsData: IDADataset;
|
||||||
|
AWhere : TDAWhereExpression;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
AWhere := NIL;
|
||||||
|
|
||||||
|
AConn := dmServer.ConnectionManager.NewConnection(dmServer.ConnectionManager.GetDefaultConnectionName);
|
||||||
|
{ Construir la expresión del Where a partir de los parámetros
|
||||||
|
que se han recibido.
|
||||||
|
}
|
||||||
|
with TDAWhereBuilder.Create do
|
||||||
|
try
|
||||||
|
AWhere := NewBinaryExpression(NewField('', 'ID_EJERCICIO'), NewConstant(darEjercicioActivo(ID_EMPRESA), datInteger), dboEqual);
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
try
|
||||||
|
try
|
||||||
|
dsData := schContabilidad.NewDataset(AConn, 'ExisteSubCuenta', ['ID_CONTACTO'], [ID_CONTACTO]);
|
||||||
|
dsData.DynamicWhere.Expression := AWhere;
|
||||||
|
|
||||||
|
dsData.Active := True;
|
||||||
|
Result := (dsData.FieldValues[0] > 0);
|
||||||
|
AConn.CommitTransaction;
|
||||||
|
|
||||||
|
except
|
||||||
|
RaiseError('Error al buscar subcuentas del contacto');
|
||||||
|
AConn.RollbackTransaction;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
dsData := NIL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
TROClassFactory.Create('srvContabilidad', Create_srvContabilidad, TsrvContabilidad_Invoker);
|
TROClassFactory.Create('srvContabilidad', Create_srvContabilidad, TsrvContabilidad_Invoker);
|
||||||
|
|
||||||
|
|||||||
@ -321,10 +321,6 @@ begin
|
|||||||
if (SubCuentas.DataTable.State in dsEditModes) then
|
if (SubCuentas.DataTable.State in dsEditModes) then
|
||||||
SubCuentas.DataTable.Post;
|
SubCuentas.DataTable.Post;
|
||||||
|
|
||||||
if (IGNORAR_CONTABILIDAD = 0)
|
|
||||||
and (SubCuentas.DataTable.RecordCount = 0) then
|
|
||||||
raise Exception.Create('El cliente debe tener asociada una subcuenta contable');
|
|
||||||
|
|
||||||
if (BLOQUEADO = 0) then
|
if (BLOQUEADO = 0) then
|
||||||
begin
|
begin
|
||||||
Edit;
|
Edit;
|
||||||
|
|||||||
@ -20,7 +20,7 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
uDataModuleServer, uDAClasses,
|
uDataModuleServer, uDAClasses, srvContabilidad_Impl,
|
||||||
schContactosClient_Intf, uBusinessUtils;
|
schContactosClient_Intf, uBusinessUtils;
|
||||||
|
|
||||||
{ TBizClienteServer }
|
{ TBizClienteServer }
|
||||||
@ -53,6 +53,10 @@ var
|
|||||||
ASchema : TDASchema;
|
ASchema : TDASchema;
|
||||||
ACurrentConn : IDAConnection;
|
ACurrentConn : IDAConnection;
|
||||||
ACommand : IDASQLCommand;
|
ACommand : IDASQLCommand;
|
||||||
|
idCliente: integer;
|
||||||
|
idTienda: integer;
|
||||||
|
idEmpresa: integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
@ -80,6 +84,23 @@ begin
|
|||||||
ParamByName('PROCEDENCIA_CLIENTE').Value := aChange.NewValueByName[fld_ClientesPROCEDENCIA_CLIENTE];
|
ParamByName('PROCEDENCIA_CLIENTE').Value := aChange.NewValueByName[fld_ClientesPROCEDENCIA_CLIENTE];
|
||||||
Execute;
|
Execute;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//En caso de no ignorar contabilidad se deberá dar de alta una cuenta para el cliente si el usuario no la ha asignado
|
||||||
|
if (aChange.NewValueByName[fld_ClientesIGNORAR_CONTABILIDAD] = 0) then
|
||||||
|
begin
|
||||||
|
with TsrvContabilidad.Create(NIL) do
|
||||||
|
try
|
||||||
|
idCliente := aChange.NewValueByName[fld_ClientesID];
|
||||||
|
idTienda := aChange.NewValueByName[fld_ClientesID_TIENDA];
|
||||||
|
idEmpresa := aChange.NewValueByName[fld_ClientesID_EMPRESA];
|
||||||
|
if not TieneCuentaAsociada(idCliente, idEmpresa) then
|
||||||
|
AnadirSubCuentaCliente(idCliente, idTienda, idEmpresa);
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
finally
|
finally
|
||||||
ACommand := NIL;
|
ACommand := NIL;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
inherited frViewSubCuentaContacto: TfrViewSubCuentaContacto
|
inherited frViewSubCuentaContacto: TfrViewSubCuentaContacto
|
||||||
Width = 451
|
Width = 575
|
||||||
Height = 304
|
|
||||||
Align = alClient
|
Align = alClient
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
OnCreate = CustomViewCreate
|
OnCreate = CustomViewCreate
|
||||||
@ -10,16 +9,17 @@ inherited frViewSubCuentaContacto: TfrViewSubCuentaContacto
|
|||||||
object layoutApunte: TdxLayoutControl
|
object layoutApunte: TdxLayoutControl
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 451
|
Width = 575
|
||||||
Height = 304
|
Height = 291
|
||||||
Align = alClient
|
Align = alClient
|
||||||
ParentBackground = True
|
ParentBackground = True
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
AutoContentSizes = [acsWidth, acsHeight]
|
AutoContentSizes = [acsWidth, acsHeight]
|
||||||
ExplicitWidth = 591
|
ExplicitWidth = 451
|
||||||
|
ExplicitHeight = 304
|
||||||
DesignSize = (
|
DesignSize = (
|
||||||
451
|
575
|
||||||
304)
|
291)
|
||||||
object eRefSubCuenta: TcxDBTextEdit
|
object eRefSubCuenta: TcxDBTextEdit
|
||||||
Left = 93
|
Left = 93
|
||||||
Top = 37
|
Top = 37
|
||||||
@ -41,7 +41,7 @@ inherited frViewSubCuentaContacto: TfrViewSubCuentaContacto
|
|||||||
Width = 346
|
Width = 346
|
||||||
end
|
end
|
||||||
object BitBtn3: TBitBtn
|
object BitBtn3: TBitBtn
|
||||||
Left = 119
|
Left = 233
|
||||||
Top = 37
|
Top = 37
|
||||||
Width = 110
|
Width = 110
|
||||||
Height = 25
|
Height = 25
|
||||||
@ -105,7 +105,7 @@ inherited frViewSubCuentaContacto: TfrViewSubCuentaContacto
|
|||||||
Width = 265
|
Width = 265
|
||||||
end
|
end
|
||||||
object BitBtn1: TBitBtn
|
object BitBtn1: TBitBtn
|
||||||
Left = 235
|
Left = 349
|
||||||
Top = 37
|
Top = 37
|
||||||
Width = 120
|
Width = 120
|
||||||
Height = 25
|
Height = 25
|
||||||
@ -149,7 +149,7 @@ inherited frViewSubCuentaContacto: TfrViewSubCuentaContacto
|
|||||||
E000E248D100E407DB00FF00FF00FF00FF00FF00FF00FF00FF00}
|
E000E248D100E407DB00FF00FF00FF00FF00FF00FF00FF00FF00}
|
||||||
end
|
end
|
||||||
object BitBtn2: TBitBtn
|
object BitBtn2: TBitBtn
|
||||||
Left = 361
|
Left = 475
|
||||||
Top = 37
|
Top = 37
|
||||||
Width = 90
|
Width = 90
|
||||||
Height = 25
|
Height = 25
|
||||||
|
|||||||
@ -338,6 +338,14 @@
|
|||||||
</Parameter>
|
</Parameter>
|
||||||
</Parameters>
|
</Parameters>
|
||||||
</Operation>
|
</Operation>
|
||||||
|
<Operation Name="darEjercicioActivo" UID="{072973FA-4504-4633-ABD1-5BE0B05257A0}">
|
||||||
|
<Parameters>
|
||||||
|
<Parameter Name="Result" DataType="Integer" Flag="Result">
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Name="ID_EMPRESA" DataType="Integer" Flag="In" >
|
||||||
|
</Parameter>
|
||||||
|
</Parameters>
|
||||||
|
</Operation>
|
||||||
</Operations>
|
</Operations>
|
||||||
</Interface>
|
</Interface>
|
||||||
</Interfaces>
|
</Interfaces>
|
||||||
@ -377,6 +385,40 @@
|
|||||||
<Interfaces>
|
<Interfaces>
|
||||||
<Interface Name="Default" UID="{04CDF2E1-EFC2-4247-AA4F-09BE782C73FA}">
|
<Interface Name="Default" UID="{04CDF2E1-EFC2-4247-AA4F-09BE782C73FA}">
|
||||||
<Operations>
|
<Operations>
|
||||||
|
<Operation Name="TieneCuentaAsociada" UID="{F18B7A99-55D5-4234-BC14-1A96C0CB83CF}">
|
||||||
|
<Parameters>
|
||||||
|
<Parameter Name="Result" DataType="Boolean" Flag="Result">
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Name="ID_CONTACTO" DataType="Integer" Flag="In" >
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Name="ID_EMPRESA" DataType="Integer" Flag="In" >
|
||||||
|
</Parameter>
|
||||||
|
</Parameters>
|
||||||
|
</Operation>
|
||||||
|
<Operation Name="AnadirSubCuentaCliente" UID="{D13C68AD-871D-46C0-886E-9E017AF1E688}">
|
||||||
|
<Parameters>
|
||||||
|
<Parameter Name="Result" DataType="Boolean" Flag="Result">
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Name="ID_CONTACTO" DataType="Integer" Flag="In" >
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Name="ID_TIENDA" DataType="Integer" Flag="In" >
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Name="ID_EMPRESA" DataType="Integer" Flag="In" >
|
||||||
|
</Parameter>
|
||||||
|
</Parameters>
|
||||||
|
</Operation>
|
||||||
|
<Operation Name="AnadirSubCuentaProveedor" UID="{E2D673BB-FA95-456D-805D-EB75C9361C54}">
|
||||||
|
<Parameters>
|
||||||
|
<Parameter Name="Result" DataType="Boolean" Flag="Result">
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Name="ID_CONTACTO" DataType="Integer" Flag="In" >
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Name="ID_TIENDA" DataType="Integer" Flag="In" >
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Name="ID_EMPRESA" DataType="Integer" Flag="In" >
|
||||||
|
</Parameter>
|
||||||
|
</Parameters>
|
||||||
|
</Operation>
|
||||||
</Operations>
|
</Operations>
|
||||||
</Interface>
|
</Interface>
|
||||||
</Interfaces>
|
</Interfaces>
|
||||||
|
|||||||
@ -571,6 +571,7 @@ type
|
|||||||
IsrvEjercicios = interface(IDataAbstractService)
|
IsrvEjercicios = interface(IDataAbstractService)
|
||||||
['{E99052D5-4ED9-480C-B4D4-384E8C6E4B08}']
|
['{E99052D5-4ED9-480C-B4D4-384E8C6E4B08}']
|
||||||
function GenerarPGC(const ID_EJERCICIO_COPIA: Integer; const ID_EJERCICIO: Integer): Boolean;
|
function GenerarPGC(const ID_EJERCICIO_COPIA: Integer; const ID_EJERCICIO: Integer): Boolean;
|
||||||
|
function darEjercicioActivo(const ID_EMPRESA: Integer): Integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ CosrvEjercicios }
|
{ CosrvEjercicios }
|
||||||
@ -584,6 +585,7 @@ type
|
|||||||
function __GetInterfaceName:string; override;
|
function __GetInterfaceName:string; override;
|
||||||
|
|
||||||
function GenerarPGC(const ID_EJERCICIO_COPIA: Integer; const ID_EJERCICIO: Integer): Boolean;
|
function GenerarPGC(const ID_EJERCICIO_COPIA: Integer; const ID_EJERCICIO: Integer): Boolean;
|
||||||
|
function darEjercicioActivo(const ID_EMPRESA: Integer): Integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ IsrvReferencias }
|
{ IsrvReferencias }
|
||||||
@ -613,6 +615,9 @@ type
|
|||||||
{ IsrvContabilidad }
|
{ IsrvContabilidad }
|
||||||
IsrvContabilidad = interface(IDataAbstractService)
|
IsrvContabilidad = interface(IDataAbstractService)
|
||||||
['{04CDF2E1-EFC2-4247-AA4F-09BE782C73FA}']
|
['{04CDF2E1-EFC2-4247-AA4F-09BE782C73FA}']
|
||||||
|
function TieneCuentaAsociada(const ID_CONTACTO: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
function AnadirSubCuentaCliente(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
function AnadirSubCuentaProveedor(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ CosrvContabilidad }
|
{ CosrvContabilidad }
|
||||||
@ -625,6 +630,9 @@ type
|
|||||||
protected
|
protected
|
||||||
function __GetInterfaceName:string; override;
|
function __GetInterfaceName:string; override;
|
||||||
|
|
||||||
|
function TieneCuentaAsociada(const ID_CONTACTO: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
function AnadirSubCuentaCliente(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
function AnadirSubCuentaProveedor(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ IsrvUnidadesMedida }
|
{ IsrvUnidadesMedida }
|
||||||
@ -1542,6 +1550,22 @@ begin
|
|||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TsrvEjercicios_Proxy.darEjercicioActivo(const ID_EMPRESA: Integer): Integer;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'darEjercicioActivo');
|
||||||
|
__Message.Write('ID_EMPRESA', TypeInfo(Integer), ID_EMPRESA, []);
|
||||||
|
__Message.Finalize;
|
||||||
|
|
||||||
|
__TransportChannel.Dispatch(__Message);
|
||||||
|
|
||||||
|
__Message.Read('Result', TypeInfo(Integer), result, []);
|
||||||
|
finally
|
||||||
|
__Message.UnsetAttributes(__TransportChannel);
|
||||||
|
__Message.FreeStream;
|
||||||
|
end
|
||||||
|
end;
|
||||||
|
|
||||||
{ CosrvReferencias }
|
{ CosrvReferencias }
|
||||||
|
|
||||||
class function CosrvReferencias.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvReferencias;
|
class function CosrvReferencias.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvReferencias;
|
||||||
@ -1598,11 +1622,66 @@ begin
|
|||||||
result := TsrvContabilidad_Proxy.Create(aMessage, aTransportChannel);
|
result := TsrvContabilidad_Proxy.Create(aMessage, aTransportChannel);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TsrvContabilidad_Proxy }
|
||||||
|
|
||||||
function TsrvContabilidad_Proxy.__GetInterfaceName:string;
|
function TsrvContabilidad_Proxy.__GetInterfaceName:string;
|
||||||
begin
|
begin
|
||||||
result := 'srvContabilidad';
|
result := 'srvContabilidad';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TsrvContabilidad_Proxy.TieneCuentaAsociada(const ID_CONTACTO: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'TieneCuentaAsociada');
|
||||||
|
__Message.Write('ID_CONTACTO', TypeInfo(Integer), ID_CONTACTO, []);
|
||||||
|
__Message.Write('ID_EMPRESA', TypeInfo(Integer), ID_EMPRESA, []);
|
||||||
|
__Message.Finalize;
|
||||||
|
|
||||||
|
__TransportChannel.Dispatch(__Message);
|
||||||
|
|
||||||
|
__Message.Read('Result', TypeInfo(Boolean), result, []);
|
||||||
|
finally
|
||||||
|
__Message.UnsetAttributes(__TransportChannel);
|
||||||
|
__Message.FreeStream;
|
||||||
|
end
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TsrvContabilidad_Proxy.AnadirSubCuentaCliente(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'AnadirSubCuentaCliente');
|
||||||
|
__Message.Write('ID_CONTACTO', TypeInfo(Integer), ID_CONTACTO, []);
|
||||||
|
__Message.Write('ID_TIENDA', TypeInfo(Integer), ID_TIENDA, []);
|
||||||
|
__Message.Write('ID_EMPRESA', TypeInfo(Integer), ID_EMPRESA, []);
|
||||||
|
__Message.Finalize;
|
||||||
|
|
||||||
|
__TransportChannel.Dispatch(__Message);
|
||||||
|
|
||||||
|
__Message.Read('Result', TypeInfo(Boolean), result, []);
|
||||||
|
finally
|
||||||
|
__Message.UnsetAttributes(__TransportChannel);
|
||||||
|
__Message.FreeStream;
|
||||||
|
end
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TsrvContabilidad_Proxy.AnadirSubCuentaProveedor(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'AnadirSubCuentaProveedor');
|
||||||
|
__Message.Write('ID_CONTACTO', TypeInfo(Integer), ID_CONTACTO, []);
|
||||||
|
__Message.Write('ID_TIENDA', TypeInfo(Integer), ID_TIENDA, []);
|
||||||
|
__Message.Write('ID_EMPRESA', TypeInfo(Integer), ID_EMPRESA, []);
|
||||||
|
__Message.Finalize;
|
||||||
|
|
||||||
|
__TransportChannel.Dispatch(__Message);
|
||||||
|
|
||||||
|
__Message.Read('Result', TypeInfo(Boolean), result, []);
|
||||||
|
finally
|
||||||
|
__Message.UnsetAttributes(__TransportChannel);
|
||||||
|
__Message.FreeStream;
|
||||||
|
end
|
||||||
|
end;
|
||||||
|
|
||||||
{ CosrvUnidadesMedida }
|
{ CosrvUnidadesMedida }
|
||||||
|
|
||||||
class function CosrvUnidadesMedida.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvUnidadesMedida;
|
class function CosrvUnidadesMedida.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvUnidadesMedida;
|
||||||
|
|||||||
@ -174,6 +174,7 @@ type
|
|||||||
protected
|
protected
|
||||||
published
|
published
|
||||||
procedure Invoke_GenerarPGC(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
procedure Invoke_GenerarPGC(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
|
procedure Invoke_darEjercicioActivo(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TsrvReferencias_Invoker = class(TDataAbstractService_Invoker)
|
TsrvReferencias_Invoker = class(TDataAbstractService_Invoker)
|
||||||
@ -188,6 +189,9 @@ type
|
|||||||
private
|
private
|
||||||
protected
|
protected
|
||||||
published
|
published
|
||||||
|
procedure Invoke_TieneCuentaAsociada(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
|
procedure Invoke_AnadirSubCuentaCliente(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
|
procedure Invoke_AnadirSubCuentaProveedor(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TsrvUnidadesMedida_Invoker = class(TDataAbstractService_Invoker)
|
TsrvUnidadesMedida_Invoker = class(TDataAbstractService_Invoker)
|
||||||
@ -707,6 +711,26 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TsrvEjercicios_Invoker.Invoke_darEjercicioActivo(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
|
{ function darEjercicioActivo(const ID_EMPRESA: Integer): Integer; }
|
||||||
|
var
|
||||||
|
ID_EMPRESA: Integer;
|
||||||
|
lResult: Integer;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
__Message.Read('ID_EMPRESA', TypeInfo(Integer), ID_EMPRESA, []);
|
||||||
|
|
||||||
|
lResult := (__Instance as IsrvEjercicios).darEjercicioActivo(ID_EMPRESA);
|
||||||
|
|
||||||
|
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvEjercicios', 'darEjercicioActivoResponse');
|
||||||
|
__Message.Write('Result', TypeInfo(Integer), lResult, []);
|
||||||
|
__Message.Finalize;
|
||||||
|
__Message.UnsetAttributes(__Transport);
|
||||||
|
|
||||||
|
finally
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TsrvReferencias_Invoker }
|
{ TsrvReferencias_Invoker }
|
||||||
|
|
||||||
procedure TsrvReferencias_Invoker.Invoke_DarNuevaReferencia(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
procedure TsrvReferencias_Invoker.Invoke_DarNuevaReferencia(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
@ -755,5 +779,77 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TsrvContabilidad_Invoker }
|
||||||
|
|
||||||
|
procedure TsrvContabilidad_Invoker.Invoke_TieneCuentaAsociada(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
|
{ function TieneCuentaAsociada(const ID_CONTACTO: Integer; const ID_EMPRESA: Integer): Boolean; }
|
||||||
|
var
|
||||||
|
ID_CONTACTO: Integer;
|
||||||
|
ID_EMPRESA: Integer;
|
||||||
|
lResult: Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
__Message.Read('ID_CONTACTO', TypeInfo(Integer), ID_CONTACTO, []);
|
||||||
|
__Message.Read('ID_EMPRESA', TypeInfo(Integer), ID_EMPRESA, []);
|
||||||
|
|
||||||
|
lResult := (__Instance as IsrvContabilidad).TieneCuentaAsociada(ID_CONTACTO, ID_EMPRESA);
|
||||||
|
|
||||||
|
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvContabilidad', 'TieneCuentaAsociadaResponse');
|
||||||
|
__Message.Write('Result', TypeInfo(Boolean), lResult, []);
|
||||||
|
__Message.Finalize;
|
||||||
|
__Message.UnsetAttributes(__Transport);
|
||||||
|
|
||||||
|
finally
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TsrvContabilidad_Invoker.Invoke_AnadirSubCuentaCliente(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
|
{ function AnadirSubCuentaCliente(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer): Boolean; }
|
||||||
|
var
|
||||||
|
ID_CONTACTO: Integer;
|
||||||
|
ID_TIENDA: Integer;
|
||||||
|
ID_EMPRESA: Integer;
|
||||||
|
lResult: Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
__Message.Read('ID_CONTACTO', TypeInfo(Integer), ID_CONTACTO, []);
|
||||||
|
__Message.Read('ID_TIENDA', TypeInfo(Integer), ID_TIENDA, []);
|
||||||
|
__Message.Read('ID_EMPRESA', TypeInfo(Integer), ID_EMPRESA, []);
|
||||||
|
|
||||||
|
lResult := (__Instance as IsrvContabilidad).AnadirSubCuentaCliente(ID_CONTACTO, ID_TIENDA, ID_EMPRESA);
|
||||||
|
|
||||||
|
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvContabilidad', 'AnadirSubCuentaClienteResponse');
|
||||||
|
__Message.Write('Result', TypeInfo(Boolean), lResult, []);
|
||||||
|
__Message.Finalize;
|
||||||
|
__Message.UnsetAttributes(__Transport);
|
||||||
|
|
||||||
|
finally
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TsrvContabilidad_Invoker.Invoke_AnadirSubCuentaProveedor(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
|
{ function AnadirSubCuentaProveedor(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer): Boolean; }
|
||||||
|
var
|
||||||
|
ID_CONTACTO: Integer;
|
||||||
|
ID_TIENDA: Integer;
|
||||||
|
ID_EMPRESA: Integer;
|
||||||
|
lResult: Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
__Message.Read('ID_CONTACTO', TypeInfo(Integer), ID_CONTACTO, []);
|
||||||
|
__Message.Read('ID_TIENDA', TypeInfo(Integer), ID_TIENDA, []);
|
||||||
|
__Message.Read('ID_EMPRESA', TypeInfo(Integer), ID_EMPRESA, []);
|
||||||
|
|
||||||
|
lResult := (__Instance as IsrvContabilidad).AnadirSubCuentaProveedor(ID_CONTACTO, ID_TIENDA, ID_EMPRESA);
|
||||||
|
|
||||||
|
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvContabilidad', 'AnadirSubCuentaProveedorResponse');
|
||||||
|
__Message.Write('Result', TypeInfo(Boolean), lResult, []);
|
||||||
|
__Message.Finalize;
|
||||||
|
__Message.UnsetAttributes(__Transport);
|
||||||
|
|
||||||
|
finally
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
end.
|
end.
|
||||||
|
|||||||
Binary file not shown.
@ -39,8 +39,9 @@ object dmServer: TdmServer
|
|||||||
item
|
item
|
||||||
Name = 'IBX'
|
Name = 'IBX'
|
||||||
ConnectionString =
|
ConnectionString =
|
||||||
'IBX?Server=localhost;Database=C:\Codigo Acana\Database\ACANA.FDB' +
|
'IBX?Server=localhost;Database=C:\Codigo Acana\Output\Debug\Datab' +
|
||||||
';UserID=sysdba;Password=masterkey;Dialect=3;Charset=ISO8859_1;'
|
'ase\FactuGES.FDB;UserID=sysdba;Password=masterkey;Dialect=3;Char' +
|
||||||
|
'set=ISO8859_1;'
|
||||||
ConnectionType = 'Interbase'
|
ConnectionType = 'Interbase'
|
||||||
Default = True
|
Default = True
|
||||||
end>
|
end>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user