From 1728a7106770884e23e047cd2f87e8f3e92495d1 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 14 Sep 2012 16:53:12 +0000 Subject: [PATCH] Tarea #1072 -> Guardar el estado de las columnas del grid de detalles Tarea #1078 -> Poner una columna de VISIBLE en los conceptos de presupuestos y contratos git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@571 f4e31baf-9722-1c47-927c-6f952f962d4b --- Source/Base/Base.dproj | 159 ++++++------------ Source/Base/Utiles/uCalculosUtils.pas | 3 +- Source/Cliente/FactuGES.dproj | 4 +- Source/Cliente/FactuGES.rc | 8 +- Source/Cliente/FactuGES.res | Bin 171984 -> 171984 bytes Source/GUIBase/GUIBase.dproj | 56 +++--- Source/GUIBase/uViewDetallesBase.dfm | 50 +++++- Source/GUIBase/uViewDetallesBase.pas | 52 +++++- Source/GUIBase/uViewDocumentos.pas | 2 - Source/Informes/InfContratoCliente.fr3 | 18 +- Source/Informes/InfPresupuestoCliente.fr3 | 16 +- .../ContratosCliente_controller.dproj | 16 +- .../uDetallesContratoClienteController.pas | 8 + .../Data/uDataModuleContratosCliente.dfm | 4 + .../Model/schContratosClienteClient_Intf.pas | 77 ++++++--- .../Model/schContratosClienteServer_Intf.pas | 71 ++++++-- .../Model/uBizDetallesContratoCliente.pas | 1 + .../Reports/uRptContratosCliente_Server.dfm | 16 +- .../Servidor/srvContratosCliente_Impl.dfm | 59 ++++--- .../Views/uEditorContratoCliente.dfm | 10 +- .../Views/uEditorContratoCliente.pas | 4 +- .../Views/uViewDetallesContratoCliente.dfm | 29 ++-- .../Views/uViewDetallesContratoCliente.pas | 59 ++++++- .../uDetallesPresupuestoClienteController.pas | 43 ++++- .../Data/uDataModulePresupuestosCliente.dfm | 21 ++- .../Model/PresupuestosCliente_model.dproj | 4 - .../schPresupuestosClienteClient_Intf.pas | 143 +++++++++++++--- .../schPresupuestosClienteServer_Intf.pas | 153 +++++++++++++++-- .../Model/uBizDetallesPresupuestoCliente.pas | 1 + .../uRptPresupuestosCliente_Server.dfm | 16 +- .../Servidor/srvPresupuestosCliente_Impl.dfm | 110 ++++++++---- .../Views/uEditorPresupuestoCliente.dfm | 93 +++++----- .../Views/uEditorPresupuestoCliente.pas | 7 +- .../Views/uViewDetallesPresupuestoCliente.dfm | 33 ++-- .../Views/uViewDetallesPresupuestoCliente.pas | 62 ++++++- Source/Servidor/FactuGES_Server.dpr | 6 +- Source/Servidor/FactuGES_Server.dproj | 2 +- Source/Servidor/FactuGES_Server.rc | 10 +- Source/Servidor/FactuGES_Server.res | Bin 23344 -> 23356 bytes 39 files changed, 1023 insertions(+), 403 deletions(-) diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj index 9a77ac9a..426db58c 100644 --- a/Source/Base/Base.dproj +++ b/Source/Base/Base.dproj @@ -44,69 +44,6 @@ Package FalseTrueFalseLibreria base de FactuGESFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VCL for the Web Design Package for CodeGear RAD Studio CodeGear WebSnap Components CodeGear SOAP Components @@ -121,55 +58,55 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fConfigurarConexion
TForm diff --git a/Source/Base/Utiles/uCalculosUtils.pas b/Source/Base/Utiles/uCalculosUtils.pas index 303d4738..c7a713f3 100644 --- a/Source/Base/Utiles/uCalculosUtils.pas +++ b/Source/Base/Utiles/uCalculosUtils.pas @@ -16,7 +16,8 @@ const CAMPO_IMPORTE_TOTAL = 'IMPORTE_TOTAL'; CAMPO_DESCUENTO = 'DESCUENTO'; CAMPO_IMPORTE_PORTE = 'IMPORTE_PORTE'; - CAMPO_VISIBLE = 'VISIBLE'; //Se usará para saber si un concepto se debe sumar o no + CAMPO_VISIBLE = 'VISIBLE'; //Se usará para saber si un concepto se debe sumar o no + CAMPO_VISIBLE2 = 'VISIBLE2'; //Se usará para saber si un concepto se muestra o no function CalcularLineaConcepto (const ADataTable : TDADataTable): Double; procedure ValidarCamposLineaConcepto(DataTable: TDADataTable); diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index bca9923e..a6df7e8f 100644 --- a/Source/Cliente/FactuGES.dproj +++ b/Source/Cliente/FactuGES.dproj @@ -52,7 +52,9 @@ Delphi.Personality VCLApplication -FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2500FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.5.0.0FactuGESFactuGES2.5.0.0 +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2510FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.5.1.0FactuGESFactuGES2.5.1.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.rc b/Source/Cliente/FactuGES.rc index 94b9843b..38754d06 100644 --- a/Source/Cliente/FactuGES.rc +++ b/Source/Cliente/FactuGES.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo Acana\Resources\Iconos\Factuges.ico" 1 VERSIONINFO -FILEVERSION 2,5,0,0 -PRODUCTVERSION 2,5,0,0 +FILEVERSION 2,5,1,0 +PRODUCTVERSION 2,5,1,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -13,10 +13,10 @@ BEGIN BLOCK "0C0A04E4" BEGIN VALUE "CompanyName", "Rodax Software S.L.\0" - VALUE "FileVersion", "2.5.0.0\0" + VALUE "FileVersion", "2.5.1.0\0" VALUE "InternalName", "FactuGES\0" VALUE "ProductName", "FactuGES\0" - VALUE "ProductVersion", "2.5.0.0\0" + VALUE "ProductVersion", "2.5.1.0\0" END END BLOCK "VarFileInfo" diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index ed2b90492623f647eafe9657de1185234977b92e..75d4651f9109642b4c820092dbd05b642812b798 100644 GIT binary patch delta 42 xcmcbxpXa_5c6? diff --git a/Source/GUIBase/GUIBase.dproj b/Source/GUIBase/GUIBase.dproj index a2fc16c9..f44e3be7 100644 --- a/Source/GUIBase/GUIBase.dproj +++ b/Source/GUIBase/GUIBase.dproj @@ -58,34 +58,34 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fDialogBase
diff --git a/Source/GUIBase/uViewDetallesBase.dfm b/Source/GUIBase/uViewDetallesBase.dfm index 9046ff56..85f558a3 100644 --- a/Source/GUIBase/uViewDetallesBase.dfm +++ b/Source/GUIBase/uViewDetallesBase.dfm @@ -64,7 +64,7 @@ inherited frViewDetallesBase: TfrViewDetallesBase DroppedDownWidth = 145 MaxMRUCount = 0 FontName = 'Tahoma' - ItemIndex = 35 + ItemIndex = 40 Options = [foTrueTypeOnly, foNoOEMFonts, foScalableOnly, foWysiWyg] Sorted = True TabOrder = 2 @@ -328,6 +328,54 @@ inherited frViewDetallesBase: TfrViewDetallesBase HeaderAlignmentHorz = taCenter Width = 25 end + object cxGridViewVISIBLE2: TcxGridDBColumn + Caption = #191'Visible?' + DataBinding.FieldName = 'VISIBLE2' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.Alignment = taCenter + Properties.DisplayChecked = '1' + Properties.DisplayUnchecked = '0' + Properties.Glyph.Data = { + 92030000424D9203000000000000920100002800000020000000100000000100 + 08000000000000020000120B0000120B0000570000005700000000000000FFFF + FF0040384000703840008048500090586000C0606000A0505000804040006030 + 30009050500070404000A060600090606000A0707000B0808000C09090004030 + 3000E0B0B000B0909000FFF0F000FF787000E0787000C0686000FF9890009048 + 4000A0585000D0888000E0989000E0706000FF80700080484000A0686000FFA0 + 9000FF887000B060500070484000FFB0A000C0989000D0A8A000E0B8B000FF98 + 8000A0605000FFC0B000F0C0B00080686000F0D8D000B0908000E0C8B000E0D8 + D000FFE0C000FFF8F000F0E0C000FFF0D000FFF8E00020283000FEFEFE00FAFA + FA00F7F7F700F3F3F300F1F1F100F0F0F000EDEDED00EAEAEA00E7E7E700E6E6 + E600E3E3E300E0E0E000DADADA00D7D7D700D3D3D300D0D0D000CDCDCD00C9C9 + C900C6C6C600C4C4C400C3C3C300C0C0C000BEBEBE00BCBCBC00B9B9B900B7B7 + B700B3B3B300AEAEAE00ACACAC00A6A6A600FFFFFF0056565656565656565656 + 5656565656565656565656565656565656565656565656565656565656565656 + 5656565656565656565656565656565656565656565656565656565656565656 + 5656565656565656565656565656565656565656565656565656565656565656 + 5656565656565656565656565656565656565656565656565656404040444C4C + 463D5656565656565656122830262D2D2F325656565644444444433E4145474A + 50463B404456101010102734181D061A242F35122656564646443A3F434A544C + 49493A3C4646560F0F10362C1507110A2320362E0F0F56564845394341535554 + 44473944484856560E13331C21023711161714260E0E5656564A3E403E38544A + 4344464B4B565656560D31122B01111A1E1B0F050556565656564E49423F4343 + 434A4E4E565656565656040C2925221E1E2A04045656565656565650504F4D4F + 50505056565656565656560B0B1F19080B0B0B56565656565656565652505151 + 505656565656565656565656090B03030B565656565656565656565656565656 + 5656565656565656565656565656565656565656565656565656565656565656 + 5656565656565656565656565656565656565656565656565656565656565656 + 5656565656565656565656565656565656565656565656565656565656565656 + 56565656565656565656565656565656565656565656} + Properties.GlyphCount = 2 + Properties.ImmediatePost = True + Properties.NullStyle = nssUnchecked + Properties.ValueChecked = 1 + Properties.ValueUnchecked = 0 + Visible = False + FooterAlignmentHorz = taCenter + HeaderAlignmentHorz = taCenter + VisibleForCustomization = False + Width = 25 + end end object cxGridLevel: TcxGridLevel GridView = cxGridView diff --git a/Source/GUIBase/uViewDetallesBase.pas b/Source/GUIBase/uViewDetallesBase.pas index dea8faaa..74e2c7aa 100644 --- a/Source/GUIBase/uViewDetallesBase.pas +++ b/Source/GUIBase/uViewDetallesBase.pas @@ -23,6 +23,9 @@ type procedure SaveGridStatus; procedure RestoreGridStatus; + procedure RestoreFromIniFile; + procedure StoreToIniFile; + procedure BeginUpdate; procedure EndUpdate; @@ -108,6 +111,7 @@ type TBXItem13: TTBXItem; cxStyle_DESCUENTO: TcxStyle; cxStyleDesactivado: TcxStyle; + cxGridViewVISIBLE2: TcxGridDBColumn; procedure actAnadirExecute(Sender: TObject); procedure actEliminarExecute(Sender: TObject); @@ -176,6 +180,8 @@ type procedure EndUpdate; procedure SaveGridStatus; procedure RestoreGridStatus; + procedure RestoreFromIniFile; + procedure StoreToIniFile; procedure ExpandirTodo; procedure ContraerTodo; procedure AjustarAncho; @@ -192,7 +198,7 @@ implementation {$R *.dfm} uses - uCalculosUtils, uSistemaFunc; + uCalculosUtils, uSistemaFunc, SHFolder, uAppInfoUtils; function EnumFontsProc(var LogFont: TLogFont; var TextMetric: TTextMetric; FontType: Integer; Data: Pointer): Integer; stdcall; @@ -348,6 +354,7 @@ procedure TfrViewDetallesBase.CustomViewDestroy(Sender: TObject); begin inherited; CurEdit := Nil; + StoreToIniFile; end; procedure TfrViewDetallesBase.cxGridViewEditing(Sender: TcxCustomGridTableView; @@ -630,6 +637,24 @@ begin end; end; +procedure TfrViewDetallesBase.RestoreFromIniFile; +var + AIniFile : String; +begin + inherited; + if Assigned(_FocusedView) then + begin + + AIniFile := GetSpecialFolderPath(CSIDL_APPDATA); //[Current Users]\Application Data + AIniFile := AIniFile + PathDelim + 'Rodax Software' + PathDelim + GetAppName + PathDelim; + + if not DirectoryExists(AIniFile) then + ForceDirectories(AIniFile); + + _FocusedView.RestoreFromIniFile(AIniFile + 'grid.xml', True, False, []); + end; +end; + procedure TfrViewDetallesBase.RestoreGridStatus; begin if Assigned(FGridStatus) and (not IsEmpty) then @@ -698,11 +723,34 @@ procedure TfrViewDetallesBase.SetDetalles(const Value: IDAStronglyTypedDataTable begin FDetalles := Value; if Assigned(FDetalles) then - DADataSource.DataTable := FDetalles.DataTable + begin + DADataSource.DataTable := FDetalles.DataTable; + RestoreFromIniFile; // la restauración de las columnas sólo funciona cuando hay datos. + end else DADataSource.DataTable := NIL; end; +procedure TfrViewDetallesBase.StoreToIniFile; +var + AIniFile : String; +begin + inherited; + + if Assigned(_FocusedView) then + begin + + AIniFile := GetSpecialFolderPath(CSIDL_APPDATA); //[Current Users]\Application Data + AIniFile := AIniFile + PathDelim + 'Rodax Software' + PathDelim + GetAppName + PathDelim; + + if not DirectoryExists(AIniFile) then + ForceDirectories(AIniFile); + + _FocusedView.StoreToIniFile(AIniFile + 'grid.xml', False, []); +// _FocusedView.StoreToRegistry(Path + '\\GridSettings\\' + Self.Name, False, [], Self.Name); + end; +end; + procedure TfrViewDetallesBase.TBXItem13Click(Sender: TObject); begin inherited; diff --git a/Source/GUIBase/uViewDocumentos.pas b/Source/GUIBase/uViewDocumentos.pas index ec7812bd..1ed485a2 100644 --- a/Source/GUIBase/uViewDocumentos.pas +++ b/Source/GUIBase/uViewDocumentos.pas @@ -220,8 +220,6 @@ end; function TfrViewDocumentos.AsignarImagen(ANombreFichero: String): Integer; begin - Result := -1; - if (LOWERCASE(ExtractFileExt(ANombreFichero)) = '.txt') or (LOWERCASE(ExtractFileExt(ANombreFichero)) = '.ini') or (LOWERCASE(ExtractFileExt(ANombreFichero)) = '.sql') then diff --git a/Source/Informes/InfContratoCliente.fr3 b/Source/Informes/InfContratoCliente.fr3 index 0032bbd2..f5faf9f8 100644 --- a/Source/Informes/InfContratoCliente.fr3 +++ b/Source/Informes/InfContratoCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -12,19 +12,19 @@ - + - + - + @@ -32,7 +32,7 @@ - + @@ -54,17 +54,17 @@ - + - + - + @@ -79,7 +79,7 @@ - + diff --git a/Source/Informes/InfPresupuestoCliente.fr3 b/Source/Informes/InfPresupuestoCliente.fr3 index b8adaba9..065d0c36 100644 --- a/Source/Informes/InfPresupuestoCliente.fr3 +++ b/Source/Informes/InfPresupuestoCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -14,19 +14,19 @@ - - + + - + - + @@ -34,7 +34,7 @@ - + @@ -54,10 +54,10 @@ - + - + diff --git a/Source/Modulos/Contratos de cliente/Controller/ContratosCliente_controller.dproj b/Source/Modulos/Contratos de cliente/Controller/ContratosCliente_controller.dproj index 607dfed2..0d47611c 100644 --- a/Source/Modulos/Contratos de cliente/Controller/ContratosCliente_controller.dproj +++ b/Source/Modulos/Contratos de cliente/Controller/ContratosCliente_controller.dproj @@ -49,18 +49,18 @@ MainSource + + + + + + + + - - - - - - - - diff --git a/Source/Modulos/Contratos de cliente/Controller/uDetallesContratoClienteController.pas b/Source/Modulos/Contratos de cliente/Controller/uDetallesContratoClienteController.pas index 36fb1996..2b382c9a 100644 --- a/Source/Modulos/Contratos de cliente/Controller/uDetallesContratoClienteController.pas +++ b/Source/Modulos/Contratos de cliente/Controller/uDetallesContratoClienteController.pas @@ -18,6 +18,7 @@ type procedure AnadirCapitulo (const Tipo: String; const Descripcion: String; Const Descuento:Boolean; ADetalles: IDAStronglyTypedDataTable); procedure SetTipoArticulo(ADetalles: IDAStronglyTypedDataTable; ATipo: String); procedure SetVisible(ADetalles: IDAStronglyTypedDataTable;const AVisible: Integer;const Orden: Integer); //1Ascendente/0Descendente + procedure SetVisible2(ADetalles: IDAStronglyTypedDataTable;const AVisible: Integer;const Orden: Integer); end; TDetallesContratoClienteController = class(TControllerDetallesArticulos, IDetallesContratoClienteController) @@ -50,6 +51,7 @@ type procedure SetTipoArticulo(ADetalles: IDAStronglyTypedDataTable; ATipo: String); procedure SetVisible(ADetalles: IDAStronglyTypedDataTable;const AVisible: Integer;const Orden: Integer); //1Ascendente/0Descendente + procedure SetVisible2(ADetalles: IDAStronglyTypedDataTable;const AVisible: Integer;const Orden: Integer); end; implementation @@ -176,6 +178,12 @@ begin FDetallesPresupuestoCliente.SetVisible(ADetalles, AVisible, Orden); end; +procedure TDetallesContratoClienteController.SetVisible2( + ADetalles: IDAStronglyTypedDataTable; const AVisible, Orden: Integer); +begin + FDetallesPresupuestoCliente.SetVisible2(ADetalles, AVisible, Orden); +end; + procedure TDetallesContratoClienteController.ValidarCampos(DataTable: TDADataTable); begin inherited; diff --git a/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.dfm b/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.dfm index 109b78d7..94b2e10c 100644 --- a/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.dfm +++ b/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.dfm @@ -379,6 +379,10 @@ inherited DataModuleContratosCliente: TDataModuleContratosCliente Name = 'IMPORTE_TOTAL' DataType = datCurrency end + item + Name = 'VISIBLE2' + DataType = datSmallInt + end item Name = 'VISIBLE' DataType = datSmallInt diff --git a/Source/Modulos/Contratos de cliente/Model/schContratosClienteClient_Intf.pas b/Source/Modulos/Contratos de cliente/Model/schContratosClienteClient_Intf.pas index 9595186e..696e78e1 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 = '{77A5C873-380F-4698-9E11-F611CF7B4D6A}'; - RID_Propiedades = '{486DF363-F3FC-4540-B80F-3D6ECD60057F}'; - RID_ListaAnosContratos = '{5F6BBC0C-7DD6-4B5A-93C3-E0A70687F51B}'; - RID_ContratosClienteBeneficios = '{5001FCC6-7A3E-420B-A362-C66022A8D4F9}'; - RID_ContratosCliente = '{ED10394C-954E-4012-88CC-B63CAC527A63}'; - RID_TiposCapitulos = '{2DF18C63-1821-49E9-AC1D-634E5396332E}'; - RID_ContratosCliente_Detalles = '{FE59D0AE-E7D9-4742-A444-A90ACC89B005}'; + RID_Valores = '{A3223E5F-2D10-45AF-8361-05537914212E}'; + RID_Propiedades = '{506EF0BF-FB5A-4737-A7FD-09951FD2C7B8}'; + RID_ListaAnosContratos = '{578CAF17-79FA-448E-BDEE-1FC0F15EFC68}'; + RID_ContratosClienteBeneficios = '{6A8C9891-3518-459A-969C-5760CBFDA3D3}'; + RID_ContratosCliente = '{D4734C94-87F5-4A8B-A8FC-BBBF6121322C}'; + RID_TiposCapitulos = '{D2CDA279-9E7E-412A-901B-92F2F70555BA}'; + RID_ContratosCliente_Detalles = '{EA4FF513-3EDB-4F49-9025-2C5011436584}'; { Data table names } nme_Valores = 'Valores'; @@ -198,6 +198,7 @@ const fld_ContratosCliente_DetallesCANTIDAD = 'CANTIDAD'; fld_ContratosCliente_DetallesIMPORTE_UNIDAD = 'IMPORTE_UNIDAD'; fld_ContratosCliente_DetallesIMPORTE_TOTAL = 'IMPORTE_TOTAL'; + fld_ContratosCliente_DetallesVISIBLE2 = 'VISIBLE2'; fld_ContratosCliente_DetallesVISIBLE = 'VISIBLE'; fld_ContratosCliente_DetallesID_ARTICULO = 'ID_ARTICULO'; fld_ContratosCliente_DetallesTIPO_ARTICULO = 'TIPO_ARTICULO'; @@ -216,18 +217,19 @@ const idx_ContratosCliente_DetallesCANTIDAD = 6; idx_ContratosCliente_DetallesIMPORTE_UNIDAD = 7; idx_ContratosCliente_DetallesIMPORTE_TOTAL = 8; - idx_ContratosCliente_DetallesVISIBLE = 9; - idx_ContratosCliente_DetallesID_ARTICULO = 10; - idx_ContratosCliente_DetallesTIPO_ARTICULO = 11; - idx_ContratosCliente_DetallesDESCUENTO = 12; - idx_ContratosCliente_DetallesIMPORTE_PORTE = 13; - idx_ContratosCliente_DetallesREFERENCIA = 14; - idx_ContratosCliente_DetallesREFERENCIA_PROVEEDOR = 15; + idx_ContratosCliente_DetallesVISIBLE2 = 9; + idx_ContratosCliente_DetallesVISIBLE = 10; + idx_ContratosCliente_DetallesID_ARTICULO = 11; + idx_ContratosCliente_DetallesTIPO_ARTICULO = 12; + idx_ContratosCliente_DetallesDESCUENTO = 13; + idx_ContratosCliente_DetallesIMPORTE_PORTE = 14; + idx_ContratosCliente_DetallesREFERENCIA = 15; + idx_ContratosCliente_DetallesREFERENCIA_PROVEEDOR = 16; type { IValores } IValores = interface(IDAStronglyTypedDataTable) - ['{DFCE6325-A26B-4ABC-B445-11FC8A0B0EA5}'] + ['{C2EFDF3D-8F14-4A69-8754-E2384C48DC25}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -286,7 +288,7 @@ type { IPropiedades } IPropiedades = interface(IDAStronglyTypedDataTable) - ['{3905AFC7-7942-4A46-9780-838277847C23}'] + ['{75054379-E40C-4CD7-96C1-46C26308E523}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -345,7 +347,7 @@ type { IListaAnosContratos } IListaAnosContratos = interface(IDAStronglyTypedDataTable) - ['{50911EB2-C48F-4B1B-B3B5-2AE0C9EF69E9}'] + ['{417E2367-4285-4DF4-9854-1E44C8A5008B}'] { Property getters and setters } function GetANOValue: String; procedure SetANOValue(const aValue: String); @@ -380,7 +382,7 @@ type { IContratosClienteBeneficios } IContratosClienteBeneficios = interface(IDAStronglyTypedDataTable) - ['{E857F9D0-94BB-4BAD-8CC8-5BBBAFDB6B52}'] + ['{F9A3D0AB-50BF-4390-A1D7-228F020BF1BD}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -535,7 +537,7 @@ type { IContratosCliente } IContratosCliente = interface(IDAStronglyTypedDataTable) - ['{918B08A5-1B87-4AC4-A9E9-AC5F96815EB0}'] + ['{135031F8-11AD-44F9-8712-F24C96C7D409}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -1101,7 +1103,7 @@ type } { ITiposCapitulos } ITiposCapitulos = interface(IDAStronglyTypedDataTable) - ['{48215290-558C-4E03-B941-E5C5162F335F}'] + ['{447F4E62-0CA7-42E6-A436-174E923F5865}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -1196,7 +1198,7 @@ type { IContratosCliente_Detalles } IContratosCliente_Detalles = interface(IDAStronglyTypedDataTable) - ['{202C1D1C-1786-4027-A601-61B2DF617286}'] + ['{642FAB02-5C40-4C1C-9F3D-010C305C3544}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -1234,6 +1236,10 @@ type procedure SetIMPORTE_TOTALValue(const aValue: Currency); function GetIMPORTE_TOTALIsNull: Boolean; procedure SetIMPORTE_TOTALIsNull(const aValue: Boolean); + function GetVISIBLE2Value: SmallInt; + procedure SetVISIBLE2Value(const aValue: SmallInt); + function GetVISIBLE2IsNull: Boolean; + procedure SetVISIBLE2IsNull(const aValue: Boolean); function GetVISIBLEValue: SmallInt; procedure SetVISIBLEValue(const aValue: SmallInt); function GetVISIBLEIsNull: Boolean; @@ -1283,6 +1289,8 @@ type property IMPORTE_UNIDADIsNull: Boolean read GetIMPORTE_UNIDADIsNull write SetIMPORTE_UNIDADIsNull; property IMPORTE_TOTAL: Currency read GetIMPORTE_TOTALValue write SetIMPORTE_TOTALValue; property IMPORTE_TOTALIsNull: Boolean read GetIMPORTE_TOTALIsNull write SetIMPORTE_TOTALIsNull; + property VISIBLE2: SmallInt read GetVISIBLE2Value write SetVISIBLE2Value; + property VISIBLE2IsNull: Boolean read GetVISIBLE2IsNull write SetVISIBLE2IsNull; property VISIBLE: SmallInt read GetVISIBLEValue write SetVISIBLEValue; property VISIBLEIsNull: Boolean read GetVISIBLEIsNull write SetVISIBLEIsNull; property ID_ARTICULO: Integer read GetID_ARTICULOValue write SetID_ARTICULOValue; @@ -1340,6 +1348,10 @@ type procedure SetIMPORTE_TOTALValue(const aValue: Currency); virtual; function GetIMPORTE_TOTALIsNull: Boolean; virtual; procedure SetIMPORTE_TOTALIsNull(const aValue: Boolean); virtual; + function GetVISIBLE2Value: SmallInt; virtual; + procedure SetVISIBLE2Value(const aValue: SmallInt); virtual; + function GetVISIBLE2IsNull: Boolean; virtual; + procedure SetVISIBLE2IsNull(const aValue: Boolean); virtual; function GetVISIBLEValue: SmallInt; virtual; procedure SetVISIBLEValue(const aValue: SmallInt); virtual; function GetVISIBLEIsNull: Boolean; virtual; @@ -1388,6 +1400,8 @@ type property IMPORTE_UNIDADIsNull: Boolean read GetIMPORTE_UNIDADIsNull write SetIMPORTE_UNIDADIsNull; property IMPORTE_TOTAL: Currency read GetIMPORTE_TOTALValue write SetIMPORTE_TOTALValue; property IMPORTE_TOTALIsNull: Boolean read GetIMPORTE_TOTALIsNull write SetIMPORTE_TOTALIsNull; + property VISIBLE2: SmallInt read GetVISIBLE2Value write SetVISIBLE2Value; + property VISIBLE2IsNull: Boolean read GetVISIBLE2IsNull write SetVISIBLE2IsNull; property VISIBLE: SmallInt read GetVISIBLEValue write SetVISIBLEValue; property VISIBLEIsNull: Boolean read GetVISIBLEIsNull write SetVISIBLEIsNull; property ID_ARTICULO: Integer read GetID_ARTICULOValue write SetID_ARTICULOValue; @@ -3156,6 +3170,27 @@ begin DataTable.Fields[idx_ContratosCliente_DetallesIMPORTE_TOTAL].AsVariant := Null; end; +function TContratosCliente_DetallesDataTableRules.GetVISIBLE2Value: SmallInt; +begin + result := DataTable.Fields[idx_ContratosCliente_DetallesVISIBLE2].AsSmallInt; +end; + +procedure TContratosCliente_DetallesDataTableRules.SetVISIBLE2Value(const aValue: SmallInt); +begin + DataTable.Fields[idx_ContratosCliente_DetallesVISIBLE2].AsSmallInt := aValue; +end; + +function TContratosCliente_DetallesDataTableRules.GetVISIBLE2IsNull: boolean; +begin + result := DataTable.Fields[idx_ContratosCliente_DetallesVISIBLE2].IsNull; +end; + +procedure TContratosCliente_DetallesDataTableRules.SetVISIBLE2IsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_ContratosCliente_DetallesVISIBLE2].AsVariant := Null; +end; + function TContratosCliente_DetallesDataTableRules.GetVISIBLEValue: SmallInt; begin result := DataTable.Fields[idx_ContratosCliente_DetallesVISIBLE].AsSmallInt; diff --git a/Source/Modulos/Contratos de cliente/Model/schContratosClienteServer_Intf.pas b/Source/Modulos/Contratos de cliente/Model/schContratosClienteServer_Intf.pas index 394a8e93..1d41f0aa 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 = '{8CBBCC4D-7331-4B84-AAA3-4BB44C00350D}'; - RID_PropiedadesDelta = '{ABE36068-9C2A-4085-A298-7A30650655AB}'; - RID_ListaAnosContratosDelta = '{A4974C08-1841-49BF-8870-5515D21B8330}'; - RID_ContratosClienteBeneficiosDelta = '{E213F4FC-FC45-4298-BB98-EFCC5BF3A82F}'; - RID_ContratosClienteDelta = '{D5BD987F-847E-4F41-AB14-F13F95A95B72}'; - RID_TiposCapitulosDelta = '{5573FCA2-DCAD-4F1D-BE66-CD8EE363EEF6}'; - RID_ContratosCliente_DetallesDelta = '{6F34F5D3-1DE1-4784-97F6-30522B0CBAC2}'; + RID_ValoresDelta = '{ACD58DAA-F31F-4349-BA59-32F5BB5C3E5E}'; + RID_PropiedadesDelta = '{B5FFFD19-4935-4CB2-8987-1762AC2EDFA6}'; + RID_ListaAnosContratosDelta = '{D47F07C0-6EA3-47C0-9CAE-36FEAE8310C6}'; + RID_ContratosClienteBeneficiosDelta = '{432F7094-684F-436C-8BCF-CEF1FC9C4BA9}'; + RID_ContratosClienteDelta = '{689F7295-72C8-4658-A6B8-CF751A4F8E74}'; + RID_TiposCapitulosDelta = '{3D0913EE-324F-43C6-9F91-30143D154B25}'; + RID_ContratosCliente_DetallesDelta = '{BA05CF81-F011-4DC0-BCD5-065A91F1F4F1}'; type { IValoresDelta } IValoresDelta = interface(IValores) - ['{8CBBCC4D-7331-4B84-AAA3-4BB44C00350D}'] + ['{ACD58DAA-F31F-4349-BA59-32F5BB5C3E5E}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_PROPIEDADValue : Integer; @@ -78,7 +78,7 @@ type { IPropiedadesDelta } IPropiedadesDelta = interface(IPropiedades) - ['{ABE36068-9C2A-4085-A298-7A30650655AB}'] + ['{B5FFFD19-4935-4CB2-8987-1762AC2EDFA6}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldDESCRIPCIONValue : String; @@ -136,7 +136,7 @@ type { IListaAnosContratosDelta } IListaAnosContratosDelta = interface(IListaAnosContratos) - ['{A4974C08-1841-49BF-8870-5515D21B8330}'] + ['{D47F07C0-6EA3-47C0-9CAE-36FEAE8310C6}'] { Property getters and setters } function GetOldANOValue : String; @@ -170,7 +170,7 @@ type { IContratosClienteBeneficiosDelta } IContratosClienteBeneficiosDelta = interface(IContratosClienteBeneficios) - ['{E213F4FC-FC45-4298-BB98-EFCC5BF3A82F}'] + ['{432F7094-684F-436C-8BCF-CEF1FC9C4BA9}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldREFERENCIAValue : String; @@ -324,7 +324,7 @@ type { IContratosClienteDelta } IContratosClienteDelta = interface(IContratosCliente) - ['{D5BD987F-847E-4F41-AB14-F13F95A95B72}'] + ['{689F7295-72C8-4658-A6B8-CF751A4F8E74}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_EMPRESAValue : Integer; @@ -890,7 +890,7 @@ type { ITiposCapitulosDelta } ITiposCapitulosDelta = interface(ITiposCapitulos) - ['{5573FCA2-DCAD-4F1D-BE66-CD8EE363EEF6}'] + ['{3D0913EE-324F-43C6-9F91-30143D154B25}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldPOSICIONValue : Integer; @@ -984,7 +984,7 @@ type { IContratosCliente_DetallesDelta } IContratosCliente_DetallesDelta = interface(IContratosCliente_Detalles) - ['{6F34F5D3-1DE1-4784-97F6-30522B0CBAC2}'] + ['{BA05CF81-F011-4DC0-BCD5-065A91F1F4F1}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_CONTRATOValue : Integer; @@ -995,6 +995,7 @@ type function GetOldCANTIDADValue : Currency; function GetOldIMPORTE_UNIDADValue : Currency; function GetOldIMPORTE_TOTALValue : Currency; + function GetOldVISIBLE2Value : SmallInt; function GetOldVISIBLEValue : SmallInt; function GetOldID_ARTICULOValue : Integer; function GetOldTIPO_ARTICULOValue : String; @@ -1013,6 +1014,7 @@ type property OldCANTIDAD : Currency read GetOldCANTIDADValue; property OldIMPORTE_UNIDAD : Currency read GetOldIMPORTE_UNIDADValue; property OldIMPORTE_TOTAL : Currency read GetOldIMPORTE_TOTALValue; + property OldVISIBLE2 : SmallInt read GetOldVISIBLE2Value; property OldVISIBLE : SmallInt read GetOldVISIBLEValue; property OldID_ARTICULO : Integer read GetOldID_ARTICULOValue; property OldTIPO_ARTICULO : String read GetOldTIPO_ARTICULOValue; @@ -1081,6 +1083,12 @@ type function GetOldIMPORTE_TOTALIsNull: Boolean; virtual; procedure SetIMPORTE_TOTALValue(const aValue: Currency); virtual; procedure SetIMPORTE_TOTALIsNull(const aValue: Boolean); virtual; + function GetVISIBLE2Value: SmallInt; virtual; + function GetVISIBLE2IsNull: Boolean; virtual; + function GetOldVISIBLE2Value: SmallInt; virtual; + function GetOldVISIBLE2IsNull: Boolean; virtual; + procedure SetVISIBLE2Value(const aValue: SmallInt); virtual; + procedure SetVISIBLE2IsNull(const aValue: Boolean); virtual; function GetVISIBLEValue: SmallInt; virtual; function GetVISIBLEIsNull: Boolean; virtual; function GetOldVISIBLEValue: SmallInt; virtual; @@ -1161,6 +1169,10 @@ type property IMPORTE_TOTALIsNull : Boolean read GetIMPORTE_TOTALIsNull write SetIMPORTE_TOTALIsNull; property OldIMPORTE_TOTAL : Currency read GetOldIMPORTE_TOTALValue; property OldIMPORTE_TOTALIsNull : Boolean read GetOldIMPORTE_TOTALIsNull; + property VISIBLE2 : SmallInt read GetVISIBLE2Value write SetVISIBLE2Value; + property VISIBLE2IsNull : Boolean read GetVISIBLE2IsNull write SetVISIBLE2IsNull; + property OldVISIBLE2 : SmallInt read GetOldVISIBLE2Value; + property OldVISIBLE2IsNull : Boolean read GetOldVISIBLE2IsNull; property VISIBLE : SmallInt read GetVISIBLEValue write SetVISIBLEValue; property VISIBLEIsNull : Boolean read GetVISIBLEIsNull write SetVISIBLEIsNull; property OldVISIBLE : SmallInt read GetOldVISIBLEValue; @@ -3728,6 +3740,37 @@ begin BusinessProcessor.CurrentChange.NewValueByName[fld_ContratosCliente_DetallesIMPORTE_TOTAL] := Null; end; +function TContratosCliente_DetallesBusinessProcessorRules.GetVISIBLE2Value: SmallInt; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_ContratosCliente_DetallesVISIBLE2]; +end; + +function TContratosCliente_DetallesBusinessProcessorRules.GetVISIBLE2IsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ContratosCliente_DetallesVISIBLE2]); +end; + +function TContratosCliente_DetallesBusinessProcessorRules.GetOldVISIBLE2Value: SmallInt; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_ContratosCliente_DetallesVISIBLE2]; +end; + +function TContratosCliente_DetallesBusinessProcessorRules.GetOldVISIBLE2IsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ContratosCliente_DetallesVISIBLE2]); +end; + +procedure TContratosCliente_DetallesBusinessProcessorRules.SetVISIBLE2Value(const aValue: SmallInt); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_ContratosCliente_DetallesVISIBLE2] := aValue; +end; + +procedure TContratosCliente_DetallesBusinessProcessorRules.SetVISIBLE2IsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_ContratosCliente_DetallesVISIBLE2] := Null; +end; + function TContratosCliente_DetallesBusinessProcessorRules.GetVISIBLEValue: SmallInt; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ContratosCliente_DetallesVISIBLE]; diff --git a/Source/Modulos/Contratos de cliente/Model/uBizDetallesContratoCliente.pas b/Source/Modulos/Contratos de cliente/Model/uBizDetallesContratoCliente.pas index 6ecc0417..9070ee90 100644 --- a/Source/Modulos/Contratos de cliente/Model/uBizDetallesContratoCliente.pas +++ b/Source/Modulos/Contratos de cliente/Model/uBizDetallesContratoCliente.pas @@ -41,6 +41,7 @@ procedure TBizDetallesContratoCliente.OnNewRecord(Sender: TDADataTable); begin inherited; VISIBLE := 1; + VISIBLE2 := 1; end; initialization diff --git a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm index c5a441f4..fa3f9a00 100644 --- a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm +++ b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm @@ -676,7 +676,7 @@ object RptContratosCliente: TRptContratosCliente item Name = 'ID_PRE_CON' DataType = datInteger - Value = '' + Value = '11' end> Statements = < item @@ -747,6 +747,10 @@ object RptContratosCliente: TRptContratosCliente item DatasetField = 'VISIBLE' TableField = 'VISIBLE' + end + item + DatasetField = 'VISIBLE2' + TableField = 'VISIBLE2' end> end> Name = 'Informe_Capitulos_Detalles' @@ -811,6 +815,10 @@ object RptContratosCliente: TRptContratosCliente Name = 'IMPORTE_TOTAL' DataType = datCurrency end + item + Name = 'VISIBLE2' + DataType = datSmallInt + end item Name = 'VISIBLE' DataType = datSmallInt @@ -1027,7 +1035,7 @@ object RptContratosCliente: TRptContratosCliente PrintOptions.Printer = 'Por defecto' PrintOptions.PrintOnSheet = 0 ReportOptions.CreateDate = 39065.872423495400000000 - ReportOptions.LastChange = 41081.761483032410000000 + ReportOptions.LastChange = 41157.903052835650000000 ScriptLanguage = 'PascalScript' ShowProgress = False StoreInDFM = False @@ -1690,6 +1698,10 @@ object RptContratosCliente: TRptContratosCliente item Name = 'VISIBLE' DataType = datSmallInt + end + item + Name = 'VISIBLE2' + DataType = datSmallInt end> Params = < item diff --git a/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.dfm b/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.dfm index 282dcb72..cc7be6f8 100644 --- a/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.dfm +++ b/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.dfm @@ -763,15 +763,15 @@ object srvContratosCliente: TsrvContratosCliente 'ES.PROPIEDAD, CONTRATOS_CLIENTE_DETALLES.CONCEPTO, CONTRATOS_CLI' + 'ENTE_DETALLES.CANTIDAD,'#10' CONTRATOS_CLIENTE_DETALLES.IMPORTE_U' + 'NIDAD, CONTRATOS_CLIENTE_DETALLES.IMPORTE_TOTAL,'#10' CONTRATOS_C' + - 'LIENTE_DETALLES.VISIBLE,'#10#10' CONTRATOS_CLIENTE_DETALLES.ID_ARTI' + - 'CULO, CONTRATOS_CLIENTE_DETALLES.TIPO_ARTICULO,'#10' CONTRATOS_CL' + - 'IENTE_DETALLES.DESCUENTO,'#10' CONTRATOS_CLIENTE_DETALLES.IMPORTE' + - '_PORTE, ARTICULOS.REFERENCIA,'#10' '#39#39' as REFERENCIA_PROVEEDOR /*E' + - 's necesario para que no fallen los detalles porque los detalles ' + - 'son comunes para la rama de cliente y de proveedor*/'#10#10'FROM CONTR' + - 'ATOS_CLIENTE_DETALLES'#10'LEFT JOIN ARTICULOS ON CONTRATOS_CLIENTE_D' + - 'ETALLES.ID_ARTICULO = ARTICULOS.ID'#10'where {where}'#10'ORDER BY POSICI' + - 'ON;'#10#10#10#10 + 'LIENTE_DETALLES.VISIBLE, CONTRATOS_CLIENTE_DETALLES.VISIBLE2,'#10#10' ' + + ' CONTRATOS_CLIENTE_DETALLES.ID_ARTICULO, CONTRATOS_CLIENTE_DET' + + 'ALLES.TIPO_ARTICULO,'#10' CONTRATOS_CLIENTE_DETALLES.DESCUENTO,'#10' ' + + ' CONTRATOS_CLIENTE_DETALLES.IMPORTE_PORTE, ARTICULOS.REFERENCI' + + 'A,'#10' '#39#39' as REFERENCIA_PROVEEDOR /*Es necesario para que no fal' + + 'len los detalles porque los detalles son comunes para la rama de' + + ' cliente y de proveedor*/'#10#10'FROM CONTRATOS_CLIENTE_DETALLES'#10'LEFT ' + + 'JOIN ARTICULOS ON CONTRATOS_CLIENTE_DETALLES.ID_ARTICULO = ARTIC' + + 'ULOS.ID'#10'where {where}'#10'ORDER BY POSICION;'#10#10#10#10 StatementType = stSQL ColumnMappings = < item @@ -839,6 +839,10 @@ object srvContratosCliente: TsrvContratosCliente DatasetField = 'REFERENCIA' TableField = '' SQLOrigin = 'REFERENCIA' + end + item + DatasetField = 'VISIBLE2' + TableField = 'VISIBLE2' end> end> Name = 'ContratosCliente_Detalles' @@ -884,6 +888,10 @@ object srvContratosCliente: TsrvContratosCliente Name = 'IMPORTE_TOTAL' DataType = datCurrency end + item + Name = 'VISIBLE2' + DataType = datSmallInt + end item Name = 'VISIBLE' DataType = datSmallInt @@ -1456,6 +1464,11 @@ object srvContratosCliente: TsrvContratosCliente DataType = datSmallInt Value = '' end + item + Name = 'VISIBLE2' + DataType = datSmallInt + Value = '' + end item Name = 'ID_ARTICULO' DataType = datInteger @@ -1485,12 +1498,12 @@ object srvContratosCliente: TsrvContratosCliente SQL = 'INSERT'#10' INTO CONTRATOS_CLIENTE_DETALLES'#10' (ID, ID_CONTRATO, P' + 'OSICION, TIPO_DETALLE, PROPIEDAD, CONCEPTO, CANTIDAD,'#10' IMPOR' + - 'TE_UNIDAD, IMPORTE_TOTAL, VISIBLE, ID_ARTICULO, TIPO_ARTICULO,'#10' ' + - ' DESCUENTO, IMPORTE_PORTE, FECHA_ALTA)'#10' VALUES'#10' (:ID, :ID' + - '_CONTRATO, :POSICION, :TIPO_DETALLE, :PROPIEDAD, :CONCEPTO,'#10' ' + - ' :CANTIDAD, :IMPORTE_UNIDAD, :IMPORTE_TOTAL, :VISIBLE,'#10' :ID_' + - 'ARTICULO, :TIPO_ARTICULO, :DESCUENTO, :IMPORTE_PORTE, CURRENT_TI' + - 'MESTAMP)'#10 + 'TE_UNIDAD, IMPORTE_TOTAL, VISIBLE, VISIBLE2, ID_ARTICULO, TIPO_A' + + 'RTICULO,'#10' DESCUENTO, IMPORTE_PORTE, FECHA_ALTA)'#10' VALUES'#10' ' + + ' (:ID, :ID_CONTRATO, :POSICION, :TIPO_DETALLE, :PROPIEDAD, :CONC' + + 'EPTO,'#10' :CANTIDAD, :IMPORTE_UNIDAD, :IMPORTE_TOTAL, :VISIBLE,' + + ' :VISIBLE2,'#10' :ID_ARTICULO, :TIPO_ARTICULO, :DESCUENTO, :IMPO' + + 'RTE_PORTE, CURRENT_TIMESTAMP)'#10 StatementType = stSQL ColumnMappings = <> end> @@ -1520,7 +1533,8 @@ object srvContratosCliente: TsrvContratosCliente Params = < item Name = 'ID' - DataType = datInteger + DataType = datAutoInc + GeneratorName = 'GEN_CONTRATOS_CLI_DETALLE_ID' Value = '' end item @@ -1571,6 +1585,11 @@ object srvContratosCliente: TsrvContratosCliente DataType = datSmallInt Value = '' end + item + Name = 'VISIBLE2' + DataType = datSmallInt + Value = '' + end item Name = 'ID_ARTICULO' DataType = datInteger @@ -1607,10 +1626,10 @@ object srvContratosCliente: TsrvContratosCliente 'LE = :TIPO_DETALLE,'#10' PROPIEDAD = :PROPIEDAD,'#10' CONCEPTO = :' + 'CONCEPTO, '#10' CANTIDAD = :CANTIDAD, '#10' IMPORTE_UNIDAD = :IMPO' + 'RTE_UNIDAD,'#10' IMPORTE_TOTAL = :IMPORTE_TOTAL, '#10' VISIBLE = :' + - 'VISIBLE, '#10' ID_ARTICULO = :ID_ARTICULO, '#10' TIPO_ARTICULO = :' + - 'TIPO_ARTICULO,'#10' DESCUENTO = :DESCUENTO, '#10' IMPORTE_PORTE = ' + - ':IMPORTE_PORTE,'#10' FECHA_MODIFICACION = CURRENT_TIMESTAMP'#10' WHE' + - 'RE'#10' (ID = :OLD_ID)'#10 + 'VISIBLE, '#10' VISIBLE2 = :VISIBLE2,'#10' ID_ARTICULO = :ID_ARTICU' + + 'LO, '#10' TIPO_ARTICULO = :TIPO_ARTICULO,'#10' DESCUENTO = :DESCUE' + + 'NTO, '#10' IMPORTE_PORTE = :IMPORTE_PORTE,'#10' FECHA_MODIFICACION' + + ' = CURRENT_TIMESTAMP'#10' WHERE'#10' (ID = :OLD_ID)'#10 StatementType = stSQL ColumnMappings = <> end> diff --git a/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.dfm b/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.dfm index 20eb87f8..9a916038 100644 --- a/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.dfm +++ b/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.dfm @@ -211,9 +211,15 @@ inherited fEditorContratoCliente: TfEditorContratoCliente Height = 24 ExplicitWidth = 831 ExplicitHeight = 24 - inherited ToolButton14: TToolButton + inherited ToolButton4: TToolButton Wrap = False end + inherited ToolButton14: TToolButton + Left = 334 + Top = 0 + ExplicitLeft = 334 + ExplicitTop = 0 + end inherited FontName: TJvFontComboBox Left = 368 Top = 0 @@ -297,7 +303,7 @@ inherited fEditorContratoCliente: TfEditorContratoCliente ExplicitTop = 24 ExplicitWidth = 831 inherited TBXToolbar1: TTBXToolbar - ExplicitWidth = 665 + ExplicitWidth = 663 end end inherited cxLookupComboBox1: TcxLookupComboBox diff --git a/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.pas b/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.pas index 6ef92e85..5f6e2f18 100644 --- a/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.pas +++ b/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.pas @@ -264,7 +264,7 @@ begin inherited; ShowHourglassCursor; -// frViewDetallesContratoCliente1.SaveGridStatus; + frViewDetallesContratoCliente1.SaveGridStatus; frViewDetallesContratoCliente1.BeginUpdate; try bEsNuevo := FContrato.EsNuevo; @@ -274,7 +274,7 @@ begin finally frViewDetallesContratoCliente1.EndUpdate; -// frViewDetallesContratoCliente1.RestoreGridStatus; + frViewDetallesContratoCliente1.RestoreGridStatus; HideHourglassCursor; end; if bEsNuevo then diff --git a/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm b/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm index d7a990de..a64f6c2b 100644 --- a/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm +++ b/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm @@ -9,45 +9,49 @@ inherited frViewDetallesContratoCliente: TfrViewDetallesContratoCliente Visible = False VisibleForCustomization = False end - inherited cxGridViewVISIBLE: TcxGridDBColumn [5] + inherited cxGridViewVISIBLE2: TcxGridDBColumn [5] Visible = True end - object cxGridViewPROPIEDAD: TcxGridDBColumn [6] + inherited cxGridViewVISIBLE: TcxGridDBColumn [6] + Caption = #191'Valorado?' + Visible = True + end + object cxGridViewPROPIEDAD: TcxGridDBColumn [7] Caption = 'Propiedad' DataBinding.FieldName = 'PROPIEDAD' PropertiesClassName = 'TcxRichEditProperties' OnGetPropertiesForEdit = cxGridViewPROPIEDADGetPropertiesForEdit Width = 138 end - inherited cxGridViewREFERENCIA: TcxGridDBColumn [7] + inherited cxGridViewREFERENCIA: TcxGridDBColumn [8] end - inherited cxGridViewREFERENCIA_PROVEEDOR: TcxGridDBColumn [8] + inherited cxGridViewREFERENCIA_PROVEEDOR: TcxGridDBColumn [9] DataBinding.FieldName = '' end - inherited cxGridViewDESCRIPCION: TcxGridDBColumn [9] + inherited cxGridViewDESCRIPCION: TcxGridDBColumn [10] OnGetPropertiesForEdit = cxGridViewDESCRIPCIONGetPropertiesForEdit Width = 186 end - inherited cxGridViewCANTIDAD: TcxGridDBColumn [10] + inherited cxGridViewCANTIDAD: TcxGridDBColumn [11] VisibleForCustomization = False Width = 20 end - inherited cxGridViewIMPORTEUNIDAD: TcxGridDBColumn [11] + inherited cxGridViewIMPORTEUNIDAD: TcxGridDBColumn [12] VisibleForCustomization = False Width = 26 end - inherited cxGridViewDESCUENTO: TcxGridDBColumn [12] + inherited cxGridViewDESCUENTO: TcxGridDBColumn [13] VisibleForCustomization = False Width = 20 end - inherited cxGridViewIMPORTENETO: TcxGridDBColumn [13] + inherited cxGridViewIMPORTENETO: TcxGridDBColumn [14] Visible = False VisibleForCustomization = False Width = 29 end - inherited cxGridViewIMPORTEPORTE: TcxGridDBColumn [14] + inherited cxGridViewIMPORTEPORTE: TcxGridDBColumn [15] end - inherited cxGridViewIMPORTETOTAL: TcxGridDBColumn [15] + inherited cxGridViewIMPORTETOTAL: TcxGridDBColumn [16] VisibleForCustomization = False Width = 22 end @@ -112,10 +116,13 @@ inherited frViewDetallesContratoCliente: TfrViewDetallesContratoCliente Properties.KeyFieldNames = 'DESCRIPCION' Properties.ListColumns = < item + SortOrder = soAscending FieldName = 'DESCRIPCION' end> Properties.ListOptions.ShowHeader = False + Properties.ListOptions.SyncMode = True Properties.ListSource = DAValores + Properties.OnEditValueChanged = cxLookupComboBox1PropertiesEditValueChanged Style.Font.Charset = DEFAULT_CHARSET Style.Font.Color = clWindowText Style.Font.Height = -13 diff --git a/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.pas b/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.pas index 51cd51c7..9f6f5d90 100644 --- a/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.pas +++ b/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.pas @@ -76,9 +76,11 @@ type procedure OnVISIBLEPropertiesEditValueChanged(Sender: TObject); procedure CustomViewDestroy(Sender: TObject); procedure actCapituloObraExecute(Sender: TObject); + procedure cxLookupComboBox1PropertiesEditValueChanged(Sender: TObject); private procedure AnadirCapitulo(const Tipo: String;const Descripcion: String; const Descuento:Boolean = false); + procedure OnVISIBLE2PropertiesEditValueChanged(Sender: TObject); protected FContrato: IBizContratoCliente; @@ -99,8 +101,9 @@ type implementation {$R *.dfm} -uses uControllerDetallesBase, uDetallesContratoClienteController, schContratosClienteClient_Intf, -uDetallesPresupuestoClienteController, +uses +uControllerDetallesBase, uDetallesContratoClienteController, schContratosClienteClient_Intf, +uDetallesPresupuestoClienteController, cxVariants, cxDataUtils, uCalculosUtils; { TfrViewDetallesContratoProveedor } @@ -248,6 +251,7 @@ end; procedure TfrViewDetallesContratoCliente.CustomViewDestroy(Sender: TObject); begin cxGridViewVISIBLE.Properties.OnEditValueChanged := Nil; + cxGridViewVISIBLE2.Properties.OnEditValueChanged := Nil; inherited; end; @@ -260,7 +264,8 @@ begin FPropiedades.DataTable.Active := True; DAPropiedades.DataTable := FPropiedades.DataTable; DAValores.DataTable := FPropiedades.Valores.DataTable; - cxGridViewVISIBLE.Properties.OnEditValueChanged := OnVISIBLEPropertiesEditValueChanged; + cxGridViewVISIBLE.Properties.OnEditValueChanged := OnVISIBLEPropertiesEditValueChanged; + cxGridViewVISIBLE2.Properties.OnEditValueChanged := OnVISIBLE2PropertiesEditValueChanged; end; end; @@ -275,9 +280,12 @@ begin if (ARecord.DisplayTexts[cxGridViewTIPO.Index] = TIPO_DETALLE_CONCEPTO) and (ARecord.DisplayTexts[cxGridViewPROPIEDAD.Index] <> '') then + begin AProperties := cxLookupComboBox1.Properties - else + end + else begin AProperties := cxRichEdit1.Properties; + end; end; procedure TfrViewDetallesContratoCliente.cxGridViewPROPIEDADGetPropertiesForEdit( @@ -286,13 +294,32 @@ procedure TfrViewDetallesContratoCliente.cxGridViewPROPIEDADGetPropertiesForEdit begin inherited; - if (ARecord.DisplayTexts[cxGridViewTIPO.Index] = TIPO_DETALLE_CONCEPTO) - then + if (ARecord.DisplayTexts[cxGridViewTIPO.Index] = TIPO_DETALLE_CONCEPTO) then + begin AProperties := cxLookupComboBox2.Properties + end else AProperties := cxRichEdit1.Properties; end; +procedure TfrViewDetallesContratoCliente.cxLookupComboBox1PropertiesEditValueChanged( + Sender: TObject); +var + AEdit: TcxCustomEdit; + AValue: Variant; +begin + inherited; + AEdit := Sender as TcxCustomEdit; + + if (AEdit.EditValue = DAValores.DataTable.FieldByName('DESCRIPCION').AsString) then + begin + AValue := DAValores.DataTable.FieldByName('PRECIO_PVP').Value; + AEdit.PostEditValue; // To 'stick' the new value in the active cell + cxGridView.DataController.SetEditValue(cxGridViewIMPORTEUNIDAD.Index, AValue, evsValue); + Controller.actualizarTotales(Detalles); + end; +end; + function TfrViewDetallesContratoCliente.EsTipoEditable(AItem: TcxCustomGridTableItem): Boolean; var IndiceCol : Integer; @@ -335,6 +362,26 @@ begin Result := FContrato; end; +procedure TfrViewDetallesContratoCliente.OnVISIBLE2PropertiesEditValueChanged(Sender: TObject); +var + Orden: Integer; +begin + inherited; + Orden := 1; + if (cxGridView.DataController.GetItemByFieldName(CAMPO_TIPO).EditValue = TIPO_DETALLE_TITULO) + or (cxGridView.DataController.GetItemByFieldName(CAMPO_TIPO).EditValue = TIPO_DETALLE_TITULO_OPCIONAL) + or (cxGridView.DataController.GetItemByFieldName(CAMPO_TIPO).EditValue = TIPO_DETALLE_SUBTOTAL) then + begin + cxGridView.BeginUpdate; + + if (cxGridView.DataController.GetItemByFieldName(CAMPO_TIPO).EditValue = TIPO_DETALLE_SUBTOTAL) then + Orden := 0; + (Controller as IDetallesContratoClienteController).SetVisible2(Detalles, cxGridView.DataController.GetItemByFieldName(CAMPO_VISIBLE2).EditValue, Orden); + + cxGridView.EndUpdate; + end; +end; + procedure TfrViewDetallesContratoCliente.OnVISIBLEPropertiesEditValueChanged(Sender: TObject); var Orden: Integer; diff --git a/Source/Modulos/Presupuestos de cliente/Controller/uDetallesPresupuestoClienteController.pas b/Source/Modulos/Presupuestos de cliente/Controller/uDetallesPresupuestoClienteController.pas index fff840a3..e68844d7 100644 --- a/Source/Modulos/Presupuestos de cliente/Controller/uDetallesPresupuestoClienteController.pas +++ b/Source/Modulos/Presupuestos de cliente/Controller/uDetallesPresupuestoClienteController.pas @@ -19,7 +19,8 @@ type procedure AnadirCapitulo (const Tipo: String; const Descripcion: String; const Descuento:Boolean; ADetalles: IDAStronglyTypedDataTable); function BuscarCapitulo (const Tipo: String): IBizCapitulo; procedure SetTipoArticulo(ADetalles: IDAStronglyTypedDataTable; ATipo: String); - procedure SetVisible(ADetalles: IDAStronglyTypedDataTable;const AVisible: Integer;const Orden: Integer); //1Ascendente/0Descendente + procedure SetVisible(ADetalles: IDAStronglyTypedDataTable;const AVisible: Integer;const Orden: Integer); //1Ascendente/0Descendente + procedure SetVisible2(ADetalles: IDAStronglyTypedDataTable;const AVisible: Integer;const Orden: Integer); end; TDetallesPresupuestoClienteController = class(TControllerDetallesArticulos, IDetallesPresupuestoClienteController) @@ -56,6 +57,7 @@ type procedure SetTipoArticulo(ADetalles: IDAStronglyTypedDataTable; ATipo: String); procedure SetVisible(ADetalles: IDAStronglyTypedDataTable;const AVisible: Integer;const Orden: Integer); //1Ascendente/0Descendente + procedure SetVisible2(ADetalles: IDAStronglyTypedDataTable;const AVisible: Integer;const Orden: Integer); end; implementation @@ -295,6 +297,45 @@ begin end; end; +procedure TDetallesPresupuestoClienteController.SetVisible2( + ADetalles: IDAStronglyTypedDataTable; const AVisible, Orden: Integer); +var + ABookmark : TBookmark; + AuxPosicion: Integer; + AuxEncontrado: Boolean; +begin + AuxPosicion := ADetalles.DataTable.FieldByName(CAMPO_POSICION).AsInteger; + + ABookmark := ADetalles.DataTable.GetBookMark; + try + ADetalles.DataTable.DisableControls; + + repeat + if (Orden > 0) then + Inc(AuxPosicion) + else + Dec(AuxPosicion); + + ADetalles.First; + AuxEncontrado := ADetalles.Locate(CAMPO_POSICION, AuxPosicion, []); + if AuxEncontrado then + begin + ADetalles.DataTable.Edit; + ADetalles.DataTable.FieldByName(CAMPO_VISIBLE2).AsInteger := AVisible; + ADetalles.DataTable.Post; + end; + until (ADetalles.DataTable.FieldByName(CAMPO_TIPO).AsString = TIPO_DETALLE_SUBTOTAL) + or (ADetalles.DataTable.FieldByName(CAMPO_TIPO).AsString = TIPO_DETALLE_TITULO) + or (ADetalles.DataTable.FieldByName(CAMPO_TIPO).AsString = TIPO_DETALLE_TITULO_OPCIONAL) + or (AuxEncontrado = False) + + finally + ADetalles.DataTable.GotoBookmark(ABookmark); + ADetalles.DataTable.FreeBookmark(ABookmark); + ADetalles.DataTable.EnableControls; + end; +end; + procedure TDetallesPresupuestoClienteController.ValidarCampos(DataTable: TDADataTable); begin inherited; diff --git a/Source/Modulos/Presupuestos de cliente/Data/uDataModulePresupuestosCliente.dfm b/Source/Modulos/Presupuestos de cliente/Data/uDataModulePresupuestosCliente.dfm index b9559491..17f860de 100644 --- a/Source/Modulos/Presupuestos de cliente/Data/uDataModulePresupuestosCliente.dfm +++ b/Source/Modulos/Presupuestos de cliente/Data/uDataModulePresupuestosCliente.dfm @@ -314,9 +314,15 @@ inherited DataModulePresupuestosCliente: TDataModulePresupuestosCliente Name = 'IMPORTE_TOTAL' DataType = datCurrency end + item + Name = 'VISIBLE2' + DataType = datSmallInt + DisplayLabel = #191'Visible?' + end item Name = 'VISIBLE' DataType = datSmallInt + DisplayLabel = #191'Valorado?' end item Name = 'ID_ARTICULO' @@ -425,8 +431,6 @@ inherited DataModulePresupuestosCliente: TDataModulePresupuestosCliente item Name = 'ID' DataType = datInteger - Required = True - InPrimaryKey = True end item Name = 'ID_EMPRESA' @@ -436,16 +440,29 @@ inherited DataModulePresupuestosCliente: TDataModulePresupuestosCliente Name = 'REFERENCIA' DataType = datString Size = 255 + DisplayLabel = 'Referencia' end item Name = 'DESCRIPCION' DataType = datString Size = 255 + DisplayLabel = 'Descripci'#243'n' end item Name = 'FAMILIA' DataType = datString Size = 255 + DisplayLabel = 'Familia' + end + item + Name = 'PRECIO_COSTE' + DataType = datCurrency + DisplayLabel = 'Precio de coste' + end + item + Name = 'PRECIO_PVP' + DataType = datCurrency + DisplayLabel = 'Precio PVP' end> Params = <> MasterMappingMode = mmWhere diff --git a/Source/Modulos/Presupuestos de cliente/Model/PresupuestosCliente_model.dproj b/Source/Modulos/Presupuestos de cliente/Model/PresupuestosCliente_model.dproj index b303edca..2605e967 100644 --- a/Source/Modulos/Presupuestos de cliente/Model/PresupuestosCliente_model.dproj +++ b/Source/Modulos/Presupuestos de cliente/Model/PresupuestosCliente_model.dproj @@ -43,10 +43,6 @@ Package FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0 - - - - RemObjects Pascal Script - RemObjects SDK 3.0 Integration EurekaLog 5.1.9 PresupuestosCliente_model.dpk diff --git a/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteClient_Intf.pas b/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteClient_Intf.pas index 65324cc3..50a3ae3e 100644 --- a/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteClient_Intf.pas +++ b/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteClient_Intf.pas @@ -9,12 +9,12 @@ 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 = '{6348B4C1-5922-413E-9A20-13FACB52DC4D}'; - RID_Propiedades = '{FA67BDBC-F85D-4E3D-B403-7AC43AF007F3}'; - RID_ListaAnosPresupuestos = '{9CE1B82B-66E8-498E-9559-105748B1B8D0}'; - RID_PresupuestosCliente = '{13CE35AE-8D8D-488C-8C8D-70063B48C2C5}'; - RID_CapitulosPresupuesto = '{25C8A50F-E9A5-478E-A825-DF6332C457C2}'; - RID_PresupuestosCliente_Detalles = '{128B9C7B-1A51-4571-8948-A8D1201FF20A}'; + RID_Valores = '{01240DD5-A0EB-453D-82E2-811190BCCCB0}'; + RID_Propiedades = '{84FE1A88-2F78-4428-8BE5-AB6823809F69}'; + RID_ListaAnosPresupuestos = '{F179C1AE-48C3-4E76-87FB-6BB6AA0B9953}'; + RID_PresupuestosCliente = '{7C99E973-7D22-467E-B0D2-232A872F4AD0}'; + RID_CapitulosPresupuesto = '{96502DDF-3960-4105-B99D-D1F12570194E}'; + RID_PresupuestosCliente_Detalles = '{E263EC66-1B4A-4341-B7EF-18026268971D}'; { Data table names } nme_Valores = 'Valores'; @@ -30,6 +30,8 @@ const fld_ValoresREFERENCIA = 'REFERENCIA'; fld_ValoresDESCRIPCION = 'DESCRIPCION'; fld_ValoresFAMILIA = 'FAMILIA'; + fld_ValoresPRECIO_COSTE = 'PRECIO_COSTE'; + fld_ValoresPRECIO_PVP = 'PRECIO_PVP'; { Valores field indexes } idx_ValoresID = 0; @@ -37,6 +39,8 @@ const idx_ValoresREFERENCIA = 2; idx_ValoresDESCRIPCION = 3; idx_ValoresFAMILIA = 4; + idx_ValoresPRECIO_COSTE = 5; + idx_ValoresPRECIO_PVP = 6; { Propiedades fields } fld_PropiedadesID = 'ID'; @@ -174,6 +178,7 @@ const fld_PresupuestosCliente_DetallesCANTIDAD = 'CANTIDAD'; fld_PresupuestosCliente_DetallesIMPORTE_UNIDAD = 'IMPORTE_UNIDAD'; fld_PresupuestosCliente_DetallesIMPORTE_TOTAL = 'IMPORTE_TOTAL'; + fld_PresupuestosCliente_DetallesVISIBLE2 = 'VISIBLE2'; fld_PresupuestosCliente_DetallesVISIBLE = 'VISIBLE'; fld_PresupuestosCliente_DetallesID_ARTICULO = 'ID_ARTICULO'; fld_PresupuestosCliente_DetallesTIPO_ARTICULO = 'TIPO_ARTICULO'; @@ -192,18 +197,19 @@ const idx_PresupuestosCliente_DetallesCANTIDAD = 6; idx_PresupuestosCliente_DetallesIMPORTE_UNIDAD = 7; idx_PresupuestosCliente_DetallesIMPORTE_TOTAL = 8; - idx_PresupuestosCliente_DetallesVISIBLE = 9; - idx_PresupuestosCliente_DetallesID_ARTICULO = 10; - idx_PresupuestosCliente_DetallesTIPO_ARTICULO = 11; - idx_PresupuestosCliente_DetallesDESCUENTO = 12; - idx_PresupuestosCliente_DetallesIMPORTE_PORTE = 13; - idx_PresupuestosCliente_DetallesREFERENCIA = 14; - idx_PresupuestosCliente_DetallesREFERENCIA_PROVEEDOR = 15; + idx_PresupuestosCliente_DetallesVISIBLE2 = 9; + idx_PresupuestosCliente_DetallesVISIBLE = 10; + idx_PresupuestosCliente_DetallesID_ARTICULO = 11; + idx_PresupuestosCliente_DetallesTIPO_ARTICULO = 12; + idx_PresupuestosCliente_DetallesDESCUENTO = 13; + idx_PresupuestosCliente_DetallesIMPORTE_PORTE = 14; + idx_PresupuestosCliente_DetallesREFERENCIA = 15; + idx_PresupuestosCliente_DetallesREFERENCIA_PROVEEDOR = 16; type { IValores } IValores = interface(IDAStronglyTypedDataTable) - ['{AA0C40BF-2339-4326-9A5E-EEE260CADC74}'] + ['{C10745AB-25B0-4C44-B0F9-6FB4D71D3575}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -225,6 +231,14 @@ type procedure SetFAMILIAValue(const aValue: String); function GetFAMILIAIsNull: Boolean; procedure SetFAMILIAIsNull(const aValue: Boolean); + function GetPRECIO_COSTEValue: Currency; + procedure SetPRECIO_COSTEValue(const aValue: Currency); + function GetPRECIO_COSTEIsNull: Boolean; + procedure SetPRECIO_COSTEIsNull(const aValue: Boolean); + function GetPRECIO_PVPValue: Currency; + procedure SetPRECIO_PVPValue(const aValue: Currency); + function GetPRECIO_PVPIsNull: Boolean; + procedure SetPRECIO_PVPIsNull(const aValue: Boolean); { Properties } @@ -238,6 +252,10 @@ type property DESCRIPCIONIsNull: Boolean read GetDESCRIPCIONIsNull write SetDESCRIPCIONIsNull; property FAMILIA: String read GetFAMILIAValue write SetFAMILIAValue; property FAMILIAIsNull: Boolean read GetFAMILIAIsNull write SetFAMILIAIsNull; + property PRECIO_COSTE: Currency read GetPRECIO_COSTEValue write SetPRECIO_COSTEValue; + property PRECIO_COSTEIsNull: Boolean read GetPRECIO_COSTEIsNull write SetPRECIO_COSTEIsNull; + property PRECIO_PVP: Currency read GetPRECIO_PVPValue write SetPRECIO_PVPValue; + property PRECIO_PVPIsNull: Boolean read GetPRECIO_PVPIsNull write SetPRECIO_PVPIsNull; end; { TValoresDataTableRules } @@ -265,6 +283,14 @@ type procedure SetFAMILIAValue(const aValue: String); virtual; function GetFAMILIAIsNull: Boolean; virtual; procedure SetFAMILIAIsNull(const aValue: Boolean); virtual; + function GetPRECIO_COSTEValue: Currency; virtual; + procedure SetPRECIO_COSTEValue(const aValue: Currency); virtual; + function GetPRECIO_COSTEIsNull: Boolean; virtual; + procedure SetPRECIO_COSTEIsNull(const aValue: Boolean); virtual; + function GetPRECIO_PVPValue: Currency; virtual; + procedure SetPRECIO_PVPValue(const aValue: Currency); virtual; + function GetPRECIO_PVPIsNull: Boolean; virtual; + procedure SetPRECIO_PVPIsNull(const aValue: Boolean); virtual; { Properties } property ID: Integer read GetIDValue write SetIDValue; @@ -277,6 +303,10 @@ type property DESCRIPCIONIsNull: Boolean read GetDESCRIPCIONIsNull write SetDESCRIPCIONIsNull; property FAMILIA: String read GetFAMILIAValue write SetFAMILIAValue; property FAMILIAIsNull: Boolean read GetFAMILIAIsNull write SetFAMILIAIsNull; + property PRECIO_COSTE: Currency read GetPRECIO_COSTEValue write SetPRECIO_COSTEValue; + property PRECIO_COSTEIsNull: Boolean read GetPRECIO_COSTEIsNull write SetPRECIO_COSTEIsNull; + property PRECIO_PVP: Currency read GetPRECIO_PVPValue write SetPRECIO_PVPValue; + property PRECIO_PVPIsNull: Boolean read GetPRECIO_PVPIsNull write SetPRECIO_PVPIsNull; public constructor Create(aDataTable: TDADataTable); override; @@ -286,7 +316,7 @@ type { IPropiedades } IPropiedades = interface(IDAStronglyTypedDataTable) - ['{EA75AD60-D801-4B85-B0EF-6ED926A30B2A}'] + ['{58959861-2906-481E-9128-89F3C54D24D4}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -333,7 +363,7 @@ type { IListaAnosPresupuestos } IListaAnosPresupuestos = interface(IDAStronglyTypedDataTable) - ['{282E6250-DA69-4658-A522-A54C6A1705CE}'] + ['{8C8359FD-8B9C-40FB-AAA7-F99D251D6EBA}'] { Property getters and setters } function GetANOValue: String; procedure SetANOValue(const aValue: String); @@ -368,7 +398,7 @@ type { IPresupuestosCliente } IPresupuestosCliente = interface(IDAStronglyTypedDataTable) - ['{D998C033-F1BC-4A07-B2ED-AF2753438192}'] + ['{24023A22-7BF2-416E-AD04-A496E6F9E4C1}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -883,7 +913,7 @@ type { ICapitulosPresupuesto } ICapitulosPresupuesto = interface(IDAStronglyTypedDataTable) - ['{311247FA-7E4E-4B5A-AC81-6E596ADD47B8}'] + ['{CC4491CC-4270-451B-9120-A6DBEF668324}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -1038,7 +1068,7 @@ type { IPresupuestosCliente_Detalles } IPresupuestosCliente_Detalles = interface(IDAStronglyTypedDataTable) - ['{1C2C32E6-33C3-4D21-A13B-AD25078DC360}'] + ['{A94CE8DD-1625-4372-8F27-2F2D25DB2912}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -1076,6 +1106,10 @@ type procedure SetIMPORTE_TOTALValue(const aValue: Currency); function GetIMPORTE_TOTALIsNull: Boolean; procedure SetIMPORTE_TOTALIsNull(const aValue: Boolean); + function GetVISIBLE2Value: SmallInt; + procedure SetVISIBLE2Value(const aValue: SmallInt); + function GetVISIBLE2IsNull: Boolean; + procedure SetVISIBLE2IsNull(const aValue: Boolean); function GetVISIBLEValue: SmallInt; procedure SetVISIBLEValue(const aValue: SmallInt); function GetVISIBLEIsNull: Boolean; @@ -1125,6 +1159,8 @@ type property IMPORTE_UNIDADIsNull: Boolean read GetIMPORTE_UNIDADIsNull write SetIMPORTE_UNIDADIsNull; property IMPORTE_TOTAL: Currency read GetIMPORTE_TOTALValue write SetIMPORTE_TOTALValue; property IMPORTE_TOTALIsNull: Boolean read GetIMPORTE_TOTALIsNull write SetIMPORTE_TOTALIsNull; + property VISIBLE2: SmallInt read GetVISIBLE2Value write SetVISIBLE2Value; + property VISIBLE2IsNull: Boolean read GetVISIBLE2IsNull write SetVISIBLE2IsNull; property VISIBLE: SmallInt read GetVISIBLEValue write SetVISIBLEValue; property VISIBLEIsNull: Boolean read GetVISIBLEIsNull write SetVISIBLEIsNull; property ID_ARTICULO: Integer read GetID_ARTICULOValue write SetID_ARTICULOValue; @@ -1182,6 +1218,10 @@ type procedure SetIMPORTE_TOTALValue(const aValue: Currency); virtual; function GetIMPORTE_TOTALIsNull: Boolean; virtual; procedure SetIMPORTE_TOTALIsNull(const aValue: Boolean); virtual; + function GetVISIBLE2Value: SmallInt; virtual; + procedure SetVISIBLE2Value(const aValue: SmallInt); virtual; + function GetVISIBLE2IsNull: Boolean; virtual; + procedure SetVISIBLE2IsNull(const aValue: Boolean); virtual; function GetVISIBLEValue: SmallInt; virtual; procedure SetVISIBLEValue(const aValue: SmallInt); virtual; function GetVISIBLEIsNull: Boolean; virtual; @@ -1230,6 +1270,8 @@ type property IMPORTE_UNIDADIsNull: Boolean read GetIMPORTE_UNIDADIsNull write SetIMPORTE_UNIDADIsNull; property IMPORTE_TOTAL: Currency read GetIMPORTE_TOTALValue write SetIMPORTE_TOTALValue; property IMPORTE_TOTALIsNull: Boolean read GetIMPORTE_TOTALIsNull write SetIMPORTE_TOTALIsNull; + property VISIBLE2: SmallInt read GetVISIBLE2Value write SetVISIBLE2Value; + property VISIBLE2IsNull: Boolean read GetVISIBLE2IsNull write SetVISIBLE2IsNull; property VISIBLE: SmallInt read GetVISIBLEValue write SetVISIBLEValue; property VISIBLEIsNull: Boolean read GetVISIBLEIsNull write SetVISIBLEIsNull; property ID_ARTICULO: Integer read GetID_ARTICULOValue write SetID_ARTICULOValue; @@ -1371,6 +1413,48 @@ begin DataTable.Fields[idx_ValoresFAMILIA].AsVariant := Null; end; +function TValoresDataTableRules.GetPRECIO_COSTEValue: Currency; +begin + result := DataTable.Fields[idx_ValoresPRECIO_COSTE].AsCurrency; +end; + +procedure TValoresDataTableRules.SetPRECIO_COSTEValue(const aValue: Currency); +begin + DataTable.Fields[idx_ValoresPRECIO_COSTE].AsCurrency := aValue; +end; + +function TValoresDataTableRules.GetPRECIO_COSTEIsNull: boolean; +begin + result := DataTable.Fields[idx_ValoresPRECIO_COSTE].IsNull; +end; + +procedure TValoresDataTableRules.SetPRECIO_COSTEIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_ValoresPRECIO_COSTE].AsVariant := Null; +end; + +function TValoresDataTableRules.GetPRECIO_PVPValue: Currency; +begin + result := DataTable.Fields[idx_ValoresPRECIO_PVP].AsCurrency; +end; + +procedure TValoresDataTableRules.SetPRECIO_PVPValue(const aValue: Currency); +begin + DataTable.Fields[idx_ValoresPRECIO_PVP].AsCurrency := aValue; +end; + +function TValoresDataTableRules.GetPRECIO_PVPIsNull: boolean; +begin + result := DataTable.Fields[idx_ValoresPRECIO_PVP].IsNull; +end; + +procedure TValoresDataTableRules.SetPRECIO_PVPIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_ValoresPRECIO_PVP].AsVariant := Null; +end; + { TPropiedadesDataTableRules } constructor TPropiedadesDataTableRules.Create(aDataTable: TDADataTable); @@ -2797,6 +2881,27 @@ begin DataTable.Fields[idx_PresupuestosCliente_DetallesIMPORTE_TOTAL].AsVariant := Null; end; +function TPresupuestosCliente_DetallesDataTableRules.GetVISIBLE2Value: SmallInt; +begin + result := DataTable.Fields[idx_PresupuestosCliente_DetallesVISIBLE2].AsSmallInt; +end; + +procedure TPresupuestosCliente_DetallesDataTableRules.SetVISIBLE2Value(const aValue: SmallInt); +begin + DataTable.Fields[idx_PresupuestosCliente_DetallesVISIBLE2].AsSmallInt := aValue; +end; + +function TPresupuestosCliente_DetallesDataTableRules.GetVISIBLE2IsNull: boolean; +begin + result := DataTable.Fields[idx_PresupuestosCliente_DetallesVISIBLE2].IsNull; +end; + +procedure TPresupuestosCliente_DetallesDataTableRules.SetVISIBLE2IsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_PresupuestosCliente_DetallesVISIBLE2].AsVariant := Null; +end; + function TPresupuestosCliente_DetallesDataTableRules.GetVISIBLEValue: SmallInt; begin result := DataTable.Fields[idx_PresupuestosCliente_DetallesVISIBLE].AsSmallInt; diff --git a/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteServer_Intf.pas b/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteServer_Intf.pas index dec69eed..5f2390d6 100644 --- a/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteServer_Intf.pas +++ b/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteServer_Intf.pas @@ -9,23 +9,25 @@ 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 = '{F474C394-03E2-478D-B532-27D4854BFAF2}'; - RID_PropiedadesDelta = '{884EB1CE-DC47-4617-8333-3EC5DBFD665B}'; - RID_ListaAnosPresupuestosDelta = '{925DEA86-D6E7-405B-8AC5-DC91888B5F49}'; - RID_PresupuestosClienteDelta = '{1EAAD063-02A3-4241-8820-524FA60D7806}'; - RID_CapitulosPresupuestoDelta = '{70F8EB27-2019-40CA-9A3C-091F37ADC909}'; - RID_PresupuestosCliente_DetallesDelta = '{13C9A38A-3687-4815-8E90-F51DAC75F95B}'; + RID_ValoresDelta = '{416F5769-AE40-4A91-AC03-BAEE67591266}'; + RID_PropiedadesDelta = '{79C29CFD-CEB2-4958-A514-0F08DFA587C1}'; + RID_ListaAnosPresupuestosDelta = '{5AD64A70-834D-4211-B4E2-CF197FBED98B}'; + RID_PresupuestosClienteDelta = '{A9E95F7E-9B12-460D-A255-24BBF1AA5E58}'; + RID_CapitulosPresupuestoDelta = '{793834E6-6B3C-4618-99AF-A6629F835A46}'; + RID_PresupuestosCliente_DetallesDelta = '{625AFBDA-44C7-4EE0-B18E-3803CFAC970C}'; type { IValoresDelta } IValoresDelta = interface(IValores) - ['{F474C394-03E2-478D-B532-27D4854BFAF2}'] + ['{416F5769-AE40-4A91-AC03-BAEE67591266}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_EMPRESAValue : Integer; function GetOldREFERENCIAValue : String; function GetOldDESCRIPCIONValue : String; function GetOldFAMILIAValue : String; + function GetOldPRECIO_COSTEValue : Currency; + function GetOldPRECIO_PVPValue : Currency; { Properties } property OldID : Integer read GetOldIDValue; @@ -33,6 +35,8 @@ type property OldREFERENCIA : String read GetOldREFERENCIAValue; property OldDESCRIPCION : String read GetOldDESCRIPCIONValue; property OldFAMILIA : String read GetOldFAMILIAValue; + property OldPRECIO_COSTE : Currency read GetOldPRECIO_COSTEValue; + property OldPRECIO_PVP : Currency read GetOldPRECIO_PVPValue; end; { TValoresBusinessProcessorRules } @@ -70,6 +74,18 @@ type function GetOldFAMILIAIsNull: Boolean; virtual; procedure SetFAMILIAValue(const aValue: String); virtual; procedure SetFAMILIAIsNull(const aValue: Boolean); virtual; + function GetPRECIO_COSTEValue: Currency; virtual; + function GetPRECIO_COSTEIsNull: Boolean; virtual; + function GetOldPRECIO_COSTEValue: Currency; virtual; + function GetOldPRECIO_COSTEIsNull: Boolean; virtual; + procedure SetPRECIO_COSTEValue(const aValue: Currency); virtual; + procedure SetPRECIO_COSTEIsNull(const aValue: Boolean); virtual; + function GetPRECIO_PVPValue: Currency; virtual; + function GetPRECIO_PVPIsNull: Boolean; virtual; + function GetOldPRECIO_PVPValue: Currency; virtual; + function GetOldPRECIO_PVPIsNull: Boolean; virtual; + procedure SetPRECIO_PVPValue(const aValue: Currency); virtual; + procedure SetPRECIO_PVPIsNull(const aValue: Boolean); virtual; { Properties } property ID : Integer read GetIDValue write SetIDValue; @@ -92,6 +108,14 @@ type property FAMILIAIsNull : Boolean read GetFAMILIAIsNull write SetFAMILIAIsNull; property OldFAMILIA : String read GetOldFAMILIAValue; property OldFAMILIAIsNull : Boolean read GetOldFAMILIAIsNull; + property PRECIO_COSTE : Currency read GetPRECIO_COSTEValue write SetPRECIO_COSTEValue; + property PRECIO_COSTEIsNull : Boolean read GetPRECIO_COSTEIsNull write SetPRECIO_COSTEIsNull; + property OldPRECIO_COSTE : Currency read GetOldPRECIO_COSTEValue; + property OldPRECIO_COSTEIsNull : Boolean read GetOldPRECIO_COSTEIsNull; + property PRECIO_PVP : Currency read GetPRECIO_PVPValue write SetPRECIO_PVPValue; + property PRECIO_PVPIsNull : Boolean read GetPRECIO_PVPIsNull write SetPRECIO_PVPIsNull; + property OldPRECIO_PVP : Currency read GetOldPRECIO_PVPValue; + property OldPRECIO_PVPIsNull : Boolean read GetOldPRECIO_PVPIsNull; public constructor Create(aBusinessProcessor: TDABusinessProcessor); override; @@ -101,7 +125,7 @@ type { IPropiedadesDelta } IPropiedadesDelta = interface(IPropiedades) - ['{884EB1CE-DC47-4617-8333-3EC5DBFD665B}'] + ['{79C29CFD-CEB2-4958-A514-0F08DFA587C1}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldDESCRIPCIONValue : String; @@ -147,7 +171,7 @@ type { IListaAnosPresupuestosDelta } IListaAnosPresupuestosDelta = interface(IListaAnosPresupuestos) - ['{925DEA86-D6E7-405B-8AC5-DC91888B5F49}'] + ['{5AD64A70-834D-4211-B4E2-CF197FBED98B}'] { Property getters and setters } function GetOldANOValue : String; @@ -181,7 +205,7 @@ type { IPresupuestosClienteDelta } IPresupuestosClienteDelta = interface(IPresupuestosCliente) - ['{1EAAD063-02A3-4241-8820-524FA60D7806}'] + ['{A9E95F7E-9B12-460D-A255-24BBF1AA5E58}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_EMPRESAValue : Integer; @@ -699,7 +723,7 @@ type { ICapitulosPresupuestoDelta } ICapitulosPresupuestoDelta = interface(ICapitulosPresupuesto) - ['{70F8EB27-2019-40CA-9A3C-091F37ADC909}'] + ['{793834E6-6B3C-4618-99AF-A6629F835A46}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldPOSICIONValue : Integer; @@ -853,7 +877,7 @@ type { IPresupuestosCliente_DetallesDelta } IPresupuestosCliente_DetallesDelta = interface(IPresupuestosCliente_Detalles) - ['{13C9A38A-3687-4815-8E90-F51DAC75F95B}'] + ['{625AFBDA-44C7-4EE0-B18E-3803CFAC970C}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_PRESUPUESTOValue : Integer; @@ -864,6 +888,7 @@ type function GetOldCANTIDADValue : Currency; function GetOldIMPORTE_UNIDADValue : Currency; function GetOldIMPORTE_TOTALValue : Currency; + function GetOldVISIBLE2Value : SmallInt; function GetOldVISIBLEValue : SmallInt; function GetOldID_ARTICULOValue : Integer; function GetOldTIPO_ARTICULOValue : String; @@ -882,6 +907,7 @@ type property OldCANTIDAD : Currency read GetOldCANTIDADValue; property OldIMPORTE_UNIDAD : Currency read GetOldIMPORTE_UNIDADValue; property OldIMPORTE_TOTAL : Currency read GetOldIMPORTE_TOTALValue; + property OldVISIBLE2 : SmallInt read GetOldVISIBLE2Value; property OldVISIBLE : SmallInt read GetOldVISIBLEValue; property OldID_ARTICULO : Integer read GetOldID_ARTICULOValue; property OldTIPO_ARTICULO : String read GetOldTIPO_ARTICULOValue; @@ -950,6 +976,12 @@ type function GetOldIMPORTE_TOTALIsNull: Boolean; virtual; procedure SetIMPORTE_TOTALValue(const aValue: Currency); virtual; procedure SetIMPORTE_TOTALIsNull(const aValue: Boolean); virtual; + function GetVISIBLE2Value: SmallInt; virtual; + function GetVISIBLE2IsNull: Boolean; virtual; + function GetOldVISIBLE2Value: SmallInt; virtual; + function GetOldVISIBLE2IsNull: Boolean; virtual; + procedure SetVISIBLE2Value(const aValue: SmallInt); virtual; + procedure SetVISIBLE2IsNull(const aValue: Boolean); virtual; function GetVISIBLEValue: SmallInt; virtual; function GetVISIBLEIsNull: Boolean; virtual; function GetOldVISIBLEValue: SmallInt; virtual; @@ -1030,6 +1062,10 @@ type property IMPORTE_TOTALIsNull : Boolean read GetIMPORTE_TOTALIsNull write SetIMPORTE_TOTALIsNull; property OldIMPORTE_TOTAL : Currency read GetOldIMPORTE_TOTALValue; property OldIMPORTE_TOTALIsNull : Boolean read GetOldIMPORTE_TOTALIsNull; + property VISIBLE2 : SmallInt read GetVISIBLE2Value write SetVISIBLE2Value; + property VISIBLE2IsNull : Boolean read GetVISIBLE2IsNull write SetVISIBLE2IsNull; + property OldVISIBLE2 : SmallInt read GetOldVISIBLE2Value; + property OldVISIBLE2IsNull : Boolean read GetOldVISIBLE2IsNull; property VISIBLE : SmallInt read GetVISIBLEValue write SetVISIBLEValue; property VISIBLEIsNull : Boolean read GetVISIBLEIsNull write SetVISIBLEIsNull; property OldVISIBLE : SmallInt read GetOldVISIBLEValue; @@ -1236,6 +1272,68 @@ begin BusinessProcessor.CurrentChange.NewValueByName[fld_ValoresFAMILIA] := Null; end; +function TValoresBusinessProcessorRules.GetPRECIO_COSTEValue: Currency; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_ValoresPRECIO_COSTE]; +end; + +function TValoresBusinessProcessorRules.GetPRECIO_COSTEIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ValoresPRECIO_COSTE]); +end; + +function TValoresBusinessProcessorRules.GetOldPRECIO_COSTEValue: Currency; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_ValoresPRECIO_COSTE]; +end; + +function TValoresBusinessProcessorRules.GetOldPRECIO_COSTEIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ValoresPRECIO_COSTE]); +end; + +procedure TValoresBusinessProcessorRules.SetPRECIO_COSTEValue(const aValue: Currency); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_ValoresPRECIO_COSTE] := aValue; +end; + +procedure TValoresBusinessProcessorRules.SetPRECIO_COSTEIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_ValoresPRECIO_COSTE] := Null; +end; + +function TValoresBusinessProcessorRules.GetPRECIO_PVPValue: Currency; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_ValoresPRECIO_PVP]; +end; + +function TValoresBusinessProcessorRules.GetPRECIO_PVPIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ValoresPRECIO_PVP]); +end; + +function TValoresBusinessProcessorRules.GetOldPRECIO_PVPValue: Currency; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_ValoresPRECIO_PVP]; +end; + +function TValoresBusinessProcessorRules.GetOldPRECIO_PVPIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ValoresPRECIO_PVP]); +end; + +procedure TValoresBusinessProcessorRules.SetPRECIO_PVPValue(const aValue: Currency); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_ValoresPRECIO_PVP] := aValue; +end; + +procedure TValoresBusinessProcessorRules.SetPRECIO_PVPIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_ValoresPRECIO_PVP] := Null; +end; + { TPropiedadesBusinessProcessorRules } constructor TPropiedadesBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); @@ -3306,6 +3404,37 @@ begin BusinessProcessor.CurrentChange.NewValueByName[fld_PresupuestosCliente_DetallesIMPORTE_TOTAL] := Null; end; +function TPresupuestosCliente_DetallesBusinessProcessorRules.GetVISIBLE2Value: SmallInt; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_PresupuestosCliente_DetallesVISIBLE2]; +end; + +function TPresupuestosCliente_DetallesBusinessProcessorRules.GetVISIBLE2IsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_PresupuestosCliente_DetallesVISIBLE2]); +end; + +function TPresupuestosCliente_DetallesBusinessProcessorRules.GetOldVISIBLE2Value: SmallInt; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_PresupuestosCliente_DetallesVISIBLE2]; +end; + +function TPresupuestosCliente_DetallesBusinessProcessorRules.GetOldVISIBLE2IsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_PresupuestosCliente_DetallesVISIBLE2]); +end; + +procedure TPresupuestosCliente_DetallesBusinessProcessorRules.SetVISIBLE2Value(const aValue: SmallInt); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_PresupuestosCliente_DetallesVISIBLE2] := aValue; +end; + +procedure TPresupuestosCliente_DetallesBusinessProcessorRules.SetVISIBLE2IsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_PresupuestosCliente_DetallesVISIBLE2] := Null; +end; + function TPresupuestosCliente_DetallesBusinessProcessorRules.GetVISIBLEValue: SmallInt; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_PresupuestosCliente_DetallesVISIBLE]; diff --git a/Source/Modulos/Presupuestos de cliente/Model/uBizDetallesPresupuestoCliente.pas b/Source/Modulos/Presupuestos de cliente/Model/uBizDetallesPresupuestoCliente.pas index bb3f5510..0a0a5ade 100644 --- a/Source/Modulos/Presupuestos de cliente/Model/uBizDetallesPresupuestoCliente.pas +++ b/Source/Modulos/Presupuestos de cliente/Model/uBizDetallesPresupuestoCliente.pas @@ -100,6 +100,7 @@ procedure TBizDetallesPresupuestoCliente.OnNewRecord(Sender: TDADataTable); begin inherited; VISIBLE := 1; + VISIBLE2 := 1; end; { TBizPropiedades } diff --git a/Source/Modulos/Presupuestos de cliente/Reports/uRptPresupuestosCliente_Server.dfm b/Source/Modulos/Presupuestos de cliente/Reports/uRptPresupuestosCliente_Server.dfm index 3372b543..0c2e219a 100644 --- a/Source/Modulos/Presupuestos de cliente/Reports/uRptPresupuestosCliente_Server.dfm +++ b/Source/Modulos/Presupuestos de cliente/Reports/uRptPresupuestosCliente_Server.dfm @@ -515,7 +515,7 @@ object RptPresupuestosCliente: TRptPresupuestosCliente item Name = 'ID_PRE_CON' DataType = datInteger - Value = '' + Value = '11' end> Statements = < item @@ -586,6 +586,10 @@ object RptPresupuestosCliente: TRptPresupuestosCliente item DatasetField = 'VISIBLE' TableField = 'VISIBLE' + end + item + DatasetField = 'VISIBLE2' + TableField = 'VISIBLE2' end> end> Name = 'Informe_Capitulos_Detalles' @@ -654,6 +658,10 @@ object RptPresupuestosCliente: TRptPresupuestosCliente item Name = 'VISIBLE' DataType = datSmallInt + end + item + Name = 'VISIBLE2' + DataType = datSmallInt end> ReadOnly = True end @@ -868,7 +876,7 @@ object RptPresupuestosCliente: TRptPresupuestosCliente PrintOptions.Printer = 'Por defecto' PrintOptions.PrintOnSheet = 0 ReportOptions.CreateDate = 39065.872423495400000000 - ReportOptions.LastChange = 40141.552037754600000000 + ReportOptions.LastChange = 41156.501393946760000000 ScriptLanguage = 'PascalScript' ShowProgress = False StoreInDFM = False @@ -1610,6 +1618,10 @@ object RptPresupuestosCliente: TRptPresupuestosCliente item Name = 'VISIBLE' DataType = datSmallInt + end + item + Name = 'VISIBLE2' + DataType = datSmallInt end> Params = < item diff --git a/Source/Modulos/Presupuestos de cliente/Servidor/srvPresupuestosCliente_Impl.dfm b/Source/Modulos/Presupuestos de cliente/Servidor/srvPresupuestosCliente_Impl.dfm index b2594d0d..292d4400 100644 --- a/Source/Modulos/Presupuestos de cliente/Servidor/srvPresupuestosCliente_Impl.dfm +++ b/Source/Modulos/Presupuestos de cliente/Servidor/srvPresupuestosCliente_Impl.dfm @@ -21,18 +21,15 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente TargetTable = 'ARTICULOS' Name = 'IBX' SQL = - 'SELECT '#10' ID, ID_EMPRESA, REFERENCIA, DESCRIPCION, FAMILIA'#10#10' ' + - 'FROM'#10' ARTICULOS'#10' WHERE ELIMINADO = 0 and {Where}'#10 + 'SELECT '#10' ID, ID_EMPRESA, REFERENCIA, DESCRIPCION, FAMILIA, PR' + + 'ECIO_COSTE, PRECIO_PVP'#10' FROM'#10' ARTICULOS'#10' WHERE ELIMINADO = ' + + '0 and {Where}'#10 StatementType = stSQL ColumnMappings = < item DatasetField = 'ID' TableField = 'ID' end - item - DatasetField = 'DESCRIPCION' - TableField = 'DESCRIPCION' - end item DatasetField = 'ID_EMPRESA' TableField = 'ID_EMPRESA' @@ -41,9 +38,21 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente DatasetField = 'REFERENCIA' TableField = 'REFERENCIA' end + item + DatasetField = 'DESCRIPCION' + TableField = 'DESCRIPCION' + end item DatasetField = 'FAMILIA' TableField = 'FAMILIA' + end + item + DatasetField = 'PRECIO_COSTE' + TableField = 'PRECIO_COSTE' + end + item + DatasetField = 'PRECIO_PVP' + TableField = 'PRECIO_PVP' end> end> Name = 'Valores' @@ -51,8 +60,6 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente item Name = 'ID' DataType = datInteger - Required = True - InPrimaryKey = True end item Name = 'ID_EMPRESA' @@ -62,16 +69,29 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente Name = 'REFERENCIA' DataType = datString Size = 255 + DisplayLabel = 'Referencia' end item Name = 'DESCRIPCION' DataType = datString Size = 255 + DisplayLabel = 'Descripci'#243'n' end item Name = 'FAMILIA' DataType = datString Size = 255 + DisplayLabel = 'Familia' + end + item + Name = 'PRECIO_COSTE' + DataType = datCurrency + DisplayLabel = 'Precio de coste' + end + item + Name = 'PRECIO_PVP' + DataType = datCurrency + DisplayLabel = 'Precio PVP' end> end item @@ -662,15 +682,16 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente 'TOS_CLIENTE_DETALLES.PROPIEDAD, PRESUPUESTOS_CLIENTE_DETALLES.CO' + 'NCEPTO, PRESUPUESTOS_CLIENTE_DETALLES.CANTIDAD,'#10' PRESUPUESTOS' + '_CLIENTE_DETALLES.IMPORTE_UNIDAD, PRESUPUESTOS_CLIENTE_DETALLES.' + - 'IMPORTE_TOTAL,'#10' PRESUPUESTOS_CLIENTE_DETALLES.VISIBLE,'#10#10' P' + - 'RESUPUESTOS_CLIENTE_DETALLES.ID_ARTICULO, PRESUPUESTOS_CLIENTE_D' + - 'ETALLES.TIPO_ARTICULO,'#10' PRESUPUESTOS_CLIENTE_DETALLES.DESCUEN' + - 'TO,'#10' PRESUPUESTOS_CLIENTE_DETALLES.IMPORTE_PORTE, ARTICULOS.R' + - 'EFERENCIA,'#10' '#39#39' as REFERENCIA_PROVEEDOR /*Es necesario para qu' + - 'e no fallen los detalles porque los detalles son comunes para la' + - ' rama de cliente y de proveedor*/'#10#10'FROM PRESUPUESTOS_CLIENTE_DET' + - 'ALLES'#10'LEFT JOIN ARTICULOS ON PRESUPUESTOS_CLIENTE_DETALLES.ID_AR' + - 'TICULO = ARTICULOS.ID'#10'where {where}'#10'ORDER BY POSICION;'#10#10#10 + 'IMPORTE_TOTAL,'#10' PRESUPUESTOS_CLIENTE_DETALLES.VISIBLE, PRESUP' + + 'UESTOS_CLIENTE_DETALLES.VISIBLE2,'#10#10' PRESUPUESTOS_CLIENTE_DETA' + + 'LLES.ID_ARTICULO, PRESUPUESTOS_CLIENTE_DETALLES.TIPO_ARTICULO,'#10' ' + + ' PRESUPUESTOS_CLIENTE_DETALLES.DESCUENTO,'#10' PRESUPUESTOS_CLI' + + 'ENTE_DETALLES.IMPORTE_PORTE, ARTICULOS.REFERENCIA,'#10' '#39#39' as REF' + + 'ERENCIA_PROVEEDOR /*Es necesario para que no fallen los detalles' + + ' porque los detalles son comunes para la rama de cliente y de pr' + + 'oveedor*/'#10#10'FROM PRESUPUESTOS_CLIENTE_DETALLES'#10'LEFT JOIN ARTICULO' + + 'S ON PRESUPUESTOS_CLIENTE_DETALLES.ID_ARTICULO = ARTICULOS.ID'#10'wh' + + 'ere {where}'#10'ORDER BY POSICION;'#10#10#10 StatementType = stSQL ColumnMappings = < item @@ -738,6 +759,10 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente item DatasetField = 'PROPIEDAD' TableField = 'PROPIEDAD' + end + item + DatasetField = 'VISIBLE2' + TableField = 'VISIBLE2' end> end> Name = 'PresupuestosCliente_Detalles' @@ -783,9 +808,15 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente Name = 'IMPORTE_TOTAL' DataType = datCurrency end + item + Name = 'VISIBLE2' + DataType = datSmallInt + DisplayLabel = #191'Visible?' + end item Name = 'VISIBLE' DataType = datSmallInt + DisplayLabel = #191'Valorado?' end item Name = 'ID_ARTICULO' @@ -1273,7 +1304,7 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente item Name = 'PROPIEDAD' DataType = datString - Size = 2000 + Size = 255 Value = '' end item @@ -1302,6 +1333,11 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente DataType = datSmallInt Value = '' end + item + Name = 'VISIBLE2' + DataType = datSmallInt + Value = '' + end item Name = 'ID_ARTICULO' DataType = datInteger @@ -1331,12 +1367,12 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente SQL = 'INSERT'#10' INTO PRESUPUESTOS_CLIENTE_DETALLES'#10' (ID, ID_PRESUPUE' + 'STO, POSICION, TIPO_DETALLE, PROPIEDAD, CONCEPTO, CANTIDAD,'#10' ' + - ' IMPORTE_UNIDAD, IMPORTE_TOTAL, VISIBLE, ID_ARTICULO, TIPO_ARTIC' + - 'ULO,'#10' DESCUENTO, IMPORTE_PORTE, FECHA_ALTA)'#10' VALUES'#10' (:I' + - 'D, :ID_PRESUPUESTO, :POSICION, :TIPO_DETALLE, :PROPIEDAD, :CONCE' + - 'PTO,'#10' :CANTIDAD, :IMPORTE_UNIDAD, :IMPORTE_TOTAL, :VISIBLE,'#10 + - ' :ID_ARTICULO, :TIPO_ARTICULO, :DESCUENTO, :IMPORTE_PORTE, C' + - 'URRENT_TIMESTAMP)'#10 + ' IMPORTE_UNIDAD, IMPORTE_TOTAL, VISIBLE, VISIBLE2, ID_ARTICULO, ' + + 'TIPO_ARTICULO,'#10' DESCUENTO, IMPORTE_PORTE, FECHA_ALTA)'#10' VALU' + + 'ES'#10' (:ID, :ID_PRESUPUESTO, :POSICION, :TIPO_DETALLE, :PROPIED' + + 'AD, :CONCEPTO,'#10' :CANTIDAD, :IMPORTE_UNIDAD, :IMPORTE_TOTAL, ' + + ':VISIBLE, :VISIBLE2,'#10' :ID_ARTICULO, :TIPO_ARTICULO, :DESCUEN' + + 'TO, :IMPORTE_PORTE, CURRENT_TIMESTAMP)'#10 StatementType = stSQL ColumnMappings = <> end> @@ -1366,7 +1402,8 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente Params = < item Name = 'ID' - DataType = datInteger + DataType = datAutoInc + GeneratorName = 'GEN_PRESUPUESTOS_CLI_DETALLE_ID' Value = '' end item @@ -1388,7 +1425,7 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente item Name = 'PROPIEDAD' DataType = datString - Size = 2000 + Size = 255 Value = '' end item @@ -1417,6 +1454,11 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente DataType = datSmallInt Value = '' end + item + Name = 'VISIBLE2' + DataType = datSmallInt + Value = '' + end item Name = 'ID_ARTICULO' DataType = datInteger @@ -1453,10 +1495,10 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente 'TIPO_DETALLE = :TIPO_DETALLE, '#10' PROPIEDAD = :PROPIEDAD,'#10' C' + 'ONCEPTO = :CONCEPTO, '#10' CANTIDAD = :CANTIDAD, '#10' IMPORTE_UNI' + 'DAD = :IMPORTE_UNIDAD,'#10' IMPORTE_TOTAL = :IMPORTE_TOTAL, '#10' ' + - 'VISIBLE = :VISIBLE, '#10' ID_ARTICULO = :ID_ARTICULO, '#10' TIPO_A' + - 'RTICULO = :TIPO_ARTICULO,'#10' DESCUENTO = :DESCUENTO, '#10' IMPOR' + - 'TE_PORTE = :IMPORTE_PORTE,'#10' FECHA_MODIFICACION = CURRENT_TIME' + - 'STAMP'#10' WHERE'#10' (ID = :OLD_ID)'#10 + 'VISIBLE = :VISIBLE, '#10' VISIBLE2 = :VISIBLE2,'#10' ID_ARTICULO =' + + ' :ID_ARTICULO, '#10' TIPO_ARTICULO = :TIPO_ARTICULO,'#10' DESCUENT' + + 'O = :DESCUENTO, '#10' IMPORTE_PORTE = :IMPORTE_PORTE,'#10' FECHA_M' + + 'ODIFICACION = CURRENT_TIMESTAMP'#10' WHERE'#10' (ID = :OLD_ID)'#10 StatementType = stSQL ColumnMappings = <> end> @@ -1871,7 +1913,7 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente item Name = 'PresupuestosCliente_Detalles_VISIBLE' DataType = datInteger - DisplayLabel = 'VISIBLE' + DisplayLabel = #191'Valorado?' end item Name = 'PresupuestosCliente_Detalles_ID_ARTICULO' @@ -1967,6 +2009,12 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente item Name = 'CapitulosPresupuesto_VISIBLE' DataType = datInteger + DisplayLabel = #191'Valorado?' + end + item + Name = 'PresupuestosCliente_Detalles_VISIBLE2' + DataType = datInteger + DisplayLabel = #191'Visible?' end> Left = 48 Top = 152 diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm index d6fe4531..810b190e 100644 --- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm +++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm @@ -213,16 +213,31 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente Width = 834 Height = 24 ExplicitWidth = 834 - ExplicitHeight = 24 - inherited ToolButton14: TToolButton - Wrap = False - end - inherited FontName: TJvFontComboBox - Left = 368 + inherited ToolButton14: TToolButton [1] + Left = 109 Top = 0 - ExplicitLeft = 368 + Enabled = True + ExplicitLeft = 109 ExplicitTop = 0 end + inherited ToolButton2: TToolButton [2] + Left = 143 + end + inherited FontName: TJvFontComboBox [3] + Left = 257 + Top = 0 + ExplicitLeft = 257 + ExplicitTop = 0 + end + inherited ToolButton3: TToolButton [4] + Left = 402 + ExplicitLeft = 402 + end + inherited ToolButton4: TToolButton [5] + Left = 457 + Wrap = False + ExplicitLeft = 457 + end inherited FontSize: TEdit Left = 513 Top = 0 @@ -290,25 +305,27 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente Top = 50 Width = 834 Height = 239 - ExplicitTop = 50 ExplicitWidth = 834 ExplicitHeight = 239 end inherited TBXDock1: TTBXDock Top = 24 Width = 834 - ExplicitTop = 24 ExplicitWidth = 834 inherited TBXToolbar1: TTBXToolbar - ExplicitWidth = 665 + ExplicitWidth = 663 end end inherited cxLookupComboBox1: TcxLookupComboBox + Properties.OnCloseUp = nil Style.IsFontAssigned = True end inherited cxRichEdit1: TcxRichEdit Style.IsFontAssigned = True end + inherited cxLookupComboBox2: TcxLookupComboBox + Style.IsFontAssigned = True + end end end object pagInicidencias: TTabSheet @@ -417,18 +434,16 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente LookAndFeel = dxLayoutOfficeLookAndFeel1 ExplicitWidth = 848 inherited Bevel3: TBevel - Left = 352 + Left = 310 Top = 57 - Height = 122 - ExplicitLeft = 352 + ExplicitLeft = 310 ExplicitTop = 57 - ExplicitHeight = 122 end inherited Bevel4: TBevel - Left = 464 + Left = 422 Top = 88 Width = 342 - ExplicitLeft = 464 + ExplicitLeft = 422 ExplicitTop = 88 ExplicitWidth = 342 end @@ -436,26 +451,20 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente Top = 84 Style.IsFontAssigned = True ExplicitTop = 84 - ExplicitWidth = 93 - Width = 93 end inherited ImporteIVA: TcxDBCurrencyEdit - Left = 535 + Left = 493 Top = 108 Style.IsFontAssigned = True - ExplicitLeft = 535 + ExplicitLeft = 493 ExplicitTop = 108 - ExplicitWidth = 137 - Width = 137 end inherited ImporteTotal: TcxDBCurrencyEdit - Left = 465 + Left = 423 Top = 162 Style.IsFontAssigned = True - ExplicitLeft = 465 + ExplicitLeft = 423 ExplicitTop = 162 - ExplicitWidth = 137 - Width = 137 end inherited edtDescuento: TcxDBSpinEdit Top = 84 @@ -463,69 +472,57 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente ExplicitTop = 84 end inherited edtIVA: TcxDBSpinEdit - Left = 464 + Left = 422 Top = 108 Style.IsFontAssigned = True - ExplicitLeft = 464 + ExplicitLeft = 422 ExplicitTop = 108 end inherited ImporteBase: TcxDBCurrencyEdit - Left = 464 + Left = 422 Top = 57 Style.IsFontAssigned = True - ExplicitLeft = 464 + ExplicitLeft = 422 ExplicitTop = 57 - ExplicitWidth = 92 - Width = 92 end inherited edtRE: TcxDBSpinEdit - Left = 464 + Left = 422 Top = 135 Style.IsFontAssigned = True - ExplicitLeft = 464 + ExplicitLeft = 422 ExplicitTop = 135 end inherited ImporteRE: TcxDBCurrencyEdit - Left = 535 + Left = 493 Top = 135 Style.IsFontAssigned = True - ExplicitLeft = 535 + ExplicitLeft = 493 ExplicitTop = 135 - ExplicitWidth = 56 - Width = 56 end inherited eImporteNeto: TcxDBCurrencyEdit Top = 57 Style.IsFontAssigned = True ExplicitTop = 57 - ExplicitWidth = 147 - Width = 147 end inherited ePorte: TcxDBCurrencyEdit Top = 111 Style.IsFontAssigned = True ExplicitTop = 111 - ExplicitWidth = 147 - Width = 147 end inherited eIVA: TcxDBLookupComboBox Top = 138 ExplicitTop = 138 - ExplicitWidth = 81 - Width = 81 end inherited bTiposIVA: TButton - Left = 204 + Left = 162 Top = 138 OnClick = frViewTotales1bTiposIVAClick - ExplicitLeft = 204 + ExplicitLeft = 162 ExplicitTop = 138 end inherited cbRecargoEquivalencia: TcxDBCheckBox Top = 165 ExplicitTop = 165 - ExplicitWidth = 219 - Width = 219 end inherited cbValorado: TcxDBCheckBox Left = 11 diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas index 73a29342..8fa4dff1 100644 --- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas +++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas @@ -159,6 +159,8 @@ procedure TfEditorPresupuestoCliente.CustomEditorClose(Sender: TObject; var Action: TCloseAction); begin inherited; + frViewDetallesPresupuestoCliente1.SaveGridStatus; + //GESTION_DOCUMENTOS //Este método eliminará el directorio temporal si se ha creado frViewDocumentosPresupuestoCliente1.actEliminarTodo.Execute; @@ -198,6 +200,7 @@ begin pgPaginas.ActivePage := pagGeneral; Presupuesto.DataTable.Active := True; + frViewDetallesPresupuestoCliente1.RestoreGridStatus; end; procedure TfEditorPresupuestoCliente.frViewTotales1bTiposIVAClick( @@ -264,7 +267,7 @@ begin inherited; ShowHourglassCursor; -// frViewDetallesPresupuestoCliente1.SaveGridStatus; + frViewDetallesPresupuestoCliente1.SaveGridStatus; frViewDetallesPresupuestoCliente1.BeginUpdate; try bEsNuevo := FPresupuesto.EsNuevo; @@ -274,7 +277,7 @@ begin finally frViewDetallesPresupuestoCliente1.EndUpdate; -// frViewDetallesPresupuestoCliente1.RestoreGridStatus; + frViewDetallesPresupuestoCliente1.RestoreGridStatus; HideHourglassCursor; end; if bEsNuevo then diff --git a/Source/Modulos/Presupuestos de cliente/Views/uViewDetallesPresupuestoCliente.dfm b/Source/Modulos/Presupuestos de cliente/Views/uViewDetallesPresupuestoCliente.dfm index 98e4dcd8..a5df7838 100644 --- a/Source/Modulos/Presupuestos de cliente/Views/uViewDetallesPresupuestoCliente.dfm +++ b/Source/Modulos/Presupuestos de cliente/Views/uViewDetallesPresupuestoCliente.dfm @@ -9,51 +9,55 @@ inherited frViewDetallesPresupuestoCliente: TfrViewDetallesPresupuestoCliente Visible = False VisibleForCustomization = False end - inherited cxGridViewVISIBLE: TcxGridDBColumn [4] + inherited cxGridViewVISIBLE2: TcxGridDBColumn [4] + Visible = True + Width = 51 + end + inherited cxGridViewVISIBLE: TcxGridDBColumn [5] Caption = #191'Valorado?' Visible = True Width = 51 end - inherited cxGridViewID_ARTICULO: TcxGridDBColumn [5] + inherited cxGridViewID_ARTICULO: TcxGridDBColumn [6] VisibleForCustomization = False Width = 57 end - object cxGridViewPROPIEDAD: TcxGridDBColumn [6] + object cxGridViewPROPIEDAD: TcxGridDBColumn [7] Caption = 'Familia' DataBinding.FieldName = 'PROPIEDAD' PropertiesClassName = 'TcxRichEditProperties' OnGetPropertiesForEdit = cxGridViewPROPIEDADGetPropertiesForEdit Width = 287 end - inherited cxGridViewREFERENCIA: TcxGridDBColumn [7] + inherited cxGridViewREFERENCIA: TcxGridDBColumn [8] end - inherited cxGridViewREFERENCIA_PROVEEDOR: TcxGridDBColumn [8] + inherited cxGridViewREFERENCIA_PROVEEDOR: TcxGridDBColumn [9] DataBinding.FieldName = '' end - inherited cxGridViewDESCRIPCION: TcxGridDBColumn [9] + inherited cxGridViewDESCRIPCION: TcxGridDBColumn [10] OnGetPropertiesForEdit = cxGridViewDESCRIPCIONGetPropertiesForEdit Width = 383 end - inherited cxGridViewCANTIDAD: TcxGridDBColumn [10] + inherited cxGridViewCANTIDAD: TcxGridDBColumn [11] VisibleForCustomization = False Width = 39 end - inherited cxGridViewIMPORTEUNIDAD: TcxGridDBColumn [11] + inherited cxGridViewIMPORTEUNIDAD: TcxGridDBColumn [12] VisibleForCustomization = False Width = 54 end - inherited cxGridViewDESCUENTO: TcxGridDBColumn [12] + inherited cxGridViewDESCUENTO: TcxGridDBColumn [13] VisibleForCustomization = False Width = 31 end - inherited cxGridViewIMPORTENETO: TcxGridDBColumn [13] + inherited cxGridViewIMPORTENETO: TcxGridDBColumn [14] Visible = False VisibleForCustomization = False Width = 29 end - inherited cxGridViewIMPORTEPORTE: TcxGridDBColumn [14] + inherited cxGridViewIMPORTEPORTE: TcxGridDBColumn [15] end - inherited cxGridViewIMPORTETOTAL: TcxGridDBColumn [15] + inherited cxGridViewIMPORTETOTAL: TcxGridDBColumn [16] VisibleForCustomization = False Width = 46 end @@ -115,14 +119,17 @@ inherited frViewDetallesPresupuestoCliente: TfrViewDetallesPresupuestoCliente Top = 256 ParentFont = False Properties.DropDownListStyle = lsEditList - Properties.ImmediatePost = True Properties.KeyFieldNames = 'DESCRIPCION' Properties.ListColumns = < item + SortOrder = soAscending FieldName = 'DESCRIPCION' end> Properties.ListOptions.ShowHeader = False + Properties.ListOptions.SyncMode = True Properties.ListSource = DAValores + Properties.PostPopupValueOnTab = True + Properties.OnEditValueChanged = cxLookupComboBox1PropertiesEditValueChanged Style.Font.Charset = DEFAULT_CHARSET Style.Font.Color = clWindowText Style.Font.Height = -13 diff --git a/Source/Modulos/Presupuestos de cliente/Views/uViewDetallesPresupuestoCliente.pas b/Source/Modulos/Presupuestos de cliente/Views/uViewDetallesPresupuestoCliente.pas index 2075001f..c0eee62c 100644 --- a/Source/Modulos/Presupuestos de cliente/Views/uViewDetallesPresupuestoCliente.pas +++ b/Source/Modulos/Presupuestos de cliente/Views/uViewDetallesPresupuestoCliente.pas @@ -15,7 +15,7 @@ uses Mask, DBCtrls, cxButtonEdit, cxDropDownEdit, Menus, cxGridCustomPopupMenu, cxGridPopupMenu, cxDBLookupComboBox, cxCalc, cxEditRepositoryItems, cxContainer, cxLookupEdit, cxDBLookupEdit, uBizDetallesPresupuestoCliente, - cxMemo; + cxMemo, cxDBEditRepository, cxExtEditRepositoryItems; type IViewDetallesPresupuestoCliente = interface(IViewDetallesArticulos) @@ -74,8 +74,10 @@ type procedure actAnadirExecute(Sender: TObject); procedure actCapituloImportesExecute(Sender: TObject); procedure OnVISIBLEPropertiesEditValueChanged(Sender: TObject); + procedure OnVISIBLE2PropertiesEditValueChanged(Sender: TObject); procedure CustomViewDestroy(Sender: TObject); procedure actCapituloObraExecute(Sender: TObject); + procedure cxLookupComboBox1PropertiesEditValueChanged(Sender: TObject); private procedure AnadirCapitulo(const Tipo: String;const Descripcion: String; const Descuento:Boolean = false); @@ -99,8 +101,9 @@ type implementation {$R *.dfm} -uses uControllerDetallesBase, uDetallesPresupuestoClienteController, schPresupuestosClienteClient_Intf, -uCalculosUtils; +uses + uControllerDetallesBase, uDetallesPresupuestoClienteController, schPresupuestosClienteClient_Intf, + uCalculosUtils, cxVariants, cxDataUtils; { TfrViewDetallesPresupuestoProveedor } @@ -245,6 +248,7 @@ end; procedure TfrViewDetallesPresupuestoCliente.CustomViewDestroy(Sender: TObject); begin + cxGridViewVISIBLE2.Properties.OnEditValueChanged := Nil; cxGridViewVISIBLE.Properties.OnEditValueChanged := Nil; inherited; end; @@ -259,6 +263,7 @@ begin DAPropiedades.DataTable := FPropiedades.DataTable; DAValores.DataTable := FPropiedades.Valores.DataTable; + cxGridViewVISIBLE2.Properties.OnEditValueChanged := OnVISIBLE2PropertiesEditValueChanged; cxGridViewVISIBLE.Properties.OnEditValueChanged := OnVISIBLEPropertiesEditValueChanged; end; end; @@ -274,9 +279,12 @@ begin if (ARecord.DisplayTexts[cxGridViewTIPO.Index] = TIPO_DETALLE_CONCEPTO) and (ARecord.DisplayTexts[cxGridViewPROPIEDAD.Index] <> '') then - AProperties := cxLookupComboBox1.Properties - else + begin + AProperties := cxLookupComboBox1.Properties; + end + else begin AProperties := cxRichEdit1.Properties; + end; end; procedure TfrViewDetallesPresupuestoCliente.cxGridViewPROPIEDADGetPropertiesForEdit( @@ -285,13 +293,53 @@ procedure TfrViewDetallesPresupuestoCliente.cxGridViewPROPIEDADGetPropertiesForE begin inherited; - if (ARecord.DisplayTexts[cxGridViewTIPO.Index] = TIPO_DETALLE_CONCEPTO) - then + if (ARecord.DisplayTexts[cxGridViewTIPO.Index] = TIPO_DETALLE_CONCEPTO) then + begin AProperties := cxLookupComboBox2.Properties + end else AProperties := cxRichEdit1.Properties; end; +procedure TfrViewDetallesPresupuestoCliente.cxLookupComboBox1PropertiesEditValueChanged( + Sender: TObject); +var + AEdit: TcxCustomEdit; + AValue: Variant; +begin + inherited; + AEdit := Sender as TcxCustomEdit; + + if (AEdit.EditValue = DAValores.DataTable.FieldByName('DESCRIPCION').AsString) then + begin + AValue := DAValores.DataTable.FieldByName('PRECIO_PVP').Value; + AEdit.PostEditValue; // To 'stick' the new value in the active cell + cxGridView.DataController.SetEditValue(cxGridViewIMPORTEUNIDAD.Index, AValue, evsValue); + Controller.actualizarTotales(Detalles); + end; +end; + +procedure TfrViewDetallesPresupuestoCliente.OnVISIBLE2PropertiesEditValueChanged( + Sender: TObject); +var + Orden: Integer; +begin + inherited; + Orden := 1; + if (cxGridView.DataController.GetItemByFieldName(CAMPO_TIPO).EditValue = TIPO_DETALLE_TITULO) + or (cxGridView.DataController.GetItemByFieldName(CAMPO_TIPO).EditValue = TIPO_DETALLE_TITULO_OPCIONAL) + or (cxGridView.DataController.GetItemByFieldName(CAMPO_TIPO).EditValue = TIPO_DETALLE_SUBTOTAL) then + begin + cxGridView.BeginUpdate; + + if (cxGridView.DataController.GetItemByFieldName(CAMPO_TIPO).EditValue = TIPO_DETALLE_SUBTOTAL) then + Orden := 0; + (Controller as IDetallesPresupuestoClienteController).SetVisible2(Detalles, cxGridView.DataController.GetItemByFieldName(CAMPO_VISIBLE2).EditValue, Orden); + + cxGridView.EndUpdate; + end; +end; + procedure TfrViewDetallesPresupuestoCliente.OnVISIBLEPropertiesEditValueChanged(Sender: TObject); var Orden: Integer; diff --git a/Source/Servidor/FactuGES_Server.dpr b/Source/Servidor/FactuGES_Server.dpr index 67ca116e..40239798 100644 --- a/Source/Servidor/FactuGES_Server.dpr +++ b/Source/Servidor/FactuGES_Server.dpr @@ -133,10 +133,10 @@ uses schFamiliasServer_Intf in '..\Modulos\Familias\Model\schFamiliasServer_Intf.pas', schContratosClienteClient_Intf in '..\Modulos\Contratos de cliente\Model\schContratosClienteClient_Intf.pas', schContratosClienteServer_Intf in '..\Modulos\Contratos de cliente\Model\schContratosClienteServer_Intf.pas', - schPresupuestosClienteClient_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteClient_Intf.pas', - schPresupuestosClienteServer_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteServer_Intf.pas', schArticulosClient_Intf in '..\Modulos\Articulos\Model\schArticulosClient_Intf.pas', - schArticulosServer_Intf in '..\Modulos\Articulos\Model\schArticulosServer_Intf.pas'; + schArticulosServer_Intf in '..\Modulos\Articulos\Model\schArticulosServer_Intf.pas', + schPresupuestosClienteClient_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteClient_Intf.pas', + schPresupuestosClienteServer_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteServer_Intf.pas'; {$R *.res} {$R ..\Servicios\RODLFile.res} diff --git a/Source/Servidor/FactuGES_Server.dproj b/Source/Servidor/FactuGES_Server.dproj index 7971ad1a..3028a017 100644 --- a/Source/Servidor/FactuGES_Server.dproj +++ b/Source/Servidor/FactuGES_Server.dproj @@ -28,7 +28,7 @@ Delphi.Personality - FalseTrueFalseTrueFalse2500FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.5.0.0FactuGES (Servidor)2.5.0.0miércoles, 23 de mayo de 2012 13:56 + FalseTrueFalseTrueFalse2510FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.5.1.0FactuGES (Servidor)2.5.1.0miércoles, 05 de septiembre de 2012 20:56 File C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPScxScheduler2LnkD11.bpl not found FactuGES_Server.dpr diff --git a/Source/Servidor/FactuGES_Server.rc b/Source/Servidor/FactuGES_Server.rc index 9a3587b8..6c802c87 100644 --- a/Source/Servidor/FactuGES_Server.rc +++ b/Source/Servidor/FactuGES_Server.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo Acana\Resources\Iconos\Servidor.ico" 1 VERSIONINFO -FILEVERSION 2,5,0,0 -PRODUCTVERSION 2,5,0,0 +FILEVERSION 2,5,1,0 +PRODUCTVERSION 2,5,1,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -13,10 +13,10 @@ BEGIN BLOCK "0C0A04E4" BEGIN VALUE "CompanyName", "Rodax Software S.L.\0" - VALUE "FileVersion", "2.5.0.0\0" + VALUE "FileVersion", "2.5.1.0\0" VALUE "ProductName", "FactuGES (Servidor)\0" - VALUE "ProductVersion", "2.5.0.0\0" - VALUE "CompileDate", "jueves, 21 de junio de 2012 19:00\0" + VALUE "ProductVersion", "2.5.1.0\0" + VALUE "CompileDate", "viernes, 14 de septiembre de 2012 18:42\0" END END BLOCK "VarFileInfo" diff --git a/Source/Servidor/FactuGES_Server.res b/Source/Servidor/FactuGES_Server.res index 6207798cbe41d31795113f8a285810559e421362..1d3f7c7af62846987eb413b2a078681b48b2d272 100644 GIT binary patch delta 151 zcmdn6jd9O5#tnBO7#$|xjgSYDe3us7$;jt$}%pP92u$1STngcvYpXz zGHX;dw;_Wbg8@*!fI(w&ca*Ge8AB#RDnk)N9*`_%&|y$uFk~Ir0M;EI`~Uy|