65 lines
1.8 KiB
ObjectPascal
65 lines
1.8 KiB
ObjectPascal
|
|
unit uViewPresupuestoFactura;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, uViewPresupuestoRelacionado, DB, uDADataTable, ImgList,
|
|||
|
|
PngImageList, ActnList, cxControls, cxContainer, cxEdit, cxTextEdit,
|
|||
|
|
cxDBEdit, ComCtrls, ToolWin, ExtCtrls, StdCtrls;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrViewPresupuestoFactura = class(TfrViewPresupuestoRelacionado)
|
|||
|
|
procedure actElegirPresupuestoExecute(Sender: TObject);
|
|||
|
|
procedure actVerPresupuestoUpdate(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frViewPresupuestoFactura: TfrViewPresupuestoFactura;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
uses uBizPresupuestosCliente, uDataModulePresupuestos, schFacturasClienteClient_Intf,
|
|||
|
|
uDAInterfaces;
|
|||
|
|
|
|||
|
|
procedure TfrViewPresupuestoFactura.actElegirPresupuestoExecute(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
APresupuesto : IBizPresupuestos;
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
|
|||
|
|
if Length(edtlReferencia.Text) > 0 then
|
|||
|
|
if (MessageBox(0, 'Esta factura ya tiene asociado un presupuesto/albar<61>n. '+#13+#10+
|
|||
|
|
'Si elige otro presupuesto/albar<61>n, se cambiar<61> en esta factura el cliente y los conceptos '+#13+#10+
|
|||
|
|
'para hacerlos coincidir con el presupuesto/albar<61>n elegido. '+#13+#10+
|
|||
|
|
'<27>Desea continuar?', 'Confirmaci<63>n', MB_ICONQUESTION or MB_YESNO) = idNo) then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
APresupuesto := dmPresupuestos.GetPresupuestos;
|
|||
|
|
try
|
|||
|
|
if APresupuesto.ShowForSelect = mrOK then
|
|||
|
|
begin
|
|||
|
|
Self.Presupuesto := dmPresupuestos.GetItemsSeleccionados(APresupuesto)
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
APresupuesto := NIL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrViewPresupuestoFactura.actVerPresupuestoUpdate(
|
|||
|
|
Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
// inherited;
|
|||
|
|
if assigned(DADataSource) then
|
|||
|
|
begin
|
|||
|
|
(Sender as TAction).Enabled := not VarIsNull(edtlReferencia.EditValue);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|