git-svn-id: https://192.168.0.254/svn/Proyectos.AlonsoYSal_FactuGES/trunk@34 9a1d36f3-7752-2d40-8ccb-50eb49674c68
106 lines
3.2 KiB
ObjectPascal
106 lines
3.2 KiB
ObjectPascal
unit uEditorPagoCliente;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, uEditorPago, DB, uDADataTable, JvAppStorage,
|
|
JvAppRegistryStorage, JvComponent, JvFormPlacement, ImgList,
|
|
PngImageList, StdActns, ActnList, ComCtrls, TBX, TB2Item, TB2Dock,
|
|
TB2Toolbar, ExtCtrls, JvExControls, JvNavigationPane, uCustomView,
|
|
uViewBase, uViewPago, uViewPagoCliente, JvComponentBase;
|
|
|
|
type
|
|
IEditorPagoCliente = interface(IEditorPago)
|
|
['{7C06A739-2333-435B-B6B6-09D924DA20CB}']
|
|
end;
|
|
|
|
TfEditorPagoCliente = class(TfEditorPago, IEditorPagoCliente)
|
|
frViewPagoCliente1: TfrViewPagoCliente;
|
|
procedure actEliminarExecute(Sender: TObject);
|
|
procedure dsDataTableDataChange(Sender: TObject; Field: TField);
|
|
procedure frViewContactoedtlNombrePropertiesChange(Sender: TObject);
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
end;
|
|
|
|
var
|
|
fEditorPagoCliente: TfEditorPagoCliente;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
{ TfEditorPagoCliente }
|
|
|
|
uses uEditorUtils, uBizPagos, cxDBEdit;
|
|
|
|
function ShowEditorPagoCliente (ABizObject : TDADataTableRules) : TModalResult;
|
|
var
|
|
AEditor: TfEditorPagoCliente;
|
|
begin
|
|
AEditor := TfEditorPagoCliente.Create(Application);
|
|
try
|
|
AEditor.Pago := (ABizObject as IBizPagosCliente);
|
|
|
|
//Es llamado desde el albarán para generar automáticamente el cobro
|
|
//Solo podremos en este caso guardar y cerrar
|
|
if (Length(AEditor.Pago.DESCRIPCION) > 0) then
|
|
begin
|
|
AEditor.actGuardar.Visible := False;
|
|
AEditor.actRefrescar.Enabled := False;
|
|
AEditor.actRefrescar.Visible := False;
|
|
//AEditor.actPrevisualizar.Enabled := False;
|
|
//AEditor.actPrevisualizar.Visible := False;
|
|
//AEditor.actImprimir.Enabled := False;
|
|
//AEditor.actImprimir.Visible := False;
|
|
end;
|
|
|
|
Result := AEditor.ShowModal;
|
|
finally
|
|
AEditor.Release;
|
|
end;
|
|
end;
|
|
|
|
procedure TfEditorPagoCliente.actEliminarExecute(Sender: TObject);
|
|
begin
|
|
if (Application.MessageBox('¿Desea borrar este cobro de cliente?', 'Atención', MB_YESNO) = IDYES) then
|
|
inherited;
|
|
end;
|
|
|
|
constructor TfEditorPagoCliente.Create(AOwner: TComponent);
|
|
begin
|
|
inherited;
|
|
//ViewPago := CreateView(TfrViewPagoCliente) as IViewPagoCliente;
|
|
ViewPago := frViewPagoCliente1;
|
|
end;
|
|
|
|
procedure TfEditorPagoCliente.dsDataTableDataChange(Sender: TObject; Field: TField);
|
|
begin
|
|
inherited;
|
|
if Assigned(Pago) and (not (Pago.DataTable.Fetching) or
|
|
not (Pago.DataTable.Opening) or not (Pago.DataTable.Closing)) then
|
|
begin
|
|
if Length(Pago.NOMBRE) = 0 then
|
|
JvNavPanelHeader.Caption := 'Nuevo cobro de cliente'
|
|
else
|
|
JvNavPanelHeader.Caption := Pago.NOMBRE;
|
|
Self.Caption := JvNavPanelHeader.Caption;
|
|
end;
|
|
end;
|
|
|
|
procedure TfEditorPagoCliente.frViewContactoedtlNombrePropertiesChange(
|
|
Sender: TObject);
|
|
begin
|
|
inherited;
|
|
if Length((Sender as TcxDBTextEdit).Text) = 0 then
|
|
JvNavPanelHeader.Caption := 'Nuevo cobro de cliente'
|
|
else
|
|
JvNavPanelHeader.Caption := 'Cobro de ' + (Sender as TcxDBTextEdit).Text;
|
|
Caption := JvNavPanelHeader.Caption;
|
|
end;
|
|
|
|
initialization
|
|
RegisterEditor(IBizPagosCliente, ShowEditorPagoCliente, etItem);
|
|
|
|
end.
|