From 2e593cbaf931efad0ed8b50d2f48bd32804f1143 Mon Sep 17 00:00:00 2001 From: roberto Date: Fri, 13 Apr 2012 11:55:51 +0000 Subject: [PATCH] =?UTF-8?q?Se=20a=C3=B1ade=20el=20incorporar=20una=20image?= =?UTF-8?q?n=20en=20los=20articulos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@552 f4e31baf-9722-1c47-927c-6f952f962d4b --- .../Reports/uRptContratosCliente_Server.dfm | 294 +++++++++++++++++- .../Reports/uRptContratosCliente_Server.pas | 14 +- 2 files changed, 303 insertions(+), 5 deletions(-) diff --git a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm index 746bca7d..432a7b3b 100644 --- a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm +++ b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm @@ -481,6 +481,185 @@ object RptContratosCliente: TRptContratosCliente end> ReadOnly = True end + item + Params = < + item + Name = 'id_contrato' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select *'#10'from articulos'#10'where id'#10'in (select id_articulo'#10' from' + + ' contratos_cliente_detalles'#10' where id_contrato = :id_contrato' + + #10' and id_articulo > 0)'#10'and imagen is not null'#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 = 'DESCRIPCION' + TableField = 'DESCRIPCION' + end + item + DatasetField = 'FAMILIA' + TableField = 'FAMILIA' + end + item + DatasetField = 'IMAGEN' + TableField = 'IMAGEN' + end + item + DatasetField = 'COMISIONABLE' + TableField = 'COMISIONABLE' + end + item + DatasetField = 'ID_PROVEEDOR' + TableField = 'ID_PROVEEDOR' + end + item + DatasetField = 'REFERENCIA_PROV' + TableField = 'REFERENCIA_PROV' + end + item + DatasetField = 'PRECIO_COSTE' + TableField = 'PRECIO_COSTE' + end + item + DatasetField = 'DESCUENTO' + TableField = 'DESCUENTO' + end + item + DatasetField = 'PRECIO_NETO' + TableField = 'PRECIO_NETO' + end + item + DatasetField = 'PRECIO_PORTE' + TableField = 'PRECIO_PORTE' + end + item + DatasetField = 'PRECIO_PVP' + TableField = 'PRECIO_PVP' + end + item + DatasetField = 'FECHA_ALTA' + TableField = 'FECHA_ALTA' + end + item + DatasetField = 'FECHA_MODIFICACION' + TableField = 'FECHA_MODIFICACION' + end + item + DatasetField = 'USUARIO' + TableField = 'USUARIO' + end + item + DatasetField = 'INVENTARIABLE' + TableField = 'INVENTARIABLE' + end + item + DatasetField = 'ELIMINADO' + TableField = 'ELIMINADO' + end> + end> + Name = 'DetallesArticulos' + Fields = < + item + Name = 'ID' + DataType = datInteger + end + item + Name = 'ID_EMPRESA' + DataType = datInteger + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 255 + end + item + Name = 'FAMILIA' + DataType = datString + Size = 255 + end + item + Name = 'IMAGEN' + DataType = datBlob + end + item + Name = 'COMISIONABLE' + DataType = datSmallInt + end + item + Name = 'ID_PROVEEDOR' + DataType = datInteger + end + item + Name = 'REFERENCIA_PROV' + DataType = datString + Size = 255 + end + item + Name = 'PRECIO_COSTE' + DataType = datCurrency + end + item + Name = 'DESCUENTO' + DataType = datFloat + end + item + Name = 'PRECIO_NETO' + DataType = datCurrency + end + item + Name = 'PRECIO_PORTE' + DataType = datCurrency + end + item + Name = 'PRECIO_PVP' + DataType = datCurrency + end + item + Name = 'FECHA_ALTA' + DataType = datDateTime + end + item + Name = 'FECHA_MODIFICACION' + DataType = datDateTime + end + item + Name = 'USUARIO' + DataType = datString + Size = 30 + end + item + Name = 'INVENTARIABLE' + DataType = datSmallInt + end + item + Name = 'ELIMINADO' + DataType = datSmallInt + end> + end item Params = < item @@ -837,7 +1016,7 @@ object RptContratosCliente: TRptContratosCliente PrintOptions.Printer = 'Por defecto' PrintOptions.PrintOnSheet = 0 ReportOptions.CreateDate = 39065.872423495400000000 - ReportOptions.LastChange = 40420.450887569440000000 + ReportOptions.LastChange = 41012.566414745370000000 ScriptLanguage = 'PascalScript' ShowProgress = False StoreInDFM = False @@ -1555,4 +1734,117 @@ object RptContratosCliente: TRptContratosCliente Left = 352 Top = 304 end + object tbl_DetallesArticulos: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ID' + DataType = datInteger + end + item + Name = 'ID_EMPRESA' + DataType = datInteger + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 255 + end + item + Name = 'FAMILIA' + DataType = datString + Size = 255 + end + item + Name = 'IMAGEN' + DataType = datBlob + end + item + Name = 'COMISIONABLE' + DataType = datSmallInt + end + item + Name = 'ID_PROVEEDOR' + DataType = datInteger + end + item + Name = 'REFERENCIA_PROV' + DataType = datString + Size = 255 + end + item + Name = 'PRECIO_COSTE' + DataType = datCurrency + end + item + Name = 'DESCUENTO' + DataType = datFloat + end + item + Name = 'PRECIO_NETO' + DataType = datCurrency + end + item + Name = 'PRECIO_PORTE' + DataType = datCurrency + end + item + Name = 'PRECIO_PVP' + DataType = datCurrency + end + item + Name = 'FECHA_ALTA' + DataType = datDateTime + end + item + Name = 'FECHA_MODIFICACION' + DataType = datDateTime + end + item + Name = 'USUARIO' + DataType = datString + Size = 30 + end + item + Name = 'INVENTARIABLE' + DataType = datSmallInt + end + item + Name = 'ELIMINADO' + DataType = datSmallInt + end> + Params = < + item + Name = 'id_contrato' + Value = '' + end> + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = DABin2DataStreamer1 + LogicalName = 'DetallesArticulos' + IndexDefs = <> + Left = 528 + Top = 128 + end + object DADSDetallesArticulos: TDADataSource + DataSet = tbl_DetallesArticulos.Dataset + DataTable = tbl_DetallesArticulos + Left = 528 + Top = 72 + end + object frxDBDetallesArticulos: TfrxDBDataset + UserName = 'frxDBDetallesArticulos' + CloseDataSource = False + DataSource = DADSDetallesArticulos + BCDToCurrency = False + Left = 528 + Top = 16 + end end diff --git a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas index 5eebb038..dc4d9ad0 100644 --- a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas +++ b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas @@ -64,11 +64,14 @@ type cabeceraPOBLACION: TIBStringField; cabeceraPROVINCIA: TIBStringField; cabeceraCODIGO_POSTAL: TIBStringField; - schReport: TDASchema; - DataDictionary: TDADataDictionary; frxDBCondiciones: TfrxDBDataset; DADSCondiciones: TDADataSource; tbl_Condiciones: TDAMemDataTable; + schReport: TDASchema; + DataDictionary: TDADataDictionary; + tbl_DetallesArticulos: TDAMemDataTable; + DADSDetallesArticulos: TDADataSource; + frxDBDetallesArticulos: TfrxDBDataset; procedure DataModuleCreate(Sender: TObject); procedure DataModuleDestroy(Sender: TObject); function frxReportUserFunction(const MethodName: string; @@ -519,11 +522,13 @@ begin tbl_Cabecera.Active := False; tbl_Capitulos.Active := False; tbl_Detalles.Active := False; - tbl_Condiciones.Active := False; + tbl_Condiciones.Active := False; + tbl_DetallesArticulos.Active := False; tbl_Cabecera.ParamByName('ID').AsInteger := AID; tbl_Capitulos.ParamByName('ID_PRE_CON').AsInteger := AID; tbl_Detalles.ParamByName('ID_PRE_CON').AsInteger := AID; + tbl_DetallesArticulos.ParamByName('ID_CONTRATO').AsInteger := AID; // Se asignan los parametros en este orden para que funcionen // dentro de las relaciones maestro-detalle (capítulos y conceptos). @@ -531,7 +536,8 @@ begin tbl_Cabecera.Active := True; tbl_Capitulos.Active := True; tbl_Detalles.Active := True; - tbl_Condiciones.Active := True; + tbl_Condiciones.Active := True; + tbl_DetallesArticulos.Active := True; AInforme := DarRutaFichero(DarRutaInformes, rptInforme, tbl_Cabecera.FieldByName('ID_EMPRESA').AsString); if VarIsNull(AInforme) then