--ABS-114791/ ABS-115911

/*
The following statemts have been commented out because they can take very long on some databases
They can be run on demand on a customer's db.

UPDATE INVOICEHEADER IH SET IH.STARTWEEK = GETISOWEEK(IH.STARTDATE), IH.ENDWEEK = GETISOWEEK(IH.ENDDATE)
WHERE IH.STARTWEEK IS NOT NULL AND IH.STARTDATE IS NOT NULL AND IH.ENDYEAR = YEAR(SYSDATE);
COMMIT;

UPDATE INVOICEHEADER IH SET IH.NEXTPERIODSTARTWEEK = GETISOWEEK(IH.NEXTPERIODSTARTDATE), IH.NEXTPERIODENDWEEK = GETISOWEEK(IH.NEXTPERIODENDDATE)
WHERE IH.NEXTPERIODSTARTWEEK IS NOT NULL AND IH.NEXTPERIODSTARTDATE IS NOT NULL AND IH.ENDYEAR = YEAR(SYSDATE);
COMMIT;

UPDATE DELIVERYHISTORY DH SET DH.WEEK = GETISOWEEK(DH.DELIVERYDATE) 
WHERE DH.YEAR = YEAR(SYSDATE);
COMMIT;

UPDATE WEIGHINGHISTORY WH SET WH.WEEK = GETISOWEEK(WH.WEIGHINGDATE) WHERE WH.YEAR = YEAR(SYSDATE);
COMMIT;

UPDATE PACKINGNOTE PN SET PN.WEEK = GETISOWEEK(PN.DELIVERYDATE) WHERE PN.YEAR = YEAR(SYSDATE);
COMMIT;


UPDATE SCAN S SET S.WEEK = GETISOWEEK(S.SCANTIMESTAMP) WHERE S.YEAR = YEAR(SYSDATE)
AND S.SCANTIMESTAMP >= SYSDATE - 14;
COMMIT;

UPDATE STATUSQUOHEADER SQ SET SQ.WEEK = GETISOWEEK(SQ.STATUSQUODATE) WHERE SQ.YEAR = YEAR(SYSDATE);
COMMIT;*/