{*******************************************************}
{                                                       }
{       Administración de puntos de venta               }
{                                                       }
{       Copyright (C) 2006 Rodax Software S.L.          }
{                                                       }
{*******************************************************}

unit uViewListaRecepcionesAlbaran;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uViewGrid, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
  cxDataStorage, cxEdit, DB, cxDBData, DBTables, cxGridLevel,
  cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
  cxControls, cxGridCustomView, cxGrid, uBizRecepciones, dxPSGlbl,
  dxPSUtl, dxPSEngn, dxPrnPg, dxBkgnd, dxWrap, dxPrnDev, dxPSCompsProvider,
  dxPSFillPatterns, dxPSEdgePatterns, cxCalendar, cxTextEdit,
  cxCurrencyEdit, dxPSCore, uDADataTable, StdCtrls, cxGridBandedTableView,
  cxGridDBBandedTableView, cxImageComboBox, ImgList, PngImageList,
  dxPScxCommon, dxPScxGridLnk, cxMemo;

type
  IViewListaRecepcionesAlbaran = interface(IViewGrid)
  ['{F0B4B97B-158B-4FD8-B3F1-8ECAC7AE40D5}']
  end;

  TfrViewListaRecepcionesAlbaran = class(TfrViewGrid, IViewListaRecepcionesAlbaran)
    cxStyleEnviado: TcxStyle;
    cxStyleRecibido: TcxStyle;
    cxStyleSubtotal: TcxStyle;
    SmallImages: TPngImageList;
    cxStyleCantidadRectificada: TcxStyle;
    cxStyle1: TcxStyle;
    cxStyleFooter: TcxStyle;
    dxComponentPrinterLink1: TdxGridReportLink;
    cxStyleRepositoryInforme: TcxStyleRepository;
    cxStyleContentInforme: TcxStyle;
    cxStyleFooterInforme: TcxStyle;
    cxStyleGroupInforme: TcxStyle;
    cxStyleHeaderInforme: TcxStyle;
    cxStyleSelectionInforme: TcxStyle;
    cxGridViewRecID: TcxGridDBColumn;
    cxGridViewALBARAN: TcxGridDBColumn;
    cxGridViewESTADOALBARAN: TcxGridDBColumn;
    cxGridViewFILIAL: TcxGridDBColumn;
    cxGridViewESTADOPRODUCTO: TcxGridDBColumn;
    cxGridViewCODIGO: TcxGridDBColumn;
    cxGridViewPRODUCTO: TcxGridDBColumn;
    cxGridViewCOLOR: TcxGridDBColumn;
    cxGridViewE38: TcxGridDBColumn;
    cxGridViewE40: TcxGridDBColumn;
    cxGridViewE42: TcxGridDBColumn;
    cxGridViewE44: TcxGridDBColumn;
    cxGridViewE46: TcxGridDBColumn;
    cxGridViewE48: TcxGridDBColumn;
    procedure cxGridViewALBARANGetDataText(Sender: TcxCustomGridTableItem;
      ARecordIndex: Integer; var AText: String);
  public
    procedure Preview; override;
    procedure Print; override;
    procedure PrintSetup; override;
  end;


implementation

uses
  uDataModuleRecepciones, DateUtils, cxGridDBDataDefinitions,
  uViewGridBase, cxGridRows;

{$R *.dfm}
procedure TfrViewListaRecepcionesAlbaran.Preview;
begin
  inherited;
  dxComponentPrinterLink1.Preview;
end;

procedure TfrViewListaRecepcionesAlbaran.Print;
begin
  inherited;
  dxComponentPrinterLink1.Print(True, nil);
end;

procedure TfrViewListaRecepcionesAlbaran.PrintSetup;
begin
  inherited;
  dxComponentPrinterLink1.PageSetup;
end;

procedure TfrViewListaRecepcionesAlbaran.cxGridViewALBARANGetDataText(
  Sender: TcxCustomGridTableItem; ARecordIndex: Integer;
  var AText: String);
var
  ARecIndex: Integer;
  Val1: string;
begin
  inherited;

  if Assigned(Sender) then
  begin
    Val1 := cxGridView.DataController.Values[ARecordIndex, cxGridViewALBARAN.Index];
    AText := Val1;
    Val1 := cxGridView.DataController.Values[ARecordIndex, cxGridViewFILIAL.Index];
    AText := AText + ' - Destino: ' + Val1;
  end;
end;

end.
