unit p_closeing;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Db, DBTables, cxGridLevel, cxClasses, cxControls, cxGridCustomView,
  cxGridCustomTableView, cxGridCardView, cxGridDBCardView, cxGrid, cxStyles,
  DBCGrids, ipGIF, ExtCtrls, StdCtrls, Mask, DBCtrls, RzPanel, RzButton,
  IvDictio, IvMulti, dxGDIPlusClasses;

type
  Tf_closetable = class(TForm)
    Query1: TQuery;
    DataSource1: TDataSource;
    Query1SID: TStringField;
    Query1SNAME: TStringField;
    Query1ATTENTION: TStringField;
    Query1MID: TStringField;
    Query1SMAIN: TStringField;
    Query1SCURRID: TIntegerField;
    Query1SDEBIT: TFloatField;
    Query1SCREDIT: TFloatField;
    Query1SDEBITLC: TFloatField;
    Query1SCREDITLC: TFloatField;
    Query1SLEVEL: TIntegerField;
    Query1CREDITLIMIT: TFloatField;
    Query1PRICETYPE: TIntegerField;
    Query1MGROUP: TIntegerField;
    Query1ADDRESS1: TStringField;
    Query1ADDRESS2: TStringField;
    Query1TEL1: TStringField;
    Query1TEL2: TStringField;
    Query1FAX: TStringField;
    Query1EMAIL: TStringField;
    Query1CONTACT: TIntegerField;
    Query1SALESMAN: TIntegerField;
    Query1JOB: TIntegerField;
    Query1DAYS: TIntegerField;
    Query1DISCOUNT: TFloatField;
    Query1STARTDATE: TDateTimeField;
    Query1ENDDATE: TDateTimeField;
    Query1ACCACTIVE: TStringField;
    Query1SDEBITM: TFloatField;
    Query1SCREDITM: TFloatField;
    Query1SDEBITLCM: TFloatField;
    Query1SCREDITLCM: TFloatField;
    Query1NEXT_: TIntegerField;
    Query1DBALANCE: TFloatField;
    Query1OBALANCE: TFloatField;
    Query1SCURRVAL: TFloatField;
    Query1SEXCHLL: TFloatField;
    Query1OBALANCELC: TFloatField;
    Query1USER_: TStringField;
    Query1SBALANCELC: TFloatField;
    Query1SBALANCE: TFloatField;
    Query1ENTYPE: TStringField;
    Query1ENMTYPE: TStringField;
    Query1OBLJOB: TStringField;
    Query1AUTONO: TIntegerField;
    Query1OBLDEPART: TStringField;
    Query1OBLCONTACT: TStringField;
    DBCtrlGrid1: TDBCtrlGrid;
    Label1: TLabel;
    DBEdit1: TDBEdit;
    Label2: TLabel;
    DBEdit2: TDBEdit;
    Image1: TImage;
    RzPanel1: TRzPanel;
    btnexit: TRzBitBtn;
    IvTranslator1: TIvTranslator;
    Edit1: TEdit;
    RzBitBtn1: TRzBitBtn;
    procedure Edit1Change(Sender: TObject);
    procedure Query1BeforeOpen(DataSet: TDataSet);
    procedure DBCtrlGrid1KeyPress(Sender: TObject; var Key: Char);
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
    procedure RzBitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  f_closetable: Tf_closetable;

implementation

uses p_posmodule;

{$R *.DFM}

procedure Tf_closetable.Edit1Change(Sender: TObject);
begin
query1.close;
query1.sql.Strings[2]:=' and sname like ''%'+edit1.text+'%''';
query1.open;
end;

procedure Tf_closetable.Query1BeforeOpen(DataSet: TDataSet);
var s:string;
begin
s:=posmodule.CONFIGSATTENTION.AsString;
if (s='') then
s:='POS';
query1.ParamByName('myattention').AsString:=S;
end;

procedure Tf_closetable.DBCtrlGrid1KeyPress(Sender: TObject;
  var Key: Char);
begin

if query1.IsEmpty then exit;
if key=#13 then
modalresult:=mrok;
end;

procedure Tf_closetable.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
modalresult:=mrok;
end;

procedure Tf_closetable.RzBitBtn1Click(Sender: TObject);
begin
if query1.IsEmpty then exit;
f_closetable.ModalResult:=mrok;
end;

end.
