corrected the payment proceed validation
This commit is contained in:
parent
68f17214fd
commit
214816ac0f
@ -197,8 +197,19 @@ class _ReimbursementBottomSheetState extends State<ReimbursementBottomSheet> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expenseTransactionDate != null &&
|
if (expenseTransactionDate != null && selectedDate != null) {
|
||||||
selectedDate.isBefore(expenseTransactionDate)) {
|
final normalizedSelected = DateTime(
|
||||||
|
selectedDate.year,
|
||||||
|
selectedDate.month,
|
||||||
|
selectedDate.day,
|
||||||
|
);
|
||||||
|
final normalizedTransaction = DateTime(
|
||||||
|
expenseTransactionDate.year,
|
||||||
|
expenseTransactionDate.month,
|
||||||
|
expenseTransactionDate.day,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (normalizedSelected.isBefore(normalizedTransaction)) {
|
||||||
showAppSnackbar(
|
showAppSnackbar(
|
||||||
title: "Invalid Date",
|
title: "Invalid Date",
|
||||||
message:
|
message:
|
||||||
@ -208,11 +219,11 @@ class _ReimbursementBottomSheetState extends State<ReimbursementBottomSheet> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final success = await widget.onSubmit(
|
final success = await widget.onSubmit(
|
||||||
comment: commentCtrl.text.trim(),
|
comment: commentCtrl.text.trim(),
|
||||||
reimburseTransactionId: txnCtrl.text
|
reimburseTransactionId: txnCtrl.text.trim(),
|
||||||
.trim(),
|
|
||||||
reimburseDate: dateStr.value,
|
reimburseDate: dateStr.value,
|
||||||
reimburseById: controller.selectedReimbursedBy.value!.id,
|
reimburseById: controller.selectedReimbursedBy.value!.id,
|
||||||
statusId: widget.statusId,
|
statusId: widget.statusId,
|
||||||
|
|||||||
@ -170,10 +170,11 @@ class _UpdatePaymentRequestWithReimbursementState
|
|||||||
dateStr.value.isEmpty ||
|
dateStr.value.isEmpty ||
|
||||||
baseAmountCtrl.text.trim().isEmpty ||
|
baseAmountCtrl.text.trim().isEmpty ||
|
||||||
taxAmountCtrl.text.trim().isEmpty ||
|
taxAmountCtrl.text.trim().isEmpty ||
|
||||||
commentCtrl.text.trim().isEmpty) {
|
commentCtrl.text.trim().isEmpty ||
|
||||||
|
controller.selectedReimbursedBy.value == null) {
|
||||||
showAppSnackbar(
|
showAppSnackbar(
|
||||||
title: "Incomplete",
|
title: "Incomplete",
|
||||||
message: "Please fill all mandatory fields",
|
message: "Please fill all mandatory fields, including 'Paid By'",
|
||||||
type: SnackbarType.warning,
|
type: SnackbarType.warning,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@ -233,7 +234,6 @@ class _UpdatePaymentRequestWithReimbursementState
|
|||||||
decoration: _inputDecoration("Enter transaction ID"),
|
decoration: _inputDecoration("Enter transaction ID"),
|
||||||
),
|
),
|
||||||
MySpacing.height(16),
|
MySpacing.height(16),
|
||||||
|
|
||||||
_requiredLabel("Transaction Date"),
|
_requiredLabel("Transaction Date"),
|
||||||
MySpacing.height(8),
|
MySpacing.height(8),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
@ -266,8 +266,7 @@ class _UpdatePaymentRequestWithReimbursementState
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
MySpacing.height(16),
|
MySpacing.height(16),
|
||||||
|
_requiredLabel("Paid By"),
|
||||||
MyText.labelMedium("Paid By (Optional)"),
|
|
||||||
MySpacing.height(8),
|
MySpacing.height(8),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: _showEmployeeList,
|
onTap: _showEmployeeList,
|
||||||
@ -294,7 +293,6 @@ class _UpdatePaymentRequestWithReimbursementState
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
MySpacing.height(16),
|
MySpacing.height(16),
|
||||||
|
|
||||||
_requiredLabel("Base Amount"),
|
_requiredLabel("Base Amount"),
|
||||||
MySpacing.height(8),
|
MySpacing.height(8),
|
||||||
TextField(
|
TextField(
|
||||||
@ -303,7 +301,6 @@ class _UpdatePaymentRequestWithReimbursementState
|
|||||||
decoration: _inputDecoration("Enter Base Amount"),
|
decoration: _inputDecoration("Enter Base Amount"),
|
||||||
),
|
),
|
||||||
MySpacing.height(16),
|
MySpacing.height(16),
|
||||||
|
|
||||||
_requiredLabel("GST Amount"),
|
_requiredLabel("GST Amount"),
|
||||||
MySpacing.height(8),
|
MySpacing.height(8),
|
||||||
TextField(
|
TextField(
|
||||||
@ -312,7 +309,6 @@ class _UpdatePaymentRequestWithReimbursementState
|
|||||||
decoration: _inputDecoration("Enter GST Amount"),
|
decoration: _inputDecoration("Enter GST Amount"),
|
||||||
),
|
),
|
||||||
MySpacing.height(16),
|
MySpacing.height(16),
|
||||||
|
|
||||||
MyText.labelMedium("TDS Percent"),
|
MyText.labelMedium("TDS Percent"),
|
||||||
MySpacing.height(8),
|
MySpacing.height(8),
|
||||||
TextField(
|
TextField(
|
||||||
@ -335,7 +331,6 @@ class _UpdatePaymentRequestWithReimbursementState
|
|||||||
color: Colors.grey.shade600,
|
color: Colors.grey.shade600,
|
||||||
),
|
),
|
||||||
MySpacing.height(16),
|
MySpacing.height(16),
|
||||||
|
|
||||||
Obx(() => Column(
|
Obx(() => Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@ -353,7 +348,6 @@ class _UpdatePaymentRequestWithReimbursementState
|
|||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
MySpacing.height(20),
|
MySpacing.height(20),
|
||||||
|
|
||||||
_requiredLabel("Comment"),
|
_requiredLabel("Comment"),
|
||||||
MySpacing.height(8),
|
MySpacing.height(8),
|
||||||
TextField(
|
TextField(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user