unit p_item;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  RzButton, ExtCtrls, RzPanel, cxVGrid, cxDBVGrid, cxControls,
  cxInplaceContainer, cxStyles, Db, DBTables;

type
  Tf_item = class(TForm)
    cxStyleRepository1: TcxStyleRepository;
    cxStyle1: TcxStyle;
    cxStyle2: TcxStyle;
    cxStyle3: TcxStyle;
    cxDBVerticalGrid7: TcxDBVerticalGrid;
    cxCategoryRow5: TcxCategoryRow;
    cxDBVerticalGrid7DBEditorRow1: TcxDBEditorRow;
    cxDBVerticalGrid7DBEditorRow2: TcxDBEditorRow;
    cxDBVerticalGrid7DBEditorRow3: TcxDBEditorRow;
    cd1: TColorDialog;
    RzPanel1: TRzPanel;
    RzBitBtn1: TRzBitBtn;
    RzBitBtn2: TRzBitBtn;
    cxDBVerticalGrid7DBEditorRow4: TcxDBEditorRow;
    Query1: TQuery;
    Query1ITEM: TStringField;
    Query1DESCR1: TStringField;
    Query1DESCR2: TStringField;
    Query1POSPRICE1: TFloatField;
    Query1VAT: TFloatField;
    Query1OFRE: TIntegerField;
    Query1CATEGORY: TStringField;
    Query1SUBCAT1: TStringField;
    Query1SUBCAT2: TStringField;
    Query1WHEREIS: TStringField;
    Query1SUPPLIER: TStringField;
    Query1MASDAR: TStringField;
    Query1PACK: TFloatField;
    Query1BCOSTUS: TFloatField;
    Query1BCOSTLC: TFloatField;
    Query1SALESCURRID: TIntegerField;
    Query1PRICEA: TFloatField;
    Query1PRICEB: TFloatField;
    Query1PRICEC: TFloatField;
    Query1PRICED: TFloatField;
    Query1PRICEE: TFloatField;
    Query1PRICEF: TFloatField;
    Query1BARCODE1: TStringField;
    Query1BARCODE2: TStringField;
    Query1BARCODE3: TStringField;
    Query1BARCODE4: TStringField;
    Query1PACK1: TFloatField;
    Query1PACK2: TFloatField;
    Query1PACK3: TFloatField;
    Query1PACK4: TFloatField;
    Query1PRICE1: TFloatField;
    Query1PRICE2: TFloatField;
    Query1PRICE3: TFloatField;
    Query1PRICE4: TFloatField;
    Query1MINSTOCK: TFloatField;
    Query1MAXSTOCK: TFloatField;
    Query1GWEIGHT: TFloatField;
    Query1NWEIGHT: TFloatField;
    Query1VOLUME: TFloatField;
    Query1SALESDISC: TFloatField;
    Query1PURCHDISC: TFloatField;
    Query1SUNIT: TStringField;
    Query1BQTY: TFloatField;
    Query1QTY: TFloatField;
    Query1CDATE: TDateTimeField;
    Query1YESNO: TStringField;
    Query1COSTUS: TFloatField;
    Query1COSTLC: TFloatField;
    Query1LCOST: TFloatField;
    Query1STYPE: TIntegerField;
    Query1BUY: TFloatField;
    Query1PAY: TFloatField;
    Query1RBUY: TFloatField;
    Query1RPAY: TFloatField;
    Query1ADJUSTIN: TFloatField;
    Query1ADJUSTOUT: TFloatField;
    Query1PRODIN: TFloatField;
    Query1PRODOUT: TFloatField;
    Query1PROFORMAQTY: TFloatField;
    Query1ORDERQTY: TFloatField;
    Query1OQTY: TFloatField;
    Query1JQTY: TFloatField;
    Query1USER_: TStringField;
    Query1MIZANE: TIntegerField;
    Query1MIZANE1: TIntegerField;
    Query1MIZANE2: TIntegerField;
    Query1MIZANE3: TIntegerField;
    Query1MIZANE4: TIntegerField;
    Query1CARTOON: TFloatField;
    Query1LCOST1: TFloatField;
    Query1LCOST2: TFloatField;
    Query1LCOST3: TFloatField;
    Query1LCOST4: TFloatField;
    DataSource1: TDataSource;
    Query1MYPRN: TStringField;
    Table1: TTable;
    Table1ITEM: TStringField;
    Table1DESCR1: TStringField;
    Table1DESCR2: TStringField;
    Table1CATEGORY: TStringField;
    Table1SUBCAT1: TStringField;
    Table1SUBCAT2: TStringField;
    Table1WHEREIS: TStringField;
    Table1SUPPLIER: TStringField;
    Table1MASDAR: TStringField;
    Table1PACK: TFloatField;
    Table1BCOSTUS: TFloatField;
    Table1BCOSTLC: TFloatField;
    Table1POSPRICE1: TFloatField;
    Table1SALESCURRID: TIntegerField;
    Table1PRICEA: TFloatField;
    Table1PRICEB: TFloatField;
    Table1PRICEC: TFloatField;
    Table1PRICED: TFloatField;
    Table1PRICEE: TFloatField;
    Table1PRICEF: TFloatField;
    Table1BARCODE1: TStringField;
    Table1BARCODE2: TStringField;
    Table1BARCODE3: TStringField;
    Table1BARCODE4: TStringField;
    Table1PACK1: TFloatField;
    Table1PACK2: TFloatField;
    Table1PACK3: TFloatField;
    Table1PACK4: TFloatField;
    Table1PRICE1: TFloatField;
    Table1PRICE2: TFloatField;
    Table1PRICE3: TFloatField;
    Table1PRICE4: TFloatField;
    Table1MINSTOCK: TFloatField;
    Table1MAXSTOCK: TFloatField;
    Table1GWEIGHT: TFloatField;
    Table1NWEIGHT: TFloatField;
    Table1VOLUME: TFloatField;
    Table1SALESDISC: TFloatField;
    Table1PURCHDISC: TFloatField;
    Table1SUNIT: TStringField;
    Table1VAT: TFloatField;
    Table1BQTY: TFloatField;
    Table1QTY: TFloatField;
    Table1CDATE: TDateTimeField;
    Table1YESNO: TStringField;
    Table1COSTUS: TFloatField;
    Table1COSTLC: TFloatField;
    Table1LCOST: TFloatField;
    Table1STYPE: TIntegerField;
    Table1BUY: TFloatField;
    Table1PAY: TFloatField;
    Table1RBUY: TFloatField;
    Table1RPAY: TFloatField;
    Table1ADJUSTIN: TFloatField;
    Table1ADJUSTOUT: TFloatField;
    Table1PRODIN: TFloatField;
    Table1PRODOUT: TFloatField;
    Table1PROFORMAQTY: TFloatField;
    Table1ORDERQTY: TFloatField;
    Table1OQTY: TFloatField;
    Table1JQTY: TFloatField;
    Table1USER_: TStringField;
    Table1MIZANE: TIntegerField;
    Table1MIZANE1: TIntegerField;
    Table1MIZANE2: TIntegerField;
    Table1MIZANE3: TIntegerField;
    Table1MIZANE4: TIntegerField;
    Table1OFRE: TIntegerField;
    Table1CARTOON: TFloatField;
    Table1LCOST1: TFloatField;
    Table1LCOST2: TFloatField;
    Table1LCOST3: TFloatField;
    Table1LCOST4: TFloatField;
    Table1MYPRN: TStringField;
    Table1MYCOSTUS: TFloatField;
    Table1MYCOSTLC: TFloatField;
    cxDBVerticalGrid7DBEditorRow5: TcxDBEditorRow;
    Query1POSORDER: TIntegerField;
    Table1POSORDER: TIntegerField;
    procedure cxDBVerticalGrid7DblClick(Sender: TObject);
    procedure RzBitBtn1Click(Sender: TObject);
    procedure RzBitBtn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  f_item: Tf_item;

implementation

uses p_posmodule, p_touchinv, p_touchcash;

{$R *.DFM}

procedure Tf_item.cxDBVerticalGrid7DblClick(Sender: TObject);
begin
if cd1.Execute then
begin
query1.edit;
query1OFRE.AsCurrency:=cd1.Color;
end;
end;

procedure Tf_item.RzBitBtn1Click(Sender: TObject);
begin


query1.ApplyUpdates;
table1.open;
table1.locate('item',query1item.AsString,[])  ;
table1.edit;
table1descr1.AsString:=query1descr1.AsString;
table1ofre.AsCurrency:=Query1OFRE.AsCurrency;
table1MYPRN.AsString:=Query1MYPRN.AsString;
table1POSPRICE1.AsCurrency:=Query1POSPRICE1.AsCurrency;
table1POSORDER.AsCurrency:=Query1POSORDER.AsCurrency;
table1.post;
table1.close;
try
f_touchinv.stock.close;
f_touchinv.stock.open;

except
try
f_touchcash.stock.close;
f_touchcash.stock.open;

except
end;

end;
close;



end;

procedure Tf_item.RzBitBtn2Click(Sender: TObject);
begin
query1.cancelUpdates;
close;
end;

end.
