---ABS-56440
---ERP_I_WEIGHINGCATEGORY table---
ALTER TABLE ERP_I_WEIGHINGCATEGORY ADD (LANGUAGECODE VARCHAR2(5) NULL);

COMMENT ON COLUMN ERP_I_WEIGHINGCATEGORY.LANGUAGECODE
  IS 'If left empty the ‘default’ language is being used for the description.
Remark the optional description table can overrule/overwrite this description';

ALTER TABLE ERP_I_WEIGHINGCATEGORY
  ADD CONSTRAINT PK_ERP_WEIGHINGCAT_FK UNIQUE (TRANSFER_ID, WEIGHINGCATEGORYCODE);
  
---ERP_I_WEIGHINGCATEGORY_DESC table---
CREATE TABLE ERP_I_WEIGHINGCATEGORY_DESC
(
  TRANSFER_ID          NUMBER NOT NULL,
  TRANSFER_STATUS      NUMBER DEFAULT 0 NOT NULL,
  WEIGHINGCATEGORYCODE VARCHAR2(6) NOT NULL,
  LANGUAGECODE         VARCHAR2(5) NOT NULL,
  DESCRIPTION          VARCHAR2(30) NOT NULL
);

ALTER TABLE ERP_I_WEIGHINGCATEGORY_DESC
  ADD CONSTRAINT PK_ERP_I_WEIGHINGCATDESC PRIMARY KEY (TRANSFER_ID, WEIGHINGCATEGORYCODE, LANGUAGECODE);
 
CREATE INDEX XIF1ERP_I_WEIGHINGCATEGORY_D ON ERP_I_WEIGHINGCATEGORY_DESC(TRANSFER_ID ASC);

ALTER TABLE ERP_I_WEIGHINGCATEGORY_DESC
  ADD CONSTRAINT FK_ERP_I_WEIGHINGCATEGORY_DESC FOREIGN KEY (TRANSFER_ID)
  REFERENCES ERP_I_WEIGHINGCATEGORY (TRANSFER_ID) ON DELETE CASCADE;

---ERP_O_INTERNALCALCULATION table---
ALTER TABLE ERP_O_INTERNALCALCULATION ADD (INVPLANTCURRENCYCODE VARCHAR2(3) NULL);

COMMENT ON COLUMN ERP_O_INTERNALCALCULATION.INVPLANTCURRENCYCODE
  IS 'Invoice bussinessunit, plant, countries, currency code';