1"
diff --git a/src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts b/src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts
index e86bd119f1..c6d714ec0e 100644
--- a/src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts
+++ b/src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts
@@ -1693,7 +1693,13 @@ export class AddEditMileagePage implements OnInit {
);
this.fg.controls.commuteDeduction.valueChanges.subscribe((commuteDeductionType: string) => {
- this.updateDistanceOnDeductionChange(commuteDeductionType);
+ if (this.commuteDetails?.id) {
+ this.updateDistanceOnDeductionChange(commuteDeductionType);
+ } else {
+ if (!(commuteDeductionType === 'NO_DEDUCTION')) {
+ this.openCommuteDetailsModal();
+ }
+ }
});
this.fg.controls.route.valueChanges.pipe(distinctUntilKeyChanged('roundTrip')).subscribe(() => {
@@ -2998,6 +3004,9 @@ export class AddEditMileagePage implements OnInit {
this.fg.patchValue({ commuteDeduction: 'NO_DEDUCTION' });
this.showCommuteUpdatedPopover();
});
+ } else {
+ // If user closes the modal without saving the commute details, reset the commute deduction field to null
+ this.fg.patchValue({ commuteDeduction: null }, { emitEvent: false });
}
}
}
diff --git a/src/app/shared/components/fy-select-commute-details/fy-select-commute-details.component.html b/src/app/shared/components/fy-select-commute-details/fy-select-commute-details.component.html
index 6eb970035a..7492945a7b 100644
--- a/src/app/shared/components/fy-select-commute-details/fy-select-commute-details.component.html
+++ b/src/app/shared/components/fy-select-commute-details/fy-select-commute-details.component.html
@@ -1,5 +1,5 @@
-
+
diff --git a/src/app/shared/components/fy-select-commute-details/fy-select-commute-details.component.scss b/src/app/shared/components/fy-select-commute-details/fy-select-commute-details.component.scss
index 3660724b49..54fa8ff961 100644
--- a/src/app/shared/components/fy-select-commute-details/fy-select-commute-details.component.scss
+++ b/src/app/shared/components/fy-select-commute-details/fy-select-commute-details.component.scss
@@ -1,6 +1,10 @@
@import '../../../../theme/colors.scss';
.commute-details {
+ &--toolbar {
+ margin-top: calc(env(safe-area-inset-top));
+ }
+
&--header {
&-save {
--color: $brand-primary;
diff --git a/src/app/shared/components/route-selector/route-selector.component.html b/src/app/shared/components/route-selector/route-selector.component.html
index c046330784..a283ff2a8d 100644
--- a/src/app/shared/components/route-selector/route-selector.component.html
+++ b/src/app/shared/components/route-selector/route-selector.component.html
@@ -137,6 +137,8 @@
+
+