2007-08-01 16:16:26 +00:00
|
|
|
|
unit uEditorControlStockVARELA;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
|
Dialogs, uEditorControlBase, DB, uDADataTable, JvAppStorage,
|
|
|
|
|
|
JvAppRegistryStorage, JvComponentBase, JvFormPlacement, ImgList,
|
|
|
|
|
|
PngImageList, StdActns, ActnList, ComCtrls, TBX, TB2Item, TB2Dock,
|
|
|
|
|
|
TB2Toolbar, ExtCtrls, JvExControls, JvComponent, JvNavigationPane,
|
|
|
|
|
|
uCustomView, uViewBase, uViewControlBase, Grids, DBGrids, pngimage, StdCtrls,
|
|
|
|
|
|
uEditorGridBase, uViewGridBase, uViewGrid, Menus, TB2ExtItems, TBXExtItems,
|
2007-09-18 17:11:41 +00:00
|
|
|
|
uBizStock, uViewControGridStockVARELA, uViewControlGrid, uDAInterfaces,
|
|
|
|
|
|
uViewParametrosCentro, uViewParametrosControlGrid, uViewParametrosColeccion,
|
|
|
|
|
|
TBXDkPanels;
|
2007-08-01 16:16:26 +00:00
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
IEditorControlStockVARELA = interface(IEditorGridBase)
|
|
|
|
|
|
['{E73FFD61-E345-43EF-A3D1-56B8A5D3DA8B}']
|
|
|
|
|
|
function GetItems: IBizStockVARELA;
|
|
|
|
|
|
procedure SetItems(const Value: IBizStockVARELA);
|
|
|
|
|
|
property Items: IBizStockVARELA read GetItems write SetItems;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
TfEditorControlStockVARELA = class(TfEditorGridBase, IEditorControlStockVARELA)
|
|
|
|
|
|
dsVentasTerminadas: TDADataSource;
|
|
|
|
|
|
actExpandir: TAction;
|
|
|
|
|
|
actContraer: TAction;
|
|
|
|
|
|
actAnchoAuto: TAction;
|
|
|
|
|
|
frViewControlGridStockVARELA1: TfrViewControlGridStockVARELA;
|
2007-09-21 17:56:46 +00:00
|
|
|
|
TBXSeparatorItem16: TTBXSeparatorItem;
|
|
|
|
|
|
TBXItem35: TTBXItem;
|
|
|
|
|
|
TBXItem36: TTBXItem;
|
|
|
|
|
|
TBXItem37: TTBXItem;
|
2007-08-01 16:16:26 +00:00
|
|
|
|
procedure actAnchoAutoExecute(Sender: TObject);
|
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure actPrevisualizarExecute(Sender: TObject);
|
|
|
|
|
|
procedure actImprimirExecute(Sender: TObject);
|
|
|
|
|
|
procedure actExpandirExecute(Sender: TObject);
|
|
|
|
|
|
procedure actContraerExecute(Sender: TObject);
|
2007-09-18 17:11:41 +00:00
|
|
|
|
procedure actRefrescarExecute(Sender: TObject);
|
2007-08-01 16:16:26 +00:00
|
|
|
|
private
|
|
|
|
|
|
property ViewGrid;
|
|
|
|
|
|
protected
|
|
|
|
|
|
FItems : IBizStockVARELA;
|
|
|
|
|
|
function GetItems: IBizStockVARELA;
|
|
|
|
|
|
procedure SetItems(const Value: IBizStockVARELA);
|
|
|
|
|
|
public
|
|
|
|
|
|
property Items: IBizStockVARELA read GetItems write SetItems;
|
|
|
|
|
|
constructor Create(AOwner: TComponent); override;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
cxControls, uEditorUtils, DateUtils, uCustomEditor, uEditorBase;
|
|
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
{ TfEditorControlStockEDI }
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorControlStockVARELA.actAnchoAutoExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
frViewControlGridStockVARELA1.AjustarAncho;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorControlStockVARELA.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
|
|
|
|
|
|
if not Assigned(FItems) then
|
|
|
|
|
|
raise Exception.Create('No hay items asignados');
|
|
|
|
|
|
|
|
|
|
|
|
if not Assigned(ViewGrid) then
|
|
|
|
|
|
raise Exception.Create('No hay una vista asignada');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorControlStockVARELA.actImprimirExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
frViewControlGridStockVARELA1.Print;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
constructor TfEditorControlStockVARELA.Create(AOwner: TComponent);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
ViewGrid := frViewControlGridStockVARELA1;
|
|
|
|
|
|
Self.Caption := 'Control de stock de almac<61>n';
|
|
|
|
|
|
JvNavPanelHeader.Caption := Self.Caption;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfEditorControlStockVARELA.GetItems: IBizStockVARELA;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := FItems;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorControlStockVARELA.SetItems(const Value: IBizStockVARELA);
|
|
|
|
|
|
begin
|
|
|
|
|
|
FItems := Value;
|
|
|
|
|
|
if Assigned(FItems) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
dsDataTable.DataTable := FItems.DataTable;
|
2007-09-18 17:11:41 +00:00
|
|
|
|
frViewControlGridStockVARELA1.Items := FItems;
|
2007-08-01 16:16:26 +00:00
|
|
|
|
|
2007-09-18 17:11:41 +00:00
|
|
|
|
// Se pasa a realizar la consulta bajo demanda
|
|
|
|
|
|
// if not FItems.DataTable.Active then
|
|
|
|
|
|
// FItems.DataTable.Active := True;
|
2007-08-01 16:16:26 +00:00
|
|
|
|
|
2007-09-18 17:11:41 +00:00
|
|
|
|
actAnchoAuto.Execute;
|
2007-08-01 16:16:26 +00:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorControlStockVARELA.actPrevisualizarExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
frViewControlGridStockVARELA1.Preview;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2007-09-18 17:11:41 +00:00
|
|
|
|
procedure TfEditorControlStockVARELA.actRefrescarExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
frViewControlGridStockVARELA1.Refresh;
|
|
|
|
|
|
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
|
|
|
|
|
|
ViewGrid.ExpandirTodo;
|
|
|
|
|
|
ViewGrid.GotoFirst;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2007-08-01 16:16:26 +00:00
|
|
|
|
procedure TfEditorControlStockVARELA.actExpandirExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
ViewGrid.ExpandirTodo;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorControlStockVARELA.actContraerExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
ViewGrid.ContraerTodo;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|
|