diff --git a/Source/Informes/1/InfFacturaCliente.fr3 b/Source/Informes/1/InfFacturaCliente.fr3 index 03e3697d..83409d71 100644 --- a/Source/Informes/1/InfFacturaCliente.fr3 +++ b/Source/Informes/1/InfFacturaCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -47,7 +47,7 @@ - + diff --git a/Source/Informes/2/InfFacturaCliente.fr3 b/Source/Informes/2/InfFacturaCliente.fr3 index 5e8cfdd0..5cb1c5c9 100644 --- a/Source/Informes/2/InfFacturaCliente.fr3 +++ b/Source/Informes/2/InfFacturaCliente.fr3 @@ -1,5 +1,5 @@ - + diff --git a/Source/Modulos/Albaranes de cliente/AlbaranesCliente_Group.groupproj b/Source/Modulos/Albaranes de cliente/AlbaranesCliente_Group.groupproj index cdafc97f..e19aa9f0 100644 --- a/Source/Modulos/Albaranes de cliente/AlbaranesCliente_Group.groupproj +++ b/Source/Modulos/Albaranes de cliente/AlbaranesCliente_Group.groupproj @@ -12,6 +12,7 @@ + @@ -171,14 +172,23 @@ + + + + + + + + + - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranCliente.dfm index 0a5e8b89..3fa685ae 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranCliente.dfm +++ b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranCliente.dfm @@ -14,7 +14,7 @@ inherited fEditorAlbaranCliente: TfEditorAlbaranCliente Caption = 'Nuevo albaran de cliente' ExplicitWidth = 765 inherited Image1: TImage - Left = 738 + Left = 632 Picture.Data = { 0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001800 0000180806000000E0773DF80000000970485973000017120000171201679FD2 @@ -124,6 +124,10 @@ inherited fEditorAlbaranCliente: TfEditorAlbaranCliente 0000000049454E44AE426082} ExplicitLeft = 735 end + inherited lblDesbloquear: TcxLabel + Left = 667 + ExplicitLeft = 667 + end end inherited TBXDock: TTBXDock Width = 765 @@ -234,49 +238,49 @@ inherited fEditorAlbaranCliente: TfEditorAlbaranCliente Wrap = True ExplicitLeft = 0 ExplicitTop = 0 - ExplicitHeight = 30 + ExplicitHeight = 27 end inherited ToolButton6: TToolButton Left = 0 - Top = 30 + Top = 27 ExplicitLeft = 0 - ExplicitTop = 30 + ExplicitTop = 27 end inherited ToolButton7: TToolButton Left = 66 - Top = 30 + Top = 27 ExplicitLeft = 66 - ExplicitTop = 30 + ExplicitTop = 27 end inherited ToolButton8: TToolButton Left = 133 - Top = 30 + Top = 27 ExplicitLeft = 133 - ExplicitTop = 30 + ExplicitTop = 27 end inherited ToolButton12: TToolButton Left = 216 - Top = 30 + Top = 27 ExplicitLeft = 216 - ExplicitTop = 30 + ExplicitTop = 27 end inherited ToolButton9: TToolButton Left = 224 - Top = 30 + Top = 27 ExplicitLeft = 224 - ExplicitTop = 30 + ExplicitTop = 27 end inherited ToolButton10: TToolButton Left = 369 - Top = 30 + Top = 27 ExplicitLeft = 369 - ExplicitTop = 30 + ExplicitTop = 27 end inherited ToolButton11: TToolButton Left = 494 - Top = 30 + Top = 27 ExplicitLeft = 494 - ExplicitTop = 30 + ExplicitTop = 27 end end inherited cxGrid: TcxGrid diff --git a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranCliente.pas b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranCliente.pas index 05770ac6..ab10f078 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranCliente.pas +++ b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranCliente.pas @@ -14,7 +14,7 @@ uses dxLayoutLookAndFeels, JvExComCtrls, JvStatusBar, uViewTotales, uIEditorAlbaranCliente, uBizAlbaranesCliente, uViewAlbaranCliente, uViewDetallesDTO, uViewDetallesArticulos, uDAInterfaces, - uViewDetallesArticulosParaVenta; + uViewDetallesArticulosParaVenta, cxLabel; type TfEditorAlbaranCliente = class(TfEditorDBItem, IEditorAlbaranCliente) diff --git a/Source/Modulos/Contactos/Controller/uClientesController.pas b/Source/Modulos/Contactos/Controller/uClientesController.pas index a50735b9..5aeab507 100644 --- a/Source/Modulos/Contactos/Controller/uClientesController.pas +++ b/Source/Modulos/Contactos/Controller/uClientesController.pas @@ -126,7 +126,7 @@ begin if IsPositiveResult(AEditor.ShowModal) then Result := AEditor.ContactosSeleccionados; finally - Release; + AEditor.Release; AEditor := NIL; Application.ProcessMessages; end; diff --git a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas index e9f59fa9..a6300d01 100644 --- a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas +++ b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas @@ -42,8 +42,10 @@ type function Duplicar(AFactura: IBizFacturaCliente): IBizFacturaCliente; function GenerarAbono(AFactura: IBizFacturaCliente): IBizFacturaCliente; - procedure Preview(AFactura : IBizFacturaCliente; AllItems: Boolean = false); - procedure Print(AFactura : IBizFacturaCliente; AllItems: Boolean = false); + procedure Preview(AFactura : IBizFacturaCliente; AllItems: Boolean = false; + const VerSello: Boolean = True); + procedure Print(AFactura : IBizFacturaCliente; AllItems: Boolean = false; + const VerSello: Boolean = True); procedure RecalcularImportes(AFactura: IBizFacturaCliente); function EsModificable(AFactura: IBizFacturaCliente): Boolean; @@ -105,8 +107,10 @@ type function GenerarAbono(AFactura: IBizFacturaCliente): IBizFacturaCliente; procedure RecuperarCliente(AFactura : IBizFacturaCliente); - procedure Preview(AFactura : IBizFacturaCliente; AllItems: Boolean = false); - procedure Print(AFactura : IBizFacturaCliente; AllItems: Boolean = false); + procedure Preview(AFactura : IBizFacturaCliente; AllItems: Boolean = false; + const VerSello: Boolean = True); + procedure Print(AFactura : IBizFacturaCliente; AllItems: Boolean = false; + const VerSello: Boolean = True); procedure RecalcularImportes(AFactura: IBizFacturaCliente); function EsModificable(AFactura: IBizFacturaCliente): Boolean; @@ -983,7 +987,8 @@ begin Result := AFactura; end; -procedure TFacturasClienteController.Preview(AFactura: IBizFacturaCliente; AllItems: Boolean = false); +procedure TFacturasClienteController.Preview(AFactura: IBizFacturaCliente; AllItems: Boolean = false; +const VerSello: Boolean = True); var AReportController : IFacturasClienteReportController; ID_Facturas: TIntegerList; @@ -1010,7 +1015,7 @@ begin else ID_Facturas.Add(AFactura.ID); - AReportController.Preview(ID_Facturas); + AReportController.Preview(ID_Facturas, VerSello); finally AReportController := NIL; @@ -1018,7 +1023,8 @@ begin end; end; -procedure TFacturasClienteController.Print(AFactura: IBizFacturaCliente; AllItems: Boolean = false); +procedure TFacturasClienteController.Print(AFactura: IBizFacturaCliente; AllItems: Boolean = false; +const VerSello: Boolean = True); var AReportController : IFacturasClienteReportController; ID_Facturas: TIntegerList; @@ -1045,7 +1051,7 @@ begin else ID_Facturas.Add(AFactura.ID); - AReportController.Print(ID_Facturas); + AReportController.Print(ID_Facturas, VerSello); finally AReportController := NIL; diff --git a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteReportController.pas b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteReportController.pas index 30b8523f..e4cd2c77 100644 --- a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteReportController.pas +++ b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteReportController.pas @@ -10,10 +10,10 @@ uses type IFacturasClienteReportController = interface(IControllerBase) ['{A0F41767-4FF6-4BAE-9FC9-894DD721D756}'] - procedure Preview(const AListaID : TIntegerList); - procedure Print(const AListaID : TIntegerList); - function ExportToWord(const AID: Integer; const AFileName : String = ''): Boolean; - function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean; + procedure Preview(const AListaID : TIntegerList; const VerSello: Boolean = True); + procedure Print(const AListaID : TIntegerList; const VerSello: Boolean = True); + function ExportToWord(const AID: Integer; const AFileName : String = ''; const VerSello: Boolean = True): Boolean; + function ExportToPDF(const AID: Integer; const AFileName : String = ''; const VerSello: Boolean = True): Boolean; end; TFacturasClienteReportController = class(TControllerBase, IFacturasClienteReportController) @@ -25,10 +25,10 @@ type constructor Create; override; destructor Destroy; override; - procedure Preview(const AListaID : TIntegerList); - procedure Print(const AListaID : TIntegerList); - function ExportToWord(const AID: Integer; const AFileName : String = ''): Boolean; - function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean; + procedure Preview(const AListaID : TIntegerList; const VerSello: Boolean = True); + procedure Print(const AListaID : TIntegerList; const VerSello: Boolean = True); + function ExportToWord(const AID: Integer; const AFileName : String = ''; const VerSello: Boolean = True): Boolean; + function ExportToPDF(const AID: Integer; const AFileName : String = ''; const VerSello: Boolean = True): Boolean; end; @@ -60,8 +60,7 @@ begin inherited; end; -function TFacturasClienteReportController.ExportToPDF(const AID: Integer; - const AFileName: String): Boolean; +function TFacturasClienteReportController.ExportToPDF(const AID: Integer; const AFileName: String = ''; const VerSello: Boolean = True): Boolean; var AStream: Binary; begin @@ -71,7 +70,7 @@ begin ShowHourglassCursor; try - AStream := FDataModule.GetRptPDFFactura(AID); + AStream := FDataModule.GetRptPDFFactura(AID, VerSello); try AStream.SaveToFile(AFileName); Result := True; @@ -84,20 +83,20 @@ begin end; function TFacturasClienteReportController.ExportToWord(const AID: Integer; - const AFileName: String): Boolean; + const AFileName: String = ''; const VerSello: Boolean = True): Boolean; var AStream: Binary; AFile : String; begin Result := False; AFile := AFileName; - + if EsCadenaVacia(AFile) and (not PreguntarFicheroWordExportar(AFile)) then Exit; ShowHourglassCursor; try - AStream := FDataModule.GetRptWordFactura(AID); + AStream := FDataModule.GetRptWordFactura(AID, VerSello); try AStream.SaveToFile(AFile); Result := True; @@ -109,14 +108,14 @@ begin end; end; -procedure TFacturasClienteReportController.Preview(const AListaID : TIntegerList); +procedure TFacturasClienteReportController.Preview(const AListaID : TIntegerList; const VerSello: Boolean = True); var AStream: Binary; AEditor : IEditorFacturasClientePreview; begin AEditor := NIL; - AStream := FDataModule.GetRptFacturas(AListaID); + AStream := FDataModule.GetRptFacturas(AListaID, VerSello); try CreateEditor('EditorFacturasClientePreview', IEditorFacturasClientePreview, AEditor); if Assigned(AEditor) then @@ -137,7 +136,7 @@ begin end; end; -procedure TFacturasClienteReportController.Print(const AListaID : TIntegerList); +procedure TFacturasClienteReportController.Print(const AListaID : TIntegerList; const VerSello: Boolean = True); var AStream: Binary; AEditor : IEditorFacturasClientePreview; @@ -145,7 +144,7 @@ begin AEditor := NIL; ShowHourglassCursor; try - AStream := FDataModule.GetRptFacturas(AListaID); + AStream := FDataModule.GetRptFacturas(AListaID, VerSello); try CreateEditor('EditorFacturasClientePreview', IEditorFacturasClientePreview, AEditor); if Assigned(AEditor) then diff --git a/Source/Modulos/Facturas de cliente/Data/uDataModuleFacturasCliente.pas b/Source/Modulos/Facturas de cliente/Data/uDataModuleFacturasCliente.pas index 45fa2b5a..ab91db15 100644 --- a/Source/Modulos/Facturas de cliente/Data/uDataModuleFacturasCliente.pas +++ b/Source/Modulos/Facturas de cliente/Data/uDataModuleFacturasCliente.pas @@ -30,9 +30,9 @@ type function NewItem : IBizFacturaCliente; // Report - function GetRptFacturas(const AListaID: TIntegerList): Binary; - function GetRptWordFactura(const AID: Integer): Binary; - function GetRptPDFFactura(const AID: Integer): Binary; + function GetRptFacturas(const AListaID: TIntegerList; const VerSello: Boolean = True): Binary; + function GetRptWordFactura(const AID: Integer; const VerSello: Boolean = True): Binary; + function GetRptPDFFactura(const AID: Integer; const VerSello: Boolean = True): Binary; end; implementation @@ -51,37 +51,34 @@ begin RORemoteService.Message := dmConexion.Message; end; -function TDataModuleFacturasCliente.GetRptFacturas( - const AListaID: TIntegerList): Binary; +function TDataModuleFacturasCliente.GetRptFacturas(const AListaID: TIntegerList; const VerSello: Boolean = True): Binary; var AParam : TIntegerArray; begin AParam := AListaID.ToIntegerArray; try - Result := (RORemoteService as IsrvFacturasCliente).GenerarInforme(AParam); + Result := (RORemoteService as IsrvFacturasCliente).GenerarInforme(AParam, VerSello); finally FreeANDNIL(AParam); end; end; -function TDataModuleFacturasCliente.GetRptPDFFactura( - const AID: Integer): Binary; +function TDataModuleFacturasCliente.GetRptPDFFactura(const AID: Integer; const VerSello: Boolean = True): Binary; var AParam : TIntegerArray; begin AParam := TIntegerArray.Create; try AParam.Add(AID); - Result := (RORemoteService as IsrvFacturasCliente).GenerarInformeEnPDF(AParam); + Result := (RORemoteService as IsrvFacturasCliente).GenerarInformeEnPDF(AParam, VerSello); finally FreeANDNIL(AParam); end; end; -function TDataModuleFacturasCliente.GetRptWordFactura( - const AID: Integer): Binary; +function TDataModuleFacturasCliente.GetRptWordFactura(const AID: Integer; const VerSello: Boolean = True): Binary; begin - Result := (RORemoteService as IsrvFacturasCliente).GenerarInformeEnWord(AID) + Result := (RORemoteService as IsrvFacturasCliente).GenerarInformeEnWord(AID, VerSello) end; function TDataModuleFacturasCliente.NewItem: IBizFacturaCliente; diff --git a/Source/Modulos/Facturas de cliente/Model/Data/uIDataModuleFacturasClienteReport.pas b/Source/Modulos/Facturas de cliente/Model/Data/uIDataModuleFacturasClienteReport.pas index cf5e8433..985ac945 100644 --- a/Source/Modulos/Facturas de cliente/Model/Data/uIDataModuleFacturasClienteReport.pas +++ b/Source/Modulos/Facturas de cliente/Model/Data/uIDataModuleFacturasClienteReport.pas @@ -8,9 +8,9 @@ uses type IDataModuleFacturasClienteReport = interface ['{D241A912-78C6-4C65-AEBF-8DDEFE35F511}'] - function GetRptFacturas(const AListaID: TIntegerList): Binary; - function GetRptWordFactura(const AID: Integer): Binary; - function GetRptPDFFactura(const AID: Integer): Binary; + function GetRptFacturas(const AListaID: TIntegerList; const VerSello: Boolean = True): Binary; + function GetRptWordFactura(const AID: Integer; const VerSello: Boolean = True): Binary; + function GetRptPDFFactura(const AID: Integer; const VerSello: Boolean = True): Binary; end; implementation diff --git a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas index 50a6a80b..31ac089e 100644 --- a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas +++ b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas @@ -88,11 +88,11 @@ type private FConnection: IDAConnection; //Genera cada una de las facturas a imprimir - procedure _GenerarFactura(const ID: Integer); + procedure _GenerarFactura(const ID: Integer; const VerSello: Boolean = True); function _GenerarInforme(const TipoInforme: String; const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const ImporteMinimo: Currency): Binary; public - function GenerarFactura(const ListaID : TIntegerArray): Binary; - function GenerarFacturaEnPDF(const ListaID : TIntegerArray): Binary; + function GenerarFactura(const ListaID : TIntegerArray; const VerSello: Boolean = True): Binary; + function GenerarFacturaEnPDF(const ListaID : TIntegerArray; const VerSello: Boolean = True): Binary; function GenerarInformeIVA(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturas(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasPendientes(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; @@ -134,7 +134,7 @@ begin frxDBVencimientos.DataSource := DADSVencimientos; end; -function TRptFacturasCliente.GenerarFactura(const ListaID: TIntegerArray): Binary; +function TRptFacturasCliente.GenerarFactura(const ListaID: TIntegerArray; const VerSello: Boolean = True): Binary; var i: Integer; begin @@ -142,15 +142,14 @@ begin try //Vamos generando todos y cada una de las facturas recibidas for i := 0 to ListaID.Count - 1 do - _GenerarFactura(ListaID.Items[i]); + _GenerarFactura(ListaID.Items[i], VerSello); frxReport.PreviewPages.SaveToStream(Result); finally end; end; -function TRptFacturasCliente.GenerarFacturaEnPDF( - const ListaID: TIntegerArray): Binary; +function TRptFacturasCliente.GenerarFacturaEnPDF(const ListaID: TIntegerArray; const VerSello: Boolean = True): Binary; var i: Integer; begin @@ -158,7 +157,7 @@ begin try //Vamos generando todos y cada una de las facturas recibidas for i := 0 to ListaID.Count - 1 do - _GenerarFactura(ListaID.Items[i]); + _GenerarFactura(ListaID.Items[i], VerSello); frxPDFExport1.Stream := Result; frxReport.Export(frxPDFExport1) @@ -231,7 +230,7 @@ begin Result := _GenerarInforme(ATipoInforme, IdEmpresa, FechaInicio, FechaFin, ListaIDClientes, ImporteMinimo); end; -procedure TRptFacturasCliente._GenerarFactura(const ID: Integer); +procedure TRptFacturasCliente._GenerarFactura(const ID: Integer; const VerSello: Boolean = True); begin FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO" try @@ -248,6 +247,10 @@ begin tbl_Vencimientos.Active := True; frxReport.LoadFromFile(DarRutaInformes + tbl_Cabecera.FieldByName('ID_EMPRESA').AsString + '\' + rptFacturaCliente, True); + if VerSello then + frxReport.Variables.Variables['VerSello'] := 1 + else + frxReport.Variables.Variables['VerSello'] := 0; frxReport.PrepareReport(False); finally FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO" diff --git a/Source/Modulos/Facturas de cliente/Reports/uRptWordFacturaCliente.pas b/Source/Modulos/Facturas de cliente/Reports/uRptWordFacturaCliente.pas index 8646f018..5323307c 100644 --- a/Source/Modulos/Facturas de cliente/Reports/uRptWordFacturaCliente.pas +++ b/Source/Modulos/Facturas de cliente/Reports/uRptWordFacturaCliente.pas @@ -33,7 +33,7 @@ type function RellenarInforme : boolean; virtual; procedure _GenerarFactura(const AID: String); public - function Exportar(Codigo, Fichero : String): Boolean; + function Exportar(Codigo, Fichero : String; const VerSello: Boolean = True): Boolean; constructor Create (AOwner : TComponent); override; destructor Destroy; override; end; @@ -81,7 +81,7 @@ begin inherited; end; -function TRptWordFacturaCliente.Exportar(Codigo, Fichero: String): Boolean; +function TRptWordFacturaCliente.Exportar(Codigo, Fichero: String; const VerSello: Boolean = True): Boolean; begin if EsCadenaVacia(Fichero) then begin diff --git a/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.pas b/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.pas index 13d31475..f9aebc3c 100644 --- a/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.pas +++ b/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.pas @@ -30,14 +30,13 @@ type procedure DARemoteServiceBeforeGetDatasetData(const Dataset: IDADataset; const IncludeSchema: Boolean; const MaxRecords: Integer); procedure DARemoteServiceCreate(Sender: TObject); - procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; - var aConnectionName: string); + procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string); private protected { IsrvFacturasCliente methods } - function GenerarInforme(const ListaID: TIntegerArray): Binary; - function GenerarInformeEnWord(const ID: Integer): Binary; - function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary; + function GenerarInforme(const ListaID: TIntegerArray; const VerSello: Boolean = True): Binary; + function GenerarInformeEnWord(const ID: Integer; const VerSello: Boolean = True): Binary; + function GenerarInformeEnPDF(const ListaID: TIntegerArray; const VerSello: Boolean = True): Binary; end; implementation @@ -84,32 +83,31 @@ begin ConnectionName := dmServer.ConnectionName; end; -function TsrvFacturasCliente.GenerarInformeEnPDF( - const ListaID: TIntegerArray): Binary; +function TsrvFacturasCliente.GenerarInformeEnPDF(const ListaID: TIntegerArray; const VerSello: Boolean = True): Binary; var AReportGenerator : TRptFacturasCliente; begin AReportGenerator := TRptFacturasCliente.Create(nil); try - Result := AReportGenerator.GenerarFacturaEnPDF(ListaID); + Result := AReportGenerator.GenerarFacturaEnPDF(ListaID, VerSello); finally FreeAndNIL(AReportGenerator); end; end; -function TsrvFacturasCliente.GenerarInforme(const ListaID: TIntegerArray): Binary; +function TsrvFacturasCliente.GenerarInforme(const ListaID: TIntegerArray; const VerSello: Boolean = True): Binary; var AReportGenerator : TRptFacturasCliente; begin AReportGenerator := TRptFacturasCliente.Create(nil); try - Result := AReportGenerator.GenerarFactura(ListaID); + Result := AReportGenerator.GenerarFactura(ListaID, VerSello); finally FreeAndNIL(AReportGenerator); end; end; -function TsrvFacturasCliente.GenerarInformeEnWord(const ID: Integer): Binary; +function TsrvFacturasCliente.GenerarInformeEnWord(const ID: Integer; const VerSello: Boolean = True): Binary; var AReportGenerator : TRptWordFacturaCliente; AFicheroTMP : TFileName; @@ -118,7 +116,7 @@ begin AFicheroTMP := DarFicheroTemporal; AReportGenerator := TRptWordFacturaCliente.Create(nil); try - if AReportGenerator.Exportar(IntToStr(ID), AFicheroTMP) then + if AReportGenerator.Exportar(IntToStr(ID), AFicheroTMP, VerSello) then begin Result := Binary.Create; Result.LoadFromFile(AFicheroTMP); diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm index 4990489a..216d466d 100644 --- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm +++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm @@ -120,10 +120,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente 798 316) inherited Label1: TLabel - Left = 351 - Width = 311 - ExplicitLeft = 351 - ExplicitWidth = 311 + Left = 604 + ExplicitLeft = 604 end inherited eReferencia: TcxDBTextEdit Style.LookAndFeel.SkinName = '' @@ -160,8 +158,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente Width = 111 end inherited bFormasPago: TButton - Left = 180 - ExplicitLeft = 180 + Left = 433 + ExplicitLeft = 433 end inherited cbCuentaBancaria: TcxDBComboBox Style.LookAndFeel.SkinName = '' @@ -172,57 +170,38 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente Width = 249 end inherited cbClienteFinal: TcxDBTextEdit - Left = 351 + Left = 604 Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 351 - ExplicitWidth = 339 - Width = 339 + ExplicitLeft = 604 end inherited bElegirClienteFinal: TButton Left = 725 ExplicitLeft = 725 end inherited frViewDatosYSeleccionClienteFacturaCliente1: TfrViewDatosYSeleccionClienteFacturaCliente - Left = 340 - Width = 505 - ExplicitLeft = 340 - ExplicitWidth = 505 + Left = 593 + ExplicitLeft = 593 inherited dxLayoutControl1: TdxLayoutControl - Width = 505 inherited edtlNombre: TcxDBTextEdit Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 224 - Width = 224 end inherited edtNIFCIF: TcxDBTextEdit - Left = 306 Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 306 - end - inherited Button3: TBitBtn - Left = 217 - ExplicitLeft = 217 end inherited edtDireccion: TcxTextEdit Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 121 - Width = 121 - end - inherited Button4: TButton - Left = 386 - ExplicitLeft = 386 end end end @@ -252,45 +231,39 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente ExplicitHeight = 316 inherited ToolBar1: TToolBar Width = 798 - Height = 46 + Height = 51 ExplicitWidth = 798 - ExplicitHeight = 46 + ExplicitHeight = 51 inherited ToolButton3: TToolButton Wrap = False end inherited ToolButton4: TToolButton Left = 278 Top = 0 - Wrap = True ExplicitLeft = 278 ExplicitTop = 0 end - inherited ToolButton14: TToolButton - Left = 0 - Wrap = False - ExplicitLeft = 0 - end inherited FontName: TJvFontComboBox - Left = 65 - Top = 22 - ExplicitLeft = 399 + Left = 334 + Top = 0 + ExplicitLeft = 334 ExplicitTop = 0 end - inherited FontSize: TEdit - Left = 544 + inherited FontSize: TEdit [5] + Left = 479 Top = 0 Width = 152 - ExplicitLeft = 544 + ExplicitLeft = 479 ExplicitTop = 0 ExplicitWidth = 152 end - inherited UpDown1: TUpDown - Left = 696 + inherited UpDown1: TUpDown [6] + Left = 631 Top = 0 - ExplicitLeft = 696 + ExplicitLeft = 631 ExplicitTop = 0 end - inherited ToolButton13: TToolButton + inherited ToolButton13: TToolButton [7] Left = 0 Top = 0 Wrap = True @@ -298,46 +271,54 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente ExplicitTop = 0 ExplicitHeight = 27 end - inherited ToolButton6: TToolButton + inherited ToolButton6: TToolButton [8] Left = 0 Top = 27 ExplicitLeft = 0 ExplicitTop = 27 end - inherited ToolButton7: TToolButton + inherited ToolButton7: TToolButton [9] Left = 66 Top = 27 + Wrap = False ExplicitLeft = 66 ExplicitTop = 27 end - inherited ToolButton8: TToolButton + inherited ToolButton14: TToolButton [10] Left = 133 Top = 27 ExplicitLeft = 133 + end + inherited ToolButton8: TToolButton [11] + Left = 198 + Top = 27 + ExplicitLeft = 198 ExplicitTop = 27 end - inherited ToolButton12: TToolButton - Left = 216 + inherited ToolButton12: TToolButton [12] + Left = 281 Top = 27 - ExplicitLeft = 216 + Wrap = False + ExplicitLeft = 281 + ExplicitTop = 27 + ExplicitHeight = 22 + end + inherited ToolButton9: TToolButton [13] + Left = 289 + Top = 27 + ExplicitLeft = 289 ExplicitTop = 27 end - inherited ToolButton9: TToolButton - Left = 224 + inherited ToolButton10: TToolButton [14] + Left = 434 Top = 27 - ExplicitLeft = 224 + ExplicitLeft = 434 ExplicitTop = 27 end - inherited ToolButton10: TToolButton - Left = 369 + inherited ToolButton11: TToolButton [15] + Left = 559 Top = 27 - ExplicitLeft = 369 - ExplicitTop = 27 - end - inherited ToolButton11: TToolButton - Left = 494 - Top = 27 - ExplicitLeft = 494 + ExplicitLeft = 559 ExplicitTop = 27 end end diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.pas b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.pas index 1e1ba9cf..0054d8c6 100644 --- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.pas +++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.pas @@ -309,7 +309,11 @@ end; procedure TfEditorFacturaCliente.ImprimirInterno; begin inherited; - FController.Print(FFactura); + //Preguntamos si desea que en las facturas se vea el Sello + if (Application.MessageBox('¿Desea previsualizar la factura con sello?', 'Atención', MB_YESNO) = IDYES) then + FController.Print(FFactura) + else + FController.Print(FFactura, False, False); end; procedure TfEditorFacturaCliente.OnClienteChanged(Sender: TObject); @@ -377,7 +381,11 @@ end; procedure TfEditorFacturaCliente.PrevisualizarInterno; begin inherited; - FController.Preview(FFactura); + //Preguntamos si desea que en las facturas se vea el Sello + if (Application.MessageBox('¿Desea previsualizar la factura con sello?', 'Atención', MB_YESNO) = IDYES) then + FController.Preview(FFactura) + else + FController.Preview(FFactura, False, False); end; procedure TfEditorFacturaCliente.RecalcularPortePorUnidad; diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas index 336f9e25..0d7f633c 100644 --- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas +++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas @@ -296,10 +296,11 @@ var Respuesta : Integer; AFacturas: IBizFacturaCliente; AllItems: Boolean; + AVerSello: Boolean; begin - AFacturas := Nil; AllItems := False; + AVerSello := False; if MultiSelect and Assigned(ViewGrid) then AllItems := (ViewGrid.NumSeleccionados > 1); @@ -325,8 +326,12 @@ begin else AFacturas := Facturas; + //Preguntamos si desea que en las facturas se vea el Sello + if (Application.MessageBox('¿Desea previsualizar la/s factura/s con sello?', 'Atención', MB_YESNO) = IDYES) then + AVerSello:= true; + if Assigned(AFacturas) then - FController.Print(AFacturas, AllItems); + FController.Print(AFacturas, AllItems, AVerSello); end; end; end; @@ -379,9 +384,11 @@ var Respuesta : Integer; AFacturas: IBizFacturaCliente; AllItems: Boolean; + AVerSello: Boolean; begin AFacturas := Nil; AllItems := False; + AVerSello := False; if MultiSelect and Assigned(ViewGrid) then AllItems := (ViewGrid.NumSeleccionados > 1); @@ -407,8 +414,12 @@ begin else AFacturas := Facturas; + //Preguntamos si desea que en las facturas se vea el Sello + if (Application.MessageBox('¿Desea previsualizar la/s factura/s con sello?', 'Atención', MB_YESNO) = IDYES) then + AVerSello:= true; + if Assigned(AFacturas) then - FController.Preview(AFacturas, AllItems); + FController.Preview(AFacturas, AllItems, AVerSello); end; end; end; diff --git a/Source/Servicios/FactuGES.RODL b/Source/Servicios/FactuGES.RODL index 87c5ea3f..c970f792 100644 --- a/Source/Servicios/FactuGES.RODL +++ b/Source/Servicios/FactuGES.RODL @@ -234,6 +234,8 @@ + + @@ -242,6 +244,8 @@ + + @@ -250,6 +254,8 @@ + + diff --git a/Source/Servicios/FactuGES_Intf.pas b/Source/Servicios/FactuGES_Intf.pas index ba185e19..5f82e7de 100644 --- a/Source/Servicios/FactuGES_Intf.pas +++ b/Source/Servicios/FactuGES_Intf.pas @@ -496,9 +496,9 @@ type { IsrvFacturasCliente } IsrvFacturasCliente = interface(IDataAbstractService) ['{56B4FFF0-AB1B-46B2-BA16-ABD5360F6311}'] - function GenerarInforme(const ListaID: TIntegerArray): Binary; - function GenerarInformeEnWord(const ID: Integer): Binary; - function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary; + function GenerarInforme(const ListaID: TIntegerArray; const VerSello: Boolean): Binary; + function GenerarInformeEnWord(const ID: Integer; const VerSello: Boolean): Binary; + function GenerarInformeEnPDF(const ListaID: TIntegerArray; const VerSello: Boolean): Binary; end; { CosrvFacturasCliente } @@ -511,9 +511,9 @@ type protected function __GetInterfaceName:string; override; - function GenerarInforme(const ListaID: TIntegerArray): Binary; - function GenerarInformeEnWord(const ID: Integer): Binary; - function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary; + function GenerarInforme(const ListaID: TIntegerArray; const VerSello: Boolean): Binary; + function GenerarInformeEnWord(const ID: Integer; const VerSello: Boolean): Binary; + function GenerarInformeEnPDF(const ListaID: TIntegerArray; const VerSello: Boolean): Binary; end; { IsrvFacturasProveedor } @@ -1617,12 +1617,13 @@ begin result := 'srvFacturasCliente'; end; -function TsrvFacturasCliente_Proxy.GenerarInforme(const ListaID: TIntegerArray): Binary; +function TsrvFacturasCliente_Proxy.GenerarInforme(const ListaID: TIntegerArray; const VerSello: Boolean): Binary; begin try result := nil; __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerarInforme'); __Message.Write('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []); + __Message.Write('VerSello', TypeInfo(Boolean), VerSello, []); __Message.Finalize; __TransportChannel.Dispatch(__Message); @@ -1634,12 +1635,13 @@ begin end end; -function TsrvFacturasCliente_Proxy.GenerarInformeEnWord(const ID: Integer): Binary; +function TsrvFacturasCliente_Proxy.GenerarInformeEnWord(const ID: Integer; const VerSello: Boolean): Binary; begin try result := nil; __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerarInformeEnWord'); __Message.Write('ID', TypeInfo(Integer), ID, []); + __Message.Write('VerSello', TypeInfo(Boolean), VerSello, []); __Message.Finalize; __TransportChannel.Dispatch(__Message); @@ -1651,12 +1653,13 @@ begin end end; -function TsrvFacturasCliente_Proxy.GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary; +function TsrvFacturasCliente_Proxy.GenerarInformeEnPDF(const ListaID: TIntegerArray; const VerSello: Boolean): Binary; begin try result := nil; __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerarInformeEnPDF'); __Message.Write('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []); + __Message.Write('VerSello', TypeInfo(Boolean), VerSello, []); __Message.Finalize; __TransportChannel.Dispatch(__Message); diff --git a/Source/Servicios/FactuGES_Invk.pas b/Source/Servicios/FactuGES_Invk.pas index fe860902..89ba32e6 100644 --- a/Source/Servicios/FactuGES_Invk.pas +++ b/Source/Servicios/FactuGES_Invk.pas @@ -527,9 +527,10 @@ end; { TsrvFacturasCliente_Invoker } procedure TsrvFacturasCliente_Invoker.Invoke_GenerarInforme(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); -{ function GenerarInforme(const ListaID: TIntegerArray): Binary; } +{ function GenerarInforme(const ListaID: TIntegerArray; const VerSello: Boolean): Binary; } var ListaID: FactuGES_Intf.TIntegerArray; + VerSello: Boolean; lResult: Binary; __lObjectDisposer: TROObjectDisposer; begin @@ -537,8 +538,9 @@ begin lResult := nil; try __Message.Read('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []); + __Message.Read('VerSello', TypeInfo(Boolean), VerSello, []); - lResult := (__Instance as IsrvFacturasCliente).GenerarInforme(ListaID); + lResult := (__Instance as IsrvFacturasCliente).GenerarInforme(ListaID, VerSello); __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvFacturasCliente', 'GenerarInformeResponse'); __Message.Write('Result', TypeInfo(Binary), lResult, []); @@ -557,17 +559,19 @@ begin end; procedure TsrvFacturasCliente_Invoker.Invoke_GenerarInformeEnWord(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); -{ function GenerarInformeEnWord(const ID: Integer): Binary; } +{ function GenerarInformeEnWord(const ID: Integer; const VerSello: Boolean): Binary; } var ID: Integer; + VerSello: Boolean; lResult: Binary; __lObjectDisposer: TROObjectDisposer; begin lResult := nil; try __Message.Read('ID', TypeInfo(Integer), ID, []); + __Message.Read('VerSello', TypeInfo(Boolean), VerSello, []); - lResult := (__Instance as IsrvFacturasCliente).GenerarInformeEnWord(ID); + lResult := (__Instance as IsrvFacturasCliente).GenerarInformeEnWord(ID, VerSello); __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvFacturasCliente', 'GenerarInformeEnWordResponse'); __Message.Write('Result', TypeInfo(Binary), lResult, []); @@ -585,9 +589,10 @@ begin end; procedure TsrvFacturasCliente_Invoker.Invoke_GenerarInformeEnPDF(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); -{ function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary; } +{ function GenerarInformeEnPDF(const ListaID: TIntegerArray; const VerSello: Boolean): Binary; } var ListaID: FactuGES_Intf.TIntegerArray; + VerSello: Boolean; lResult: Binary; __lObjectDisposer: TROObjectDisposer; begin @@ -595,8 +600,9 @@ begin lResult := nil; try __Message.Read('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []); + __Message.Read('VerSello', TypeInfo(Boolean), VerSello, []); - lResult := (__Instance as IsrvFacturasCliente).GenerarInformeEnPDF(ListaID); + lResult := (__Instance as IsrvFacturasCliente).GenerarInformeEnPDF(ListaID, VerSello); __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvFacturasCliente', 'GenerarInformeEnPDFResponse'); __Message.Write('Result', TypeInfo(Binary), lResult, []); diff --git a/Source/Servicios/RODLFILE.res b/Source/Servicios/RODLFILE.res index b8c2ca8b..af6afac3 100644 Binary files a/Source/Servicios/RODLFILE.res and b/Source/Servicios/RODLFILE.res differ