--ABS-50995/ ABS-56078

---RENTALQTYADJUSTMENT table---
ALTER TABLE RENTALQTYADJUSTMENT ADD (RECALCSTATUS NUMBER DEFAULT 0 NOT NULL
                                     CONSTRAINT RECALCSTATUS_VALID1_1 CHECK (RECALCSTATUS IN (0,1,2,3)));

COMMENT ON COLUMN RENTALQTYADJUSTMENT.RECALCSTATUS
  IS 'Possible values:
0   = Not applicable (default)
1   = To be recalculated
2   = Being  recalculated
3   = Recalculated
Only relevant for module FIXEDDELIVERYANDBILLING';
  
---PRODUCT table---
ALTER TABLE PRODUCT ADD (DELIVERYTOBILLRELATIONSHIP VARCHAR2(1) DEFAULT 'N' NOT NULL
                         CONSTRAINT YN_VALIDATIONFIELD401 CHECK (DELIVERYTOBILLRELATIONSHIP IN ('Y', 'N')));

---PRODUCTLISTPERDISTRIBPOINT table---
ALTER TABLE PRODUCTLISTPERDISTRIBPOINT MODIFY (ORDERINGMETHOD DEFAULT 2);
ALTER TABLE PRODUCTLISTPERDISTRIBPOINT MODIFY (HOLIDAYUSAGEFACTOR DEFAULT 100);

ALTER TABLE PRODUCTLISTPERDISTRIBPOINT ADD (DELIVERYPERCENTAGE NUMBER NULL  
                                            CONSTRAINT DELIVERYPERCENTAGE_VALID1_1 CHECK (DELIVERYPERCENTAGE BETWEEN 0 AND 100),
                                            BILLINGPERCENTAGE NUMBER NULL 
                                            CONSTRAINT BILLINGPERCENTAGE_VALID1_1 CHECK (BILLINGPERCENTAGE BETWEEN 0 AND 100));

COMMENT ON COLUMN PRODUCTLISTPERDISTRIBPOINT.COUNTSEQUENCE
  IS 'Count sequence for product within current consumption point.
Default value 1, but will be overridden in client with max(countsequence) for current distributionpoint';

COMMENT ON COLUMN PRODUCTLISTPERDISTRIBPOINT.HOLIDAYUSAGEFACTOR
  IS 'Holiday usage factor. Possible values 0..999, default value 100';
  
COMMENT ON COLUMN PRODUCTLISTPERDISTRIBPOINT.CONTRACTPERIOD
  IS 'Contract period in days';
  
COMMENT ON COLUMN PRODUCTLISTPERDISTRIBPOINT.PROLONGATIONPERIOD
  IS 'Prolongation period in days';
  
COMMENT ON COLUMN PRODUCTLISTPERDISTRIBPOINT.CANCELADVANCEPERIOD
  IS 'Cancel period in days.';
  
COMMENT ON COLUMN PRODUCTLISTPERDISTRIBPOINT.MINSTOCKQTY
  IS 'MinStockQty  NUMBER  N  0  Minimum stock quantity. Allowed values 0..9999, default value 0';
  
COMMENT ON COLUMN PRODUCTLISTPERDISTRIBPOINT.MAXSSTOCKQTY
  IS 'Maximum stock quantity. Allowed values 0..9999, default value 0';
  
COMMENT ON COLUMN PRODUCTLISTPERDISTRIBPOINT.DELIVERYPERCENTAGE
  IS 'Optional, so may be left empty. When filled the possible values are 0..100
Only used for module FIXEDDELIVERYANDBILLING';

COMMENT ON COLUMN PRODUCTLISTPERDISTRIBPOINT.BILLINGPERCENTAGE
  IS 'Optional so may be left empty. When filled the possible values are 0..100
Only used for module FIXEDDELIVERYANDBILLING'; 


