diff --git a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js
index feb5e61ee..2deb1f15f 100644
--- a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js
+++ b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js
@@ -796,7 +796,7 @@ const FOIRequest = React.memo(({ userDetail }) => {
_status,
requestExtensions,
});
-
+
setRequestStatus(mappedBottomText);
};
@@ -1045,7 +1045,8 @@ const FOIRequest = React.memo(({ userDetail }) => {
- {bottomTextArray.length > 0 &&
+ {isOIPCReview && requestDetails.isreopened ? ""
+ : bottomTextArray.length > 0 &&
_requestStatus &&
_requestStatus.toLowerCase().includes("days") &&
bottomTextArray.map((text) => {
diff --git a/forms-flow-web/src/components/FOI/FOIRequest/OIPCDetails/OIPCItem.jsx b/forms-flow-web/src/components/FOI/FOIRequest/OIPCDetails/OIPCItem.jsx
index 1b10ef7a9..b70d30b71 100644
--- a/forms-flow-web/src/components/FOI/FOIRequest/OIPCDetails/OIPCItem.jsx
+++ b/forms-flow-web/src/components/FOI/FOIRequest/OIPCDetails/OIPCItem.jsx
@@ -183,7 +183,7 @@ const OIPCItem = (props) => {
InputLabelProps={{ shrink: true }}
InputProps={{inputProps: { max: formatDate(new Date())} }}
type="date"
- error={(!oipc.outcomeid || oipc.outcomeid === 5) && oipc.receiveddate === null}
+ error={(!oipc.outcomeid || oipc.outcomeid === 5) && oipc.receiveddate === null || oipc.receiveddate === ""}
required
disabled={oipc.outcomeid && oipc.outcomeid !== 5}
/>
@@ -367,6 +367,8 @@ const OIPCItem = (props) => {
InputLabelProps={{ shrink: true }}
InputProps={{inputProps: { min: oipc.receiveddate ? formatDate(new Date(oipc.receiveddate)) : null } }}
type="date"
+ error={oipc.inquiryattributes.orderno ? (!oipc.outcomeid || oipc.outcomeid === 5) && oipc.inquiryattributes.inquirydate === null || oipc.inquiryattributes.inquirydate === "" : false}
+ required={oipc.inquiryattributes.orderno}
disabled={oipc.outcomeid && oipc.outcomeid !== 5}
/>
@@ -378,6 +380,8 @@ const OIPCItem = (props) => {
value={oipc.inquiryattributes.orderno}
onChange = {(event) => handleInquiryFields(event.target.value, "ORDERNO")}
InputLabelProps={{ shrink: true }}
+ error={oipc.inquiryattributes.inquirydate ? (!oipc.outcomeid || oipc.outcomeid === 5) && oipc.inquiryattributes.orderno === "" : false}
+ required={oipc.inquiryattributes.inquirydate}
disabled={oipc.outcomeid && oipc.outcomeid !== 5}
placeholder="Order Number"
/>
diff --git a/forms-flow-web/src/components/FOI/FOIRequest/utils.js b/forms-flow-web/src/components/FOI/FOIRequest/utils.js
index 486ae82f3..dc5c8abeb 100644
--- a/forms-flow-web/src/components/FOI/FOIRequest/utils.js
+++ b/forms-flow-web/src/components/FOI/FOIRequest/utils.js
@@ -349,7 +349,13 @@ export const checkValidationError = (
!requiredRequestDetailsValues.requestStartDate ||
!requiredAxisDetails.axisRequestId ||
(oipcData?.length > 0 && isOipcReview && oipcData?.some((oipc) => {
- return oipc.oipcno === "" || oipc.receiveddate === null || oipc.receiveddate === "" || oipc.reviewtypeid === null || oipc.reasonid === null || oipc.statusid === null;
+ if (oipc.inquiryattributes?.inquirydate) {
+ return oipc.inquiryattributes.orderno === "";
+ }
+ if (oipc.inquiryattributes?.orderno) {
+ return oipc.inquiryattributes?.inquirydate === null || oipc.inquiryattributes?.inquirydate === "";
+ }
+ return oipc.oipcno === "" || oipc.receiveddate === null || oipc.receiveddate === "" || oipc.reviewtypeid === null || oipc.reasonid === null || oipc.statusid === null;
}))
);
};
diff --git a/request-management-api/request_api/services/foirequest/requestservicegetter.py b/request-management-api/request_api/services/foirequest/requestservicegetter.py
index 78181e224..6588bdb9f 100644
--- a/request-management-api/request_api/services/foirequest/requestservicegetter.py
+++ b/request-management-api/request_api/services/foirequest/requestservicegetter.py
@@ -168,6 +168,7 @@ def __preparebaseinfo(self,request,foiministryrequestid,requestministry,requestm
'selectedMinistries':[{'code':requestministry['programarea.bcgovcode'],'id':requestministry['foiministryrequestid'],'name':requestministry['programarea.name'],'selected':'true'}],
'divisions': self.getdivisions(requestministrydivisions),
'isoipcreview': requestministry['isoipcreview'],
+ 'isreopened': self.hasreopened(foiministryrequestid),
'oipcdetails': self.getoipcdetails(foiministryrequestid, requestministry['version']),
'onholdTransitionDate': self.getonholdtransition(foiministryrequestid),
'stateTransition': FOIMinistryRequest.getstatesummary(foiministryrequestid),
@@ -268,6 +269,14 @@ def getministryrequest(self, foiministryrequestid):
def __genericdateformat(self):
return '%Y-%m-%d'
+ def hasreopened(self, requestid):
+ states = FOIMinistryRequest.getstatesummary(requestid)
+ if len(states) > 0:
+ current_state = states[0]
+ if current_state != "Closed" and any(state['status'] == "Closed" for state in states):
+ return True
+ return False
+
def __prepareapplicant(self,firstname= None, middlename= None, lastname= None, businessname= None):
return {
'firstName': firstname,
diff --git a/request-management-api/request_api/services/requestservice.py b/request-management-api/request_api/services/requestservice.py
index 83d6bf039..99248b3d9 100644
--- a/request-management-api/request_api/services/requestservice.py
+++ b/request-management-api/request_api/services/requestservice.py
@@ -139,10 +139,14 @@ def calculateduedate(self, ministryrequestid, foirequest, paymentdate):
def __skipduedatecalculation(self, ministryrequestid, offholddate):
previousoffholddate = FOIMinistryRequest.getlastoffholddate(ministryrequestid)
+ foiministry_request = FOIMinistryRequest.getrequest(ministryrequestid)
+ request_reopened = self.__hasreopened(ministryrequestid, "ministryrequest")
if previousoffholddate not in (None, ''):
previouspaymentdate_pst = datetimehandler().convert_to_pst(previousoffholddate)
if datetimehandler().getdate(previouspaymentdate_pst).date() == datetimehandler().getdate(offholddate).date():
return True
+ if foiministry_request['isoipcreview'] == True and request_reopened:
+ return True
return False
def __isincludeoffhold(self):
@@ -165,4 +169,14 @@ def saverestrictedrequest(self,ministryrequestid,type, isrestricted,userid):
version = FOIMinistryRequest.getversionforrequest(ministryrequestid)
FOIRestrictedMinistryRequest.disablerestrictedrequests(ministryrequestid,type,userid)
return FOIRestrictedMinistryRequest.saverestrictedrequest(ministryrequestid,type,isrestricted, version, userid)
-
+
+ def __hasreopened(self, requestid, requesttype):
+ if requesttype == "rawrequest":
+ states = FOIRawRequest.getstatesummary(requestid)
+ else:
+ states = FOIMinistryRequest.getstatesummary(requestid)
+ if len(states) > 0:
+ current_state = states[0]
+ if current_state != "Closed" and any(state['status'] == "Closed" for state in states):
+ return True
+ return False