git-svn-id: https://192.168.0.254/svn/Proyectos.AlonsoYSal_FactuGES/trunk@5 9a1d36f3-7752-2d40-8ccb-50eb49674c68
114 lines
2.7 KiB
ObjectPascal
114 lines
2.7 KiB
ObjectPascal
unit uEditorPago;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, uEditorDBItem, DB, uDADataTable, JvAppStorage,
|
|
JvAppRegistryStorage, JvComponent, JvFormPlacement, ImgList,
|
|
PngImageList, StdActns, ActnList, ComCtrls, TBX, TB2Item, TB2Dock,
|
|
TB2Toolbar, ExtCtrls, JvExControls, JvNavigationPane,
|
|
|
|
uBizPagos, uViewPago, JvComponentBase;
|
|
|
|
type
|
|
IEditorPago = interface(IEditorDBItem)
|
|
['{D322A0F5-AFB7-47A6-A223-778FFE2FEB78}']
|
|
function GetPago: IBizPagos;
|
|
procedure SetPago(const Value: IBizPagos);
|
|
property Pago: IBizPagos read GetPago write SetPago;
|
|
end;
|
|
|
|
TfEditorPago = class(TfEditorDBItem, IEditorPago)
|
|
procedure FormShow(Sender: TObject);
|
|
procedure actGuardarExecute(Sender: TObject);
|
|
procedure actGuardarCerrarExecute(Sender: TObject);
|
|
private
|
|
FPago: IBizPagos;
|
|
FViewPago : IViewPago;
|
|
protected
|
|
function GetPago: IBizPagos; virtual;
|
|
procedure SetPago(const Value: IBizPagos); virtual;
|
|
|
|
function GetViewPago: IViewPago;
|
|
procedure SetViewPago(const Value: IViewPago);
|
|
property ViewPago: IViewPago read GetViewPago write SetViewPago;
|
|
public
|
|
property Pago: IBizPagos read GetPago write SetPago;
|
|
destructor Destroy; override;
|
|
end;
|
|
|
|
var
|
|
fEditorPago: TfEditorPago;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
{ TfEditorPago }
|
|
|
|
destructor TfEditorPago.Destroy;
|
|
begin
|
|
FViewPago := NIL;
|
|
FPago := NIL;
|
|
inherited;
|
|
end;
|
|
|
|
procedure TfEditorPago.FormShow(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
|
|
if not Assigned(FViewPago) then
|
|
raise Exception.Create('No hay ninguna vista asignada');
|
|
|
|
if not Assigned(Pago) then
|
|
raise Exception.Create('No hay ningún pago asignado');
|
|
|
|
Pago.DataTable.Active := True;
|
|
FViewPago.ShowEmbedded(pagGeneral);
|
|
FViewPago.SetFocus;
|
|
end;
|
|
|
|
function TfEditorPago.GetPago: IBizPagos;
|
|
begin
|
|
Result := FPago;
|
|
end;
|
|
|
|
function TfEditorPago.GetViewPago: IViewPago;
|
|
begin
|
|
Result := FViewPago;
|
|
end;
|
|
|
|
procedure TfEditorPago.SetPago(const Value: IBizPagos);
|
|
begin
|
|
FPago := Value;
|
|
dsDataTable.DataTable := FPago.DataTable;
|
|
|
|
if Assigned(FViewPago) and Assigned(Pago) then
|
|
FViewPago.Pago := Pago;
|
|
end;
|
|
|
|
procedure TfEditorPago.SetViewPago(const Value: IViewPago);
|
|
begin
|
|
FViewPago := Value;
|
|
|
|
if Assigned(FViewPago) and Assigned(Pago) then
|
|
FViewPago.Pago := Pago;
|
|
end;
|
|
|
|
procedure TfEditorPago.actGuardarExecute(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
//Necesario para automatizar los pagos de albaranes
|
|
ModalResult := mrOK;
|
|
end;
|
|
|
|
procedure TfEditorPago.actGuardarCerrarExecute(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
//Necesario para automatizar los pagos de albaranes
|
|
ModalResult := mrOK;
|
|
end;
|
|
|
|
end.
|