Se adaptan las fichas de cliente y de proveedor para que acepten varios dias de pago (en los clientes se desactiva para acana), ademas de retocar la lógica de generacion de los recibos asociados a las facturas.
git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@371 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
parent
e958c451fa
commit
050462d4ae
@ -1120,7 +1120,11 @@ var
|
|||||||
AFormaPago: IBizFormaPago;
|
AFormaPago: IBizFormaPago;
|
||||||
ARecibosProveedorController: IRecibosProveedorController;
|
ARecibosProveedorController: IRecibosProveedorController;
|
||||||
ARecibos: IBizRecibosProveedor;
|
ARecibos: IBizRecibosProveedor;
|
||||||
|
AFechaVencimiento: TDateTime;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
ADiaVencimiento: Integer;
|
||||||
|
ADiasMas: Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if not Assigned(AFactura) then
|
if not Assigned(AFactura) then
|
||||||
Exit;
|
Exit;
|
||||||
@ -1166,7 +1170,27 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
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);
|
ARecibos.IMPORTE := AFactura.IMPORTE_TOTAL * (AFormaPago.Plazos.PORCENTAJE / 100);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user