119 lines
3.6 KiB
ObjectPascal
119 lines
3.6 KiB
ObjectPascal
|
|
unit uViewFacturaCliente;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, uViewBase, DB, uDADataTable, uCustomView,
|
|||
|
|
uViewDatosYSeleccionCliente, uBizFacturasCliente,
|
|||
|
|
cxControls, cxContainer, cxEdit, cxTextEdit, cxDBEdit, dxLayoutControl,
|
|||
|
|
cxMemo, cxMaskEdit, cxDropDownEdit, cxCalendar, cxSpinEdit, StdCtrls, Mask,
|
|||
|
|
DBCtrls, cxGraphics, dxLayoutLookAndFeels;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
IViewFacturaCliente = interface(IViewBase)
|
|||
|
|
['{3A95930C-20B3-41E9-93CB-21138ADB5B70}']
|
|||
|
|
function GetFactura: IBizFacturaCliente;
|
|||
|
|
procedure SetFactura(const Value: IBizFacturaCliente);
|
|||
|
|
property Factura: IBizFacturaCliente read GetFactura write SetFactura;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
TfrViewFacturaCliente = class(TfrViewBase, IViewFacturaCliente)
|
|||
|
|
DADataSource: TDADataSource;
|
|||
|
|
dxLayoutControl1Group_Root: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1: TdxLayoutControl;
|
|||
|
|
dxLayoutControl1Item1: TdxLayoutItem;
|
|||
|
|
eReferencia: TcxDBTextEdit;
|
|||
|
|
dxLayoutControl1Item2: TdxLayoutItem;
|
|||
|
|
edtFecha: TcxDBDateEdit;
|
|||
|
|
dxLayoutControl1Group1: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Group2: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Item4: TdxLayoutItem;
|
|||
|
|
memFormaPago: TcxDBMemo;
|
|||
|
|
dxLayoutControl1Item5: TdxLayoutItem;
|
|||
|
|
memObservaciones: TcxDBMemo;
|
|||
|
|
dxLayoutControl1Group3: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Group5: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Item6: TdxLayoutItem;
|
|||
|
|
frViewClienteFactura: TfrViewDatosYSeleccionCliente;
|
|||
|
|
edtVencimiento: TcxDBSpinEdit;
|
|||
|
|
dxLayoutControl1Item7: TdxLayoutItem;
|
|||
|
|
dxLayoutControl1Group7: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Group6: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Item3: TdxLayoutItem;
|
|||
|
|
cbSituacion: TcxDBComboBox;
|
|||
|
|
dxLayoutControl1Item8: TdxLayoutItem;
|
|||
|
|
edtFechaDecision: TcxDBDateEdit;
|
|||
|
|
edtFechaVencimiento: TcxDBDateEdit;
|
|||
|
|
dxLayoutControl1Item9: TdxLayoutItem;
|
|||
|
|
dxLayoutControl1Group9: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Group4: TdxLayoutGroup;
|
|||
|
|
dxLayoutLookAndFeelList1: TdxLayoutLookAndFeelList;
|
|||
|
|
dxLayoutOfficeLookAndFeel1: TdxLayoutOfficeLookAndFeel;
|
|||
|
|
procedure cbSituacionPropertiesInitPopup(Sender: TObject);
|
|||
|
|
procedure OnCreate(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
FFactura : IBizFacturaCliente;
|
|||
|
|
protected
|
|||
|
|
function GetFactura: IBizFacturaCliente;
|
|||
|
|
procedure SetFactura(const Value: IBizFacturaCliente);
|
|||
|
|
public
|
|||
|
|
property Factura: IBizFacturaCliente read GetFactura write SetFactura;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses uDataModuleContactos, schFacturasClienteClient_Intf;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
{ TfrViewFacturaCliente }
|
|||
|
|
|
|||
|
|
procedure TfrViewFacturaCliente.cbSituacionPropertiesInitPopup(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
with cbSituacion.Properties.Items do
|
|||
|
|
begin
|
|||
|
|
if Count = 0 then
|
|||
|
|
begin
|
|||
|
|
BeginUpdate;
|
|||
|
|
try
|
|||
|
|
Clear;
|
|||
|
|
AddStrings(Factura.
|
|||
|
|
DarListaSituaciones);
|
|||
|
|
finally
|
|||
|
|
EndUpdate;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrViewFacturaCliente.GetFactura: IBizFacturaCliente;
|
|||
|
|
begin
|
|||
|
|
Result := FFactura;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrViewFacturaCliente.OnCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frViewClienteFactura.MsgElegirCliente := 'Elija el cliente al que se le realizar<61> la factura.';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrViewFacturaCliente.SetFactura(const Value: IBizFacturaCliente);
|
|||
|
|
begin
|
|||
|
|
FFactura := Value;
|
|||
|
|
if Assigned(FFactura) then
|
|||
|
|
begin
|
|||
|
|
DADataSource.DataTable := FFactura.DataTable;
|
|||
|
|
|
|||
|
|
//Solo se deshabilita al insertar, luego la referencia ser<65> modificable
|
|||
|
|
eReferencia.Enabled := (FFactura.DataTable.State = dsInsert);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
DADataSource.DataTable := NIL;
|
|||
|
|
|
|||
|
|
frViewClienteFactura.Cliente := FFactura.Cliente;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|