2007-06-21 16:02:50 +00:00
|
|
|
|
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<61>n para generar autom<6F>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;
|
2017-12-27 12:07:32 +00:00
|
|
|
|
//AEditor.actPrevisualizar.Enabled := False;
|
|
|
|
|
|
//AEditor.actPrevisualizar.Visible := False;
|
|
|
|
|
|
//AEditor.actImprimir.Enabled := False;
|
|
|
|
|
|
//AEditor.actImprimir.Visible := False;
|
2007-06-21 16:02:50 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
Result := AEditor.ShowModal;
|
|
|
|
|
|
finally
|
|
|
|
|
|
AEditor.Release;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorPagoCliente.actEliminarExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if (Application.MessageBox('<27>Desea borrar este cobro de cliente?', 'Atenci<63>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.
|