#401 No recupera la fecha del pago de los recibos si la modificamos y no coge bien la fecha cuendo la metemos manualmente
git-svn-id: https://192.168.0.254/svn/Proyectos.Noviseda_FactuGES2/trunk@129 f33bb606-9f5c-448d-9c99-757f00063c96
This commit is contained in:
parent
8663a34655
commit
3c31071bc2
@ -812,7 +812,7 @@ end;
|
|||||||
procedure TRecibosClienteController.ModificarPago(ARecibosCliente: IBizRecibosCliente);
|
procedure TRecibosClienteController.ModificarPago(ARecibosCliente: IBizRecibosCliente);
|
||||||
var
|
var
|
||||||
AEditor : IEditorFechaPago;
|
AEditor : IEditorFechaPago;
|
||||||
FechaPago: String;
|
AFechaPago: String;
|
||||||
begin
|
begin
|
||||||
if not Assigned(ARecibosCliente) then
|
if not Assigned(ARecibosCliente) then
|
||||||
raise Exception.Create ('Recibos de cliente no asignado (ModificarPago)');
|
raise Exception.Create ('Recibos de cliente no asignado (ModificarPago)');
|
||||||
@ -822,16 +822,16 @@ begin
|
|||||||
CreateEditor('EditorFechaPago', IEditorFechaPago, AEditor);
|
CreateEditor('EditorFechaPago', IEditorFechaPago, AEditor);
|
||||||
if Assigned(AEditor) then
|
if Assigned(AEditor) then
|
||||||
try
|
try
|
||||||
FechaPago := '';
|
AEditor.FechaPago := ARecibosCliente.Pagos.FECHA_PAGO;
|
||||||
if (AEditor.ShowModal = mrOk) then
|
if (AEditor.ShowModal = mrOk) then
|
||||||
FechaPago := DateToStr(AEditor.FechaPago);
|
AFechaPago := DateToStr(AEditor.FechaPago);
|
||||||
finally
|
finally
|
||||||
AEditor.Release;
|
AEditor.Release;
|
||||||
AEditor := NIL;
|
AEditor := NIL;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Length(FechaPago) > 0 then
|
if Length(AFechaPago) > 0 then
|
||||||
PagosController.Modificar(ARecibosCliente.Pagos, FechaPago);
|
PagosController.Modificar(ARecibosCliente.Pagos, AFechaPago);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TRecibosClienteController.Nuevo: IBizRecibosCliente;
|
function TRecibosClienteController.Nuevo: IBizRecibosCliente;
|
||||||
|
|||||||
@ -37,7 +37,7 @@ object fEditorFechaPago: TfEditorFechaPago
|
|||||||
object eFechaPago: TcxDateEdit
|
object eFechaPago: TcxDateEdit
|
||||||
Left = 77
|
Left = 77
|
||||||
Top = 64
|
Top = 64
|
||||||
Properties.OnChange = eFechaPagoPropertiesChange
|
Properties.OnEditValueChanged = eFechaPagoPropertiesEditValueChanged
|
||||||
Style.LookAndFeel.Kind = lfStandard
|
Style.LookAndFeel.Kind = lfStandard
|
||||||
Style.LookAndFeel.NativeStyle = True
|
Style.LookAndFeel.NativeStyle = True
|
||||||
StyleDisabled.LookAndFeel.Kind = lfStandard
|
StyleDisabled.LookAndFeel.Kind = lfStandard
|
||||||
|
|||||||
@ -5,7 +5,8 @@ interface
|
|||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
Dialogs, StdCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
Dialogs, StdCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
||||||
cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorFechaPago;
|
cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorFechaPago,
|
||||||
|
cxGraphics, cxLookAndFeels, cxLookAndFeelPainters;
|
||||||
|
|
||||||
type
|
type
|
||||||
TfEditorFechaPago = class(TfEditorBasico, IEditorFechaPago)
|
TfEditorFechaPago = class(TfEditorBasico, IEditorFechaPago)
|
||||||
@ -16,7 +17,7 @@ type
|
|||||||
Label2: TLabel;
|
Label2: TLabel;
|
||||||
Panel1: TPanel;
|
Panel1: TPanel;
|
||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
procedure eFechaPagoPropertiesChange(Sender: TObject);
|
procedure eFechaPagoPropertiesEditValueChanged(Sender: TObject);
|
||||||
private
|
private
|
||||||
FFechaPago : TDateTime;
|
FFechaPago : TDateTime;
|
||||||
function GetFechaPago: TDateTime;
|
function GetFechaPago: TDateTime;
|
||||||
@ -32,14 +33,16 @@ implementation
|
|||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
procedure TfEditorFechaPago.eFechaPagoPropertiesChange(Sender: TObject);
|
procedure TfEditorFechaPago.eFechaPagoPropertiesEditValueChanged(
|
||||||
|
Sender: TObject);
|
||||||
begin
|
begin
|
||||||
FechaPago := eFechaPago.Date;
|
FechaPago := eFechaPago.Date;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfEditorFechaPago.FormShow(Sender: TObject);
|
procedure TfEditorFechaPago.FormShow(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
eFechaPago.Date := Date;
|
if (length(eFechaPago.Text) = 0) then
|
||||||
|
eFechaPago.Date := Date;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TfEditorFechaPago.GetFechaPago: TDateTime;
|
function TfEditorFechaPago.GetFechaPago: TDateTime;
|
||||||
@ -50,6 +53,7 @@ end;
|
|||||||
procedure TfEditorFechaPago.SetFechaPago(const Value: TDateTime);
|
procedure TfEditorFechaPago.SetFechaPago(const Value: TDateTime);
|
||||||
begin
|
begin
|
||||||
FFechaPago := Value;
|
FFechaPago := Value;
|
||||||
|
eFechaPago.EditValue := FFechaPago;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -786,22 +786,22 @@ end;
|
|||||||
procedure TRecibosProveedorController.ModificarPago(ARecibosProveedor: IBizRecibosProveedor);
|
procedure TRecibosProveedorController.ModificarPago(ARecibosProveedor: IBizRecibosProveedor);
|
||||||
var
|
var
|
||||||
AEditor : IEditorFechaPagoProveedor;
|
AEditor : IEditorFechaPagoProveedor;
|
||||||
FechaPago: String;
|
AFechaPago: String;
|
||||||
begin
|
begin
|
||||||
//Pedimos la fecha del pago
|
//Pedimos la fecha del pago
|
||||||
CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor);
|
CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor);
|
||||||
if Assigned(AEditor) then
|
if Assigned(AEditor) then
|
||||||
try
|
try
|
||||||
FechaPago:= '';
|
AEditor.FechaPago:= ARecibosProveedor.Pagos.FECHA_PAGO;
|
||||||
if (AEditor.ShowModal = mrOk) then
|
if (AEditor.ShowModal = mrOk) then
|
||||||
FechaPago := DateToStr(AEditor.FechaPago);
|
AFechaPago := DateToStr(AEditor.FechaPago);
|
||||||
finally
|
finally
|
||||||
AEditor.Release;
|
AEditor.Release;
|
||||||
AEditor := NIL;
|
AEditor := NIL;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Length(FechaPago) > 0 then
|
if Length(AFechaPago) > 0 then
|
||||||
PagosController.Modificar(ARecibosProveedor.Pagos, FechaPago);
|
PagosController.Modificar(ARecibosProveedor.Pagos, AFechaPago);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TRecibosProveedorController.Nuevo: IBizRecibosProveedor;
|
function TRecibosProveedorController.Nuevo: IBizRecibosProveedor;
|
||||||
|
|||||||
@ -41,7 +41,7 @@ object fEditorFechaPagoProveedor: TfEditorFechaPagoProveedor
|
|||||||
object eFechaPago: TcxDateEdit
|
object eFechaPago: TcxDateEdit
|
||||||
Left = 77
|
Left = 77
|
||||||
Top = 64
|
Top = 64
|
||||||
Properties.OnChange = eFechaPagoPropertiesChange
|
Properties.OnEditValueChanged = eFechaPagoPropertiesEditValueChanged
|
||||||
Style.LookAndFeel.Kind = lfStandard
|
Style.LookAndFeel.Kind = lfStandard
|
||||||
Style.LookAndFeel.NativeStyle = True
|
Style.LookAndFeel.NativeStyle = True
|
||||||
StyleDisabled.LookAndFeel.Kind = lfStandard
|
StyleDisabled.LookAndFeel.Kind = lfStandard
|
||||||
|
|||||||
@ -5,7 +5,8 @@ interface
|
|||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
Dialogs, StdCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
Dialogs, StdCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
||||||
cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorFechaPagoProveedor;
|
cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorFechaPagoProveedor,
|
||||||
|
cxGraphics, cxLookAndFeels, cxLookAndFeelPainters;
|
||||||
|
|
||||||
type
|
type
|
||||||
TfEditorFechaPagoProveedor = class(TfEditorBasico, IEditorFechaPagoProveedor)
|
TfEditorFechaPagoProveedor = class(TfEditorBasico, IEditorFechaPagoProveedor)
|
||||||
@ -16,7 +17,7 @@ type
|
|||||||
Label2: TLabel;
|
Label2: TLabel;
|
||||||
Panel1: TPanel;
|
Panel1: TPanel;
|
||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
procedure eFechaPagoPropertiesChange(Sender: TObject);
|
procedure eFechaPagoPropertiesEditValueChanged(Sender: TObject);
|
||||||
private
|
private
|
||||||
FFechaPago : TDateTime;
|
FFechaPago : TDateTime;
|
||||||
function GetFechaPago: TDateTime;
|
function GetFechaPago: TDateTime;
|
||||||
@ -28,14 +29,16 @@ type
|
|||||||
implementation
|
implementation
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
procedure TfEditorFechaPagoProveedor.eFechaPagoPropertiesChange(Sender: TObject);
|
procedure TfEditorFechaPagoProveedor.eFechaPagoPropertiesEditValueChanged(
|
||||||
|
Sender: TObject);
|
||||||
begin
|
begin
|
||||||
FechaPago := eFechaPago.Date;
|
FechaPago := eFechaPago.Date;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfEditorFechaPagoProveedor.FormShow(Sender: TObject);
|
procedure TfEditorFechaPagoProveedor.FormShow(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
eFechaPago.Date := Date;
|
if (length(eFechaPago.Text) = 0) then
|
||||||
|
eFechaPago.Date := Date;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TfEditorFechaPagoProveedor.GetFechaPago: TDateTime;
|
function TfEditorFechaPagoProveedor.GetFechaPago: TDateTime;
|
||||||
@ -46,6 +49,7 @@ end;
|
|||||||
procedure TfEditorFechaPagoProveedor.SetFechaPago(const Value: TDateTime);
|
procedure TfEditorFechaPagoProveedor.SetFechaPago(const Value: TDateTime);
|
||||||
begin
|
begin
|
||||||
FFechaPago := Value;
|
FFechaPago := Value;
|
||||||
|
eFechaPago.EditValue := FFechaPago;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
Reference in New Issue
Block a user