125 lines
4.0 KiB
ObjectPascal
125 lines
4.0 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, cxLookupEdit, cxDBLookupEdit,
|
|||
|
|
cxDBLookupComboBox, uFormasPagoController, uDAInterfaces;
|
|||
|
|
|
|||
|
|
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;
|
|||
|
|
dxLayoutControl1Item5: TdxLayoutItem;
|
|||
|
|
memObservaciones: TcxDBMemo;
|
|||
|
|
dxLayoutControl1Group5: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Item6: TdxLayoutItem;
|
|||
|
|
frViewClienteFactura: TfrViewDatosYSeleccionCliente;
|
|||
|
|
dxLayoutLookAndFeelList1: TdxLayoutLookAndFeelList;
|
|||
|
|
dxLayoutOfficeLookAndFeel1: TdxLayoutOfficeLookAndFeel;
|
|||
|
|
dsFormaPago: TDADataSource;
|
|||
|
|
dxLayoutControl1Item4: TdxLayoutItem;
|
|||
|
|
cbFormaPago: TcxDBLookupComboBox;
|
|||
|
|
dxLayoutControl1Item10: TdxLayoutItem;
|
|||
|
|
bFormasPago: TButton;
|
|||
|
|
dxLayoutControl1Group3: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Group6: TdxLayoutGroup;
|
|||
|
|
procedure bFormasPagoClick(Sender: TObject);
|
|||
|
|
procedure CustomViewDestroy(Sender: TObject);
|
|||
|
|
procedure CustomViewCreate(Sender: TObject);
|
|||
|
|
protected
|
|||
|
|
FFactura : IBizFacturaCliente;
|
|||
|
|
FFormasPagoController : IFormasPagoController;
|
|||
|
|
function GetFactura: IBizFacturaCliente;
|
|||
|
|
procedure SetFactura(const Value: IBizFacturaCliente);
|
|||
|
|
public
|
|||
|
|
property Factura: IBizFacturaCliente read GetFactura write SetFactura;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
uDataModuleContactos, schFacturasClienteClient_Intf,
|
|||
|
|
uBizFormasPago;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
{ TfrViewFacturaCliente }
|
|||
|
|
|
|||
|
|
procedure TfrViewFacturaCliente.bFormasPagoClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
FFormasPagoController.VerTodos((dsFormaPago.DataTable) as IBizFormaPago);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrViewFacturaCliente.CustomViewCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
// FFormasPagoController := TFormasPagoController.Create;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrViewFacturaCliente.CustomViewDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
// FFormasPagoController := NIL;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrViewFacturaCliente.GetFactura: IBizFacturaCliente;
|
|||
|
|
begin
|
|||
|
|
Result := FFactura;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrViewFacturaCliente.SetFactura(const Value: IBizFacturaCliente);
|
|||
|
|
var
|
|||
|
|
ACadena : String;
|
|||
|
|
begin
|
|||
|
|
FFactura := Value;
|
|||
|
|
if Assigned(FFactura) then
|
|||
|
|
begin
|
|||
|
|
DADataSource.DataTable := FFactura.DataTable;
|
|||
|
|
{
|
|||
|
|
dsFormaPago.DataTable := FFormasPagoController.BuscarTodos.DataTable;
|
|||
|
|
dsFormaPago.DataTable.Active := True;
|
|||
|
|
}
|
|||
|
|
//Solo se deshabilita al insertar, luego la referencia ser<65> modificable
|
|||
|
|
//eReferencia.Enabled := (FFactura.DataTable.State = dsInsert);
|
|||
|
|
|
|||
|
|
if FFactura.TIPO = CTE_TIPO_ABONO then
|
|||
|
|
begin
|
|||
|
|
dxLayoutControl1Group1.Caption := 'Datos del abono:';
|
|||
|
|
dxLayoutControl1Item2.Caption := 'Fecha del abono:';
|
|||
|
|
ACadena := 'Elija el cliente al que se le realizar<61> el abono.';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
ACadena := 'Elija el cliente al que se le realizar<61> la factura.';
|
|||
|
|
frViewClienteFactura.MsgElegirCliente := ACadena;
|
|||
|
|
end
|
|||
|
|
else begin
|
|||
|
|
DADataSource.DataTable := NIL;
|
|||
|
|
dsFormaPago.DataTable := NIL;
|
|||
|
|
frViewClienteFactura.Cliente := NIL
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|