From 29a83863a9850e66a221db02361ec33e3da3d5b3 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 1 Aug 2016 11:11:29 +0000 Subject: [PATCH] =?UTF-8?q?-=20Mejorado=20el=20informe=20de=20albaranes=20?= =?UTF-8?q?de=20cliente=20para=20que=20los=20conceptos=20ocupen=20menos=20?= =?UTF-8?q?espacio=20en=20las=20hojas.=20-=20Al=20generar=20un=20albar?= =?UTF-8?q?=C3=A1n=20a=20patir=20de=20un=20contrato,=20recalcular=20el=20i?= =?UTF-8?q?mporte=20de=20la=20cabecera=20teniendo=20en=20cuenta=20que=20lo?= =?UTF-8?q?s=20albaranes=20no=20tienen=20ni=20IVA=20ni=20descuento=20ni=20?= =?UTF-8?q?RE.?= 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@648 f4e31baf-9722-1c47-927c-6f952f962d4b --- Source/Informes/5/InfAlbaranCliente.fr3 | 26 +++++++++---------- .../Reports/uRptAlbaranesCliente_Server.dfm | 6 ++--- .../Reports/uRptAlbaranesCliente_Server.pas | 1 + .../uGenerarAlbaranesCliUtils.pas | 26 ++++++++++++++++--- 4 files changed, 39 insertions(+), 20 deletions(-) diff --git a/Source/Informes/5/InfAlbaranCliente.fr3 b/Source/Informes/5/InfAlbaranCliente.fr3 index 3dac159c..e73b0d78 100644 --- a/Source/Informes/5/InfAlbaranCliente.fr3 +++ b/Source/Informes/5/InfAlbaranCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -13,23 +13,23 @@ - - - - - + + + + + - + - - - - + + + + - + @@ -41,6 +41,6 @@ - + diff --git a/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.dfm b/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.dfm index 19f99216..ed5c59e1 100644 --- a/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.dfm +++ b/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.dfm @@ -1,8 +1,8 @@ object RptAlbaranesCliente: TRptAlbaranesCliente OldCreateOrder = True OnCreate = DataModuleCreate - Height = 425 - Width = 527 + Height = 439 + Width = 529 object DADataCabecera: TDADataSource DataSet = tbl_Cabecera.Dataset DataTable = tbl_Cabecera @@ -1075,7 +1075,7 @@ object RptAlbaranesCliente: TRptAlbaranesCliente PrintOptions.Printer = 'Default' PrintOptions.PrintOnSheet = 0 ReportOptions.CreateDate = 37871.995398692100000000 - ReportOptions.LastChange = 40142.519712557870000000 + ReportOptions.LastChange = 42583.535851493060000000 ReportOptions.VersionBuild = '1' ReportOptions.VersionMajor = '12' ReportOptions.VersionMinor = '13' diff --git a/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.pas b/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.pas index d1a2c614..f9d22703 100644 --- a/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.pas +++ b/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.pas @@ -71,6 +71,7 @@ begin frxReport.EngineOptions.NewSilentMode := simReThrow; end; + function TRptAlbaranesCliente.GenerarAlbaran(const ListaID : TIntegerArray): Binary; var i: Integer; diff --git a/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/uGenerarAlbaranesCliUtils.pas b/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/uGenerarAlbaranesCliUtils.pas index 48b9beae..eda34c36 100644 --- a/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/uGenerarAlbaranesCliUtils.pas +++ b/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/uGenerarAlbaranesCliUtils.pas @@ -64,12 +64,14 @@ begin AAlbaran.DataTable.FieldByName(fld_AlbaranesClienteOBSERVACIONES).AsVariant := AContrato.DataTable.FieldByName(fld_ContratosClienteOBSERVACIONES).AsVariant; AAlbaran.IMPORTE_NETO := AContrato.IMPORTE_NETO; - AAlbaran.IMPORTE_PORTE := AContrato.IMPORTE_PORTE; - AAlbaran.DESCUENTO := AContrato.DESCUENTO; - AAlbaran.IMPORTE_DESCUENTO := AContrato.IMPORTE_DESCUENTO; + +// Los albaranes no tienen Descuento +// AAlbaran.IMPORTE_PORTE := AContrato.IMPORTE_PORTE; +// AAlbaran.DESCUENTO := AContrato.DESCUENTO; +// AAlbaran.IMPORTE_DESCUENTO := AContrato.IMPORTE_DESCUENTO; AAlbaran.BASE_IMPONIBLE := AContrato.BASE_IMPONIBLE; - // Los albaranes no tienen IVA +// Los albaranes no tienen IVA // AAlbaran.ID_TIPO_IVA := AContrato.ID_TIPO_IVA; // AAlbaran.IVA := AContrato.IVA; // AAlbaran.IMPORTE_IVA := AContrato.IMPORTE_IVA; @@ -149,6 +151,21 @@ begin end; end; +procedure RecalcularImporteAlbaran(AAlbaran : IBizAlbaranCliente); +begin + if not Assigned(AAlbaran) then + raise Exception.Create ('Albarán no asignado (RecalcularImporteAlbaran)'); + + AAlbaran.Edit; + try + AAlbaran.IMPORTE_NETO := AAlbaranesClienteController.DetallesController.DarTotalImporteTotal(AAlbaran.Detalles); + AAlbaran.BASE_IMPONIBLE := AAlbaran.IMPORTE_NETO; + AAlbaran.IMPORTE_TOTAL := AAlbaran.BASE_IMPONIBLE; + finally + AAlbaran.Post; + end; +end; + procedure Inicializar; begin dmGenerarAlbaranesCli := TdmGenerarAlbaranesCli.Create(nil); @@ -205,6 +222,7 @@ begin AAlbaran := AAlbaranesClienteController.Nuevo; CopiarContratoAAlbaran(AContrato, AAlbaran); CopiarDetallesAAlbaran(AContrato, AAlbaran, AContrato.Detalles); + RecalcularImporteAlbaran(AAlbaran); //Sustituir por if de guardar if AAlbaranesClienteController.Guardar(AAlbaran) then