Linn Vat: {linnVat}
diff --git a/src/Service.Host/client/src/components/importBooks/ImportBook.js b/src/Service.Host/client/src/components/importBooks/ImportBook.js
index 86cb9a2b4..c454e6e3f 100644
--- a/src/Service.Host/client/src/components/importBooks/ImportBook.js
+++ b/src/Service.Host/client/src/components/importBooks/ImportBook.js
@@ -346,9 +346,7 @@ function ImportBook({
!state.impbook.totalImportValue ||
!state.impbook.deliveryTermCode ||
!state.impbook.pva ||
- !state.impbook.foreignCurrency ||
- `${calcRemainingTotal()}` !== '0' ||
- `${calcRemainingDuty()}` !== '0'
+ !state.impbook.foreignCurrency
);
};
@@ -357,6 +355,10 @@ function ImportBook({
const handleSaveClick = () => {
if (`${calcRemainingWeight()}` !== '0' && !dialogOpen) {
setDialogOpen(true);
+ } else if (`${calcRemainingTotal()}` !== '0' && !dialogOpen) {
+ setDialogOpen(true);
+ } else if (`${calcRemainingDuty()}` !== '0' && !dialogOpen) {
+ setDialogOpen(true);
} else if (creating()) {
addItem(state.impbook);
setEditStatus('view');
@@ -386,8 +388,54 @@ function ImportBook({
textAlign: 'center'
}
}));
+
const classes = useStyles();
+ const ImportValueMismatchWarning = () => {
+ if (`${calcRemainingTotal()}` !== '0') {
+ return (
+
+
+ Import Value Mismatch! Difference of: {calcRemainingTotal()}
+
+ (Import Book value is: {state.impbook?.totalImportValue})
+
+
+ );
+ }
+ return <>>;
+ };
+
+ const DutyMismatchWarning = () => {
+ if (`${calcRemainingDuty()}` !== '0') {
+ return (
+
+
+ Duty Mismatch! Difference of: {calcRemainingDuty()}
+
+ (Import Book tab duty is: {state.impbook?.linnDuty})
+
+
+ );
+ }
+ return <>>;
+ };
+
+ const WeightMismatchWarning = () => {
+ if (`${calcRemainingWeight()}` !== '0') {
+ return (
+
+
+ Weight Mismatch! Difference of: {calcRemainingWeight()}
+
+ (Import Book tab weight is: {state.impbook?.weight})
+
+
+ );
+ }
+ return <>>;
+ };
+
return (
<>
@@ -440,13 +488,9 @@ function ImportBook({
Warning
-
-
- Weight Mismatch! Difference of: {calcRemainingWeight()}
-
- (Import Book tab weight is: {state.impbook?.weight})
-
-
+
+
+