#398 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.Tecsitel_FactuGES2/trunk@1004 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
1dd49fb520
commit
63158c42e5
@ -812,26 +812,25 @@ 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)');
|
||||
|
||||
|
||||
//Pedimos la fecha del pago
|
||||
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,9 @@ object fEditorFechaPago: TfEditorFechaPago
|
||||
object eFechaPago: TcxDateEdit
|
||||
Left = 77
|
||||
Top = 64
|
||||
Properties.OnChange = eFechaPagoPropertiesChange
|
||||
Properties.ImmediatePost = True
|
||||
Properties.PostPopupValueOnTab = True
|
||||
Properties.OnEditValueChanged = eFechaPagoPropertiesEditValueChanged
|
||||
Style.LookAndFeel.Kind = lfStandard
|
||||
Style.LookAndFeel.NativeStyle = True
|
||||
StyleDisabled.LookAndFeel.Kind = lfStandard
|
||||
|
||||
@ -16,7 +16,7 @@ type
|
||||
Label2: TLabel;
|
||||
Panel1: TPanel;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure eFechaPagoPropertiesChange(Sender: TObject);
|
||||
procedure eFechaPagoPropertiesEditValueChanged(Sender: TObject);
|
||||
private
|
||||
FFechaPago : TDateTime;
|
||||
function GetFechaPago: TDateTime;
|
||||
@ -29,17 +29,19 @@ var
|
||||
fEditorFechaPago: TfEditorFechaPago;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfEditorFechaPago.eFechaPagoPropertiesChange(Sender: TObject);
|
||||
uses uStringsUtils;
|
||||
|
||||
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 +52,7 @@ end;
|
||||
procedure TfEditorFechaPago.SetFechaPago(const Value: TDateTime);
|
||||
begin
|
||||
FFechaPago := Value;
|
||||
eFechaPago.EditValue := FFechaPago;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -40,6 +40,8 @@ inherited fEditorReciboCliente: TfEditorReciboCliente
|
||||
inherited lblDesbloquear: TcxLabel
|
||||
Left = 593
|
||||
ExplicitLeft = 593
|
||||
AnchorX = 638
|
||||
AnchorY = 14
|
||||
end
|
||||
end
|
||||
inherited TBXDock: TTBXDock
|
||||
@ -316,6 +318,18 @@ inherited fEditorReciboCliente: TfEditorReciboCliente
|
||||
inherited ToolBar1: TToolBar
|
||||
Width = 677
|
||||
ExplicitWidth = 677
|
||||
inherited ToolButton1: TToolButton
|
||||
ExplicitWidth = 113
|
||||
end
|
||||
inherited ToolButton4: TToolButton
|
||||
ExplicitWidth = 113
|
||||
end
|
||||
inherited ToolButton2: TToolButton
|
||||
ExplicitWidth = 113
|
||||
end
|
||||
inherited ToolButton7: TToolButton
|
||||
ExplicitWidth = 113
|
||||
end
|
||||
inherited ToolButton3: TToolButton
|
||||
ExplicitWidth = 98
|
||||
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
|
||||
|
||||
@ -16,7 +16,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 +28,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 +48,7 @@ end;
|
||||
procedure TfEditorFechaPagoProveedor.SetFechaPago(const Value: TDateTime);
|
||||
begin
|
||||
FFechaPago := Value;
|
||||
eFechaPago.EditValue := FFechaPago;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user