Informes de presupuestos de cliente adaptados al resumen
git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@880 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
9a2b3795ae
commit
1109c4fb6e
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -74,16 +74,17 @@ contains
|
|||||||
uEditorInformeBase in 'uEditorInformeBase.pas' {fEditorInformeBase: TForm},
|
uEditorInformeBase in 'uEditorInformeBase.pas' {fEditorInformeBase: TForm},
|
||||||
uViewFiltroClientes in 'uViewFiltroClientes.pas' {frViewFiltroClientes: TFrame},
|
uViewFiltroClientes in 'uViewFiltroClientes.pas' {frViewFiltroClientes: TFrame},
|
||||||
uViewParametrosInforme in 'uViewParametrosInforme.pas' {frViewParametrosInforme: TFrame},
|
uViewParametrosInforme in 'uViewParametrosInforme.pas' {frViewParametrosInforme: TFrame},
|
||||||
uEditorInformeFacturasClientePendientesReport in 'uEditorInformeFacturasClientePendientesReport.pas' {fEditorInformeFacturasClientePendientesReport: TForm},
|
uEditorInformeFacturasClientePendientesReport in 'uEditorInformeFacturasClientePendientesReport.pas' {fEditorInformeFacturasClientePendientesReport: t},
|
||||||
uEditorInformeFacturasClienteReport in 'uEditorInformeFacturasClienteReport.pas' {fEditorInformeFacturasClienteReport: TForm},
|
uEditorInformeFacturasClienteReport in 'uEditorInformeFacturasClienteReport.pas' {fEditorInformeFacturasClienteReport: T},
|
||||||
uEditorInformeRecibosClienteReport in 'uEditorInformeRecibosClienteReport.pas' {fEditorInformeRecibosClienteReport: TForm},
|
uEditorInformeRecibosClienteReport in 'uEditorInformeRecibosClienteReport.pas' {fEditorInformeRecibosClienteReport: T},
|
||||||
uEditorInformeRecibosCliPendientesReport in 'uEditorInformeRecibosCliPendientesReport.pas' {fEditorInformeRecibosCliPendientesReport: TForm},
|
uEditorInformeRecibosCliPendientesReport in 'uEditorInformeRecibosCliPendientesReport.pas' {fEditorInformeRecibosCliPendientesReport: T},
|
||||||
uViewFiltroProveedores in 'uViewFiltroProveedores.pas' {frViewFiltroProveedores: TFrame},
|
uViewFiltroProveedores in 'uViewFiltroProveedores.pas' {frViewFiltroProveedores: TFrame},
|
||||||
uEditorInformeIVAProveedoresReport in 'uEditorInformeIVAProveedoresReport.pas' {fEditorInformeIVAProveedoresReport: TForm},
|
uEditorInformeIVAProveedoresReport in 'uEditorInformeIVAProveedoresReport.pas' {fEditorInformeIVAProveedoresReport: TForm},
|
||||||
uEditorInformeRecibosProvPendientesReport in 'uEditorInformeRecibosProvPendientesReport.pas' {fEditorInformeRecibosProvPendientesReport: TForm},
|
uEditorInformeRecibosProvPendientesReport in 'uEditorInformeRecibosProvPendientesReport.pas' {fEditorInformeRecibosProvPendientesReport: TForm},
|
||||||
uEditorInformeFacturasProveedorPendientesReport in 'uEditorInformeFacturasProveedorPendientesReport.pas' {fEditorInformeFacturasProveedorPendientesReport: TForm},
|
uEditorInformeFacturasProveedorPendientesReport in 'uEditorInformeFacturasProveedorPendientesReport.pas' {fEditorInformeFacturasProveedorPendientesReport: TForm},
|
||||||
uEditorInformeFacturasProveedorReport in 'uEditorInformeFacturasProveedorReport.pas' {fEditorInformeFacturasProveedorReport: TForm},
|
uEditorInformeFacturasProveedorReport in 'uEditorInformeFacturasProveedorReport.pas' {fEditorInformeFacturasProveedorReport: TForm},
|
||||||
uEditorInformePedidosReport in 'uEditorInformePedidosReport.pas' {fEditorInformePedidosReport: TForm},
|
uEditorInformePedidosReport in 'uEditorInformePedidosReport.pas' {fEditorInformePedidosReport: TForm},
|
||||||
uEditorInformeRecibosProveedorReport in 'uEditorInformeRecibosProveedorReport.pas' {fEditorInformeRecibosProveedorReport: TForm};
|
uEditorInformeRecibosProveedorReport in 'uEditorInformeRecibosProveedorReport.pas' {fEditorInformeRecibosProveedorReport: TForm},
|
||||||
|
uEditorInformePresupuestosReport in 'uEditorInformePresupuestosReport.pas' {fEditorInformePresupuestosReport: TForm};
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -38,46 +38,40 @@
|
|||||||
<DelphiCompile Include="GestorInformes_view.dpk">
|
<DelphiCompile Include="GestorInformes_view.dpk">
|
||||||
<MainSource>MainSource</MainSource>
|
<MainSource>MainSource</MainSource>
|
||||||
</DelphiCompile>
|
</DelphiCompile>
|
||||||
<DCCReference Include="..\..\Facturas de cliente\ApplicationBase.dcp" />
|
<DCCReference Include="ApplicationBase.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\Base.dcp" />
|
<DCCReference Include="Base.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\ccpackD11.dcp" />
|
<DCCReference Include="ccpackD11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\cfpack_d11.dcp" />
|
<DCCReference Include="cfpack_d11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\Contactos_controller.dcp" />
|
<DCCReference Include="Contactos_controller.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\Contactos_model.dcp" />
|
<DCCReference Include="Contactos_model.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\Contactos_view.dcp" />
|
<DCCReference Include="Contactos_view.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\cxDataD11.dcp" />
|
<DCCReference Include="cxDataD11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\cxEditorsD11.dcp" />
|
<DCCReference Include="cxEditorsD11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\cxLibraryD11.dcp" />
|
<DCCReference Include="cxLibraryD11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\dbrtl.dcp" />
|
<DCCReference Include="dbrtl.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\designide.dcp" />
|
<DCCReference Include="designide.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\dxComnD11.dcp" />
|
<DCCReference Include="dxComnD11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\dxGDIPlusD11.dcp" />
|
<DCCReference Include="dxGDIPlusD11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\dxLayoutControlD11.dcp" />
|
<DCCReference Include="dxLayoutControlD11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\dxThemeD11.dcp" />
|
<DCCReference Include="dxThemeD11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\frx11.dcp" />
|
<DCCReference Include="frx11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\frxe11.dcp" />
|
<DCCReference Include="frxe11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\fs11.dcp" />
|
<DCCReference Include="fs11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\GestorInformes_controller.dcp" />
|
<DCCReference Include="GestorInformes_controller.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\GUIBase.dcp" />
|
<DCCReference Include="GUIBase.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\GUISDK_D11.dcp" />
|
<DCCReference Include="GUISDK_D11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\Jcl.dcp" />
|
<DCCReference Include="Jcl.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\JclVcl.dcp" />
|
<DCCReference Include="JclVcl.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\JvCoreD11R.dcp" />
|
<DCCReference Include="JvCoreD11R.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\JvPageCompsD11R.dcp" />
|
<DCCReference Include="JvPageCompsD11R.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\JvStdCtrlsD11R.dcp" />
|
<DCCReference Include="JvStdCtrlsD11R.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\JvSystemD11R.dcp" />
|
<DCCReference Include="JvSystemD11R.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\PngComponentsD10.dcp" />
|
<DCCReference Include="PngComponentsD10.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\PNG_D10.dcp" />
|
<DCCReference Include="PNG_D10.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\RemObjects_Core_D11.dcp" />
|
<DCCReference Include="RemObjects_Core_D11.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\rtl.dcp" />
|
<DCCReference Include="rtl.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\tb2k_d10.dcp" />
|
<DCCReference Include="tb2k_d10.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\tbx_d10.dcp" />
|
<DCCReference Include="tbx_d10.dcp" />
|
||||||
<DCCReference Include="..\..\Facturas de cliente\vcl.dcp" />
|
|
||||||
<DCCReference Include="..\..\Facturas de cliente\vclactnband.dcp" />
|
|
||||||
<DCCReference Include="..\..\Facturas de cliente\vcldb.dcp" />
|
|
||||||
<DCCReference Include="..\..\Facturas de cliente\vcljpg.dcp" />
|
|
||||||
<DCCReference Include="..\..\Facturas de cliente\vclx.dcp" />
|
|
||||||
<DCCReference Include="..\..\Facturas de cliente\xmlrtl.dcp" />
|
|
||||||
<DCCReference Include="uEditorInformeBase.pas">
|
<DCCReference Include="uEditorInformeBase.pas">
|
||||||
<Form>fEditorInformeBase</Form>
|
<Form>fEditorInformeBase</Form>
|
||||||
<DesignClass>TForm</DesignClass>
|
<DesignClass>TForm</DesignClass>
|
||||||
@ -110,6 +104,10 @@
|
|||||||
<Form>fEditorInformePedidosReport</Form>
|
<Form>fEditorInformePedidosReport</Form>
|
||||||
<DesignClass>TForm</DesignClass>
|
<DesignClass>TForm</DesignClass>
|
||||||
</DCCReference>
|
</DCCReference>
|
||||||
|
<DCCReference Include="uEditorInformePresupuestosReport.pas">
|
||||||
|
<Form>fEditorInformePresupuestoReport</Form>
|
||||||
|
<DesignClass>TForm</DesignClass>
|
||||||
|
</DCCReference>
|
||||||
<DCCReference Include="uEditorInformeRecibosClienteReport.pas">
|
<DCCReference Include="uEditorInformeRecibosClienteReport.pas">
|
||||||
<Form>fEditorInformeRecibosClienteReport</Form>
|
<Form>fEditorInformeRecibosClienteReport</Form>
|
||||||
<DesignClass>T</DesignClass>
|
<DesignClass>T</DesignClass>
|
||||||
@ -147,6 +145,12 @@
|
|||||||
<Form>frViewPeriodoFechas</Form>
|
<Form>frViewPeriodoFechas</Form>
|
||||||
<DesignClass>TFrame</DesignClass>
|
<DesignClass>TFrame</DesignClass>
|
||||||
</DCCReference>
|
</DCCReference>
|
||||||
|
<DCCReference Include="vcl.dcp" />
|
||||||
|
<DCCReference Include="vclactnband.dcp" />
|
||||||
|
<DCCReference Include="vcldb.dcp" />
|
||||||
|
<DCCReference Include="vcljpg.dcp" />
|
||||||
|
<DCCReference Include="vclx.dcp" />
|
||||||
|
<DCCReference Include="xmlrtl.dcp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
<!-- EurekaLog First Line
|
<!-- EurekaLog First Line
|
||||||
|
|||||||
@ -70,7 +70,7 @@ inherited fEditorInformePresupuestosReport: TfEditorInformePresupuestosReport
|
|||||||
Width = 182
|
Width = 182
|
||||||
ExplicitWidth = 182
|
ExplicitWidth = 182
|
||||||
inherited Label3: TLabel
|
inherited Label3: TLabel
|
||||||
Width = 85
|
Width = 172
|
||||||
end
|
end
|
||||||
inherited edtFechaFin: TcxDateEdit
|
inherited edtFechaFin: TcxDateEdit
|
||||||
Left = 76
|
Left = 76
|
||||||
@ -109,7 +109,7 @@ inherited fEditorInformePresupuestosReport: TfEditorInformePresupuestosReport
|
|||||||
Width = 182
|
Width = 182
|
||||||
ExplicitWidth = 182
|
ExplicitWidth = 182
|
||||||
inherited Label4: TLabel
|
inherited Label4: TLabel
|
||||||
Width = 160
|
Width = 172
|
||||||
end
|
end
|
||||||
inherited edtFechaVenFin: TcxDateEdit
|
inherited edtFechaVenFin: TcxDateEdit
|
||||||
Style.LookAndFeel.SkinName = ''
|
Style.LookAndFeel.SkinName = ''
|
||||||
@ -184,6 +184,9 @@ inherited fEditorInformePresupuestosReport: TfEditorInformePresupuestosReport
|
|||||||
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
|
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
|
||||||
Width = 182
|
Width = 182
|
||||||
ExplicitWidth = 182
|
ExplicitWidth = 182
|
||||||
|
inherited cbxDesglosado: TCheckBox
|
||||||
|
Caption = 'Solo presupuestos que superen:'
|
||||||
|
end
|
||||||
inherited eImporte: TcxSpinEdit
|
inherited eImporte: TcxSpinEdit
|
||||||
Style.LookAndFeel.SkinName = ''
|
Style.LookAndFeel.SkinName = ''
|
||||||
StyleDisabled.LookAndFeel.SkinName = ''
|
StyleDisabled.LookAndFeel.SkinName = ''
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
<Projects Include="..\Facturas de cliente\Views\FacturasCliente_view.dproj" />
|
<Projects Include="..\Facturas de cliente\Views\FacturasCliente_view.dproj" />
|
||||||
<Projects Include="..\Gestion de documentos\Controller\GestorDocumentos_controller.dproj" />
|
<Projects Include="..\Gestion de documentos\Controller\GestorDocumentos_controller.dproj" />
|
||||||
<Projects Include="..\Gestion de documentos\Data\GestorDocumentos_data.dproj" />
|
<Projects Include="..\Gestion de documentos\Data\GestorDocumentos_data.dproj" />
|
||||||
|
<Projects Include="..\Gestor de informes\Views\GestorInformes_view.dproj" />
|
||||||
<Projects Include="..\Relaciones\Presupuestos de cliente - Albaranes de cliente\PreCli_AlbCli_relation.dproj" />
|
<Projects Include="..\Relaciones\Presupuestos de cliente - Albaranes de cliente\PreCli_AlbCli_relation.dproj" />
|
||||||
<Projects Include="..\Relaciones\Presupuestos de cliente - Facturas de cliente\PreCli_FacCli_relation.dproj" />
|
<Projects Include="..\Relaciones\Presupuestos de cliente - Facturas de cliente\PreCli_FacCli_relation.dproj" />
|
||||||
<Projects Include="Controller\PresupuestosCliente_controller.dproj" />
|
<Projects Include="Controller\PresupuestosCliente_controller.dproj" />
|
||||||
@ -231,14 +232,23 @@
|
|||||||
<Target Name="FacturasCliente_view:Make">
|
<Target Name="FacturasCliente_view:Make">
|
||||||
<MSBuild Projects="..\Facturas de cliente\Views\FacturasCliente_view.dproj" Targets="Make" />
|
<MSBuild Projects="..\Facturas de cliente\Views\FacturasCliente_view.dproj" Targets="Make" />
|
||||||
</Target>
|
</Target>
|
||||||
|
<Target Name="GestorInformes_view">
|
||||||
|
<MSBuild Projects="..\Gestor de informes\Views\GestorInformes_view.dproj" Targets="" />
|
||||||
|
</Target>
|
||||||
|
<Target Name="GestorInformes_view:Clean">
|
||||||
|
<MSBuild Projects="..\Gestor de informes\Views\GestorInformes_view.dproj" Targets="Clean" />
|
||||||
|
</Target>
|
||||||
|
<Target Name="GestorInformes_view:Make">
|
||||||
|
<MSBuild Projects="..\Gestor de informes\Views\GestorInformes_view.dproj" Targets="Make" />
|
||||||
|
</Target>
|
||||||
<Target Name="Build">
|
<Target Name="Build">
|
||||||
<CallTarget Targets="Base;GUIBase;ApplicationBase;Contactos_model;Contactos_data;Contactos_controller;Contactos_view;Articulos_data;Articulos_controller;Articulos_view;PresupuestosCliente_model;PresupuestosCliente_data;GestorDocumentos_data;GestorDocumentos_controller;PresupuestosCliente_controller;PreCli_FacCli_relation;PreCli_AlbCli_relation;PresupuestosCliente_view;PresupuestosCliente_plugin;FactuGES;FactuGES_Server;FacturasCliente_view" />
|
<CallTarget Targets="Base;GUIBase;ApplicationBase;Contactos_model;Contactos_data;Contactos_controller;Contactos_view;Articulos_data;Articulos_controller;Articulos_view;PresupuestosCliente_model;PresupuestosCliente_data;GestorDocumentos_data;GestorDocumentos_controller;PresupuestosCliente_controller;PreCli_FacCli_relation;PreCli_AlbCli_relation;PresupuestosCliente_view;PresupuestosCliente_plugin;FactuGES;FactuGES_Server;FacturasCliente_view;GestorInformes_view" />
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="Clean">
|
<Target Name="Clean">
|
||||||
<CallTarget Targets="Base:Clean;GUIBase:Clean;ApplicationBase:Clean;Contactos_model:Clean;Contactos_data:Clean;Contactos_controller:Clean;Contactos_view:Clean;Articulos_data:Clean;Articulos_controller:Clean;Articulos_view:Clean;PresupuestosCliente_model:Clean;PresupuestosCliente_data:Clean;GestorDocumentos_data:Clean;GestorDocumentos_controller:Clean;PresupuestosCliente_controller:Clean;PreCli_FacCli_relation:Clean;PreCli_AlbCli_relation:Clean;PresupuestosCliente_view:Clean;PresupuestosCliente_plugin:Clean;FactuGES:Clean;FactuGES_Server:Clean;FacturasCliente_view:Clean" />
|
<CallTarget Targets="Base:Clean;GUIBase:Clean;ApplicationBase:Clean;Contactos_model:Clean;Contactos_data:Clean;Contactos_controller:Clean;Contactos_view:Clean;Articulos_data:Clean;Articulos_controller:Clean;Articulos_view:Clean;PresupuestosCliente_model:Clean;PresupuestosCliente_data:Clean;GestorDocumentos_data:Clean;GestorDocumentos_controller:Clean;PresupuestosCliente_controller:Clean;PreCli_FacCli_relation:Clean;PreCli_AlbCli_relation:Clean;PresupuestosCliente_view:Clean;PresupuestosCliente_plugin:Clean;FactuGES:Clean;FactuGES_Server:Clean;FacturasCliente_view:Clean;GestorInformes_view:Clean" />
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="Make">
|
<Target Name="Make">
|
||||||
<CallTarget Targets="Base:Make;GUIBase:Make;ApplicationBase:Make;Contactos_model:Make;Contactos_data:Make;Contactos_controller:Make;Contactos_view:Make;Articulos_data:Make;Articulos_controller:Make;Articulos_view:Make;PresupuestosCliente_model:Make;PresupuestosCliente_data:Make;GestorDocumentos_data:Make;GestorDocumentos_controller:Make;PresupuestosCliente_controller:Make;PreCli_FacCli_relation:Make;PreCli_AlbCli_relation:Make;PresupuestosCliente_view:Make;PresupuestosCliente_plugin:Make;FactuGES:Make;FactuGES_Server:Make;FacturasCliente_view:Make" />
|
<CallTarget Targets="Base:Make;GUIBase:Make;ApplicationBase:Make;Contactos_model:Make;Contactos_data:Make;Contactos_controller:Make;Contactos_view:Make;Articulos_data:Make;Articulos_controller:Make;Articulos_view:Make;PresupuestosCliente_model:Make;PresupuestosCliente_data:Make;GestorDocumentos_data:Make;GestorDocumentos_controller:Make;PresupuestosCliente_controller:Make;PreCli_FacCli_relation:Make;PreCli_AlbCli_relation:Make;PresupuestosCliente_view:Make;PresupuestosCliente_plugin:Make;FactuGES:Make;FactuGES_Server:Make;FacturasCliente_view:Make;GestorInformes_view:Make" />
|
||||||
</Target>
|
</Target>
|
||||||
<Import Condition="Exists('$(MSBuildBinPath)\Borland.Group.Targets')" Project="$(MSBuildBinPath)\Borland.Group.Targets" />
|
<Import Condition="Exists('$(MSBuildBinPath)\Borland.Group.Targets')" Project="$(MSBuildBinPath)\Borland.Group.Targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@ -772,6 +772,87 @@ object RptPresupuestosCliente: TRptPresupuestosCliente
|
|||||||
Name = 'VISIBLE'
|
Name = 'VISIBLE'
|
||||||
DataType = datSmallInt
|
DataType = datSmallInt
|
||||||
end>
|
end>
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Params = <>
|
||||||
|
Statements = <
|
||||||
|
item
|
||||||
|
Connection = 'IBX'
|
||||||
|
TargetTable = 'V_PRESUPUESTOS_CLIENTE'
|
||||||
|
SQL =
|
||||||
|
'select ID_EMPRESA,'#10'extract (year from fecha_presupuesto) as ANO,' +
|
||||||
|
#10'extract (month from fecha_presupuesto) as MES,'#10'case'#10'when extrac' +
|
||||||
|
't (month from fecha_presupuesto) = 1 then '#39'ENERO - '#39' || extract ' +
|
||||||
|
'(year from fecha_presupuesto)'#10'when extract (month from fecha_pre' +
|
||||||
|
'supuesto) = 2 then '#39'FEBRERO - '#39' || extract (year from fecha_pres' +
|
||||||
|
'upuesto)'#10'when extract (month from fecha_presupuesto) = 3 then '#39'M' +
|
||||||
|
'ARZO - '#39' || extract (year from fecha_presupuesto)'#10'when extract (' +
|
||||||
|
'month from fecha_presupuesto) = 4 then '#39'ABRIL - '#39' || extract (ye' +
|
||||||
|
'ar from fecha_presupuesto)'#10'when extract (month from fecha_presup' +
|
||||||
|
'uesto) = 5 then '#39'MAYO - '#39' || extract (year from fecha_presupuest' +
|
||||||
|
'o)'#10'when extract (month from fecha_presupuesto) = 6 then '#39'JUNIO -' +
|
||||||
|
' '#39' || extract (year from fecha_presupuesto)'#10'when extract (month ' +
|
||||||
|
'from fecha_presupuesto) = 7 then '#39'JULIO - '#39' || extract (year fro' +
|
||||||
|
'm fecha_presupuesto)'#10'when extract (month from fecha_presupuesto)' +
|
||||||
|
' = 8 then '#39'AGOSTO - '#39' || extract (year from fecha_presupuesto)'#10'w' +
|
||||||
|
'hen extract (month from fecha_presupuesto) = 9 then '#39'SEPTIEMBRE ' +
|
||||||
|
'- '#39' || extract (year from fecha_presupuesto)'#10'when extract (month' +
|
||||||
|
' from fecha_presupuesto) = 10 then '#39'OCTUBRE - '#39' || extract (year' +
|
||||||
|
' from fecha_presupuesto)'#10'when extract (month from fecha_presupue' +
|
||||||
|
'sto) = 11 then '#39'NOVIEMBRE - '#39' || extract (year from fecha_presup' +
|
||||||
|
'uesto)'#10'when extract (month from fecha_presupuesto) = 12 then '#39'DI' +
|
||||||
|
'CIEMBRE - '#39' || extract (year from fecha_presupuesto)'#10'end as TITU' +
|
||||||
|
'LO,'#10'sum(IMPORTE_TOTAL) as IMPORTE_TOTAL'#10#10'from V_presupuestos_cli' +
|
||||||
|
'ente'#10'group by 1,2,3,4'#10'order by ANO, MES'#10
|
||||||
|
StatementType = stSQL
|
||||||
|
ColumnMappings = <
|
||||||
|
item
|
||||||
|
DatasetField = 'ID_EMPRESA'
|
||||||
|
TableField = 'ID_EMPRESA'
|
||||||
|
end
|
||||||
|
item
|
||||||
|
DatasetField = 'ANO'
|
||||||
|
TableField = '<unknown>'
|
||||||
|
SQLOrigin = 'ANO'
|
||||||
|
end
|
||||||
|
item
|
||||||
|
DatasetField = 'MES'
|
||||||
|
TableField = '<unknown>'
|
||||||
|
SQLOrigin = 'MES'
|
||||||
|
end
|
||||||
|
item
|
||||||
|
DatasetField = 'TITULO'
|
||||||
|
TableField = '<unknown>'
|
||||||
|
SQLOrigin = 'TITULO'
|
||||||
|
end
|
||||||
|
item
|
||||||
|
DatasetField = 'IMPORTE_TOTAL'
|
||||||
|
TableField = 'IMPORTE_TOTAL'
|
||||||
|
end>
|
||||||
|
end>
|
||||||
|
Name = 'InformeListadoPresupuestosResumen'
|
||||||
|
Fields = <
|
||||||
|
item
|
||||||
|
Name = 'ID_EMPRESA'
|
||||||
|
DataType = datInteger
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'ANO'
|
||||||
|
DataType = datSmallInt
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'MES'
|
||||||
|
DataType = datSmallInt
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'TITULO'
|
||||||
|
DataType = datString
|
||||||
|
Size = 19
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'IMPORTE_TOTAL'
|
||||||
|
DataType = datCurrency
|
||||||
|
end>
|
||||||
end>
|
end>
|
||||||
JoinDataTables = <>
|
JoinDataTables = <>
|
||||||
UnionDataTables = <>
|
UnionDataTables = <>
|
||||||
@ -790,21 +871,59 @@ object RptPresupuestosCliente: TRptPresupuestosCliente
|
|||||||
object frxReport: TfrxReport
|
object frxReport: TfrxReport
|
||||||
Version = '4.3'
|
Version = '4.3'
|
||||||
DotMatrixReport = False
|
DotMatrixReport = False
|
||||||
|
EngineOptions.DoublePass = True
|
||||||
IniFile = '\Software\Fast Reports'
|
IniFile = '\Software\Fast Reports'
|
||||||
PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
|
PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
|
||||||
PreviewOptions.Zoom = 1.000000000000000000
|
PreviewOptions.Zoom = 1.000000000000000000
|
||||||
PrintOptions.Printer = 'Por defecto'
|
PrintOptions.Printer = 'Por defecto'
|
||||||
PrintOptions.PrintOnSheet = 0
|
PrintOptions.PrintOnSheet = 0
|
||||||
ReportOptions.CreateDate = 39794.451322581020000000
|
ReportOptions.CreateDate = 37800.807714351900000000
|
||||||
ReportOptions.LastChange = 39794.451322581020000000
|
ReportOptions.LastChange = 39836.700555358800000000
|
||||||
ScriptLanguage = 'PascalScript'
|
ScriptLanguage = 'PascalScript'
|
||||||
ScriptText.Strings = (
|
ScriptText.Strings = (
|
||||||
|
'procedure frxReportOnStartReport(Sender: TfrxComponent);'
|
||||||
|
'begin'
|
||||||
|
' Set('#39'Pagina'#39', 0);'
|
||||||
|
' Set('#39'TotalPaginas'#39', 0); '
|
||||||
|
'end;'
|
||||||
|
''
|
||||||
|
'procedure Band1OnBeforePrint(Sender: TfrxComponent);'
|
||||||
|
'begin'
|
||||||
|
' if not Engine.FinalPass then'
|
||||||
|
' Set('#39'TotalPaginas'#39', (<TotalPaginas> + 1));'
|
||||||
|
''
|
||||||
|
' if Engine.FinalPass then'
|
||||||
|
' Set('#39'Pagina'#39', (<Pagina> + 1)); '
|
||||||
|
'end;'
|
||||||
|
''
|
||||||
|
'procedure mContinuaOnBeforePrint(Sender: TfrxComponent);'
|
||||||
|
'begin'
|
||||||
|
' if Engine.FinalPass then'
|
||||||
|
' begin'
|
||||||
|
|
||||||
|
' //A la vez que salta este salta la asignacion de pagina por ' +
|
||||||
|
'lo que no coincide nunca si no suponemos +1 ' +
|
||||||
|
' ' +
|
||||||
|
' ' +
|
||||||
|
' ' +
|
||||||
|
' '
|
||||||
|
' if ((<Pagina> + 1) = <TotalPaginas>) then'
|
||||||
|
' begin '
|
||||||
|
' mContinua.Visible := True;'
|
||||||
|
' end '
|
||||||
|
' else'
|
||||||
|
' begin '
|
||||||
|
' mContinua.Visible := False;'
|
||||||
|
' end '
|
||||||
|
' end; '
|
||||||
|
'end;'
|
||||||
''
|
''
|
||||||
'begin'
|
'begin'
|
||||||
''
|
''
|
||||||
'end.')
|
'end.')
|
||||||
ShowProgress = False
|
ShowProgress = False
|
||||||
StoreInDFM = False
|
StoreInDFM = False
|
||||||
|
OnStartReport = 'frxReportOnStartReport'
|
||||||
Left = 169
|
Left = 169
|
||||||
Top = 16
|
Top = 16
|
||||||
end
|
end
|
||||||
@ -1518,6 +1637,10 @@ object RptPresupuestosCliente: TRptPresupuestosCliente
|
|||||||
Name = 'ID_EMPRESA'
|
Name = 'ID_EMPRESA'
|
||||||
DataType = datInteger
|
DataType = datInteger
|
||||||
end
|
end
|
||||||
|
item
|
||||||
|
Name = 'ANO'
|
||||||
|
DataType = datSmallInt
|
||||||
|
end
|
||||||
item
|
item
|
||||||
Name = 'MES'
|
Name = 'MES'
|
||||||
DataType = datSmallInt
|
DataType = datSmallInt
|
||||||
@ -1588,4 +1711,31 @@ object RptPresupuestosCliente: TRptPresupuestosCliente
|
|||||||
Left = 680
|
Left = 680
|
||||||
Top = 16
|
Top = 16
|
||||||
end
|
end
|
||||||
|
object frxDBInformeListadoPresupuestosResumen: TfrxDBDataset
|
||||||
|
UserName = 'frxDBInformeListadoPresupuestosResumen'
|
||||||
|
CloseDataSource = True
|
||||||
|
DataSource = DADSInformeListadoPresupuestosResumen
|
||||||
|
Left = 680
|
||||||
|
Top = 192
|
||||||
|
end
|
||||||
|
object DADSInformeListadoPresupuestosResumen: TDADataSource
|
||||||
|
DataSet = tbl_InformeListadoPresupuestosResumen.Dataset
|
||||||
|
DataTable = tbl_InformeListadoPresupuestosResumen
|
||||||
|
Left = 680
|
||||||
|
Top = 248
|
||||||
|
end
|
||||||
|
object tbl_InformeListadoPresupuestosResumen: TDAMemDataTable
|
||||||
|
RemoteUpdatesOptions = []
|
||||||
|
Fields = <>
|
||||||
|
Params = <>
|
||||||
|
MasterMappingMode = mmDataRequest
|
||||||
|
LogChanges = False
|
||||||
|
StreamingOptions = [soDisableEventsWhileStreaming]
|
||||||
|
RemoteFetchEnabled = False
|
||||||
|
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||||
|
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||||
|
IndexDefs = <>
|
||||||
|
Left = 680
|
||||||
|
Top = 304
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -79,17 +79,30 @@ type
|
|||||||
DADSInformeListadoPresupuestos: TDADataSource;
|
DADSInformeListadoPresupuestos: TDADataSource;
|
||||||
tbl_InformeListadoPresupuestos: TDAMemDataTable;
|
tbl_InformeListadoPresupuestos: TDAMemDataTable;
|
||||||
frxDBInformeListadoPresupuestos: TfrxDBDataset;
|
frxDBInformeListadoPresupuestos: TfrxDBDataset;
|
||||||
|
frxDBInformeListadoPresupuestosResumen: TfrxDBDataset;
|
||||||
|
DADSInformeListadoPresupuestosResumen: TDADataSource;
|
||||||
|
tbl_InformeListadoPresupuestosResumen: TDAMemDataTable;
|
||||||
schReport: TDASchema;
|
schReport: TDASchema;
|
||||||
DataDictionary: TDADataDictionary;
|
DataDictionary: TDADataDictionary;
|
||||||
procedure DataModuleCreate(Sender: TObject);
|
procedure DataModuleCreate(Sender: TObject);
|
||||||
private
|
private
|
||||||
FConnection: IDAConnection;
|
FConnection: IDAConnection;
|
||||||
|
FIdEmpresa: Integer;
|
||||||
|
FFechaInicio: Variant;
|
||||||
|
FFechaFin: Variant;
|
||||||
|
FListaIDClientes: TIntegerArray;
|
||||||
|
FImporteMinimo: Currency;
|
||||||
|
|
||||||
procedure _GenerarPresupuesto(const AID : Integer);
|
procedure _GenerarPresupuesto(const AID : Integer);
|
||||||
function _GenerarInforme(const TipoInforme: String; const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const ImporteMinimo: Currency): Binary;
|
|
||||||
|
procedure PrepararTablaInforme(ATabla: TDAMemDataTable);
|
||||||
|
procedure PrepararTablaResumenInforme(ATabla: IDADataset);
|
||||||
|
function _GenerarInforme(const TipoInforme: String): Binary;
|
||||||
|
|
||||||
public
|
public
|
||||||
function GenerarPresupuesto(const ListaID : TIntegerArray): Binary;
|
function GenerarPresupuesto(const ListaID : TIntegerArray): Binary;
|
||||||
function GenerarPresupuestoEnPDF(const ListaID : TIntegerArray): Binary;
|
function GenerarPresupuestoEnPDF(const ListaID : TIntegerArray): Binary;
|
||||||
function GenerarInformeListadoPresupuestos(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
|
function GenerarInformeListadoPresupuestos(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -97,15 +110,15 @@ implementation
|
|||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
uSistemaFunc, uDataModuleServer, schPresupuestosClienteClient_Intf;
|
uSistemaFunc, StrUtils, uDataModuleServer, schPresupuestosClienteClient_Intf;
|
||||||
|
|
||||||
const
|
const
|
||||||
rptInforme = 'InfPresupuestoCliente.fr3';
|
rptInforme = 'InfPresupuestoCliente.fr3';
|
||||||
rptInformeListadoPresupuestosDesglosado = 'InformeListadoPresupuestosDesglosado.fr3';
|
rptInformeListadoPresupuestosDesglosado = 'InformeListadoPresupuestosDesglosado.fr3';
|
||||||
rptInformeListadoPresupuestos = 'InformeListadoPresupuestos.fr3';
|
rptInformeListadoPresupuestos = 'InformeListadoPresupuestos.fr3';
|
||||||
|
|
||||||
|
{ Dataset names for schReport }
|
||||||
{ TRptPresupuestosProveedor }
|
ds_InformeListadoPresupuestosResumen = 'InformeListadoPresupuestosResumen';
|
||||||
|
|
||||||
|
|
||||||
procedure TRptPresupuestosCliente.DataModuleCreate(Sender: TObject);
|
procedure TRptPresupuestosCliente.DataModuleCreate(Sender: TObject);
|
||||||
@ -143,22 +156,168 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TRptPresupuestosCliente.PrepararTablaInforme(ATabla: TDAMemDataTable);
|
||||||
|
var
|
||||||
|
Condicion: TDAWhereExpression;
|
||||||
|
i: Integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
// Filtrar el informe por empresa
|
||||||
|
with ATabla.DynamicWhere do
|
||||||
|
begin
|
||||||
|
// (ID_EMPRESA >= ID)
|
||||||
|
Condicion := NewBinaryExpression(NewField('', fld_PresupuestosClienteID_EMPRESA), NewConstant(FIdEmpresa, datInteger), dboEqual);
|
||||||
|
if IsEmpty then
|
||||||
|
Expression := Condicion
|
||||||
|
else
|
||||||
|
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Filtrar el informe por fechas
|
||||||
|
if not VarIsNull(FFechaInicio)
|
||||||
|
and not VarIsNull(FFechaFin) then
|
||||||
|
begin
|
||||||
|
with ATabla.DynamicWhere do
|
||||||
|
begin
|
||||||
|
// (FECHA_INICIO between FECHA_FIN)
|
||||||
|
Condicion := NewBinaryExpression(NewField('', fld_PresupuestosClienteFECHA_PRESUPUESTO), NewConstant(FFechaInicio, datDateTime), dboGreaterOrEqual);
|
||||||
|
Condicion := NewBinaryExpression(NewBinaryExpression(NewField('', fld_PresupuestosClienteFECHA_PRESUPUESTO), NewConstant(FFechaFin, datDateTime), dboLessOrEqual), Condicion, dboAnd);
|
||||||
|
if IsEmpty then
|
||||||
|
Expression := Condicion
|
||||||
|
else
|
||||||
|
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Filtrar el informe por proveedor
|
||||||
|
if Assigned(FListaIDClientes) then
|
||||||
|
begin
|
||||||
|
with ATabla.DynamicWhere do
|
||||||
|
begin
|
||||||
|
for i := 0 to FListaIDClientes.Count - 1 do
|
||||||
|
begin
|
||||||
|
|
||||||
|
// (ID_PROVEEDOR = ID)
|
||||||
|
Condicion := NewBinaryExpression(NewField('', fld_PresupuestosClienteID_CLIENTE), NewConstant(FListaIDClientes.Items[i], datInteger), dboEqual);
|
||||||
|
if IsEmpty then
|
||||||
|
Expression := Condicion
|
||||||
|
else
|
||||||
|
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Filtrar el informe por importe minimo
|
||||||
|
if (FImporteMinimo > 0) then
|
||||||
|
begin
|
||||||
|
with ATabla.DynamicWhere do
|
||||||
|
begin
|
||||||
|
// (IMPORTE_TOTAL > ImporteMinimo)
|
||||||
|
Condicion := NewBinaryExpression(NewField('', fld_PresupuestosClienteIMPORTE_TOTAL), NewConstant(FImporteMinimo, datCurrency), dboGreaterOrEqual);
|
||||||
|
if IsEmpty then
|
||||||
|
Expression := Condicion
|
||||||
|
else
|
||||||
|
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TRptPresupuestosCliente.PrepararTablaResumenInforme(ATabla: IDADataset);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
AWhereStr : String;
|
||||||
|
|
||||||
|
begin
|
||||||
|
// Filtrar el informe por empresa
|
||||||
|
AWhereStr := ' (' + fld_PresupuestosClienteID_EMPRESA + ' = ' + IntToStr(FIdEmpresa) + ') ';
|
||||||
|
|
||||||
|
// Filtrar el informe por fechas
|
||||||
|
if not VarIsNull(FFechaInicio)
|
||||||
|
and not VarIsNull(FFechaFin) then
|
||||||
|
begin
|
||||||
|
if Length(AWhereStr) > 0 then
|
||||||
|
AWhereStr := AWhereStr + 'AND';
|
||||||
|
AWhereStr := AWhereStr + ' (' + fld_PresupuestosClienteFECHA_PRESUPUESTO + ' between ''' + ReplaceStr(VarToStr(FFechaInicio),'/','.') + ''' and ''' + ReplaceStr(VarToStr(FFechaFin),'/','.') + ''') ';
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Filtrar el informe por cliente
|
||||||
|
if Assigned(FListaIDClientes) then
|
||||||
|
begin
|
||||||
|
for i := 0 to FListaIDClientes.Count - 1 do
|
||||||
|
begin
|
||||||
|
if Length(AWhereStr) > 0 then
|
||||||
|
AWhereStr := AWhereStr + 'AND';
|
||||||
|
AWhereStr := AWhereStr + ' (' + fld_PresupuestosClienteID_CLIENTE + ' = ' + IntToStr(FListaIDClientes.Items[i]) + ') ';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Filtrar el informe por importe minimo
|
||||||
|
if (FImporteMinimo > 0) then
|
||||||
|
begin
|
||||||
|
if Length(AWhereStr) > 0 then
|
||||||
|
AWhereStr := AWhereStr + 'AND';
|
||||||
|
AWhereStr := AWhereStr + ' (' + fld_PresupuestosClienteIMPORTE_TOTAL + ' >= ' + CurrToStr(FImporteMinimo) + ') ';
|
||||||
|
end;
|
||||||
|
|
||||||
|
ATabla.Where.AddText(AWhereStr);
|
||||||
|
end;
|
||||||
|
|
||||||
function TRptPresupuestosCliente.GenerarInformeListadoPresupuestos(
|
function TRptPresupuestosCliente.GenerarInformeListadoPresupuestos(
|
||||||
const IdEmpresa: Integer; const FechaInicio, FechaFin: DateTime;
|
const IdEmpresa: Integer; const FechaInicio, FechaFin: Variant;
|
||||||
const ListaIDClientes: TIntegerArray; const Desglosado: Boolean;
|
const ListaIDClientes: TIntegerArray; const Desglosado: Boolean;
|
||||||
const ImporteMinimo: Currency): Binary;
|
const ImporteMinimo: Currency): Binary;
|
||||||
var
|
var
|
||||||
ATipoInforme: String;
|
ATipoInforme: String;
|
||||||
|
AStream: TMemoryStream;
|
||||||
|
dsMaster: IDADataset;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||||
|
|
||||||
//DESGLOSADO POR CLIENTE EN ESTE INFORME NO SE DESGLOSARÁ POR CLIENTE
|
AStream := TMemoryStream.Create;
|
||||||
|
try
|
||||||
|
//Inicializamos parametros
|
||||||
|
FIdEmpresa := IdEmpresa;
|
||||||
|
FFechaInicio := FechaInicio;
|
||||||
|
FFechaFin := FechaFin;
|
||||||
|
FImporteMinimo := ImporteMinimo;
|
||||||
|
|
||||||
|
if Assigned(FListaIDClientes) then
|
||||||
|
FListaIDClientes.Free;
|
||||||
|
FListaIDClientes := ListaIDClientes;
|
||||||
|
|
||||||
|
if tbl_InformeListadoPresupuestos.Active then
|
||||||
|
tbl_InformeListadoPresupuestos.Active := False;
|
||||||
|
PrepararTablaInforme(tbl_InformeListadoPresupuestos);
|
||||||
|
|
||||||
|
//Se prepara la tabla del listado resumen del informe
|
||||||
|
if tbl_InformeListadoPresupuestosResumen.Active then
|
||||||
|
tbl_InformeListadoPresupuestosResumen.Active := False;
|
||||||
|
dsMaster := schReport.NewDataset(FConnection, ds_InformeListadoPresupuestosResumen, [], [], False);
|
||||||
|
PrepararTablaResumenInforme(dsMaster);
|
||||||
|
//Esto se hace para rellenar la tabla del datamodule que usa el informe.
|
||||||
|
dsMaster.Open;
|
||||||
|
AStream.Clear;
|
||||||
|
DABin2DataStreamer1.WriteDataset(AStream, dsMaster, [woRows, woSchema], -1);
|
||||||
|
DABin2DataStreamer1.ReadDataset(AStream, tbl_InformeListadoPresupuestosResumen, TRUE, '', TRUE, TRUE);
|
||||||
|
|
||||||
|
//DESGLOSADO POR CLIENTE EN ESTE INFORME NO SE DESGLOSARÁ POR CLIENTE
|
||||||
if Desglosado then
|
if Desglosado then
|
||||||
ATipoInforme := rptInformeListadoPresupuestosDesglosado
|
ATipoInforme := rptInformeListadoPresupuestosDesglosado
|
||||||
else
|
else
|
||||||
ATipoInforme := rptInformeListadoPresupuestos;
|
ATipoInforme := rptInformeListadoPresupuestos;
|
||||||
|
|
||||||
Result := _GenerarInforme(ATipoInforme, IdEmpresa, FechaInicio, FechaFin, ListaIDClientes, ImporteMinimo);
|
//Finalmente se abren las tablas del informe
|
||||||
|
tbl_InformeListadoPresupuestos.Active := True;
|
||||||
|
tbl_InformeListadoPresupuestosResumen.Active := True;
|
||||||
|
|
||||||
|
Result := _GenerarInforme(ATipoInforme);
|
||||||
|
|
||||||
|
finally
|
||||||
|
AStream.Free;
|
||||||
|
dsMaster := Nil;
|
||||||
|
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TRptPresupuestosCliente.GenerarPresupuesto(const ListaID: TIntegerArray): Binary;
|
function TRptPresupuestosCliente.GenerarPresupuesto(const ListaID: TIntegerArray): Binary;
|
||||||
@ -176,99 +335,22 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TRptPresupuestosCliente._GenerarInforme(const TipoInforme: String;
|
function TRptPresupuestosCliente._GenerarInforme(const TipoInforme: String): Binary;
|
||||||
const IdEmpresa: Integer; const FechaInicio, FechaFin: DateTime;
|
|
||||||
const ListaIDClientes: TIntegerArray; const ImporteMinimo: Currency): Binary;
|
|
||||||
var
|
var
|
||||||
Condicion: TDAWhereExpression;
|
|
||||||
i: Integer;
|
|
||||||
AInforme: Variant;
|
AInforme: Variant;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result := Binary.Create;
|
Result := Binary.Create;
|
||||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
AInforme := DarRutaFichero(DarRutaInformes, TipoInforme, IntToStr(FIdEmpresa));
|
||||||
|
if VarIsNull(AInforme) then
|
||||||
|
raise Exception.Create (('Error Servidor: _GenerarInforme, no encuentra informe ' + TipoInforme));
|
||||||
|
|
||||||
try
|
frxReport.LoadFromFile(AInforme, True);
|
||||||
|
frxReport.Variables.Variables['FechaInicio'] := FFechaInicio;
|
||||||
|
frxReport.Variables.Variables['FechaFin'] := FFechaFin;
|
||||||
|
|
||||||
if tbl_InformeListadoPresupuestos.Active then
|
frxReport.PrepareReport(False);
|
||||||
tbl_InformeListadoPresupuestos.Active := False;
|
frxReport.PreviewPages.SaveToStream(Result);
|
||||||
|
|
||||||
// Filtrar el informe por empresa
|
|
||||||
with tbl_InformeListadoPresupuestos.DynamicWhere do
|
|
||||||
begin
|
|
||||||
// (ID_EMPRESA >= ID)
|
|
||||||
Condicion := NewBinaryExpression(NewField('', fld_PresupuestosClienteID_EMPRESA), NewConstant(IdEmpresa, datInteger), dboEqual);
|
|
||||||
if IsEmpty then
|
|
||||||
Expression := Condicion
|
|
||||||
else
|
|
||||||
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
|
||||||
end;
|
|
||||||
|
|
||||||
// Filtrar el informe por fechas
|
|
||||||
if not VarIsNull(FechaInicio)
|
|
||||||
and not VarIsNull(FechaFin) then
|
|
||||||
begin
|
|
||||||
with tbl_InformeListadoPresupuestos.DynamicWhere do
|
|
||||||
begin
|
|
||||||
// (FECHA_INICIO between FECHA_FIN)
|
|
||||||
Condicion := NewBinaryExpression(NewField('', fld_PresupuestosClienteFECHA_PRESUPUESTO), NewConstant(FechaInicio, datDateTime), dboGreaterOrEqual);
|
|
||||||
Condicion := NewBinaryExpression(NewBinaryExpression(NewField('', fld_PresupuestosClienteFECHA_PRESUPUESTO), NewConstant(FechaFin, datDateTime), dboLessOrEqual), Condicion, dboAnd);
|
|
||||||
if IsEmpty then
|
|
||||||
Expression := Condicion
|
|
||||||
else
|
|
||||||
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// Filtrar el informe por cliente
|
|
||||||
if Assigned(ListaIDClientes) then
|
|
||||||
begin
|
|
||||||
with tbl_InformeListadoPresupuestos.DynamicWhere do
|
|
||||||
begin
|
|
||||||
for i := 0 to ListaIDClientes.Count - 1 do
|
|
||||||
begin
|
|
||||||
|
|
||||||
// (ID_CLIENTE = ID)
|
|
||||||
Condicion := NewBinaryExpression(NewField('', fld_PresupuestosClienteID_CLIENTE), NewConstant(ListaIDClientes.Items[i], datInteger), dboEqual);
|
|
||||||
if IsEmpty then
|
|
||||||
Expression := Condicion
|
|
||||||
else
|
|
||||||
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// Filtrar el informe por importe minimo
|
|
||||||
if (ImporteMinimo > 0) then
|
|
||||||
begin
|
|
||||||
with tbl_InformeListadoPresupuestos.DynamicWhere do
|
|
||||||
begin
|
|
||||||
// (IMPORTE_TOTAL > ImporteMinimo)
|
|
||||||
Condicion := NewBinaryExpression(NewField('', fld_PresupuestosClienteIMPORTE_TOTAL), NewConstant(ImporteMinimo, datCurrency), dboGreaterOrEqual);
|
|
||||||
if IsEmpty then
|
|
||||||
Expression := Condicion
|
|
||||||
else
|
|
||||||
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
tbl_InformeListadoPresupuestos.Active := True;
|
|
||||||
|
|
||||||
AInforme := DarRutaFichero(DarRutaInformes, TipoInforme, IntToStr(IdEmpresa));
|
|
||||||
if VarIsNull(AInforme) then
|
|
||||||
raise Exception.Create (('Error Servidor: _GenerarInforme, no encuentra informe ' + TipoInforme));
|
|
||||||
|
|
||||||
frxReport.LoadFromFile(AInforme, True);
|
|
||||||
frxReport.Variables.Variables['FechaInicio'] := FechaInicio;
|
|
||||||
frxReport.Variables.Variables['FechaFin'] := FechaFin;
|
|
||||||
|
|
||||||
frxReport.PrepareReport(False);
|
|
||||||
frxReport.PreviewPages.SaveToStream(Result);
|
|
||||||
|
|
||||||
finally
|
|
||||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TRptPresupuestosCliente._GenerarPresupuesto(const AID: Integer);
|
procedure TRptPresupuestosCliente._GenerarPresupuesto(const AID: Integer);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user