diff --git a/forms-flow-web/src/components/FOI/customComponents/Fees/Tabs/ApplicationFeeTab.tsx b/forms-flow-web/src/components/FOI/customComponents/Fees/Tabs/ApplicationFeeTab.tsx
index 56898ae59..3e4c35969 100644
--- a/forms-flow-web/src/components/FOI/customComponents/Fees/Tabs/ApplicationFeeTab.tsx
+++ b/forms-flow-web/src/components/FOI/customComponents/Fees/Tabs/ApplicationFeeTab.tsx
@@ -363,14 +363,15 @@ export const ApplicationFeeTab = ({
const uploadedReceiptsField = formData?.receipts.map((receipt: any) => {
if (receipt.isactive) {
return (
-
+
{
getReceiptFile(receipt?.receiptfilename, receipt?.receiptfilepath)}
}
>{receipt.receiptfilename ? receipt.receiptfilename : 'view online payment receipt'}
setFormData((values: any) => ({...values, ['receipts']: [...formData?.receipts.filter((r: any) => r.receiptfilename != receipt.receiptfilename), {...receipt, isactive: false}]}))}
>
diff --git a/forms-flow-web/src/components/FOI/customComponents/Fees/index.scss b/forms-flow-web/src/components/FOI/customComponents/Fees/index.scss
index aec8518b6..2f6975c35 100644
--- a/forms-flow-web/src/components/FOI/customComponents/Fees/index.scss
+++ b/forms-flow-web/src/components/FOI/customComponents/Fees/index.scss
@@ -178,6 +178,12 @@
font-size: 20px;
margin-top: 2px;
}
+ .receipt-link {
+ cursor: pointer;
+ }
+ .receipt-delete {
+ cursor: pointer;
+ }
}
@media (max-width: 1444px) {
diff --git a/forms-flow-web/src/components/FOI/customComponents/Fees/index.tsx b/forms-flow-web/src/components/FOI/customComponents/Fees/index.tsx
index 571c93aac..f97da7733 100644
--- a/forms-flow-web/src/components/FOI/customComponents/Fees/index.tsx
+++ b/forms-flow-web/src/components/FOI/customComponents/Fees/index.tsx
@@ -221,10 +221,15 @@ export const Fees = ({
}
const validateFields = () => {
- if (applicationFeeFormData?.paymentSource != 'creditcardonline') {
- if (applicationFeeFormData?.paymentDate == null || applicationFeeFormData?.paymentDate == '') return false;
- if (applicationFeeFormData?.amountPaid == 0) return false;
- if (applicationFeeFormData?.paymentSource == 'init') return false;
+ if (!_.isEqual(initialApplicationFeeFormData?.applicationFeeStatus, applicationFeeFormData?.applicationFeeStatus)) {
+ if (applicationFeeFormData?.applicationFeeStatus == 'na-ige' || applicationFeeFormData?.applicationFeeStatus == 'appfeeowing') return true;
+ if (applicationFeeFormData?.applicationFeeStatus == 'paid') {
+ if (applicationFeeFormData?.paymentSource != 'creditcardonline') {
+ if (applicationFeeFormData?.paymentDate == null || applicationFeeFormData?.paymentDate == '') return false;
+ if (applicationFeeFormData?.amountPaid == 0) return false;
+ if (applicationFeeFormData?.paymentSource == 'init') return false;
+ }
+ }
}
if (validateBalancePaymentMethod() || validateEstimatePaymentMethod()) {
return false;
@@ -245,10 +250,12 @@ export const Fees = ({
if (!validateApplicationFeeAmountPaid()) {
return false;
}
- if (!validateApplicationFeeRefundAmount() || !applicationFeeFormData?.refundDate) {
- return false;
+ if (!_.isEqual(initialApplicationFeeFormData?.refundAmount, applicationFeeFormData?.refundAmount) ||
+ !_.isEqual(initialApplicationFeeFormData?.refundDate, applicationFeeFormData?.refundDate)) {
+ if (!validateApplicationFeeRefundAmount() || !applicationFeeFormData?.refundDate) {
+ return false;
+ }
}
-
if (receiptFileUpload && receiptFileUpload.length > 0) return true;
return !_.isEqual(initialCFRFormData, CFRFormData) || !_.isEqual(initialApplicationFeeFormData, applicationFeeFormData);
diff --git a/request-management-api/request_api/services/applicationfeeservice.py b/request-management-api/request_api/services/applicationfeeservice.py
index 89b25042d..90418afbb 100644
--- a/request-management-api/request_api/services/applicationfeeservice.py
+++ b/request-management-api/request_api/services/applicationfeeservice.py
@@ -17,7 +17,7 @@ def saveapplicationfee(self, requestid, ministryrequestid, data, userid = 'syste
if result.success == True and applicationfeeservice().applicationfeestatushaschanged(requestid):
applicationfeeformevent().createfeestatuschangeevent(requestid, ministryrequestid, data, userid, username)
if result.success == True and applicationfeeservice().applicationfeerefundupdated(requestid):
- applicationfeeformevent().createfeerefundevent(requestid, ministryrequestid, applicationfee.refundamount, userid, username)
+ applicationfeeformevent().createfeerefundevent(requestid, ministryrequestid, data['refundamount'], userid, username)
return result
def getapplicationfee(self, requestid, ministryrequestid = None):
@@ -90,7 +90,7 @@ def __prepareapplicationfee(self, requestid, data={}, getprevious=True):
applicationfee.orderid = data.get('orderid', None)
applicationfee.transactionnumber = data.get('transactionnumber', None)
applicationfee.refundamount = data.get('refundamount', None)
- if data['refunddate'] and isinstance(data['refunddate'], str) and len(data['refunddate']) < 11 and data['refunddate'].count('-') == 2:
+ if 'refunddate' in data and isinstance(data['refunddate'], str) and len(data['refunddate']) < 11 and data['refunddate'].count('-') == 2:
parseddateobject = data['refunddate'].split('-')
datetime_object = datetime(int(parseddateobject[0]), int(parseddateobject[1]), int(parseddateobject[2]), 17, 0, 0)
applicationfee.refunddate = datetime_object