#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);
|
||||
var
|
||||
AEditor : IEditorFechaPago;
|
||||
FechaPago: String;
|
||||
AFechaPago: String;
|
||||
begin
|
||||
if not Assigned(ARecibosCliente) then
|
||||
raise Exception.Create ('Recibos de cliente no asignado (ModificarPago)');
|
||||
@ -822,16 +822,16 @@ begin
|
||||
CreateEditor('EditorFechaPago', IEditorFechaPago, AEditor);
|
||||
if Assigned(AEditor) then
|
||||
try
|
||||
FechaPago := '';
|
||||
AEditor.FechaPago := ARecibosCliente.Pagos.FECHA_PAGO;
|
||||
if (AEditor.ShowModal = mrOk) then
|
||||
FechaPago := DateToStr(AEditor.FechaPago);
|
||||
AFechaPago := DateToStr(AEditor.FechaPago);
|
||||
finally
|
||||
AEditor.Release;
|
||||
AEditor := NIL;
|
||||
end;
|
||||
|
||||
if Length(FechaPago) > 0 then
|
||||
PagosController.Modificar(ARecibosCliente.Pagos, FechaPago);
|
||||
if Length(AFechaPago) > 0 then
|
||||
PagosController.Modificar(ARecibosCliente.Pagos, AFechaPago);
|
||||
end;
|
||||
|
||||
function TRecibosClienteController.Nuevo: IBizRecibosCliente;
|
||||
|
||||
@ -37,7 +37,7 @@ object fEditorFechaPago: TfEditorFechaPago
|
||||
object eFechaPago: TcxDateEdit
|
||||
Left = 77
|
||||
Top = 64
|
||||
Properties.OnChange = eFechaPagoPropertiesChange
|
||||
Properties.OnEditValueChanged = eFechaPagoPropertiesEditValueChanged
|
||||
Style.LookAndFeel.Kind = lfStandard
|
||||
Style.LookAndFeel.NativeStyle = True
|
||||
StyleDisabled.LookAndFeel.Kind = lfStandard
|
||||
|
||||
@ -5,7 +5,8 @@ interface
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
||||
cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorFechaPago;
|
||||
cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorFechaPago,
|
||||
cxGraphics, cxLookAndFeels, cxLookAndFeelPainters;
|
||||
|
||||
type
|
||||
TfEditorFechaPago = class(TfEditorBasico, IEditorFechaPago)
|
||||
@ -16,7 +17,7 @@ type
|
||||
Label2: TLabel;
|
||||
Panel1: TPanel;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure eFechaPagoPropertiesChange(Sender: TObject);
|
||||
procedure eFechaPagoPropertiesEditValueChanged(Sender: TObject);
|
||||
private
|
||||
FFechaPago : TDateTime;
|
||||
function GetFechaPago: TDateTime;
|
||||
@ -32,14 +33,16 @@ implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfEditorFechaPago.eFechaPagoPropertiesChange(Sender: TObject);
|
||||
procedure TfEditorFechaPago.eFechaPagoPropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
begin
|
||||
FechaPago := eFechaPago.Date;
|
||||
end;
|
||||
|
||||
procedure TfEditorFechaPago.FormShow(Sender: TObject);
|
||||
begin
|
||||
eFechaPago.Date := Date;
|
||||
if (length(eFechaPago.Text) = 0) then
|
||||
eFechaPago.Date := Date;
|
||||
end;
|
||||
|
||||
function TfEditorFechaPago.GetFechaPago: TDateTime;
|
||||
@ -50,6 +53,7 @@ end;
|
||||
procedure TfEditorFechaPago.SetFechaPago(const Value: TDateTime);
|
||||
begin
|
||||
FFechaPago := Value;
|
||||
eFechaPago.EditValue := FFechaPago;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -786,22 +786,22 @@ end;
|
||||
procedure TRecibosProveedorController.ModificarPago(ARecibosProveedor: IBizRecibosProveedor);
|
||||
var
|
||||
AEditor : IEditorFechaPagoProveedor;
|
||||
FechaPago: String;
|
||||
AFechaPago: String;
|
||||
begin
|
||||
//Pedimos la fecha del pago
|
||||
CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor);
|
||||
if Assigned(AEditor) then
|
||||
try
|
||||
FechaPago:= '';
|
||||
AEditor.FechaPago:= ARecibosProveedor.Pagos.FECHA_PAGO;
|
||||
if (AEditor.ShowModal = mrOk) then
|
||||
FechaPago := DateToStr(AEditor.FechaPago);
|
||||
AFechaPago := DateToStr(AEditor.FechaPago);
|
||||
finally
|
||||
AEditor.Release;
|
||||
AEditor := NIL;
|
||||
end;
|
||||
|
||||
if Length(FechaPago) > 0 then
|
||||
PagosController.Modificar(ARecibosProveedor.Pagos, FechaPago);
|
||||
if Length(AFechaPago) > 0 then
|
||||
PagosController.Modificar(ARecibosProveedor.Pagos, AFechaPago);
|
||||
end;
|
||||
|
||||
function TRecibosProveedorController.Nuevo: IBizRecibosProveedor;
|
||||
|
||||
@ -41,7 +41,7 @@ object fEditorFechaPagoProveedor: TfEditorFechaPagoProveedor
|
||||
object eFechaPago: TcxDateEdit
|
||||
Left = 77
|
||||
Top = 64
|
||||
Properties.OnChange = eFechaPagoPropertiesChange
|
||||
Properties.OnEditValueChanged = eFechaPagoPropertiesEditValueChanged
|
||||
Style.LookAndFeel.Kind = lfStandard
|
||||
Style.LookAndFeel.NativeStyle = True
|
||||
StyleDisabled.LookAndFeel.Kind = lfStandard
|
||||
|
||||
@ -5,7 +5,8 @@ interface
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
||||
cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorFechaPagoProveedor;
|
||||
cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorFechaPagoProveedor,
|
||||
cxGraphics, cxLookAndFeels, cxLookAndFeelPainters;
|
||||
|
||||
type
|
||||
TfEditorFechaPagoProveedor = class(TfEditorBasico, IEditorFechaPagoProveedor)
|
||||
@ -16,7 +17,7 @@ type
|
||||
Label2: TLabel;
|
||||
Panel1: TPanel;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure eFechaPagoPropertiesChange(Sender: TObject);
|
||||
procedure eFechaPagoPropertiesEditValueChanged(Sender: TObject);
|
||||
private
|
||||
FFechaPago : TDateTime;
|
||||
function GetFechaPago: TDateTime;
|
||||
@ -28,14 +29,16 @@ type
|
||||
implementation
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfEditorFechaPagoProveedor.eFechaPagoPropertiesChange(Sender: TObject);
|
||||
procedure TfEditorFechaPagoProveedor.eFechaPagoPropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
begin
|
||||
FechaPago := eFechaPago.Date;
|
||||
end;
|
||||
|
||||
procedure TfEditorFechaPagoProveedor.FormShow(Sender: TObject);
|
||||
begin
|
||||
eFechaPago.Date := Date;
|
||||
if (length(eFechaPago.Text) = 0) then
|
||||
eFechaPago.Date := Date;
|
||||
end;
|
||||
|
||||
function TfEditorFechaPagoProveedor.GetFechaPago: TDateTime;
|
||||
@ -46,6 +49,7 @@ end;
|
||||
procedure TfEditorFechaPagoProveedor.SetFechaPago(const Value: TDateTime);
|
||||
begin
|
||||
FFechaPago := Value;
|
||||
eFechaPago.EditValue := FFechaPago;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user