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@369 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
David Arranz 2008-12-18 15:38:42 +00:00
parent 709430d667
commit 38785086a1

View File

@ -119,10 +119,10 @@ type
implementation implementation
uses uses
Windows, uNumUtils, Controls, cxControls, DB, uEditorRegistryUtils, schFacturasClienteClient_Intf, Windows, uDateUtils, uNumUtils, Controls, cxControls, DB, uEditorRegistryUtils, schFacturasClienteClient_Intf,
uBizContactos, uIEditorFacturasCliente, uIEditorFacturaCliente, uFactuGES_App, uBizContactos, uIEditorFacturasCliente, uIEditorFacturaCliente, uFactuGES_App,
uDataModuleFacturasCliente, uBizDetallesFacturaCliente, uControllerDetallesBase, uDataModuleFacturasCliente, uBizDetallesFacturaCliente, uControllerDetallesBase,
uDataModuleUsuarios, uDAInterfaces, uDataTableUtils, uDateUtils, uDataModuleUsuarios, uDAInterfaces, uDataTableUtils,
uAlbaranesClienteController, schAlbaranesClienteClient_Intf, uROTypes, uDetallesAlbaranClienteController, uAlbaranesClienteController, schAlbaranesClienteClient_Intf, uROTypes, uDetallesAlbaranClienteController,
uBizDetallesAlbaranCliente, uFacturasClienteReportController, uBizDetallesAlbaranCliente, uFacturasClienteReportController,
// uBizPedidosCliente, uPedidosClienteController, uBizDetallesPedidoCliente, // uBizPedidosCliente, uPedidosClienteController, uBizDetallesPedidoCliente,
@ -656,7 +656,8 @@ begin
//De esta forma obligaremos siempre a tener un recibo asociado a la factura, //De esta forma obligaremos siempre a tener un recibo asociado a la factura,
//porque si la forma de pago no tiene plazos es obligatorio la fecha de vencimiento //porque si la forma de pago no tiene plazos es obligatorio la fecha de vencimiento
with TFormasPagoController.Create do //OJO-----En facturas de cliente para acana no es obligatorio porque deben de poder generar facturas sin recibos asociados
{ with TFormasPagoController.Create do
begin begin
try try
AFormaPago := Buscar(AFactura.ID_FORMA_PAGO); AFormaPago := Buscar(AFactura.ID_FORMA_PAGO);
@ -669,6 +670,7 @@ begin
Free; Free;
end; end;
end; end;
}
if (AFactura.IGNORAR_CONTABILIDAD = 0) and ((AFactura.Cliente.SubCuentas.ID < 1) if (AFactura.IGNORAR_CONTABILIDAD = 0) and ((AFactura.Cliente.SubCuentas.ID < 1)
//REPASAR //REPASAR
@ -1159,12 +1161,16 @@ begin
//Se cambia la lógica a peticion de acana, en el caso de meter una fecha de vencimiento, //Se cambia la lógica a peticion de acana, en el caso de meter una fecha de vencimiento,
//los plazos de la forma de pago no tendrán efecto, se generará un recibo con el 100% y fecha de vencimiento //los plazos de la forma de pago no tendrán efecto, se generará un recibo con el 100% y fecha de vencimiento
//de la factura. //de la factura. (Se permitirá para acana poder dar de alta facturas sin recibos asociados)
With AFormaPago.Plazos.DataTable do With AFormaPago.Plazos.DataTable do
begin begin
i := 1; i := 1;
First; First;
repeat repeat
//SOLO PARA ACANA (Leer comentario anterior
if (AFormaPago.Plazos.RecordCount > 0)
or (AFactura.FECHA_VENCIMIENTO <> 0) then
begin
ARecibos := ARecibosClienteController.Nuevo; ARecibos := ARecibosClienteController.Nuevo;
ARecibos.Edit; ARecibos.Edit;
ARecibos.ID_FACTURA := AFactura.ID; ARecibos.ID_FACTURA := AFactura.ID;
@ -1189,10 +1195,14 @@ begin
begin begin
AFechaVencimiento := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS; AFechaVencimiento := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS;
ADiasMas := 0; ADiasMas := 0;
if (AFactura.Cliente.VENCIMIENTO_FACTURAS <> 0) then if (AFactura.Cliente.VENCIMIENTO_FACTURAS_1 <> 0)
or (AFactura.Cliente.VENCIMIENTO_FACTURAS_2 <> 0)
or (AFactura.Cliente.VENCIMIENTO_FACTURAS_3 <> 0) then
begin begin
ADiaVencimiento := DayOf(AFechaVencimiento); ADiaVencimiento := DayOf(AFechaVencimiento);
while (ADiaVencimiento <> AFactura.Cliente.VENCIMIENTO_FACTURAS) do while (ADiaVencimiento <> AFactura.Cliente.VENCIMIENTO_FACTURAS_1)
and (ADiaVencimiento <> AFactura.Cliente.VENCIMIENTO_FACTURAS_2)
and (ADiaVencimiento <> AFactura.Cliente.VENCIMIENTO_FACTURAS_3) do
begin begin
if ADiaVencimiento = DaysInMonth(AFechaVencimiento) then if ADiaVencimiento = DaysInMonth(AFechaVencimiento) then
ADiaVencimiento := 1 ADiaVencimiento := 1
@ -1209,6 +1219,8 @@ begin
ARecibos.DESCRIPCION := 'RECIBO ' + ARecibos.REFERENCIA + ' - ' + CifraToLetras(ARecibos.IMPORTE); ARecibos.DESCRIPCION := 'RECIBO ' + ARecibos.REFERENCIA + ' - ' + CifraToLetras(ARecibos.IMPORTE);
ARecibosClienteController.Guardar(ARecibos); ARecibosClienteController.Guardar(ARecibos);
end;
Inc(i); Inc(i);
Next; Next;
until (eof); until (eof);