diff --git a/RodaxSoftware.FactuGES.proj b/RodaxSoftware.FactuGES.proj index b04725cb..a34fd395 100644 --- a/RodaxSoftware.FactuGES.proj +++ b/RodaxSoftware.FactuGES.proj @@ -134,9 +134,9 @@ - - - + + + diff --git a/Source/ApplicationBase/Empresas/Model/schEmpresasClient_Intf.pas b/Source/ApplicationBase/Empresas/Model/schEmpresasClient_Intf.pas index f83bac57..c376b570 100644 --- a/Source/ApplicationBase/Empresas/Model/schEmpresasClient_Intf.pas +++ b/Source/ApplicationBase/Empresas/Model/schEmpresasClient_Intf.pas @@ -3,7 +3,7 @@ unit schEmpresasClient_Intf; interface uses - Classes, DB, SysUtils, uROClasses, uDAInterfaces, uDADataTable, FmtBCD, uROXMLIntf; + Classes, DB, schBase_Intf, SysUtils, uROClasses, uDAInterfaces, uDADataTable, FmtBCD, uROXMLIntf; const { Data table rules ids @@ -271,7 +271,7 @@ type end; { TEmpresasDataTableRules } - TEmpresasDataTableRules = class(TDADataTableRules, IEmpresas) + TEmpresasDataTableRules = class(TIntfObjectDADataTableRules, IEmpresas) private f_NOTAS: IROStrings; f_LOGOTIPO: IROStream; @@ -524,7 +524,7 @@ type end; { TEmpresasDatosBancoDataTableRules } - TEmpresasDatosBancoDataTableRules = class(TDADataTableRules, IEmpresasDatosBanco) + TEmpresasDatosBancoDataTableRules = class(TIntfObjectDADataTableRules, IEmpresasDatosBanco) private protected { Property getters and setters } diff --git a/Source/Base/Base.res b/Source/Base/Base.res index 1641339f..8b251f31 100644 Binary files a/Source/Base/Base.res and b/Source/Base/Base.res differ diff --git a/Source/Informes/1/InfAlbaranProveedor.fr3 b/Source/Informes/1/InfAlbaranProveedor.fr3 index 477cc57d..fdcc953c 100644 --- a/Source/Informes/1/InfAlbaranProveedor.fr3 +++ b/Source/Informes/1/InfAlbaranProveedor.fr3 @@ -1,5 +1,5 @@ - + @@ -24,8 +24,8 @@ - - + + diff --git a/Source/Informes/2/InfAlbaranProveedor.fr3 b/Source/Informes/2/InfAlbaranProveedor.fr3 index a243bcf3..392bca29 100644 --- a/Source/Informes/2/InfAlbaranProveedor.fr3 +++ b/Source/Informes/2/InfAlbaranProveedor.fr3 @@ -1,5 +1,5 @@ - + diff --git a/Source/Modulos/Albaranes de proveedor/Controller/View/uIEditorAlbaranesProveedorPreview.pas b/Source/Modulos/Albaranes de proveedor/Controller/View/uIEditorAlbaranesProveedorPreview.pas index 51586252..8dde31bd 100644 --- a/Source/Modulos/Albaranes de proveedor/Controller/View/uIEditorAlbaranesProveedorPreview.pas +++ b/Source/Modulos/Albaranes de proveedor/Controller/View/uIEditorAlbaranesProveedorPreview.pas @@ -8,6 +8,13 @@ uses type IEditorAlbaranesProveedorPreview = interface(IEditorPreview) ['{7299A2C7-2D2D-49C7-A23C-28DBA150D276}'] + procedure SetVerPrecios(const Value: Boolean); + function GetVerPrecios: Boolean; + property VerPrecios : Boolean read GetVerPrecios write SetVerPrecios; + + function GetVerRefProveedor: Boolean; + procedure SetVerRefProveedor(const Value: Boolean); + property VerRefProveedor : Boolean read GetVerRefProveedor write SetVerRefProveedor; end; diff --git a/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorController.pas b/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorController.pas index fb440720..69cd0418 100644 --- a/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorController.pas +++ b/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorController.pas @@ -59,8 +59,10 @@ type function EsModificable(AAlbaran: IBizAlbaranProveedor): Boolean; function EsEliminable(AAlbaran: IBizAlbaranProveedor): Boolean; - procedure Preview(AAlbaran : IBizAlbaranProveedor; AllItems: Boolean = false); - procedure Print(AAlbaran : IBizAlbaranProveedor; AllItems: Boolean = false); + procedure Preview(AAlbaran : IBizAlbaranProveedor; AllItems: Boolean = false; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True); + procedure Print(AAlbaran : IBizAlbaranProveedor; AllItems: Boolean = false; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True); function DarListaAnosAlbaranes: TStringList; procedure FiltrarAno(AAlbaran: IBizAlbaranProveedor; ADynWhereDataTable: WideString; const Ano: String); @@ -138,8 +140,10 @@ type function EsModificable(AAlbaran: IBizAlbaranProveedor): Boolean; function EsEliminable(AAlbaran: IBizAlbaranProveedor): Boolean; - procedure Preview(AAlbaran : IBizAlbaranProveedor; AllItems: Boolean = false); - procedure Print(AAlbaran : IBizAlbaranProveedor; AllItems: Boolean = false); + procedure Preview(AAlbaran : IBizAlbaranProveedor; AllItems: Boolean = false; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True); + procedure Print(AAlbaran : IBizAlbaranProveedor; AllItems: Boolean = false; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True); function DarListaAnosAlbaranes: TStringList; procedure FiltrarAno(AAlbaran: IBizAlbaranProveedor; ADynWhereDataTable: WideString; const Ano: String); @@ -1075,7 +1079,8 @@ begin Result := AAlbaran; end; -procedure TAlbaranesProveedorController.Preview(AAlbaran: IBizAlbaranProveedor; AllItems: Boolean = false); +procedure TAlbaranesProveedorController.Preview(AAlbaran: IBizAlbaranProveedor; AllItems: Boolean = false; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True); var AReportController : IAlbaranesProveedorReportController; ID_Albaranes: TIntegerList; @@ -1101,14 +1106,15 @@ begin else ID_Albaranes.Add(AAlbaran.ID); - AReportController.Preview(ID_Albaranes); + AReportController.Preview(ID_Albaranes, VerPrecios, VerRefProveedor); finally AReportController := NIL; FreeANDNIL(ID_Albaranes) end; end; -procedure TAlbaranesProveedorController.Print(AAlbaran: IBizAlbaranProveedor; AllItems: Boolean = false); +procedure TAlbaranesProveedorController.Print(AAlbaran: IBizAlbaranProveedor; AllItems: Boolean = false; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True); var AReportController : IAlbaranesProveedorReportController; ID_Albaranes: TIntegerList; @@ -1134,7 +1140,7 @@ begin else ID_Albaranes.Add(AAlbaran.ID); - AReportController.Print(ID_Albaranes); + AReportController.Print(ID_Albaranes, VerPrecios, VerRefProveedor); finally AReportController := NIL; FreeANDNIL(ID_Albaranes) diff --git a/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorReportController.pas b/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorReportController.pas index a59ffdd9..2b261a28 100644 --- a/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorReportController.pas +++ b/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorReportController.pas @@ -10,10 +10,14 @@ uses type IAlbaranesProveedorReportController = interface(IControllerBase) ['{11F9D087-C6BE-4401-AB13-4342025D62BB}'] - 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 VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True); + procedure Print(const AListaID : TIntegerList; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True); + function ExportToWord(const AID: Integer; const AFileName : String = ''; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True): Boolean; + function ExportToPDF(const AID: Integer; const AFileName : String = ''; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True): Boolean; end; TAlbaranesProveedorReportController = class(TControllerBase, IAlbaranesProveedorReportController) @@ -24,10 +28,14 @@ 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 VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True); + procedure Print(const AListaID : TIntegerList; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True); + function ExportToWord(const AID: Integer; const AFileName : String = ''; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True): Boolean; + function ExportToPDF(const AID: Integer; const AFileName : String = ''; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True): Boolean; end; @@ -59,8 +67,8 @@ begin inherited; end; -function TAlbaranesProveedorReportController.ExportToPDF(const AID: Integer; - const AFileName: String): Boolean; +function TAlbaranesProveedorReportController.ExportToPDF(const AID: Integer; const AFileName : String = ''; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True): Boolean; var AStream: Binary; begin @@ -70,7 +78,7 @@ begin ShowHourglassCursor; try - AStream := FDataModule.GetRptPDFAlbaran(AID); + AStream := FDataModule.GetRptPDFAlbaran(AID, VerPrecios, VerRefProveedor); try AStream.SaveToFile(AFileName); Result := True; @@ -82,8 +90,8 @@ begin end; end; -function TAlbaranesProveedorReportController.ExportToWord(const AID: Integer; - const AFileName: String): Boolean; +function TAlbaranesProveedorReportController.ExportToWord(const AID: Integer; const AFileName : String = ''; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True): Boolean; var AStream: Binary; AFile : String; @@ -96,7 +104,7 @@ begin ShowHourglassCursor; try - AStream := FDataModule.GetRptWordAlbaran(AID); + AStream := FDataModule.GetRptWordAlbaran(AID, VerPrecios, VerRefProveedor); try AStream.SaveToFile(AFile); Result := True; @@ -108,8 +116,8 @@ begin end; end; -procedure TAlbaranesProveedorReportController.Preview( - const AListaID: TIntegerList); +procedure TAlbaranesProveedorReportController.Preview(const AListaID: TIntegerList; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True); var AStream: Binary; AEditor : IEditorAlbaranesProveedorPreview; @@ -118,7 +126,7 @@ begin ShowHourglassCursor; try - AStream := FDataModule.GetReport(AListaID); + AStream := FDataModule.GetReport(AListaID, VerPrecios, VerRefProveedor); try CreateEditor('EditorAlbaranesProveedorPreview', IEditorAlbaranesProveedorPreview, AEditor); if Assigned(AEditor) then @@ -126,6 +134,8 @@ begin try AEditor.Controller := Self; AEditor.ListaID := AListaID; + AEditor.VerPrecios := VerPrecios; + AEditor.VerRefProveedor := VerRefProveedor; AEditor.Title := 'Albarán de proveedor - ' + AppFactuGES.EmpresaActiva.NOMBRE; AEditor.LoadFromStream(AStream); AEditor.Preview; @@ -142,8 +152,8 @@ begin end; end; -procedure TAlbaranesProveedorReportController.Print( - const AListaID: TIntegerList); +procedure TAlbaranesProveedorReportController.Print(const AListaID: TIntegerList; + const VerPrecios: Boolean = True; const VerRefProveedor: Boolean = True); var AStream: Binary; AEditor : IEditorAlbaranesProveedorPreview; @@ -152,7 +162,7 @@ begin ShowHourglassCursor; try - AStream := FDataModule.GetReport(AListaID); + AStream := FDataModule.GetReport(AListaID, VerPrecios, VerRefProveedor); try CreateEditor('EditorAlbaranesProveedorPreview', IEditorAlbaranesProveedorPreview, AEditor); if Assigned(AEditor) then @@ -160,7 +170,9 @@ begin try AEditor.Controller := Self; AEditor.ListaID := AListaID; - AEditor.Title := 'Albarán de proveedor - ' + AppFactuGES.EmpresaActiva.NOMBRE; + AEditor.VerPrecios := VerPrecios; + AEditor.VerRefProveedor := VerRefProveedor; + AEditor.Title := 'Albarán de proveedor - ' + AppFactuGES.EmpresaActiva.NOMBRE; AEditor.LoadFromStream(AStream); AEditor.Print; finally diff --git a/Source/Modulos/Albaranes de proveedor/Data/uDataModuleAlbaranesProveedor.dfm b/Source/Modulos/Albaranes de proveedor/Data/uDataModuleAlbaranesProveedor.dfm index d3dd7cde..cb67103c 100644 --- a/Source/Modulos/Albaranes de proveedor/Data/uDataModuleAlbaranesProveedor.dfm +++ b/Source/Modulos/Albaranes de proveedor/Data/uDataModuleAlbaranesProveedor.dfm @@ -14,12 +14,12 @@ inherited DataModuleAlbaranesProveedor: TDataModuleAlbaranesProveedor Top = 92 end object rda_AlbaranesProveedor: TDARemoteDataAdapter + DataStreamer = Bin2DataStreamer GetSchemaCall.RemoteService = RORemoteService GetDataCall.RemoteService = RORemoteService UpdateDataCall.RemoteService = RORemoteService GetScriptsCall.RemoteService = RORemoteService RemoteService = RORemoteService - DataStreamer = Bin2DataStreamer Left = 51 Top = 151 end @@ -300,8 +300,6 @@ inherited DataModuleAlbaranesProveedor: TDataModuleAlbaranesProveedor Params = <> StreamingOptions = [soDisableEventsWhileStreaming] RemoteDataAdapter = rda_AlbaranesProveedor - DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] - MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] LogicalName = 'AlbaranesProveedor' IndexDefs = <> Left = 168 @@ -426,8 +424,6 @@ inherited DataModuleAlbaranesProveedor: TDataModuleAlbaranesProveedor MasterSource = ds_AlbaranesProveedor MasterFields = 'ID' DetailFields = 'ID_ALBARAN' - DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] - MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] LogicalName = 'AlbaranesProveedor_Detalles' IndexDefs = <> Left = 328 @@ -450,8 +446,6 @@ inherited DataModuleAlbaranesProveedor: TDataModuleAlbaranesProveedor Params = <> StreamingOptions = [soDisableEventsWhileStreaming] RemoteDataAdapter = rda_AlbaranesProveedor - DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] - MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] LogicalName = 'ListaAnosAlbaranes' IndexDefs = <> Left = 168 diff --git a/Source/Modulos/Albaranes de proveedor/Data/uDataModuleAlbaranesProveedor.pas b/Source/Modulos/Albaranes de proveedor/Data/uDataModuleAlbaranesProveedor.pas index bf7cd7a8..63204fae 100644 --- a/Source/Modulos/Albaranes de proveedor/Data/uDataModuleAlbaranesProveedor.pas +++ b/Source/Modulos/Albaranes de proveedor/Data/uDataModuleAlbaranesProveedor.pas @@ -36,9 +36,12 @@ type function NewItem : IBizAlbaranProveedor; // Report - function GetReport(const ListaID: TIntegerList): Binary; - function GetRptWordAlbaran(const AID: Integer): Binary; - function GetRptPDFAlbaran(const AID: Integer): Binary; + function GetReport(const ListaID: TIntegerList; const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; + function GetRptWordAlbaran(const AID: Integer; const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; + function GetRptPDFAlbaran(const AID: Integer; const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; function GetAnosItems : TStringList; end; @@ -64,37 +67,43 @@ begin RORemoteService.Message := dmConexion.Message; end; -function TDataModuleAlbaranesProveedor.GetReport( - const ListaID: TIntegerList): Binary; +function TDataModuleAlbaranesProveedor.GetReport(const ListaID: TIntegerList; + const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; var AParam : TIntegerArray; begin AParam := ListaID.ToIntegerArray; try - Result := (RORemoteService as IsrvAlbaranesProveedor).GenerarInforme(AParam); + Result := (RORemoteService as IsrvAlbaranesProveedor).GenerarInforme(AParam, + ImprimirPrecio, ImprimirRefProveedor); finally FreeANDNil(AParam); end; end; -function TDataModuleAlbaranesProveedor.GetRptPDFAlbaran( - const AID: Integer): Binary; +function TDataModuleAlbaranesProveedor.GetRptPDFAlbaran(const AID: Integer; + const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; var AParam : TIntegerArray; begin AParam := TIntegerArray.Create; try AParam.Add(AID); - Result := (RORemoteService as IsrvAlbaranesProveedor).GenerarInformeEnPDF(AParam); + Result := (RORemoteService as IsrvAlbaranesProveedor).GenerarInformeEnPDF(AParam, + ImprimirPrecio, ImprimirRefProveedor); finally FreeANDNil(AParam); end; end; -function TDataModuleAlbaranesProveedor.GetRptWordAlbaran( - const AID: Integer): Binary; +function TDataModuleAlbaranesProveedor.GetRptWordAlbaran(const AID: Integer; + const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; begin - Result := (RORemoteService as IsrvAlbaranesProveedor).GenerarInformeEnWord(AID); + Result := (RORemoteService as IsrvAlbaranesProveedor).GenerarInformeEnWord(AID, + ImprimirPrecio, ImprimirRefProveedor); end; function TDataModuleAlbaranesProveedor.NewItem: IBizAlbaranProveedor; diff --git a/Source/Modulos/Albaranes de proveedor/Model/Data/uIDataModuleAlbaranesProveedorReport.pas b/Source/Modulos/Albaranes de proveedor/Model/Data/uIDataModuleAlbaranesProveedorReport.pas index 7bbf271a..1b49e693 100644 --- a/Source/Modulos/Albaranes de proveedor/Model/Data/uIDataModuleAlbaranesProveedorReport.pas +++ b/Source/Modulos/Albaranes de proveedor/Model/Data/uIDataModuleAlbaranesProveedorReport.pas @@ -8,9 +8,12 @@ uses type IDataModuleAlbaranesProveedorReport = interface ['{FC37B698-7FBF-4658-BBD0-CBD4F6891CDF}'] - function GetReport(const ListaID: TIntegerList): Binary; - function GetRptWordAlbaran(const AID: Integer): Binary; - function GetRptPDFAlbaran(const AID: Integer): Binary; + function GetReport(const ListaID: TIntegerList; const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; + function GetRptWordAlbaran(const AID: Integer; const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; + function GetRptPDFAlbaran(const AID: Integer; const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; end; implementation diff --git a/Source/Modulos/Albaranes de proveedor/Reports/uRptAlbaranesProveedor_Server.dfm b/Source/Modulos/Albaranes de proveedor/Reports/uRptAlbaranesProveedor_Server.dfm index 584f9592..cb645243 100644 --- a/Source/Modulos/Albaranes de proveedor/Reports/uRptAlbaranesProveedor_Server.dfm +++ b/Source/Modulos/Albaranes de proveedor/Reports/uRptAlbaranesProveedor_Server.dfm @@ -494,7 +494,7 @@ object RptAlbaranesProveedor: TRptAlbaranesProveedor Top = 16 end object frxReport: TfrxReport - Version = '4.3' + Version = '4.7.71' DotMatrixReport = False EngineOptions.DoublePass = True IniFile = '\Software\Fast Reports' @@ -582,6 +582,7 @@ object RptAlbaranesProveedor: TRptAlbaranesProveedor 'end.') ShowProgress = False StoreInDFM = False + OnGetValue = frxReportGetValue OnStartReport = 'frxReportOnStartReport' Left = 145 Top = 16 @@ -590,6 +591,7 @@ object RptAlbaranesProveedor: TRptAlbaranesProveedor UserName = 'frxDBCabecera' CloseDataSource = False DataSource = DADSCabecera + BCDToCurrency = False Left = 264 Top = 16 end @@ -597,6 +599,7 @@ object RptAlbaranesProveedor: TRptAlbaranesProveedor UserName = 'frxDBDetalles' CloseDataSource = False DataSource = DADSDetalles + BCDToCurrency = False Left = 344 Top = 16 end @@ -819,8 +822,6 @@ object RptAlbaranesProveedor: TRptAlbaranesProveedor RemoteFetchEnabled = False LocalSchema = schReport LocalDataStreamer = DABin2DataStreamer1 - DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] - MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] LogicalName = 'Informe_Cabecera' IndexDefs = <> Left = 264 @@ -889,8 +890,6 @@ object RptAlbaranesProveedor: TRptAlbaranesProveedor LocalSchema = schReport LocalDataStreamer = DABin2DataStreamer1 DetailFields = 'ID_ALBARAN' - DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] - MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] LogicalName = 'Informe_Detalles' IndexDefs = <> Left = 344 @@ -900,13 +899,21 @@ object RptAlbaranesProveedor: TRptAlbaranesProveedor ShowDialog = False UseFileCache = True ShowProgress = False + OverwritePrompt = False PrintOptimized = True Outline = False + Background = False + HTMLTags = True Author = 'FactuGES' Subject = 'FactuGES' - Background = False Creator = 'FactuGES' - HTMLTags = True + ProtectionFlags = [ePrint, eModify, eCopy, eAnnot] + HideToolbar = False + HideMenubar = False + HideWindowUI = False + FitWindow = False + CenterWindow = False + PrintScaling = False Left = 344 Top = 304 end diff --git a/Source/Modulos/Albaranes de proveedor/Reports/uRptAlbaranesProveedor_Server.pas b/Source/Modulos/Albaranes de proveedor/Reports/uRptAlbaranesProveedor_Server.pas index f1ad0548..19c00460 100644 --- a/Source/Modulos/Albaranes de proveedor/Reports/uRptAlbaranesProveedor_Server.pas +++ b/Source/Modulos/Albaranes de proveedor/Reports/uRptAlbaranesProveedor_Server.pas @@ -46,13 +46,20 @@ type schReport: TDASchema; procedure DataModuleCreate(Sender: TObject); procedure DataModuleDestroy(Sender: TObject); + procedure frxReportGetValue(const VarName: string; var Value: Variant); private FConnection: IDAConnection; + FImprimirPrecio : Boolean; + FImprimirRefProveedor : Boolean; //Genera cada uno de los albaranes a imprimir procedure _GenerarAlbaran(const AID: Integer); public - function GenerarAlbaran(const AListaID : TIntegerArray): Binary; - function GenerarAlbaranEnPDF(const ListaID : TIntegerArray): Binary; + function GenerarAlbaran(const AListaID : TIntegerArray; + const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; + function GenerarAlbaranEnPDF(const ListaID : TIntegerArray; + const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; end; implementation @@ -92,11 +99,24 @@ begin tbl_Detalles.Active := False; end; -function TRptAlbaranesProveedor.GenerarAlbaran(const AListaID : TIntegerArray): Binary; +procedure TRptAlbaranesProveedor.frxReportGetValue(const VarName: string; + var Value: Variant); +begin + if VarName = 'ImprimirPrecio' then + Value := FImprimirPrecio; + if VarName = 'ImprimirRefProveedor' then + Value := FImprimirRefProveedor; +end; + +function TRptAlbaranesProveedor.GenerarAlbaran(const AListaID : TIntegerArray; + const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; var i: Integer; begin Result := Binary.Create; + FImprimirPrecio := ImprimirPrecio; + FImprimirRefProveedor := ImprimirRefProveedor; try //Vamos generando todos y cada uno de los albaranes recibidos for i := 0 to AListaID.Count - 1 do @@ -106,12 +126,15 @@ begin end; end; -function TRptAlbaranesProveedor.GenerarAlbaranEnPDF( - const ListaID: TIntegerArray): Binary; +function TRptAlbaranesProveedor.GenerarAlbaranEnPDF(const ListaID: TIntegerArray; + const ImprimirPrecio: Boolean = True; + const ImprimirRefProveedor: Boolean = True): Binary; var i: Integer; begin Result := Binary.Create; + FImprimirPrecio := ImprimirPrecio; + FImprimirRefProveedor := ImprimirRefProveedor; try //Vamos generando todos y cada uno de los presupuestos recibidos for i := 0 to ListaID.Count - 1 do diff --git a/Source/Modulos/Albaranes de proveedor/Reports/uRptWordAlbaranProveedor.pas b/Source/Modulos/Albaranes de proveedor/Reports/uRptWordAlbaranProveedor.pas index f67f1488..c87fa388 100644 --- a/Source/Modulos/Albaranes de proveedor/Reports/uRptWordAlbaranProveedor.pas +++ b/Source/Modulos/Albaranes de proveedor/Reports/uRptWordAlbaranProveedor.pas @@ -29,6 +29,8 @@ type function RellenarDatosDetalle : Boolean; procedure _GenerarAlbaran(const AID: String); public + ImprimirPrecio : Boolean; + ImprimirRefProveedor : Boolean; function Exportar(Codigo, Fichero : String): Boolean; constructor Create (AOwner : TComponent); override; destructor Destroy; override; @@ -50,6 +52,8 @@ const constructor TRptWordAlbaranProveedor.Create(AOwner: TComponent); begin inherited; + ImprimirPrecio := False; + ImprimirRefProveedor := False; FDocumento := NIL; end; @@ -129,7 +133,8 @@ begin begin Rows.Item (iRowCount).Cells.Split (numRows, numCols, mergesplit); - Cell(iRowCount, 1).Range.Text := FieldByName('REFERENCIA_PROVEEDOR').AsString; + if ImprimirRefProveedor then + Cell(iRowCount, 1).Range.Text := FieldByName('REFERENCIA_PROVEEDOR').AsString; Cell(iRowCount, 2).Range.Text := FieldByName('REFERENCIA_FABRICANTE').AsString; Cell(iRowCount, 3).Range.Text := FieldByName('CONCEPTO').AsString; @@ -143,15 +148,18 @@ begin Cell(iRowCount, 4).Range.Text := AText + ' ' + FieldByName('UNIDAD_MEDIDA').AsString; - if (FieldByName('IMPORTE_UNIDAD').AsFloat = 0) then - Cell(iRowCount, 5).Range.Text := '' + if ImprimirPrecio + and (FieldByName('IMPORTE_UNIDAD').AsFloat <> 0) then + Cell(iRowCount, 5).Range.Text := FormatFloat(DISPLAY_EUROS2, FieldByName('IMPORTE_UNIDAD').AsFloat) else - Cell(iRowCount, 5).Range.Text := FormatFloat(DISPLAY_EUROS2, FieldByName('IMPORTE_UNIDAD').AsFloat); + Cell(iRowCount, 5).Range.Text := ''; - if (FieldByName('IMPORTE_TOTAL').AsFloat = 0) then - Cell(iRowCount, 6).Range.Text := '' + if ImprimirPrecio + and (FieldByName('IMPORTE_TOTAL').AsFloat <> 0) then + Cell(iRowCount, 6).Range.Text := FormatFloat(DISPLAY_EUROS2, FieldByName('IMPORTE_TOTAL').AsFloat) else - Cell(iRowCount, 6).Range.Text := FormatFloat(DISPLAY_EUROS2, FieldByName('IMPORTE_TOTAL').AsFloat); + Cell(iRowCount, 6).Range.Text := ''; + Next; Inc (iRowCount); end; @@ -232,7 +240,10 @@ begin ReplaceBookmark('PersonaContactoProveedor', FieldByName('PERSONA_CONTACTO').AsString); ReplaceBookmark('CodigoClienteProveedor', FieldByName('CODIGO_CLIENTE').AsString); - ReplaceBookmark('ImporteTotal', FormatFloat(DISPLAY_EUROS2, FieldByName('IMPORTE_TOTAL').AsFloat)); + if ImprimirPrecio then + ReplaceBookmark('ImporteTotal', FormatFloat(DISPLAY_EUROS2, FieldByName('IMPORTE_TOTAL').AsFloat)) + else + ReplaceBookmark('ImporteTotal', ''); ReplaceBookmark('NotasAlbaran', FieldByName('OBSERVACIONES').AsString); diff --git a/Source/Modulos/Albaranes de proveedor/Servidor/srvAlbaranesProveedor_Impl.pas b/Source/Modulos/Albaranes de proveedor/Servidor/srvAlbaranesProveedor_Impl.pas index 84bcd473..cc059ea6 100644 --- a/Source/Modulos/Albaranes de proveedor/Servidor/srvAlbaranesProveedor_Impl.pas +++ b/Source/Modulos/Albaranes de proveedor/Servidor/srvAlbaranesProveedor_Impl.pas @@ -32,9 +32,12 @@ type procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string); protected - function GenerarInforme(const ListaID: TIntegerArray): Binary; - function GenerarInformeEnWord(const ID: Integer): Binary; - function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary; + function GenerarInforme(const ListaID: TIntegerArray; + const ImprimirPrecio: Boolean; const ImprimirRefProveedor: Boolean): Binary; + function GenerarInformeEnWord(const ID: Integer; + const ImprimirPrecio: Boolean; const ImprimirRefProveedor: Boolean): Binary; + function GenerarInformeEnPDF(const ListaID: TIntegerArray; + const ImprimirPrecio: Boolean; const ImprimirRefProveedor: Boolean): Binary; end; @@ -81,33 +84,36 @@ begin ConnectionName := dmServer.ConnectionName; end; -function TsrvAlbaranesProveedor.GenerarInforme( - const ListaID: TIntegerArray): Binary; +function TsrvAlbaranesProveedor.GenerarInforme(const ListaID: TIntegerArray; + const ImprimirPrecio: Boolean; const ImprimirRefProveedor: Boolean): Binary; var AReportGenerator : TRptAlbaranesProveedor; begin AReportGenerator := TRptAlbaranesProveedor.Create(nil); try - Result := AReportGenerator.GenerarAlbaran(ListaID); + Result := AReportGenerator.GenerarAlbaran(ListaID, + ImprimirPrecio, ImprimirRefProveedor); finally FreeAndNIL(AReportGenerator); end; end; -function TsrvAlbaranesProveedor.GenerarInformeEnPDF( - const ListaID: TIntegerArray): Binary; +function TsrvAlbaranesProveedor.GenerarInformeEnPDF(const ListaID: TIntegerArray; + const ImprimirPrecio: Boolean; const ImprimirRefProveedor: Boolean): Binary; var AReportGenerator : TRptAlbaranesProveedor; begin AReportGenerator := TRptAlbaranesProveedor.Create(nil); try - Result := AReportGenerator.GenerarAlbaranEnPDF(ListaID); + Result := AReportGenerator.GenerarAlbaranEnPDF(ListaID, + ImprimirPrecio, ImprimirRefProveedor); finally FreeAndNIL(AReportGenerator); end; end; -function TsrvAlbaranesProveedor.GenerarInformeEnWord(const ID: Integer): Binary; +function TsrvAlbaranesProveedor.GenerarInformeEnWord(const ID: Integer; + const ImprimirPrecio: Boolean; const ImprimirRefProveedor: Boolean): Binary; var AReportGenerator : TRptWordAlbaranProveedor; AFicheroTMP : TFileName; @@ -116,6 +122,8 @@ begin AFicheroTMP := DarFicheroTemporal; AReportGenerator := TRptWordAlbaranProveedor.Create(nil); try + AReportGenerator.ImprimirPrecio := ImprimirPrecio; + AReportGenerator.ImprimirRefProveedor := ImprimirRefProveedor; if AReportGenerator.Exportar(IntToStr(ID), AFicheroTMP) then begin Result := Binary.Create; diff --git a/Source/Modulos/Albaranes de proveedor/Views/AlbaranesProveedor_view.dpk b/Source/Modulos/Albaranes de proveedor/Views/AlbaranesProveedor_view.dpk index 6b6abfdf..df0a0bcf 100644 --- a/Source/Modulos/Albaranes de proveedor/Views/AlbaranesProveedor_view.dpk +++ b/Source/Modulos/Albaranes de proveedor/Views/AlbaranesProveedor_view.dpk @@ -34,7 +34,9 @@ requires Almacenes_model, Almacenes_controller, AlbProv_FacProv_relation, - PedProv_AlbProv_relation; + PedProv_AlbProv_relation, + rtl, + vcl; contains uAlbaranesProveedorViewRegister in 'uAlbaranesProveedorViewRegister.pas', @@ -53,6 +55,7 @@ contains uEditorAlbaranDevProveedor in 'uEditorAlbaranDevProveedor.pas' {fEditorAlbaranDevProveedor: TCustomEditor}, uViewAlbaranesDevProveedor in 'uViewAlbaranesDevProveedor.pas' {frViewAlbaranesDevProveedor: TCustomView}, uEditorAlbaranesProveedorReport in 'uEditorAlbaranesProveedorReport.pas' {fEditorAlbaranesProveedorReport: TEditorAlbaranesProveedorReport}, - uViewDatosYSeleccionProveedorAlbaran in 'uViewDatosYSeleccionProveedorAlbaran.pas' {frViewDatosYSeleccionProveedorAlbaran: TCustomView}; + uViewDatosYSeleccionProveedorAlbaran in 'uViewDatosYSeleccionProveedorAlbaran.pas' {frViewDatosYSeleccionProveedorAlbaran: TCustomView}, + uDialogOpcionesImpresionAlbaranesProveedor in 'uDialogOpcionesImpresionAlbaranesProveedor.pas' {fDialogOpcionesImpresionAlbaranesProveedor: TfDialogOpcionesImpresionAlbaranesProveedor}; end. diff --git a/Source/Modulos/Albaranes de proveedor/Views/AlbaranesProveedor_view.dproj b/Source/Modulos/Albaranes de proveedor/Views/AlbaranesProveedor_view.dproj index 7c503ae1..7ba2c14a 100644 --- a/Source/Modulos/Albaranes de proveedor/Views/AlbaranesProveedor_view.dproj +++ b/Source/Modulos/Albaranes de proveedor/Views/AlbaranesProveedor_view.dproj @@ -59,7 +59,12 @@ + + +
fDialogOpcionesImpresionAlbaranesProveedor
+ TfEditorElegirAlbaranesProveedor +
fEditorAlbaranDevProveedor
TCustomEditor @@ -109,7 +114,7 @@ TFrame
-
fruViewDatosYSeleccionProveedorAlbaran
+
frViewDatosYSeleccionProveedorAlbaran
TCustomView
@@ -124,6 +129,7 @@
frViewElegirArticulosAlbaranesProveedor
TFrame
+