diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index 8048b908..aefff5ea 100644 --- a/Source/Cliente/FactuGES.dproj +++ b/Source/Cliente/FactuGES.dproj @@ -54,11 +54,7 @@ Delphi.Personality VCLApplication -FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse1370FalseFalseFalseFalseFalse30821252Rodax Software S.L.1.3.7.0FactuGESFactuGES1.3.7.0 - - - - +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse1400FalseFalseFalseFalseFalse30821252Rodax Software S.L.1.4.0.0FactuGESFactuGES1.4.0.0 diff --git a/Source/Cliente/FactuGES.rc b/Source/Cliente/FactuGES.rc index a06fb814..e8053c2d 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 1,3,7,0 -PRODUCTVERSION 1,3,7,0 +FILEVERSION 1,4,0,0 +PRODUCTVERSION 1,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", "1.3.7.0\0" + VALUE "FileVersion", "1.4.0.0\0" VALUE "InternalName", "FactuGES\0" VALUE "ProductName", "FactuGES\0" - VALUE "ProductVersion", "1.3.7.0\0" + VALUE "ProductVersion", "1.4.0.0\0" END END BLOCK "VarFileInfo" diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index 5d085937..6fc88ef0 100644 Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ diff --git a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas index dc283b21..f4147466 100644 --- a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas +++ b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas @@ -94,8 +94,8 @@ type function GenerarFactura(const ListaID : TIntegerArray): Binary; function GenerarFacturaEnPDF(const ListaID : TIntegerArray): Binary; function GenerarInformeIVA(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; - function GetInformeListadoFacturas(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; - function GetInformeListadoFacturasPendientes(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarInformeListadoFacturas(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarInformeListadoFacturasPendientes(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; end; implementation @@ -187,7 +187,7 @@ begin Result := _GenerarInforme(ATipoInforme, IdEmpresa, FechaInicio, FechaFin, ListaIDClientes, ImporteMinimo); end; -function TRptFacturasCliente.GetInformeListadoFacturas(const IdEmpresa: Integer; +function TRptFacturasCliente.GenerarInformeListadoFacturas(const IdEmpresa: Integer; const FechaInicio, FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; var @@ -204,7 +204,7 @@ begin Result := _GenerarInforme(ATipoInforme, IdEmpresa, FechaInicio, FechaFin, ListaIDClientes, ImporteMinimo); end; -function TRptFacturasCliente.GetInformeListadoFacturasPendientes( +function TRptFacturasCliente.GenerarInformeListadoFacturasPendientes( const IdEmpresa: Integer; const FechaInicio, FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas index 1dcd18a6..b4327bcd 100644 --- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas +++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas @@ -123,13 +123,13 @@ begin begin case JsInformesDialog.CustomButtonResult of 100 : begin // Listado de facturas pendientes - AGestorInformesController.VerInformeListadoFacturasPendientes; + AGestorInformesController.VerInformeListadoFacturasCliPendientes; end; 200 : begin // Listado de IVA AGestorInformesController.VerInformeIVAClientes; end; 300 : begin // Listado de facturas de cliente - AGestorInformesController.VerInformeListadoFacturas; + AGestorInformesController.VerInformeListadoFacturasCli; end; end; end; diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorInfFacturasClienteReport.dfm b/Source/Modulos/Facturas de cliente/Views/uEditorInfFacturasClienteReport.dfm new file mode 100644 index 00000000..5f0a64d7 --- /dev/null +++ b/Source/Modulos/Facturas de cliente/Views/uEditorInfFacturasClienteReport.dfm @@ -0,0 +1,6 @@ +inherited fEditorPreview1: TfEditorPreview1 + Caption = 'fEditorPreview1' + ExplicitHeight = 492 + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorInfFacturasClienteReport.pas b/Source/Modulos/Facturas de cliente/Views/uEditorInfFacturasClienteReport.pas new file mode 100644 index 00000000..67cd04fa --- /dev/null +++ b/Source/Modulos/Facturas de cliente/Views/uEditorInfFacturasClienteReport.pas @@ -0,0 +1,30 @@ +unit uEditorInfFacturasClienteReport; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uEditorPreview, frxExportText, frxExportRTF, frxExportMail, + frxExportXLS, frxExportImage, frxExportPDF, frxClass, frxDCtrl, frxGradient, + frxChBox, frxCross, frxRich, frxOLE, frxBarcode, JvAppStorage, + JvAppRegistryStorage, JvComponentBase, JvFormPlacement, ImgList, PngImageList, + StdActns, ActnList, ComCtrls, JvExComCtrls, JvStatusBar, TB2ExtItems, + TBXExtItems, TBX, TB2Item, TB2Dock, TB2Toolbar, pngimage, ExtCtrls, + JvExControls, JvNavigationPane; + +type + TfEditorPreview1 = class(TfEditorPreview) + private + { Private declarations } + public + { Public declarations } + end; + +var + fEditorPreview1: TfEditorPreview1; + +implementation + +{$R *.dfm} + +end. diff --git a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm index 14d2b765..6defa985 100644 --- a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm +++ b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm @@ -1,196 +1,111 @@ object RptFacturasProveedor: TRptFacturasProveedor OldCreateOrder = True OnCreate = DataModuleCreate - Height = 405 - Width = 447 - object DADataCabecera: TDADataSource - DataTable = tbl_FacturaProveedor - Left = 264 - Top = 72 - end - object DADataDetalles: TDADataSource - DataTable = tbl_DetallesFacturaProveedor - Left = 344 - Top = 72 - end - object tbl_FacturaProveedor: TDACDSDataTable - RemoteUpdatesOptions = [] - Fields = <> - Params = <> - MasterMappingMode = mmDataRequest - LogChanges = False - StreamingOptions = [soDisableEventsWhileStreaming] - RemoteFetchEnabled = False - SchemaCall.Params = <> - DataRequestCall.Params = <> - DataUpdateCall.Params = <> - ScriptCall.Params = <> - ReadOnly = False - DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] - MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] - IndexDefs = <> - Left = 264 - Top = 128 - end - object tbl_DetallesFacturaProveedor: TDACDSDataTable - RemoteUpdatesOptions = [] - Fields = <> - Params = <> - MasterMappingMode = mmDataRequest - LogChanges = False - StreamingOptions = [soDisableEventsWhileStreaming] - RemoteFetchEnabled = False - SchemaCall.Params = <> - DataRequestCall.Params = <> - DataUpdateCall.Params = <> - ScriptCall.Params = <> - ReadOnly = False - DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] - MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] - IndexDefs = <> - Left = 344 - Top = 128 - end - object DABINAdapter: TDABINAdapter - Left = 48 - Top = 80 - end - object frxRichObject1: TfrxRichObject - Left = 48 - Top = 296 - end - object frxBarCodeObject1: TfrxBarCodeObject - Left = 144 - Top = 296 - end - object frxOLEObject1: TfrxOLEObject - Left = 48 - Top = 344 - end - object frxCrossObject1: TfrxCrossObject - Left = 144 - Top = 344 - end - object frxCheckBoxObject1: TfrxCheckBoxObject - Left = 256 - Top = 296 - end - object frxGradientObject1: TfrxGradientObject - Left = 360 - Top = 296 - end - object frxChartObject1: TfrxChartObject - Left = 256 - Top = 344 - end + Height = 513 + Width = 933 object schReport: TDASchema ConnectionManager = dmServer.ConnectionManager - DataDictionary = DataDictionary Datasets = < - item - Params = < - item - Name = 'ID_FACTURA' - DataType = datInteger - BlobType = dabtUnknown - Value = '' - ParamType = daptInput - end> - Statements = < - item - Connection = 'IBX' - TargetTable = 'V_RECIBOS_PROVEEDOR' - SQL = - 'SELECT'#10' V_RECIBOS_PROVEEDOR.FECHA_VENCIMIENTO, V_RECIBOS_PROV' + - 'EEDOR.IMPORTE_TOTAL'#10'FROM V_RECIBOS_PROVEEDOR'#10'WHERE V_RECIBOS_PRO' + - 'VEEDOR.ID_FACTURA = :ID_FACTURA'#10'ORDER BY V_RECIBOS_PROVEEDOR.FEC' + - 'HA_VENCIMIENTO' - StatementType = stSQL - ColumnMappings = < - item - DatasetField = 'FECHA_VENCIMIENTO' - TableField = 'FECHA_VENCIMIENTO' - end - item - DatasetField = 'IMPORTE_TOTAL' - TableField = 'IMPORTE_TOTAL' - end> - end> - Name = 'InformeFacturasProveedor_Vencimientos' - Fields = < - item - Name = 'FECHA_VENCIMIENTO' - DataType = datDateTime - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'IMPORTE_TOTAL' - DataType = datFloat - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end> - BusinessRulesClient.ScriptLanguage = rslPascalScript - BusinessRulesServer.ScriptLanguage = rslPascalScript - end item Params = < item Name = 'ID' DataType = datInteger - BlobType = dabtUnknown - Value = '12' + Value = '1' ParamType = daptInput end> Statements = < item Connection = 'IBX' - TargetTable = 'V_FACTURAS_PROVEEDOR' SQL = - 'SELECT'#10' V_FACTURAS_PROVEEDOR.ID, V_FACTURAS_PROVEEDOR.REFEREN' + - 'CIA, V_FACTURAS_PROVEEDOR.FECHA_FACTURA,'#10' V_FACTURAS_PROVEEDO' + - 'R.BASE_IMPONIBLE, V_FACTURAS_PROVEEDOR.DESCUENTO, V_FACTURAS_PRO' + - 'VEEDOR.IMPORTE_DESCUENTO,'#10' V_FACTURAS_PROVEEDOR.IVA, V_FACTUR' + - 'AS_PROVEEDOR.IMPORTE_IVA,'#10' V_FACTURAS_PROVEEDOR.RE, V_FACTURA' + - 'S_PROVEEDOR.IMPORTE_RE,'#10' V_FACTURAS_PROVEEDOR.IMPORTE_TOTAL,'#10 + - ' V_FACTURAS_PROVEEDOR.OBSERVACIONES, FORMAS_PAGO.DESCRIPCION ' + - 'AS FORMA_PAGO, V_FACTURAS_PROVEEDOR.ID_PROVEEDOR,'#10' V_FACTURAS' + - '_PROVEEDOR.NIF_CIF, V_FACTURAS_PROVEEDOR.NOMBRE, V_FACTURAS_PROV' + - 'EEDOR.CALLE,'#10' V_FACTURAS_PROVEEDOR.PROVINCIA, V_FACTURAS_PROV' + - 'EEDOR.CODIGO_POSTAL, V_FACTURAS_PROVEEDOR.POBLACION,'#10#10' ID_EMP' + - 'RESA, EMPRESAS.NIF_CIF as NIF_CIF_EMPRESA, EMPRESAS.RAZON_SOCIAL' + - ','#10' EMPRESAS.CALLE as CALLE_EMPRESA, EMPRESAS.POBLACION as POB' + - 'LACION_EMPRESA,'#10' EMPRESAS.PROVINCIA as PROVINCIA_EMPRESA, EMP' + - 'RESAS.CODIGO_POSTAL as CODIGO_POSTAL_EMPRESA,'#10' EMPRESAS.TELEF' + - 'ONO_1, EMPRESAS.FAX, EMPRESAS.MOVIL_1, EMPRESAS.EMAIL_1,'#10' EMP' + - 'RESAS.PAGINA_WEB, EMPRESAS.REGISTRO_MERCANTIL, EMPRESAS.LOGOTIPO' + - #10#10'FROM V_FACTURAS_PROVEEDOR'#10'LEFT JOIN EMPRESAS ON EMPRESAS.ID = ' + - 'ID_EMPRESA'#10'LEFT JOIN FORMAS_PAGO ON (FORMAS_PAGO.ID = V_FACTURAS' + - '_PROVEEDOR.ID_FORMA_PAGO)'#10'WHERE V_FACTURAS_PROVEEDOR.ID = :ID' + 'select'#10' V_FACTURAS_PROVEEDOR.id, V_FACTURAS_PROVEEDOR.id_empre' + + 'sa,'#10' V_FACTURAS_PROVEEDOR.referencia, V_FACTURAS_PROVEEDOR.tip' + + 'o,'#10' V_FACTURAS_PROVEEDOR.fecha_factura, V_FACTURAS_PROVEEDOR.b' + + 'ase_imponible,'#10' V_FACTURAS_PROVEEDOR.situacion, V_FACTURAS_PRO' + + 'VEEDOR.descuento,'#10' V_FACTURAS_PROVEEDOR.importe_descuento, V_F' + + 'ACTURAS_PROVEEDOR.iva,'#10' V_FACTURAS_PROVEEDOR.importe_iva, V_FA' + + 'CTURAS_PROVEEDOR.re,'#10' V_FACTURAS_PROVEEDOR.importe_re, V_FACTU' + + 'RAS_PROVEEDOR.importe_total,'#10' V_FACTURAS_PROVEEDOR.observacion' + + 'es, V_FACTURAS_PROVEEDOR.nif_cif,'#10' V_FACTURAS_PROVEEDOR.id_pro' + + 'veedor, V_FACTURAS_PROVEEDOR.nombre,'#10' V_FACTURAS_PROVEEDOR.cal' + + 'le, V_FACTURAS_PROVEEDOR.provincia,'#10' V_FACTURAS_PROVEEDOR.pobl' + + 'acion, V_FACTURAS_PROVEEDOR.codigo_postal,'#10' V_FACTURAS_PROVEED' + + 'OR.recargo_equivalencia, V_FACTURAS_PROVEEDOR.importe_neto,'#10' V' + + '_FACTURAS_PROVEEDOR.importe_porte, formas_pago.descripcion as FO' + + 'RMA_PAGO,'#10' V_FACTURAS_PROVEEDOR.DATOS_BANCARIOS'#10'from V_FACTURA' + + 'S_PROVEEDOR'#10' left outer join formas_pago on (formas_pago.id = ' + + 'V_FACTURAS_PROVEEDOR.id_forma_pago)'#10'WHERE V_FACTURAS_PROVEEDOR.I' + + 'D = :ID'#10 StatementType = stSQL ColumnMappings = < + item + DatasetField = 'ID' + TableField = 'ID' + end + item + DatasetField = 'ID_EMPRESA' + TableField = 'ID_EMPRESA' + end + item + DatasetField = 'REFERENCIA' + TableField = 'REFERENCIA' + end + item + DatasetField = 'TIPO' + TableField = 'TIPO' + end + item + DatasetField = 'FECHA_FACTURA' + TableField = 'FECHA_FACTURA' + end + item + DatasetField = 'BASE_IMPONIBLE' + TableField = 'BASE_IMPONIBLE' + end + item + DatasetField = 'SITUACION' + TableField = 'SITUACION' + end item DatasetField = 'DESCUENTO' TableField = 'DESCUENTO' end + item + DatasetField = 'IMPORTE_DESCUENTO' + TableField = 'IMPORTE_DESCUENTO' + end item DatasetField = 'IVA' TableField = 'IVA' end + item + DatasetField = 'IMPORTE_IVA' + TableField = 'IMPORTE_IVA' + end + item + DatasetField = 'RE' + TableField = 'RE' + end + item + DatasetField = 'IMPORTE_RE' + TableField = 'IMPORTE_RE' + end + item + DatasetField = 'IMPORTE_TOTAL' + TableField = 'IMPORTE_TOTAL' + end item DatasetField = 'OBSERVACIONES' TableField = 'OBSERVACIONES' end + item + DatasetField = 'NIF_CIF' + TableField = 'NIF_CIF' + end + item + DatasetField = 'ID_PROVEEDOR' + TableField = 'ID_PROVEEDOR' + end item DatasetField = 'NOMBRE' TableField = 'NOMBRE' @@ -208,17 +123,363 @@ object RptFacturasProveedor: TRptFacturasProveedor TableField = 'POBLACION' end item - DatasetField = 'REFERENCIA' - TableField = 'REFERENCIA' + DatasetField = 'CODIGO_POSTAL' + TableField = 'CODIGO_POSTAL' end + item + DatasetField = 'RECARGO_EQUIVALENCIA' + TableField = 'RECARGO_EQUIVALENCIA' + end + item + DatasetField = 'IMPORTE_NETO' + TableField = 'IMPORTE_NETO' + end + item + DatasetField = 'IMPORTE_PORTE' + TableField = 'IMPORTE_PORTE' + end + item + DatasetField = 'FORMA_PAGO' + TableField = 'FORMA_PAGO' + end + item + DatasetField = 'DATOS_BANCARIOS' + TableField = 'DATOS_BANCARIOS' + end> + end> + Name = 'InformeFacturasProveedor' + Fields = < + item + Name = 'ID' + DataType = datInteger + DictionaryEntry = 'FacturasCliente_ID' + InPrimaryKey = True + end + item + Name = 'ID_EMPRESA' + DataType = datInteger + DictionaryEntry = 'FacturasCliente_ID_EMPRESA' + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + DictionaryEntry = 'FacturasCliente_REFERENCIA' + end + item + Name = 'TIPO' + DataType = datString + Size = 1 + end + item + Name = 'FECHA_FACTURA' + DataType = datDateTime + DictionaryEntry = 'FacturasCliente_FECHA_FACTURA' + end + item + Name = 'BASE_IMPONIBLE' + DataType = datCurrency + DictionaryEntry = 'FacturasCliente_BASE_IMPONIBLE' + end + item + Name = 'SITUACION' + DataType = datString + Size = 19 + end + item + Name = 'DESCUENTO' + DataType = datFloat + DictionaryEntry = 'FacturasCliente_DESCUENTO' + end + item + Name = 'IMPORTE_DESCUENTO' + DataType = datCurrency + DictionaryEntry = 'FacturasCliente_IMPORTE_DESCUENTO' + end + item + Name = 'IVA' + DataType = datFloat + DictionaryEntry = 'FacturasCliente_IVA' + end + item + Name = 'IMPORTE_IVA' + DataType = datCurrency + DictionaryEntry = 'FacturasCliente_IMPORTE_IVA' + end + item + Name = 'RE' + DataType = datFloat + end + item + Name = 'IMPORTE_RE' + DataType = datCurrency + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + DictionaryEntry = 'FacturasCliente_IMPORTE_TOTAL' + end + item + Name = 'OBSERVACIONES' + DataType = datMemo + DictionaryEntry = 'FacturasCliente_OBSERVACIONES' + end + item + Name = 'NIF_CIF' + DataType = datString + Size = 15 + DictionaryEntry = 'FacturasCliente_NIF_CIF' + end + item + Name = 'ID_PROVEEDOR' + DataType = datInteger + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + DictionaryEntry = 'FacturasCliente_NOMBRE' + end + item + Name = 'CALLE' + DataType = datString + Size = 255 + DictionaryEntry = 'FacturasCliente_CALLE' + end + item + Name = 'PROVINCIA' + DataType = datString + Size = 255 + DictionaryEntry = 'FacturasCliente_PROVINCIA' + end + item + Name = 'POBLACION' + DataType = datString + Size = 255 + DictionaryEntry = 'FacturasCliente_POBLACION' + end + item + Name = 'CODIGO_POSTAL' + DataType = datString + Size = 10 + DictionaryEntry = 'FacturasCliente_CODIGO_POSTAL' + end + item + Name = 'RECARGO_EQUIVALENCIA' + DataType = datSmallInt + end + item + Name = 'IMPORTE_NETO' + DataType = datCurrency + end + item + Name = 'IMPORTE_PORTE' + DataType = datCurrency + end + item + Name = 'FORMA_PAGO' + DataType = datString + Size = 255 + end + item + Name = 'DATOS_BANCARIOS' + DataType = datString + Size = 255 + end> + ReadOnly = True + end + item + Params = < + item + Name = 'ID_FACTURA' + DataType = datInteger + Value = '2' + ParamType = daptInput + end> + Statements = < + item + Connection = 'IBX' + SQL = + 'SELECT'#10' DET.ID, DET.ID_FACTURA, DET.POSICION, DET.TIPO_DETALL' + + 'E, ARTICULOS.REFERENCIA,'#10' DET.CONCEPTO, DET.CANTIDAD, DET.UNI' + + 'DAD_MEDIDA, DET.IMPORTE_UNIDAD,'#10' DET.DESCUENTO, DET.IMPORTE_T' + + 'OTAL, DET.VISIBLE'#10'FROM FACTURAS_PROVEEDOR_DETALLES AS DET'#10'LEFT O' + + 'UTER JOIN ARTICULOS ON (ARTICULOS.ID = DET.ID_ARTICULO)'#10'WHERE DE' + + 'T.ID_FACTURA = :ID_FACTURA AND DET.VISIBLE = 1 AND {Where}'#10'ORDER' + + ' BY DET.ID_FACTURA, DET.POSICION;'#10 + StatementType = stSQL + ColumnMappings = < item DatasetField = 'ID' TableField = 'ID' end + item + DatasetField = 'ID_FACTURA' + TableField = 'ID_FACTURA' + end + item + DatasetField = 'POSICION' + TableField = 'POSICION' + end + item + DatasetField = 'TIPO_DETALLE' + TableField = 'TIPO_DETALLE' + end + item + DatasetField = 'REFERENCIA' + TableField = 'REFERENCIA' + end + item + DatasetField = 'CONCEPTO' + TableField = 'CONCEPTO' + end + item + DatasetField = 'CANTIDAD' + TableField = 'CANTIDAD' + end + item + DatasetField = 'UNIDAD_MEDIDA' + TableField = 'UNIDAD_MEDIDA' + end + item + DatasetField = 'IMPORTE_UNIDAD' + TableField = 'IMPORTE_UNIDAD' + end + item + DatasetField = 'DESCUENTO' + TableField = 'DESCUENTO' + end + item + DatasetField = 'IMPORTE_TOTAL' + TableField = 'IMPORTE_TOTAL' + end + item + DatasetField = 'VISIBLE' + TableField = 'VISIBLE' + end> + end> + Name = 'InformeFacturasProveedor_Detalles' + Fields = < + item + Name = 'ID' + DataType = datInteger + InPrimaryKey = True + end + item + Name = 'ID_FACTURA' + DataType = datInteger + end + item + Name = 'POSICION' + DataType = datInteger + end + item + Name = 'TIPO_DETALLE' + DataType = datString + Size = 25 + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + end + item + Name = 'CONCEPTO' + DataType = datString + Size = 2000 + end + item + Name = 'CANTIDAD' + DataType = datFloat + end + item + Name = 'UNIDAD_MEDIDA' + DataType = datString + Size = 255 + end + item + Name = 'IMPORTE_UNIDAD' + DataType = datCurrency + end + item + Name = 'DESCUENTO' + DataType = datFloat + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'VISIBLE' + DataType = datSmallInt + end> + end + item + Params = <> + Statements = < + item + Connection = 'IBX' + TargetTable = 'V_FACTURAS_PROVEEDOR' + SQL = + 'select ID_EMPRESA,'#10'extract (month from fecha_factura) as MES,'#10'ca' + + 'se'#10'when extract (month from fecha_factura) = 1 then '#39'ENERO - '#39' |' + + '| extract (year from fecha_factura)'#10'when extract (month from fec' + + 'ha_factura) = 2 then '#39'FEBRERO - '#39' || extract (year from fecha_fa' + + 'ctura)'#10'when extract (month from fecha_factura) = 3 then '#39'MARZO -' + + ' '#39' || extract (year from fecha_factura)'#10'when extract (month from' + + ' fecha_factura) = 4 then '#39'ABRIL - '#39' || extract (year from fecha_' + + 'factura)'#10'when extract (month from fecha_factura) = 5 then '#39'MAYO ' + + '- '#39' || extract (year from fecha_factura)'#10'when extract (month fro' + + 'm fecha_factura) = 6 then '#39'JUNIO - '#39' || extract (year from fecha' + + '_factura)'#10'when extract (month from fecha_factura) = 7 then '#39'JULI' + + 'O - '#39' || extract (year from fecha_factura)'#10'when extract (month f' + + 'rom fecha_factura) = 8 then '#39'AGOSTO - '#39' || extract (year from fe' + + 'cha_factura)'#10'when extract (month from fecha_factura) = 9 then '#39'S' + + 'EPTIEMBRE - '#39' || extract (year from fecha_factura)'#10'when extract ' + + '(month from fecha_factura) = 10 then '#39'OCTUBRE - '#39' || extract (ye' + + 'ar from fecha_factura)'#10'when extract (month from fecha_factura) =' + + ' 11 then '#39'NOVIEMBRE - '#39' || extract (year from fecha_factura)'#10'whe' + + 'n extract (month from fecha_factura) = 12 then '#39'DICIEMBRE - '#39' ||' + + ' extract (year from fecha_factura)'#10'end as TITULO,'#10'REFERENCIA, I' + + 'D_PROVEEDOR, NOMBRE, SITUACION, NIF_CIF, FECHA_FACTURA, BASE_IMP' + + 'ONIBLE, IMPORTE_IVA, IMPORTE_TOTAL'#10#10'from V_facturas_proveedor'#10'wh' + + 'ere {where}'#10'order by FECHA_FACTURA'#10#10 + StatementType = stSQL + ColumnMappings = < item DatasetField = 'ID_EMPRESA' TableField = 'ID_EMPRESA' end + item + DatasetField = 'MES' + TableField = '' + SQLOrigin = 'MES' + end + item + DatasetField = 'TITULO' + TableField = '' + SQLOrigin = 'TITULO' + end + item + DatasetField = 'REFERENCIA' + TableField = 'REFERENCIA' + end + item + DatasetField = 'ID_PROVEEDOR' + TableField = 'ID_PROVEEDOR' + end + item + DatasetField = 'NOMBRE' + TableField = 'NOMBRE' + end + item + DatasetField = 'SITUACION' + TableField = 'SITUACION' + end + item + DatasetField = 'NIF_CIF' + TableField = 'NIF_CIF' + end item DatasetField = 'FECHA_FACTURA' TableField = 'FECHA_FACTURA' @@ -227,10 +488,6 @@ object RptFacturasProveedor: TRptFacturasProveedor DatasetField = 'BASE_IMPONIBLE' TableField = 'BASE_IMPONIBLE' end - item - DatasetField = 'IMPORTE_DESCUENTO' - TableField = 'IMPORTE_DESCUENTO' - end item DatasetField = 'IMPORTE_IVA' TableField = 'IMPORTE_IVA' @@ -238,636 +495,70 @@ object RptFacturasProveedor: TRptFacturasProveedor item DatasetField = 'IMPORTE_TOTAL' TableField = 'IMPORTE_TOTAL' - end - item - DatasetField = 'FORMA_PAGO' - TableField = 'FORMA_PAGO' - end - item - DatasetField = 'NIF_CIF' - TableField = 'NIF_CIF' - end - item - DatasetField = 'CODIGO_POSTAL' - TableField = 'CODIGO_POSTAL' - end - item - DatasetField = 'NIF_CIF_EMPRESA' - TableField = 'NIF_CIF_EMPRESA' - end - item - DatasetField = 'RAZON_SOCIAL' - TableField = 'RAZON_SOCIAL' - end - item - DatasetField = 'CALLE_EMPRESA' - TableField = 'CALLE_EMPRESA' - end - item - DatasetField = 'POBLACION_EMPRESA' - TableField = 'POBLACION_EMPRESA' - end - item - DatasetField = 'PROVINCIA_EMPRESA' - TableField = 'PROVINCIA_EMPRESA' - end - item - DatasetField = 'CODIGO_POSTAL_EMPRESA' - TableField = 'CODIGO_POSTAL_EMPRESA' - end - item - DatasetField = 'TELEFONO_1' - TableField = 'TELEFONO_1' - end - item - DatasetField = 'FAX' - TableField = 'FAX' - end - item - DatasetField = 'MOVIL_1' - TableField = 'MOVIL_1' - end - item - DatasetField = 'EMAIL_1' - TableField = 'EMAIL_1' - end - item - DatasetField = 'PAGINA_WEB' - TableField = 'PAGINA_WEB' - end - item - DatasetField = 'REGISTRO_MERCANTIL' - TableField = 'REGISTRO_MERCANTIL' - end - item - DatasetField = 'LOGOTIPO' - TableField = 'LOGOTIPO' - end - item - DatasetField = 'RE' - TableField = 'RE' - end - item - DatasetField = 'IMPORTE_RE' - TableField = 'IMPORTE_RE' - end - item - DatasetField = 'ID_PROVEEDOR' - TableField = 'ID_PROVEEDOR' end> end> - Name = 'InformeFacturasProveedor' + Name = 'InformeListadoFacturas' Fields = < - item - Name = 'ID' - DataType = datAutoInc - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_ID' - InPrimaryKey = True - Calculated = False - Lookup = False - LookupCache = False - end item Name = 'ID_EMPRESA' DataType = datInteger - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_ID_EMPRESA' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False end item - Name = 'FECHA_FACTURA' - DataType = datDateTime - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_FECHA_FACTURA' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False + Name = 'MES' + DataType = datSmallInt end item - Name = 'BASE_IMPONIBLE' - DataType = datFloat - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_BASE_IMPONIBLE' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False + Name = 'TITULO' + DataType = datString + Size = 19 end item Name = 'REFERENCIA' DataType = datString - Size = 20 - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_REFERENCIA' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'IMPORTE_DESCUENTO' - DataType = datFloat - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_IMPORTE_DESCUENTO' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'DESCUENTO' - DataType = datFloat - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_DESCUENTO' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'IMPORTE_IVA' - DataType = datFloat - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_IMPORTE_IVA' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'RE' - DataType = datFloat - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'IMPORTE_RE' - DataType = datFloat - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'IMPORTE_TOTAL' - DataType = datFloat - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_IMPORTE_TOTAL' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'IVA' - DataType = datFloat - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_IVA' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'FORMA_PAGO' - DataType = datMemo - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_FORMA_PAGO' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False + Size = 255 end item Name = 'ID_PROVEEDOR' DataType = datInteger - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + end + item + Name = 'SITUACION' + DataType = datString + Size = 19 end item Name = 'NIF_CIF' DataType = datString Size = 15 - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_NIF_CIF' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False end item - Name = 'OBSERVACIONES' - DataType = datMemo - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_OBSERVACIONES' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False + Name = 'FECHA_FACTURA' + DataType = datDateTime end item - Name = 'NOMBRE' - DataType = datString - Size = 100 - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_NOMBRE' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False + Name = 'BASE_IMPONIBLE' + DataType = datCurrency end item - Name = 'CALLE' - DataType = datString - Size = 150 - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_CALLE' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'PROVINCIA' - DataType = datString - Size = 30 - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_PROVINCIA' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'CODIGO_POSTAL' - DataType = datString - Size = 10 - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_CODIGO_POSTAL' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'POBLACION' - DataType = datString - Size = 150 - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_POBLACION' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'NIF_CIF_EMPRESA' - DataType = datString - Size = 15 - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'RAZON_SOCIAL' - DataType = datString - Size = 255 - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'CALLE_EMPRESA' - DataType = datString - Size = 255 - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'POBLACION_EMPRESA' - DataType = datString - Size = 255 - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'PROVINCIA_EMPRESA' - DataType = datString - Size = 255 - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'CODIGO_POSTAL_EMPRESA' - DataType = datString - Size = 10 - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'TELEFONO_1' - DataType = datString - Size = 25 - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'FAX' - DataType = datString - Size = 25 - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'MOVIL_1' - DataType = datString - Size = 25 - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'EMAIL_1' - DataType = datString - Size = 255 - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'PAGINA_WEB' - DataType = datString - Size = 255 - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'REGISTRO_MERCANTIL' - DataType = datString - Size = 255 - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'LOGOTIPO' - DataType = datBlob - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end> - BusinessRulesClient.ScriptLanguage = rslPascalScript - BusinessRulesServer.ScriptLanguage = rslPascalScript - end - item - Params = < - item - Name = 'ID_FACTURA' - DataType = datInteger - BlobType = dabtUnknown - Value = '13' - ParamType = daptInput - end> - Statements = < - item - Connection = 'IBX' - TargetTable = 'FACTURAS_PROVEEDOR_DETALLES' - SQL = - 'SELECT'#10' ID, ID_FACTURA, POSICION, TIPO_DETALLE, CONCEPTO, CAN' + - 'TIDAD,'#10' IMPORTE_UNIDAD, DESCUENTO, IMPORTE_TOTAL, VISIBLE'#10'FRO' + - 'M FACTURAS_PROVEEDOR_DETALLES'#10'WHERE ID_FACTURA = :ID_FACTURA'#10'ORD' + - 'ER BY POSICION;' - StatementType = stSQL - ColumnMappings = < - item - DatasetField = 'CANTIDAD' - TableField = 'CANTIDAD' - end - item - DatasetField = 'POSICION' - TableField = 'POSICION' - end - item - DatasetField = 'ID' - TableField = 'ID' - end - item - DatasetField = 'ID_FACTURA' - TableField = 'ID_FACTURA' - end - item - DatasetField = 'TIPO_DETALLE' - TableField = 'TIPO_DETALLE' - end - item - DatasetField = 'CONCEPTO' - TableField = 'CONCEPTO' - end - item - DatasetField = 'IMPORTE_UNIDAD' - TableField = 'IMPORTE_UNIDAD' - end - item - DatasetField = 'IMPORTE_TOTAL' - TableField = 'IMPORTE_TOTAL' - end - item - DatasetField = 'VISIBLE' - TableField = 'VISIBLE' - end - item - DatasetField = 'DESCUENTO' - TableField = 'DESCUENTO' - end> - end> - Name = 'InformeFacturasProveedor_Detalles' - Fields = < - item - Name = 'ID' - DataType = datAutoInc - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_Detalles_ID' - InPrimaryKey = True - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'ID_FACTURA' - DataType = datInteger - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_Detalles_ID_FACTURA' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'POSICION' - DataType = datInteger - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_Detalles_POSICION' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'TIPO_DETALLE' - DataType = datString - Size = 10 - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_Detalles_TIPO_DETALLE' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'CONCEPTO' - DataType = datString - Size = 2000 - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_Detalles_CONCEPTO' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'CANTIDAD' - DataType = datInteger - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_Detalles_CANTIDAD' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'IMPORTE_UNIDAD' - DataType = datFloat - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_Detalles_IMPORTE_UNIDAD' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'DESCUENTO' - DataType = datFloat - BlobType = dabtUnknown - DisplayWidth = 0 - Alignment = taLeftJustify - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False + Name = 'IMPORTE_IVA' + DataType = datCurrency end item Name = 'IMPORTE_TOTAL' - DataType = datFloat - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_Detalles_IMPORTE_TOTAL' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False - end - item - Name = 'VISIBLE' - DataType = datInteger - BlobType = dabtUnknown - DictionaryEntry = 'FacturasCliente_Detalles_VISIBLE' - InPrimaryKey = False - Calculated = False - Lookup = False - LookupCache = False + DataType = datCurrency end> - BusinessRulesClient.ScriptLanguage = rslPascalScript - BusinessRulesServer.ScriptLanguage = rslPascalScript end> + JoinDataTables = <> + UnionDataTables = <> Commands = <> RelationShips = <> UpdateRules = <> + Version = 0 Left = 48 Top = 16 end @@ -876,429 +567,819 @@ object RptFacturasProveedor: TRptFacturasProveedor item Name = 'FacturasCliente_ID' DataType = datAutoInc - BlobType = dabtUnknown Required = True - DisplayWidth = 0 DisplayLabel = 'ID' - Alignment = taLeftJustify end item Name = 'FacturasCliente_ID_EMPRESA' DataType = datInteger - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'ID_EMPRESA' - Alignment = taLeftJustify end item Name = 'FacturasCliente_ID_CONTRATO' DataType = datInteger - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'ID_CONTRATO' - Alignment = taLeftJustify end item Name = 'FacturasCliente_FECHA_FACTURA' DataType = datDateTime - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Fecha de las factura' - Alignment = taLeftJustify end item Name = 'FacturasCliente_VENCIMIENTO' DataType = datInteger - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Vencimiento' - Alignment = taLeftJustify end item Name = 'FacturasCliente_SITUACION' DataType = datString Size = 255 - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Situaci'#243'n' - Alignment = taLeftJustify end item Name = 'FacturasCliente_BASE_IMPONIBLE' DataType = datFloat - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Base imponible' Alignment = taRightJustify end item Name = 'FacturasCliente_IMPORTE_DESCUENTO' DataType = datFloat - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Importe dto.' Alignment = taRightJustify end item Name = 'FacturasCliente_IMPORTE_IVA' DataType = datFloat - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Importe IVA' Alignment = taRightJustify end item Name = 'FacturasCliente_IMPORTE_TOTAL' DataType = datFloat - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Importe total' Alignment = taRightJustify end item Name = 'FacturasCliente_FORMA_PAGO' DataType = datMemo - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Forma de pago' - Alignment = taLeftJustify end item Name = 'FacturasCliente_ID_CLIENTE' DataType = datInteger - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'ID_CLIENTE' - Alignment = taLeftJustify end item Name = 'FacturasCliente_NIF_CIF' DataType = datString Size = 15 - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'NIF/CIF' - Alignment = taLeftJustify end item Name = 'FacturasCliente_CODIGO_POSTAL' DataType = datString Size = 10 - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'C'#243'd. postal' - Alignment = taLeftJustify end item Name = 'FacturasCliente_FECHA_ALTA' DataType = datDateTime - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'FECHA_ALTA' - Alignment = taLeftJustify end item Name = 'FacturasCliente_FECHA_MODIFICACION' DataType = datDateTime - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'FECHA_MODIFICACION' - Alignment = taLeftJustify end item Name = 'FacturasCliente_OBSERVACIONES' DataType = datMemo - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Observaciones' - Alignment = taLeftJustify end item Name = 'FacturasCliente_NOMBRE' DataType = datString Size = 100 - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Cliente' - Alignment = taLeftJustify end item Name = 'FacturasCliente_CALLE' DataType = datString Size = 150 - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Direcci'#243'n' - Alignment = taLeftJustify end item Name = 'FacturasCliente_PROVINCIA' DataType = datString Size = 30 - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Provincia' - Alignment = taLeftJustify end item Name = 'FacturasCliente_POBLACION' DataType = datString Size = 150 - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Poblaci'#243'n' - Alignment = taLeftJustify end item Name = 'FacturasCliente_IVA' DataType = datFloat - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'IVA' - Alignment = taLeftJustify end item Name = 'FacturasCliente_USUARIO' DataType = datString Size = 100 - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'USUARIO' - Alignment = taLeftJustify end item Name = 'FacturasCliente_REFERENCIA' DataType = datString Size = 20 - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Referencia' - Alignment = taLeftJustify end item Name = 'FacturasCliente_DESCUENTO' DataType = datFloat - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Dto.' - Alignment = taLeftJustify end item Name = 'FacturasCliente_Detalles_ID' DataType = datAutoInc - BlobType = dabtUnknown Required = True - DisplayWidth = 0 DisplayLabel = 'ID' - Alignment = taLeftJustify end item Name = 'FacturasCliente_Detalles_ID_FACTURA' DataType = datInteger - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'ID_FACTURA' - Alignment = taLeftJustify end item Name = 'FacturasCliente_Detalles_TIPO_DETALLE' DataType = datString - Size = 10 - BlobType = dabtUnknown - DisplayWidth = 0 + Size = 25 DisplayLabel = 'Tipo detalle' - Alignment = taLeftJustify end item Name = 'FacturasCliente_Detalles_CONCEPTO' DataType = datString Size = 2000 - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Concepto' - Alignment = taLeftJustify end item Name = 'FacturasCliente_Detalles_IMPORTE_UNIDAD' DataType = datFloat - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Importe unidad' Alignment = taRightJustify end item Name = 'FacturasCliente_Detalles_IMPORTE_TOTAL' DataType = datFloat - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Importe total' Alignment = taRightJustify end item Name = 'FacturasCliente_Detalles_VISIBLE' DataType = datInteger - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = #191'Visible?' - Alignment = taLeftJustify end item Name = 'FacturasCliente_Detalles_POSICION' DataType = datInteger - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Posici'#243'n' - Alignment = taLeftJustify end item Name = 'FacturasCliente_Detalles_CANTIDAD' DataType = datInteger - BlobType = dabtUnknown - DisplayWidth = 0 DisplayLabel = 'Cantidad' - Alignment = taLeftJustify end> Left = 46 - Top = 158 + Top = 142 + end + object frxDBCabecera: TfrxDBDataset + UserName = 'frxDBCabecera' + CloseDataSource = True + DataSource = DADSCabecera + Left = 264 + Top = 16 + end + object frxDBDetalles: TfrxDBDataset + UserName = 'frxDBDetalles' + CloseDataSource = True + DataSource = DADSDetalles + Left = 344 + Top = 16 + end + object IBDatabase1: TIBDatabase + DatabaseName = 'C:\Codigo Tecsitel\Output\Debug\Database\FACTUGES.FDB' + Params.Strings = ( + 'user_name=sysdba' + 'password=masterkey' + 'lc_ctype=ISO8859_1') + LoginPrompt = False + DefaultTransaction = IBTransaction1 + Left = 48 + Top = 296 + end + object IBTransaction1: TIBTransaction + Left = 48 + Top = 352 + end + object DataSource1: TDataSource + DataSet = cabecera + Left = 216 + Top = 296 + end + object DataSource2: TDataSource + DataSet = detalles + Left = 216 + Top = 352 + end + object cabecera: TIBQuery + Database = IBDatabase1 + Transaction = IBTransaction1 + SQL.Strings = ( + 'select' + ' v_facturas_cliente.id, v_facturas_cliente.id_empresa,' + ' v_facturas_cliente.referencia, v_facturas_cliente.tipo,' + + ' v_facturas_cliente.fecha_factura, v_facturas_cliente.base_imp' + + 'onible,' + ' v_facturas_cliente.situacion, v_facturas_cliente.descuento,' + ' v_facturas_cliente.importe_descuento, v_facturas_cliente.iva,' + ' v_facturas_cliente.importe_iva, v_facturas_cliente.re,' + + ' v_facturas_cliente.importe_re, v_facturas_cliente.importe_tot' + + 'al,' + ' v_facturas_cliente.observaciones, v_facturas_cliente.nif_cif,' + ' v_facturas_cliente.id_cliente, v_facturas_cliente.nombre,' + ' v_facturas_cliente.calle, v_facturas_cliente.provincia,' + + ' v_facturas_cliente.poblacion, v_facturas_cliente.codigo_posta' + + 'l,' + + ' v_facturas_cliente.recargo_equivalencia, v_facturas_cliente.i' + + 'mporte_neto,' + + ' v_facturas_cliente.importe_porte, formas_pago.descripcion as ' + + 'FORMA_PAGO,' + ' v_facturas_cliente.DATOS_BANCARIOS' + 'from v_facturas_cliente' + + ' left outer join formas_pago on (formas_pago.id = v_facturas_c' + + 'liente.id_forma_pago)' + 'WHERE V_FACTURAS_CLIENTE.ID = 2') + Left = 136 + Top = 296 + object cabeceraID: TIntegerField + FieldName = 'ID' + Origin = '"V_FACTURAS_CLIENTE"."ID"' + end + object cabeceraID_EMPRESA: TIntegerField + FieldName = 'ID_EMPRESA' + Origin = '"V_FACTURAS_CLIENTE"."ID_EMPRESA"' + end + object cabeceraREFERENCIA: TIBStringField + FieldName = 'REFERENCIA' + Origin = '"V_FACTURAS_CLIENTE"."REFERENCIA"' + Size = 255 + end + object cabeceraTIPO: TIBStringField + FieldKind = fkInternalCalc + FieldName = 'TIPO' + Origin = '"V_FACTURAS_CLIENTE"."TIPO"' + ProviderFlags = [] + ReadOnly = True + FixedChar = True + Size = 1 + end + object cabeceraFECHA_FACTURA: TDateField + FieldName = 'FECHA_FACTURA' + Origin = '"V_FACTURAS_CLIENTE"."FECHA_FACTURA"' + end + object cabeceraBASE_IMPONIBLE: TIBBCDField + FieldName = 'BASE_IMPONIBLE' + Origin = '"V_FACTURAS_CLIENTE"."BASE_IMPONIBLE"' + Precision = 18 + Size = 2 + end + object cabeceraSITUACION: TIBStringField + FieldKind = fkInternalCalc + FieldName = 'SITUACION' + Origin = '"V_FACTURAS_CLIENTE"."SITUACION"' + ProviderFlags = [] + ReadOnly = True + FixedChar = True + Size = 19 + end + object cabeceraDESCUENTO: TFloatField + FieldName = 'DESCUENTO' + Origin = '"V_FACTURAS_CLIENTE"."DESCUENTO"' + end + object cabeceraIMPORTE_DESCUENTO: TIBBCDField + FieldName = 'IMPORTE_DESCUENTO' + Origin = '"V_FACTURAS_CLIENTE"."IMPORTE_DESCUENTO"' + Precision = 18 + Size = 2 + end + object cabeceraIVA: TFloatField + FieldName = 'IVA' + Origin = '"V_FACTURAS_CLIENTE"."IVA"' + end + object cabeceraIMPORTE_IVA: TIBBCDField + FieldName = 'IMPORTE_IVA' + Origin = '"V_FACTURAS_CLIENTE"."IMPORTE_IVA"' + Precision = 18 + Size = 2 + end + object cabeceraRE: TFloatField + FieldName = 'RE' + Origin = '"V_FACTURAS_CLIENTE"."RE"' + end + object cabeceraIMPORTE_RE: TIBBCDField + FieldName = 'IMPORTE_RE' + Origin = '"V_FACTURAS_CLIENTE"."IMPORTE_RE"' + Precision = 18 + Size = 2 + end + object cabeceraIMPORTE_TOTAL: TIBBCDField + FieldName = 'IMPORTE_TOTAL' + Origin = '"V_FACTURAS_CLIENTE"."IMPORTE_TOTAL"' + Precision = 18 + Size = 2 + end + object cabeceraOBSERVACIONES: TMemoField + FieldName = 'OBSERVACIONES' + Origin = '"V_FACTURAS_CLIENTE"."OBSERVACIONES"' + ProviderFlags = [pfInUpdate] + BlobType = ftMemo + Size = 8 + end + object cabeceraNIF_CIF: TIBStringField + FieldName = 'NIF_CIF' + Origin = '"V_FACTURAS_CLIENTE"."NIF_CIF"' + Size = 15 + end + object cabeceraID_CLIENTE: TIntegerField + FieldName = 'ID_CLIENTE' + Origin = '"V_FACTURAS_CLIENTE"."ID_CLIENTE"' + end + object cabeceraNOMBRE: TIBStringField + FieldName = 'NOMBRE' + Origin = '"V_FACTURAS_CLIENTE"."NOMBRE"' + Size = 255 + end + object cabeceraCALLE: TIBStringField + FieldName = 'CALLE' + Origin = '"V_FACTURAS_CLIENTE"."CALLE"' + Size = 255 + end + object cabeceraPROVINCIA: TIBStringField + FieldName = 'PROVINCIA' + Origin = '"V_FACTURAS_CLIENTE"."PROVINCIA"' + Size = 255 + end + object cabeceraPOBLACION: TIBStringField + FieldName = 'POBLACION' + Origin = '"V_FACTURAS_CLIENTE"."POBLACION"' + Size = 255 + end + object cabeceraCODIGO_POSTAL: TIBStringField + FieldName = 'CODIGO_POSTAL' + Origin = '"V_FACTURAS_CLIENTE"."CODIGO_POSTAL"' + Size = 10 + end + object cabeceraRECARGO_EQUIVALENCIA: TSmallintField + FieldName = 'RECARGO_EQUIVALENCIA' + Origin = '"V_FACTURAS_CLIENTE"."RECARGO_EQUIVALENCIA"' + end + object cabeceraIMPORTE_NETO: TIBBCDField + FieldName = 'IMPORTE_NETO' + Origin = '"V_FACTURAS_CLIENTE"."IMPORTE_NETO"' + Precision = 18 + Size = 2 + end + object cabeceraIMPORTE_PORTE: TIBBCDField + FieldName = 'IMPORTE_PORTE' + Origin = '"V_FACTURAS_CLIENTE"."IMPORTE_PORTE"' + Precision = 18 + Size = 2 + end + object cabeceraFORMA_PAGO: TIBStringField + FieldName = 'FORMA_PAGO' + Origin = '"FORMAS_PAGO"."DESCRIPCION"' + Size = 255 + end + object cabeceraDATOS_BANCARIOS: TIBStringField + FieldName = 'DATOS_BANCARIOS' + Origin = '"V_FACTURAS_CLIENTE"."DATOS_BANCARIOS"' + Size = 255 + end + end + object detalles: TIBQuery + Database = IBDatabase1 + Transaction = IBTransaction1 + SQL.Strings = ( + 'SELECT' + + ' DET.ID, DET.ID_FACTURA, DET.POSICION, DET.TIPO_DETALLE, ARTI' + + 'CULOS.REFERENCIA,' + + ' DET.CONCEPTO, DET.CANTIDAD, DET.IMPORTE_UNIDAD, DET.DESCUENT' + + 'O,' + ' DET.IMPORTE_TOTAL, DET.VISIBLE' + 'FROM FACTURAS_CLIENTE_DETALLES DET' + 'LEFT OUTER JOIN ARTICULOS ON (ARTICULOS.ID = DET.ID_ARTICULO)' + 'WHERE DET.ID_FACTURA = 2 AND DET.VISIBLE = 1 ' + 'ORDER BY DET.ID_FACTURA, DET.POSICION;') + Left = 136 + Top = 352 + object detallesID: TIntegerField + FieldName = 'ID' + Origin = '"FACTURAS_CLIENTE_DETALLES"."ID"' + ProviderFlags = [pfInUpdate, pfInWhere, pfInKey] + Required = True + end + object detallesID_FACTURA: TIntegerField + FieldName = 'ID_FACTURA' + Origin = '"FACTURAS_CLIENTE_DETALLES"."ID_FACTURA"' + Required = True + end + object detallesPOSICION: TIntegerField + FieldName = 'POSICION' + Origin = '"FACTURAS_CLIENTE_DETALLES"."POSICION"' + end + object detallesTIPO_DETALLE: TIBStringField + FieldName = 'TIPO_DETALLE' + Origin = '"FACTURAS_CLIENTE_DETALLES"."TIPO_DETALLE"' + Size = 10 + end + object detallesCONCEPTO: TIBStringField + FieldName = 'CONCEPTO' + Origin = '"FACTURAS_CLIENTE_DETALLES"."CONCEPTO"' + Size = 2000 + end + object detallesCANTIDAD: TIntegerField + FieldName = 'CANTIDAD' + Origin = '"FACTURAS_CLIENTE_DETALLES"."CANTIDAD"' + end + object detallesIMPORTE_UNIDAD: TIBBCDField + FieldName = 'IMPORTE_UNIDAD' + Origin = '"FACTURAS_CLIENTE_DETALLES"."IMPORTE_UNIDAD"' + Precision = 18 + Size = 2 + end + object detallesDESCUENTO: TFloatField + FieldName = 'DESCUENTO' + Origin = '"FACTURAS_CLIENTE_DETALLES"."DESCUENTO"' + end + object detallesIMPORTE_TOTAL: TIBBCDField + FieldName = 'IMPORTE_TOTAL' + Origin = '"FACTURAS_CLIENTE_DETALLES"."IMPORTE_TOTAL"' + Precision = 18 + Size = 2 + end + object detallesVISIBLE: TSmallintField + FieldName = 'VISIBLE' + Origin = '"FACTURAS_CLIENTE_DETALLES"."VISIBLE"' + end + object detallesREFERENCIA: TIBStringField + FieldName = 'REFERENCIA' + Origin = '"ARTICULOS"."REFERENCIA"' + Size = 255 + end + end + object DABINAdapter: TDABINAdapter + Left = 48 + Top = 80 + end + object DADSCabecera: TDADataSource + DataSet = tbl_Cabecera.Dataset + DataTable = tbl_Cabecera + Left = 264 + Top = 72 + end + object DADSDetalles: TDADataSource + DataSet = tbl_Detalles.Dataset + DataTable = tbl_Detalles + Left = 344 + Top = 72 + end + object tbl_Detalles: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ID' + DataType = datInteger + InPrimaryKey = True + end + item + Name = 'ID_FACTURA' + DataType = datInteger + end + item + Name = 'POSICION' + DataType = datInteger + end + item + Name = 'TIPO_DETALLE' + DataType = datString + Size = 25 + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + end + item + Name = 'CONCEPTO' + DataType = datString + Size = 2000 + end + item + Name = 'CANTIDAD' + DataType = datFloat + end + item + Name = 'UNIDAD_MEDIDA' + DataType = datString + Size = 255 + end + item + Name = 'IMPORTE_UNIDAD' + DataType = datCurrency + end + item + Name = 'DESCUENTO' + DataType = datFloat + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'VISIBLE' + DataType = datSmallInt + end> + Params = < + item + Name = 'ID_FACTURA' + DataType = datInteger + Value = '2' + ParamType = daptInput + end> + MasterParamsMappings.Strings = ( + 'ID_FACTURA=ID') + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = DABINAdapter + MasterSource = DADSCabecera + MasterFields = 'ID' + DetailFields = 'ID_FACTURA' + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'InformeFacturasProveedor_Detalles' + IndexDefs = <> + Left = 344 + Top = 128 + end + object tbl_Cabecera: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ID' + DataType = datInteger + DictionaryEntry = 'FacturasCliente_ID' + InPrimaryKey = True + end + item + Name = 'ID_EMPRESA' + DataType = datInteger + DictionaryEntry = 'FacturasCliente_ID_EMPRESA' + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + DictionaryEntry = 'FacturasCliente_REFERENCIA' + end + item + Name = 'TIPO' + DataType = datString + Size = 1 + end + item + Name = 'FECHA_FACTURA' + DataType = datDateTime + DictionaryEntry = 'FacturasCliente_FECHA_FACTURA' + end + item + Name = 'BASE_IMPONIBLE' + DataType = datCurrency + DictionaryEntry = 'FacturasCliente_BASE_IMPONIBLE' + end + item + Name = 'SITUACION' + DataType = datString + Size = 19 + end + item + Name = 'DESCUENTO' + DataType = datFloat + DictionaryEntry = 'FacturasCliente_DESCUENTO' + end + item + Name = 'IMPORTE_DESCUENTO' + DataType = datCurrency + DictionaryEntry = 'FacturasCliente_IMPORTE_DESCUENTO' + end + item + Name = 'IVA' + DataType = datFloat + DictionaryEntry = 'FacturasCliente_IVA' + end + item + Name = 'IMPORTE_IVA' + DataType = datCurrency + DictionaryEntry = 'FacturasCliente_IMPORTE_IVA' + end + item + Name = 'RE' + DataType = datFloat + end + item + Name = 'IMPORTE_RE' + DataType = datCurrency + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + DictionaryEntry = 'FacturasCliente_IMPORTE_TOTAL' + end + item + Name = 'OBSERVACIONES' + DataType = datMemo + DictionaryEntry = 'FacturasCliente_OBSERVACIONES' + end + item + Name = 'NIF_CIF' + DataType = datString + Size = 15 + DictionaryEntry = 'FacturasCliente_NIF_CIF' + end + item + Name = 'ID_PROVEEDOR' + DataType = datInteger + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + DictionaryEntry = 'FacturasCliente_NOMBRE' + end + item + Name = 'CALLE' + DataType = datString + Size = 255 + DictionaryEntry = 'FacturasCliente_CALLE' + end + item + Name = 'PROVINCIA' + DataType = datString + Size = 255 + DictionaryEntry = 'FacturasCliente_PROVINCIA' + end + item + Name = 'POBLACION' + DataType = datString + Size = 255 + DictionaryEntry = 'FacturasCliente_POBLACION' + end + item + Name = 'CODIGO_POSTAL' + DataType = datString + Size = 10 + DictionaryEntry = 'FacturasCliente_CODIGO_POSTAL' + end + item + Name = 'RECARGO_EQUIVALENCIA' + DataType = datSmallInt + end + item + Name = 'IMPORTE_NETO' + DataType = datCurrency + end + item + Name = 'IMPORTE_PORTE' + DataType = datCurrency + end + item + Name = 'FORMA_PAGO' + DataType = datString + Size = 255 + end + item + Name = 'DATOS_BANCARIOS' + DataType = datString + Size = 255 + end> + Params = < + item + Name = 'ID' + DataType = datInteger + Value = '1' + ParamType = daptInput + end> + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = DABINAdapter + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'InformeFacturasProveedor' + IndexDefs = <> + Left = 264 + Top = 128 + end + object frxCheckBoxObject1: TfrxCheckBoxObject + Left = 296 + Top = 288 + end + object frxChartObject1: TfrxChartObject + Left = 296 + Top = 336 + end + object frxGradientObject1: TfrxGradientObject + Left = 360 + Top = 288 + end + object frxCrossObject1: TfrxCrossObject + Left = 360 + Top = 440 + end + object frxOLEObject1: TfrxOLEObject + Left = 296 + Top = 440 + end + object frxBarCodeObject1: TfrxBarCodeObject + Left = 360 + Top = 392 + end + object frxRichObject1: TfrxRichObject + Left = 296 + Top = 392 end object frxReport: TfrxReport - Version = '3.23.7' + Version = '4.3' DotMatrixReport = False EngineOptions.DoublePass = True IniFile = '\Software\Fast Reports' PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick] - PreviewOptions.OutlineWidth = 180 PreviewOptions.Zoom = 1.000000000000000000 - PrintOptions.Printer = 'Default' - ReportOptions.CreateDate = 37871.995398692100000000 - ReportOptions.LastChange = 39293.765855208330000000 - ReportOptions.VersionBuild = '1' - ReportOptions.VersionMajor = '12' - ReportOptions.VersionMinor = '13' - ReportOptions.VersionRelease = '1' + PrintOptions.Printer = 'Por defecto' + PrintOptions.PrintOnSheet = 0 + ReportOptions.CreateDate = 37800.807714351900000000 + ReportOptions.LastChange = 39741.448087719910000000 ScriptLanguage = 'PascalScript' ScriptText.Strings = ( - 'procedure DatosClienteOnBeforePrint(Sender: TfrxComponent);' + 'procedure frxReportOnStartReport(Sender: TfrxComponent);' 'begin' - ' DatosCliente.Lines.Clear;' - ' DatosCliente.Lines.Add();' - '' - ' if ( <> '#39#39')' - ' or ( <> '#39#39') then' - - ' DatosCliente.Lines.Add( + '#39' ' + - #39' + );' + ' Set('#39'Pagina'#39', 0);' + ' Set('#39'TotalPaginas'#39', 0); ' 'end;' '' - 'procedure BandaDetallesOnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' BandaDetalles.StartNewPage := False;' - ' BandaDetalles.Visible := True;' - ' MemPrecio.Style := '#39'Concepto normal'#39';' - ' MemCantidad.Style := '#39'Concepto normal'#39';' - ' MemImpTotal.Style := '#39'Concepto normal'#39';' - ' RichConcepto.Visible := True;' - '' - ' case of' - ' '#39'Salto'#39': begin' - ' BandaDetalles.StartNewPage := True;' - ' RichConcepto.Visible := False;' - ' end;' - ' '#39'Titulo'#39': begin' - ' MemPrecio.Style := '#39'Concepto titulo'#39';' - ' MemCantidad.Style := '#39'Concepto titulo'#39';' - ' MemImpTotal.Style := '#39'Concepto titulo'#39';' - ' end;' - ' '#39'Concepto'#39': begin' - ' MemPrecio.Style := '#39'Concepto normal'#39';' - ' MemCantidad.Style := '#39'Concepto normal'#39';' - ' MemImpTotal.Style := '#39'Concepto normal'#39';' - ' end;' - ' '#39'Subtotal'#39': begin' - ' MemPrecio.Style := '#39'Concepto subtotal'#39';' - ' MemCantidad.Style := '#39'Concepto subtotal'#39';' - ' MemImpTotal.Style := '#39'Concepto subtotal'#39';' - ' end;' - ' '#39'Descuento'#39': begin' - ' BandaDetalles.Visible := False;' - ' RichConcepto.Color := clNone;' - ' end;' - ' end;' - '' - ' RichConcepto.Color := MemImpTotal.Color;' - ' RichConcepto.Frame := MemImpTotal.Frame;' - 'end;' - '' - 'procedure ReportSummary1OnBeforePrint(Sender: TfrxComponent);' - 'begin' - - ' Engine.CurY := Engine.CurY + Engine.FreeSpace - ReportSummary1' + - '.Height - 1;' - 'end;' - '' - 'procedure DatosEmpresaOnBeforePrint(Sender: TfrxComponent);' - 'var' - ' Cadena: String;' - 'begin' - ' DatosEmpresa.Lines.Clear;' - ' DatosEmpresa.Lines.Add();' - ' DatosEmpresa.Lines.Add();' - '' - ' Cadena := '#39#39';' - ' if ( <> '#39#39') then' - ' Cadena := '#39'TLF: '#39' + ;' - ' if ( <> '#39#39') then' - ' Cadena := Cadena + '#39' FAX: '#39' + ;' - ' DatosEmpresa.Lines.Add(Cadena);' - '' - ' Cadena := '#39#39';' - ' if ( <> '#39#39') then' - ' Cadena := ;' - ' if ( <> '#39#39') then' - - ' Cadena := Cadena + '#39' '#39' + ;' - ' if ( <> '#39#39') then' - - ' Cadena := Cadena + '#39' - '#39' + ;' - ' DatosEmpresa.Lines.Add(Cadena);' - 'end;' - '' - 'procedure Memo15OnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' Memo15.Lines.Clear;' - ' if (StrToFloat() < 0) then' - ' Memo15.Lines.Add('#39'ABONO'#39')' - ' else' - ' Memo15.Lines.Add('#39'FACTURA'#39')' - 'end;' - '' - 'procedure Memo20OnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' if (StrToFloat() = 0) then' - ' begin' - ' Memo20.Lines.Clear;' - ' Memo28.Lines.Clear;' - ' Memo21.Lines.Clear;' - ' Memo29.Lines.Clear;' - ' end;' - '' - 'end;' - '' - 'procedure Band2OnBeforePrint(Sender: TfrxComponent);' + 'procedure Band1OnBeforePrint(Sender: TfrxComponent);' 'begin' ' if not Engine.FinalPass then' ' Set('#39'TotalPaginas'#39', ( + 1));' '' ' if Engine.FinalPass then' - ' Set('#39'Pagina'#39', ( + 1));' + ' Set('#39'Pagina'#39', ( + 1)); ' 'end;' '' - 'procedure frxReportOnStartReport(Sender: TfrxComponent);' + 'procedure mContinuaOnBeforePrint(Sender: TfrxComponent);' 'begin' - ' Set('#39'Pagina'#39', 0);' - ' Set('#39'TotalPaginas'#39', 0);' + ' 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 (( + 1) = ) then' + ' begin ' + ' mContinua.Visible := True;' + ' end ' + ' else' + ' begin ' + ' mContinua.Visible := False;' + ' end ' + ' end; ' 'end;' '' 'begin' @@ -1307,116 +1388,135 @@ object RptFacturasProveedor: TRptFacturasProveedor ShowProgress = False StoreInDFM = False OnStartReport = 'frxReportOnStartReport' - Left = 169 - Top = 16 - Datasets = < - item - DataSet = frxDBCabecera - DataSetName = 'frxDBCabecera' - end - item - DataSet = frxDBDetalles - DataSetName = 'frxDBDetalles' - end - item - DataSet = frxDBDataset1 - DataSetName = 'frxDBVencimientos' - end> - Variables = < - item - Name = ' Paginacion' - Value = Null - end - item - Name = 'Pagina' - Value = Null - end - item - Name = 'TotalPaginas' - Value = Null - end> - Style = < - item - Name = 'Concepto normal' - Color = clNone - Font.Charset = ANSI_CHARSET - Font.Color = clWindowText - Font.Height = -12 - Font.Name = 'Tahoma' - Font.Style = [] - end - item - Name = 'Concepto subtotal' - Color = clNone - Font.Charset = ANSI_CHARSET - Font.Color = clWindowText - Font.Height = -12 - Font.Name = 'Tahoma' - Font.Style = [fsBold] - end - item - Name = 'Cabecera de columna' - Color = 15790320 - Font.Charset = ANSI_CHARSET - Font.Color = clWindowText - Font.Height = -12 - Font.Name = 'Tahoma' - Font.Style = [fsBold] - Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom] - end - item - Name = 'Concepto titulo' - Color = clNone - Font.Charset = ANSI_CHARSET - Font.Color = clWindowText - Font.Height = -13 - Font.Name = 'Tahoma' - Font.Style = [fsBold] - end> - end - object frxDBCabecera: TfrxDBDataset - UserName = 'frxDBCabecera' - CloseDataSource = False - DataSource = DADataCabecera - Left = 264 + Left = 145 Top = 16 end - object frxDBDetalles: TfrxDBDataset - UserName = 'frxDBDetalles' - CloseDataSource = False - DataSource = DADataDetalles - Left = 344 - Top = 16 + object vencimientos: TIBQuery + Database = IBDatabase1 + Transaction = IBTransaction1 + SQL.Strings = ( + 'SELECT' + + ' V_RECIBOS_CLIENTE.FECHA_VENCIMIENTO, V_RECIBOS_CLIENTE.IMPOR' + + 'TE_TOTAL' + 'FROM V_RECIBOS_CLIENTE' + 'WHERE V_RECIBOS_CLIENTE.ID_FACTURA = 2' + 'ORDER BY V_RECIBOS_CLIENTE.FECHA_VENCIMIENTO') + Left = 136 + Top = 408 + object vencimientosFECHA_VENCIMIENTO: TDateField + FieldName = 'FECHA_VENCIMIENTO' + Origin = '"V_RECIBOS_CLIENTE"."FECHA_VENCIMIENTO"' + end + object vencimientosIMPORTE_TOTAL: TIBBCDField + FieldKind = fkInternalCalc + FieldName = 'IMPORTE_TOTAL' + Origin = '"V_RECIBOS_CLIENTE"."IMPORTE_TOTAL"' + ProviderFlags = [] + ReadOnly = True + Precision = 18 + Size = 2 + end end - object tbl_Vencimientos: TDACDSDataTable + object DataSource3: TDataSource + DataSet = vencimientos + Left = 216 + Top = 408 + end + object frxPDFExport1: TfrxPDFExport + ShowDialog = False + UseFileCache = True + ShowProgress = False + PrintOptimized = True + Outline = False + Author = 'FactuGES' + Subject = 'FactuGES' + Background = False + Creator = 'FactuGES' + HTMLTags = True + Left = 424 + Top = 288 + end + object tbl_InformeListadoFacturas: TDAMemDataTable RemoteUpdatesOptions = [] - Fields = <> + Fields = < + item + Name = 'ID_EMPRESA' + DataType = datInteger + 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' + DataType = datString + Size = 255 + end + item + Name = 'SITUACION' + DataType = datString + Size = 19 + end + item + Name = 'NIF_CIF' + DataType = datString + Size = 15 + end + item + Name = 'FECHA_FACTURA' + DataType = datDateTime + end + item + Name = 'BASE_IMPONIBLE' + DataType = datCurrency + end + item + Name = 'IMPORTE_IVA' + DataType = datCurrency + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end> Params = <> - MasterMappingMode = mmDataRequest LogChanges = False StreamingOptions = [soDisableEventsWhileStreaming] RemoteFetchEnabled = False - SchemaCall.Params = <> - DataRequestCall.Params = <> - DataUpdateCall.Params = <> - ScriptCall.Params = <> - ReadOnly = False + LocalSchema = schReport + LocalDataStreamer = DABINAdapter DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'InformeListadoFacturas' IndexDefs = <> - Left = 264 - Top = 240 + Left = 576 + Top = 128 end - object DADataVencimientos: TDADataSource - DataTable = tbl_Vencimientos - Left = 264 - Top = 184 + object DADSInformeListadoFacturas: TDADataSource + DataSet = tbl_InformeListadoFacturas.Dataset + DataTable = tbl_InformeListadoFacturas + Left = 576 + Top = 72 end - object frxDBDataset1: TfrxDBDataset - UserName = 'frxDBVencimientos' + object frxDBInformeListadoFacturas: TfrxDBDataset + UserName = 'frxDBInformeListadoFacturas' CloseDataSource = True - DataSource = DADataVencimientos - Left = 344 - Top = 184 + DataSource = DADSInformeListadoFacturas + Left = 576 + Top = 16 end end diff --git a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas index 010b6c0a..199780e3 100644 --- a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas +++ b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas @@ -7,36 +7,88 @@ uses Dialogs, frxClass, frxDBSet, uDAScriptingProvider, uDADataTable, uDACDSDataTable, DB, uDAClasses, frxChart, frxGradient, frxChBox, frxCross, frxOLE, frxBarcode, frxRich, uDABINAdapter, uROTypes, - uDAInterfaces; + uDAInterfaces, uDADataStreamer, IBCustomDataSet, IBQuery, IBDatabase, + uDAMemDataTable, FactuGES_Intf, frxExportPDF; type TRptFacturasProveedor = class(TDataModule) - DADataCabecera: TDADataSource; - DADataDetalles: TDADataSource; - tbl_FacturaProveedor: TDACDSDataTable; - tbl_DetallesFacturaProveedor: TDACDSDataTable; - DABINAdapter: TDABINAdapter; - frxRichObject1: TfrxRichObject; - frxBarCodeObject1: TfrxBarCodeObject; - frxOLEObject1: TfrxOLEObject; - frxCrossObject1: TfrxCrossObject; - frxCheckBoxObject1: TfrxCheckBoxObject; - frxGradientObject1: TfrxGradientObject; - frxChartObject1: TfrxChartObject; frxDBCabecera: TfrxDBDataset; frxDBDetalles: TfrxDBDataset; - tbl_Vencimientos: TDACDSDataTable; - DADataVencimientos: TDADataSource; - frxDBDataset1: TfrxDBDataset; - schReport: TDASchema; DataDictionary: TDADataDictionary; + IBDatabase1: TIBDatabase; + IBTransaction1: TIBTransaction; + DataSource1: TDataSource; + DataSource2: TDataSource; + cabecera: TIBQuery; + detalles: TIBQuery; + DABINAdapter: TDABINAdapter; + DADSCabecera: TDADataSource; + DADSDetalles: TDADataSource; + tbl_Detalles: TDAMemDataTable; + tbl_Cabecera: TDAMemDataTable; + frxCheckBoxObject1: TfrxCheckBoxObject; + frxChartObject1: TfrxChartObject; + frxGradientObject1: TfrxGradientObject; + frxCrossObject1: TfrxCrossObject; + frxOLEObject1: TfrxOLEObject; + frxBarCodeObject1: TfrxBarCodeObject; + frxRichObject1: TfrxRichObject; frxReport: TfrxReport; + cabeceraID: TIntegerField; + cabeceraID_EMPRESA: TIntegerField; + cabeceraREFERENCIA: TIBStringField; + cabeceraTIPO: TIBStringField; + cabeceraFECHA_FACTURA: TDateField; + cabeceraBASE_IMPONIBLE: TIBBCDField; + cabeceraSITUACION: TIBStringField; + cabeceraDESCUENTO: TFloatField; + cabeceraIMPORTE_DESCUENTO: TIBBCDField; + cabeceraIVA: TFloatField; + cabeceraIMPORTE_IVA: TIBBCDField; + cabeceraRE: TFloatField; + cabeceraIMPORTE_RE: TIBBCDField; + cabeceraIMPORTE_TOTAL: TIBBCDField; + cabeceraOBSERVACIONES: TMemoField; + cabeceraNIF_CIF: TIBStringField; + cabeceraID_CLIENTE: TIntegerField; + cabeceraNOMBRE: TIBStringField; + cabeceraCALLE: TIBStringField; + cabeceraPROVINCIA: TIBStringField; + cabeceraPOBLACION: TIBStringField; + cabeceraCODIGO_POSTAL: TIBStringField; + cabeceraRECARGO_EQUIVALENCIA: TSmallintField; + cabeceraIMPORTE_NETO: TIBBCDField; + cabeceraIMPORTE_PORTE: TIBBCDField; + cabeceraFORMA_PAGO: TIBStringField; + detallesID: TIntegerField; + detallesID_FACTURA: TIntegerField; + detallesPOSICION: TIntegerField; + detallesTIPO_DETALLE: TIBStringField; + detallesCONCEPTO: TIBStringField; + detallesCANTIDAD: TIntegerField; + detallesIMPORTE_UNIDAD: TIBBCDField; + detallesDESCUENTO: TFloatField; + detallesIMPORTE_TOTAL: TIBBCDField; + detallesVISIBLE: TSmallintField; + detallesREFERENCIA: TIBStringField; + vencimientos: TIBQuery; + DataSource3: TDataSource; + cabeceraDATOS_BANCARIOS: TIBStringField; + vencimientosFECHA_VENCIMIENTO: TDateField; + vencimientosIMPORTE_TOTAL: TIBBCDField; + frxPDFExport1: TfrxPDFExport; + tbl_InformeListadoFacturas: TDAMemDataTable; + DADSInformeListadoFacturas: TDADataSource; + frxDBInformeListadoFacturas: TfrxDBDataset; + schReport: TDASchema; procedure DataModuleCreate(Sender: TObject); private FConnection: IDAConnection; - procedure GenerarFactura(const AFacturaID: integer); overload; + function _GenerarInforme(const TipoInforme: String; const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDProveedores: TIntegerArray; const ImporteMinimo: Currency): Binary; public - function GenerarFactura(const AFacturaID : String): Binary; overload; + function GenerarInformeIVA(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarInformeListadoFacturas(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarInformeListadoFacturasPendientes(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; end; implementation @@ -47,12 +99,12 @@ uses uDataModuleServer, schFacturasProveedorClient_Intf; const - rptFacturaProveedor = 'InfFacturaProveedor.fr3'; - - { Dataset names for schReport } - ds_InformeFacturasProveedor = 'InformeFacturasProveedor'; - ds_InformeFacturasProveedor_Detalles = 'InformeFacturasProveedor_Detalles'; - ds_InformeFacturasProveedor_Vencimientos = 'InformeFacturasProveedor_Vencimientos'; + rptInformeIVA = 'InformeIVAProveedores.fr3'; + rptInformeIVADesglosado = 'InformeIVAProveedoresDesglosado.fr3'; + rptInformeListadoFacturasProveedor = 'InformeListadoFacturasProveedor.fr3'; + rptInformeListadoFacturasProveedorDesglosado = 'InformeListadoFacturasProveedorDesglosado.fr3'; + rptInformeListadoFactuasProveedorPendiente = 'InformeListadoFacturasProveedorPendientes.fr3'; + rptInformeListadoFactuasProveedorPendienteDesglosado = 'InformeListadoFacturasProveedorPendientesDesglosado.fr3'; { TRptFacturasProveedor } @@ -62,66 +114,165 @@ begin schReport.ConnectionManager := dmServer.ConnectionManager; FConnection := dmServer.DarNuevaConexion; frxReport.EngineOptions.NewSilentMode := simReThrow; + + frxDBCabecera.DataSource := DADSCabecera; + frxDBDetalles.DataSource := DADSDetalles; end; -function TRptFacturasProveedor.GenerarFactura(const AFacturaID: String): Binary; + +function TRptFacturasProveedor.GenerarInformeIVA(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; var - ID_Facturas: TStringList; + ATipoInforme: String; + +begin + +//DESGLOSADO POR PROVEEDOR EN ESTE INFORME NO SE DESGLOSARĮ POR PROVEEDOR + if Desglosado then + ATipoInforme := rptInformeIVADesglosado + else + ATipoInforme := rptInformeIVA; + + Result := _GenerarInforme(ATipoInforme, IdEmpresa, FechaInicio, FechaFin, ListaIDProveedores, ImporteMinimo); +end; + +function TRptFacturasProveedor.GenerarInformeListadoFacturas(const IdEmpresa: Integer; + const FechaInicio, FechaFin: DateTime; const ListaIDProveedores: TIntegerArray; + const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; +var + ATipoInforme: String; + +begin + +//DESGLOSADO POR PROVEEDOR EN ESTE INFORME NO SE DESGLOSARĮ POR PROVEEDOR + if Desglosado then + ATipoInforme := rptInformeListadoFacturasProveedorDesglosado + else + ATipoInforme := rptInformeListadoFacturasProveedor; + + Result := _GenerarInforme(ATipoInforme, IdEmpresa, FechaInicio, FechaFin, ListaIDProveedores, ImporteMinimo); +end; + +function TRptFacturasProveedor.GenerarInformeListadoFacturasPendientes( + const IdEmpresa: Integer; const FechaInicio, FechaFin: DateTime; + const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; + const ImporteMinimo: Currency): Binary; +var + Condicion: TDAWhereExpression; + ATipoInforme: String; + +begin + if tbl_InformeListadoFacturas.Active then + tbl_InformeListadoFacturas.Active := False; + + // Filtrar el informe por situacion + with tbl_InformeListadoFacturas.DynamicWhere do + begin + // (ID_EMPRESA >= ID) + Condicion := NewBinaryExpression(NewField('', fld_FacturasProveedorSITUACION), NewConstant('PAGADA', datString), dboNotEqual); + if IsEmpty then + Expression := Condicion + else + Expression := NewBinaryExpression(Expression, Condicion, dboAnd); + end; + + +//DESGLOSADO POR PROVEEDOR EN ESTE INFORME + if Desglosado then + ATipoInforme := rptInformeListadoFactuasProveedorPendienteDesglosado + else + ATipoInforme := rptInformeListadoFactuasProveedorPendiente; + + + Result := _GenerarInforme(ATipoInforme, IdEmpresa, FechaInicio, FechaFin, ListaIDProveedores, ImporteMinimo); +end; + +function TRptFacturasProveedor._GenerarInforme(const TipoInforme: String; + const IdEmpresa: Integer; const FechaInicio, FechaFin: DateTime; + const ListaIDProveedores: TIntegerArray; const ImporteMinimo: Currency): Binary; +var + Condicion: TDAWhereExpression; i: Integer; begin Result := Binary.Create; - FConnection.BeginTransaction; + //FConnection.BeginTransaction; <--- Creo que no va a hacer falta. try - ID_Facturas := TStringList.Create; - ID_Facturas.CommaText := AFacturaID; - //Vamos generando todos y cada uno de los albaranes recibidos - for i := 0 to ID_Facturas.Count - 1 do - GenerarFactura(StrToInt(ID_Facturas.Strings[i])); + if tbl_InformeListadoFacturas.Active then + tbl_InformeListadoFacturas.Active := False; + // Filtrar el informe por empresa + with tbl_InformeListadoFacturas.DynamicWhere do + begin + // (ID_EMPRESA >= ID) + Condicion := NewBinaryExpression(NewField('', fld_FacturasProveedorID_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_InformeListadoFacturas.DynamicWhere do + begin + // (FECHA_INICIO between FECHA_FIN) + Condicion := NewBinaryExpression(NewField('', fld_FacturasProveedorFECHA_FACTURA), NewConstant(FechaInicio, datDateTime), dboGreaterOrEqual); + Condicion := NewBinaryExpression(NewBinaryExpression(NewField('', fld_FacturasProveedorFECHA_FACTURA), NewConstant(FechaFin, datDateTime), dboLessOrEqual), Condicion, dboAnd); + if IsEmpty then + Expression := Condicion + else + Expression := NewBinaryExpression(Expression, Condicion, dboAnd); + end; + end; + + // Filtrar el informe por Proveedor + if Assigned(ListaIDProveedores) then + begin + with tbl_InformeListadoFacturas.DynamicWhere do + begin + for i := 0 to ListaIDProveedores.Count - 1 do + begin + + // (ID_PROVEEDOR = ID) + Condicion := NewBinaryExpression(NewField('', fld_FacturasProveedorID_PROVEEDOR), NewConstant(ListaIDProveedores.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_InformeListadoFacturas.DynamicWhere do + begin + // (IMPORTE_TOTAL > ImporteMinimo) + Condicion := NewBinaryExpression(NewField('', fld_FacturasProveedorIMPORTE_TOTAL), NewConstant(ImporteMinimo, datCurrency), dboGreaterOrEqual); + if IsEmpty then + Expression := Condicion + else + Expression := NewBinaryExpression(Expression, Condicion, dboAnd); + end; + end; + + + tbl_InformeListadoFacturas.Active := True; + + frxReport.LoadFromFile(DarRutaInformes + TipoInforme, True); + frxReport.Variables.Variables['FechaInicio'] := FechaInicio; + frxReport.Variables.Variables['FechaFin'] := FechaFin; + + frxReport.PrepareReport(False); frxReport.PreviewPages.SaveToStream(Result); finally - FConnection.RollbackTransaction; - end; -end; - -procedure TRptFacturasProveedor.GenerarFactura(const AFacturaID: integer); -var - AStream: TMemoryStream; - dsMaster: IDADataset; - dsDetail: IDADataset; - dsVencimientos : IDADataset; -begin - AStream := TMemoryStream.Create; - - try - dsMaster := schReport.NewDataset(FConnection, ds_InformeFacturasProveedor, ['ID'], [AFacturaID]); - dsDetail := schReport.NewDataset(FConnection, ds_InformeFacturasProveedor_Detalles, ['ID_FACTURA'], [AFacturaID], False); - dsVencimientos := schReport.NewDataset(FConnection, ds_InformeFacturasProveedor_Vencimientos, ['ID_FACTURA'], [AFacturaID], False); - - AStream.Clear; - DABINAdapter.WriteDataset(AStream, dsMaster, [woRows, woSchema], -1); - DABINAdapter.ReadDataset(AStream, tbl_FacturaProveedor, TRUE, '', TRUE, TRUE); - - AStream.Clear; - DABINAdapter.WriteDataset(AStream, dsDetail, [woRows, woSchema], -1); - DABINAdapter.ReadDataset(AStream, tbl_DetallesFacturaProveedor, TRUE, '', TRUE, TRUE); - - AStream.Clear; - DABINAdapter.WriteDataset(AStream, dsVencimientos, [woRows, woSchema], -1); - DABINAdapter.ReadDataset(AStream, tbl_Vencimientos, TRUE, '', TRUE, TRUE); - - - frxReport.LoadFromFile(DarRutaInformes + rptFacturaProveedor, True); - frxReport.PrepareReport(False); - - finally - AStream.Free; - dsMaster := Nil; - dsDetail := Nil; + //FConnection.RollbackTransaction; <--- Creo que no va a hacer falta. end; end; diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk index bf43f70a..99f61879 100644 --- a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk +++ b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk @@ -36,6 +36,13 @@ contains uIEditorInformeIVAClientesReport in 'View\uIEditorInformeIVAClientesReport.pas', uIEditorInformeFacturasClientePendientesReport in 'View\uIEditorInformeFacturasClientePendientesReport.pas', uIEditorInformeRecibosClienteReport in 'View\uIEditorInformeRecibosClienteReport.pas', - uIEditorInformeRecibosCliPendientesReport in 'View\uIEditorInformeRecibosCliPendientesReport.pas'; + uIEditorInformeRecibosCliPendientesReport in 'View\uIEditorInformeRecibosCliPendientesReport.pas', + uIEditorInformeIVAProveedoresReport in 'View\uIEditorInformeIVAProveedoresReport.pas', + uIEditorInformeRecibosProvPendientesReport in 'View\uIEditorInformeRecibosProvPendientesReport.pas', + uIEditorInformeFacturasProveedorPendientesReport in 'View\uIEditorInformeFacturasProveedorPendientesReport.pas', + uIEditorInformeFacturasProveedorReport in 'View\uIEditorInformeFacturasProveedorReport.pas', + uIEditorInformePresupuestosReport in 'View\uIEditorInformePresupuestosReport.pas', + uIEditorInformeRecibosProveedorReport in 'View\uIEditorInformeRecibosProveedorReport.pas', + uIEditorInformePedidosReport in 'View\uIEditorInformePedidosReport.pas'; end. diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj index a7ca6c3d..74356137 100644 --- a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj +++ b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj @@ -45,9 +45,16 @@ + + + + + + +