diff --git a/Build/Build.fbl6 b/Build/Build.fbl6 index f13133b..3df9276 100644 Binary files a/Build/Build.fbl6 and b/Build/Build.fbl6 differ diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj index 6f57818..c473227 100644 --- a/Source/Base/Base.dproj +++ b/Source/Base/Base.dproj @@ -65,55 +65,55 @@ MainSource + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fConfigurarConexion
TForm diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index 9041542..6c09dfa 100644 --- a/Source/Cliente/FactuGES.dproj +++ b/Source/Cliente/FactuGES.dproj @@ -51,7 +51,7 @@ Delphi.Personality VCLApplication -FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse3020FalseFalseFalseFalseFalse30821252Rodax Software S.L.3.0.2.0FactuGESFactuGES3.0.2.0 +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse3050FalseFalseFalseFalseFalse30821252Rodax Software S.L.3.0.5.0FactuGESFactuGES3.0.5.0 File C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPScxScheduler2LnkD11.bpl not found FactuGES.dprFalse diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index bc652b0..961d4bc 100644 Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ diff --git a/Source/Cliente/uPantallaPrincipal.dfm b/Source/Cliente/uPantallaPrincipal.dfm index c6248ed..e7c9fb2 100644 --- a/Source/Cliente/uPantallaPrincipal.dfm +++ b/Source/Cliente/uPantallaPrincipal.dfm @@ -274,7 +274,7 @@ object fPantallaPrincipal: TfPantallaPrincipal Category = 'Menus' Caption = 'Log'#237'stica' OnExecute = actMenuLogisticaExecute - OnUpdate = actMenuComprasUpdate + OnUpdate = actMenuLogisticaUpdate end object actMenuVentas: TAction Category = 'Menus' diff --git a/Source/Cliente/uPantallaPrincipal.pas b/Source/Cliente/uPantallaPrincipal.pas index e417df5..78fb4bb 100644 --- a/Source/Cliente/uPantallaPrincipal.pas +++ b/Source/Cliente/uPantallaPrincipal.pas @@ -124,6 +124,7 @@ type procedure actMenuInformesExecute(Sender: TObject); procedure Listadeempresas1_OLDClick(Sender: TObject); procedure actInformacionEmpresaExecute(Sender: TObject); + procedure actMenuLogisticaUpdate(Sender: TObject); private FContenido : TCustomEditor; procedure ShowEmbedded(AEditor : ICustomEditor); @@ -418,6 +419,12 @@ begin // end; +procedure TfPantallaPrincipal.actMenuLogisticaUpdate(Sender: TObject); +begin + (Sender as TAction).Enabled := AppFactuGES.EmpresaActiva.ID = 1; + (Sender as TAction).Visible := AppFactuGES.EmpresaActiva.ID = 1; +end; + procedure TfPantallaPrincipal.ExecuteActionMenu(Sender: TObject); var i : integer; diff --git a/Source/GUIBase/GUIBase.dproj b/Source/GUIBase/GUIBase.dproj index e1b15b8..87df91c 100644 --- a/Source/GUIBase/GUIBase.dproj +++ b/Source/GUIBase/GUIBase.dproj @@ -58,34 +58,34 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fDialogBase
diff --git a/Source/Informes/1/InfAlbaranCliente.fr3 b/Source/Informes/1/InfAlbaranCliente.fr3 index 11cbe91..41888b3 100644 --- a/Source/Informes/1/InfAlbaranCliente.fr3 +++ b/Source/Informes/1/InfAlbaranCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/Source/Informes/1/InfAlbaranProveedor.fr3 b/Source/Informes/1/InfAlbaranProveedor.fr3 index 78c8f9e..e0edf9b 100644 --- a/Source/Informes/1/InfAlbaranProveedor.fr3 +++ b/Source/Informes/1/InfAlbaranProveedor.fr3 @@ -1,5 +1,5 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/Source/Informes/1/InfContratoCliente.fr3 b/Source/Informes/1/InfContratoCliente.fr3 index 143c502..b98bb39 100644 --- a/Source/Informes/1/InfContratoCliente.fr3 +++ b/Source/Informes/1/InfContratoCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -73,7 +73,7 @@ - + diff --git a/Source/Informes/1/InfFacturaCliente.fr3 b/Source/Informes/1/InfFacturaCliente.fr3 index d8a6e00..cb3af90 100644 --- a/Source/Informes/1/InfFacturaCliente.fr3 +++ b/Source/Informes/1/InfFacturaCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -48,7 +48,7 @@ - + @@ -57,7 +57,7 @@ - + diff --git a/Source/Informes/1/InfPedidoProveedor.fr3 b/Source/Informes/1/InfPedidoProveedor.fr3 index f0adf54..3490c14 100644 --- a/Source/Informes/1/InfPedidoProveedor.fr3 +++ b/Source/Informes/1/InfPedidoProveedor.fr3 @@ -1,5 +1,5 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/Source/Informes/1/InfPresupuestoCliente.fr3 b/Source/Informes/1/InfPresupuestoCliente.fr3 index 56335e7..dce5c2a 100644 --- a/Source/Informes/1/InfPresupuestoCliente.fr3 +++ b/Source/Informes/1/InfPresupuestoCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -66,7 +66,7 @@ - + diff --git a/Source/Informes/InfEtiquetasAlbaranCliente.fr3 b/Source/Informes/InfEtiquetasAlbaranCliente.fr3 index 2d94b93..b19cddc 100644 --- a/Source/Informes/InfEtiquetasAlbaranCliente.fr3 +++ b/Source/Informes/InfEtiquetasAlbaranCliente.fr3 @@ -1,18 +1,23 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/Source/Informes/InfEtiquetasContratoCliente.fr3 b/Source/Informes/InfEtiquetasContratoCliente.fr3 new file mode 100644 index 0000000..51c06a1 --- /dev/null +++ b/Source/Informes/InfEtiquetasContratoCliente.fr3 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Modulos/Contratos de cliente/ContratosCliente_Group.groupproj b/Source/Modulos/Contratos de cliente/ContratosCliente_Group.groupproj index 47cfcd0..0c36138 100644 --- a/Source/Modulos/Contratos de cliente/ContratosCliente_Group.groupproj +++ b/Source/Modulos/Contratos de cliente/ContratosCliente_Group.groupproj @@ -9,6 +9,7 @@ + @@ -26,6 +27,7 @@ + @@ -204,6 +206,15 @@ + + + + + + + + + @@ -240,15 +251,6 @@ - - - - - - - - - @@ -321,14 +323,32 @@ + + + + + + + + + + + + + + + + + + - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas index 288218e..6cff961 100644 --- a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas +++ b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas @@ -65,6 +65,9 @@ type procedure EnviarContratoPorEMail(AContrato : IBizContratoCliente); function CambiarSituacion(AContrato : IBizContratoCliente; Situacion: String; FechaDecision: TDateTime; AllItems: Boolean = false): Boolean; + procedure EtiquetasPreview(AContrato : IBizContratoCliente; Const AAgencia: String; const AReferencia: String; const ANumEtiquetas: Integer; const AEtiquetaIni: Integer); + procedure EtiquetasPrint(AContrato : IBizContratoCliente; Const AAgencia: String; const AReferencia: String; const ANumEtiquetas: Integer; const AEtiquetaIni: Integer); + function DarListaAnosContratos: TStringList; procedure FiltrarAno(AContrato: IBizContratoCliente; ADynWhereDataTable: WideString; const Ano: String); procedure VerListadoBeneficios; @@ -144,6 +147,9 @@ type procedure EnviarContratoPorEMail(AContrato : IBizContratoCliente); function CambiarSituacion(AContrato : IBizContratoCliente; Situacion: String; FechaDecision: TDateTime; AllItems: Boolean = false): Boolean; + procedure EtiquetasPreview(AContrato : IBizContratoCliente; Const AAgencia: String; const AReferencia: String; const ANumEtiquetas: Integer; const AEtiquetaIni: Integer); + procedure EtiquetasPrint(AContrato : IBizContratoCliente; Const AAgencia: String; const AReferencia: String; const ANumEtiquetas: Integer; const AEtiquetaIni: Integer); + function DarListaAnosContratos: TStringList; procedure FiltrarAno(AContrato: IBizContratoCliente; ADynWhereDataTable: WideString; const Ano: String); procedure VerListadoBeneficios; @@ -384,8 +390,8 @@ begin with AContratoActual.Detalles do begin ACadena := ''; - ACadena := 'Presupuesto ' + AListaPresupuestos.REFERENCIA + ' con fecha ' + DateToStr(AListaPresupuestos.FECHA_PRESUPUESTO) +' aceptado el ' + DateToStr(AListaPresupuestos.FECHA_DECISION); - ACadena := ACadena + #13 + ' referencia: ' + AListaPresupuestos.REFERENCIA_CLIENTE; + ACadena := 'Presupuesto ' + AListaPresupuestos.REFERENCIA + ' - ' + DateToStr(AListaPresupuestos.FECHA_PRESUPUESTO); + ACadena := ACadena + #13 + ' Ref. ' + AListaPresupuestos.REFERENCIA_CLIENTE; Edit; CONCEPTO := ACadena; Post; @@ -974,6 +980,32 @@ begin Result := True; end; +procedure TContratosClienteController.EtiquetasPreview(AContrato: IBizContratoCliente; const AAgencia, AReferencia: String; + const ANumEtiquetas, AEtiquetaIni: Integer); +var + AReportController : IContratosClienteReportController; +begin + AReportController := TContratosClienteReportController.Create; + try + AReportController.EtiquetasPreview(AContrato.ID, AAgencia, AReferencia, ANumEtiquetas, AEtiquetaIni); + finally + AReportController := NIL; + end; +end; + +procedure TContratosClienteController.EtiquetasPrint(AContrato: IBizContratoCliente; const AAgencia, AReferencia: String; + const ANumEtiquetas, AEtiquetaIni: Integer); +var + AReportController : IContratosClienteReportController; +begin + AReportController := TContratosClienteReportController.Create; + try + AReportController.EtiquetasPrint(AContrato.ID, AAgencia, AReferencia, ANumEtiquetas, AEtiquetaIni); + finally + AReportController := NIL; + end; +end; + procedure TContratosClienteController.RecalcularImportes( AContrato: IBizContratoCliente); var diff --git a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteReportController.pas b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteReportController.pas index cbf19e8..746df71 100644 --- a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteReportController.pas +++ b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteReportController.pas @@ -17,6 +17,8 @@ type const VerImprimirPrecios: Boolean = False; const VerImprimirTotales: Boolean = False; const VerImprimirRefProveedor: Boolean = False; const VerImprimirObservaciones: Boolean = False; const VerImprimirIncidencias: Boolean = False); function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean; + procedure EtiquetasPreview(const AID : integer; Const AAgencia: String; const AReferencia: String; const ANumEtiquetas: Integer = 1; const AEtiquetaIni: Integer = 1); + procedure EtiquetasPrint(const AID : integer; Const AAgencia: String; const AReferencia: String; const ANumEtiquetas: Integer; const AEtiquetaIni: Integer); end; TContratosClienteReportController = class(TControllerBase, IContratosClienteReportController) @@ -34,6 +36,8 @@ type const VerImprimirPrecios: Boolean = False; const VerImprimirTotales: Boolean = False; const VerImprimirRefProveedor: Boolean = False; const VerImprimirObservaciones: Boolean = False; const VerImprimirIncidencias: Boolean = False); function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean; + procedure EtiquetasPreview(const AID : integer; Const AAgencia: String; const AReferencia: String; const ANumEtiquetas: Integer = 1; const AEtiquetaIni: Integer = 1); + procedure EtiquetasPrint(const AID : integer; Const AAgencia: String; const AReferencia: String; const ANumEtiquetas: Integer; const AEtiquetaIni: Integer); end; @@ -65,6 +69,59 @@ begin inherited; end; +procedure TContratosClienteReportController.EtiquetasPreview(const AID: integer; const AAgencia, AReferencia: String; const ANumEtiquetas, + AEtiquetaIni: Integer); +var + AStream: Binary; + AEditor : IEditorContratosClientePreview; +begin + AEditor := NIL; + + AStream := FDataModule.GetEtiquetas(AID, AAgencia, aReferencia, ANumEtiquetas, AEtiquetaIni); + try + CreateEditor('EditorContratosClientePreview', IEditorContratosClientePreview, AEditor); + if Assigned(AEditor) then + try + AEditor.LoadFromStream(AStream); + AEditor.Preview; + finally + AEditor.Release; + AEditor := NIL; + end; + finally + FreeAndNil(AStream); + end; +end; + +procedure TContratosClienteReportController.EtiquetasPrint(const AID: integer; const AAgencia, AReferencia: String; const ANumEtiquetas, + AEtiquetaIni: Integer); +var + AStream: Binary; + AEditor : IEditorContratosClientePreview; +begin + AEditor := NIL; + + ShowHourglassCursor; + try + AStream := FDataModule.GetEtiquetas(AID, AAgencia, AReferencia, ANumEtiquetas, AEtiquetaIni); + try + CreateEditor('EditorContratosClientePreview', IEditorContratosClientePreview, AEditor); + if Assigned(AEditor) then + try + AEditor.LoadFromStream(AStream); + AEditor.Print; + finally + AEditor.Release; + AEditor := Nil; + end; + finally + FreeAndNil(AStream); + end; + finally + HideHourglassCursor; + end; +end; + function TContratosClienteReportController.ExportToPDF(const AID: Integer; const AFileName: String): Boolean; {var diff --git a/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.pas b/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.pas index d6483a8..868789e 100644 --- a/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.pas +++ b/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.pas @@ -52,6 +52,8 @@ type const VerImprimirPrecios: Boolean = False; const VerImprimirTotales: Boolean = False; const VerImprimirRefProveedor: Boolean = False; const VerImprimirObservaciones: Boolean = False; const VerImprimirIncidencias: Boolean = False): Binary; + function GetEtiquetas(const AID: Integer; const AAgencia: Variant; const ARefPedido: Variant; const ANumEtiquetas: Integer; const AEtiquetaIni: Integer): Binary; + function GetAnosItems : TStringList; function GetContratosClienteBeneficios : IBizContratosClienteBeneficios; end; @@ -181,6 +183,12 @@ begin end; +function TDataModuleContratosCliente.GetEtiquetas(const AID: Integer; const AAgencia, ARefPedido: Variant; const ANumEtiquetas, + AEtiquetaIni: Integer): Binary; +begin + Result := (RORemoteService as IsrvContratosCliente).GenerarInformeEtiquetas(AID, AAgencia, ARefPedido, ANumEtiquetas, AEtiquetaIni) +end; + function TDataModuleContratosCliente.GetItem(const ID: Integer): IBizContratoCliente; var Condicion: TDAWhereExpression; diff --git a/Source/Modulos/Contratos de cliente/Model/Data/uIDataModuleContratosCliente.pas b/Source/Modulos/Contratos de cliente/Model/Data/uIDataModuleContratosCliente.pas index bf8dc2c..68e9089 100644 --- a/Source/Modulos/Contratos de cliente/Model/Data/uIDataModuleContratosCliente.pas +++ b/Source/Modulos/Contratos de cliente/Model/Data/uIDataModuleContratosCliente.pas @@ -14,7 +14,7 @@ type function GetItems(const AListaID: TIntegerList) : IBizContratoCliente; overload; function GetItem(const ID : Integer) : IBizContratoCliente; function NewItem : IBizContratoCliente; - function GetContratosClienteBeneficios : IBizContratosClienteBeneficios; + function GetContratosClienteBeneficios : IBizContratosClienteBeneficios; end; implementation diff --git a/Source/Modulos/Contratos de cliente/Model/Data/uIDataModuleContratosClienteReport.pas b/Source/Modulos/Contratos de cliente/Model/Data/uIDataModuleContratosClienteReport.pas index 3353b44..390bd24 100644 --- a/Source/Modulos/Contratos de cliente/Model/Data/uIDataModuleContratosClienteReport.pas +++ b/Source/Modulos/Contratos de cliente/Model/Data/uIDataModuleContratosClienteReport.pas @@ -14,6 +14,7 @@ type function GetRptPDFContrato(const AID: Integer; const VerLogotipo: Boolean; const VerImprimirPrecios: Boolean = False; const VerImprimirTotales: Boolean = False; const VerImprimirRefProveedor: Boolean = False; const VerImprimirObservaciones: Boolean = False; const VerImprimirIncidencias: Boolean = False): Binary; + function GetEtiquetas(const AID: Integer; const AAgencia: Variant; const ARefPedido: Variant; const ANumEtiquetas: Integer; const AEtiquetaIni: Integer): Binary; end; implementation diff --git a/Source/Modulos/Contratos de cliente/Model/schContratosClienteClient_Intf.pas b/Source/Modulos/Contratos de cliente/Model/schContratosClienteClient_Intf.pas index 95372fd..8085c10 100644 --- a/Source/Modulos/Contratos de cliente/Model/schContratosClienteClient_Intf.pas +++ b/Source/Modulos/Contratos de cliente/Model/schContratosClienteClient_Intf.pas @@ -9,13 +9,13 @@ const { Data table rules ids Feel free to change them to something more human readable but make sure they are unique in the context of your application } - RID_Valores = '{00950C9F-3C0E-4384-8F5F-8D5B986FFD3C}'; - RID_Propiedades = '{FD2B8573-731E-425A-AFCD-43695556F4F9}'; - RID_ListaAnosContratos = '{D12AE8AC-742F-4849-8CDB-1DFBDF17CB3E}'; - RID_ContratosClienteBeneficios = '{BFD9857D-FFF0-4664-8ABF-742B1783C4F5}'; - RID_ContratosCliente = '{B04C1A81-6448-4F1C-94BF-3799E0433F6D}'; - RID_TiposCapitulos = '{1928D386-F965-4F72-9277-50CBFEF81572}'; - RID_ContratosCliente_Detalles = '{3FC0F387-A276-49DC-85A1-7970110566CE}'; + RID_Valores = '{F8B6F26D-032D-4A9A-86BC-3653978ECE17}'; + RID_Propiedades = '{C4AE18DF-6020-4467-BF22-4BDBC7E303CA}'; + RID_ListaAnosContratos = '{907EAF2B-5DAA-4CA2-8629-F8A08A77F1BD}'; + RID_ContratosClienteBeneficios = '{09EDCDAA-B1DE-4EE3-BE2B-CD3E5E13E09A}'; + RID_ContratosCliente = '{F8E2106B-A375-4CF2-9588-3B6E681FAB37}'; + RID_TiposCapitulos = '{37F9F608-A228-4CBD-BDAE-F23B0A86E5A5}'; + RID_ContratosCliente_Detalles = '{7171D48A-CEAE-4E75-989D-1E2B42144FA1}'; { Data table names } nme_Valores = 'Valores'; @@ -261,7 +261,7 @@ const type { IValores } IValores = interface(IDAStronglyTypedDataTable) - ['{5D9011E6-D896-4A0E-A54D-4EEBBDCDCB2D}'] + ['{AC9EB3D4-F956-46D3-85DE-B58EDFCA3A6F}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -320,7 +320,7 @@ type { IPropiedades } IPropiedades = interface(IDAStronglyTypedDataTable) - ['{67303838-FB10-4B4D-93AC-7AE3E8DFF959}'] + ['{0E9D305B-8105-4698-B5E6-81D5BCEC50D1}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -379,7 +379,7 @@ type { IListaAnosContratos } IListaAnosContratos = interface(IDAStronglyTypedDataTable) - ['{C04F03C6-E41E-406B-BCC7-21F80327A0CE}'] + ['{573A0052-813A-4526-A721-0BF791519BC9}'] { Property getters and setters } function GetANOValue: String; procedure SetANOValue(const aValue: String); @@ -414,7 +414,7 @@ type { IContratosClienteBeneficios } IContratosClienteBeneficios = interface(IDAStronglyTypedDataTable) - ['{310BF2BD-F3AB-49EB-B1AD-95EB739E4084}'] + ['{B62B9CFF-5CF7-4A23-9C52-D6C4A49050B4}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -617,7 +617,7 @@ type { IContratosCliente } IContratosCliente = interface(IDAStronglyTypedDataTable) - ['{17F07CFD-CE56-41C1-ABA3-84A2003212C5}'] + ['{6851D77E-DDB5-4088-A8F0-8363CCD53AA1}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -1327,7 +1327,7 @@ type } { ITiposCapitulos } ITiposCapitulos = interface(IDAStronglyTypedDataTable) - ['{92B0A9C9-D2F7-45F7-888B-FEB043E3FB23}'] + ['{A2E853A0-E31D-4D44-9855-820CDFFC36EE}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -1422,7 +1422,7 @@ type { IContratosCliente_Detalles } IContratosCliente_Detalles = interface(IDAStronglyTypedDataTable) - ['{C7692BDF-2B09-4581-A624-AD101BAF3417}'] + ['{2FC1C803-A267-4C6A-8ABD-41D00BA4338C}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); diff --git a/Source/Modulos/Contratos de cliente/Model/schContratosClienteServer_Intf.pas b/Source/Modulos/Contratos de cliente/Model/schContratosClienteServer_Intf.pas index 5a18931..70a9499 100644 --- a/Source/Modulos/Contratos de cliente/Model/schContratosClienteServer_Intf.pas +++ b/Source/Modulos/Contratos de cliente/Model/schContratosClienteServer_Intf.pas @@ -9,18 +9,18 @@ const { Delta rules ids Feel free to change them to something more human readable but make sure they are unique in the context of your application } - RID_ValoresDelta = '{A722C059-2F12-41F9-A113-93534ABBC807}'; - RID_PropiedadesDelta = '{68873676-2EA3-47C8-B322-707CD8A8B7D3}'; - RID_ListaAnosContratosDelta = '{A56B54B6-30F0-4BA4-927A-8C6E54F746CA}'; - RID_ContratosClienteBeneficiosDelta = '{21A88120-1D73-4516-8DDB-C7075C1FFD8D}'; - RID_ContratosClienteDelta = '{124CFEA1-C11A-4838-93D3-83F30385BD57}'; - RID_TiposCapitulosDelta = '{8A04F5B4-9934-4228-B499-05697F987ED3}'; - RID_ContratosCliente_DetallesDelta = '{5C443914-A231-4D30-840D-BA25D9E47768}'; + RID_ValoresDelta = '{F01C60FF-A9FF-4C56-A1B5-00F28F30BA67}'; + RID_PropiedadesDelta = '{28AC15F6-D117-4ACE-A740-B50E05B0CFF0}'; + RID_ListaAnosContratosDelta = '{CAF4B4B2-6B63-4B1A-BAC0-4011A5E53F6C}'; + RID_ContratosClienteBeneficiosDelta = '{1F2067BF-7070-4B04-BC79-AA2ACB1DBA6F}'; + RID_ContratosClienteDelta = '{95CAE9B6-D652-4987-AFB2-57DC7C73D22A}'; + RID_TiposCapitulosDelta = '{F2B25CC5-1DB9-4100-8041-BA5742867047}'; + RID_ContratosCliente_DetallesDelta = '{EA940846-A19E-43E6-865E-BD60E06F5EEC}'; type { IValoresDelta } IValoresDelta = interface(IValores) - ['{A722C059-2F12-41F9-A113-93534ABBC807}'] + ['{F01C60FF-A9FF-4C56-A1B5-00F28F30BA67}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_PROPIEDADValue : Integer; @@ -78,7 +78,7 @@ type { IPropiedadesDelta } IPropiedadesDelta = interface(IPropiedades) - ['{68873676-2EA3-47C8-B322-707CD8A8B7D3}'] + ['{28AC15F6-D117-4ACE-A740-B50E05B0CFF0}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldDESCRIPCIONValue : String; @@ -136,7 +136,7 @@ type { IListaAnosContratosDelta } IListaAnosContratosDelta = interface(IListaAnosContratos) - ['{A56B54B6-30F0-4BA4-927A-8C6E54F746CA}'] + ['{CAF4B4B2-6B63-4B1A-BAC0-4011A5E53F6C}'] { Property getters and setters } function GetOldANOValue : String; @@ -170,7 +170,7 @@ type { IContratosClienteBeneficiosDelta } IContratosClienteBeneficiosDelta = interface(IContratosClienteBeneficios) - ['{21A88120-1D73-4516-8DDB-C7075C1FFD8D}'] + ['{1F2067BF-7070-4B04-BC79-AA2ACB1DBA6F}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldREFERENCIAValue : String; @@ -372,7 +372,7 @@ type { IContratosClienteDelta } IContratosClienteDelta = interface(IContratosCliente) - ['{124CFEA1-C11A-4838-93D3-83F30385BD57}'] + ['{95CAE9B6-D652-4987-AFB2-57DC7C73D22A}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_EMPRESAValue : Integer; @@ -1082,7 +1082,7 @@ type { ITiposCapitulosDelta } ITiposCapitulosDelta = interface(ITiposCapitulos) - ['{8A04F5B4-9934-4228-B499-05697F987ED3}'] + ['{F2B25CC5-1DB9-4100-8041-BA5742867047}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldPOSICIONValue : Integer; @@ -1176,7 +1176,7 @@ type { IContratosCliente_DetallesDelta } IContratosCliente_DetallesDelta = interface(IContratosCliente_Detalles) - ['{5C443914-A231-4D30-840D-BA25D9E47768}'] + ['{EA940846-A19E-43E6-865E-BD60E06F5EEC}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_CONTRATOValue : Integer; diff --git a/Source/Modulos/Contratos de cliente/Model/uBizContratosClienteServer.pas b/Source/Modulos/Contratos de cliente/Model/uBizContratosClienteServer.pas index c085391..0ff2cd4 100644 --- a/Source/Modulos/Contratos de cliente/Model/uBizContratosClienteServer.pas +++ b/Source/Modulos/Contratos de cliente/Model/uBizContratosClienteServer.pas @@ -14,7 +14,9 @@ type private FReferenciaAutomatica : Boolean; function DarReferencia : String; - function IncrementarReferencia : Boolean; + function IncrementarReferencia : Boolean; + procedure LiberarPresupuestosDelContrato(aChange: TDADeltaChange); + protected procedure BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); override; @@ -50,6 +52,10 @@ begin FReferenciaAutomatica := False; end; end; + ctDelete: begin + LiberarPresupuestosDelContrato(aChange); + end; + end; end; @@ -102,6 +108,28 @@ begin Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, ID_TIENDA) end; +procedure TBizContratosClienteServer.LiberarPresupuestosDelContrato(aChange: TDADeltaChange); +var + ASchema : TDASchema; + ACurrentConn : IDAConnection; + ACommand : IDASQLCommand; +begin + ASchema := BusinessProcessor.Schema; + ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor); + +//En el caso de borrar un contrato se comprueban los presupuestos asociados para liberarlos para generar otro contrato. + ACommand := ASchema.NewCommand(ACurrentConn, 'LiberarPresupuestosDelContrato'); + try + with ACommand do + begin + ParamByName('ID_CONTRATO').Value := aChange.OldValueByName[fld_ContratosClienteID]; + Execute; + end; + finally + ACommand := NIL; + end; +end; + initialization RegisterBusinessProcessorRules(BIZ_SERVER_CONTRATOS_CLIENTE, TBizContratosClienteServer); diff --git a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm index 372ebd6..c0b7798 100644 --- a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm +++ b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm @@ -201,6 +201,140 @@ object RptContratosCliente: TRptContratosCliente DataType = datBlob end> end + item + Params = < + item + Name = 'ID_CONTRATO' + Value = '' + end + item + Name = 'REF_PEDIDO' + Value = '' + end + item + Name = 'AGENCIA' + Value = '' + end + item + Name = 'NUM_ETIQUETAS' + Value = '' + end + item + Name = 'ETIQUETA_INI' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select *'#10'from PROC_ETIQUETAS_CONTRATO(:ID_CONTRATO, :REF_PEDIDO,' + + ' :AGENCIA, :NUM_ETIQUETAS, :ETIQUETA_INI)'#10#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'AGENCIA' + TableField = 'AGENCIA' + end + item + DatasetField = 'BULTO' + TableField = 'BULTO' + end + item + DatasetField = 'NUM_BULTOS' + TableField = 'NUM_BULTOS' + end + item + DatasetField = 'DESTINATARIO' + TableField = 'DESTINATARIO' + end + item + DatasetField = 'TELEFONO' + TableField = 'TELEFONO' + end + item + DatasetField = 'CALLE' + TableField = 'CALLE' + end + item + DatasetField = 'CODIGO_POSTAL' + TableField = 'CODIGO_POSTAL' + end + item + DatasetField = 'POBLACION' + TableField = 'POBLACION' + end + item + DatasetField = 'PROVINCIA' + TableField = 'PROVINCIA' + end + item + DatasetField = 'REF_PEDIDO' + TableField = 'REF_PEDIDO' + end + item + DatasetField = 'REF_CLIENTE' + TableField = 'REF_CLIENTE' + end> + end> + Name = 'Informe_Detalles_Etiquetas' + Fields = < + item + Name = 'AGENCIA' + DataType = datString + Size = 255 + end + item + Name = 'BULTO' + DataType = datInteger + end + item + Name = 'NUM_BULTOS' + DataType = datInteger + end + item + Name = 'DESTINATARIO' + DataType = datString + Size = 255 + end + item + Name = 'TELEFONO' + DataType = datString + Size = 255 + end + item + Name = 'CALLE' + DataType = datString + Size = 255 + end + item + Name = 'CODIGO_POSTAL' + DataType = datString + Size = 255 + end + item + Name = 'POBLACION' + DataType = datString + Size = 255 + end + item + Name = 'PROVINCIA' + DataType = datString + Size = 255 + end + item + Name = 'REF_PEDIDO' + DataType = datString + Size = 255 + end + item + Name = 'REF_CLIENTE' + DataType = datString + Size = 255 + end> + end item Params = < item @@ -1694,4 +1828,106 @@ object RptContratosCliente: TRptContratosCliente Left = 352 Top = 304 end + object frxDBEtiquetas: TfrxDBDataset + UserName = 'frxDBEtiquetas' + CloseDataSource = False + DataSource = DADataEtiquetas + BCDToCurrency = False + Left = 528 + Top = 16 + end + object DADataEtiquetas: TDADataSource + DataSet = tbl_Etiquetas.Dataset + DataTable = tbl_Etiquetas + Left = 528 + Top = 72 + end + object tbl_Etiquetas: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'AGENCIA' + DataType = datString + Size = 255 + end + item + Name = 'BULTO' + DataType = datInteger + end + item + Name = 'NUM_BULTOS' + DataType = datInteger + end + item + Name = 'DESTINATARIO' + DataType = datString + Size = 255 + end + item + Name = 'TELEFONO' + DataType = datString + Size = 255 + end + item + Name = 'CALLE' + DataType = datString + Size = 255 + end + item + Name = 'CODIGO_POSTAL' + DataType = datString + Size = 255 + end + item + Name = 'POBLACION' + DataType = datString + Size = 255 + end + item + Name = 'PROVINCIA' + DataType = datString + Size = 255 + end + item + Name = 'REF_PEDIDO' + DataType = datString + Size = 255 + end + item + Name = 'REF_CLIENTE' + DataType = datString + Size = 255 + end> + Params = < + item + Name = 'ID_CONTRATO' + Value = '' + end + item + Name = 'REF_PEDIDO' + Value = '' + end + item + Name = 'AGENCIA' + Value = '' + end + item + Name = 'NUM_ETIQUETAS' + Value = '' + end + item + Name = 'ETIQUETA_INI' + Value = '' + end> + MasterMappingMode = mmDataRequest + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = DABin2DataStreamer1 + LogicalName = 'Informe_Detalles_Etiquetas' + IndexDefs = <> + Left = 528 + Top = 128 + end end diff --git a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas index c1497a0..cdcd32e 100644 --- a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas +++ b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas @@ -69,6 +69,9 @@ type tbl_Condiciones: TDAMemDataTable; schReport: TDASchema; DataDictionary: TDADataDictionary; + frxDBEtiquetas: TfrxDBDataset; + DADataEtiquetas: TDADataSource; + tbl_Etiquetas: TDAMemDataTable; procedure DataModuleCreate(Sender: TObject); procedure DataModuleDestroy(Sender: TObject); function frxReportUserFunction(const MethodName: string; @@ -101,6 +104,7 @@ type function GenerarContratoEnPDF(const ListaID : TIntegerArray; const NombreEmpresa: AnsiString; const VerLogotipo: Boolean = True; const VerPrecios: Boolean = True; const VerTotales: Boolean = True): Binary; function GenerarInformeListadoContratos(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarEtiquetas(const AID : Integer; const AAgencia: Variant; const ARefPedido: Variant; const ANumEtiquetas: Integer; const AEtiquetaIni: Integer): Binary; end; implementation @@ -116,6 +120,7 @@ const rptInforme = 'InfContratoCliente.fr3'; rptInformeListadoContratosDesglosado = 'InformeListadoContratosDesglosado.fr3'; rptInformeListadoContratos = 'InformeListadoContratos.fr3'; + rptInfEtiquetas = 'InfEtiquetasContratoCliente.fr3'; { Dataset names for schReport } ds_InformeListadoContratosResumen = 'InformeListadoContratosResumen'; @@ -170,6 +175,41 @@ begin end; end; +function TRptContratosCliente.GenerarEtiquetas(const AID: Integer; + const AAgencia, ARefPedido: Variant; const ANumEtiquetas, + AEtiquetaIni: Integer): Binary; +var + AInforme: Variant; + +begin + Result := Binary.Create; + FConnection.BeginTransaction; + + try + tbl_Etiquetas.ParamByName('ID_CONTRATO').AsInteger := AID; + tbl_Etiquetas.ParamByName('AGENCIA').AsString := AAgencia; + tbl_Etiquetas.ParamByName('REF_PEDIDO').AsString := ARefPedido; + tbl_Etiquetas.ParamByName('NUM_ETIQUETAS').AsInteger := ANumEtiquetas; + tbl_Etiquetas.ParamByName('ETIQUETA_INI').AsInteger := AEtiquetaIni; + tbl_Etiquetas.Active := True; + + AInforme := DarRutaFichero(DarRutaInformes, rptInfEtiquetas, tbl_Cabecera.FieldByName('ID_EMPRESA').AsString); + if VarIsNull(AInforme) then + raise Exception.Create (('Error Servidor: GenerarEtiquetas, no encuentra informe' + rptInfEtiquetas)); + + frxReport.LoadFromFile(AInforme, True); +// if withRefCliente then +// frxReport.Variables.Variables['withRefCliente'] := 1 +// else +// frxReport.Variables.Variables['withRefCliente'] := 0; + frxReport.PrepareReport(False); + frxReport.PreviewPages.SaveToStream(Result); + + finally + FConnection.RollbackTransaction; + end; +end; + procedure TRptContratosCliente.IniciarParametrosInforme; var ATextos : TStringList; diff --git a/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.dfm b/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.dfm index 89758a4..322571a 100644 --- a/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.dfm +++ b/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.dfm @@ -1366,6 +1366,28 @@ object srvContratosCliente: TsrvContratosCliente end> Name = 'Insert_ContratosCliente' end + item + Params = < + item + Name = 'ID_CONTRATO' + DataType = datInteger + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + TargetTable = 'PRESUPUESTOS_CLIENTE' + Name = 'IBX' + SQL = + 'UPDATE PRESUPUESTOS_CLIENTE'#10'SET ID_CONTRATO = NULL'#10'WHERE ID_CONT' + + 'RATO = :ID_CONTRATO'#10 + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'LiberarPresupuestosDelContrato' + end item Params = < item diff --git a/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.pas b/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.pas index bc4a13c..10b5ece 100644 --- a/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.pas +++ b/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.pas @@ -35,7 +35,8 @@ type { IsrvContratosCliente methods } function GenerarInforme(const ListaID: TIntegerArray; const NombreEmpresa: AnsiString; const VerLogotipo: Boolean; const VerPrecios: Boolean; const VerTotales: Boolean): Binary; function GenerarInformeEnPDF(const ListaID: TIntegerArray; const NombreEmpresa: AnsiString; const VerLogotipo: Boolean; const VerPrecios: Boolean; const VerTotales: Boolean): Binary; - + function GenerarInformeEtiquetas(const ID: Integer; const AAgencia: Variant; const ARefPedido: Variant; const ANumEtiquetas: Integer; + const AEtiquetaIni: Integer): Binary; end; implementation @@ -104,6 +105,21 @@ begin end; end; + +function TsrvContratosCliente.GenerarInformeEtiquetas(const ID: Integer; + const AAgencia, ARefPedido: Variant; const ANumEtiquetas, + AEtiquetaIni: Integer): Binary; +var + AReportGenerator : TRptContratosCliente; +begin + AReportGenerator := TRptContratosCliente.Create(nil); + try + Result := AReportGenerator.GenerarEtiquetas(ID, AAgencia, ARefPedido, ANumEtiquetas, AEtiquetaIni); + finally + FreeAndNIL(AReportGenerator); + end; +end; + initialization TROClassFactory.Create('srvContratosCliente', Create_srvContratosCliente, TsrvContratosCliente_Invoker); diff --git a/Source/Modulos/Contratos de cliente/Views/ContratosCliente_view.dpk b/Source/Modulos/Contratos de cliente/Views/ContratosCliente_view.dpk index 555f242..6b4c65f 100644 --- a/Source/Modulos/Contratos de cliente/Views/ContratosCliente_view.dpk +++ b/Source/Modulos/Contratos de cliente/Views/ContratosCliente_view.dpk @@ -95,6 +95,7 @@ contains uEditorContratosClienteBeneficios in 'uEditorContratosClienteBeneficios.pas' {fEditorContratosClienteBeneficios: TFrame}, uDialogOpcionesImpresionContratosCliente in 'uDialogOpcionesImpresionContratosCliente.pas' {fDialogOpcionesImpresionContratosCliente: T}, uViewDireccionEntregaContratoCli in 'uViewDireccionEntregaContratoCli.pas' {frViewDireccionEntregaContratoCli: TFrame}, - uEditorDireccionEntregaContratoCliente in 'uEditorDireccionEntregaContratoCliente.pas' {fEditorDireccionEntregaContratoCliente: TFrame}; + uEditorDireccionEntregaContratoCliente in 'uEditorDireccionEntregaContratoCliente.pas' {fEditorDireccionEntregaContratoCliente: TFrame}, + uDialogOpcionesImpresionEtiquetasContratosCliente in 'uDialogOpcionesImpresionEtiquetasContratosCliente.pas' {fDialogOpcionesImpresionEtiquetasContratosCliente: TfDialogOpcionesImpresionEtiquetasContratosCliente}; end. diff --git a/Source/Modulos/Contratos de cliente/Views/ContratosCliente_view.dproj b/Source/Modulos/Contratos de cliente/Views/ContratosCliente_view.dproj index 8541206..a6352b0 100644 --- a/Source/Modulos/Contratos de cliente/Views/ContratosCliente_view.dproj +++ b/Source/Modulos/Contratos de cliente/Views/ContratosCliente_view.dproj @@ -49,63 +49,60 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fDialogOpcionesImpresionContratosCliente
T
+ +
fDialogOpcionesImpresionEtiquetasContratosCliente
+ TFrame +
fEditorPresupuestoCliente
TfEditorPedidoCliente @@ -166,6 +163,13 @@
frViewElegirArticulosContratosCliente
TFrame
+ + + + + + +