Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
PFM-4409
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuldevgarg committed Oct 26, 2023
1 parent 93056b3 commit 6b026a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,14 @@ class ExpensesDetailsProvider with ChangeNotifier {
if(expenditureDetails.selectedVendor != null && (expenditureDetails.selectedVendor?.owner?.mobileNumber == null || expenditureDetails.selectedVendor!.owner!.mobileNumber.isEmpty)){
var mobileNumber = vendorList.firstWhere((vendor) => vendor.id == expenditureDetails.vendorId, orElse: () => Vendor('', '')).owner?.mobileNumber ?? '';
expenditureDetails.selectedVendor?.owner = Owner(mobileNumber);
if(expenditureDetails.mobileNumberController.text.isNotEmpty && expenditureDetails.mobileNumberController.text!=mobileNumber){
return true;
}
expenditureDetails.mobileNumberController.text = mobileNumber;
}
if(expenditureDetails.mobileNumberController.text.isEmpty){
return true;
}
return false;
}
else {
Expand Down
21 changes: 11 additions & 10 deletions frontend/mgramseva/lib/repository/expenses_repo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,17 @@ class ExpensesRepository extends BaseService {
));

if (res != null && res['vendor'] != null) {
var vendors = res['vendor'];
vendorList = [];
for (int i =0;i<vendors.length;i++){
if(vendors[i]!=null){
if(vendors[i]['owner']==null){
continue;
}
vendorList.add(Vendor.fromJson(vendors[i]));
}
}
vendorList =
res['vendor'].map<Vendor>((e) {
if(e!=null){
if(e['owner']==null){
e['owner']={
'mobileNumber':''
};
}
}
return Vendor.fromJson(e);
}).toList();
}
return vendorList;
}
Expand Down

0 comments on commit 6b026a5

Please sign in to comment.