From 050462d4ae70af350989810ebd50cbbdda5b8567 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 18 Dec 2008 15:41:19 +0000 Subject: [PATCH] =?UTF-8?q?Se=20adaptan=20las=20fichas=20de=20cliente=20y?= =?UTF-8?q?=20de=20proveedor=20para=20que=20acepten=20varios=20dias=20de?= =?UTF-8?q?=20pago=20(en=20los=20clientes=20se=20desactiva=20para=20acana)?= =?UTF-8?q?,=20ademas=20de=20retocar=20la=20l=C3=B3gica=20de=20generacion?= =?UTF-8?q?=20de=20los=20recibos=20asociados=20a=20las=20facturas.?= 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@371 f4e31baf-9722-1c47-927c-6f952f962d4b --- .../uFacturasProveedorController.pas | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas b/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas index 79dfb90e..222605a8 100644 --- a/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas +++ b/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas @@ -1120,7 +1120,11 @@ var AFormaPago: IBizFormaPago; ARecibosProveedorController: IRecibosProveedorController; ARecibos: IBizRecibosProveedor; + AFechaVencimiento: TDateTime; i: Integer; + ADiaVencimiento: Integer; + ADiasMas: Integer; + begin if not Assigned(AFactura) then Exit; @@ -1166,7 +1170,27 @@ begin end else begin - ARecibos.FECHA_VENCIMIENTO := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS; + AFechaVencimiento := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS; + ADiasMas := 0; + if (AFactura.Proveedor.VENCIMIENTO_FACTURAS_1 <> 0) + or (AFactura.Proveedor.VENCIMIENTO_FACTURAS_2 <> 0) + or (AFactura.Proveedor.VENCIMIENTO_FACTURAS_3 <> 0) then + begin + ADiaVencimiento := DayOf(AFechaVencimiento); + while (ADiaVencimiento <> AFactura.Proveedor.VENCIMIENTO_FACTURAS_1) + and (ADiaVencimiento <> AFactura.Proveedor.VENCIMIENTO_FACTURAS_2) + and (ADiaVencimiento <> AFactura.Proveedor.VENCIMIENTO_FACTURAS_3) do + begin + if ADiaVencimiento = DaysInMonth(AFechaVencimiento) then + ADiaVencimiento := 1 + else + Inc(ADiaVencimiento); + Inc(ADiasMas); + end; + end; + + AFechaVencimiento := IncDay(AFechaVencimiento, ADiasMas); + ARecibos.FECHA_VENCIMIENTO := AFechaVencimiento; ARecibos.IMPORTE := AFactura.IMPORTE_TOTAL * (AFormaPago.Plazos.PORCENTAJE / 100); end;