Se arregla la localización del usuario con el que se ha logeado para poder asignarlo en los docmentos
git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@474 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
parent
f0093571a4
commit
2d6a376c4f
@ -262,6 +262,7 @@ end;
|
|||||||
|
|
||||||
procedure TAppFactuGES.BuscarTiendaPorDefecto;
|
procedure TAppFactuGES.BuscarTiendaPorDefecto;
|
||||||
begin
|
begin
|
||||||
|
//OJO -> MIRAR SIEMPRE QUE EL VENDEDOR TENGA ASOCIADA UNA TIENDA Y UN USUARIO EXISTENTE
|
||||||
//Nos devuelve el id de la tienda a la que pertenece el vendedor que tiene asignado
|
//Nos devuelve el id de la tienda a la que pertenece el vendedor que tiene asignado
|
||||||
//el usuario con el que ha accedido a la aplicación.
|
//el usuario con el que ha accedido a la aplicación.
|
||||||
//Esto funciona mientras la relación sea 1 a 1, cuando sea 1 a n (un usuario pertenece a varios vendedores deja de funcionar)
|
//Esto funciona mientras la relación sea 1 a 1, cuando sea 1 a n (un usuario pertenece a varios vendedores deja de funcionar)
|
||||||
|
|||||||
@ -46,6 +46,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Excluded_Packages Name="D:\MISDOC~1\BORLAN~1\Bpl\JclDebugExpert100.bpl">JCL Debug IDE extension</Excluded_Packages>
|
<Excluded_Packages Name="D:\MISDOC~1\BORLAN~1\Bpl\JclDebugExpert100.bpl">JCL Debug IDE extension</Excluded_Packages>
|
||||||
<Excluded_Packages Name="D:\MISDOC~1\BORLAN~1\Bpl\JclProjectAnalysisExpert100.bpl">JCL Project Analyzer</Excluded_Packages>
|
<Excluded_Packages Name="D:\MISDOC~1\BORLAN~1\Bpl\JclProjectAnalysisExpert100.bpl">JCL Project Analyzer</Excluded_Packages>
|
||||||
<Excluded_Packages Name="D:\MISDOC~1\BORLAN~1\Bpl\JclFavoriteFoldersExpert100.bpl">JCL Open and Save IDE dialogs with favorite folders</Excluded_Packages>
|
<Excluded_Packages Name="D:\MISDOC~1\BORLAN~1\Bpl\JclFavoriteFoldersExpert100.bpl">JCL Open and Save IDE dialogs with favorite folders</Excluded_Packages>
|
||||||
@ -56,6 +62,19 @@
|
|||||||
<DelphiCompile Include="Contactos_controller.dpk">
|
<DelphiCompile Include="Contactos_controller.dpk">
|
||||||
<MainSource>MainSource</MainSource>
|
<MainSource>MainSource</MainSource>
|
||||||
</DelphiCompile>
|
</DelphiCompile>
|
||||||
|
<DCCReference Include="..\..\..\Servidor\ApplicationBase.dcp" />
|
||||||
|
<DCCReference Include="..\..\..\Servidor\Base.dcp" />
|
||||||
|
<DCCReference Include="..\..\..\Servidor\Contabilidad_controller.dcp" />
|
||||||
|
<DCCReference Include="..\..\..\Servidor\Contactos_data.dcp" />
|
||||||
|
<DCCReference Include="..\..\..\Servidor\Contactos_model.dcp" />
|
||||||
|
<DCCReference Include="..\..\..\Servidor\designide.dcp" />
|
||||||
|
<DCCReference Include="..\..\..\Servidor\GUIBase.dcp" />
|
||||||
|
<DCCReference Include="..\..\..\Servidor\GUISDK_D11R.dcp" />
|
||||||
|
<DCCReference Include="..\..\..\Servidor\rtl.dcp" />
|
||||||
|
<DCCReference Include="..\..\..\Servidor\vcl.dcp" />
|
||||||
|
<DCCReference Include="..\..\..\Servidor\vclactnband.dcp" />
|
||||||
|
<DCCReference Include="..\..\..\Servidor\vclx.dcp" />
|
||||||
|
<DCCReference Include="..\..\..\Servidor\xmlrtl.dcp" />
|
||||||
<DCCReference Include="uClientesController.pas" />
|
<DCCReference Include="uClientesController.pas" />
|
||||||
<DCCReference Include="uContactosController.pas" />
|
<DCCReference Include="uContactosController.pas" />
|
||||||
<DCCReference Include="uDireccionesContactoController.pas" />
|
<DCCReference Include="uDireccionesContactoController.pas" />
|
||||||
@ -66,15 +85,6 @@
|
|||||||
<DCCReference Include="uProcedenciasClienteController.pas" />
|
<DCCReference Include="uProcedenciasClienteController.pas" />
|
||||||
<DCCReference Include="uProveedoresController.pas" />
|
<DCCReference Include="uProveedoresController.pas" />
|
||||||
<DCCReference Include="uVendedoresController.pas" />
|
<DCCReference Include="uVendedoresController.pas" />
|
||||||
<DCCReference Include="View\ApplicationBase.dcp" />
|
|
||||||
<DCCReference Include="View\Base.dcp" />
|
|
||||||
<DCCReference Include="View\Contabilidad_controller.dcp" />
|
|
||||||
<DCCReference Include="View\Contactos_data.dcp" />
|
|
||||||
<DCCReference Include="View\Contactos_model.dcp" />
|
|
||||||
<DCCReference Include="View\designide.dcp" />
|
|
||||||
<DCCReference Include="View\GUIBase.dcp" />
|
|
||||||
<DCCReference Include="View\GUISDK_D11R.dcp" />
|
|
||||||
<DCCReference Include="View\rtl.dcp" />
|
|
||||||
<DCCReference Include="View\uIEditorCliente.pas" />
|
<DCCReference Include="View\uIEditorCliente.pas" />
|
||||||
<DCCReference Include="View\uIEditorClientes.pas" />
|
<DCCReference Include="View\uIEditorClientes.pas" />
|
||||||
<DCCReference Include="View\uIEditorContacto.pas" />
|
<DCCReference Include="View\uIEditorContacto.pas" />
|
||||||
@ -95,10 +105,6 @@
|
|||||||
<DCCReference Include="View\uIEditorProveedores.pas" />
|
<DCCReference Include="View\uIEditorProveedores.pas" />
|
||||||
<DCCReference Include="View\uIEditorVendedor.pas" />
|
<DCCReference Include="View\uIEditorVendedor.pas" />
|
||||||
<DCCReference Include="View\uIEditorVendedores.pas" />
|
<DCCReference Include="View\uIEditorVendedores.pas" />
|
||||||
<DCCReference Include="View\vcl.dcp" />
|
|
||||||
<DCCReference Include="View\vclactnband.dcp" />
|
|
||||||
<DCCReference Include="View\vclx.dcp" />
|
|
||||||
<DCCReference Include="View\xmlrtl.dcp" />
|
|
||||||
<None Include="ModelSupport_Contactos_controller\default.txaPackage" />
|
<None Include="ModelSupport_Contactos_controller\default.txaPackage" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -18,7 +18,7 @@ type
|
|||||||
function DarListaVendedores : TStringList;
|
function DarListaVendedores : TStringList;
|
||||||
function BuscarTodos: IBizContacto; overload;
|
function BuscarTodos: IBizContacto; overload;
|
||||||
function BuscarTodos(const CadenaIDs: String): IBizContacto; overload;
|
function BuscarTodos(const CadenaIDs: String): IBizContacto; overload;
|
||||||
function DarIDVendedorDeUsuario(const AUsuario: String): Integer;
|
function DarIDVendedorDeUsuario(const AUsuario: Integer): Integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TVendedoresController = class(TContactosController, IVendedoresController)
|
TVendedoresController = class(TContactosController, IVendedoresController)
|
||||||
@ -38,7 +38,7 @@ type
|
|||||||
|
|
||||||
function Eliminar(AVendedor: IBizContacto; AllItems: Boolean = false): Boolean; overload;
|
function Eliminar(AVendedor: IBizContacto; AllItems: Boolean = false): Boolean; overload;
|
||||||
function EsEliminable(AVendedor: IBizContacto): Boolean;
|
function EsEliminable(AVendedor: IBizContacto): Boolean;
|
||||||
function DarIDVendedorDeUsuario(const AUsuario: String): Integer;
|
function DarIDVendedorDeUsuario(const AUsuario: Integer): Integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -106,11 +106,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TVendedoresController.DarIDVendedorDeUsuario(
|
function TVendedoresController.DarIDVendedorDeUsuario(
|
||||||
const AUsuario: String): Integer;
|
const AUsuario: Integer): Integer;
|
||||||
var
|
var
|
||||||
AVendedores: IBizContacto;
|
AVendedores: IBizVendedor;
|
||||||
begin
|
begin
|
||||||
AVendedores := BuscarTodos;
|
AVendedores := (BuscarTodos as IBizVendedor);
|
||||||
AVendedores.DataTable.Active := True;
|
AVendedores.DataTable.Active := True;
|
||||||
|
|
||||||
with AVendedores.DataTable do
|
with AVendedores.DataTable do
|
||||||
@ -118,7 +118,7 @@ begin
|
|||||||
First;
|
First;
|
||||||
while not EOF do
|
while not EOF do
|
||||||
begin
|
begin
|
||||||
if (not AVendedores.USUARIOIsNull) and (AVendedores.USUARIO = AUsuario) then
|
if (AVendedores.ID_USUARIO = AUsuario) then
|
||||||
begin
|
begin
|
||||||
Result := AVendedores.ID;
|
Result := AVendedores.ID;
|
||||||
Break;
|
Break;
|
||||||
|
|||||||
@ -271,7 +271,7 @@ var
|
|||||||
begin
|
begin
|
||||||
AVendedoresController := TVendedoresController.Create;
|
AVendedoresController := TVendedoresController.Create;
|
||||||
try
|
try
|
||||||
ID_VENDEDOR := AVendedoresController.DarIDVendedorDeUsuario(AppFactuGES.UsuarioActivo.UserName);
|
ID_VENDEDOR := AVendedoresController.DarIDVendedorDeUsuario(AppFactuGES.UsuarioActivo.ID);
|
||||||
finally
|
finally
|
||||||
AVendedoresController := nil;
|
AVendedoresController := nil;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -225,7 +225,7 @@ var
|
|||||||
begin
|
begin
|
||||||
AVendedoresController := TVendedoresController.Create;
|
AVendedoresController := TVendedoresController.Create;
|
||||||
try
|
try
|
||||||
ID_VENDEDOR := AVendedoresController.DarIDVendedorDeUsuario(AppFactuGES.UsuarioActivo.UserName);
|
ID_VENDEDOR := AVendedoresController.DarIDVendedorDeUsuario(AppFactuGES.UsuarioActivo.ID);
|
||||||
finally
|
finally
|
||||||
AVendedoresController := nil;
|
AVendedoresController := nil;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Binary file not shown.
@ -16,7 +16,7 @@ BEGIN
|
|||||||
VALUE "FileVersion", "2.3.9.0\0"
|
VALUE "FileVersion", "2.3.9.0\0"
|
||||||
VALUE "ProductName", "FactuGES (Servidor)\0"
|
VALUE "ProductName", "FactuGES (Servidor)\0"
|
||||||
VALUE "ProductVersion", "2.3.9.0\0"
|
VALUE "ProductVersion", "2.3.9.0\0"
|
||||||
VALUE "CompileDate", "martes, 24 de noviembre de 2009 17:00\0"
|
VALUE "CompileDate", "martes, 24 de noviembre de 2009 18:30\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user