ConstruccionesCNJ_FactuGES/Modulos/Facturas de cliente/Views/uEditorSituacionFacturaCliente.pas
2007-06-21 15:50:59 +00:00

123 lines
3.5 KiB
ObjectPascal

unit uEditorSituacionFacturaCliente;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls,
uIEditorSituacionFacturaCliente, uFacturasClienteController, uBizFacturasCliente,
JvExControls, JvComponent, JvgWizardHeader, cxControls, cxContainer, cxEdit,
cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalendar, cxDBEdit, ActnList;
type
TfEditorSituacionFacturaCliente = class(TForm, IEditorSituacionFacturaCliente)
pnlSeleccion: TPanel;
bAceptar: TButton;
bCancelar: TButton;
JvgWizardHeader1: TJvgWizardHeader;
rbPendiente: TRadioButton;
rbPagado: TRadioButton;
ActionList1: TActionList;
actPendiente: TAction;
actPagado: TAction;
actAceptar: TAction;
Label4: TLabel;
edtFechaFacturaCliente: TEdit;
Label3: TLabel;
edtFechaPagado: TcxDateEdit;
procedure actPendienteExecute(Sender: TObject);
procedure actPagadoExecute(Sender: TObject);
procedure actRechazadoExecute(Sender: TObject);
procedure actAceptarExecute(Sender: TObject);
private
FController: IFacturasClienteController;
FFacturaCliente: IBizFacturaCliente;
function GetController : IFacturasClienteController;
procedure SetController (const Value : IFacturasClienteController);
function GetFacturaCliente: IBizFacturaCliente;
procedure SetFacturaCliente(const Value: IBizFacturaCliente);
procedure RefrescarEstado;
public
property FacturaCliente: IBizFacturaCliente read GetFacturaCliente write SetFacturaCliente;
property Controller : IFacturasClienteController read GetController
write SetController;
end;
implementation
{$R *.dfm}
uses
uDateUtils, DateUtils;
{ TfEditorSituacionPedido }
procedure TfEditorSituacionFacturaCliente.actPagadoExecute(Sender: TObject);
begin
RefrescarEstado;
end;
procedure TfEditorSituacionFacturaCliente.actAceptarExecute(Sender: TObject);
begin
if rbPendiente.Checked then
FController.CambiarSituacion(FFacturaCliente, SITUACION_PENDIENTE);
if rbPagado.Checked then
FController.CambiarSituacion(FFacturaCliente, SITUACION_PAGADO,
edtFechaPagado.Date);
ModalResult := mrOk;
Close;
end;
procedure TfEditorSituacionFacturaCliente.actPendienteExecute(Sender: TObject);
begin
RefrescarEstado;
end;
procedure TfEditorSituacionFacturaCliente.actRechazadoExecute(Sender: TObject);
begin
RefrescarEstado;
end;
function TfEditorSituacionFacturaCliente.GetController: IFacturasClienteController;
begin
Result := FController;
end;
function TfEditorSituacionFacturaCliente.GetFacturaCliente: IBizFacturaCliente;
begin
Result := FFacturaCliente;
end;
procedure TfEditorSituacionFacturaCliente.SetController(
const Value: IFacturasClienteController);
begin
FController := Value;
end;
procedure TfEditorSituacionFacturaCliente.SetFacturaCliente(const Value: IBizFacturaCliente);
begin
FFacturaCliente := Value;
if not FFacturaCliente.DataTable.Active then
FFacturaCliente.DataTable.Open;
edtFechaFacturaCliente.Text := DateToStr(FFacturaCliente.FECHA_FACTURA);
rbPendiente.Checked := (FFacturaCliente.Situacion = SITUACION_PENDIENTE);
rbPagado.Checked := (FFacturaCliente.Situacion = SITUACION_PAGADO);
if not EsFechaVacia(FFacturaCliente.FECHA_PAGADO) then
edtFechaPagado.Date := FFacturaCliente.FECHA_PAGADO
else
edtFechaPagado.Clear;
end;
procedure TfEditorSituacionFacturaCliente.RefrescarEstado;
begin
//
end;
end.