2007-09-04 17:25:54 +00:00
|
|
|
|
unit uEditorCliente;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
|
uEditorContacto, ImgList, PngImageList, StdActns, ActnList, TBX,
|
|
|
|
|
|
TB2Item, TB2Dock, TB2Toolbar, ComCtrls, JvExControls, JvComponent,
|
|
|
|
|
|
JvNavigationPane, uViewCliente, uBizContactos, DB, uDADataTable,
|
|
|
|
|
|
JvFormAutoSize, uDAScriptingProvider, uDACDSDataTable, uCustomView,
|
|
|
|
|
|
uViewBase, JvAppStorage, JvAppRegistryStorage,
|
|
|
|
|
|
JvFormPlacement, ExtCtrls, pngimage, JvComponentBase, uViewContacto, StdCtrls,
|
|
|
|
|
|
|
|
|
|
|
|
uIEditorCliente, TBXStatusBars, JvExComCtrls, JvStatusBar, uViewEmpleado,
|
|
|
|
|
|
uViewDireccionesEntrega, uViewDetallesGenerico, uViewClienteDescuentos,
|
|
|
|
|
|
uViewContactoDatosBancarios, dxLayoutLookAndFeels,
|
2008-03-24 20:50:41 +00:00
|
|
|
|
uViewClienteDatosComerciales, uDAInterfaces, uViewContactoListaDatosBancarios,
|
2008-09-25 17:28:31 +00:00
|
|
|
|
uViewPersonalContacto, cxControls, cxContainer, cxEdit, cxLabel;
|
2007-09-04 17:25:54 +00:00
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfEditorCliente = class(TfEditorContacto, IEditorCliente)
|
|
|
|
|
|
frViewCliente1: TfrViewCliente;
|
|
|
|
|
|
pagDirecciones: TTabSheet;
|
|
|
|
|
|
frViewDireccionesEntrega1: TfrViewDireccionesEntrega;
|
|
|
|
|
|
actGruposCliente: TAction;
|
|
|
|
|
|
TBXItem7: TTBXItem;
|
|
|
|
|
|
pagDescuentos: TTabSheet;
|
|
|
|
|
|
frViewClienteDescuentos1: TfrViewClienteDescuentos;
|
|
|
|
|
|
pagDatosComerciales: TTabSheet;
|
|
|
|
|
|
frViewClienteDatosComerciales1: TfrViewClienteDatosComerciales;
|
2008-11-10 11:29:57 +00:00
|
|
|
|
TBXSubmenuItem2: TTBXSubmenuItem;
|
|
|
|
|
|
TBXSubmenuItem3: TTBXSubmenuItem;
|
|
|
|
|
|
TBXItem33: TTBXItem;
|
|
|
|
|
|
TBXSeparatorItem6: TTBXSeparatorItem;
|
|
|
|
|
|
actDocumentosPresupuestos: TAction;
|
|
|
|
|
|
actDocumentosAlbaranes: TAction;
|
|
|
|
|
|
actDocumentosFacturas: TAction;
|
|
|
|
|
|
TBXSubmenuItem8: TTBXSubmenuItem;
|
|
|
|
|
|
TBXItem34: TTBXItem;
|
|
|
|
|
|
TBXItem35: TTBXItem;
|
|
|
|
|
|
TBXItem36: TTBXItem;
|
|
|
|
|
|
TBXItem37: TTBXItem;
|
|
|
|
|
|
TBXItem38: TTBXItem;
|
|
|
|
|
|
TBXItem39: TTBXItem;
|
|
|
|
|
|
TBXItem40: TTBXItem;
|
|
|
|
|
|
actDocumentosRecibos: TAction;
|
|
|
|
|
|
TBXItem41: TTBXItem;
|
2007-09-04 17:25:54 +00:00
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure actGruposClienteExecute(Sender: TObject);
|
2008-11-10 11:29:57 +00:00
|
|
|
|
procedure actDocumentosFacturasExecute(Sender: TObject);
|
|
|
|
|
|
procedure actDocumentosPresupuestosExecute(Sender: TObject);
|
|
|
|
|
|
procedure actDocumentosAlbaranesExecute(Sender: TObject);
|
|
|
|
|
|
procedure actDocumentosRecibosExecute(Sender: TObject);
|
2007-09-04 17:25:54 +00:00
|
|
|
|
protected
|
|
|
|
|
|
procedure EliminarInterno; override;
|
|
|
|
|
|
procedure SetContacto(const Value: IBizContacto); override;
|
|
|
|
|
|
public
|
|
|
|
|
|
constructor Create(AOwner: TComponent); override;
|
|
|
|
|
|
procedure PonerTitulos(const ATitulo: string = ''); override;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
uEditorItem, uEditorBase, uDataModuleUsuarios, uEditorDBItem,
|
2008-11-10 11:29:57 +00:00
|
|
|
|
uGruposClienteController, uBizGruposCliente, uEditorDBBase, uDialogUtils,
|
|
|
|
|
|
uClientesController;
|
2007-09-04 17:25:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
2008-11-10 11:29:57 +00:00
|
|
|
|
procedure TfEditorCliente.actDocumentosAlbaranesExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
(FController as IClientesController).VerAlbaranesDeCliente(IBizCliente(FContacto));
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorCliente.actDocumentosFacturasExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
(FController as IClientesController).VerFacturasDeCliente(IBizCliente(FContacto));
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorCliente.actDocumentosPresupuestosExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
(FController as IClientesController).VerPresupuestosDeCliente(IBizCliente(FContacto));
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorCliente.actDocumentosRecibosExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
(FController as IClientesController).VerRecibosDeCliente(IBizCliente(FContacto));
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2007-09-04 17:25:54 +00:00
|
|
|
|
procedure TfEditorCliente.actGruposClienteExecute(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
AGruposController : IGruposClienteController;
|
|
|
|
|
|
AGrupos : IBizGrupoCliente;
|
|
|
|
|
|
begin
|
|
|
|
|
|
AGruposController := TGruposClienteController.Create;
|
|
|
|
|
|
try
|
|
|
|
|
|
AGrupos := (AGruposController.BuscarTodos as IBizGrupoCliente);
|
|
|
|
|
|
AGruposController.VerTodos(AGrupos);
|
|
|
|
|
|
finally
|
|
|
|
|
|
AGrupos := NIL;
|
|
|
|
|
|
AGruposController := NIL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
constructor TfEditorCliente.Create(AOwner: TComponent);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
ViewContacto := frViewCliente1;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorCliente.EliminarInterno;
|
|
|
|
|
|
begin
|
|
|
|
|
|
if (ShowConfirmMessage('<27>Desea borrar este cliente?', '') = IDYES) then
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorCliente.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
pgPaginas.ActivePageIndex := 0;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorCliente.PonerTitulos(const ATitulo: string);
|
|
|
|
|
|
var
|
|
|
|
|
|
FTitulo : String;
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Assigned(Contacto) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Contacto.EsNuevo then
|
|
|
|
|
|
FTitulo := 'Nuevo cliente'
|
|
|
|
|
|
else
|
|
|
|
|
|
FTitulo := 'Cliente';
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
inherited PonerTitulos(FTitulo);
|
|
|
|
|
|
|
|
|
|
|
|
if (Contacto as IBizCliente).BLOQUEADO = 1 then
|
|
|
|
|
|
JvNavPanelHeader.Caption := JvNavPanelHeader.Caption + ' (Bloqueado)';
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorCliente.SetContacto(const Value: IBizContacto);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
if Assigned(Contacto) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
frViewDireccionesEntrega1.dsDetalles.DataTable := Contacto.Direcciones.DataTable;
|
|
|
|
|
|
frViewClienteDescuentos1.dsDetalles.DataTable := (Contacto as IBizCliente).Descuentos.DataTable;
|
|
|
|
|
|
frViewClienteDatosComerciales1.Contacto := Contacto;
|
|
|
|
|
|
end
|
|
|
|
|
|
else begin
|
|
|
|
|
|
frViewDireccionesEntrega1.dsDetalles.DataTable := NIL;
|
|
|
|
|
|
frViewClienteDescuentos1.dsDetalles.DataTable := NIL;
|
|
|
|
|
|
frViewClienteDatosComerciales1.Contacto := NIL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|