--
-- Definition of table PRICELISTS
--

CREATE TABLE  PRICELISTS (
  LST_ID int(11) NOT NULL auto_increment,
  LST_CODE varchar(7) NOT NULL,
  LST_NAME varchar(50) NOT NULL,
  LST_DESC varchar(100) NOT NULL,
  LST_CURRENCY varchar(10) NOT NULL,
  PRIMARY KEY  (LST_ID)
) ENGINE=MyISAM;

--
-- Dumping data for table PRICELISTS
--

INSERT INTO PRICELISTS (LST_CODE, LST_NAME, LST_DESC, LST_CURRENCY) VALUES  ('LIST001','Basic','Basic price list','');

--
-- Definition of table PRICES
--

CREATE TABLE  PRICES (
  PRC_ID int(11) NOT NULL auto_increment,
  PRC_LST_ID int(11) NOT NULL,
  PRC_GRP char(3) NOT NULL,
  PRC_ITEM varchar(10) NOT NULL,
  PRC_DESC varchar(100) NOT NULL,
  PRC_PRICE double NOT NULL,
  PRIMARY KEY  (PRC_ID)
) ENGINE=MyISAM;

--
-- Definition of table PRICESOTHERS
--

CREATE TABLE  PRICESOTHERS (
  OTH_ID int(11) NOT NULL auto_increment,
  OTH_CODE varchar(10) NOT NULL,
  OTH_DESC varchar(100) NOT NULL,
  OTH_OPD_INCLUDE int(11) NOT NULL default '0',
  OTH_IPD_INCLUDE int(11) NOT NULL default '0',
  OTH_DAILY int(11) NOT NULL default '0',
  PRIMARY KEY  (OTH_ID)
) ENGINE=MyISAM;

--
-- Dumping data for table PRICESOTHERS
--

INSERT INTO PRICESOTHERS (OTH_CODE, OTH_DESC, OTH_OPD_INCLUDE, OTH_IPD_INCLUDE, OTH_DAILY) VALUES  ('OTH001','Amount per day',0,1,1);

--
-- Dumping data for table PRICES
--

INSERT INTO PRICES (PRC_LST_ID, PRC_GRP, PRC_ITEM, PRC_DESC, PRC_PRICE) SELECT 1, 'EXA', EXA_ID_A, EXA_DESC, 0 FROM EXAM ORDER BY EXA_DESC;

INSERT INTO PRICES (PRC_LST_ID, PRC_GRP, PRC_ITEM, PRC_DESC, PRC_PRICE) SELECT 1, 'OPE', OPE_ID_A, OPE_DESC, 0 FROM OPERATION ORDER BY OPE_DESC;

INSERT INTO PRICES (PRC_LST_ID, PRC_GRP, PRC_ITEM, PRC_DESC, PRC_PRICE) SELECT 1, 'MED', MDSR_ID, MDSR_DESC, 0 FROM MEDICALDSR ORDER BY MDSR_DESC;

INSERT INTO PRICES (PRC_LST_ID, PRC_GRP, PRC_ITEM, PRC_DESC, PRC_PRICE) SELECT 1, 'OTH', OTH_ID, OTH_DESC, 0 FROM PRICESOTHERS ORDER BY OTH_DESC;

-- Menu items

INSERT INTO MENUITEM VALUES ('priceslists', 'angal.menu.btn.priceslists', 'angal.menu.priceslists', 'x', 'P', 'generaldata', 'org.isf.priceslist.gui.PricesBrowser','N', 7);

INSERT INTO MENUITEM VALUES ('otherprices', 'angal.menu.btn.otherprices', 'angal.menu.otherprices', 'x', 'H', 'types', 'org.isf.pricesothers.gui.PricesOthersBrowser','N', 10);

-- Admin grants

INSERT INTO GROUPMENU (GM_UG_ID_A, GM_MNI_ID_A, GM_ACTIVE) VALUES ('admin','priceslists','Y');

INSERT INTO GROUPMENU (GM_UG_ID_A, GM_MNI_ID_A, GM_ACTIVE) VALUES ('admin','otherprices','Y');
