--ABS-7361 / 20014910
-----------------------CUSTOMER---------------------
ALTER TABLE CUSTOMER ADD (SALESORDERDISCOUNT NUMBER(6,2) DEFAULT 0.00 NOT NULL CONSTRAINT SALESORDERDISCOUNT_VALID1_1  CHECK (SALESORDERDISCOUNT BETWEEN 0.00 AND 100.00));
  
-- ABS-7363 / 20014913
-----------------------CUSTOMERSALESPRICE---------------------
ALTER TABLE CUSTOMERSALESPRICE ADD (VOLUMEPRICE NUMBER(6) DEFAULT 1 NOT NULL);

-----------------------GENERALSALESPRICE---------------------
ALTER TABLE GENERALSALESPRICE ADD (VOLUMEPRICE NUMBER(6) DEFAULT 1 NOT NULL);

-----------------------GENERALPRICELIST---------------------
ALTER TABLE GENERALPRICELIST ADD (SALESVOLUMEPRICE VARCHAR2(1) DEFAULT 'N' NOT NULL  CONSTRAINT SALESVOLUMEPRICE_VALID1_1  CHECK (SALESVOLUMEPRICE IN ('Y','N')));


--ABS-5795 / 20015850
-----------------------PRODUCTLISTPERCUSTOMER---------------------
ALTER TABLE PRODUCTLISTPERCUSTOMER ADD (SHOWFOCRENTONINVOICE VARCHAR2(1) DEFAULT 'N' NOT NULL CONSTRAINT SHOWFOCRENTONINVOICE_VALID1_1  CHECK (SHOWFOCRENTONINVOICE IN ('Y','N')));

-----------------------INVOICELINESUBTYPE---------------------
INSERT INTO INVOICELINESUBTYPE I
      (I.INVOICELINESUBTYPE_ID,
       SUBTYPE,
       INVOICELINETYPE_ID,
       FACTORYDESCRIPTION,
       SYSTEMUSER_ID,
       TIMESTAMP)
      SELECT SEQ_INVOICELINESUBTYPE.NEXTVAL,
             45,
             1,
             'Rent by Wearer Product Free of Charge',
             GETMINSYSTEMUSER(),
             SYSDATE
        FROM DUAL;
COMMIT;


 --ABS-7278 / 20014060
-----------------------CUSTOMER-------------------------------
ALTER TABLE CUSTOMER ADD (REPAIRSPECIFICATIONONINVOICE NUMBER DEFAULT 0 NOT NULL CONSTRAINT REPSPECONINVOICE_VALID1_1  CHECK (REPAIRSPECIFICATIONONINVOICE IN (0,1,2)));

COMMENT ON COLUMN CUSTOMER.REPAIRSPECIFICATIONONINVOICE
  IS '0 =Not applicable / Summarized on LOG / COG
    1 = Summarized on RepairType
    2 = Detailed per Wearer';

-----------------------INVOICELINESUBTYPE---------------------
INSERT INTO INVOICELINESUBTYPE I
      (I.INVOICELINESUBTYPE_ID,
       SUBTYPE,
       INVOICELINETYPE_ID,
       FACTORYDESCRIPTION,
       SYSTEMUSER_ID,
       TIMESTAMP)
      SELECT SEQ_INVOICELINESUBTYPE.NEXTVAL,
             6,
             6,
             'Summarized per Repairtype',
             GETMINSYSTEMUSER(),
             SYSDATE
        FROM DUAL;
COMMIT;

INSERT INTO INVOICELINESUBTYPE I
      (I.INVOICELINESUBTYPE_ID,
       SUBTYPE,
       INVOICELINETYPE_ID,
       FACTORYDESCRIPTION,
       SYSTEMUSER_ID,
       TIMESTAMP)
      SELECT SEQ_INVOICELINESUBTYPE.NEXTVAL,
             7,
             6,
             'Summarized per Repairtype – COG',
             GETMINSYSTEMUSER(),
             SYSDATE
        FROM DUAL;
COMMIT;

INSERT INTO INVOICELINESUBTYPE I
      (I.INVOICELINESUBTYPE_ID,
       SUBTYPE,
       INVOICELINETYPE_ID,
       FACTORYDESCRIPTION,
       SYSTEMUSER_ID,
       TIMESTAMP)
      SELECT SEQ_INVOICELINESUBTYPE.NEXTVAL,
             8,
             6,
             'Detailed per Wearer',
             GETMINSYSTEMUSER(),
             SYSDATE
        FROM DUAL;
COMMIT;

INSERT INTO INVOICELINESUBTYPE I
      (I.INVOICELINESUBTYPE_ID,
       SUBTYPE,
       INVOICELINETYPE_ID,
       FACTORYDESCRIPTION,
       SYSTEMUSER_ID,
       TIMESTAMP)
      SELECT SEQ_INVOICELINESUBTYPE.NEXTVAL,
             9,
             6,
             'Detailed per Wearer',
             GETMINSYSTEMUSER(),
             SYSDATE
        FROM DUAL;
COMMIT;


-----------------------INVOICELINE---------------------
ALTER TABLE INVOICELINE ADD (REPAIRNUMBEROFMINUTES NUMBER(6) DEFAULT 0 NOT NULL,
							 REPAIRPRICEPERMINUTE NUMBER(15,6) DEFAULT 0 NOT NULL);

--ABS-7368 /  	
-----------------------WEARER--------------------- 
ALTER TABLE WEARER ADD (EMBLEMNAMEOPTION NUMBER DEFAULT 7 NOT NULL CONSTRAINT EMBLEMNAMEOPTION_VALID1_1 CHECK (EMBLEMNAMEOPTION BETWEEN 1 AND 7));

COMMENT ON COLUMN WEARER.EMBLEMNAMEOPTION
  IS 'Possible values:
1 = First name only
2 = Last name only
3 = First name + Last name
4 = Last name + First name
5 = First letter First name + Last name
6 = First name + First letter last name
7 = Manual (default)';

--ABS-7367 / 20015844
------------------CONTACTPERSON-------------------
ALTER TABLE CONTACTPERSON MODIFY (PHONE VARCHAR2(30),
								  MOBILEPHONE VARCHAR2(30),
								  FAX VARCHAR2(30));
								  
								  
------------------DEPOT-------------------
ALTER TABLE DEPOT MODIFY (PHONENO VARCHAR2(30),
						  FAXNO VARCHAR2(30));								  

------------------EMPLOYEE-------------------
ALTER TABLE EMPLOYEE MODIFY (PHONENO VARCHAR2(30),
							 MOBILENO VARCHAR2(30),
							 FAXNO VARCHAR2(30));

------------------SUPPLIER-------------------
ALTER TABLE SUPPLIER MODIFY (FAX VARCHAR2(30),
							 PHONE VARCHAR2(30));

------------------PLANT-------------------
ALTER TABLE PLANT MODIFY (PHONENO VARCHAR2(30),
						  FAXNO VARCHAR2(30));							 
							 

------------------PLANTCOMPANY-------------------
ALTER TABLE PLANTCOMPANY MODIFY (PHONE VARCHAR2(30),
								 FAX VARCHAR2(30));
--ABS-7281 / 2001587
INSERT INTO SOUNDCONFIGURATION
  (SELECT SEQ_SOUNDCONFIGURATION.NEXTVAL,
         'Scanning',
         'Washing Process Change',
         GETMINSYSTEMUSER(),
         SYSDATE,
         NULL
    FROM DUAL );
COMMIT;
							 							 
								 
								 