diff --git a/frontend/mgramseva/lib/model/expenses_details/expenses_details.dart b/frontend/mgramseva/lib/model/expenses_details/expenses_details.dart index 4a30d571b..95c46ecc5 100644 --- a/frontend/mgramseva/lib/model/expenses_details/expenses_details.dart +++ b/frontend/mgramseva/lib/model/expenses_details/expenses_details.dart @@ -167,10 +167,10 @@ class ExpensesDetailsModel { expensesAmount?.first.amount ?? totalAmount?.toInt().toString() ?? ''; billDateCtrl.text = DateFormats.timeStampToDate(billDate); paidDateCtrl.text = - paidDate == 0 ? '' : DateFormats.timeStampToDate(paidDate); + paidDate == null || paidDate == 0 ? '' : DateFormats.timeStampToDate(paidDate); billIssuedDateCtrl.text = billIssuedDate == 0 ? '' : DateFormats.timeStampToDate(billIssuedDate); - isBillPaid ??= false; + isBillPaid = paidDate != null && paidDate != 0 ? isBillPaid : false; challanNumberCtrl.text = challanNo?.toString() ?? ''; fromDateCtrl.text = DateFormats.timeStampToDate(taxPeriodFrom); toDateCtrl.text = DateFormats.timeStampToDate(taxPeriodTo); @@ -179,7 +179,7 @@ class ExpensesDetailsModel { selectedVendor = Vendor(vendorName ?? '', vendorId ?? ''); } - if (isBillPaid!) { + if (isBillPaid! && paidDate != null && paidDate != 0) { allowEdit = false; } else { paidDateCtrl.text = '';