diff --git a/Source/Base/Base.res b/Source/Base/Base.res
index 8b251f31..1641339f 100644
Binary files a/Source/Base/Base.res and b/Source/Base/Base.res differ
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 329097c7..5b73f16f 100644
Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ
diff --git a/Source/GUIBase/uViewDetallesBase.dfm b/Source/GUIBase/uViewDetallesBase.dfm
index 454b0c9d..5bd258df 100644
--- a/Source/GUIBase/uViewDetallesBase.dfm
+++ b/Source/GUIBase/uViewDetallesBase.dfm
@@ -267,35 +267,56 @@ inherited frViewDetallesBase: TfrViewDetallesBase
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}
+ 36060000424D3606000000000000360000002800000020000000100000000100
+ 18000000000000060000120B0000120B00000000000000000000FFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFC9C9C98989897A7A7A6A6A6A666666A2A2A2FFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAACEE56D
+ 90A15684983D778F336E9389A6B9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFF9D9D9DE5E5E5DADADAB9B9B9AEAEAE636363CDCD
+ CDDDDDDDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5BAADABE
+ FFFFA3FCFF61DBFF4CD0FF1D6FA4C6CED3D7DFE3FFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFEFEFEF9B9B9B7272726E6E6E6F6F6F5E5E5E5E5E
+ 5E696969848484FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE1F1FC5A
+ A8D4337EAA277EAE2C83A827698E26708D2076AB5D8BA8FFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFE7E7E7E7E7E7DCDCDCA8A8A8D9D9D9A7A7A78F8F8F6E6E6E7373
+ 73B1B1B17B7B7BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0B0B0E0B8B0D4C0AB6B
+ B0D4BEEBEB67C0DB3AA7D72179B42B84B252D4FF4F84A3FFFFFFB9B9B98E8E8E
+ 7979797F7F7F8181818282826666667171718888888D8D8D8181819797976363
+ 635F5F5F686868737373BFA297A282779868619D6F689F746BB17C68945C4733
+ 7DA83FA1C5439CCF3593C448ABDC2773961E6B95515F6A99755ED7D7D7F9F9F9
+ DEDEDEE4E4E4DADADAC7C7C7919191ABABAB9595956B6B6B525252606060ACAC
+ AC9898988C8C8C7A7A7AE7D6D0F7FCF6CFF1D8DBF0DDCDEBD1B9E3B253A8C47E
+ B3D36B9DBB2780A5085E9521649E51BDFF2AA4FF578EC0987E67DBDBDBCCCCCC
+ 999999767676737373CDCDCDC8C8C8CDCDCDC6C6C6BEBEBEC0C0C05757577B7B
+ 7B828282B4B4B4868686F0D6D6B9E4C359E08A28CF5F35BF58B8E8BF9CD1F08E
+ E7FF7DE7FF6EDBFF76D5FF15828344AE813DC092A1CAAEAB7D72E0E0E0CCCCCC
+ 6B6B6B777777D6D6D6CFCFCFE0E0E06C6C6C414141B4B4B4BFBFBF9191914A4A
+ 4A393939AFAFAF979797F6D8DAB9E3C217CB543ABF60CCE3CFC1ECBAD7F6CE2B
+ C047009B1190E39FA6E1AE6BC96D229F08008E00ABCF91B78A90DEDEDECCCCCC
+ 7070709C9C9CFFFFFF4646467171716A6A6A6767678585855050508989899C9C
+ 9C414141B4B4B4939393F4D7D9BAE3C31DCE5A7EC48AFFFFFF00B0003DC13A35
+ C42A36BB2C5FC85415B40A61CB5A82BE8B059907A9D19DB68A8AD6D6D6C0C0C0
+ D9D9D9A0A0A0B4B4B4DCDCDCECECECA7A7A7838383CECECEE0E0E0696969BBBB
+ BBAAAAAAA3A3A3939393E8D3D0A7DEB4BEF6D476D28F9DD3A5D4EFCCE7F8E284
+ E27E58C953B8F2B4D8F0D336B03FA3DBAC86DA908DCA88B6898ADDDDDDD6D6D6
+ A7A7A78E8E8E808080D1D1D1D2D2D2C8C8C8C1C1C1CBCBCBBEBEBE6666668484
+ 84797979CACACA898989F1D7D7C2EDCE6DE79A48DC7D3FCC6BB4EECFB1F4CFA4
+ F0C29BECB6A9F0C39FE2B427B6454DCB6441C353B7E5B8AC817FCCCCCCD5D5D5
+ CACACAD4D4D4D5D5D5C5C5C5C3C3C3C6C6C6C6C6C6C0C0C0BFBFBFD1D1D1C1C1
+ C1BEBEBEDBDBDB9E9E9EDDCCC3E1D7CEC8D6C0D9DACCD6DDCDBED5B9BCD3B7C0
+ D4BBC1D4BBBBD0B3BBCEB1D9D6C8C5CBB4C4C9B0E8DCD4B79F91D2D2D2D3D3D3
+ DCDCDCE0E0E0E0E0E0D9D9D9D7D7D7D7D7D7D8D8D8D7D7D7D8D8D8E1E1E1DADA
+ DADDDDDDD8D8D8C0C0C0DED3CAE4D1CCF2D6D7F6D7DBF6D9DBEBD6D3EAD4D2EA
+ D4D2EAD5D2EAD4D2EBD4D2F9D7DDF0D3D5F4D3D9E9D5D2D0C2B6FFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}
Properties.GlyphCount = 2
Properties.ImmediatePost = True
Properties.NullStyle = nssUnchecked
diff --git a/Source/Informes/InfContratoCliente.fr3 b/Source/Informes/InfContratoCliente.fr3
index d4316bcc..8e0735cd 100644
--- a/Source/Informes/InfContratoCliente.fr3
+++ b/Source/Informes/InfContratoCliente.fr3
@@ -1,5 +1,5 @@
-
+
@@ -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 1641339f..8b251f31 100644
Binary files a/Source/Modulos/Contratos de cliente/Model/ContratosCliente_model.res and b/Source/Modulos/Contratos de cliente/Model/ContratosCliente_model.res differ
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
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+