git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@29 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
parent
27fca54c58
commit
872b1146ed
Binary file not shown.
@ -11,6 +11,7 @@ type
|
||||
['{94E5F2B6-64C8-4331-B9CB-3ED730478529}']
|
||||
function BuscarTodos: IBizEjercicio;
|
||||
function Buscar(ID: Integer): IBizEjercicio;
|
||||
function BuscarActivo(IDEmpresa: Integer): IBizEjercicio;
|
||||
procedure VerTodos(AEjercicios: IBizEjercicio);
|
||||
procedure Ver(AEjercicio: IBizEjercicio);
|
||||
procedure Anadir(AEjercicio : IBizEjercicio);
|
||||
@ -45,6 +46,7 @@ type
|
||||
procedure Anadir(AEjercicio : IBizEjercicio);
|
||||
function BuscarTodos: IBizEjercicio;
|
||||
function Buscar(ID: Integer): IBizEjercicio;
|
||||
function BuscarActivo(IDEmpresa: Integer): IBizEjercicio;
|
||||
procedure VerTodos(AEjercicios: IBizEjercicio);
|
||||
procedure Ver(AEjercicio: IBizEjercicio);
|
||||
function GenerarPCG(IdEjercicioCopia, IdEjercicio: Integer): Boolean;
|
||||
@ -98,6 +100,30 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TEjerciciosController.BuscarActivo(IDEmpresa: Integer): IBizEjercicio;
|
||||
var
|
||||
Condicion: TDAWhereExpression;
|
||||
begin
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
Result := BuscarTodos;
|
||||
|
||||
with Result.DataTable.DynamicWhere do
|
||||
begin
|
||||
// (ACTIVO = 1)
|
||||
Condicion := NewBinaryExpression(NewField('', fld_EjerciciosACTIVO), NewConstant(1, datInteger), dboEqual);
|
||||
|
||||
if IsEmpty then
|
||||
Expression := Condicion
|
||||
else
|
||||
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
||||
end;
|
||||
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TEjerciciosController.BuscarTodos: IBizEjercicio;
|
||||
begin
|
||||
Result := FDataModule.GetItems;
|
||||
@ -290,6 +316,7 @@ begin
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
AEjercicio.DataTable.ApplyUpdates;
|
||||
AppFactuGES.CambiarEjercicio(AppFactuGES.EmpresaActiva.ID);
|
||||
Result := True;
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
|
||||
@ -29,7 +29,7 @@ type
|
||||
function GetAppVersion: String;
|
||||
function GetUsuarioActivo: TUsuario;
|
||||
function GetEmpresaActiva: IBizEmpresa;
|
||||
// function GetEjercicioActivo: IBizEjercicio;
|
||||
function GetEjercicioActivo: IBizEjercicio;
|
||||
function GetModuleManager : THostManager;
|
||||
function GetTerminated: Boolean;
|
||||
|
||||
@ -43,6 +43,7 @@ type
|
||||
procedure SetAppSplashForm (AAppSplashForm : IAppSplashForm);
|
||||
|
||||
procedure CambiarEmpresa(const AIDEmpresa : Integer);
|
||||
procedure CambiarEjercicio(const AIDEmpresa : Integer);
|
||||
|
||||
procedure ShowSplashForm;
|
||||
procedure HideSplashForm;
|
||||
@ -54,7 +55,7 @@ type
|
||||
property AppName : String read GetAppName;
|
||||
property MainForm : TCustomForm read GetMainForm;
|
||||
property EmpresaActiva : IBizEmpresa read GetEmpresaActiva;
|
||||
// property EjercicioActivo : IBizEjercicio read GetEjercicioActivo;
|
||||
property EjercicioActivo : IBizEjercicio read GetEjercicioActivo;
|
||||
property UsuarioActivo : TUsuario read GetUsuarioActivo;
|
||||
property EmpresasController : IEmpresasController read GetEmpresasController;
|
||||
property UsuariosController : IUsuariosController read GetUsuariosController;
|
||||
@ -63,7 +64,7 @@ type
|
||||
property DoMainFormEvent : TDoMainFormEvent read GetDoMainFormEvent write SetDoMainFormEvent;
|
||||
property DoLoadModulesEvent : TDoLoadModulesEvent read GetLoadModulesEvent write SetLoadModulesEvent;
|
||||
property Terminated : Boolean read GetTerminated;
|
||||
|
||||
|
||||
procedure ShowCapado;
|
||||
end;
|
||||
|
||||
@ -74,6 +75,7 @@ type
|
||||
FEmpresasController : IEmpresasController;
|
||||
FUsuariosController: IUsuariosController;
|
||||
FEmpresaActiva: IBizEmpresa;
|
||||
FEjercicioActivo: IBizEjercicio;
|
||||
FAppSplashForm : IAppSplashForm;
|
||||
FHostManager : THostManager;
|
||||
FTerminated : Boolean;
|
||||
@ -88,6 +90,7 @@ type
|
||||
function GetAppVersion: String;
|
||||
function GetUsuarioActivo: TUsuario;
|
||||
function GetEmpresaActiva: IBizEmpresa;
|
||||
function GetEjercicioActivo: IBizEjercicio;
|
||||
function GetModuleManager : THostManager;
|
||||
function GetTerminated: Boolean;
|
||||
|
||||
@ -117,11 +120,13 @@ type
|
||||
procedure Terminate;
|
||||
|
||||
procedure CambiarEmpresa(const AIDEmpresa : Integer);
|
||||
procedure CambiarEjercicio(const AIDEmpresa : Integer);
|
||||
|
||||
property AppVersion : String read GetAppVersion;
|
||||
property AppName : String read GetAppName;
|
||||
property MainForm : TCustomForm read GetMainForm;
|
||||
property EmpresaActiva : IBizEmpresa read GetEmpresaActiva;
|
||||
property EjercicioActivo : IBizEjercicio read GetEjercicioActivo;
|
||||
property AppSplashForm : IAppSplashForm read GetAppSplashForm write SetAppSplashForm;
|
||||
property UsuarioActivo : TUsuario read GetUsuarioActivo;
|
||||
property EmpresasController : IEmpresasController read GetEmpresasController;
|
||||
@ -141,7 +146,26 @@ implementation
|
||||
|
||||
uses
|
||||
Dialogs, uDialogUtils, cxControls, uUsuariosViewRegister,
|
||||
uEmpresasViewRegister;
|
||||
uEmpresasViewRegister, uEjerciciosController;
|
||||
|
||||
procedure TAppFactuGES.CambiarEjercicio(const AIDEmpresa: Integer);
|
||||
var
|
||||
Aux : IBizEjercicio;
|
||||
AEjerciciosController: IEjerciciosController;
|
||||
begin
|
||||
AEjerciciosController := TEjerciciosController.Create;
|
||||
try
|
||||
Aux := AEjerciciosController.BuscarActivo(AIDEmpresa);
|
||||
if Assigned(Aux) then
|
||||
begin
|
||||
Aux.DataTable.Active := True;
|
||||
if not Aux.IsEmpty then
|
||||
FEjercicioActivo := Aux;
|
||||
end;
|
||||
finally
|
||||
AEjerciciosController := Nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TAppFactuGES.CambiarEmpresa(const AIDEmpresa: Integer);
|
||||
var
|
||||
@ -154,6 +178,9 @@ begin
|
||||
if not Aux.IsEmpty then
|
||||
FEmpresaActiva := Aux;
|
||||
end;
|
||||
|
||||
//Establece el ejercicio activo de la empresa activa
|
||||
CambiarEjercicio(AIDEmpresa);
|
||||
end;
|
||||
|
||||
procedure TAppFactuGES.CargarModulos;
|
||||
@ -232,6 +259,11 @@ begin
|
||||
Result := FAppInfo.ProductVersion;
|
||||
end;
|
||||
|
||||
function TAppFactuGES.GetEjercicioActivo: IBizEjercicio;
|
||||
begin
|
||||
Result := FEjercicioActivo;
|
||||
end;
|
||||
|
||||
function TAppFactuGES.GetEmpresaActiva: IBizEmpresa;
|
||||
begin
|
||||
Result := FEmpresaActiva;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user