Subida segundo repaso de documentos asociados en presupuestos de cliente
git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@540 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
b7ef06ed1b
commit
4feb1db491
@ -1,7 +1,7 @@
|
||||
MAINICON ICON "C:\Codigo Tecsitel\Resources\Iconos\Factuges.ico"
|
||||
1 VERSIONINFO
|
||||
FILEVERSION 1,2,5,0
|
||||
PRODUCTVERSION 1,2,5,0
|
||||
FILEVERSION 1,2,6,0
|
||||
PRODUCTVERSION 1,2,6,0
|
||||
FILEFLAGSMASK 0x3FL
|
||||
FILEFLAGS 0x00L
|
||||
FILEOS 0x40004L
|
||||
@ -13,10 +13,10 @@ BEGIN
|
||||
BLOCK "0C0A04E4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Rodax Software S.L.\0"
|
||||
VALUE "FileVersion", "1.2.5.0\0"
|
||||
VALUE "FileVersion", "1.2.6.0\0"
|
||||
VALUE "InternalName", "FactuGES\0"
|
||||
VALUE "ProductName", "FactuGES\0"
|
||||
VALUE "ProductVersion", "1.2.5.0\0"
|
||||
VALUE "ProductVersion", "1.2.6.0\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
Binary file not shown.
@ -66,6 +66,7 @@ inherited frViewDocumentos: TfrViewDocumentos
|
||||
end
|
||||
object actActualizarServidor: TAction
|
||||
Caption = 'Actualizar Servidor'
|
||||
Visible = False
|
||||
OnExecute = actActualizarServidorExecute
|
||||
end
|
||||
end
|
||||
|
||||
@ -32,20 +32,27 @@ type
|
||||
procedure actModificarExecute(Sender: TObject);
|
||||
procedure actEliminarExecute(Sender: TObject);
|
||||
procedure actEliminarTodoExecute(Sender: TObject);
|
||||
procedure actActualizarServidorExecute(Sender: TObject);
|
||||
procedure CustomViewCreate(Sender: TObject);
|
||||
procedure CustomViewDestroy(Sender: TObject);
|
||||
procedure actActualizarServidorExecute(Sender: TObject);
|
||||
|
||||
private
|
||||
FDirectorio: Variant;
|
||||
function GetDirectorio: Variant;
|
||||
function DarFicherosSeleccionados: TStringList;
|
||||
|
||||
protected
|
||||
FListaDocumentos: TStringList;
|
||||
procedure Sincronizar; virtual; abstract;
|
||||
function RecuperarFicheroServidor(const NombreFichero: String; const DestinoFichero: String): Boolean; virtual; abstract;
|
||||
procedure Refrescar; virtual;
|
||||
public
|
||||
FListaFicheros: TStringList;
|
||||
property Directorio: Variant read GetDirectorio;
|
||||
|
||||
//Son los metodos que se sobreescribiran en la vista hija
|
||||
procedure Sincronizar; virtual; abstract;
|
||||
function RecuperarFicheroServidor(const NombreFichero: String; const DirectorioDestino: String): Boolean; virtual; abstract;
|
||||
procedure RefrescarVisualizador; virtual;
|
||||
|
||||
public
|
||||
property ListaFicheros: TStringList read FListaFicheros;
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
@ -66,7 +73,7 @@ end;
|
||||
procedure TfrViewDocumentos.actAnadirExecute(Sender: TObject);
|
||||
var
|
||||
openDialog : TOpenDialog;
|
||||
FicheroOrigen : String;
|
||||
ANombreFichero : String;
|
||||
i : Integer;
|
||||
begin
|
||||
openDialog := TOpenDialog.Create(self);
|
||||
@ -88,18 +95,20 @@ begin
|
||||
begin
|
||||
for i:=0 to openDialog.Files.Count - 1 do
|
||||
begin
|
||||
FicheroOrigen := openDialog.Files.Strings[i];
|
||||
if Length(FicheroOrigen) > 0 then
|
||||
CopiarFichero(FicheroOrigen, (Directorio + ExtractFileName(FicheroOrigen)));
|
||||
ANombreFichero := openDialog.Files.Strings[i];
|
||||
if Length(ANombreFichero) > 0 then
|
||||
CopiarFichero(ANombreFichero, (Directorio + ExtractFileName(ANombreFichero)));
|
||||
|
||||
//Lo añadimos a la lista de documentos local
|
||||
FListaDocumentos.Add(ExtractFileName(FicheroOrigen))
|
||||
FListaFicheros.Add(ExtractFileName(ANombreFichero))
|
||||
end;
|
||||
end;
|
||||
|
||||
finally
|
||||
openDialog.Free;
|
||||
Refrescar;
|
||||
//Now, We compact the process memory:
|
||||
SetProcessWorkingSetSize(GetCurrentProcess, $FFFFFFFF, $FFFFFFFF);
|
||||
RefrescarVisualizador;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -107,34 +116,35 @@ procedure TfrViewDocumentos.actEliminarExecute(Sender: TObject);
|
||||
var
|
||||
i, j: Integer;
|
||||
FicherosSeleccionados: TStringList;
|
||||
ANombreDocumento: String;
|
||||
ANombreFichero: String;
|
||||
|
||||
begin
|
||||
inherited;
|
||||
|
||||
FicherosSeleccionados := DarFicherosSeleccionados;
|
||||
for i := 0 to FicherosSeleccionados.Count - 1 do
|
||||
begin
|
||||
if FileExists(FicherosSeleccionados.Strings[i]) then
|
||||
if not DeleteFile(FicherosSeleccionados.Strings[i]) then
|
||||
Application.MessageBox('No se pudo borrar el fichero', 'Error', MB_ICONEXCLAMATION);
|
||||
try
|
||||
for i := 0 to FicherosSeleccionados.Count - 1 do
|
||||
begin
|
||||
//Buscamos si existen fisicamente y si es así los eliminamos
|
||||
if FileExists(FicherosSeleccionados.Strings[i]) then
|
||||
if not DeleteFile(FicherosSeleccionados.Strings[i]) then
|
||||
Application.MessageBox('No se pudo borrar el fichero', 'Error', MB_ICONEXCLAMATION);
|
||||
|
||||
ANombreDocumento := ExtractFileName(FicherosSeleccionados.Strings[i]);
|
||||
if FListaDocumentos.Find(ANombreDocumento, j) then
|
||||
FListaDocumentos.Delete(j);
|
||||
//Lo quitamos de la propiedad donde guardamos lista de documentos
|
||||
ANombreFichero := ExtractFileName(FicherosSeleccionados.Strings[i]);
|
||||
if FListaFicheros.Find(ANombreFichero, j) then
|
||||
FListaFicheros.Delete(j);
|
||||
end;
|
||||
finally
|
||||
FreeAndNil(FicherosSeleccionados);
|
||||
RefrescarVisualizador;
|
||||
end;
|
||||
Refrescar;
|
||||
end;
|
||||
|
||||
procedure TfrViewDocumentos.actEliminarTodoExecute(Sender: TObject);
|
||||
begin
|
||||
// if (ShowConfirmMessage('¿Desea borrar todos los documentos asociados a este presupuesto de cliente?', '') = IDYES) then
|
||||
// begin
|
||||
Deltree(Directorio, True);
|
||||
FListaDocumentos.Clear;
|
||||
FDirectorio := Null;
|
||||
// end;
|
||||
Refrescar;
|
||||
Deltree(Directorio, True);
|
||||
FListaFicheros.Clear;
|
||||
FDirectorio := Null;
|
||||
RefrescarVisualizador;
|
||||
end;
|
||||
|
||||
procedure TfrViewDocumentos.actModificarExecute(Sender: TObject);
|
||||
@ -142,40 +152,40 @@ var
|
||||
i: Integer;
|
||||
FicherosSeleccionados: TStringList;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
FicherosSeleccionados := DarFicherosSeleccionados;
|
||||
for i := 0 to FicherosSeleccionados.Count - 1 do
|
||||
if FileExists(FicherosSeleccionados.Strings[i]) then
|
||||
begin
|
||||
// showmessage('Existe: ' + FicherosSeleccionados.Strings[i]);
|
||||
if ShellExecute(Handle, nil, pchar(FicherosSeleccionados.Strings[i]),
|
||||
nil, nil, SW_SHOWNORMAL) <= 32 then
|
||||
Application.MessageBox('No se pudo editar el fichero', 'Error', MB_ICONEXCLAMATION);
|
||||
end
|
||||
else
|
||||
begin
|
||||
// showmessage('No existe: ' + FicherosSeleccionados.Strings[i]);
|
||||
if not RecuperarFicheroServidor(ExtractFileName(FicherosSeleccionados.Strings[i]), ExtractFilePath(FicherosSeleccionados.Strings[i])) then
|
||||
Application.MessageBox('No se pudo RecuperarFicheroServidor', 'Error', MB_ICONEXCLAMATION);
|
||||
try
|
||||
for i := 0 to FicherosSeleccionados.Count - 1 do
|
||||
if FileExists(FicherosSeleccionados.Strings[i]) then
|
||||
begin
|
||||
if ShellExecute(Handle, nil, pchar(FicherosSeleccionados.Strings[i]),
|
||||
nil, nil, SW_SHOWNORMAL) <= 32 then
|
||||
Application.MessageBox('No se pudo editar el fichero', 'Error', MB_ICONEXCLAMATION);
|
||||
end
|
||||
else
|
||||
begin
|
||||
if not RecuperarFicheroServidor(ExtractFileName(FicherosSeleccionados.Strings[i]), ExtractFilePath(FicherosSeleccionados.Strings[i])) then
|
||||
Application.MessageBox('No se pudo RecuperarFicheroServidor', 'Error', MB_ICONEXCLAMATION);
|
||||
|
||||
if ShellExecute(Handle, nil, pchar(FicherosSeleccionados.Strings[i]),
|
||||
nil, nil, SW_SHOWNORMAL) <= 32 then
|
||||
Application.MessageBox('No se pudo editar el fichero', 'Error', MB_ICONEXCLAMATION);
|
||||
end;
|
||||
if ShellExecute(Handle, nil, pchar(FicherosSeleccionados.Strings[i]),
|
||||
nil, nil, SW_SHOWNORMAL) <= 32 then
|
||||
Application.MessageBox('No se pudo editar el fichero', 'Error', MB_ICONEXCLAMATION);
|
||||
end;
|
||||
finally
|
||||
FreeAndNil(FicherosSeleccionados)
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrViewDocumentos.CustomViewCreate(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
FDirectorio := Null;
|
||||
FListaDocumentos := Nil;
|
||||
FListaFicheros := Nil;
|
||||
end;
|
||||
|
||||
procedure TfrViewDocumentos.CustomViewDestroy(Sender: TObject);
|
||||
begin
|
||||
FDirectorio := Null;
|
||||
FreeAndNil(FListaDocumentos);
|
||||
FreeAndNil(FListaFicheros);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
@ -202,18 +212,10 @@ begin
|
||||
Result := FDirectorio;
|
||||
end;
|
||||
|
||||
procedure TfrViewDocumentos.Refrescar;
|
||||
var
|
||||
ADocumentos: TStringList;
|
||||
i: Integer;
|
||||
procedure TfrViewDocumentos.RefrescarVisualizador;
|
||||
begin
|
||||
// ADocumentos := FindFile(Directorio + '*.*');
|
||||
// for i := 0 to ADocumentos.Count - 1 do
|
||||
// ADocumentos.Strings[i] := ExtractFileName(ADocumentos.Strings[i]);
|
||||
|
||||
ListaDocumentos.Clear;
|
||||
ListaDocumentos.Items.AddStrings(FListaDocumentos);
|
||||
// FreeAndNil(ADocumentos);
|
||||
ListaDocumentos.Items.AddStrings(FListaFicheros);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -13,4 +13,4 @@ BEGIN
|
||||
END
|
||||
|
||||
/* C:\Codigo Tecsitel\Source\Modulos\Gestion de documentos\Controller\GestorDocumentos_Controller.res */
|
||||
/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf146.tmp */
|
||||
/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf373.tmp */
|
||||
|
||||
@ -12,6 +12,7 @@ type
|
||||
function DescargarFichero(const ID:Integer; const NombreFichero: String; const DestinoFichero: String): Boolean;
|
||||
function SubirFichero(const ID:Integer; const NombreFichero: String; const Fichero: Binary): Boolean;
|
||||
procedure SincronizarDocumentos(const ID: Integer; FListaDocumentos: TStringList; Directorio: String);
|
||||
function EliminarDirectorio(const ID: Integer): Boolean;
|
||||
end;
|
||||
|
||||
TGestorDocumentosController = class(TControllerBase, IGestorDocumentosController)
|
||||
@ -30,6 +31,7 @@ type
|
||||
function DescargarFichero(const ID:Integer; const NombreFichero: String; const DestinoFichero: String): Boolean;
|
||||
function SubirFichero(const ID:Integer; const NombreFichero: String; const Fichero: Binary): Boolean;
|
||||
procedure SincronizarDocumentos(const ID: Integer; FListaDocumentos: TStringList; Directorio: String);
|
||||
function EliminarDirectorio(const ID: Integer): Boolean;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -66,6 +68,11 @@ begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TGestorDocumentosController.EliminarDirectorio(const ID: Integer): Boolean;
|
||||
begin
|
||||
Result := FDataModule.EliminarID(ID);
|
||||
end;
|
||||
|
||||
procedure TGestorDocumentosController.SincronizarDocumentos(const ID: Integer;
|
||||
FListaDocumentos: TStringList; Directorio: String);
|
||||
var
|
||||
|
||||
@ -14,4 +14,4 @@ END
|
||||
|
||||
/* C:\Codigo Tecsitel\Source\Modulos\Gestion de documentos\Data\uDataModuleGestorDocumentos.dfm */
|
||||
/* C:\Codigo Tecsitel\Source\Modulos\Gestion de documentos\Data\GestorDocumentos_data.res */
|
||||
/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf144.tmp */
|
||||
/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf371.tmp */
|
||||
|
||||
@ -13,6 +13,7 @@ type
|
||||
function DescargarFichero(const ID : Integer; const NombreFichero: String; const DestinoFichero: String): Boolean;
|
||||
function SubirFichero(const ID : Integer; const NombreFichero: String; const Fichero: Binary): Boolean;
|
||||
function EliminarFichero(const ID : Integer; const NombreFichero: String): Boolean;
|
||||
function EliminarID(const ID : Integer): Boolean;
|
||||
end;
|
||||
|
||||
TDataModuleGestorDocumentos = class(TDataModuleBase, IDataModuleGestorDocumentos)
|
||||
@ -28,7 +29,7 @@ type
|
||||
function DescargarFichero(const ID : Integer; const NombreFichero: String; const DestinoFichero: String): Boolean;
|
||||
function SubirFichero(const ID : Integer; const NombreFichero: String; const Fichero: Binary): Boolean;
|
||||
function EliminarFichero(const ID : Integer; const NombreFichero: String): Boolean;
|
||||
|
||||
function EliminarID(const ID : Integer): Boolean;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -91,6 +92,16 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDataModuleGestorDocumentos.EliminarID(const ID: Integer): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
try
|
||||
Result := (RORemoteService as IsrvGestorDocumentos).EliminarID(TRdxAlmacenes_Presupuestos, ID);
|
||||
finally
|
||||
//
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDataModuleGestorDocumentos.SubirFichero(const ID: Integer; const NombreFichero: String; const Fichero: Binary): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
@ -31,6 +31,7 @@ type
|
||||
function DescargarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Binary;
|
||||
function SubirFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String; const Fichero: Binary): Boolean;
|
||||
function EliminarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Boolean;
|
||||
function EliminarID(const Almacen: TRdxAlmacenes; const ID: Integer): Boolean;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -99,7 +100,7 @@ begin
|
||||
try
|
||||
GetClassFactory('srvConfiguracion').CreateInstance(AClientID, Intf);
|
||||
AConfiguracionService := Intf as IsrvConfiguracion;
|
||||
Result := AConfiguracionService.darValor('RUTA');
|
||||
Result := AConfiguracionService.darValor('RUTA_DOCUMENTOS');
|
||||
finally
|
||||
AConfiguracionService := Nil;
|
||||
end;
|
||||
@ -148,6 +149,28 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TsrvGestorDocumentos.EliminarID(const Almacen: TRdxAlmacenes; const ID: Integer): Boolean;
|
||||
var
|
||||
Ruta: String;
|
||||
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
try
|
||||
Ruta := DarRutaDocumentos;
|
||||
case Almacen of
|
||||
TRdxAlmacenes_Presupuestos:
|
||||
begin
|
||||
Ruta := Ruta + '\presupuestos\' + IntToStr(ID);
|
||||
Deltree(Ruta, True);
|
||||
Result := True;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
//
|
||||
end;
|
||||
end;
|
||||
|
||||
function TsrvGestorDocumentos.SubirFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String;
|
||||
const Fichero: Binary): Boolean;
|
||||
var
|
||||
@ -160,7 +183,11 @@ begin
|
||||
case Almacen of
|
||||
TRdxAlmacenes_Presupuestos:
|
||||
begin
|
||||
Ruta := Ruta + '\presupuestos\' + IntToStr(ID) + '\' + NombreFichero;
|
||||
Ruta := Ruta + '\presupuestos\' + IntToStr(ID);
|
||||
if not DirectoryExists(Ruta) then
|
||||
CreateDir(Ruta);
|
||||
|
||||
Ruta := Ruta + '\' + NombreFichero;
|
||||
Fichero.SaveToFile(Ruta);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
@ -20,6 +20,7 @@ type
|
||||
procedure SetDetallesController(const Value: IDetallesPresupuestoClienteController);
|
||||
property DetallesController: IDetallesPresupuestoClienteController read GetDetallesController write SetDetallesController;
|
||||
|
||||
//GESTION_DOCUMENTOS
|
||||
function GetGestorDocumentosController: IGestorDocumentosController;
|
||||
procedure SetGestorDocumentosController(const Value: IGestorDocumentosController);
|
||||
property GestorDocumentosController: IGestorDocumentosController read GetGestorDocumentosController write SetGestorDocumentosController;
|
||||
@ -58,13 +59,6 @@ type
|
||||
procedure EnviarPresupuestoPorEMail(APresupuesto : IBizPresupuestoCliente);
|
||||
function GenerarCertificados(APresupuesto : IBizPresupuestoCliente; AllItems: Boolean = false): Boolean;
|
||||
function CambiarSituacion(APresupuesto : IBizPresupuestoCliente; Situacion: String; FechaDecision: TDateTime; AllItems: Boolean = false): Boolean;
|
||||
|
||||
{
|
||||
function DarListaDocumentos(const ID: Integer): TStringList;
|
||||
function DescargarFichero(const ID:Integer; const NombreFichero: String; const DestinoFichero: String): Boolean;
|
||||
function SubirFichero(const ID:Integer; const NombreFichero: String; const Fichero: Binary): Boolean;
|
||||
procedure SincronizarDocumentos(const ID: Integer; FListaDocumentos: TStringList; Directorio: String);
|
||||
}
|
||||
end;
|
||||
|
||||
TPresupuestosClienteController = class(TControllerBase, IPresupuestosClienteController)
|
||||
@ -78,6 +72,8 @@ type
|
||||
procedure SetClienteController(const Value: IClientesController);
|
||||
function GetDetallesController: IDetallesPresupuestoClienteController;
|
||||
procedure SetDetallesController(const Value: IDetallesPresupuestoClienteController);
|
||||
|
||||
//GESTION_DOCUMENTOS
|
||||
function GetGestorDocumentosController: IGestorDocumentosController;
|
||||
procedure SetGestorDocumentosController(const Value: IGestorDocumentosController);
|
||||
|
||||
@ -133,13 +129,6 @@ type
|
||||
function GenerarCertificados(APresupuesto : IBizPresupuestoCliente; AllItems: Boolean = false): Boolean;
|
||||
procedure EnviarPresupuestoPorEMail(APresupuesto : IBizPresupuestoCliente);
|
||||
function CambiarSituacion(APresupuesto : IBizPresupuestoCliente; Situacion: String; FechaDecision: TDateTime; AllItems: Boolean = false): Boolean;
|
||||
|
||||
{
|
||||
function DarListaDocumentos(const ID: Integer): TStringList;
|
||||
function DescargarFichero(const ID:Integer; const NombreFichero: String; const DestinoFichero: String): Boolean;
|
||||
function SubirFichero(const ID:Integer; const NombreFichero: String; const Fichero: Binary): Boolean;
|
||||
procedure SincronizarDocumentos(const ID: Integer; FListaDocumentos: TStringList; Directorio: String);
|
||||
}
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -356,7 +345,10 @@ begin
|
||||
|
||||
FClienteController := TClientesController.Create;
|
||||
FDetallesController := TDetallesPresupuestoClienteController.Create;
|
||||
|
||||
//GESTION_DOCUMENTOS
|
||||
FGestorDocumentosController := TGestorDocumentosController.Create;
|
||||
|
||||
FDetallesController.addObservador(Self);
|
||||
end;
|
||||
|
||||
@ -399,6 +391,8 @@ begin
|
||||
FDataModule := Nil;
|
||||
FClienteController := Nil;
|
||||
FDetallesController := Nil;
|
||||
|
||||
//GESTION_DOCUMENTOS
|
||||
FGestorDocumentosController := Nil;
|
||||
inherited;
|
||||
end;
|
||||
@ -624,6 +618,9 @@ begin
|
||||
//Siempre eliminaremos el seleccionado
|
||||
if EsEliminable(APresupuesto) then
|
||||
begin
|
||||
//GESTION_DOCUMENTOS
|
||||
FGestorDocumentosController.EliminarDirectorio(APresupuesto.ID);
|
||||
|
||||
APresupuesto.Delete;
|
||||
bEliminado := True;
|
||||
end;
|
||||
@ -638,6 +635,9 @@ begin
|
||||
begin
|
||||
if EsEliminable(APresupuesto) then
|
||||
begin
|
||||
//GESTION_DOCUMENTOS
|
||||
FGestorDocumentosController.EliminarDirectorio(APresupuesto.ID);
|
||||
|
||||
APresupuesto.Delete;
|
||||
bEliminado := True
|
||||
end
|
||||
@ -867,8 +867,6 @@ begin
|
||||
|
||||
try
|
||||
APresupuesto.DataTable.ApplyUpdates;
|
||||
// ApplyUpdatesDocumentos;
|
||||
|
||||
Result := True;
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
|
||||
@ -199,108 +199,116 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
|
||||
ExplicitHeight = 386
|
||||
inherited ToolBar1: TToolBar
|
||||
Width = 735
|
||||
Height = 78
|
||||
Height = 46
|
||||
ExplicitWidth = 735
|
||||
ExplicitHeight = 78
|
||||
inherited ToolButton4: TToolButton [1]
|
||||
ExplicitHeight = 46
|
||||
inherited ToolButton4: TToolButton
|
||||
Left = 109
|
||||
Top = 0
|
||||
ExplicitLeft = 109
|
||||
ExplicitTop = 0
|
||||
end
|
||||
inherited ToolButton14: TToolButton [2]
|
||||
inherited FontName: TJvFontComboBox [2]
|
||||
Left = 165
|
||||
Top = 0
|
||||
ExplicitLeft = 165
|
||||
ExplicitTop = 0
|
||||
end
|
||||
inherited FontName: TJvFontComboBox [3]
|
||||
Left = 230
|
||||
inherited FontSize: TEdit [3]
|
||||
Left = 310
|
||||
Top = 0
|
||||
ExplicitLeft = 230
|
||||
Width = 200
|
||||
ExplicitLeft = 310
|
||||
ExplicitTop = 0
|
||||
ExplicitWidth = 200
|
||||
end
|
||||
inherited UpDown1: TUpDown [4]
|
||||
Left = 510
|
||||
Top = 0
|
||||
ExplicitLeft = 510
|
||||
ExplicitTop = 0
|
||||
end
|
||||
inherited FontSize: TEdit [4]
|
||||
Left = 375
|
||||
inherited ToolButton3: TToolButton [5]
|
||||
Left = 527
|
||||
Top = 0
|
||||
Width = 184
|
||||
ExplicitLeft = 375
|
||||
ExplicitTop = 0
|
||||
ExplicitWidth = 184
|
||||
end
|
||||
inherited UpDown1: TUpDown [5]
|
||||
Left = 559
|
||||
Top = 0
|
||||
ExplicitLeft = 559
|
||||
ExplicitTop = 0
|
||||
end
|
||||
inherited ToolButton13: TToolButton [6]
|
||||
Left = 0
|
||||
Wrap = True
|
||||
ExplicitLeft = 527
|
||||
ExplicitTop = 0
|
||||
end
|
||||
inherited ToolButton2: TToolButton [6]
|
||||
Top = 22
|
||||
Wrap = True
|
||||
end
|
||||
inherited ToolButton14: TToolButton
|
||||
Left = 0
|
||||
Top = 44
|
||||
ExplicitLeft = 0
|
||||
ExplicitHeight = 27
|
||||
ExplicitTop = 44
|
||||
end
|
||||
inherited ToolButton2: TToolButton [7]
|
||||
inherited ToolButton13: TToolButton [8]
|
||||
Left = 65
|
||||
Top = 44
|
||||
ExplicitLeft = 65
|
||||
ExplicitTop = 44
|
||||
end
|
||||
inherited ToolButton6: TToolButton [8]
|
||||
Left = 114
|
||||
Top = 27
|
||||
ExplicitLeft = 114
|
||||
ExplicitTop = 27
|
||||
inherited ToolButton6: TToolButton [9]
|
||||
Left = 73
|
||||
Top = 44
|
||||
ExplicitLeft = 73
|
||||
ExplicitTop = 44
|
||||
end
|
||||
inherited ToolButton7: TToolButton [9]
|
||||
Left = 180
|
||||
Top = 27
|
||||
ExplicitLeft = 180
|
||||
ExplicitTop = 27
|
||||
inherited ToolButton7: TToolButton [10]
|
||||
Left = 139
|
||||
Top = 44
|
||||
ExplicitLeft = 139
|
||||
ExplicitTop = 44
|
||||
end
|
||||
inherited ToolButton8: TToolButton [10]
|
||||
Left = 247
|
||||
Top = 27
|
||||
ExplicitLeft = 247
|
||||
ExplicitTop = 27
|
||||
inherited ToolButton8: TToolButton [11]
|
||||
Left = 206
|
||||
Top = 44
|
||||
ExplicitLeft = 206
|
||||
ExplicitTop = 44
|
||||
end
|
||||
inherited ToolButton12: TToolButton [11]
|
||||
Top = 27
|
||||
ExplicitTop = 27
|
||||
end
|
||||
inherited ToolButton3: TToolButton [12]
|
||||
Top = 54
|
||||
ExplicitTop = 54
|
||||
inherited ToolButton12: TToolButton [12]
|
||||
Left = 289
|
||||
Top = 44
|
||||
Wrap = False
|
||||
ExplicitLeft = 289
|
||||
ExplicitTop = 44
|
||||
ExplicitHeight = 22
|
||||
end
|
||||
inherited ToolButton9: TToolButton [13]
|
||||
Left = 55
|
||||
Top = 54
|
||||
Wrap = False
|
||||
ExplicitLeft = 55
|
||||
ExplicitTop = 54
|
||||
Left = 297
|
||||
Top = 44
|
||||
ExplicitLeft = 297
|
||||
ExplicitTop = 44
|
||||
end
|
||||
inherited ToolButton10: TToolButton [14]
|
||||
Left = 200
|
||||
Top = 54
|
||||
Left = 442
|
||||
Top = 44
|
||||
Wrap = False
|
||||
ExplicitLeft = 200
|
||||
ExplicitTop = 54
|
||||
ExplicitLeft = 442
|
||||
ExplicitTop = 44
|
||||
end
|
||||
inherited ToolButton11: TToolButton
|
||||
Left = 325
|
||||
Top = 54
|
||||
ExplicitLeft = 325
|
||||
ExplicitTop = 54
|
||||
Left = 567
|
||||
Top = 44
|
||||
ExplicitLeft = 567
|
||||
ExplicitTop = 44
|
||||
end
|
||||
end
|
||||
inherited cxGrid: TcxGrid
|
||||
Top = 104
|
||||
Top = 72
|
||||
Width = 735
|
||||
Height = 282
|
||||
ExplicitTop = 99
|
||||
Height = 314
|
||||
ExplicitTop = 72
|
||||
ExplicitWidth = 735
|
||||
ExplicitHeight = 287
|
||||
ExplicitHeight = 314
|
||||
end
|
||||
inherited TBXDock1: TTBXDock
|
||||
Top = 78
|
||||
Top = 46
|
||||
Width = 735
|
||||
ExplicitTop = 73
|
||||
ExplicitTop = 46
|
||||
ExplicitWidth = 735
|
||||
inherited TBXToolbar1: TTBXToolbar
|
||||
ExplicitWidth = 702
|
||||
|
||||
@ -57,6 +57,7 @@ type
|
||||
procedure pgPaginasChanging(Sender: TObject; var AllowChange: Boolean);
|
||||
procedure actEnviarPorEMailExecute(Sender: TObject);
|
||||
procedure actEnviarPorEMailUpdate(Sender: TObject);
|
||||
procedure actEliminarUpdate(Sender: TObject);
|
||||
private
|
||||
procedure RecalcularPortePorUnidad;
|
||||
|
||||
@ -108,6 +109,13 @@ uses
|
||||
{
|
||||
**************************** TfEditorPresupuestoCliente ****************************
|
||||
}
|
||||
procedure TfEditorPresupuestoCliente.actEliminarUpdate(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
if (Sender as TAction).Enabled then
|
||||
(Sender as TAction).Enabled := (FPresupuesto.SITUACION = SITUACION_PRESUPUESTO_PENDIENTE);
|
||||
end;
|
||||
|
||||
procedure TfEditorPresupuestoCliente.actEnviarPorEMailExecute(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
@ -161,6 +169,9 @@ procedure TfEditorPresupuestoCliente.CustomEditorClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
inherited;
|
||||
//GESTION_DOCUMENTOS
|
||||
//Este método eliminará el directorio temporal si se ha creado
|
||||
frViewDocumentosPresupuestoCliente1.actEliminarTodo.Execute;
|
||||
FViewPresupuesto := NIL;
|
||||
FPresupuesto := NIL;
|
||||
end;
|
||||
@ -233,10 +244,10 @@ begin
|
||||
frViewDetallesPresupuestoCliente1.BeginUpdate;
|
||||
try
|
||||
bEsNuevo := FPresupuesto.EsNuevo;
|
||||
FController.Guardar(FPresupuesto);
|
||||
//GESTION_DOCUMENTOS
|
||||
if FController.Guardar(FPresupuesto) then
|
||||
frViewDocumentosPresupuestoCliente1.actActualizarServidor.Execute;
|
||||
|
||||
//Obligamos a sincronizar documentos con servidor
|
||||
// frViewDocumentosPresupuestoCliente1.actActualizarServidor.Execute;
|
||||
finally
|
||||
frViewDetallesPresupuestoCliente1.EndUpdate;
|
||||
// frViewDetallesPresupuestoCliente1.RestoreGridStatus;
|
||||
@ -365,6 +376,8 @@ begin
|
||||
begin
|
||||
ViewPresupuesto.ViewClientePresupuesto.Controller := Controller.ClienteController;
|
||||
frViewDetallesPresupuestoCliente1.Controller := Controller.DetallesController;
|
||||
|
||||
//GESTION_DOCUMENTOS
|
||||
frViewDocumentosPresupuestoCliente1.Controller := Controller;
|
||||
end;
|
||||
end;
|
||||
@ -386,6 +399,8 @@ begin
|
||||
ViewPresupuesto.ViewClientePresupuesto.OnClienteChanged := OnClienteChanged;
|
||||
frViewDetallesPresupuestoCliente1.Detalles := FPresupuesto.Detalles;
|
||||
frViewDetallesPresupuestoCliente1.Presupuesto := FPresupuesto; //Para poder sacar los descuento del articulos segun el cliente seleccionado
|
||||
|
||||
//GESTION_DOCUMENTOS
|
||||
frViewDocumentosPresupuestoCliente1.Presupuesto := FPresupuesto;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -36,8 +36,7 @@ type
|
||||
|
||||
protected
|
||||
procedure Sincronizar; override;
|
||||
function RecuperarFicheroServidor(const NombreFichero: String; const DestinoFichero: String): Boolean; override;
|
||||
procedure Refrescar; override;
|
||||
function RecuperarFicheroServidor(const NombreFichero: String; const DirectorioDestino: String): Boolean; override;
|
||||
|
||||
public
|
||||
property Controller : IPresupuestosClienteController read GetController write SetController;
|
||||
@ -63,21 +62,10 @@ begin
|
||||
Result := FPresupuesto;
|
||||
end;
|
||||
|
||||
function TfrViewDocumentosPresupuestoCliente.RecuperarFicheroServidor(const NombreFichero: String; const DestinoFichero: String): Boolean;
|
||||
function TfrViewDocumentosPresupuestoCliente.RecuperarFicheroServidor(const NombreFichero: String; const DirectorioDestino: String): Boolean;
|
||||
begin
|
||||
inherited;
|
||||
Result := Controller.GestorDocumentosController.DescargarFichero(Presupuesto.ID, NombreFichero, DestinoFichero);
|
||||
end;
|
||||
|
||||
procedure TfrViewDocumentosPresupuestoCliente.Refrescar;
|
||||
var
|
||||
ADocumentos: TStringList;
|
||||
|
||||
begin
|
||||
inherited;
|
||||
// ADocumentos := Controller.DarListaDocumentos(Presupuesto.ID);
|
||||
// ListaDocumentos.Items.AddStrings(ADocumentos);
|
||||
// FreeAndNil(ADocumentos);
|
||||
Result := Controller.GestorDocumentosController.DescargarFichero(Presupuesto.ID, NombreFichero, DirectorioDestino);
|
||||
end;
|
||||
|
||||
procedure TfrViewDocumentosPresupuestoCliente.SetController(const Value: IPresupuestosClienteController);
|
||||
@ -90,14 +78,27 @@ begin
|
||||
FPresupuesto := Value;
|
||||
//Inicializamos la lista de documentos local con los ficheros del servidor
|
||||
if Assigned(FPresupuesto) and Assigned(FController) then
|
||||
FListaDocumentos := Controller.GestorDocumentosController.DarListaDocumentos(Presupuesto.ID);
|
||||
Refrescar;
|
||||
FListaFicheros := Controller.GestorDocumentosController.DarListaDocumentos(Presupuesto.ID);
|
||||
|
||||
RefrescarVisualizador;
|
||||
end;
|
||||
|
||||
procedure TfrViewDocumentosPresupuestoCliente.Sincronizar;
|
||||
begin
|
||||
inherited;
|
||||
Controller.GestorDocumentosController.SincronizarDocumentos(Presupuesto.ID, FListaDocumentos, Directorio);
|
||||
|
||||
//De momento el action actSincronizar con el servidor estará oculto y se activa, hay que tener en cuenta lo comentado
|
||||
{
|
||||
if Presupuesto.EsNuevo then
|
||||
begin
|
||||
if (ShowConfirmMessage('Se han producido cambios', 'Se han producido cambios y no se puede sincronizar hasta que no se guarden.' + #10#13 +
|
||||
'¿Desea guardarlos ahora?') = IDYES) then
|
||||
actGuardar.Execute
|
||||
else
|
||||
ShowInfoMessage('Recuerde guardar los cambios si quiere previsualizar o imprimir.');
|
||||
end;
|
||||
}
|
||||
Controller.GestorDocumentosController.SincronizarDocumentos(Presupuesto.ID, FListaFicheros, Directorio);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -509,6 +509,16 @@
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
<Operation Name="EliminarID" UID="{4E7F02BF-0422-415F-A5FB-D61BDCC45F03}">
|
||||
<Parameters>
|
||||
<Parameter Name="Result" DataType="Boolean" Flag="Result">
|
||||
</Parameter>
|
||||
<Parameter Name="Almacen" DataType="TRdxAlmacenes" Flag="In" >
|
||||
</Parameter>
|
||||
<Parameter Name="ID" DataType="Integer" Flag="In" >
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
</Operations>
|
||||
</Interface>
|
||||
</Interfaces>
|
||||
|
||||
@ -722,6 +722,7 @@ type
|
||||
function DescargarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Binary;
|
||||
function SubirFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String; const Fichero: Binary): Boolean;
|
||||
function EliminarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Boolean;
|
||||
function EliminarID(const Almacen: TRdxAlmacenes; const ID: Integer): Boolean;
|
||||
end;
|
||||
|
||||
{ CosrvGestorDocumentos }
|
||||
@ -738,6 +739,7 @@ type
|
||||
function DescargarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Binary;
|
||||
function SubirFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String; const Fichero: Binary): Boolean;
|
||||
function EliminarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Boolean;
|
||||
function EliminarID(const Almacen: TRdxAlmacenes; const ID: Integer): Boolean;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -2049,6 +2051,23 @@ begin
|
||||
end
|
||||
end;
|
||||
|
||||
function TsrvGestorDocumentos_Proxy.EliminarID(const Almacen: TRdxAlmacenes; const ID: Integer): Boolean;
|
||||
begin
|
||||
try
|
||||
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'EliminarID');
|
||||
__Message.Write('Almacen', TypeInfo(FactuGES_Intf.TRdxAlmacenes), Almacen, []);
|
||||
__Message.Write('ID', TypeInfo(Integer), ID, []);
|
||||
__Message.Finalize;
|
||||
|
||||
__TransportChannel.Dispatch(__Message);
|
||||
|
||||
__Message.Read('Result', TypeInfo(Boolean), result, []);
|
||||
finally
|
||||
__Message.UnsetAttributes(__TransportChannel);
|
||||
__Message.FreeStream;
|
||||
end
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterROClass(TRdxLoginInfo);
|
||||
RegisterROClass(TRdxEmpresasArray);
|
||||
|
||||
@ -218,6 +218,7 @@ type
|
||||
procedure Invoke_DescargarFichero(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_SubirFichero(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_EliminarFichero(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_EliminarID(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -1114,5 +1115,27 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TsrvGestorDocumentos_Invoker.Invoke_EliminarID(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
{ function EliminarID(const Almacen: TRdxAlmacenes; const ID: Integer): Boolean; }
|
||||
var
|
||||
Almacen: FactuGES_Intf.TRdxAlmacenes;
|
||||
ID: Integer;
|
||||
lResult: Boolean;
|
||||
begin
|
||||
try
|
||||
__Message.Read('Almacen', TypeInfo(FactuGES_Intf.TRdxAlmacenes), Almacen, []);
|
||||
__Message.Read('ID', TypeInfo(Integer), ID, []);
|
||||
|
||||
lResult := (__Instance as IsrvGestorDocumentos).EliminarID(Almacen, ID);
|
||||
|
||||
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvGestorDocumentos', 'EliminarIDResponse');
|
||||
__Message.Write('Result', TypeInfo(Boolean), lResult, []);
|
||||
__Message.Finalize;
|
||||
__Message.UnsetAttributes(__Transport);
|
||||
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
end.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
MAINICON ICON "C:\Codigo Tecsitel\Resources\Iconos\Servidor.ico"
|
||||
1 VERSIONINFO
|
||||
FILEVERSION 1,2,5,0
|
||||
PRODUCTVERSION 1,2,5,0
|
||||
FILEVERSION 1,2,4,0
|
||||
PRODUCTVERSION 1,2,4,0
|
||||
FILEFLAGSMASK 0x3FL
|
||||
FILEFLAGS 0x00L
|
||||
FILEOS 0x40004L
|
||||
@ -12,9 +12,9 @@ BEGIN
|
||||
BEGIN
|
||||
BLOCK "0C0A04E4"
|
||||
BEGIN
|
||||
VALUE "FileVersion", "1.2.5.0\0"
|
||||
VALUE "ProductVersion", "1.2.5.0\0"
|
||||
VALUE "CompileDate", "martes, 26 de agosto de 2008 12:42\0"
|
||||
VALUE "FileVersion", "1.2.4.0\0"
|
||||
VALUE "ProductVersion", "1.2.4.0\0"
|
||||
VALUE "CompileDate", "miércoles, 27 de agosto de 2008 18:08\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user