From 65871e67768fff0e0ddcb844c3a733277e297417 Mon Sep 17 00:00:00 2001 From: roberto Date: Fri, 20 Nov 2009 18:14:24 +0000 Subject: [PATCH] Se adaptan los detalles de presupuestos y contratos para que se pueda establecer si es valorado o no. Para cubrir las necesidades de los presupuestos de cocina git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@462 f4e31baf-9722-1c47-927c-6f952f962d4b --- Source/Base/Base.res | Bin 384 -> 4748 bytes .../Controladores/uControllerDetallesBase.pas | 9 +- Source/Base/Utiles/uCalculosUtils.pas | 1 + Source/Cliente/FactuGES.dproj | 2 +- Source/Cliente/FactuGES.rc | 8 +- Source/Cliente/FactuGES.res | Bin 171984 -> 171984 bytes Source/GUIBase/uViewDetallesBase.dfm | 79 ++- Source/Informes/InfContratoCliente.fr3 | 18 +- Source/Informes/InfPresupuestoCliente.fr3 | 18 +- .../ContratosCliente_Group.groupproj | 26 +- .../uDetallesContratoClienteController.pas | 17 +- .../Model/ContratosCliente_model.res | Bin 4748 -> 384 bytes .../Reports/uRptContratosCliente_Server.dfm | 282 +-------- .../Views/uViewDetallesContratoCliente.dfm | 23 +- .../Views/uViewDetallesContratoCliente.pas | 56 +- .../uDetallesPresupuestoClienteController.pas | 143 ++--- .../Model/PresupuestosCliente_model.dproj | 26 +- .../Model/PresupuestosCliente_model.res | Bin 4748 -> 384 bytes .../Model/uBizDetallesPresupuestoCliente.pas | 2 - .../uRptPresupuestosCliente_Server.dfm | 7 +- .../Views/uViewDetallesPresupuestoCliente.dfm | 24 +- .../Views/uViewDetallesPresupuestoCliente.pas | 55 +- .../uGenerarContratosCliUtils.pas | 2 +- Source/Servidor/Configuracion/uConexionBD.dfm | 3 - Source/Servidor/FactuGES_Server.RES | Bin 23348 -> 23356 bytes Source/Servidor/FactuGES_Server.dproj | 592 +++++++++--------- Source/Servidor/FactuGES_Server.rc | 10 +- 27 files changed, 634 insertions(+), 769 deletions(-) diff --git a/Source/Base/Base.res b/Source/Base/Base.res index 8b251f312bcccec5485024f6fe8d80e1cdf25746..1641339fcc482e7e3492d1b45813a86619622c33 100644 GIT binary patch literal 4748 zcmbW5&ub)A5XUPdpe&2#;C*uNAUVhgd+&(4um@dnom`vXF9g}ZuHJ;se=<3UNdFJg zbCw+UD9j$byGIXV`~6hC>h4S?F|k9X-j90q{Z_qtZ<;nUJCO8!h?p${kR>3GhM`oH*q zk=UsjOCIgA_4!`B+Gb&`I84R)bT4dy-BQV<-SyFz?R8ILEQ(+JB$u{sEXE@j@B*7W zT;iZH#|OJ<&DO$RCkM6VbK3(B(k{nbdv1lpc;E$xz9as|v3uE1V{hw2w~g3eD0an7 z{BT%G%irdMe*|oDJmgvJaA2`9B<6Xi*?M~Q;)@Sbfwf3uf zVaWkbUjU=;sL{BlYemIZXv%qZ{SZw{-TCU+;!nH6KDDIJumU+9{E0zXW4>7T)y|>$DQlv zRJe?TjSp{c!DqeayAnSMTtZZT;>LN7J0Rls+5m@q)MbyB*eL%Eu@(+$Cw}Pd@q7N| z%Q0*AHpCP^b9v`@jx-l_FD>khpW2W8(OU2&V5TrnoAY-m_hlcV?zq3;7{2gF{J#Hc z6R+o~mVenX?>@W0@_DVzyOFs(5464CY{!q9ChoF#_*eXi@4gFuV8?vhl=_w5$iKL0 zEV0nMBcN08xtRmsgJrqjh@s#|{?*ssnsG)mH*wa6{efF0JFWHok@kA5%b661{B38= zCcgJ|*ZFTpV$8<-&+AWpa)Q8*`wL&hMeNQ^v6I7$HSdLZhZ^&+6<@Uw_Zsml9^v3W zVvPDBKHh;i=RU4J_ta3E;)Mn>Y+L zKLZ0UQ+*km9FO-b?U4gmn-62iwzH6&*duKGo~aUV)bYDla8wWZ9+^7p-F<8lP@i!m z@vhbD_${F}h>^T;C(?(b*OJDk?{dEXB?nuehoON3HAb!7Mr7-ls!84-5V-jJugbu<_$}mU=Yd9!?TOX;|B-#B)+0x#9q*yqJiqS!`49d=7ztk$O+9=1i;?K_|J<8T z?0b7=-`Z3A#vV$4XJ5(lQ~TOZHUFdA%oWvK5zg&_IKXIbughQBA8XAsd#=@|TFLXC zy(^m((;DnQmDQKatmw!@c`| G?EMQ&4NnpP delta 11 ScmeBCZD5|Duvteife`=|>;pCc diff --git a/Source/Base/Controladores/uControllerDetallesBase.pas b/Source/Base/Controladores/uControllerDetallesBase.pas index 42a6f45b..ee898218 100644 --- a/Source/Base/Controladores/uControllerDetallesBase.pas +++ b/Source/Base/Controladores/uControllerDetallesBase.pas @@ -118,17 +118,21 @@ end; procedure TControllerDetallesBase.Add(ADataTable: IDAStronglyTypedDataTable; TipoConcepto: Variant); var AuxNumOrden : Integer; + AuxVisible : Variant; begin BeginUpdate(ADataTable); try with ADataTable do begin + AuxVisible := DataTable.FieldByName(CAMPO_VISIBLE).AsVariant; AuxNumOrden := desplazarNPosiciones(DataTable, DataTable.FieldByName(CAMPO_POSICION).AsVariant, 1); DataTable.Insert; DataTable.FieldByName(CAMPO_POSICION).AsInteger := AuxNumOrden; DataTable.FieldByName(CAMPO_TIPO).AsVariant := TipoConcepto; + if not VarIsNull(AuxVisible) then + DataTable.FieldByName(CAMPO_VISIBLE).AsInteger := AuxVisible; DataTable.post; end; finally @@ -159,7 +163,7 @@ var AuxPosicion : Integer; AuxImporteAcumulado : Double; AuxImporteTotal : Double; - SemaforoOpcional: Boolean; + SemaforoOpcional: Boolean; //Sirve para capitulos opcionales como en tecsitel, donde no queremos que sumen su totalidad al total del documento begin if (DataTable.State in dsEditModes) then @@ -223,7 +227,8 @@ begin begin if Modificar then TratamientoDetalleConcepto(DataTable); //Se podrá sobreescribir para que se tengan en cuenta nuevos campos - CalculoDetalleConcepto(DataTable, AuxImporteAcumulado, AuxImporteTotal, SemaforoOpcional); //Se podrá sobreescribir para posibles nuevos calculos de los hijos + if DataTable.FieldByName(CAMPO_VISIBLE).AsBoolean then //Se usa para saber si el concepto se sumará o no como un concepto más del presupuesto + CalculoDetalleConcepto(DataTable, AuxImporteAcumulado, AuxImporteTotal, SemaforoOpcional); //Se podrá sobreescribir para posibles nuevos calculos de los hijos end //HIJOS else CalcularTotalesHijos(Modificar, DataTable, AuxImporteAcumulado, AuxImporteTotal); diff --git a/Source/Base/Utiles/uCalculosUtils.pas b/Source/Base/Utiles/uCalculosUtils.pas index be8a4a46..df782305 100644 --- a/Source/Base/Utiles/uCalculosUtils.pas +++ b/Source/Base/Utiles/uCalculosUtils.pas @@ -16,6 +16,7 @@ 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 function CalcularLineaConcepto (const ADataTable : TDADataTable): Double; procedure ValidarCamposLineaConcepto(DataTable: TDADataTable); diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index ae1e6517..35762cab 100644 --- a/Source/Cliente/FactuGES.dproj +++ b/Source/Cliente/FactuGES.dproj @@ -53,7 +53,7 @@ Delphi.Personality VCLApplication -FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2380FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.3.8.0FactuGESFactuGES2.3.8.0FactuGES.dprFalse +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2390FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.3.9.0FactuGESFactuGES2.3.9.0FactuGES.dprFalse diff --git a/Source/Cliente/FactuGES.rc b/Source/Cliente/FactuGES.rc index 8cbb0a72..17d3a4cb 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,3,8,0 -PRODUCTVERSION 2,3,8,0 +FILEVERSION 2,3,9,0 +PRODUCTVERSION 2,3,9,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.3.8.0\0" + VALUE "FileVersion", "2.3.9.0\0" VALUE "InternalName", "FactuGES\0" VALUE "ProductName", "FactuGES\0" - VALUE "ProductVersion", "2.3.8.0\0" + VALUE "ProductVersion", "2.3.9.0\0" END END BLOCK "VarFileInfo" diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index 329097c76d5cfae7f4fccc1e76ddd7bc715671ae..5b73f16f4de840da4a05cd3447a8b76cb25a5659 100644 GIT binary patch delta 42 xcmcbxpX - + @@ -11,30 +11,30 @@ - + - + - + - + - + - + @@ -57,10 +57,10 @@ - + - + diff --git a/Source/Informes/InfPresupuestoCliente.fr3 b/Source/Informes/InfPresupuestoCliente.fr3 index ede29255..eccaaaf3 100644 --- a/Source/Informes/InfPresupuestoCliente.fr3 +++ b/Source/Informes/InfPresupuestoCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -11,30 +11,30 @@ - + - + - + - + - + - + @@ -55,10 +55,10 @@ - + - + diff --git a/Source/Modulos/Contratos de cliente/ContratosCliente_Group.groupproj b/Source/Modulos/Contratos de cliente/ContratosCliente_Group.groupproj index 07d2c635..022cfd0f 100644 --- a/Source/Modulos/Contratos de cliente/ContratosCliente_Group.groupproj +++ b/Source/Modulos/Contratos de cliente/ContratosCliente_Group.groupproj @@ -16,7 +16,9 @@ + + @@ -191,14 +193,32 @@ + + + + + + + + + + + + + + + + + + - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Contratos de cliente/Controller/uDetallesContratoClienteController.pas b/Source/Modulos/Contratos de cliente/Controller/uDetallesContratoClienteController.pas index 1e65e67c..577c85e0 100644 --- a/Source/Modulos/Contratos de cliente/Controller/uDetallesContratoClienteController.pas +++ b/Source/Modulos/Contratos de cliente/Controller/uDetallesContratoClienteController.pas @@ -15,8 +15,9 @@ type function DarTotalPorteTotal(ADetalles: IDAStronglyTypedDataTable): Double; function DarPropiedades: IBizPropiedades; - procedure AnadirCapitulo (const Tipo: String; ADetalles: IDAStronglyTypedDataTable); - procedure SetTipoArticulo(ADetalles: IDAStronglyTypedDataTable; ATipo: String); + 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 end; TDetallesContratoClienteController = class(TControllerDetallesArticulos, IDetallesContratoClienteController) @@ -45,12 +46,13 @@ type destructor Destroy; override; function DarPropiedades: IBizPropiedades; - procedure AnadirCapitulo (const Tipo: String; ADetalles: IDAStronglyTypedDataTable); + procedure AnadirCapitulo (const Tipo: String; const Descripcion: String; Const Descuento:Boolean; ADetalles: IDAStronglyTypedDataTable); //Se sobre escribe para hacer otro recorrido y rellenar el tipo_articulo a todos los conceptos de los capitulos procedure ValidarDetalles(ADataTable: IDAStronglyTypedDataTable); override; procedure SetTipoArticulo(ADetalles: IDAStronglyTypedDataTable; ATipo: String); + procedure SetVisible(ADetalles: IDAStronglyTypedDataTable;const AVisible: Integer;const Orden: Integer); //1Ascendente/0Descendente end; implementation @@ -106,9 +108,9 @@ begin end; end; -procedure TDetallesContratoClienteController.AnadirCapitulo(const Tipo: String; ADetalles: IDAStronglyTypedDataTable); +procedure TDetallesContratoClienteController.AnadirCapitulo(const Tipo: String; const Descripcion: String; Const Descuento:Boolean; ADetalles: IDAStronglyTypedDataTable); begin - FDetallesPresupuestoCliente.AnadirCapitulo(Tipo, ADetalles); + FDetallesPresupuestoCliente.AnadirCapitulo(Tipo, Descripcion, Descuento, ADetalles); end; procedure TDetallesContratoClienteController.AsignarController; @@ -176,6 +178,11 @@ begin end; end; +procedure TDetallesContratoClienteController.SetVisible(ADetalles: IDAStronglyTypedDataTable; const AVisible, Orden: Integer); +begin + FDetallesPresupuestoCliente.SetVisible(ADetalles, AVisible, Orden); +end; + procedure TDetallesContratoClienteController.ValidarCampos(DataTable: TDADataTable); begin inherited; diff --git a/Source/Modulos/Contratos de cliente/Model/ContratosCliente_model.res b/Source/Modulos/Contratos de cliente/Model/ContratosCliente_model.res index 1641339fcc482e7e3492d1b45813a86619622c33..8b251f312bcccec5485024f6fe8d80e1cdf25746 100644 GIT binary patch delta 11 ScmeBCZD5|Duvteife`=|>;pCc literal 4748 zcmbW5&ub)A5XUPdpe&2#;C*uNAUVhgd+&(4um@dnom`vXF9g}ZuHJ;se=<3UNdFJg zbCw+UD9j$byGIXV`~6hC>h4S?F|k9X-j90q{Z_qtZ<;nUJCO8!h?p${kR>3GhM`oH*q zk=UsjOCIgA_4!`B+Gb&`I84R)bT4dy-BQV<-SyFz?R8ILEQ(+JB$u{sEXE@j@B*7W zT;iZH#|OJ<&DO$RCkM6VbK3(B(k{nbdv1lpc;E$xz9as|v3uE1V{hw2w~g3eD0an7 z{BT%G%irdMe*|oDJmgvJaA2`9B<6Xi*?M~Q;)@Sbfwf3uf zVaWkbUjU=;sL{BlYemIZXv%qZ{SZw{-TCU+;!nH6KDDIJumU+9{E0zXW4>7T)y|>$DQlv zRJe?TjSp{c!DqeayAnSMTtZZT;>LN7J0Rls+5m@q)MbyB*eL%Eu@(+$Cw}Pd@q7N| z%Q0*AHpCP^b9v`@jx-l_FD>khpW2W8(OU2&V5TrnoAY-m_hlcV?zq3;7{2gF{J#Hc z6R+o~mVenX?>@W0@_DVzyOFs(5464CY{!q9ChoF#_*eXi@4gFuV8?vhl=_w5$iKL0 zEV0nMBcN08xtRmsgJrqjh@s#|{?*ssnsG)mH*wa6{efF0JFWHok@kA5%b661{B38= zCcgJ|*ZFTpV$8<-&+AWpa)Q8*`wL&hMeNQ^v6I7$HSdLZhZ^&+6<@Uw_Zsml9^v3W zVvPDBKHh;i=RU4J_ta3E;)Mn>Y+L zKLZ0UQ+*km9FO-b?U4gmn-62iwzH6&*duKGo~aUV)bYDla8wWZ9+^7p-F<8lP@i!m z@vhbD_${F}h>^T;C(?(b*OJDk?{dEXB?nuehoON3HAb!7Mr7-ls!84-5V-jJugbu<_$}mU=Yd9!?TOX;|B-#B)+0x#9q*yqJiqS!`49d=7ztk$O+9=1i;?K_|J<8T z?0b7=-`Z3A#vV$4XJ5(lQ~TOZHUFdA%oWvK5zg&_IKXIbughQBA8XAsd#=@|TFLXC zy(^m((;DnQmDQKatmw!@c`| G?EMQ&4NnpP diff --git a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm index ad116762..960f1bc5 100644 --- a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm +++ b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm @@ -450,8 +450,7 @@ object RptContratosCliente: TRptContratosCliente Default = True SQL = 'SELECT * FROM PROC_PRE_CON_CAPITULOS_CONCEP(:ID_PRE_CON, '#39'Contra' + - 'to'#39')'#10'WHERE (VISIBLE <> 0) AND {where}'#10'ORDER BY ID_PRE_CON, POSIC' + - 'ION'#10 + 'to'#39')'#10'WHERE {where}'#10'ORDER BY ID_PRE_CON, POSICION'#10 StatementType = stSQL ColumnMappings = < item @@ -597,7 +596,7 @@ object RptContratosCliente: TRptContratosCliente Default = True SQL = 'SELECT * FROM PROC_PRE_CON_CAPITULOS(:ID_PRE_CON, '#39'Contrato'#39')'#10'WH' + - 'ERE (VISIBLE <> 0) AND {where}'#10'ORDER BY ID_PRE_CON, POSICION'#10 + 'ERE {where}'#10'ORDER BY ID_PRE_CON, POSICION'#10 StatementType = stSQL ColumnMappings = < item @@ -784,7 +783,7 @@ object RptContratosCliente: TRptContratosCliente Top = 142 end object frxReport: TfrxReport - Version = '4.3' + Version = '4.8.11' DotMatrixReport = False EngineOptions.DoublePass = True IniFile = '\Software\Fast Reports' @@ -795,264 +794,6 @@ object RptContratosCliente: TRptContratosCliente ReportOptions.CreateDate = 39065.872423495400000000 ReportOptions.LastChange = 40071.577940347220000000 ScriptLanguage = 'PascalScript' - ScriptText.Strings = ( - '' - '' - 'procedure NombreEmpresaOnBeforePrint(Sender: TfrxComponent);' - 'begin' - '{ NombreEmpresa.Lines.Clear;' - ' NombreEmpresa.Lines.Add();' - '}' - 'end;' - '' - 'procedure PageHeader1OnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' if not Engine.FinalPass then' - ' Set('#39'TotalPaginas'#39', ( + 1));' - '' - ' if Engine.FinalPass then' - ' Set('#39'Pagina'#39', ( + 1)); ' - 'end;' - '' - 'procedure frxReportOnStartReport(Sender: TfrxComponent);' - 'begin' - ' Set('#39'Pagina'#39', 0);' - ' Set('#39'TotalPaginas'#39', 0);' - ' Set('#39'Capitulo'#39', '#39'0'#39');' - ' Set('#39'NumCapitulos'#39', 0);' - ' Set('#39'TextoNumCapitulo'#39', '#39#39#39' '#39#39#39'); ' - 'end;' - '' - 'procedure Rich3OnBeforePrint(Sender: TfrxComponent);' - 'begin' - '{ ' - ' if Engine.FinalPass then' - ' begin ' - ' Set('#39'Capitulo'#39', ( + 1));' - ' if ( = 1) then' - - ' MasterData1.Visible := False; ' + - ' ' - ' end' - ' else' - ' Set('#39'NumCapitulos'#39', ( + 1));' - '} ' - 'end;' - '' - 'procedure Memo45OnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' if Engine.FinalPass then' - ' begin' - - ' Set('#39'Capitulo'#39', ( + 1)); ' + - ' ' - ' Set('#39'TextoNumCapitulo'#39', );' - '' - - ' if (( = 1) and ( =' + - ' '#39'General'#39')) then' - ' MasterData1.Visible := False' - ' else begin ' - - ' if ( = '#39'Titulo opcional'#39') ' + - 'then' - ' begin' - ' Set('#39'TextoNumCapitulo'#39', '#39#39#39'OPCIONAL'#39#39#39');' - ' end' - ' end ' - ' end' - ' else ' - ' Set('#39'NumCapitulos'#39', ( + 1));' - '' - '' - '// Memo11.lines.add(); ' - 'end;' - '' - 'procedure Memo47OnBeforePrint(Sender: TfrxComponent);' - 'begin' - '{ ' - ' if (Length() = 0) then' - ' begin' - - ' Memo11.Visible := False; ' + - ' ' - ' Memo47.Visible := False;' - ' end' - '} ' - 'end;' - '' - - 'procedure frxDBDetallesCANTIDADOnBeforePrint(Sender: TfrxCompone' + - 'nt);' - 'var ' - ' ACantidad: String; ' - ' AIndice: Integer;' - ' AText : String; ' - 'begin' - '{ ' - ' frxDBDetallesCANTIDAD.Memo.Clear; ' - ' ACantidad := FloatToStr(); ' - ' AIndice := Pos('#39','#39', ACantidad);' - ' if AIndice > 0 then ' - - ' AText := '#39'[FormatFloat('#39#39'#,##0.00'#39#39',)]' - ' else ' - - ' AText := '#39'[FormatFloat('#39#39'#,##0.##'#39#39',)]; ' - ' ' - ' frxDBDetallesCANTIDAD.Memo.Add(AText);' - '} ' - 'end;' - '' - 'procedure DatosClienteOnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' DatosCliente.Lines.Clear;' - ' DatosCliente.Lines.Add();' - '' - ' if ( <> '#39#39')' - ' or ( <> '#39#39') then' - - ' DatosCliente.Lines.Add( + '#39' ' + - ' '#39' + );' - '' - ' if ( <> '#39#39') then' - ' DatosCliente.Lines.Add(); ' - 'end;' - '' - 'procedure MasterData1OnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' if ( = '#39'AF'#39' ) ' - ' or ( = '#39'AI'#39' )' - ' or ( = '#39'B'#39' ) then' - ' begin' - - ' Header1.Visible := False; ' + - ' ' - - ' DetailData1.Visible := False; ' + - ' ' - ' DetailData2.Visible := True;' - ' end' - ' else' - ' begin' - - ' Header1.Visible := True; ' + - ' ' - - ' DetailData1.Visible := True; ' + - ' ' - ' DetailData2.Visible := False;' - ' end;' - 'end;' - '' - 'procedure Memo11OnBeforePrint(Sender: TfrxComponent);' - 'begin' - 'end;' - '' - 'procedure Memo29OnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' if ( > 0) then' - ' begin' - ' Memo29.visible := True;' - ' if ( > 0) then' - ' begin' - ' Memo30.visible := True; ' - ' end' - ' else' - ' begin' - ' Memo30.visible := False; ' - ' Shape10.Top := Shape9.Top;' - ' Memo26.Top := Memo30.Top;' - ' Memo25.Top := Memo31.Top;' - ' Line8.height := Line8.height - Shape10.height;' - ' end' - ' end' - ' else' - ' begin' - ' Memo29.visible := False;' - ' Shape10.Top := Shape8.Top;' - ' Memo26.Top := Memo29.Top;' - ' Memo25.Top := Memo33.Top;' - ' Line8.height := Line8.height - Shape10.height;' - ' //Si IVA es 0 RE tambien' - ' Memo30.Visible := False;' - ' Shape9.Visible := False;' - ' //Subimos comentarios' - ' Memo40.Top := Memo40.Top - Shape9.height;' - - ' Memo37.Top := Memo37.Top - Shape9.height; ' + - ' ' - ' Memo39.Top := Memo39.Top - Shape9.height;' - - ' Memo28.Top := Memo28.Top - Shape9.height; ' + - ' ' - ' end;' - 'end;' - '' - 'procedure ReportSummary1OnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' if (Length() = 0) then' - ' begin' - ' Memo40.Visible := False;' - ' Memo37.Visible := False;' - ' end;' - '' - ' if (Length() = 0) then' - ' begin' - ' Memo38.Visible := False;' - - ' Memo27.Visible := False; ' + - ' ' - ' end; ' - '' - ' if (Length() = 0) then' - ' begin' - ' Memo39.Visible := False;' - ' Memo28.Visible := False;' - ' Memo41.Top := Memo41.Top - (Memo39.height + Memo28.height);' - - ' Memo42.Top := Memo42.Top - (Memo39.height + Memo28.height); ' + - ' ' - ' end; ' - 'end;' - '' - 'procedure Memo20OnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' if (sum(, DetailData1) = 0)' - - ' and (sum(, DetailData2) = 0) th' + - 'en' - ' begin' - ' Footer1.Height := 10;' - ' Memo13.Visible := False;' - ' Memo20.Visible := False; ' - ' Memo21.Visible := False; ' - ' Memo11.Visible := False;' - ' Memo24.Visible := False;' - ' end' - ' else' - ' begin' - ' Footer1.Height := 55;' - ' Memo13.Visible := True; ' - ' Memo20.Visible := True;' - ' Memo21.Visible := True;' - ' Memo11.Visible := True;' - ' Memo24.Visible := True; ' - ' end;' - '' - ' if ( = 0) then' - ' begin' - ' Footer1.Height := 35; ' - ' Memo11.Visible := False;' - ' Memo24.Visible := False; ' - ' end; ' - 'end;' - '' - 'begin' - '' - 'end.') ShowProgress = False StoreInDFM = False OnStartReport = 'frxReportOnStartReport' @@ -1064,6 +805,7 @@ object RptContratosCliente: TRptContratosCliente UserName = 'frxDBCabecera' CloseDataSource = False DataSource = DADSCabecera + BCDToCurrency = False Left = 264 Top = 16 end @@ -1071,6 +813,7 @@ object RptContratosCliente: TRptContratosCliente UserName = 'frxDBDetalles' CloseDataSource = False DataSource = DADSDetalles + BCDToCurrency = False Left = 440 Top = 16 end @@ -1243,6 +986,7 @@ object RptContratosCliente: TRptContratosCliente UserName = 'frxDBCapitulos' CloseDataSource = False DataSource = DADSCapitulos + BCDToCurrency = False Left = 352 Top = 16 end @@ -1465,13 +1209,21 @@ object RptContratosCliente: TRptContratosCliente ShowDialog = False UseFileCache = True ShowProgress = False + OverwritePrompt = False PrintOptimized = True Outline = False + Background = False + HTMLTags = True Author = 'FactuGES' Subject = 'FactuGES' - Background = False Creator = 'FactuGES' - HTMLTags = True + ProtectionFlags = [ePrint, eModify, eCopy, eAnnot] + HideToolbar = False + HideMenubar = False + HideWindowUI = False + FitWindow = False + CenterWindow = False + PrintScaling = False Left = 528 Top = 440 end @@ -1548,6 +1300,7 @@ object RptContratosCliente: TRptContratosCliente UserName = 'frxDBInformeListadoContratos' CloseDataSource = True DataSource = DADSInformeListadoContratos + BCDToCurrency = False Left = 680 Top = 16 end @@ -1555,6 +1308,7 @@ object RptContratosCliente: TRptContratosCliente UserName = 'frxDBInformeListadoContratosResumen' CloseDataSource = True DataSource = DADSInformeListadoContratosResumen + BCDToCurrency = False Left = 680 Top = 192 end diff --git a/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm b/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm index 0d0cc809..71cc05e1 100644 --- a/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm +++ b/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm @@ -65,7 +65,10 @@ inherited frViewDetallesContratoCliente: TfrViewDetallesContratoCliente Visible = False VisibleForCustomization = False end - object cxGridViewID_PROPIEDAD: TcxGridDBColumn [5] + inherited cxGridViewVISIBLE: TcxGridDBColumn [5] + Visible = True + end + object cxGridViewID_PROPIEDAD: TcxGridDBColumn [6] Caption = 'Propiedad' DataBinding.FieldName = 'ID_ARTICULO' PropertiesClassName = 'TcxLookupComboBoxProperties' @@ -79,31 +82,35 @@ inherited frViewDetallesContratoCliente: TfrViewDetallesContratoCliente Properties.ListOptions.SyncMode = True Properties.ListSource = DAPropiedades end - inherited cxGridViewREFERENCIA_PROVEEDOR: TcxGridDBColumn + inherited cxGridViewREFERENCIA: TcxGridDBColumn [7] + end + inherited cxGridViewREFERENCIA_PROVEEDOR: TcxGridDBColumn [8] DataBinding.FieldName = '' end - inherited cxGridViewDESCRIPCION: TcxGridDBColumn + inherited cxGridViewDESCRIPCION: TcxGridDBColumn [9] OnGetPropertiesForEdit = cxGridViewDESCRIPCIONGetPropertiesForEdit Width = 243 end - inherited cxGridViewCANTIDAD: TcxGridDBColumn + inherited cxGridViewCANTIDAD: TcxGridDBColumn [10] VisibleForCustomization = False Width = 25 end - inherited cxGridViewIMPORTEUNIDAD: TcxGridDBColumn + inherited cxGridViewIMPORTEUNIDAD: TcxGridDBColumn [11] VisibleForCustomization = False Width = 34 end - inherited cxGridViewDESCUENTO: TcxGridDBColumn + inherited cxGridViewDESCUENTO: TcxGridDBColumn [12] VisibleForCustomization = False Width = 20 end - inherited cxGridViewIMPORTENETO: TcxGridDBColumn + inherited cxGridViewIMPORTENETO: TcxGridDBColumn [13] Visible = False VisibleForCustomization = False Width = 29 end - inherited cxGridViewIMPORTETOTAL: TcxGridDBColumn + inherited cxGridViewIMPORTEPORTE: TcxGridDBColumn [14] + end + inherited cxGridViewIMPORTETOTAL: TcxGridDBColumn [15] VisibleForCustomization = False Width = 29 end diff --git a/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.pas b/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.pas index a3a0a016..6c80e19d 100644 --- a/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.pas +++ b/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.pas @@ -68,9 +68,11 @@ type procedure actCapituloVariosExecute(Sender: TObject); procedure actAnadirExecute(Sender: TObject); procedure actCapituloImportesExecute(Sender: TObject); + procedure OnVISIBLEPropertiesEditValueChanged(Sender: TObject); + procedure CustomViewDestroy(Sender: TObject); private - procedure AnadirCapitulo(const Tipo: String); + procedure AnadirCapitulo(const Tipo: String;const Descripcion: String; const Descuento:Boolean = false); protected FContrato: IBizContratoCliente; @@ -156,38 +158,40 @@ end; procedure TfrViewDetallesContratoCliente.actCapituloArmarioFExecute(Sender: TObject); begin - AnadirCapitulo(TIPO_CAPITULO_AF); + AnadirCapitulo(TIPO_CAPITULO_AF, 'FRENTE DE ARMARIO Nº '); end; procedure TfrViewDetallesContratoCliente.actCapituloArmarioIExecute(Sender: TObject); begin - AnadirCapitulo(TIPO_CAPITULO_AI); + AnadirCapitulo(TIPO_CAPITULO_AI, 'INTERIOR DE ARMARIO Nº '); end; procedure TfrViewDetallesContratoCliente.actCapituloBanoExecute(Sender: TObject); begin - AnadirCapitulo(TIPO_CAPITULO_B); + AnadirCapitulo(TIPO_CAPITULO_B, 'MUEBLE DE BAÑO Nº '); + AnadirCapitulo(TIPO_CAPITULO_V, 'IMPORTES ', True); end; procedure TfrViewDetallesContratoCliente.actCapituloCocinaExecute(Sender: TObject); begin - AnadirCapitulo(TIPO_CAPITULO_C); + AnadirCapitulo(TIPO_CAPITULO_C_VACIO, 'MUEBLES DE COCINA '); + AnadirCapitulo(TIPO_CAPITULO_V, 'IMPORTES ', True); + AnadirCapitulo(TIPO_CAPITULO_V, 'AUMENTO POR '); end; procedure TfrViewDetallesContratoCliente.actCapituloElectrodomesticosExecute(Sender: TObject); begin - AnadirCapitulo(TIPO_CAPITULO_E); + AnadirCapitulo(TIPO_CAPITULO_E, 'ELECTRODOMÉSTICOS '); end; procedure TfrViewDetallesContratoCliente.actCapituloImportesExecute(Sender: TObject); begin - inherited; - AnadirCapitulo(TIPO_CAPITULO_IMPORTES); + AnadirCapitulo(TIPO_CAPITULO_V, 'IMPORTES '); end; procedure TfrViewDetallesContratoCliente.actCapituloVariosExecute(Sender: TObject); begin - AnadirCapitulo(TIPO_CAPITULO_V); + AnadirCapitulo(TIPO_CAPITULO_V, 'VARIOS '); end; function TfrViewDetallesContratoCliente.AnadirArticulo(pReferencia: String; TipoReferencia: TEnumReferencia): Boolean; @@ -200,7 +204,7 @@ begin (Controller as IDetallesContratoClienteController).AnadirArticulos(Detalles, Contrato.Cliente); end; -procedure TfrViewDetallesContratoCliente.AnadirCapitulo(const Tipo: String); +procedure TfrViewDetallesContratoCliente.AnadirCapitulo(const Tipo: String;const Descripcion: String; const Descuento:Boolean = false); var bEsMultiSelect : Boolean; begin @@ -218,7 +222,7 @@ begin _FocusedView.Controller.EditingController.Edit.PostEditValue; if Assigned(Controller) and Assigned(Detalles) then - (Controller as IDetallesContratoClienteController).AnadirCapitulo(Tipo, Detalles) + (Controller as IDetallesContratoClienteController).AnadirCapitulo(Tipo, Descripcion, Descuento, Detalles) finally _FocusedView.EndUpdate; HideHourglassCursor; @@ -229,6 +233,12 @@ begin end; end; +procedure TfrViewDetallesContratoCliente.CustomViewDestroy(Sender: TObject); +begin + cxGridViewVISIBLE.Properties.OnEditValueChanged := Nil; + inherited; +end; + procedure TfrViewDetallesContratoCliente.CustomViewShow(Sender: TObject); begin inherited; @@ -238,6 +248,7 @@ begin FPropiedades.DataTable.Active := True; DAPropiedades.DataTable := FPropiedades.DataTable; DAValores.DataTable := FPropiedades.Valores.DataTable; + cxGridViewVISIBLE.Properties.OnEditValueChanged := OnVISIBLEPropertiesEditValueChanged; end; end; @@ -299,6 +310,29 @@ begin Result := FContrato; end; +procedure TfrViewDetallesContratoCliente.OnVISIBLEPropertiesEditValueChanged(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; + + if Assigned(Controller) and Assigned(Detalles) then + (Controller as IDetallesContratoClienteController).SetVisible(Detalles, cxGridView.DataController.GetItemByFieldName(CAMPO_VISIBLE).EditValue, Orden); + + cxGridView.EndUpdate; + end; + (Controller as IDetallesContratoClienteController).ActualizarTotales(Detalles); +end; + procedure TfrViewDetallesContratoCliente.RellenarArticulosInterno; begin (Controller as IDetallesContratoClienteController).AnadirArticulos(Detalles, Contrato.Cliente, False); diff --git a/Source/Modulos/Presupuestos de cliente/Controller/uDetallesPresupuestoClienteController.pas b/Source/Modulos/Presupuestos de cliente/Controller/uDetallesPresupuestoClienteController.pas index 96a971dd..34247a0c 100644 --- a/Source/Modulos/Presupuestos de cliente/Controller/uDetallesPresupuestoClienteController.pas +++ b/Source/Modulos/Presupuestos de cliente/Controller/uDetallesPresupuestoClienteController.pas @@ -16,8 +16,9 @@ type function PedirDescuento: Variant; function DarPropiedades: IBizPropiedades; - procedure AnadirCapitulo (const Tipo: String; ADetalles: IDAStronglyTypedDataTable); + 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 end; TDetallesPresupuestoClienteController = class(TControllerDetallesArticulos, IDetallesPresupuestoClienteController) @@ -45,17 +46,18 @@ type destructor Destroy; override; function DarPropiedades: IBizPropiedades; - procedure AnadirCapitulo (const Tipo: String; ADetalles: IDAStronglyTypedDataTable); + procedure AnadirCapitulo (const Tipo: String; const Descripcion: String; const Descuento:Boolean; ADetalles: IDAStronglyTypedDataTable); //Se sobre escribe para hacer otro recorrido y rellenar el tipo_articulo a todos los conceptos de los capitulos procedure ValidarDetalles(ADataTable: IDAStronglyTypedDataTable); override; procedure SetTipoArticulo(ADetalles: IDAStronglyTypedDataTable; ATipo: String); + procedure SetVisible(ADetalles: IDAStronglyTypedDataTable;const AVisible: Integer;const Orden: Integer); //1Ascendente/0Descendente end; implementation -uses Controls, SysUtils, Dialogs, uDAInterfaces, uDialogUtils, Variants, uDataModulePresupuestosCliente, +uses DB, Controls, SysUtils, Dialogs, uDAInterfaces, uDialogUtils, Variants, uDataModulePresupuestosCliente, uArticulosPresupuestoClienteController, schPresupuestosClienteClient_Intf, uDataTableUtils, uCalculosUtils, uIEditorAsignarDescuento, uEditorRegistryUtils; @@ -104,67 +106,20 @@ begin end; end; -procedure TDetallesPresupuestoClienteController.AnadirCapitulo(const Tipo: String; ADetalles: IDAStronglyTypedDataTable); +procedure TDetallesPresupuestoClienteController.AnadirCapitulo(const Tipo: String;const Descripcion: String; const Descuento:Boolean; ADetalles: IDAStronglyTypedDataTable); var ACapitulo: IBizCapitulo; - TipoAux: String; begin - if ((Tipo = TIPO_CAPITULO_IMPORTES) - or (Tipo = TIPO_CAPITULO_IMPORTES_OPCIONAL)) then - //Esta capitulo será igual que un capitulo de varios - TipoAux := TIPO_CAPITULO_V - else - TipoAux := Tipo; - Self.Add(ADetalles, TIPO_DETALLE_TITULO); if not ADetalles.DataTable.Editing then ADetalles.DataTable.Edit; - if Tipo = TIPO_CAPITULO_AF then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'FRENTE DE ARMARIO Nº '; - end - else if Tipo = TIPO_CAPITULO_AI then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'INTERIOR DE ARMARIO Nº '; - end - else if Tipo = TIPO_CAPITULO_B then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'MUEBLE DE BAÑO Nº '; - end - else if (Tipo = TIPO_CAPITULO_C) or (Tipo = TIPO_CAPITULO_C_VACIO) then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'MUEBLES DE COCINA '; - end - else if Tipo = TIPO_CAPITULO_E then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'ELECTRODOMÉSTICOS '; - end - else if Tipo = TIPO_CAPITULO_V then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'VARIOS '; - end - else if Tipo = TIPO_CAPITULO_IMPORTES then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'IMPORTES '; - end - else if Tipo = TIPO_CAPITULO_IMPORTES_OPCIONAL then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'IMPORTES '; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_DETALLE).AsString := TIPO_DETALLE_TITULO_OPCIONAL; - end; + ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := Tipo; + ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := Descripcion; //Rellenamos con las propiedades del capitulo - ACapitulo := FDataModule.GetCapitulo(TipoAux); + ACapitulo := FDataModule.GetCapitulo(Tipo); ACapitulo.DataTable.Active := True; with ACapitulo.DataTable do begin @@ -174,7 +129,7 @@ begin if not ADetalles.DataTable.Editing then ADetalles.DataTable.Edit; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; + ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := Tipo; ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesID_ARTICULO).AsInteger := ACapitulo.ID_ARTICULO; Next; until EOF; @@ -184,45 +139,15 @@ begin if not ADetalles.DataTable.Editing then ADetalles.DataTable.Edit; - if Tipo = TIPO_CAPITULO_AF then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'TOTAL FRENTE DE ARMARIO Nº '; - end - else if Tipo = TIPO_CAPITULO_AI then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'TOTAL INTERIOR DE ARMARIO Nº '; - end - else if Tipo = TIPO_CAPITULO_B then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'TOTAL MUEBLE DE BAÑO Nº '; - end - else if (Tipo = TIPO_CAPITULO_C) or (Tipo = TIPO_CAPITULO_C_VACIO) then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'TOTAL MUEBLES DE COCINA '; - end - else if Tipo = TIPO_CAPITULO_E then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'TOTAL ELECTRODOMÉSTICOS '; - end - else if Tipo = TIPO_CAPITULO_V then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'TOTAL VARIOS '; - end - else if ((Tipo = TIPO_CAPITULO_IMPORTES) or (Tipo = TIPO_CAPITULO_IMPORTES_OPCIONAL)) then - begin - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'TOTAL IMPORTES '; + ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := Tipo; + ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'SUBTOTAL ' + Descripcion; + if Descuento then + begin Self.Add(ADetalles, TIPO_DETALLE_DESCUENTO); if not ADetalles.DataTable.Editing then ADetalles.DataTable.Edit; - ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := TipoAux; + ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesTIPO_ARTICULO).AsString := Tipo; ADetalles.DataTable.FieldByName(fld_PresupuestosCliente_DetallesCONCEPTO).AsString := 'DESCUENTO '; end; @@ -323,6 +248,44 @@ begin end; end; +procedure TDetallesPresupuestoClienteController.SetVisible(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_VISIBLE).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/Model/PresupuestosCliente_model.dproj b/Source/Modulos/Presupuestos de cliente/Model/PresupuestosCliente_model.dproj index 097a3298..c4eaa8ef 100644 --- a/Source/Modulos/Presupuestos de cliente/Model/PresupuestosCliente_model.dproj +++ b/Source/Modulos/Presupuestos de cliente/Model/PresupuestosCliente_model.dproj @@ -43,6 +43,8 @@ Package FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0 + + RemObjects Pascal Script - RemObjects SDK 3.0 Integration EurekaLog 5.1.9 PresupuestosCliente_model.dpk @@ -52,15 +54,21 @@ MainSource - - - - - - - - - + + + + + + + + + + + + + + +