diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index d4516365..db59be65 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\TrueFalse2340FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.3.4.0FactuGESFactuGES2.3.4.0FactuGES.dprFalse +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2400FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.4.0.0FactuGESFactuGES2.4.0.0FactuGES.dprFalse diff --git a/Source/Cliente/FactuGES.rc b/Source/Cliente/FactuGES.rc index f4a002ff..34e40ecf 100644 --- a/Source/Cliente/FactuGES.rc +++ b/Source/Cliente/FactuGES.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo tecsitel\Resources\Iconos\Factuges.ico" 1 VERSIONINFO -FILEVERSION 2,3,4,0 -PRODUCTVERSION 2,3,4,0 +FILEVERSION 2,4,0,0 +PRODUCTVERSION 2,4,0,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.4.0\0" + VALUE "FileVersion", "2.4.0.0\0" VALUE "InternalName", "FactuGES\0" VALUE "ProductName", "FactuGES\0" - VALUE "ProductVersion", "2.3.4.0\0" + VALUE "ProductVersion", "2.4.0.0\0" END END BLOCK "VarFileInfo" diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index a9e78344..7e638f7b 100644 Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ diff --git a/Source/Informes/1/AlbaranCliente.rdx b/Source/Informes/1/AlbaranCliente.rdx index fccb0fea..5ede8a30 100644 Binary files a/Source/Informes/1/AlbaranCliente.rdx and b/Source/Informes/1/AlbaranCliente.rdx differ diff --git a/Source/Informes/1/InfAlbaranCliente.fr3 b/Source/Informes/1/InfAlbaranCliente.fr3 index bbe91dc7..98a2515d 100644 --- a/Source/Informes/1/InfAlbaranCliente.fr3 +++ b/Source/Informes/1/InfAlbaranCliente.fr3 @@ -1,12 +1,12 @@ - + - + @@ -27,7 +27,7 @@ - + diff --git a/Source/Informes/2/AlbaranCliente.rdx b/Source/Informes/2/AlbaranCliente.rdx index 21291e69..fe21a568 100644 Binary files a/Source/Informes/2/AlbaranCliente.rdx and b/Source/Informes/2/AlbaranCliente.rdx differ diff --git a/Source/Informes/2/InfAlbaranCliente.fr3 b/Source/Informes/2/InfAlbaranCliente.fr3 index 48a41af1..b5c269dd 100644 --- a/Source/Informes/2/InfAlbaranCliente.fr3 +++ b/Source/Informes/2/InfAlbaranCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -30,9 +30,7 @@ - - - + @@ -40,5 +38,6 @@ + diff --git a/Source/Informes/2/InformeListadoBeneficiosGrafComp.fr3 b/Source/Informes/2/InformeListadoBeneficiosGrafComp.fr3 index 27065b83..1d108d7e 100644 --- a/Source/Informes/2/InformeListadoBeneficiosGrafComp.fr3 +++ b/Source/Informes/2/InformeListadoBeneficiosGrafComp.fr3 @@ -1,8 +1,8 @@ - + - + @@ -19,15 +19,16 @@ - - + + - + - + + diff --git a/Source/Informes/2/InformeListadoFacturasProveedorGrafComp.fr3 b/Source/Informes/2/InformeListadoFacturasProveedorGrafComp.fr3 index df820868..524bcba1 100644 --- a/Source/Informes/2/InformeListadoFacturasProveedorGrafComp.fr3 +++ b/Source/Informes/2/InformeListadoFacturasProveedorGrafComp.fr3 @@ -1,23 +1,24 @@ - + - + - - + + - + + diff --git a/Source/Informes/3/AlbaranCliente.rdx b/Source/Informes/3/AlbaranCliente.rdx index 0f5b2a53..893c5b50 100644 Binary files a/Source/Informes/3/AlbaranCliente.rdx and b/Source/Informes/3/AlbaranCliente.rdx differ diff --git a/Source/Informes/3/InfAlbaranCliente.fr3 b/Source/Informes/3/InfAlbaranCliente.fr3 index 5ca37b8d..29e57a6a 100644 --- a/Source/Informes/3/InfAlbaranCliente.fr3 +++ b/Source/Informes/3/InfAlbaranCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -19,7 +19,9 @@ - + + + @@ -27,8 +29,8 @@ - - + + diff --git a/Source/Informes/3/InformeListadoBeneficiosGrafComp.fr3 b/Source/Informes/3/InformeListadoBeneficiosGrafComp.fr3 index c3b25328..64571841 100644 --- a/Source/Informes/3/InformeListadoBeneficiosGrafComp.fr3 +++ b/Source/Informes/3/InformeListadoBeneficiosGrafComp.fr3 @@ -1,8 +1,8 @@ - + - + @@ -19,15 +19,16 @@ - - + + - + - + + diff --git a/Source/Informes/3/InformeListadoFacturasProveedorGrafComp.fr3 b/Source/Informes/3/InformeListadoFacturasProveedorGrafComp.fr3 index f9b29aa5..481a9476 100644 --- a/Source/Informes/3/InformeListadoFacturasProveedorGrafComp.fr3 +++ b/Source/Informes/3/InformeListadoFacturasProveedorGrafComp.fr3 @@ -1,23 +1,24 @@ - + - + - - + + - + + diff --git a/Source/Informes/4/AlbaranCliente.rdx b/Source/Informes/4/AlbaranCliente.rdx index a829ab57..50dd72d9 100644 Binary files a/Source/Informes/4/AlbaranCliente.rdx and b/Source/Informes/4/AlbaranCliente.rdx differ diff --git a/Source/Informes/4/InfAlbaranCliente.fr3 b/Source/Informes/4/InfAlbaranCliente.fr3 index a121e3f2..d0880653 100644 --- a/Source/Informes/4/InfAlbaranCliente.fr3 +++ b/Source/Informes/4/InfAlbaranCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -32,7 +32,7 @@ - + diff --git a/Source/Informes/5/AlbaranCliente.rdx b/Source/Informes/5/AlbaranCliente.rdx index f60b1e7f..96157c26 100644 Binary files a/Source/Informes/5/AlbaranCliente.rdx and b/Source/Informes/5/AlbaranCliente.rdx differ diff --git a/Source/Informes/5/InfAlbaranCliente.fr3 b/Source/Informes/5/InfAlbaranCliente.fr3 index b8d07bb1..c1165400 100644 --- a/Source/Informes/5/InfAlbaranCliente.fr3 +++ b/Source/Informes/5/InfAlbaranCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -23,13 +23,13 @@ - + - + diff --git a/Source/Modulos/Albaranes de cliente/Reports/uRptWordAlbaranCliente.pas b/Source/Modulos/Albaranes de cliente/Reports/uRptWordAlbaranCliente.pas index 578d77ad..531bff02 100644 --- a/Source/Modulos/Albaranes de cliente/Reports/uRptWordAlbaranCliente.pas +++ b/Source/Modulos/Albaranes de cliente/Reports/uRptWordAlbaranCliente.pas @@ -180,6 +180,18 @@ begin ReplaceBookmark('FaxEmpresa', tbl_Empresa.FieldByName('FAX').AsString); if BookmarkExists('CorreoEmpresa') then ReplaceBookmark('CorreoEmpresa', tbl_Empresa.FieldByName('EMAIL_1').AsString); + + if BookmarkExists('ImporteTotal') then + if ImprimirPrecio then + begin + ReplaceBookmark('ImporteTotal', FormatFloat(DISPLAY_EUROS2, FieldByName('IMPORTE_TOTAL').AsFloat)); + end + else + begin + ReplaceBookmark('ImporteTotal', ''); + if BookmarkExists('DescripcionImporteTotal') then + ReplaceBookmark('DescripcionImporteTotal', ''); + end; end; end; diff --git a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm index 01a1c649..fecfa67e 100644 --- a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm +++ b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm @@ -2379,7 +2379,63 @@ object RptFacturasCliente: TRptFacturasCliente Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -2449,19 +2505,21 @@ object RptFacturasCliente: TRptFacturasCliente '(VALOR = periodo_ingresos1.NFILA)'#10#10'left join'#10'(select comp2.ID_EM' + 'PRESA, comp2.ANO, MES as NFILA, SUM(comp2.BASE_IMPONIBLE) as IMP' + 'ORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp2'#10'where ID_EMPRESA = :ID' + - '_EMPRESA1'#10'and (ANO = :ANO1)'#10'and (comp2.ID_TIPO_FACTURA = :ID_TIP' + - 'O_GASTO)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo_gastos1 o' + - 'n (VALOR = periodo_gastos1.NFILA)'#10#10'left join'#10'(select comp3.ID_EM' + - 'PRESA, comp3.ANO, MES as NFILA, SUM(comp3.BASE_IMPONIBLE) as IMP' + - 'ORTE_TOTAL'#10'from V_INF_FAC_CLIENTE comp3'#10'where ID_EMPRESA = :ID_E' + - 'MPRESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) ' + - 'periodo_ingresos2 on (VALOR = periodo_ingresos2.NFILA)'#10#10'left joi' + - 'n'#10'(select comp4.ID_EMPRESA, comp4.ANO, MES as NFILA, SUM(comp4.B' + - 'ASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp4'#10'w' + - 'here ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'and (comp4.ID_T' + - 'IPO_FACTURA = :ID_TIPO_GASTO)'#10'group by 1,2,3'#10'order by 1 desc,2 a' + - 'sc) periodo_gastos2 on (VALOR = periodo_gastos2.NFILA)'#10#10#10'where p' + - 'eriodo= '#39'MENSUAL'#39#10'order by valor asc'#10 + '_EMPRESA1'#10'and (ANO = :ANO1)'#10'AND comp2.ID_TIPO_FACTURA in (:T1,:T' + + '2,:T3,:T4,:T5,:T6,:T7,:T8,:T9,:T10,:T11,:T12,:T13,:T14,:T15)'#10'gro' + + 'up by 1,2,3'#10'order by 1 desc,2 asc) periodo_gastos1 on (VALOR = p' + + 'eriodo_gastos1.NFILA)'#10#10'left join'#10'(select comp3.ID_EMPRESA, comp3' + + '.ANO, MES as NFILA, SUM(comp3.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'f' + + 'rom V_INF_FAC_CLIENTE comp3'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and ' + + '(ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo_ingr' + + 'esos2 on (VALOR = periodo_ingresos2.NFILA)'#10#10'left join'#10'(select co' + + 'mp4.ID_EMPRESA, comp4.ANO, MES as NFILA, SUM(comp4.BASE_IMPONIBL' + + 'E) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp4'#10'where ID_EMPR' + + 'ESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'AND comp4.ID_TIPO_FACTURA i' + + 'n (:T1,:T2,:T3,:T4,:T5,:T6,:T7,:T8,:T9,:T10,:T11,:T12,:T13,:T14,' + + ':T15)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo_gastos2 on (' + + 'VALOR = periodo_gastos2.NFILA)'#10#10#10'where periodo= '#39'MENSUAL'#39#10'order ' + + 'by valor asc'#10 StatementType = stSQL ColumnMappings = < item @@ -2640,7 +2698,63 @@ object RptFacturasCliente: TRptFacturasCliente Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -2710,19 +2824,21 @@ object RptFacturasCliente: TRptFacturasCliente 's1 on (VALOR = periodo_ingresos1.NFILA)'#10#10'left join'#10'(select comp2' + '.ID_EMPRESA, comp2.ANO, SEMESTRE as NFILA, SUM(comp2.BASE_IMPONI' + 'BLE) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp2'#10'where ID_EM' + - 'PRESA = :ID_EMPRESA1'#10'and (ANO = :ANO1)'#10'and (comp2.ID_TIPO_FACTUR' + - 'A = :ID_TIPO_GASTO)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) period' + - 'o_gastos1 on (VALOR = periodo_gastos1.NFILA)'#10#10'left join'#10'(select ' + - 'comp3.ID_EMPRESA, comp3.ANO, SEMESTRE as NFILA, SUM(comp3.BASE_I' + - 'MPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_FAC_CLIENTE comp3'#10'where ID' + - '_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order b' + - 'y 1 desc,2 asc) periodo_ingresos2 on (VALOR = periodo_ingresos2.' + - 'NFILA)'#10#10'left join'#10'(select comp4.ID_EMPRESA, comp4.ANO, SEMESTRE ' + - 'as NFILA, SUM(comp4.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_' + - 'FAC_PROVEEDOR comp4'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :' + - 'ANO2)'#10'and (comp4.ID_TIPO_FACTURA = :ID_TIPO_GASTO)'#10'group by 1,2,' + - '3'#10'order by 1 desc,2 asc) periodo_gastos2 on (VALOR = periodo_gas' + - 'tos2.NFILA)'#10#10#10'where periodo= '#39'SEMESTRAL'#39#10'order by valor asc'#10 + 'PRESA = :ID_EMPRESA1'#10'and (ANO = :ANO1)'#10'AND comp2.ID_TIPO_FACTURA' + + ' in (:T1,:T2,:T3,:T4,:T5,:T6,:T7,:T8,:T9,:T10,:T11,:T12,:T13,:T1' + + '4,:T15)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo_gastos1 on' + + ' (VALOR = periodo_gastos1.NFILA)'#10#10'left join'#10'(select comp3.ID_EMP' + + 'RESA, comp3.ANO, SEMESTRE as NFILA, SUM(comp3.BASE_IMPONIBLE) as' + + ' IMPORTE_TOTAL'#10'from V_INF_FAC_CLIENTE comp3'#10'where ID_EMPRESA = :' + + 'ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 a' + + 'sc) periodo_ingresos2 on (VALOR = periodo_ingresos2.NFILA)'#10#10'left' + + ' join'#10'(select comp4.ID_EMPRESA, comp4.ANO, SEMESTRE as NFILA, SU' + + 'M(comp4.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDO' + + 'R comp4'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'AND co' + + 'mp4.ID_TIPO_FACTURA in (:T1,:T2,:T3,:T4,:T5,:T6,:T7,:T8,:T9,:T10' + + ',:T11,:T12,:T13,:T14,:T15)'#10'group by 1,2,3'#10'order by 1 desc,2 asc)' + + ' periodo_gastos2 on (VALOR = periodo_gastos2.NFILA)'#10#10#10'where peri' + + 'odo= '#39'SEMESTRAL'#39#10'order by valor asc'#10 StatementType = stSQL ColumnMappings = < item @@ -2901,7 +3017,63 @@ object RptFacturasCliente: TRptFacturasCliente Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -2971,20 +3143,21 @@ object RptFacturasCliente: TRptFacturasCliente 'os1 on (VALOR = periodo_ingresos1.NFILA)'#10#10'left join'#10'(select comp' + '2.ID_EMPRESA, comp2.ANO, TRIMESTRE as NFILA, SUM(comp2.BASE_IMPO' + 'NIBLE) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp2'#10'where ID_' + - 'EMPRESA = :ID_EMPRESA1'#10'and (ANO = :ANO1)'#10'and (comp2.ID_TIPO_FACT' + - 'URA = :ID_TIPO_GASTO)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) peri' + - 'odo_gastos1 on (VALOR = periodo_gastos1.NFILA)'#10#10'left join'#10'(selec' + - 't comp3.ID_EMPRESA, comp3.ANO, TRIMESTRE as NFILA, SUM(comp3.BAS' + - 'E_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_FAC_CLIENTE comp3'#10'where' + - ' ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'orde' + - 'r by 1 desc,2 asc) periodo_ingresos2 on (VALOR = periodo_ingreso' + - 's2.NFILA)'#10#10'left join'#10'(select comp4.ID_EMPRESA, comp4.ANO, TRIMES' + - 'TRE as NFILA, SUM(comp4.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_' + - 'INF_FAC_PROVEEDOR comp4'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO' + - ' = :ANO2)'#10'and (comp4.ID_TIPO_FACTURA = :ID_TIPO_GASTO)'#10'group by ' + - '1,2,3'#10'order by 1 desc,2 asc) periodo_gastos2 on (VALOR = periodo' + - '_gastos2.NFILA)'#10#10#10'where periodo= '#39'TRIMESTRAL'#39#10'order by valor asc' + - #10 + 'EMPRESA = :ID_EMPRESA1'#10'and (ANO = :ANO1)'#10'AND comp2.ID_TIPO_FACTU' + + 'RA in (:T1,:T2,:T3,:T4,:T5,:T6,:T7,:T8,:T9,:T10,:T11,:T12,:T13,:' + + 'T14,:T15)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo_gastos1 ' + + 'on (VALOR = periodo_gastos1.NFILA)'#10#10'left join'#10'(select comp3.ID_E' + + 'MPRESA, comp3.ANO, TRIMESTRE as NFILA, SUM(comp3.BASE_IMPONIBLE)' + + ' as IMPORTE_TOTAL'#10'from V_INF_FAC_CLIENTE comp3'#10'where ID_EMPRESA ' + + '= :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,' + + '2 asc) periodo_ingresos2 on (VALOR = periodo_ingresos2.NFILA)'#10#10'l' + + 'eft join'#10'(select comp4.ID_EMPRESA, comp4.ANO, TRIMESTRE as NFILA' + + ', SUM(comp4.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROV' + + 'EEDOR comp4'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'AN' + + 'D comp4.ID_TIPO_FACTURA in (:T1,:T2,:T3,:T4,:T5,:T6,:T7,:T8,:T9,' + + ':T10,:T11,:T12,:T13,:T14,:T15)'#10'group by 1,2,3'#10'order by 1 desc,2 ' + + 'asc) periodo_gastos2 on (VALOR = periodo_gastos2.NFILA)'#10#10#10'where ' + + 'periodo= '#39'TRIMESTRAL'#39#10'order by valor asc'#10 StatementType = stSQL ColumnMappings = < item @@ -5321,7 +5494,63 @@ object RptFacturasCliente: TRptFacturasCliente Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -5436,7 +5665,63 @@ object RptFacturasCliente: TRptFacturasCliente Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -5551,7 +5836,63 @@ object RptFacturasCliente: TRptFacturasCliente Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item diff --git a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas index 7f7529f5..236106d9 100644 --- a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas +++ b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas @@ -110,10 +110,10 @@ type frxDBDInformeIVAComparativoFacturasPro: TfrxDBDataset; DADSInformeIVAComparativoFacturasPro: TDADataSource; tbl_InformeIVAComparativoFacturasPro: TDAMemDataTable; - schReport: TDASchema; tbl_InformeListadoBeneficiosGrafCompSemestralTipoGasto: TDAMemDataTable; tbl_InformeListadoBeneficiosGrafCompTrimestralTipoGasto: TDAMemDataTable; tbl_InformeListadoBeneficiosGrafCompMensualTipoGasto: TDAMemDataTable; + schReport: TDASchema; procedure DataModuleCreate(Sender: TObject); procedure DataModuleDestroy(Sender: TObject); private @@ -141,6 +141,7 @@ type procedure PrepararTablaResumenInforme(ATabla: IDADataset); procedure PrepararTablaInformeGrafComp(ATabla: TDAMemDataTable); procedure PrepararTablaResumenInformeGrafComp(ATabla: TDAMemDataTable); + procedure RellenarParametro(ANombreParametro: String; AID: Integer; AListaIDTiposGasto: TIntegerArray; ATabla: TDADataSource); function _GenerarInforme(const TipoInforme: String): Binary; procedure IniciarParametrosInforme; procedure RecuperarNombresClientes; @@ -246,6 +247,7 @@ var AStream: TMemoryStream; AInforme: Variant; ACadena: TStringList; + i: Integer; begin FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO" @@ -267,28 +269,18 @@ begin FListaNombreTiposGasto := ListaNombreTiposGasto; //Cargamos las tablas con parametro ID_TIPO_GASTO - if (FListaIDTiposdeGasto.Count = 1) then - begin - //Preparamos la tabla correspondiente y la abrimos para el informe - if (FIntervalo = CTE_MENSUAL) then - PrepararTablaInformeGrafComp(tbl_InformeListadoBeneficiosGrafCompMensualTipoGasto) - else if (FIntervalo = CTE_TRIMESTRAL) then - PrepararTablaInformeGrafComp(tbl_InformeListadoBeneficiosGrafCompTrimestralTipoGasto) - else - PrepararTablaInformeGrafComp(tbl_InformeListadoBeneficiosGrafCompSemestralTipoGasto); - - DASInformeListadoFacturasGrafComp.DataTable.ParamByName('ID_TIPO_GASTO').AsInteger := FListaIDTiposdeGasto.Items[0]; - end + //Preparamos la tabla correspondiente y la abrimos para el informe + if (FIntervalo = CTE_MENSUAL) then + PrepararTablaInformeGrafComp(tbl_InformeListadoBeneficiosGrafCompMensualTipoGasto) + else if (FIntervalo = CTE_TRIMESTRAL) then + PrepararTablaInformeGrafComp(tbl_InformeListadoBeneficiosGrafCompTrimestralTipoGasto) else - begin - //Preparamos la tabla correspondiente y la abrimos para el informe - if (FIntervalo = CTE_MENSUAL) then - PrepararTablaInformeGrafComp(tbl_InformeListadoBeneficiosGrafCompMensual) - else if (FIntervalo = CTE_TRIMESTRAL) then - PrepararTablaInformeGrafComp(tbl_InformeListadoBeneficiosGrafCompTrimestral) - else - PrepararTablaInformeGrafComp(tbl_InformeListadoBeneficiosGrafCompSemestral); - end; + PrepararTablaInformeGrafComp(tbl_InformeListadoBeneficiosGrafCompSemestralTipoGasto); + + //Rellenamos los 15 parametros de tipos de gasto (1..15, en caso de estar filtrado a 0 + for i := 1 to 15 do + RellenarParametro('T' + IntToStr(i), i, FListaIDTiposdeGasto, DASInformeListadoFacturasGrafComp); +// DASInformeListadoFacturasGrafComp.DataTable.ParamByName('ID_TIPO_GASTO').AsInteger := FListaIDTiposdeGasto.Items[0]; DASInformeListadoFacturasGrafComp.DataTable.Active := True; Result := Binary.Create; @@ -305,7 +297,9 @@ begin if Assigned(FListaIDTiposdeGasto) and (FListaIDTiposdeGasto.Count > 0) then begin ACadena.Clear; - ACadena.Add('Solo tipo de gasto ' + FListaNombreTiposGasto.Items[0]); + ACadena.Add('Solo tipo de gasto: '); + for i := 0 to FListaNombreTiposGasto.Count - 1 do + ACadena.Add(FListaNombreTiposGasto.Items[i]); end; frxReport.Variables.Variables['TextoParametros']:= ACadena.Text; @@ -889,6 +883,15 @@ begin end; end; +procedure TRptFacturasCliente.RellenarParametro(ANombreParametro: String; AID: Integer; AListaIDTiposGasto: TIntegerArray; ATabla: TDADataSource); +begin + if (AListaIDTiposGasto.Count > AID-1) + then ATabla.DataTable.ParamByName(ANombreParametro).AsInteger := FListaIDTiposdeGasto.Items[AID-1] + else if (AListaIDTiposGasto.Count <> 0) then + ATabla.DataTable.ParamByName(ANombreParametro).AsInteger := 0 + else ATabla.DataTable.ParamByName(ANombreParametro).AsInteger := AID; +end; + procedure TRptFacturasCliente._GenerarFactura(const ID: Integer; const VerSello: Boolean = True; const VerCopia: Boolean = True); var AInforme: Variant; diff --git a/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas b/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas index 3fea84da..aeeec8f7 100644 --- a/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas +++ b/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas @@ -50,7 +50,8 @@ type function EsEliminable(AFactura: IBizFacturaProveedor): Boolean; function ElegirFacturas(AFacturas : IBizFacturaProveedor; AMensaje: String; AMultiSelect: Boolean): IBizFacturaProveedor; - function ExtraerSeleccionados(ARecibosProveedor: IBizFacturaProveedor) : IBizFacturaProveedor; + function ExtraerSeleccionados(ARecibosProveedor: IBizFacturaProveedor) : IBizFacturaProveedor; overload; + function ExtraerSeleccionados(ATiposFacturasProveedor: IBizTiposFacturaProveedor) : IBizTiposFacturaProveedor; overload; function DarListaAnosFacturas: TStringList; procedure FiltrarAno(AFactura: IBizFacturaProveedor; ADynWhereDataTable: WideString; const Ano: String); @@ -122,7 +123,8 @@ type function EsEliminable(AFactura: IBizFacturaProveedor): Boolean; function ElegirFacturas(AFacturas : IBizFacturaProveedor; AMensaje: String; AMultiSelect: Boolean): IBizFacturaProveedor; - function ExtraerSeleccionados(AFacturasProveedor: IBizFacturaProveedor) : IBizFacturaProveedor; + function ExtraerSeleccionados(AFacturasProveedor: IBizFacturaProveedor) : IBizFacturaProveedor; overload; + function ExtraerSeleccionados(ATiposFacturasProveedor: IBizTiposFacturaProveedor) : IBizTiposFacturaProveedor; overload; function DarListaAnosFacturas: TStringList; procedure FiltrarAno(AFactura: IBizFacturaProveedor; ADynWhereDataTable: WideString; const Ano: String); @@ -621,6 +623,11 @@ begin if (AFactura.Detalles.DataTable.RecordCount = 0) then raise Exception.Create('La factura debe tener al menos un concepto en su contenido'); + { Esta validacin puede saltar cuando se generan facturas automticamente + por albaranes o pedidos y el Proveedor no tiene Tipo de IVA puesto. } + if (AFactura.ID_TIPO_FACTURA = 0) then + raise Exception.Create('Debe indicar un tipo de gasto para esta factura'); + { Esta validacin puede saltar cuando se generan facturas automticamente por albaranes o pedidos y el Proveedor no tiene Tipo de IVA puesto. } { if (AFactura.ID_TIPO_IVA = 0) then @@ -919,6 +926,15 @@ begin end; end; +function TFacturasProveedorController.ExtraerSeleccionados(ATiposFacturasProveedor: IBizTiposFacturaProveedor): IBizTiposFacturaProveedor; +var + ASeleccionados : IBizTiposFacturaProveedor; +begin + ASeleccionados := (darTiposFacturaProveedor as IBizTiposFacturaProveedor); + CopyDataTableDA5(ATiposFacturasProveedor.DataTable, ASeleccionados.DataTable, True); + Result := ASeleccionados; +end; + function TFacturasProveedorController.ExtraerSeleccionados(AFacturasProveedor: IBizFacturaProveedor): IBizFacturaProveedor; var ASeleccionados : IBizFacturaProveedor; diff --git a/Source/Modulos/Facturas de proveedor/Model/uBizFacturasProveedor.pas b/Source/Modulos/Facturas de proveedor/Model/uBizFacturasProveedor.pas index 5ff0b3ff..be9ca843 100644 --- a/Source/Modulos/Facturas de proveedor/Model/uBizFacturasProveedor.pas +++ b/Source/Modulos/Facturas de proveedor/Model/uBizFacturasProveedor.pas @@ -48,7 +48,14 @@ type procedure CalcularImporteTotal; end; - TBizTiposFacturaProveedor = class(TTiposFacturaProveedorDataTableRules, IBizTiposFacturaProveedor) + TBizTiposFacturaProveedor = class(TTiposFacturaProveedorDataTableRules, IBizTiposFacturaProveedor, ISeleccionable) + private + FSeleccionableInterface : ISeleccionable; + public + property SeleccionableInterface : ISeleccionable read FSeleccionableInterface + write FSeleccionableInterface implements ISeleccionable; + constructor Create(aDataTable: TDADataTable); override; + destructor Destroy; override; end; TBizFacturaProveedor = class(TFacturasProveedorDataTableRules, IBizFacturaProveedor, ISeleccionable) @@ -303,6 +310,7 @@ begin RE := 0; SITUACION := CTE_PENDIENTE; FACTURA_WEB := 0; + ID_TIPO_FACTURA := 15; //COMPRAS POR DEFECTO end; procedure TBizFacturaProveedor.IVAOnChange(Sender: TDACustomField); @@ -388,6 +396,20 @@ begin FProveedor := AValue; end; +{ TBizTiposFacturaProveedor } + +constructor TBizTiposFacturaProveedor.Create(aDataTable: TDADataTable); +begin + inherited; + FSeleccionableInterface := TSeleccionable.Create(aDataTable); +end; + +destructor TBizTiposFacturaProveedor.Destroy; +begin + FSeleccionableInterface := NIL; + inherited; +end; + initialization RegisterDataTableRules(BIZ_CLIENT_FACTURA_PROVEEDOR, TBizFacturaProveedor); RegisterDataTableRules(BIZ_CLIENT_TIPOS_FACTURA_PROVEEDOR, TBizTiposFacturaProveedor); diff --git a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm index cb1bbbf9..85132e7f 100644 --- a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm +++ b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm @@ -1537,7 +1537,63 @@ object RptFacturasProveedor: TRptFacturasProveedor Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -1562,14 +1618,15 @@ object RptFacturasProveedor: TRptFacturasProveedor 'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.ANO, MES ' + 'as NFILA, SUM(comp1.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_' + 'FAC_PROVEEDOR comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10'and (ANO = :' + - 'ANO1)'#10'and (ID_TIPO_FACTURA = :ID_TIPO_GASTO)'#10'group by 1,2,3'#10'orde' + - 'r by 1 desc,2 asc) periodo1 on (VALOR = periodo1.NFILA)'#10#10'left jo' + - 'in'#10'(select comp2.ID_EMPRESA, comp2.ANO, MES as NFILA, SUM(comp2.' + - 'BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp2'#10 + - 'where ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'and (ID_TIPO_F' + - 'ACTURA = :ID_TIPO_GASTO)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) p' + - 'eriodo2 on (VALOR = periodo2.NFILA)'#10#10'where periodo= '#39'MENSUAL'#39#10'or' + - 'der by valor asc'#10#10 + 'ANO1)'#10'AND ID_TIPO_FACTURA in (:T1,:T2,:T3,:T4,:T5,:T6,:T7,:T8,:T' + + '9,:T10,:T11,:T12,:T13,:T14,:T15)'#10'group by 1,2,3'#10'order by 1 desc,' + + '2 asc) periodo1 on (VALOR = periodo1.NFILA)'#10#10'left join'#10'(select c' + + 'omp2.ID_EMPRESA, comp2.ANO, MES as NFILA, SUM(comp2.BASE_IMPONIB' + + 'LE) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp2'#10'where ID_EMP' + + 'RESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'AND ID_TIPO_FACTURA in (:T' + + '1,:T2,:T3,:T4,:T5,:T6,:T7,:T8,:T9,:T10,:T11,:T12,:T13,:T14,:T15)' + + #10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo2 on (VALOR = peri' + + 'odo2.NFILA)'#10#10'where periodo= '#39'MENSUAL'#39#10'order by valor asc'#10#10 StatementType = stSQL ColumnMappings = < item @@ -1652,7 +1709,63 @@ object RptFacturasProveedor: TRptFacturasProveedor Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -1677,14 +1790,16 @@ object RptFacturasProveedor: TRptFacturasProveedor 'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.ANO, SEME' + 'STRE as NFILA, SUM(comp1.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V' + '_INF_FAC_PROVEEDOR comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10'and (AN' + - 'O = :ANO1)'#10'and (ID_TIPO_FACTURA = :ID_TIPO_GASTO)'#10'group by 1,2,3' + - #10'order by 1 desc,2 asc) periodo1 on (VALOR = periodo1.NFILA)'#10#10'le' + - 'ft join'#10'(select comp2.ID_EMPRESA, comp2.ANO, SEMESTRE as NFILA, ' + - 'SUM(comp2.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEE' + - 'DOR comp2'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'and ' + - '(ID_TIPO_FACTURA = :ID_TIPO_GASTO)'#10'group by 1,2,3'#10'order by 1 des' + - 'c,2 asc) periodo2 on (VALOR = periodo2.NFILA)'#10#10'where periodo= '#39'S' + - 'EMESTRAL'#39#10'order by valor asc'#10#10#10 + 'O = :ANO1)'#10'AND ID_TIPO_FACTURA in (:T1,:T2,:T3,:T4,:T5,:T6,:T7,:' + + 'T8,:T9,:T10,:T11,:T12,:T13,:T14,:T15)'#10'group by 1,2,3'#10'order by 1 ' + + 'desc,2 asc) periodo1 on (VALOR = periodo1.NFILA)'#10#10'left join'#10'(sel' + + 'ect comp2.ID_EMPRESA, comp2.ANO, SEMESTRE as NFILA, SUM(comp2.BA' + + 'SE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp2'#10'wh' + + 'ere ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'AND ID_TIPO_FACT' + + 'URA in (:T1,:T2,:T3,:T4,:T5,:T6,:T7,:T8,:T9,:T10,:T11,:T12,:T13,' + + ':T14,:T15)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo2 on (VA' + + 'LOR = periodo2.NFILA)'#10#10'where periodo= '#39'SEMESTRAL'#39#10'order by valor' + + ' asc'#10#10#10 StatementType = stSQL ColumnMappings = < item @@ -1767,7 +1882,63 @@ object RptFacturasProveedor: TRptFacturasProveedor Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -1792,14 +1963,16 @@ object RptFacturasProveedor: TRptFacturasProveedor 'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.ANO, TRIM' + 'ESTRE as NFILA, SUM(comp1.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from ' + 'V_INF_FAC_PROVEEDOR comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10'and (A' + - 'NO = :ANO1)'#10'and (ID_TIPO_FACTURA = :ID_TIPO_GASTO)'#10'group by 1,2,' + - '3'#10'order by 1 desc,2 asc) periodo1 on (VALOR = periodo1.NFILA)'#10#10'l' + - 'eft join'#10'(select comp2.ID_EMPRESA, comp2.ANO, TRIMESTRE as NFILA' + - ', SUM(comp2.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROV' + - 'EEDOR comp2'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'an' + - 'd (ID_TIPO_FACTURA = :ID_TIPO_GASTO)'#10'group by 1,2,3'#10'order by 1 d' + - 'esc,2 asc) periodo2 on (VALOR = periodo2.NFILA)'#10#10'where periodo= ' + - #39'TRIMESTRAL'#39#10'order by valor asc'#10#10#10 + 'NO = :ANO1)'#10'AND ID_TIPO_FACTURA in (:T1,:T2,:T3,:T4,:T5,:T6,:T7,' + + ':T8,:T9,:T10,:T11,:T12,:T13,:T14,:T15)'#10'group by 1,2,3'#10'order by 1' + + ' desc,2 asc) periodo1 on (VALOR = periodo1.NFILA)'#10#10'left join'#10'(se' + + 'lect comp2.ID_EMPRESA, comp2.ANO, TRIMESTRE as NFILA, SUM(comp2.' + + 'BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp2'#10 + + 'where ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'AND ID_TIPO_FA' + + 'CTURA in (:T1,:T2,:T3,:T4,:T5,:T6,:T7,:T8,:T9,:T10,:T11,:T12,:T1' + + '3,:T14,:T15)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo2 on (' + + 'VALOR = periodo2.NFILA)'#10#10'where periodo= '#39'TRIMESTRAL'#39#10'order by va' + + 'lor asc'#10#10#10 StatementType = stSQL ColumnMappings = < item @@ -1882,7 +2055,63 @@ object RptFacturasProveedor: TRptFacturasProveedor Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -1900,8 +2129,9 @@ object RptFacturasProveedor: TRptFacturasProveedor ' 0 then 0'#10'else ((SUM(P.IMPORTE_DESCUENTO) * 100) / SUM(P.IMPORTE' + '_TOTAL)) end as PORCENTAJE'#10#10'from V_INF_FAC_PROVEEDOR P'#10'left join' + ' CONTACTOS C on P.ID_PROVEEDOR = C.ID'#10#10'where p.ID_EMPRESA = :ID_' + - 'EMPRESA'#10'and P.ANO = :ANO'#10'and ID_TIPO_FACTURA = :ID_TIPO_GASTO'#10'gr' + - 'oup by 1,2,3'#10'order by 1,5 desc'#10'rows 1 to :NTOP'#10#10#10 + 'EMPRESA'#10'and P.ANO = :ANO'#10'AND ID_TIPO_FACTURA in (:T1,:T2,:T3,:T4' + + ',:T5,:T6,:T7,:T8,:T9,:T10,:T11,:T12,:T13,:T14,:T15)'#10'group by 1,2' + + ',3'#10'order by 1,5 desc'#10'rows 1 to :NTOP'#10#10#10 StatementType = stSQL ColumnMappings = < item @@ -1980,7 +2210,63 @@ object RptFacturasProveedor: TRptFacturasProveedor Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -1997,8 +2283,9 @@ object RptFacturasProveedor: TRptFacturasProveedor '= 0 then 0'#10'else ((SUM(P.IMPORTE_TOTAL)*100)/p.Importe_TOTAL_ANO)' + #10'end as PORCENTAJE'#10#10'from V_INF_FAC_PROVEEDOR P'#10'left join CONTACT' + 'OS C on P.ID_PROVEEDOR = C.ID'#10#10'where p.ID_EMPRESA = :ID_EMPRESA'#10 + - 'and P.ANO = :ANO'#10'and P.ID_TIPO_FACTURA = :ID_TIPO_GASTO'#10'group by' + - ' 1,2,3,4'#10'order by 1,6 desc'#10'rows 1 to :NTOP'#10#10#10 + 'and P.ANO = :ANO'#10'AND ID_TIPO_FACTURA in (:T1,:T2,:T3,:T4,:T5,:T6' + + ',:T7,:T8,:T9,:T10,:T11,:T12,:T13,:T14,:T15)'#10'group by 1,2,3,4'#10'ord' + + 'er by 1,6 desc'#10'rows 1 to :NTOP'#10#10#10 StatementType = stSQL ColumnMappings = < item @@ -3023,7 +3310,63 @@ object RptFacturasProveedor: TRptFacturasProveedor Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -3090,7 +3433,63 @@ object RptFacturasProveedor: TRptFacturasProveedor Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -3108,7 +3507,7 @@ object RptFacturasProveedor: TRptFacturasProveedor LocalDataStreamer = Bin2DataStreamer LogicalName = 'InformeListadoFacturasGrafCompTrimestralTipoGasto' IndexDefs = <> - Left = 304 + Left = 296 Top = 448 end object tbl_InformeListadoFacturasGrafCompSemestralTipoGasto: TDAMemDataTable @@ -3157,7 +3556,63 @@ object RptFacturasProveedor: TRptFacturasProveedor Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -3221,7 +3676,63 @@ object RptFacturasProveedor: TRptFacturasProveedor Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item @@ -3281,7 +3792,63 @@ object RptFacturasProveedor: TRptFacturasProveedor Value = '' end item - Name = 'ID_TIPO_GASTO' + Name = 'T1' + Value = '' + end + item + Name = 'T2' + Value = '' + end + item + Name = 'T3' + Value = '' + end + item + Name = 'T4' + Value = '' + end + item + Name = 'T5' + Value = '' + end + item + Name = 'T6' + Value = '' + end + item + Name = 'T7' + Value = '' + end + item + Name = 'T8' + Value = '' + end + item + Name = 'T9' + Value = '' + end + item + Name = 'T10' + Value = '' + end + item + Name = 'T11' + Value = '' + end + item + Name = 'T12' + Value = '' + end + item + Name = 'T13' + Value = '' + end + item + Name = 'T14' + Value = '' + end + item + Name = 'T15' Value = '' end item diff --git a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas index 3738ed5f..575893bc 100644 --- a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas +++ b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas @@ -81,6 +81,7 @@ type procedure PrepararTablaResumenInforme(ATabla: IDADataset); procedure PrepararTablaInformeGrafComp(ATabla: TDAMemDataTable); procedure PrepararTablaResumenInformeGrafComp(ATabla: TDAMemDataTable); + procedure RellenarParametro(ANombreParametro: String; AID: Integer; AListaIDTiposGasto: TIntegerArray; ATabla: TDADataSource); procedure IniciarParametrosInforme; function _GenerarInforme(const TipoInforme: String): Binary; public @@ -142,6 +143,7 @@ var AStream: TMemoryStream; AInforme: Variant; ACadena: TStringList; + i: Integer; begin FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO" @@ -167,17 +169,13 @@ begin FreeAndNil(FListaNombreTiposGasto); FListaNombreTiposGasto := ListaNombreTiposGasto; - //Cargamos las tablas con parametro ID_TIPO_GASTO - if (FListaIDTiposdeGasto.Count = 1) then - begin - //Preparamos la tabla correspondiente y la abrimos para el informe - if (FIntervalo = CTE_MENSUAL) then - PrepararTablaInformeGrafComp(InformeListadoFacturasGrafCompMensualTipoGasto) - else if (FIntervalo = CTE_TRIMESTRAL) then - PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompTrimestralTipoGasto) - else - PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompSemestralTipoGasto); - + //Preparamos la tabla correspondiente y la abrimos para el informe + if (FIntervalo = CTE_MENSUAL) then + PrepararTablaInformeGrafComp(InformeListadoFacturasGrafCompMensualTipoGasto) + else if (FIntervalo = CTE_TRIMESTRAL) then + PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompTrimestralTipoGasto) + else + PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompSemestralTipoGasto); //Se preparan las tablas del listado resumen del informe PrepararTablaResumenInformeGrafComp(tbl_InformeListadoProveedoresMayorFacturacionResumenTipoGasto); @@ -185,27 +183,9 @@ begin DADSInformeListadoProveedoresMayorFacturacionResumen.DataTable := tbl_InformeListadoProveedoresMayorFacturacionResumenTipoGasto; DADSInformeListadoProveedoresMayorDescuentoResumen.DataTable := tbl_InformeListadoProveedoresMayorDescuentoResumenTipoGasto; - DASInformeListadoFacturasGrafComp.DataTable.ParamByName('ID_TIPO_GASTO').AsInteger := FListaIDTiposdeGasto.Items[0]; - DADSInformeListadoProveedoresMayorFacturacionResumen.DataTable.ParamByName('ID_TIPO_GASTO').AsInteger := FListaIDTiposdeGasto.Items[0]; - DADSInformeListadoProveedoresMayorDescuentoResumen.DataTable.ParamByName('ID_TIPO_GASTO').AsInteger := FListaIDTiposdeGasto.Items[0]; - end - //El el caso de todas las facturas llamaremos a las tablas sin filtro - else - begin - //Preparamos la tabla correspondiente y la abrimos para el informe - if (FIntervalo = CTE_MENSUAL) then - PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompMensual) - else if (FIntervalo = CTE_TRIMESTRAL) then - PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompTrimestral) - else - PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompSemestral); - - //Se preparan las tablas del listado resumen del informe - PrepararTablaResumenInformeGrafComp(tbl_InformeListadoProveedoresMayorFacturacionResumen); - PrepararTablaResumenInformeGrafComp(tbl_InformeListadoProveedoresMayorDescuentoResumen); - DADSInformeListadoProveedoresMayorFacturacionResumen.DataTable := tbl_InformeListadoProveedoresMayorFacturacionResumen; - DADSInformeListadoProveedoresMayorDescuentoResumen.DataTable := tbl_InformeListadoProveedoresMayorDescuentoResumen; - end; + //Rellenamos los 15 parametros de tipos de gasto (1..15, en caso de estar filtrado a 0 + for i := 1 to 15 do + RellenarParametro('T' + IntToStr(i), i, FListaIDTiposdeGasto, DASInformeListadoFacturasGrafComp); DASInformeListadoFacturasGrafComp.DataTable.Active := True; DADSInformeListadoProveedoresMayorFacturacionResumen.DataTable.Active := True; @@ -224,8 +204,10 @@ begin ACadena.Add('Todos los tipos de gasto'); if Assigned(FListaIDTiposdeGasto) and (FListaIDTiposdeGasto.Count > 0) then begin - ACadena.Clear; - ACadena.Add('Solo tipo de gasto ' + FListaNombreTiposGasto.Items[0]); + ACadena.Clear; + ACadena.Add('Solo tipo de gasto: '); + for i := 0 to FListaNombreTiposGasto.Count - 1 do + ACadena.Add(FListaNombreTiposGasto.Items[i]); end; frxReport.Variables.Variables['TextoParametros']:= ACadena.Text; @@ -478,6 +460,7 @@ procedure TRptFacturasProveedor.IniciarParametrosInforme; var ATextos : TStringList; ACadena : String; + i: Integer; begin ATextos := TStringList.Create; @@ -515,9 +498,11 @@ begin ACadena := ACadena + ' (desglosados)' end; - if Assigned(FListaIDTiposdeGasto) and (FListaIDTiposdeGasto.Count > 0) then + if Assigned(FListaIDTiposdeGasto) and (FListaNombreTiposGasto.Count > 0) then begin - ACadena := 'Solo tipo de gasto ' + FListaNombreTiposGasto.Items[0]; + ACadena := 'Solo tipo de gasto: '; + for i := 0 to FListaNombreTiposGasto.Count - 1 do + ACadena := ACadena + FListaNombreTiposGasto.Items[i] + #13; end else begin ACadena := 'Todos los tipos de gasto'; @@ -600,20 +585,25 @@ begin end; // Filtrar el informe por tipo de gasto - if Assigned(FListaIDTiposdeGasto) then + if Assigned(FListaIDTiposdeGasto) + and (FListaIDTiposdeGasto.Count > 0) then begin with ATabla.DynamicWhere do begin + Condicion := Nil; for i := 0 to FListaIDTiposdeGasto.Count - 1 do begin - - // (ID_PROVEEDOR = ID) - Condicion := NewBinaryExpression(NewField('', fld_FacturasProveedorID_TIPO_FACTURA), NewConstant(FListaIDTiposdeGasto.Items[i], datInteger), dboEqual); - if IsEmpty then - Expression := Condicion + if (Condicion = Nil) then + // (ID_TIPO_FACTURA = ID) + Condicion := NewBinaryExpression(NewField('', fld_FacturasProveedorID_TIPO_FACTURA), NewConstant(FListaIDTiposdeGasto.Items[i], datInteger), dboEqual) else - Expression := NewBinaryExpression(Expression, Condicion, dboAnd); - end; + Condicion := NewBinaryExpression(NewBinaryExpression(NewField('', fld_FacturasProveedorID_TIPO_FACTURA), NewConstant(FListaIDTiposdeGasto.Items[i], datInteger), dboEqual), Condicion, dboOr); + end; + + if IsEmpty then + Expression := Condicion + else + Expression := NewBinaryExpression(Expression, Condicion, dboAnd); end; end; @@ -810,6 +800,15 @@ begin end; +procedure TRptFacturasProveedor.RellenarParametro(ANombreParametro: String; AID: Integer; AListaIDTiposGasto: TIntegerArray; ATabla: TDADataSource); +begin + if (AListaIDTiposGasto.Count > AID-1) + then ATabla.DataTable.ParamByName(ANombreParametro).AsInteger := FListaIDTiposdeGasto.Items[AID-1] + else if (AListaIDTiposGasto.Count <> 0) then + ATabla.DataTable.ParamByName(ANombreParametro).AsInteger := 0 + else ATabla.DataTable.ParamByName(ANombreParametro).AsInteger := AID; +end; + function TRptFacturasProveedor._GenerarInforme(const TipoInforme: String): Binary; var AInforme: Variant; diff --git a/Source/Modulos/Facturas de proveedor/Views/uEditorElegirTipoGasto.dfm b/Source/Modulos/Facturas de proveedor/Views/uEditorElegirTipoGasto.dfm index 9534de05..819b88e5 100644 --- a/Source/Modulos/Facturas de proveedor/Views/uEditorElegirTipoGasto.dfm +++ b/Source/Modulos/Facturas de proveedor/Views/uEditorElegirTipoGasto.dfm @@ -3,7 +3,7 @@ object fEditorElegirTipoGasto: TfEditorElegirTipoGasto Top = 0 BorderStyle = bsDialog Caption = 'Tipo de gasto' - ClientHeight = 124 + ClientHeight = 138 ClientWidth = 500 Color = clWindow Font.Charset = DEFAULT_CHARSET @@ -34,11 +34,12 @@ object fEditorElegirTipoGasto: TfEditorElegirTipoGasto end object Panel1: TPanel Left = 0 - Top = 83 + Top = 97 Width = 500 Height = 41 Align = alBottom TabOrder = 0 + ExplicitTop = 381 DesignSize = ( 500 41) diff --git a/Source/Modulos/Facturas de proveedor/Views/uEditorElegirTipoGasto.pas b/Source/Modulos/Facturas de proveedor/Views/uEditorElegirTipoGasto.pas index c89a2fb4..59c2d45b 100644 --- a/Source/Modulos/Facturas de proveedor/Views/uEditorElegirTipoGasto.pas +++ b/Source/Modulos/Facturas de proveedor/Views/uEditorElegirTipoGasto.pas @@ -7,7 +7,10 @@ uses Dialogs, StdCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorElegirTipoGasto, cxGraphics, DB, uDAInterfaces, uDADataTable, cxDBEdit, uFacturasProveedorController, - cxLookupEdit, cxDBLookupEdit, cxDBLookupComboBox, uBizFacturasProveedor; + cxLookupEdit, cxDBLookupEdit, cxDBLookupComboBox, uBizFacturasProveedor, + cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxDBData, + cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel, + cxClasses, cxGridCustomView, cxGrid; type TfEditorElegirTipoGasto = class(TfEditorBasico, IEditorElegirTipoGasto) diff --git a/Source/Modulos/Gestor de informes/GestorInformes_Group.groupproj b/Source/Modulos/Gestor de informes/GestorInformes_Group.groupproj index 0d7fe84b..fb997c0a 100644 --- a/Source/Modulos/Gestor de informes/GestorInformes_Group.groupproj +++ b/Source/Modulos/Gestor de informes/GestorInformes_Group.groupproj @@ -9,6 +9,7 @@ + @@ -161,14 +162,23 @@ + + + + + + + + + - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj index beb8dba6..cac55e5c 100644 --- a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj +++ b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj @@ -38,48 +38,54 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fEditorInformeBase
TForm @@ -181,12 +187,6 @@
frViewPeriodoFechas
TFrame
- - - - - -