unit uViewPresupuestoAlbaran; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uViewPresupuestoRelacionado, ImgList, PngImageList, ActnList, cxControls, cxContainer, cxEdit, cxTextEdit, ComCtrls, ToolWin, ExtCtrls, StdCtrls, cxDBEdit, DB, uDADataTable; type TfrViewPresupuestoAlbaran = class(TfrViewPresupuestoRelacionado) procedure actElegirPresupuestoExecute(Sender: TObject); private { Private declarations } public { Public declarations } end; var frViewPresupuestoAlbaran: TfrViewPresupuestoAlbaran; implementation uses uBizPresupuestosCliente, schPresupuestosClient_Intf, uDataModulePresupuestos; {$R *.dfm} procedure TfrViewPresupuestoAlbaran.actElegirPresupuestoExecute( Sender: TObject); var APresupuesto : IBizPresupuestos; begin inherited; if Length(edtlReferencia.Text) > 0 then if (MessageBox(0, 'Este albarán ya tiene asociado un presupuesto. '+#13+#10+ 'Si elige otro presupuesto, se cambiará en este albarán el cliente y los conceptos '+#13+#10+ 'para hacerlos coincidir con el presupuesto elegido. '+#13+#10+ '¿Desea continuar?', 'Confirmación', MB_ICONQUESTION or MB_YESNO) = idNo) then Exit; APresupuesto := dmPresupuestos.GetPresupuestosSinAlbaran; try if APresupuesto.ShowForSelect = mrOK then begin Self.Presupuesto := dmPresupuestos.GetItemsSeleccionados(APresupuesto) end; finally APresupuesto := NIL; end; end; end.