Se separan presupuestos entre empresas, se tienen en cuenta las empresas A y B para que sean comunes, nueva variable de configuración
git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoDesign_FactuGES/trunk@59 93f398dd-4eb6-7a46-baf6-13f46f578da2
This commit is contained in:
parent
e750a0fd9e
commit
47046d5eed
BIN
Build/Build.fbl6
BIN
Build/Build.fbl6
Binary file not shown.
@ -15,7 +15,7 @@
|
||||
<![CDATA[]]>
|
||||
</Notes>
|
||||
<LastBuildRun>00:00:00</LastBuildRun>
|
||||
<LastBuildStart>26/04/2013 13:00:52</LastBuildStart>
|
||||
<LastBuildStart>29/04/2013 12:19:03</LastBuildStart>
|
||||
<LastBuildState>False</LastBuildState>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
BIN
Build/Build.fbz6
BIN
Build/Build.fbz6
Binary file not shown.
@ -3697,8 +3697,7 @@ CREATE VIEW V_PRESUPUESTOS_CLIENTE(
|
||||
AS
|
||||
SELECT
|
||||
PRESUPUESTOS_CLIENTE.ID,
|
||||
/* PRESUPUESTOS_CLIENTE.ID_EMPRESA,*/
|
||||
EMPRESAS_CONTACTOS.ID_EMPRESA,
|
||||
PRESUPUESTOS_CLIENTE.ID_EMPRESA,
|
||||
PRESUPUESTOS_CLIENTE.FECHA_PRESUPUESTO,
|
||||
PRESUPUESTOS_CLIENTE.FECHA_VIGENCIA,
|
||||
PRESUPUESTOS_CLIENTE.FECHA_DECISION,
|
||||
@ -3742,7 +3741,6 @@ SELECT
|
||||
FROM
|
||||
PRESUPUESTOS_CLIENTE
|
||||
LEFT OUTER JOIN CONTACTOS ON (PRESUPUESTOS_CLIENTE.ID_CLIENTE = CONTACTOS.ID)
|
||||
LEFT JOIN EMPRESAS_CONTACTOS ON (EMPRESAS_CONTACTOS.ID_CONTACTO = CONTACTOS.ID)
|
||||
LEFT OUTER JOIN CONTACTOS CONTACTOS2 ON (PRESUPUESTOS_CLIENTE.ID_VENDEDOR = CONTACTOS2.ID)
|
||||
LEFT OUTER JOIN EMPRESAS_TIENDAS ON (EMPRESAS_TIENDAS.ID = PRESUPUESTOS_CLIENTE.ID_TIENDA)
|
||||
LEFT OUTER JOIN CONTRATOS_CLIENTE ON (CONTRATOS_CLIENTE.ID = PRESUPUESTOS_CLIENTE.ID_CONTRATO)
|
||||
|
||||
@ -23,7 +23,8 @@ type
|
||||
procedure SalvarConfiguracion;
|
||||
procedure CargarConfiguracion;
|
||||
|
||||
function GetSettingAsString(const AFuente: TEnumAlmacen; const ASettingName: String; const ADefaultValue : String = ''): String;
|
||||
function GetSettingAsString(const AFuente: TEnumAlmacen; const ASettingName: String; const ADefaultValue : String = ''): String; overload;
|
||||
function GetSettingAsString(const AFuente: TEnumAlmacen; const ASettingName: String; const ID_EMPRESA: integer; const ADefaultValue : String = ''): String; overload;
|
||||
function GetSettingAsInteger(const AFuente: TEnumAlmacen; const ASettingName: String; const ADefaultValue : Integer = 0): Integer;
|
||||
function GetSettingAsFloat(const AFuente: TEnumAlmacen; const ASettingName: String; const ADefaultValue : Float = 0): Float;
|
||||
function GetSettingAsBoolean(const AFuente: TEnumAlmacen; const ASettingName: String; const ADefaultValue : Boolean = False): Boolean;
|
||||
@ -44,7 +45,8 @@ type
|
||||
procedure CargarConfiguracion;
|
||||
procedure ConfigurarAplicacion;
|
||||
|
||||
function GetSettingAsString(const AFuente: TEnumAlmacen; const ASettingName: String; const ADefaultValue : String = ''): String;
|
||||
function GetSettingAsString(const AFuente: TEnumAlmacen; const ASettingName: String; const ADefaultValue : String = ''): String; overload;
|
||||
function GetSettingAsString(const AFuente: TEnumAlmacen; const ASettingName: String; const ID_EMPRESA: integer; const ADefaultValue : String = ''): String; overload;
|
||||
function GetSettingAsInteger(const AFuente: TEnumAlmacen; const ASettingName: String; const ADefaultValue : Integer = 0): Integer;
|
||||
function GetSettingAsFloat(const AFuente: TEnumAlmacen; const ASettingName: String; const ADefaultValue : Float = 0): Float;
|
||||
function GetSettingAsBoolean(const AFuente: TEnumAlmacen; const ASettingName: String; const ADefaultValue : Boolean = False): Boolean;
|
||||
@ -166,6 +168,16 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TConfiguracionController.GetSettingAsString(
|
||||
const AFuente: TEnumAlmacen; const ASettingName: String;
|
||||
const ID_EMPRESA: integer; const ADefaultValue: String): String;
|
||||
begin
|
||||
case AFuente of
|
||||
// teXML: Result := FAppXMLFileStorage.ReadStringParaEmpresa(ASettingName, ADefaultValue);
|
||||
teBD: Result := FAppDBStorage.DarValorParaEmpresa(ASettingName, ID_EMPRESA);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TConfiguracionController.GetSettingAsString(const AFuente: TEnumAlmacen; const ASettingName,
|
||||
ADefaultValue: String): String;
|
||||
begin
|
||||
|
||||
@ -3,7 +3,7 @@ unit uBizEmpresas;
|
||||
interface
|
||||
|
||||
uses
|
||||
uDAInterfaces, uDADataTable, schEmpresasClient_Intf,
|
||||
uDAInterfaces, uDADataTable, Classes, schEmpresasClient_Intf,
|
||||
uBizEmpresasDatosBancarios, uBizEmpresasTiendas;
|
||||
|
||||
const
|
||||
@ -20,6 +20,9 @@ type
|
||||
function GetTiendas : IBizEmpresaTienda;
|
||||
property Tiendas : IBizEmpresaTienda read GetTiendas write SetTiendas;
|
||||
|
||||
function GetEmpresasPresupuestosComunes : TStringList;
|
||||
property EmpresasPresupuestosComunes: TStringList read GetEmpresasPresupuestosComunes;
|
||||
|
||||
function EsNuevo : Boolean;
|
||||
end;
|
||||
|
||||
@ -29,6 +32,7 @@ type
|
||||
FDatosBancariosLink : TDADataSource;
|
||||
FTiendas : IBizEmpresaTienda;
|
||||
FTiendasLink : TDADataSource;
|
||||
FEmpresasPresupuestosComunes : TStringList;
|
||||
|
||||
procedure OnNewRecord(Sender: TDADataTable); override;
|
||||
|
||||
@ -36,6 +40,7 @@ type
|
||||
function GetDatosBancarios : IBizEmpresasDatosBancarios;
|
||||
procedure SetTiendas(AValue : IBizEmpresaTienda);
|
||||
function GetTiendas : IBizEmpresaTienda;
|
||||
function GetEmpresasPresupuestosComunes : TStringList;
|
||||
|
||||
public
|
||||
function EsNuevo : Boolean;
|
||||
@ -46,14 +51,15 @@ type
|
||||
|
||||
property DatosBancarios : IBizEmpresasDatosBancarios read GetDatosBancarios write SetDatosBancarios;
|
||||
property Tiendas : IBizEmpresaTienda read GetTiendas write SetTiendas;
|
||||
property EmpresasPresupuestosComunes: TStringList read GetEmpresasPresupuestosComunes;
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
uDataTableUtils, Classes, DateUtils, SysUtils, Dialogs,
|
||||
uFactuGES_App;
|
||||
uDataTableUtils, DateUtils, SysUtils, Dialogs,
|
||||
uFactuGES_App, uConfiguracionController;
|
||||
|
||||
{ TBizEmpresa }
|
||||
|
||||
@ -66,6 +72,8 @@ begin
|
||||
|
||||
FTiendasLink := TDADataSource.Create(NIL);
|
||||
FTiendasLink.DataTable := aDataTable;
|
||||
|
||||
FEmpresasPresupuestosComunes := TStringList.Create;
|
||||
end;
|
||||
|
||||
destructor TBizEmpresa.Destroy;
|
||||
@ -74,6 +82,7 @@ begin
|
||||
FDatosBancariosLink.Free;
|
||||
FTiendas := NIL;
|
||||
FTiendasLink.Free;
|
||||
FreeANDNIL(FEmpresasPresupuestosComunes);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
@ -87,6 +96,14 @@ begin
|
||||
Result := FDatosBancarios;
|
||||
end;
|
||||
|
||||
function TBizEmpresa.GetEmpresasPresupuestosComunes: TStringList;
|
||||
begin
|
||||
if (FEmpresasPresupuestosComunes.Count = 0) then
|
||||
FEmpresasPresupuestosComunes.CommaText := AppFactuGES.Configuracion.GetSettingAsString(teBD,'EMPRESAS_PRESUPUESTOS_COMUNES', AppFactuGES.EmpresaActiva.ID);
|
||||
|
||||
Result := FEmpresasPresupuestosComunes;
|
||||
end;
|
||||
|
||||
function TBizEmpresa.GetTiendas: IBizEmpresaTienda;
|
||||
begin
|
||||
Result := FTiendas;
|
||||
|
||||
@ -44,13 +44,6 @@
|
||||
<Borland.ProjectType>Package</Borland.ProjectType>
|
||||
<BorlandProject>
|
||||
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Package_Options><Package_Options Name="PackageDescription">Libreria base de FactuGES</Package_Options><Package_Options Name="ImplicitBuild">False</Package_Options><Package_Options Name="DesigntimeOnly">False</Package_Options><Package_Options Name="RuntimeOnly">False</Package_Options></Package_Options><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys></VersionInfoKeys><Excluded_Packages>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<Excluded_Packages Name="$(BDS)\Bin\dclintraweb_90_100.bpl">VCL for the Web Design Package for CodeGear RAD Studio</Excluded_Packages>
|
||||
<Excluded_Packages Name="$(BDS)\bin\dclwebsnap100.bpl">CodeGear WebSnap Components</Excluded_Packages>
|
||||
<Excluded_Packages Name="$(BDS)\bin\dclsoap100.bpl">CodeGear SOAP Components</Excluded_Packages>
|
||||
@ -65,54 +58,54 @@
|
||||
<DelphiCompile Include="Base.dpk">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\adortl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\cxDataD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\cxEditorsD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\cxExtEditorsD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\cxGridD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\cxLibraryD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\cxPageControlD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\DataAbstract_Core_D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\dbrtl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\dclIndyCore.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\designide.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\dsnap.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\dxGDIPlusD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\dxPSCoreD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\dxThemeD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\GUISDK_D11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\IndyCore.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\IndyProtocols.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\IndySystem.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\Jcl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\JclVcl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\JSDialog100.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\JvCmpD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\JvCoreD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\JvCtrlsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\JvDlgsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\JvMMD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\JvNetD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\JvPageCompsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\JvStdCtrlsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\JvSystemD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\pckMD5.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\pckUCDataConnector.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\pckUserControl_RT.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\PluginSDK_D11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\PngComponentsD10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\PNG_D10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\RemObjects_Core_D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\rtl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\TB2k_D10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\tbx_d10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\vcl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\vclactnband.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\vcldb.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\vcljpg.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\VclSmp.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\vclx.dcp" />
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\xmlrtl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\adortl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\cxDataD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\cxEditorsD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\cxExtEditorsD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\cxGridD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\cxLibraryD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\cxPageControlD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\DataAbstract_Core_D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\dbrtl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\dclIndyCore.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\designide.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\dsnap.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\dxGDIPlusD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\dxPSCoreD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\dxThemeD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\GUISDK_D11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\IndyCore.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\IndyProtocols.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\IndySystem.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\Jcl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\JclVcl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\JSDialog100.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\JvCmpD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\JvCoreD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\JvCtrlsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\JvDlgsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\JvMMD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\JvNetD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\JvPageCompsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\JvStdCtrlsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\JvSystemD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\pckMD5.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\pckUCDataConnector.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\pckUserControl_RT.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\PluginSDK_D11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\PngComponentsD10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\PNG_D10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\RemObjects_Core_D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\rtl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\TB2k_D10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\tbx_d10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\vcl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\vclactnband.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\vcldb.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\vcljpg.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\VclSmp.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\vclx.dcp" />
|
||||
<DCCReference Include="..\Modulos\Contactos\xmlrtl.dcp" />
|
||||
<DCCReference Include="..\Servicios\FactuGES_Intf.pas" />
|
||||
<DCCReference Include="Conexion\uConfigurarConexion.pas">
|
||||
<Form>fConfigurarConexion</Form>
|
||||
|
||||
@ -17,6 +17,7 @@ type
|
||||
FIniFile : TIniFile;
|
||||
public
|
||||
function DarValor(const CODIGO: String; const ValorPorDefecto: String = ''): Variant;
|
||||
function DarValorParaEmpresa(const CODIGO: String; const ID_EMPRESA: Integer; const ValorPorDefecto: String = ''): Variant;
|
||||
procedure GuardarValor(const CODIGO: String; const Valor: Variant);
|
||||
procedure LeerConfiguracion;
|
||||
procedure SalvarConfiguracion;
|
||||
@ -61,6 +62,14 @@ begin
|
||||
Result := (RORemoteService as IsrvConfiguracion).DarValor(CODIGO, ValorPorDefecto);
|
||||
end;
|
||||
|
||||
function TdmConfiguracion.DarValorParaEmpresa(const CODIGO: String;
|
||||
const ID_EMPRESA: Integer; const ValorPorDefecto: String): Variant;
|
||||
begin
|
||||
RORemoteService.Channel := dmConexion.ROChannel;
|
||||
RORemoteService.Message := dmConexion.ROMessage;
|
||||
Result := (RORemoteService as IsrvConfiguracion).DarValorParaEmpresa(CODIGO, ID_EMPRESA, ValorPorDefecto);
|
||||
end;
|
||||
|
||||
destructor TdmConfiguracion.Destroy;
|
||||
begin
|
||||
FreeAndNIL(FIniFile);
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -3643,9 +3643,12 @@ object srvContactos: TsrvContactos
|
||||
Connection = 'IBX'
|
||||
TargetTable = 'EMPRESAS_CONTACTOS'
|
||||
SQL =
|
||||
'INSERT'#10' INTO EMPRESAS_CONTACTOS'#10' (ID, ID_EMPRESA, ID_CONTACT' +
|
||||
'O)'#10' VALUES'#10' ((SELECT GEN_ID(GEN_EMPRESAS_CONTACTOS_ID, 1) FR' +
|
||||
'OM RDB$DATABASE), :ID_EMPRESA, :ID_CONTACTO)'#10
|
||||
'INSERT INTO EMPRESAS_CONTACTOS'#10' (ID, ID_EMPRESA, ID_CONTACTO)' +
|
||||
#10#10'SELECT (SELECT GEN_ID(GEN_EMPRESAS_CONTACTOS_ID, 1) FROM RDB$D' +
|
||||
'ATABASE), ID, :ID_CONTACTO'#10'FROM'#10'('#10'SELECT EMPRESAS.ID as ID'#10'FROM ' +
|
||||
'EMPRESAS'#10'where id = :ID_EMPRESA'#10#10'union'#10#10'select valor as ID'#10'from ' +
|
||||
'configuracion'#10'where CODIGO = '#39'EMPRESAS_CONTACTOS_COMUNES'#39#10'and ID' +
|
||||
'_EMPRESA = :ID_EMPRESA'#10')'#10
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <>
|
||||
end>
|
||||
|
||||
@ -968,7 +968,8 @@ end;
|
||||
|
||||
procedure TPresupuestosClienteController.FiltrarEmpresa(APresupuesto: IBizPresupuestoCliente);
|
||||
var
|
||||
Condicion: TDAWhereExpression;
|
||||
i: Integer;
|
||||
Condicion, Condicion2: TDAWhereExpression;
|
||||
begin
|
||||
if APresupuesto.DataTable.Active then
|
||||
APresupuesto.DataTable.Active := False;
|
||||
@ -979,6 +980,13 @@ begin
|
||||
// (ID_EMPRESA >= ID)
|
||||
Condicion := NewBinaryExpression(NewField('', fld_PresupuestosClienteID_EMPRESA), NewConstant(AppFactuGES.EmpresaActiva.ID, datInteger), dboEqual);
|
||||
|
||||
for i:= 0 to AppFactuGES.EmpresaActiva.EmpresasPresupuestosComunes.Count - 1 do
|
||||
begin
|
||||
// (ID_EMPRESA >= ID)
|
||||
Condicion2 := NewBinaryExpression(NewField('', fld_PresupuestosClienteID_EMPRESA), NewConstant(AppFactuGES.EmpresaActiva.EmpresasPresupuestosComunes.Strings[i], datString), dboEqual);
|
||||
Condicion := NewBinaryExpression(Condicion, Condicion2, dboOR);
|
||||
end;
|
||||
|
||||
if IsEmpty then
|
||||
Expression := Condicion
|
||||
else
|
||||
|
||||
@ -9,12 +9,12 @@ 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_Valores = '{CC017935-A09E-4607-A480-A958DE5AF63D}';
|
||||
RID_Propiedades = '{C233C7CE-D1DF-4697-9666-FCED937B77BA}';
|
||||
RID_ListaAnosPresupuestos = '{6E6A0A4D-15B0-4565-9B08-40290AEF60D1}';
|
||||
RID_PresupuestosCliente = '{D3E682FA-3E0F-4FFD-AB60-938FFC382BB3}';
|
||||
RID_CapitulosPresupuesto = '{C1629A05-F793-43B7-9C93-A53ADDECCE34}';
|
||||
RID_PresupuestosCliente_Detalles = '{ED0B47EF-2164-4FC1-9BC2-C439761E6FE9}';
|
||||
RID_Valores = '{E7928204-C39F-4E07-9A3D-B32F3BB49D85}';
|
||||
RID_Propiedades = '{D1BE6EB5-260D-4A6B-ADEF-3FC1FB9CF572}';
|
||||
RID_ListaAnosPresupuestos = '{95229127-6332-428F-848D-966BCF5A39F6}';
|
||||
RID_PresupuestosCliente = '{E4555932-F890-4E53-8666-6E4A2B74D518}';
|
||||
RID_CapitulosPresupuesto = '{DBAF21E8-DB51-4BAD-94FF-4A20A2876FF2}';
|
||||
RID_PresupuestosCliente_Detalles = '{B7A19F6E-DAA5-4E16-9622-4D99F50E21CE}';
|
||||
|
||||
{ Data table names }
|
||||
nme_Valores = 'Valores';
|
||||
@ -205,7 +205,7 @@ const
|
||||
type
|
||||
{ IValores }
|
||||
IValores = interface(IDAStronglyTypedDataTable)
|
||||
['{681B40A3-5B11-4D32-923A-0631AA8CC5EE}']
|
||||
['{93D9A956-9F9E-4D63-A10B-A172C285C94E}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -300,7 +300,7 @@ type
|
||||
|
||||
{ IPropiedades }
|
||||
IPropiedades = interface(IDAStronglyTypedDataTable)
|
||||
['{79BD7A07-B808-4907-850F-392DC2606391}']
|
||||
['{59EB780A-FC81-43F6-9D5D-57B76B94C000}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -347,7 +347,7 @@ type
|
||||
|
||||
{ IListaAnosPresupuestos }
|
||||
IListaAnosPresupuestos = interface(IDAStronglyTypedDataTable)
|
||||
['{3AEB65F1-4948-4C06-BF1F-BA3060F0F06B}']
|
||||
['{EBF28BF5-BC89-4C6F-AE66-B6D895A58A86}']
|
||||
{ Property getters and setters }
|
||||
function GetANOValue: String;
|
||||
procedure SetANOValue(const aValue: String);
|
||||
@ -382,7 +382,7 @@ type
|
||||
|
||||
{ IPresupuestosCliente }
|
||||
IPresupuestosCliente = interface(IDAStronglyTypedDataTable)
|
||||
['{3AC483E0-CFFC-4406-9F09-E1DF675C2FC1}']
|
||||
['{BC002141-E0CE-41CB-9AAA-85B093181284}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -897,7 +897,7 @@ type
|
||||
|
||||
{ ICapitulosPresupuesto }
|
||||
ICapitulosPresupuesto = interface(IDAStronglyTypedDataTable)
|
||||
['{2E0B5814-8B22-4C77-8C40-2162ED673F5D}']
|
||||
['{A0E7A826-2872-426E-AD39-8FA97AAA61FE}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -1052,7 +1052,7 @@ type
|
||||
|
||||
{ IPresupuestosCliente_Detalles }
|
||||
IPresupuestosCliente_Detalles = interface(IDAStronglyTypedDataTable)
|
||||
['{B7CDAEEA-EF6A-484C-8CE9-D4E88ADA2ED1}']
|
||||
['{81779950-8754-42C2-A214-1147561D7D56}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
|
||||
@ -9,17 +9,17 @@ 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_ValoresDelta = '{CD4A587B-3372-4134-BAA6-FBCFA402EBF6}';
|
||||
RID_PropiedadesDelta = '{EFB1E26D-524C-4CFF-8B3A-BDDBE36FB1EF}';
|
||||
RID_ListaAnosPresupuestosDelta = '{95421BAF-1534-4293-A6C1-EFD21D3FCF1F}';
|
||||
RID_PresupuestosClienteDelta = '{28A0A025-CFA6-4384-A8A2-CB211996955D}';
|
||||
RID_CapitulosPresupuestoDelta = '{B339485B-FE22-47B9-AE8F-5738FD52D310}';
|
||||
RID_PresupuestosCliente_DetallesDelta = '{974C10D0-CF61-4660-85DD-C0CB0DE6D669}';
|
||||
RID_ValoresDelta = '{13FFF203-FA71-4ED9-AC0A-643A9FE5CAD2}';
|
||||
RID_PropiedadesDelta = '{6B42D145-11AB-46D7-88D3-65F1BE9C982F}';
|
||||
RID_ListaAnosPresupuestosDelta = '{ABE39CA0-27B3-4D80-AED4-FE540C66D871}';
|
||||
RID_PresupuestosClienteDelta = '{717C84FB-EC16-47E3-BD56-A26B1170EF2E}';
|
||||
RID_CapitulosPresupuestoDelta = '{F39487EB-F059-40C3-ABB1-8B6B4B0E271E}';
|
||||
RID_PresupuestosCliente_DetallesDelta = '{FE4CE80E-1435-4867-91AC-081602D5BAA4}';
|
||||
|
||||
type
|
||||
{ IValoresDelta }
|
||||
IValoresDelta = interface(IValores)
|
||||
['{CD4A587B-3372-4134-BAA6-FBCFA402EBF6}']
|
||||
['{13FFF203-FA71-4ED9-AC0A-643A9FE5CAD2}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -113,7 +113,7 @@ type
|
||||
|
||||
{ IPropiedadesDelta }
|
||||
IPropiedadesDelta = interface(IPropiedades)
|
||||
['{EFB1E26D-524C-4CFF-8B3A-BDDBE36FB1EF}']
|
||||
['{6B42D145-11AB-46D7-88D3-65F1BE9C982F}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldDESCRIPCIONValue : String;
|
||||
@ -159,7 +159,7 @@ type
|
||||
|
||||
{ IListaAnosPresupuestosDelta }
|
||||
IListaAnosPresupuestosDelta = interface(IListaAnosPresupuestos)
|
||||
['{95421BAF-1534-4293-A6C1-EFD21D3FCF1F}']
|
||||
['{ABE39CA0-27B3-4D80-AED4-FE540C66D871}']
|
||||
{ Property getters and setters }
|
||||
function GetOldANOValue : String;
|
||||
|
||||
@ -193,7 +193,7 @@ type
|
||||
|
||||
{ IPresupuestosClienteDelta }
|
||||
IPresupuestosClienteDelta = interface(IPresupuestosCliente)
|
||||
['{28A0A025-CFA6-4384-A8A2-CB211996955D}']
|
||||
['{717C84FB-EC16-47E3-BD56-A26B1170EF2E}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -711,7 +711,7 @@ type
|
||||
|
||||
{ ICapitulosPresupuestoDelta }
|
||||
ICapitulosPresupuestoDelta = interface(ICapitulosPresupuesto)
|
||||
['{B339485B-FE22-47B9-AE8F-5738FD52D310}']
|
||||
['{F39487EB-F059-40C3-ABB1-8B6B4B0E271E}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldPOSICIONValue : Integer;
|
||||
@ -865,7 +865,7 @@ type
|
||||
|
||||
{ IPresupuestosCliente_DetallesDelta }
|
||||
IPresupuestosCliente_DetallesDelta = interface(IPresupuestosCliente_Detalles)
|
||||
['{974C10D0-CF61-4660-85DD-C0CB0DE6D669}']
|
||||
['{FE4CE80E-1435-4867-91AC-081602D5BAA4}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_PRESUPUESTOValue : Integer;
|
||||
|
||||
@ -827,18 +827,17 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente
|
||||
Commands = <
|
||||
item
|
||||
Params = <
|
||||
item
|
||||
Name = 'TIPO_PRESUPUESTO'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
Value = ''
|
||||
end
|
||||
item
|
||||
Name = 'ID'
|
||||
DataType = datAutoInc
|
||||
GeneratorName = 'GEN_PRESUPUESTOS_CLI_ID'
|
||||
Value = ''
|
||||
end
|
||||
item
|
||||
Name = 'ID_EMPRESA'
|
||||
DataType = datInteger
|
||||
Value = ''
|
||||
end
|
||||
item
|
||||
Name = 'FECHA_PRESUPUESTO'
|
||||
DataType = datDateTime
|
||||
@ -997,6 +996,12 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente
|
||||
Name = 'NO_VALORADO'
|
||||
DataType = datSmallInt
|
||||
Value = ''
|
||||
end
|
||||
item
|
||||
Name = 'TIPO_PRESUPUESTO'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
Value = ''
|
||||
end>
|
||||
Statements = <
|
||||
item
|
||||
@ -1004,24 +1009,24 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente
|
||||
Default = True
|
||||
TargetTable = 'PRESUPUESTOS_CLIENTE'
|
||||
SQL =
|
||||
'INSERT'#10' INTO PRESUPUESTOS_CLIENTE'#10' (ID,'#10' FECHA_PRESUPUES' +
|
||||
'TO, FECHA_VIGENCIA, FECHA_DECISION, REFERENCIA,'#10' SITUACION, ' +
|
||||
'ID_CLIENTE, ID_DIRECCION, PERSONA_CONTACTO,'#10' FORMA_PAGO, PLA' +
|
||||
'ZO_ENTREGA, OBSERVACIONES, INCIDENCIAS,'#10' INCIDENCIAS_ACTIVAS' +
|
||||
', FECHA_ALTA, USUARIO, IMPORTE_NETO, IMPORTE_PORTE,'#10' DESCUEN' +
|
||||
'TO, IMPORTE_DESCUENTO, BASE_IMPONIBLE, ID_TIPO_IVA, IVA, IMPORTE' +
|
||||
'_IVA,'#10' RE, IMPORTE_RE, RECARGO_EQUIVALENCIA, IMPORTE_TOTAL, ' +
|
||||
'ID_FORMA_PAGO, ID_TIENDA, ID_VENDEDOR,'#10' ID_CONTRATO, NO_VALO' +
|
||||
'RADO, TIPO_PRESUPUESTO)'#10' VALUES'#10' (:ID,'#10' :FECHA_PRESUPUES' +
|
||||
'TO, :FECHA_VIGENCIA, :FECHA_DECISION, :REFERENCIA,'#10' :SITUACI' +
|
||||
'ON, :ID_CLIENTE, :ID_DIRECCION, :PERSONA_CONTACTO,'#10' :FORMA_P' +
|
||||
'AGO, :PLAZO_ENTREGA, :OBSERVACIONES, :INCIDENCIAS,'#10' :INCIDEN' +
|
||||
'CIAS_ACTIVAS, CURRENT_TIMESTAMP, :USUARIO, :IMPORTE_NETO, :IMPOR' +
|
||||
'TE_PORTE,'#10' :DESCUENTO, :IMPORTE_DESCUENTO, :BASE_IMPONIBLE, ' +
|
||||
':ID_TIPO_IVA, :IVA, :IMPORTE_IVA,'#10' :RE, :IMPORTE_RE, :RECARG' +
|
||||
'O_EQUIVALENCIA, :IMPORTE_TOTAL, :ID_FORMA_PAGO, :ID_TIENDA, :ID_' +
|
||||
'VENDEDOR,'#10' :ID_CONTRATO, :NO_VALORADO, :TIPO_PRESUPUESTO)'#10' ' +
|
||||
' '#10#10#10#10#10
|
||||
'INSERT'#10' INTO PRESUPUESTOS_CLIENTE'#10' (ID, ID_EMPRESA,'#10' FEC' +
|
||||
'HA_PRESUPUESTO, FECHA_VIGENCIA, FECHA_DECISION, REFERENCIA,'#10' ' +
|
||||
' SITUACION, ID_CLIENTE, ID_DIRECCION, PERSONA_CONTACTO,'#10' FOR' +
|
||||
'MA_PAGO, PLAZO_ENTREGA, OBSERVACIONES, INCIDENCIAS,'#10' INCIDEN' +
|
||||
'CIAS_ACTIVAS, FECHA_ALTA, USUARIO, IMPORTE_NETO, IMPORTE_PORTE,'#10 +
|
||||
' DESCUENTO, IMPORTE_DESCUENTO, BASE_IMPONIBLE, ID_TIPO_IVA, ' +
|
||||
'IVA, IMPORTE_IVA,'#10' RE, IMPORTE_RE, RECARGO_EQUIVALENCIA, IMP' +
|
||||
'ORTE_TOTAL, ID_FORMA_PAGO, ID_TIENDA, ID_VENDEDOR,'#10' ID_CONTR' +
|
||||
'ATO, NO_VALORADO, TIPO_PRESUPUESTO)'#10' VALUES'#10' (:ID, :ID_EMPRE' +
|
||||
'SA,'#10' :FECHA_PRESUPUESTO, :FECHA_VIGENCIA, :FECHA_DECISION, :' +
|
||||
'REFERENCIA,'#10' :SITUACION, :ID_CLIENTE, :ID_DIRECCION, :PERSON' +
|
||||
'A_CONTACTO,'#10' :FORMA_PAGO, :PLAZO_ENTREGA, :OBSERVACIONES, :I' +
|
||||
'NCIDENCIAS,'#10' :INCIDENCIAS_ACTIVAS, CURRENT_TIMESTAMP, :USUAR' +
|
||||
'IO, :IMPORTE_NETO, :IMPORTE_PORTE,'#10' :DESCUENTO, :IMPORTE_DES' +
|
||||
'CUENTO, :BASE_IMPONIBLE, :ID_TIPO_IVA, :IVA, :IMPORTE_IVA,'#10' ' +
|
||||
':RE, :IMPORTE_RE, :RECARGO_EQUIVALENCIA, :IMPORTE_TOTAL, :ID_FOR' +
|
||||
'MA_PAGO, :ID_TIENDA, :ID_VENDEDOR,'#10' :ID_CONTRATO, :NO_VALORA' +
|
||||
'DO, :TIPO_PRESUPUESTO)'#10' '#10#10#10#10#10
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <>
|
||||
end>
|
||||
|
||||
@ -26,7 +26,7 @@ uses
|
||||
uDetallesContratoClienteController, uControllerDetallesBase,
|
||||
uBizContactos, schPresupuestosClienteClient_Intf,
|
||||
schContratosClienteClient_Intf, uDireccionesContactoController,
|
||||
uBizDireccionesContacto;
|
||||
uBizDireccionesContacto, uFactuGES_App;
|
||||
|
||||
var
|
||||
dmGenerarContratosCli: TdmGenerarContratosCli;
|
||||
@ -251,6 +251,7 @@ begin
|
||||
|
||||
try
|
||||
AContrato := AContratosClienteController.Nuevo;
|
||||
AContrato.ID_EMPRESA := AppFactuGES.EmpresaActiva.ID;
|
||||
CopiarPresupuestoAContrato(APresupuesto, AContrato);
|
||||
CopiarDetallesAContrato(APresupuesto, AContrato, APresupuesto.Detalles);
|
||||
|
||||
|
||||
@ -142,6 +142,18 @@
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
<Operation Name="darValorParaEmpresa" UID="{CA726C55-472E-464A-A429-8A96F14723C6}">
|
||||
<Parameters>
|
||||
<Parameter Name="Result" DataType="AnsiString" Flag="Result">
|
||||
</Parameter>
|
||||
<Parameter Name="CODIGO" DataType="AnsiString" Flag="In" >
|
||||
</Parameter>
|
||||
<Parameter Name="ID_EMPRESA" DataType="Integer" Flag="In" >
|
||||
</Parameter>
|
||||
<Parameter Name="ValorPorDefecto" DataType="AnsiString" Flag="In" >
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
<Operation Name="guardarValor" UID="{ECE80435-0CBB-45A1-8628-B2292516FD81}">
|
||||
<Parameters>
|
||||
<Parameter Name="CODIGO" DataType="AnsiString" Flag="In" >
|
||||
@ -150,6 +162,16 @@
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
<Operation Name="guardarValorParaEmpresa" UID="{229426DB-3488-458B-AC4C-B37349A4B301}">
|
||||
<Parameters>
|
||||
<Parameter Name="CODIGO" DataType="AnsiString" Flag="In" >
|
||||
</Parameter>
|
||||
<Parameter Name="ID_EMPRESA" DataType="Integer" Flag="In" >
|
||||
</Parameter>
|
||||
<Parameter Name="Valor" DataType="AnsiString" Flag="In" >
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
</Operations>
|
||||
</Interface>
|
||||
</Interfaces>
|
||||
|
||||
@ -314,7 +314,9 @@ type
|
||||
IsrvConfiguracion = interface(IDataAbstractService)
|
||||
['{0882B8A4-C8AA-424E-8FC1-C6226B670522}']
|
||||
function darValor(const CODIGO: AnsiString; const ValorPorDefecto: AnsiString): AnsiString;
|
||||
function darValorParaEmpresa(const CODIGO: AnsiString; const ID_EMPRESA: Integer; const ValorPorDefecto: AnsiString): AnsiString;
|
||||
procedure guardarValor(const CODIGO: AnsiString; const Valor: AnsiString);
|
||||
procedure guardarValorParaEmpresa(const CODIGO: AnsiString; const ID_EMPRESA: Integer; const Valor: AnsiString);
|
||||
end;
|
||||
|
||||
{ CosrvConfiguracion }
|
||||
@ -328,7 +330,9 @@ type
|
||||
function __GetInterfaceName:string; override;
|
||||
|
||||
function darValor(const CODIGO: AnsiString; const ValorPorDefecto: AnsiString): AnsiString;
|
||||
function darValorParaEmpresa(const CODIGO: AnsiString; const ID_EMPRESA: Integer; const ValorPorDefecto: AnsiString): AnsiString;
|
||||
procedure guardarValor(const CODIGO: AnsiString; const Valor: AnsiString);
|
||||
procedure guardarValorParaEmpresa(const CODIGO: AnsiString; const ID_EMPRESA: Integer; const Valor: AnsiString);
|
||||
end;
|
||||
|
||||
{ IsrvFamilias }
|
||||
@ -1553,6 +1557,24 @@ begin
|
||||
end
|
||||
end;
|
||||
|
||||
function TsrvConfiguracion_Proxy.darValorParaEmpresa(const CODIGO: AnsiString; const ID_EMPRESA: Integer; const ValorPorDefecto: AnsiString): AnsiString;
|
||||
begin
|
||||
try
|
||||
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'darValorParaEmpresa');
|
||||
__Message.Write('CODIGO', TypeInfo(AnsiString), CODIGO, []);
|
||||
__Message.Write('ID_EMPRESA', TypeInfo(Integer), ID_EMPRESA, []);
|
||||
__Message.Write('ValorPorDefecto', TypeInfo(AnsiString), ValorPorDefecto, []);
|
||||
__Message.Finalize;
|
||||
|
||||
__TransportChannel.Dispatch(__Message);
|
||||
|
||||
__Message.Read('Result', TypeInfo(AnsiString), result, []);
|
||||
finally
|
||||
__Message.UnsetAttributes(__TransportChannel);
|
||||
__Message.FreeStream;
|
||||
end
|
||||
end;
|
||||
|
||||
procedure TsrvConfiguracion_Proxy.guardarValor(const CODIGO: AnsiString; const Valor: AnsiString);
|
||||
begin
|
||||
try
|
||||
@ -1569,6 +1591,23 @@ begin
|
||||
end
|
||||
end;
|
||||
|
||||
procedure TsrvConfiguracion_Proxy.guardarValorParaEmpresa(const CODIGO: AnsiString; const ID_EMPRESA: Integer; const Valor: AnsiString);
|
||||
begin
|
||||
try
|
||||
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'guardarValorParaEmpresa');
|
||||
__Message.Write('CODIGO', TypeInfo(AnsiString), CODIGO, []);
|
||||
__Message.Write('ID_EMPRESA', TypeInfo(Integer), ID_EMPRESA, []);
|
||||
__Message.Write('Valor', TypeInfo(AnsiString), Valor, []);
|
||||
__Message.Finalize;
|
||||
|
||||
__TransportChannel.Dispatch(__Message);
|
||||
|
||||
finally
|
||||
__Message.UnsetAttributes(__TransportChannel);
|
||||
__Message.FreeStream;
|
||||
end
|
||||
end;
|
||||
|
||||
{ CosrvFamilias }
|
||||
|
||||
class function CosrvFamilias.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvFamilias;
|
||||
|
||||
@ -77,7 +77,9 @@ type
|
||||
constructor Create; override;
|
||||
published
|
||||
procedure Invoke_darValor(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_darValorParaEmpresa(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_guardarValor(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_guardarValorParaEmpresa(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
end;
|
||||
|
||||
TsrvFamilias_Invoker = class(TDataAbstractService_Invoker)
|
||||
@ -639,6 +641,30 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TsrvConfiguracion_Invoker.Invoke_darValorParaEmpresa(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
{ function darValorParaEmpresa(const CODIGO: AnsiString; const ID_EMPRESA: Integer; const ValorPorDefecto: AnsiString): AnsiString; }
|
||||
var
|
||||
CODIGO: AnsiString;
|
||||
ID_EMPRESA: Integer;
|
||||
ValorPorDefecto: AnsiString;
|
||||
lResult: AnsiString;
|
||||
begin
|
||||
try
|
||||
__Message.Read('CODIGO', TypeInfo(AnsiString), CODIGO, []);
|
||||
__Message.Read('ID_EMPRESA', TypeInfo(Integer), ID_EMPRESA, []);
|
||||
__Message.Read('ValorPorDefecto', TypeInfo(AnsiString), ValorPorDefecto, []);
|
||||
|
||||
lResult := (__Instance as IsrvConfiguracion).darValorParaEmpresa(CODIGO, ID_EMPRESA, ValorPorDefecto);
|
||||
|
||||
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvConfiguracion', 'darValorParaEmpresaResponse');
|
||||
__Message.Write('Result', TypeInfo(AnsiString), lResult, []);
|
||||
__Message.Finalize;
|
||||
__Message.UnsetAttributes(__Transport);
|
||||
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TsrvConfiguracion_Invoker.Invoke_guardarValor(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
{ procedure guardarValor(const CODIGO: AnsiString; const Valor: AnsiString); }
|
||||
var
|
||||
@ -661,6 +687,30 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TsrvConfiguracion_Invoker.Invoke_guardarValorParaEmpresa(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
{ procedure guardarValorParaEmpresa(const CODIGO: AnsiString; const ID_EMPRESA: Integer; const Valor: AnsiString); }
|
||||
var
|
||||
CODIGO: AnsiString;
|
||||
ID_EMPRESA: Integer;
|
||||
Valor: AnsiString;
|
||||
begin
|
||||
try
|
||||
__Message.Read('CODIGO', TypeInfo(AnsiString), CODIGO, []);
|
||||
__Message.Read('ID_EMPRESA', TypeInfo(Integer), ID_EMPRESA, []);
|
||||
__Message.Read('Valor', TypeInfo(AnsiString), Valor, []);
|
||||
|
||||
(__Instance as IsrvConfiguracion).guardarValorParaEmpresa(CODIGO, ID_EMPRESA, Valor);
|
||||
|
||||
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvConfiguracion', 'guardarValorParaEmpresaResponse');
|
||||
__Message.Finalize;
|
||||
__Message.UnsetAttributes(__Transport);
|
||||
|
||||
__oResponseOptions := [roNoResponse];
|
||||
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TsrvFamilias_Invoker }
|
||||
|
||||
constructor TsrvFamilias_Invoker.Create;
|
||||
|
||||
Binary file not shown.
@ -50,6 +50,49 @@ object srvConfiguracion: TsrvConfiguracion
|
||||
Name = 'VALOR_BLOB'
|
||||
DataType = datMemo
|
||||
end>
|
||||
end
|
||||
item
|
||||
Params = <
|
||||
item
|
||||
Name = 'CODIGO'
|
||||
DataType = datString
|
||||
Size = 50
|
||||
Value = ''
|
||||
end
|
||||
item
|
||||
Name = 'ID_EMPRESA'
|
||||
DataType = datInteger
|
||||
Value = ''
|
||||
end>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
TargetTable = 'CONFIGURACION'
|
||||
SQL =
|
||||
'SELECT VALOR, VALOr_BLOB'#10'FROM CONFIGURACION'#10'WHERE CODIGO = :CODI' +
|
||||
'GO'#10'AND ID_EMPRESA = :ID_EMPRESA'#10
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <
|
||||
item
|
||||
DatasetField = 'VALOR'
|
||||
TableField = 'VALOR'
|
||||
end
|
||||
item
|
||||
DatasetField = 'VALOR_BLOB'
|
||||
TableField = 'VALOR_BLOB'
|
||||
end>
|
||||
end>
|
||||
Name = 'darValorParaEmpresa'
|
||||
Fields = <
|
||||
item
|
||||
Name = 'VALOR'
|
||||
DataType = datString
|
||||
Size = 2000
|
||||
end
|
||||
item
|
||||
Name = 'VALOR_BLOB'
|
||||
DataType = datMemo
|
||||
end>
|
||||
end>
|
||||
JoinDataTables = <>
|
||||
UnionDataTables = <>
|
||||
@ -115,6 +158,37 @@ object srvConfiguracion: TsrvConfiguracion
|
||||
ColumnMappings = <>
|
||||
end>
|
||||
Name = 'UpdateValor'
|
||||
end
|
||||
item
|
||||
Params = <
|
||||
item
|
||||
Name = 'VALOR'
|
||||
Value = ''
|
||||
end
|
||||
item
|
||||
Name = 'VALOR_BLOB'
|
||||
Value = ''
|
||||
end
|
||||
item
|
||||
Name = 'CODIGO'
|
||||
Value = ''
|
||||
end
|
||||
item
|
||||
Name = 'ID_EMPRESA'
|
||||
Value = ''
|
||||
end>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
ConnectionType = 'Interbase'
|
||||
Default = True
|
||||
SQL =
|
||||
'update CONFIGURACION'#10'set'#10'VALOR = :VALOR,'#10'VALOR_BLOB = :VALOR_BLO' +
|
||||
'B'#10'where CODIGO = :CODIGO'#10'AND ID_EMPRESA = :ID_EMPRESA'#10#10
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <>
|
||||
end>
|
||||
Name = 'UpdateValorParaEmpresa'
|
||||
end>
|
||||
RelationShips = <>
|
||||
UpdateRules = <>
|
||||
|
||||
@ -10,7 +10,7 @@ unit srvConfiguracion_Impl;
|
||||
interface
|
||||
|
||||
uses
|
||||
{vcl:} Classes, SysUtils,
|
||||
{vcl:} Classes, SysUtils,
|
||||
{RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions,
|
||||
{Ancestor Implementation:} DataAbstractService_Impl,
|
||||
{Used RODLs:} DataAbstract4_Intf,
|
||||
@ -27,8 +27,10 @@ type
|
||||
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string);
|
||||
protected
|
||||
{ IsrvConfiguracion methods }
|
||||
function DarValor(const CODIGO: String; Const ValorPorDefecto: String = ''): String;
|
||||
procedure GuardarValor(const CODIGO: AnsiString; const Valor: AnsiString);
|
||||
function darValor(const CODIGO: AnsiString; const ValorPorDefecto: String = ''): AnsiString;
|
||||
function darValorParaEmpresa(const CODIGO: AnsiString; const ID_EMPRESA: Integer; const ValorPorDefecto: String = ''): AnsiString;
|
||||
procedure guardarValor(const CODIGO: AnsiString; const Valor: String = '');
|
||||
procedure guardarValorParaEmpresa(const CODIGO: AnsiString; const ID_EMPRESA: Integer; const Valor: String = '');
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -91,13 +93,51 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TsrvConfiguracion.darValorParaEmpresa(const CODIGO: AnsiString;
|
||||
const ID_EMPRESA: Integer; const ValorPorDefecto: String): AnsiString;
|
||||
var
|
||||
ADataSet : IDADataset;
|
||||
ACurrentConn : IDAConnection;
|
||||
ACommand : IDASQLCommand;
|
||||
begin
|
||||
try
|
||||
ADataSet := schConfiguracion.NewDataset(Connection, 'darValorParaEmpresa', ['CODIGO','ID_EMPRESA'], [CODIGO, ID_EMPRESA]);
|
||||
ADataSet.Open;
|
||||
if ADataSet.Dataset.RecordCount > 0 then
|
||||
Result := ADataSet.Dataset.Fields[0].AsVariant
|
||||
else
|
||||
begin
|
||||
Result := ValorPorDefecto;
|
||||
//Creamos la variable de configuración con su valor por defecto
|
||||
ACurrentConn := dmServer.ConnectionManager.NewConnection(dmServer.ConnectionManager.GetDefaultConnectionName);
|
||||
ACommand := schConfiguracion.NewCommand(ACurrentConn, 'InsertarValor');
|
||||
try
|
||||
with ACommand do
|
||||
begin
|
||||
ParamByName('CODIGO').Value := CODIGO;
|
||||
ParamByName('VALOR').Value := ValorPorDefecto;
|
||||
ParamByName('ID_EMPRESA').Value := ID_EMPRESA;
|
||||
Execute;
|
||||
ACurrentConn.CommitTransaction;
|
||||
end;
|
||||
except
|
||||
ACurrentConn.RollbackTransaction;
|
||||
end;
|
||||
ACommand := NIL;
|
||||
// RaiseError('Falta variable de configuracion: ' + CODIGO);
|
||||
end;
|
||||
finally
|
||||
ADataSet.Close;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TsrvConfiguracion.DataAbstractServiceBeforeAcquireConnection(
|
||||
aSender: TObject; var aConnectionName: string);
|
||||
begin
|
||||
ConnectionName := dmServer.ConnectionName;
|
||||
end;
|
||||
|
||||
procedure TsrvConfiguracion.GuardarValor(const CODIGO: AnsiString; const Valor: AnsiString);
|
||||
procedure TsrvConfiguracion.GuardarValor(const CODIGO: AnsiString; const Valor: String = '');
|
||||
var
|
||||
ACurrentConn : IDAConnection;
|
||||
ACommand : IDASQLCommand;
|
||||
@ -136,6 +176,33 @@ begin
|
||||
ACommand := NIL;
|
||||
end;
|
||||
|
||||
procedure TsrvConfiguracion.guardarValorParaEmpresa(const CODIGO: AnsiString;
|
||||
const ID_EMPRESA: Integer; const Valor: String);
|
||||
var
|
||||
ACurrentConn : IDAConnection;
|
||||
ACommand : IDASQLCommand;
|
||||
st: TStringStream;
|
||||
st2: IROStream;
|
||||
|
||||
begin
|
||||
//Creamos la variable de configuración con su valor por defecto
|
||||
ACurrentConn := dmServer.ConnectionManager.NewConnection(dmServer.ConnectionManager.GetDefaultConnectionName);
|
||||
ACommand := schConfiguracion.NewCommand(ACurrentConn, 'UpdateValorParaEmpresa');
|
||||
try
|
||||
with ACommand do
|
||||
begin
|
||||
ParamByName('CODIGO').Value := CODIGO;
|
||||
ParamByName('ID_EMPRESA').Value := ID_EMPRESA;
|
||||
ParamByName('VALOR').Value := Valor;
|
||||
Execute;
|
||||
ACurrentConn.CommitTransaction;
|
||||
end;
|
||||
except
|
||||
ACurrentConn.RollbackTransaction;
|
||||
end;
|
||||
ACommand := NIL;
|
||||
end;
|
||||
|
||||
initialization
|
||||
TROClassFactory.Create('srvConfiguracion', Create_srvConfiguracion, TsrvConfiguracion_Invoker);
|
||||
|
||||
|
||||
@ -131,15 +131,15 @@ uses
|
||||
schArticulosServer_Intf in '..\Modulos\Articulos\Model\schArticulosServer_Intf.pas',
|
||||
schContratosClienteClient_Intf in '..\Modulos\Contratos de cliente\Model\schContratosClienteClient_Intf.pas',
|
||||
schContratosClienteServer_Intf in '..\Modulos\Contratos de cliente\Model\schContratosClienteServer_Intf.pas',
|
||||
schPresupuestosClienteClient_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteClient_Intf.pas',
|
||||
schPresupuestosClienteServer_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteServer_Intf.pas',
|
||||
schEmpresasClient_Intf in '..\ApplicationBase\Empresas\Model\schEmpresasClient_Intf.pas',
|
||||
schEmpresasServer_Intf in '..\ApplicationBase\Empresas\Model\schEmpresasServer_Intf.pas',
|
||||
srvSubfamilias_Impl in '..\Modulos\Subfamilias\Servidor\srvSubfamilias_Impl.pas' {srvSubfamilias: TDataAbstractService},
|
||||
schSubfamiliasClient_Intf in '..\Modulos\Subfamilias\Model\schSubfamiliasClient_Intf.pas',
|
||||
schSubfamiliasServer_Intf in '..\Modulos\Subfamilias\Model\schSubfamiliasServer_Intf.pas',
|
||||
schContactosClient_Intf in '..\Modulos\Contactos\Model\schContactosClient_Intf.pas',
|
||||
schContactosServer_Intf in '..\Modulos\Contactos\Model\schContactosServer_Intf.pas';
|
||||
schContactosServer_Intf in '..\Modulos\Contactos\Model\schContactosServer_Intf.pas',
|
||||
schPresupuestosClienteClient_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteClient_Intf.pas',
|
||||
schPresupuestosClienteServer_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteServer_Intf.pas';
|
||||
|
||||
{$R *.res}
|
||||
{$R ..\Servicios\RODLFile.res}
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user