Informes de recibos de proveedor adaptados al resumen
git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@887 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
b1f9d3ca3e
commit
ac6d6bfa85
@ -54,58 +54,58 @@
|
||||
<DelphiCompile Include="Base.dpk">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\adortl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\cxDataD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\cxEditorsD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\cxExportD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\cxExtEditorsD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\cxGridD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\cxIntl6D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\cxIntlPrintSys3D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\cxLibraryD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\cxPageControlD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\DataAbstract_Core_D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\dbrtl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\dclIndyCore.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\designide.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\dsnap.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\dxGDIPlusD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\dxPSCoreD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\dxThemeD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\GUISDK_D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\IndyCore.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\IndyProtocols.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\IndySystem.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\Jcl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\JclVcl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\JSDialog100.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\JvCmpD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\JvCoreD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\JvCtrlsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\JvDlgsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\JvMMD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\JvNetD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\JvPageCompsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\JvStdCtrlsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\JvSystemD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\pckMD5.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\pckUCDataConnector.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\pckUserControl_RT.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\PngComponentsD10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\PNG_D10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\RemObjects_Core_D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\RemObjects_Indy_D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\rtl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\TB2k_D10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\tbx_d10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\vcl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\vclactnband.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\vcldb.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\vcljpg.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\VclSmp.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\vclx.dcp" />
|
||||
<DCCReference Include="..\Modulos\Gestor de informes\xmlrtl.dcp" />
|
||||
<DCCReference Include="..\Servicios\FactuGES_Intf.pas" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\adortl.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\cxDataD11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\cxEditorsD11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\cxExportD11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\cxExtEditorsD11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\cxGridD11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\cxIntl6D11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\cxIntlPrintSys3D11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\cxLibraryD11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\cxPageControlD11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\DataAbstract_Core_D11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\dbrtl.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\dclIndyCore.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\designide.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\dsnap.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\dxGDIPlusD11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\dxPSCoreD11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\dxThemeD11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\GUISDK_D11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\IndyCore.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\IndyProtocols.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\IndySystem.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\Jcl.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\JclVcl.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\JSDialog100.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\JvCmpD11R.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\JvCoreD11R.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\JvCtrlsD11R.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\JvDlgsD11R.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\JvMMD11R.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\JvNetD11R.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\JvPageCompsD11R.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\JvStdCtrlsD11R.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\JvSystemD11R.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\pckMD5.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\pckUCDataConnector.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\pckUserControl_RT.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\PngComponentsD10.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\PNG_D10.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\RemObjects_Core_D11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\RemObjects_Indy_D11.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\rtl.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\TB2k_D10.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\tbx_d10.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\vcl.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\vclactnband.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\vcldb.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\vcljpg.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\VclSmp.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\vclx.dcp" />
|
||||
<DCCReference Include="C:\Documents and Settings\Usuario\xmlrtl.dcp" />
|
||||
<DCCReference Include="Conexion\uConfigurarConexion.pas">
|
||||
<Form>fConfigurarConexion</Form>
|
||||
<DesignClass>TForm</DesignClass>
|
||||
|
||||
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
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
Binary file not shown.
@ -2,7 +2,7 @@ object RptRecibosProveedor: TRptRecibosProveedor
|
||||
OldCreateOrder = True
|
||||
OnCreate = DataModuleCreate
|
||||
Height = 405
|
||||
Width = 654
|
||||
Width = 873
|
||||
object DADataCabecera: TDADataSource
|
||||
DataSet = tbl_Cabecera.Dataset
|
||||
DataTable = tbl_Cabecera
|
||||
@ -206,7 +206,7 @@ object RptRecibosProveedor: TRptRecibosProveedor
|
||||
StreamingOptions = [soDisableEventsWhileStreaming]
|
||||
RemoteFetchEnabled = False
|
||||
LocalSchema = schReport
|
||||
LocalDataStreamer = DABINAdapter
|
||||
LocalDataStreamer = Bin2DataStreamer
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'Informe_Cabecera'
|
||||
@ -214,10 +214,6 @@ object RptRecibosProveedor: TRptRecibosProveedor
|
||||
Left = 264
|
||||
Top = 128
|
||||
end
|
||||
object DABINAdapter: TDABINAdapter
|
||||
Left = 48
|
||||
Top = 80
|
||||
end
|
||||
object frxRichObject1: TfrxRichObject
|
||||
Left = 48
|
||||
Top = 296
|
||||
@ -283,9 +279,11 @@ object RptRecibosProveedor: TRptRecibosProveedor
|
||||
'iento)'#10'when extract (month from fecha_vencimiento) = 12 then '#39'DI' +
|
||||
'CIEMBRE - '#39' || extract (year from fecha_vencimiento)'#10'end as TITU' +
|
||||
'LO,'#10'REFERENCIA, ID_PROVEEDOR, NOMBRE_PROVEEDOR, SITUACION, NIF_' +
|
||||
'CIF_PROVEEDOR, fecha_vencimiento, FECHA_EMISION,'#10'IMPORTE_TOTAL'#10#10 +
|
||||
'from V_recibos_proveedor'#10'where {where}'#10'order by ANO, MES, NOMBRE' +
|
||||
'_PROVEEDOR'#10#10
|
||||
'CIF_PROVEEDOR, fecha_vencimiento, FECHA_EMISION,'#10'IMPORTE_TOTAL,'#10 +
|
||||
'case'#10'when strlen(DATOS_BANCARIOS) = 0 then '#39'Sin cuenta bancaria'#39 +
|
||||
#10'else DATOS_BANCARIOS'#10'end as DATOS_BANCARIOS'#10#10'from V_recibos_pro' +
|
||||
'veedor'#10'where {where}'#10'order by ANO, MES, FECHA_VENCIMIENTO, NOMBR' +
|
||||
'E_PROVEEDOR'#10#10
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <
|
||||
item
|
||||
@ -335,9 +333,13 @@ object RptRecibosProveedor: TRptRecibosProveedor
|
||||
item
|
||||
DatasetField = 'ANO'
|
||||
TableField = 'ANO'
|
||||
end
|
||||
item
|
||||
DatasetField = 'DATOS_BANCARIOS'
|
||||
TableField = 'DATOS_BANCARIOS'
|
||||
end>
|
||||
end>
|
||||
Name = 'InformeListadoRecibos'
|
||||
Name = 'InformeListadoRecibosPendientes'
|
||||
Fields = <
|
||||
item
|
||||
Name = 'ID_EMPRESA'
|
||||
@ -391,6 +393,11 @@ object RptRecibosProveedor: TRptRecibosProveedor
|
||||
item
|
||||
Name = 'IMPORTE_TOTAL'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'DATOS_BANCARIOS'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end>
|
||||
end
|
||||
item
|
||||
@ -812,6 +819,310 @@ object RptRecibosProveedor: TRptRecibosProveedor
|
||||
Name = 'LOGOTIPO'
|
||||
DataType = datBlob
|
||||
end>
|
||||
end
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
TargetTable = 'V_recibos_proveedor'
|
||||
SQL =
|
||||
'select ID_EMPRESA,'#10'extract (year from fecha_vencimiento) as ANO,' +
|
||||
#10'extract (month from fecha_vencimiento) as MES,'#10'case'#10'when extrac' +
|
||||
't (month from fecha_vencimiento) = 1 then '#39'ENERO - '#39' || extract ' +
|
||||
'(year from fecha_vencimiento)'#10'when extract (month from fecha_ven' +
|
||||
'cimiento) = 2 then '#39'FEBRERO - '#39' || extract (year from fecha_venc' +
|
||||
'imiento)'#10'when extract (month from fecha_vencimiento) = 3 then '#39'M' +
|
||||
'ARZO - '#39' || extract (year from fecha_vencimiento)'#10'when extract (' +
|
||||
'month from fecha_vencimiento) = 4 then '#39'ABRIL - '#39' || extract (ye' +
|
||||
'ar from fecha_vencimiento)'#10'when extract (month from fecha_vencim' +
|
||||
'iento) = 5 then '#39'MAYO - '#39' || extract (year from fecha_vencimient' +
|
||||
'o)'#10'when extract (month from fecha_vencimiento) = 6 then '#39'JUNIO -' +
|
||||
' '#39' || extract (year from fecha_vencimiento)'#10'when extract (month ' +
|
||||
'from fecha_vencimiento) = 7 then '#39'JULIO - '#39' || extract (year fro' +
|
||||
'm fecha_vencimiento)'#10'when extract (month from fecha_vencimiento)' +
|
||||
' = 8 then '#39'AGOSTO - '#39' || extract (year from fecha_vencimiento)'#10'w' +
|
||||
'hen extract (month from fecha_vencimiento) = 9 then '#39'SEPTIEMBRE ' +
|
||||
'- '#39' || extract (year from fecha_vencimiento)'#10'when extract (month' +
|
||||
' from fecha_vencimiento) = 10 then '#39'OCTUBRE - '#39' || extract (year' +
|
||||
' from fecha_vencimiento)'#10'when extract (month from fecha_vencimie' +
|
||||
'nto) = 11 then '#39'NOVIEMBRE - '#39' || extract (year from fecha_vencim' +
|
||||
'iento)'#10'when extract (month from fecha_vencimiento) = 12 then '#39'DI' +
|
||||
'CIEMBRE - '#39' || extract (year from fecha_vencimiento)'#10'end as TITU' +
|
||||
'LO,'#10'case'#10'when strlen(DATOS_BANCARIOS) = 0 then '#39'Sin cuenta banca' +
|
||||
'ria'#39#10'else DATOS_BANCARIOS'#10'end as DATOS_BANCARIOS,'#10'sum(IMPORTE_TO' +
|
||||
'TAL) as importe_total'#10#10'from V_recibos_proveedor'#10#10'group by 1,2,3,' +
|
||||
'4,5'#10'order by 1,2,3,4,5'#10#10#10
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <
|
||||
item
|
||||
DatasetField = 'ID_EMPRESA'
|
||||
TableField = 'ID_EMPRESA'
|
||||
end
|
||||
item
|
||||
DatasetField = 'ANO'
|
||||
TableField = 'ANO'
|
||||
end
|
||||
item
|
||||
DatasetField = 'MES'
|
||||
TableField = 'MES'
|
||||
end
|
||||
item
|
||||
DatasetField = 'TITULO'
|
||||
TableField = 'TITULO'
|
||||
end
|
||||
item
|
||||
DatasetField = 'DATOS_BANCARIOS'
|
||||
TableField = 'DATOS_BANCARIOS'
|
||||
end
|
||||
item
|
||||
DatasetField = 'IMPORTE_TOTAL'
|
||||
TableField = 'IMPORTE_TOTAL'
|
||||
end>
|
||||
end>
|
||||
Name = 'InformeListadoRecibosPendientesResumen'
|
||||
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 = 'DATOS_BANCARIOS'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_TOTAL'
|
||||
DataType = datCurrency
|
||||
end>
|
||||
end
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
TargetTable = 'V_recibos_proveedor'
|
||||
SQL =
|
||||
'select ID_EMPRESA,'#10'extract (year from fecha_emision) as ANO,'#10'ext' +
|
||||
'ract (month from fecha_emision) as MES,'#10'case'#10'when extract (month' +
|
||||
' from fecha_emision) = 1 then '#39'ENERO - '#39' || extract (year from f' +
|
||||
'echa_emision)'#10'when extract (month from fecha_emision) = 2 then '#39 +
|
||||
'FEBRERO - '#39' || extract (year from fecha_emision)'#10'when extract (m' +
|
||||
'onth from fecha_emision) = 3 then '#39'MARZO - '#39' || extract (year fr' +
|
||||
'om fecha_emision)'#10'when extract (month from fecha_emision) = 4 th' +
|
||||
'en '#39'ABRIL - '#39' || extract (year from fecha_emision)'#10'when extract ' +
|
||||
'(month from fecha_emision) = 5 then '#39'MAYO - '#39' || extract (year f' +
|
||||
'rom fecha_emision)'#10'when extract (month from fecha_emision) = 6 t' +
|
||||
'hen '#39'JUNIO - '#39' || extract (year from fecha_emision)'#10'when extract' +
|
||||
' (month from fecha_emision) = 7 then '#39'JULIO - '#39' || extract (year' +
|
||||
' from fecha_emision)'#10'when extract (month from fecha_emision) = 8' +
|
||||
' then '#39'AGOSTO - '#39' || extract (year from fecha_emision)'#10'when extr' +
|
||||
'act (month from fecha_emision) = 9 then '#39'SEPTIEMBRE - '#39' || extra' +
|
||||
'ct (year from fecha_emision)'#10'when extract (month from fecha_emis' +
|
||||
'ion) = 10 then '#39'OCTUBRE - '#39' || extract (year from fecha_emision)' +
|
||||
#10'when extract (month from fecha_emision) = 11 then '#39'NOVIEMBRE - ' +
|
||||
#39' || extract (year from fecha_emision)'#10'when extract (month from ' +
|
||||
'fecha_emision) = 12 then '#39'DICIEMBRE - '#39' || extract (year from fe' +
|
||||
'cha_emision)'#10'end as TITULO,'#10'REFERENCIA, ID_PROVEEDOR, NOMBRE_PR' +
|
||||
'OVEEDOR, SITUACION, NIF_CIF_PROVEEDOR, fecha_emision, FECHA_venc' +
|
||||
'imiento,'#10'IMPORTE_TOTAL'#10#10'from V_recibos_proveedor'#10'where {where}'#10'o' +
|
||||
'rder by ANO, MES, NOMBRE_PROVEEDOR'#10#10
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <
|
||||
item
|
||||
DatasetField = 'ID_EMPRESA'
|
||||
TableField = 'ID_EMPRESA'
|
||||
end
|
||||
item
|
||||
DatasetField = 'ANO'
|
||||
TableField = 'ANO'
|
||||
end
|
||||
item
|
||||
DatasetField = 'MES'
|
||||
TableField = 'MES'
|
||||
end
|
||||
item
|
||||
DatasetField = 'TITULO'
|
||||
TableField = 'TITULO'
|
||||
end
|
||||
item
|
||||
DatasetField = 'REFERENCIA'
|
||||
TableField = 'REFERENCIA'
|
||||
end
|
||||
item
|
||||
DatasetField = 'ID_PROVEEDOR'
|
||||
TableField = 'ID_PROVEEDOR'
|
||||
end
|
||||
item
|
||||
DatasetField = 'NOMBRE_PROVEEDOR'
|
||||
TableField = 'NOMBRE_PROVEEDOR'
|
||||
end
|
||||
item
|
||||
DatasetField = 'SITUACION'
|
||||
TableField = 'SITUACION'
|
||||
end
|
||||
item
|
||||
DatasetField = 'NIF_CIF_PROVEEDOR'
|
||||
TableField = 'NIF_CIF_PROVEEDOR'
|
||||
end
|
||||
item
|
||||
DatasetField = 'FECHA_EMISION'
|
||||
TableField = 'FECHA_EMISION'
|
||||
end
|
||||
item
|
||||
DatasetField = 'FECHA_VENCIMIENTO'
|
||||
TableField = 'FECHA_VENCIMIENTO'
|
||||
end
|
||||
item
|
||||
DatasetField = 'IMPORTE_TOTAL'
|
||||
TableField = 'IMPORTE_TOTAL'
|
||||
end>
|
||||
end>
|
||||
Name = 'InformeListadoRecibos'
|
||||
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 = 'REFERENCIA'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'ID_PROVEEDOR'
|
||||
DataType = datInteger
|
||||
end
|
||||
item
|
||||
Name = 'NOMBRE_PROVEEDOR'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'SITUACION'
|
||||
DataType = datString
|
||||
Size = 9
|
||||
end
|
||||
item
|
||||
Name = 'NIF_CIF_PROVEEDOR'
|
||||
DataType = datString
|
||||
Size = 15
|
||||
end
|
||||
item
|
||||
Name = 'FECHA_EMISION'
|
||||
DataType = datDateTime
|
||||
end
|
||||
item
|
||||
Name = 'FECHA_VENCIMIENTO'
|
||||
DataType = datDateTime
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_TOTAL'
|
||||
DataType = datCurrency
|
||||
end>
|
||||
end
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
TargetTable = 'V_recibos_proveedor'
|
||||
SQL =
|
||||
'select ID_EMPRESA,'#10'extract (year from fecha_emision) as ANO,'#10'ext' +
|
||||
'ract (month from fecha_emision) as MES,'#10'case'#10'when extract (month' +
|
||||
' from fecha_emision) = 1 then '#39'ENERO - '#39' || extract (year from f' +
|
||||
'echa_emision)'#10'when extract (month from fecha_emision) = 2 then '#39 +
|
||||
'FEBRERO - '#39' || extract (year from fecha_emision)'#10'when extract (m' +
|
||||
'onth from fecha_emision) = 3 then '#39'MARZO - '#39' || extract (year fr' +
|
||||
'om fecha_emision)'#10'when extract (month from fecha_emision) = 4 th' +
|
||||
'en '#39'ABRIL - '#39' || extract (year from fecha_emision)'#10'when extract ' +
|
||||
'(month from fecha_emision) = 5 then '#39'MAYO - '#39' || extract (year f' +
|
||||
'rom fecha_emision)'#10'when extract (month from fecha_emision) = 6 t' +
|
||||
'hen '#39'JUNIO - '#39' || extract (year from fecha_emision)'#10'when extract' +
|
||||
' (month from fecha_emision) = 7 then '#39'JULIO - '#39' || extract (year' +
|
||||
' from fecha_emision)'#10'when extract (month from fecha_emision) = 8' +
|
||||
' then '#39'AGOSTO - '#39' || extract (year from fecha_emision)'#10'when extr' +
|
||||
'act (month from fecha_emision) = 9 then '#39'SEPTIEMBRE - '#39' || extra' +
|
||||
'ct (year from fecha_emision)'#10'when extract (month from fecha_emis' +
|
||||
'ion) = 10 then '#39'OCTUBRE - '#39' || extract (year from fecha_emision)' +
|
||||
#10'when extract (month from fecha_emision) = 11 then '#39'NOVIEMBRE - ' +
|
||||
#39' || extract (year from fecha_emision)'#10'when extract (month from ' +
|
||||
'fecha_emision) = 12 then '#39'DICIEMBRE - '#39' || extract (year from fe' +
|
||||
'cha_emision)'#10'end as TITULO,'#10'sum(IMPORTE_TOTAL) as importe_total'#10 +
|
||||
#10'from V_recibos_proveedor'#10'where {where}'#10'group by 1,2,3,4'#10'order b' +
|
||||
'y 1,2,3,4'#10#10
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <
|
||||
item
|
||||
DatasetField = 'ID_EMPRESA'
|
||||
TableField = 'ID_EMPRESA'
|
||||
end
|
||||
item
|
||||
DatasetField = 'ANO'
|
||||
TableField = 'ANO'
|
||||
end
|
||||
item
|
||||
DatasetField = 'MES'
|
||||
TableField = 'MES'
|
||||
end
|
||||
item
|
||||
DatasetField = 'TITULO'
|
||||
TableField = 'TITULO'
|
||||
end
|
||||
item
|
||||
DatasetField = 'IMPORTE_TOTAL'
|
||||
TableField = 'IMPORTE_TOTAL'
|
||||
end>
|
||||
end>
|
||||
Name = 'InformeListadoRecibosResumen'
|
||||
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>
|
||||
JoinDataTables = <>
|
||||
UnionDataTables = <>
|
||||
@ -837,7 +1148,7 @@ object RptRecibosProveedor: TRptRecibosProveedor
|
||||
PrintOptions.Printer = 'Por defecto'
|
||||
PrintOptions.PrintOnSheet = 0
|
||||
ReportOptions.CreateDate = 37800.807714351900000000
|
||||
ReportOptions.LastChange = 39743.775704560180000000
|
||||
ReportOptions.LastChange = 39839.760718449080000000
|
||||
ScriptLanguage = 'PascalScript'
|
||||
ScriptText.Strings = (
|
||||
'procedure frxReportOnStartReport(Sender: TfrxComponent);'
|
||||
@ -934,7 +1245,7 @@ object RptRecibosProveedor: TRptRecibosProveedor
|
||||
StreamingOptions = [soDisableEventsWhileStreaming]
|
||||
RemoteFetchEnabled = False
|
||||
LocalSchema = schReport
|
||||
LocalDataStreamer = DABINAdapter
|
||||
LocalDataStreamer = Bin2DataStreamer
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'Informe_Compensados'
|
||||
@ -999,7 +1310,7 @@ object RptRecibosProveedor: TRptRecibosProveedor
|
||||
StreamingOptions = [soDisableEventsWhileStreaming]
|
||||
RemoteFetchEnabled = False
|
||||
LocalSchema = schReport
|
||||
LocalDataStreamer = DABINAdapter
|
||||
LocalDataStreamer = Bin2DataStreamer
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'InformeListadoRecibos'
|
||||
@ -1020,4 +1331,149 @@ object RptRecibosProveedor: TRptRecibosProveedor
|
||||
Left = 496
|
||||
Top = 16
|
||||
end
|
||||
object tbl_InformeListadoRecibosResumen: 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 = 504
|
||||
Top = 304
|
||||
end
|
||||
object DADSInformeListadoRecibosResumen: TDADataSource
|
||||
DataSet = tbl_InformeListadoRecibosResumen.Dataset
|
||||
DataTable = tbl_InformeListadoRecibosResumen
|
||||
Left = 504
|
||||
Top = 248
|
||||
end
|
||||
object frxDBInformeListadoRecibosResumen: TfrxDBDataset
|
||||
UserName = 'frxDBInformeListadoRecibosResumen'
|
||||
CloseDataSource = True
|
||||
DataSource = DADSInformeListadoRecibosResumen
|
||||
Left = 504
|
||||
Top = 192
|
||||
end
|
||||
object Bin2DataStreamer: TDABin2DataStreamer
|
||||
Left = 48
|
||||
Top = 88
|
||||
end
|
||||
object frxDBInformeListadoRecibosPendientes: TfrxDBDataset
|
||||
UserName = 'frxDBInformeListadoRecibosPendientes'
|
||||
CloseDataSource = True
|
||||
DataSource = DADSInformeListadoRecibosPendientes
|
||||
Left = 704
|
||||
Top = 16
|
||||
end
|
||||
object DADSInformeListadoRecibosPendientes: TDADataSource
|
||||
DataSet = tbl_InformeListadoRecibosPendientes.Dataset
|
||||
DataTable = tbl_InformeListadoRecibosPendientes
|
||||
Left = 704
|
||||
Top = 72
|
||||
end
|
||||
object tbl_InformeListadoRecibosPendientes: TDAMemDataTable
|
||||
RemoteUpdatesOptions = []
|
||||
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 = 'REFERENCIA'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'ID_PROVEEDOR'
|
||||
DataType = datInteger
|
||||
end
|
||||
item
|
||||
Name = 'NOMBRE_PROVEEDOR'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'SITUACION'
|
||||
DataType = datString
|
||||
Size = 9
|
||||
end
|
||||
item
|
||||
Name = 'NIF_CIF_PROVEEDOR'
|
||||
DataType = datString
|
||||
Size = 15
|
||||
end
|
||||
item
|
||||
Name = 'FECHA_VENCIMIENTO'
|
||||
DataType = datDateTime
|
||||
end
|
||||
item
|
||||
Name = 'FECHA_EMISION'
|
||||
DataType = datDateTime
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_TOTAL'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'DATOS_BANCARIOS'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end>
|
||||
Params = <>
|
||||
LogChanges = False
|
||||
StreamingOptions = [soDisableEventsWhileStreaming]
|
||||
RemoteFetchEnabled = False
|
||||
LocalSchema = schReport
|
||||
LocalDataStreamer = Bin2DataStreamer
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'InformeListadoRecibosPendientes'
|
||||
IndexDefs = <>
|
||||
Left = 704
|
||||
Top = 128
|
||||
end
|
||||
object frxDBInformeListadoRecibosPendResumen: TfrxDBDataset
|
||||
UserName = 'frxDBInformeListadoRecibosPendResumen'
|
||||
CloseDataSource = True
|
||||
DataSource = DADSInformeListadoRecibosPendResumen
|
||||
Left = 704
|
||||
Top = 192
|
||||
end
|
||||
object DADSInformeListadoRecibosPendResumen: TDADataSource
|
||||
DataSet = tbl_InformeListadoRecibosPendResumen.Dataset
|
||||
DataTable = tbl_InformeListadoRecibosPendResumen
|
||||
Left = 704
|
||||
Top = 248
|
||||
end
|
||||
object tbl_InformeListadoRecibosPendResumen: 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 = 704
|
||||
Top = 304
|
||||
end
|
||||
end
|
||||
|
||||
@ -7,13 +7,12 @@ uses
|
||||
Dialogs, frxClass, frxDBSet, uDAScriptingProvider,
|
||||
uDADataTable, uDAMemDataTable, DB, uDAClasses, frxChart, frxGradient,
|
||||
frxChBox, frxCross, frxOLE, frxBarcode, frxRich, uDABINAdapter, uROTypes,
|
||||
uDAInterfaces, uDADataStreamer, FactuGES_Intf;
|
||||
uDAInterfaces, uDADataStreamer, FactuGES_Intf, uDABin2DataStreamer;
|
||||
|
||||
type
|
||||
TRptRecibosProveedor = class(TDataModule)
|
||||
DADataCabecera: TDADataSource;
|
||||
tbl_Cabecera: TDAMemDataTable;
|
||||
DABINAdapter: TDABINAdapter;
|
||||
frxRichObject1: TfrxRichObject;
|
||||
frxBarCodeObject1: TfrxBarCodeObject;
|
||||
frxOLEObject1: TfrxOLEObject;
|
||||
@ -29,12 +28,32 @@ type
|
||||
tbl_InformeListadoRecibos: TDAMemDataTable;
|
||||
DADSInformeListadoRecibos: TDADataSource;
|
||||
frxDBInformeListadoRecibos: TfrxDBDataset;
|
||||
tbl_InformeListadoRecibosResumen: TDAMemDataTable;
|
||||
DADSInformeListadoRecibosResumen: TDADataSource;
|
||||
frxDBInformeListadoRecibosResumen: TfrxDBDataset;
|
||||
Bin2DataStreamer: TDABin2DataStreamer;
|
||||
frxDBInformeListadoRecibosPendientes: TfrxDBDataset;
|
||||
DADSInformeListadoRecibosPendientes: TDADataSource;
|
||||
tbl_InformeListadoRecibosPendientes: TDAMemDataTable;
|
||||
frxDBInformeListadoRecibosPendResumen: TfrxDBDataset;
|
||||
DADSInformeListadoRecibosPendResumen: TDADataSource;
|
||||
tbl_InformeListadoRecibosPendResumen: TDAMemDataTable;
|
||||
schReport: TDASchema;
|
||||
DataDictionary: TDADataDictionary;
|
||||
procedure DataModuleCreate(Sender: TObject);
|
||||
private
|
||||
FConnection: IDAConnection;
|
||||
function _GenerarInforme(const TipoInforme: String; const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const ImporteMinimo: Currency): Binary;
|
||||
FIdEmpresa: Integer;
|
||||
FFechaInicio: Variant;
|
||||
FFechaFin: Variant;
|
||||
FFechaVenInicio: Variant;
|
||||
FFechaVenFin: Variant;
|
||||
FListaIDProveedores: TIntegerArray;
|
||||
FImporteMinimo: Currency;
|
||||
|
||||
procedure PrepararTablaInforme(ATabla: TDAMemDataTable);
|
||||
procedure PrepararTablaResumenInforme(ATabla: IDADataset);
|
||||
function _GenerarInforme(const TipoInforme: String): Binary;
|
||||
public
|
||||
function GenerarInformeListadoRecibos(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
|
||||
function GenerarInformeListadoRecibosPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
|
||||
@ -45,7 +64,7 @@ implementation
|
||||
{$R *.dfm}
|
||||
|
||||
uses
|
||||
uSistemaFunc, uDataModuleServer, schRecibosProveedorClient_Intf;
|
||||
uSistemaFunc, StrUtils, uDataModuleServer, schRecibosProveedorClient_Intf;
|
||||
|
||||
const
|
||||
rptInforme = 'InfReciboProveedor.fr3';
|
||||
@ -57,6 +76,9 @@ const
|
||||
{ Dataset names for schReport }
|
||||
ds_InformeCabecera = 'Informe_Cabecera';
|
||||
ds_InformeCompensados = 'Informe_Compensados';
|
||||
ds_InformeListadoRecibosResumen = 'InformeListadoRecibosResumen';
|
||||
ds_InformeListadoREcibosPendientesResumen = 'InformeListadoRecibosPendientesResumen';
|
||||
|
||||
|
||||
{ TRptReciboProveedor }
|
||||
|
||||
@ -78,7 +100,44 @@ function TRptRecibosProveedor.GenerarInformeListadoRecibos(
|
||||
const ImporteMinimo: Currency): Binary;
|
||||
var
|
||||
ATipoInforme: String;
|
||||
AStream: TMemoryStream;
|
||||
dsMaster: IDADataset;
|
||||
|
||||
begin
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
AStream := TMemoryStream.Create;
|
||||
try
|
||||
//Inicializamos parametros
|
||||
FIdEmpresa := IdEmpresa;
|
||||
FFechaInicio := FechaInicio;
|
||||
FFechaFin := FechaFin;
|
||||
FFechaVenInicio := FechaVenInicio;
|
||||
FFechaVenFin := FechaVenFin;
|
||||
FImporteMinimo := ImporteMinimo;
|
||||
|
||||
if Assigned(FListaIDProveedores) then
|
||||
FListaIDProveedores.Free;
|
||||
FListaIDProveedores := ListaIDProveedores;
|
||||
|
||||
//Se prepara la tabla del listado general del informe
|
||||
if tbl_InformeListadoRecibos.Active then
|
||||
tbl_InformeListadoRecibos.Active := False;
|
||||
PrepararTablaInforme(tbl_InformeListadoRecibos);
|
||||
|
||||
//Se prepara la tabla del listado resumen del informe
|
||||
if tbl_InformeListadoRecibosResumen.Active then
|
||||
tbl_InformeListadoRecibosResumen.Active := False;
|
||||
|
||||
dsMaster := schReport.NewDataset(FConnection, ds_InformeListadoRecibosResumen, [], [], False);
|
||||
PrepararTablaResumenInforme(dsMaster);
|
||||
// Filtrar el informe por situacion
|
||||
//Esto se hace para rellenar la tabla del datamodule que usa el informe.
|
||||
dsMaster.Open;
|
||||
AStream.Clear;
|
||||
Bin2DataStreamer.WriteDataset(AStream, dsMaster, [woRows, woSchema], -1);
|
||||
Bin2DataStreamer.ReadDataset(AStream, tbl_InformeListadoRecibosResumen, TRUE, '', TRUE, TRUE);
|
||||
|
||||
|
||||
//DESGLOSADO POR PROVEEDOR EN ESTE INFORME NO SE DESGLOSARÁ POR PROVEEDOR
|
||||
if Desglosado then
|
||||
@ -86,7 +145,16 @@ begin
|
||||
else
|
||||
ATipoInforme := rptInformeListadoRecibosProveedor;
|
||||
|
||||
Result := _GenerarInforme(ATipoInforme, IdEmpresa, FechaInicio, FechaFin, FechaVenInicio, FechaVenFin, ListaIDProveedores, ImporteMinimo);
|
||||
//Finalmente se abren las tablas del informe
|
||||
tbl_InformeListadoRecibos.Active := True;
|
||||
tbl_InformeListadoRecibosResumen.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;
|
||||
|
||||
function TRptRecibosProveedor.GenerarInformeListadoRecibosPendientes(
|
||||
@ -97,15 +165,35 @@ function TRptRecibosProveedor.GenerarInformeListadoRecibosPendientes(
|
||||
var
|
||||
Condicion: TDAWhereExpression;
|
||||
ATipoInforme: String;
|
||||
AStream: TMemoryStream;
|
||||
dsMaster: IDADataset;
|
||||
|
||||
begin
|
||||
if tbl_InformeListadoRecibos.Active then
|
||||
tbl_InformeListadoRecibos.Active := False;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
AStream := TMemoryStream.Create;
|
||||
try
|
||||
//Inicializamos parametros
|
||||
FIdEmpresa := IdEmpresa;
|
||||
FFechaInicio := FechaInicio;
|
||||
FFechaFin := FechaFin;
|
||||
FFechaVenInicio := FechaVenInicio;
|
||||
FFechaVenFin := FechaVenFin;
|
||||
FImporteMinimo := ImporteMinimo;
|
||||
|
||||
if Assigned(FListaIDProveedores) then
|
||||
FListaIDProveedores.Free;
|
||||
FListaIDProveedores := ListaIDProveedores;
|
||||
|
||||
//Se prepara la tabla del listado general del informe
|
||||
if tbl_InformeListadoRecibosPendientes.Active then
|
||||
tbl_InformeListadoRecibosPendientes.Active := False;
|
||||
PrepararTablaInforme(tbl_InformeListadoRecibosPendientes);
|
||||
|
||||
// Filtrar el informe por situacion
|
||||
with tbl_InformeListadoRecibos.DynamicWhere do
|
||||
with tbl_InformeListadoRecibosPendientes.DynamicWhere do
|
||||
begin
|
||||
// (ID_EMPRESA >= ID)
|
||||
// (SITUACION <> PAGADO)
|
||||
Condicion := NewBinaryExpression(NewField('', fld_RecibosProveedorSITUACION), NewConstant('PAGADO', datString), dboNotEqual);
|
||||
if IsEmpty then
|
||||
Expression := Condicion
|
||||
@ -113,6 +201,20 @@ begin
|
||||
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
||||
end;
|
||||
|
||||
//Se prepara la tabla del listado resumen del informe
|
||||
if tbl_InformeListadoRecibosPendResumen.Active then
|
||||
tbl_InformeListadoRecibosPendResumen.Active := False;
|
||||
|
||||
dsMaster := schReport.NewDataset(FConnection, ds_InformeListadoRecibosPendientesResumen, [], [], False);
|
||||
PrepararTablaResumenInforme(dsMaster);
|
||||
// Filtrar el informe por situacion
|
||||
dsMaster.Where.AddText(' AND (SITUACION <> ''PAGADO'')');
|
||||
//Esto se hace para rellenar la tabla del datamodule que usa el informe.
|
||||
dsMaster.Open;
|
||||
AStream.Clear;
|
||||
Bin2DataStreamer.WriteDataset(AStream, dsMaster, [woRows, woSchema], -1);
|
||||
Bin2DataStreamer.ReadDataset(AStream, tbl_InformeListadoRecibosPendResumen, TRUE, '', TRUE, TRUE);
|
||||
|
||||
|
||||
//DESGLOSADO POR PROVEEDOR EN ESTE INFORME NO SE DESGLOSARÁ POR PROVEEDOR
|
||||
if Desglosado then
|
||||
@ -120,33 +222,29 @@ begin
|
||||
else
|
||||
ATipoInforme := rptInformeListadoRecibosProvPendientes;
|
||||
|
||||
Result := _GenerarInforme(ATipoInforme, IdEmpresa, FechaInicio, FechaFin, FechaVenInicio, FechaVenFin, ListaIDProveedores, ImporteMinimo);
|
||||
//Finalmente se abren las tablas del informe
|
||||
tbl_InformeListadoRecibosPendientes.Active := True;
|
||||
tbl_InformeListadoRecibosPendResumen.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;
|
||||
|
||||
function TRptRecibosProveedor._GenerarInforme(const TipoInforme: String;
|
||||
const IdEmpresa: Integer; const FechaInicio, FechaFin: Variant;
|
||||
const FechaVenInicio, FechaVenFin: Variant;
|
||||
const ListaIDProveedores: TIntegerArray;
|
||||
const ImporteMinimo: Currency): Binary;
|
||||
procedure TRptRecibosProveedor.PrepararTablaInforme(ATabla: TDAMemDataTable);
|
||||
var
|
||||
Condicion: TDAWhereExpression;
|
||||
i: Integer;
|
||||
AInforme: Variant;
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
|
||||
if tbl_InformeListadoRecibos.Active then
|
||||
tbl_InformeListadoRecibos.Active := False;
|
||||
|
||||
// Filtrar el informe por empresa
|
||||
with tbl_InformeListadoRecibos.DynamicWhere do
|
||||
with ATabla.DynamicWhere do
|
||||
begin
|
||||
// (ID_EMPRESA >= ID)
|
||||
Condicion := NewBinaryExpression(NewField('', fld_RecibosProveedorID_EMPRESA), NewConstant(IdEmpresa, datInteger), dboEqual);
|
||||
Condicion := NewBinaryExpression(NewField('', fld_RecibosProveedorID_EMPRESA), NewConstant(FIdEmpresa, datInteger), dboEqual);
|
||||
if IsEmpty then
|
||||
Expression := Condicion
|
||||
else
|
||||
@ -154,14 +252,14 @@ begin
|
||||
end;
|
||||
|
||||
// Filtrar el informe por fechas
|
||||
if not VarIsNull(FechaInicio)
|
||||
and not VarIsNull(FechaFin) then
|
||||
if not VarIsNull(FFechaInicio)
|
||||
and not VarIsNull(FFechaFin) then
|
||||
begin
|
||||
with tbl_InformeListadoRecibos.DynamicWhere do
|
||||
with ATabla.DynamicWhere do
|
||||
begin
|
||||
// (FECHA_INICIO between FECHA_FIN)
|
||||
Condicion := NewBinaryExpression(NewField('', fld_RecibosProveedorFECHA_EMISION), NewConstant(FechaInicio, datDateTime), dboGreaterOrEqual);
|
||||
Condicion := NewBinaryExpression(NewBinaryExpression(NewField('', fld_RecibosProveedorFECHA_EMISION), NewConstant(FechaFin, datDateTime), dboLessOrEqual), Condicion, dboAnd);
|
||||
Condicion := NewBinaryExpression(NewField('', fld_RecibosProveedorFECHA_EMISION), NewConstant(FFechaInicio, datDateTime), dboGreaterOrEqual);
|
||||
Condicion := NewBinaryExpression(NewBinaryExpression(NewField('', fld_RecibosProveedorFECHA_EMISION), NewConstant(FFechaFin, datDateTime), dboLessOrEqual), Condicion, dboAnd);
|
||||
if IsEmpty then
|
||||
Expression := Condicion
|
||||
else
|
||||
@ -170,14 +268,14 @@ begin
|
||||
end;
|
||||
|
||||
// Filtrar el informe por fechas de vencimiento
|
||||
if not VarIsNull(FechaVenInicio)
|
||||
and not VarIsNull(FechaVenFin) then
|
||||
if not VarIsNull(FFechaVenInicio)
|
||||
and not VarIsNull(FFechaVenFin) then
|
||||
begin
|
||||
with tbl_InformeListadoRecibos.DynamicWhere do
|
||||
with ATabla.DynamicWhere do
|
||||
begin
|
||||
// (FECHA_VENCIMIENTO_INICIO between FECHA_VENCIMIENTO_FIN)
|
||||
Condicion := NewBinaryExpression(NewField('', fld_RecibosProveedorFECHA_VENCIMIENTO), NewConstant(FechaVenInicio, datDateTime), dboGreaterOrEqual);
|
||||
Condicion := NewBinaryExpression(NewBinaryExpression(NewField('', fld_RecibosProveedorFECHA_VENCIMIENTO), NewConstant(FechaVenFin, datDateTime), dboLessOrEqual), Condicion, dboAnd);
|
||||
Condicion := NewBinaryExpression(NewField('', fld_RecibosProveedorFECHA_VENCIMIENTO), NewConstant(FFechaVenInicio, datDateTime), dboGreaterOrEqual);
|
||||
Condicion := NewBinaryExpression(NewBinaryExpression(NewField('', fld_RecibosProveedorFECHA_VENCIMIENTO), NewConstant(FFechaVenFin, datDateTime), dboLessOrEqual), Condicion, dboAnd);
|
||||
if IsEmpty then
|
||||
Expression := Condicion
|
||||
else
|
||||
@ -186,15 +284,15 @@ begin
|
||||
end;
|
||||
|
||||
// Filtrar el informe por proveedor
|
||||
if Assigned(ListaIDProveedores) then
|
||||
if Assigned(FListaIDProveedores) then
|
||||
begin
|
||||
with tbl_InformeListadoRecibos.DynamicWhere do
|
||||
with ATabla.DynamicWhere do
|
||||
begin
|
||||
for i := 0 to ListaIDProveedores.Count - 1 do
|
||||
for i := 0 to FListaIDProveedores.Count - 1 do
|
||||
begin
|
||||
|
||||
// (ID_PROVEEDOR = ID)
|
||||
Condicion := NewBinaryExpression(NewField('', fld_RecibosProveedorID_PROVEEDOR), NewConstant(ListaIDProveedores.Items[i], datInteger), dboEqual);
|
||||
Condicion := NewBinaryExpression(NewField('', fld_RecibosProveedorID_PROVEEDOR), NewConstant(FListaIDProveedores.Items[i], datInteger), dboEqual);
|
||||
if IsEmpty then
|
||||
Expression := Condicion
|
||||
else
|
||||
@ -204,35 +302,85 @@ begin
|
||||
end;
|
||||
|
||||
// Filtrar el informe por importe minimo
|
||||
if (ImporteMinimo > 0) then
|
||||
if (FImporteMinimo > 0) then
|
||||
begin
|
||||
with tbl_InformeListadoRecibos.DynamicWhere do
|
||||
with ATabla.DynamicWhere do
|
||||
begin
|
||||
// (IMPORTE_TOTAL > ImporteMinimo)
|
||||
Condicion := NewBinaryExpression(NewField('', fld_RecibosProveedorIMPORTE_TOTAL), NewConstant(ImporteMinimo, datCurrency), dboGreaterOrEqual);
|
||||
Condicion := NewBinaryExpression(NewField('', fld_RecibosProveedorIMPORTE_TOTAL), NewConstant(FImporteMinimo, datCurrency), dboGreaterOrEqual);
|
||||
if IsEmpty then
|
||||
Expression := Condicion
|
||||
else
|
||||
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
tbl_InformeListadoRecibos.Active := True;
|
||||
procedure TRptRecibosProveedor.PrepararTablaResumenInforme(ATabla: IDADataset);
|
||||
var
|
||||
i: Integer;
|
||||
AWhereStr : String;
|
||||
|
||||
AInforme := DarRutaFichero(DarRutaInformes, TipoInforme, IntToStr(IdEmpresa));
|
||||
begin
|
||||
// Filtrar el informe por empresa
|
||||
AWhereStr := ' (' + fld_RecibosProveedorID_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_RecibosProveedorFECHA_EMISION + ' between ''' + ReplaceStr(VarToStr(FFechaInicio),'/','.') + ''' and ''' + ReplaceStr(VarToStr(FFechaFin),'/','.') + ''') ';
|
||||
end;
|
||||
|
||||
// Filtrar el informe por fechas de vencimiento
|
||||
if not VarIsNull(FFechaVenInicio)
|
||||
and not VarIsNull(FFechaVenFin) then
|
||||
begin
|
||||
if Length(AWhereStr) > 0 then
|
||||
AWhereStr := AWhereStr + 'AND';
|
||||
AWhereStr := AWhereStr + ' (' + fld_RecibosProveedorFECHA_VENCIMIENTO + ' between ''' + ReplaceStr(VarToStr(FFechaVenInicio),'/','.') + ''' and ''' + ReplaceStr(VarToStr(FFechaVenFin),'/','.') + ''') ';
|
||||
end;
|
||||
|
||||
// Filtrar el informe por proveedor
|
||||
if Assigned(FListaIDProveedores) then
|
||||
begin
|
||||
for i := 0 to FListaIDProveedores.Count - 1 do
|
||||
begin
|
||||
if Length(AWhereStr) > 0 then
|
||||
AWhereStr := AWhereStr + 'AND';
|
||||
AWhereStr := AWhereStr + ' (' + fld_RecibosProveedorID_PROVEEDOR + ' = ' + IntToStr(FListaIDProveedores.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_RecibosProveedorIMPORTE_TOTAL + ' >= ' + CurrToStr(FImporteMinimo) + ') ';
|
||||
end;
|
||||
|
||||
ATabla.Where.AddText(AWhereStr);
|
||||
end;
|
||||
|
||||
function TRptRecibosProveedor._GenerarInforme(const TipoInforme: String): Binary;
|
||||
var
|
||||
AInforme: Variant;
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
AInforme := DarRutaFichero(DarRutaInformes, TipoInforme, IntToStr(FIdEmpresa));
|
||||
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.Variables.Variables['FechaInicio'] := FFechaInicio;
|
||||
frxReport.Variables.Variables['FechaFin'] := FFechaFin;
|
||||
|
||||
frxReport.PrepareReport(False);
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Binary file not shown.
@ -14,7 +14,7 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "FileVersion", "1.6.5.0\0"
|
||||
VALUE "ProductVersion", "1.6.5.0\0"
|
||||
VALUE "CompileDate", "jueves, 22 de enero de 2009 16:22\0"
|
||||
VALUE "CompileDate", "viernes, 23 de enero de 2009 18:57\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user