Se añade en el pago del recibo la columna remesa para guardar la remesa a la que estuvo asociado el recibo en un determinado momento, en el caso de quitar el recibo de la remesa manualmente no queda reflejado porque es como si se hubiera equivocado al hacer la remesa, solo queda reflejado en el caso de añadir un pago (en este caso devolución) para poderlo añadir atra remesa
git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES2/trunk@165 b2cfbe5a-eba1-4a0c-8b32-7feea0a119f2
This commit is contained in:
parent
d161401f25
commit
82f10e77f4
@ -32,8 +32,8 @@ uses
|
||||
type
|
||||
IPagosClienteController = interface(ISujeto)
|
||||
['{1864471E-74FA-4E96-BA8D-21357DA38B0F}']
|
||||
function Anadir(APagosCliente: IBizPagosCliente; Const Fecha: String = ''): Boolean;
|
||||
procedure Modificar(APagosCliente: IBizPagosCliente; Const Fecha: String);
|
||||
function Anadir(APagosCliente: IBizPagosCliente; Const Fecha: String = ''; Const Remesa: String = ''): Boolean;
|
||||
procedure Modificar(APagosCliente: IBizPagosCliente; Const Fecha: String; Const Remesa: String = '');
|
||||
function Eliminar(APagoCliente : IBizPagosCliente): Boolean;
|
||||
function EliminarTodo(APagossCliente : IBizPagosCliente): Boolean;
|
||||
end;
|
||||
@ -47,8 +47,8 @@ type
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
function Anadir(APagosCliente: IBizPagosCliente; Const Fecha: String = ''): Boolean;
|
||||
procedure Modificar(APagosCliente: IBizPagosCliente; Const Fecha: String);
|
||||
function Anadir(APagosCliente: IBizPagosCliente; Const Fecha: String = ''; Const Remesa: String = ''): Boolean;
|
||||
procedure Modificar(APagosCliente: IBizPagosCliente; Const Fecha: String; Const Remesa: String = '');
|
||||
function Eliminar(APagoCliente : IBizPagosCliente): Boolean;
|
||||
function EliminarTodo(APagosCliente : IBizPagosCliente): Boolean;
|
||||
end;
|
||||
@ -63,7 +63,7 @@ uses
|
||||
|
||||
{ TPagosClienteController }
|
||||
|
||||
function TPagosClienteController.Anadir(APagosCliente: IBizPagosCliente; Const Fecha: String = ''): Boolean;
|
||||
function TPagosClienteController.Anadir(APagosCliente: IBizPagosCliente; Const Fecha: String = ''; Const Remesa: String = ''): Boolean;
|
||||
{ Si el pago introducido es un pago y no una devolución devolvemos true en caso de ser
|
||||
una devolución devolvemos false}
|
||||
begin
|
||||
@ -73,6 +73,9 @@ begin
|
||||
else
|
||||
APagosCliente.FECHA_PAGO := StrToDate(Fecha);
|
||||
|
||||
if Length(Remesa) <> 0 then
|
||||
APagosCliente.TITULAR := Remesa;
|
||||
|
||||
if (APagosCliente.DataTable.RecordCount = 0)
|
||||
or ((APagosCliente.DataTable.RecordCount mod 2) = 0) then
|
||||
APagosCliente.TIPO := CTE_PAGO
|
||||
@ -135,10 +138,14 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPagosClienteController.Modificar(APagosCliente: IBizPagosCliente; const Fecha: String);
|
||||
procedure TPagosClienteController.Modificar(APagosCliente: IBizPagosCliente; const Fecha: String; Const Remesa: String = '');
|
||||
begin
|
||||
APagosCliente.DataTable.Edit;
|
||||
APagosCliente.FECHA_PAGO := StrToDate(Fecha);
|
||||
|
||||
if Length(Remesa) <> 0 then
|
||||
APagosCliente.TITULAR := Remesa;
|
||||
|
||||
APagosCliente.DataTable.Post;
|
||||
end;
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ type
|
||||
procedure Anadir(ARecibosCliente : IBizRecibosCliente);
|
||||
function Eliminar(ARecibosCliente : IBizRecibosCliente): Boolean;
|
||||
|
||||
function AnadirPago(ARecibosCliente : IBizRecibosCliente; FechaPago: String =''): Boolean;
|
||||
function AnadirPago(ARecibosCliente : IBizRecibosCliente; FechaPago: String =''; Remesa: String=''): Boolean;
|
||||
procedure ModificarPago(ARecibosCliente : IBizRecibosCliente);
|
||||
function EliminarPago(ARecibosCliente : IBizRecibosCliente): Boolean;
|
||||
function EliminarTodo(ARecibosCliente : IBizRecibosCliente): Boolean;
|
||||
@ -71,7 +71,7 @@ type
|
||||
function ExtraerSeleccionados(ARecibosCliente: IBizRecibosCliente) : IBizRecibosCliente;
|
||||
function ElegirRecibos(ARecibos : IBizRecibosCliente; AMensaje: String; AMultiSelect: Boolean): IBizRecibosCliente;
|
||||
|
||||
procedure AsignarRemesa(ARecibos : IBizRecibosCliente; ID_REMESA: Integer);
|
||||
procedure AsignarRemesa(ARecibos : IBizRecibosCliente; ID_REMESA: Integer; Referencia: String);
|
||||
procedure QuitarRemesa(ARecibos : IBizRecibosCliente);
|
||||
procedure SetSituacionCobrados(ARecibos : IBizRecibosCliente; WithDeltas: Boolean=False);
|
||||
|
||||
@ -122,7 +122,7 @@ type
|
||||
|
||||
procedure RecuperarCliente(AReciboCliente : IBizRecibosCliente);
|
||||
procedure Anadir(ARecibosCliente : IBizRecibosCliente);
|
||||
function AnadirPago(ARecibosCliente : IBizRecibosCliente; FechaPago: String =''): Boolean;
|
||||
function AnadirPago(ARecibosCliente : IBizRecibosCliente; FechaPago: String =''; Remesa: String=''): Boolean;
|
||||
procedure ModificarPago(ARecibosCliente : IBizRecibosCliente);
|
||||
function Eliminar(ARecibosCliente : IBizRecibosCliente): Boolean;
|
||||
function EliminarPago(ARecibosCliente : IBizRecibosCliente): Boolean;
|
||||
@ -151,7 +151,7 @@ type
|
||||
function ElegirRecibos(ARecibos : IBizRecibosCliente; AMensaje: String; AMultiSelect: Boolean): IBizRecibosCliente;
|
||||
function ElegirRecibosCompensados(ARecibo : IBizRecibosCliente): Boolean;
|
||||
|
||||
procedure AsignarRemesa(ARecibos : IBizRecibosCliente; ID_REMESA: Integer);
|
||||
procedure AsignarRemesa(ARecibos : IBizRecibosCliente; ID_REMESA: Integer; Referencia: String);
|
||||
procedure QuitarRemesa(ARecibos : IBizRecibosCliente);
|
||||
procedure QuitarReciboCompensado(ARecibo : IBizRecibosCliente);
|
||||
|
||||
@ -189,7 +189,7 @@ begin
|
||||
ARecibosCliente.Insert;
|
||||
end;
|
||||
|
||||
function TRecibosClienteController.AnadirPago(ARecibosCliente: IBizRecibosCliente; FechaPago: String =''): Boolean;
|
||||
function TRecibosClienteController.AnadirPago(ARecibosCliente: IBizRecibosCliente; FechaPago: String =''; Remesa: String=''): Boolean;
|
||||
var
|
||||
AEditor : IEditorFechaPago;
|
||||
begin
|
||||
@ -229,7 +229,7 @@ begin
|
||||
Exit;
|
||||
|
||||
//Finalmente añadimos el pago (cobro o devolucion)
|
||||
if PagosController.Anadir(ARecibosCliente.Pagos, FechaPago) then
|
||||
if PagosController.Anadir(ARecibosCliente.Pagos, FechaPago, Remesa) then
|
||||
begin
|
||||
ARecibosCliente.Edit;
|
||||
ARecibosCliente.SITUACION := CTE_COBRADO;
|
||||
@ -249,7 +249,7 @@ begin
|
||||
FDataModule := TDataModuleRecibosCliente.Create(Nil);
|
||||
end;
|
||||
|
||||
procedure TRecibosClienteController.AsignarRemesa(ARecibos: IBizRecibosCliente; ID_REMESA: Integer);
|
||||
procedure TRecibosClienteController.AsignarRemesa(ARecibos: IBizRecibosCliente; ID_REMESA: Integer; Referencia: String);
|
||||
begin
|
||||
if Assigned(ARecibos) then
|
||||
begin
|
||||
@ -263,7 +263,7 @@ begin
|
||||
ARecibos.Edit;
|
||||
//Añadimos el cobro automatico por la remesa y volvemos a asignar ID
|
||||
//para que asigne un ID nuevo para el pago, porque aqui si hay maestro-detalle
|
||||
AnadirPago(ARecibos, DateToStr(Date)); //->Ojo el orden es importante
|
||||
AnadirPago(ARecibos, DateToStr(Date), Referencia); //->Ojo el orden es importante
|
||||
ARecibos.ID_REMESA := ID_REMESA;
|
||||
end;
|
||||
Next;
|
||||
|
||||
@ -57,7 +57,7 @@ inherited fEditorReciboCliente: TfEditorReciboCliente
|
||||
inherited pgPaginas: TPageControl
|
||||
Width = 685
|
||||
Height = 329
|
||||
ActivePage = pagCompensados
|
||||
ActivePage = pagPagos
|
||||
ExplicitWidth = 685
|
||||
ExplicitHeight = 329
|
||||
inherited pagGeneral: TTabSheet
|
||||
@ -279,6 +279,9 @@ inherited fEditorReciboCliente: TfEditorReciboCliente
|
||||
OnUpdate = frViewPagosCliente1actEliminarUpdate
|
||||
end
|
||||
end
|
||||
inherited ContenidoImageList: TPngImageList
|
||||
Top = 136
|
||||
end
|
||||
end
|
||||
end
|
||||
object pagCompensados: TTabSheet
|
||||
@ -422,8 +425,8 @@ inherited fEditorReciboCliente: TfEditorReciboCliente
|
||||
OnRestorePlacement = JvFormStorageRestorePlacement
|
||||
end
|
||||
inherited dsDataTable: TDADataSource [9]
|
||||
Left = 8
|
||||
Top = 168
|
||||
Left = 16
|
||||
Top = 208
|
||||
end
|
||||
inherited JvAppRegistryStorage: TJvAppRegistryStorage [10]
|
||||
end
|
||||
|
||||
@ -137,7 +137,7 @@ inherited frViewPagosCliente: TfrViewPagosCliente
|
||||
Value = 'Devoluci'#243'n'
|
||||
end>
|
||||
Options.Focusing = False
|
||||
Width = 389
|
||||
Width = 295
|
||||
IsCaptionAssigned = True
|
||||
end
|
||||
object ListaPagosClienteDBTableView1FECHA_PAGO: TcxGridDBColumn
|
||||
@ -145,11 +145,12 @@ inherited frViewPagosCliente: TfrViewPagosCliente
|
||||
DataBinding.FieldName = 'FECHA_PAGO'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Options.Focusing = False
|
||||
Width = 231
|
||||
Width = 220
|
||||
end
|
||||
object ListaPagosClienteDBTableView1TITULAR: TcxGridDBColumn
|
||||
Caption = 'Remesa'
|
||||
DataBinding.FieldName = 'TITULAR'
|
||||
Visible = False
|
||||
Width = 103
|
||||
end
|
||||
object ListaPagosClienteDBTableView1ENTIDAD: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'ENTIDAD'
|
||||
|
||||
@ -554,7 +554,7 @@ begin
|
||||
|
||||
//Si todo ha ido bien, asignamos la remesa a los recibos asociados
|
||||
//Como no están declarados como maestro-detalles debemos hacer el applyupdates nosotros
|
||||
RecibosClienteController.AsignarRemesa(ARemesaCliente.Recibos, ARemesaCliente.ID);
|
||||
RecibosClienteController.AsignarRemesa(ARemesaCliente.Recibos, ARemesaCliente.ID, ARemesaCliente.REFERENCIA);
|
||||
ARemesaCliente.Recibos.DataTable.ApplyUpdates; //En este applyupdates tambien se realizarán todos los cambios acumulados sobre los recibos asociados (EliminarReciboCliente/ ElegirRecibosCliente)
|
||||
|
||||
//Es necesario ya que no se refrescan bien los deltas y despues del applyupdates siguen
|
||||
|
||||
Reference in New Issue
Block a user