LocationID updates

pull/317/head
haroon amjad 2 months ago
parent a9d085098f
commit f7d415b7eb

@ -14,11 +14,12 @@ class GetPharmacyInvoicesResponseModel {
String? doctorNameN; String? doctorNameN;
String? displayInvoiceNo; String? displayInvoiceNo;
String? clinicName; String? clinicName;
double? decimalDoctorRate; num? decimalDoctorRate;
String? doctorImageURL; String? doctorImageURL;
num? doctorRate; num? doctorRate;
num? patientNumber; num? patientNumber;
String? projectName; String? projectName;
dynamic locationID;
GetPharmacyInvoicesResponseModel( GetPharmacyInvoicesResponseModel(
{this.setupId, {this.setupId,
@ -40,7 +41,7 @@ class GetPharmacyInvoicesResponseModel {
this.doctorImageURL, this.doctorImageURL,
this.doctorRate, this.doctorRate,
this.patientNumber, this.patientNumber,
this.projectName}); this.projectName, this.locationID});
GetPharmacyInvoicesResponseModel.fromJson(Map<String, dynamic> json) { GetPharmacyInvoicesResponseModel.fromJson(Map<String, dynamic> json) {
setupId = json['SetupId']; setupId = json['SetupId'];
@ -63,6 +64,7 @@ class GetPharmacyInvoicesResponseModel {
doctorRate = json['DoctorRate']; doctorRate = json['DoctorRate'];
patientNumber = json['PatientNumber']; patientNumber = json['PatientNumber'];
projectName = json['ProjectName']; projectName = json['ProjectName'];
locationID = json['LocationId'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -87,6 +89,7 @@ class GetPharmacyInvoicesResponseModel {
data['DoctorRate'] = this.doctorRate; data['DoctorRate'] = this.doctorRate;
data['PatientNumber'] = this.patientNumber; data['PatientNumber'] = this.patientNumber;
data['ProjectName'] = this.projectName; data['ProjectName'] = this.projectName;
data['LocationId'] = this.locationID;
return data; return data;
} }
} }

@ -19,7 +19,7 @@ abstract class MyInvoicesRepo {
Future<Either<Failure, GenericApiModel<dynamic>>> downloadInvoice({required String setupId, required int invoiceNo, required int projectID}); Future<Either<Failure, GenericApiModel<dynamic>>> downloadInvoice({required String setupId, required int invoiceNo, required int projectID});
Future<Either<Failure, GenericApiModel<dynamic>>> downloadPharmacyInvoice({required String setupId, required int invoiceNo, required int projectID}); Future<Either<Failure, GenericApiModel<dynamic>>> downloadPharmacyInvoice({required String setupId, required int invoiceNo, required int projectID, required dynamic locationID});
} }
class MyInvoicesRepoImp implements MyInvoicesRepo { class MyInvoicesRepoImp implements MyInvoicesRepo {
@ -226,11 +226,12 @@ class MyInvoicesRepoImp implements MyInvoicesRepo {
} }
@override @override
Future<Either<Failure, GenericApiModel>> downloadPharmacyInvoice({required String setupId, required int invoiceNo, required int projectID}) async { Future<Either<Failure, GenericApiModel>> downloadPharmacyInvoice({required String setupId, required int invoiceNo, required int projectID, required dynamic locationID}) async {
Map<String, dynamic> mapDevice = { Map<String, dynamic> mapDevice = {
"SetupID": setupId, "SetupID": setupId,
"ProjectID": projectID, "ProjectID": projectID,
"InvoiceNo": invoiceNo, "InvoiceNo": invoiceNo,
"LocationID": locationID,
}; };
try { try {

@ -193,8 +193,8 @@ class MyInvoicesViewModel extends ChangeNotifier {
); );
} }
Future<void> downloadPharmacyInvoicePDF({required String setupId, required int invoiceNo, required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> downloadPharmacyInvoicePDF({required String setupId, required int invoiceNo, required int projectID, required dynamic locationID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myInvoicesRepo.downloadPharmacyInvoice(setupId: setupId, invoiceNo: invoiceNo, projectID: projectID); final result = await myInvoicesRepo.downloadPharmacyInvoice(setupId: setupId, invoiceNo: invoiceNo, projectID: projectID, locationID: locationID);
result.fold( result.fold(
(failure) async { (failure) async {

@ -51,8 +51,12 @@ class TodoSectionViewModel extends ChangeNotifier {
// if (apiResponse.messageStatus == 2) { // if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
// } else if (apiResponse.messageStatus == 1) { // } else if (apiResponse.messageStatus == 1) {
notificationsCount = if (apiResponse['List_PatientDashboard'] != null && apiResponse['List_PatientDashboard'] is List && (apiResponse['List_PatientDashboard'] as List).isNotEmpty) {
apiResponse['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : apiResponse['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); notificationsCount =
apiResponse['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : apiResponse['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
} else {
notificationsCount = "0";
}
notifyListeners(); notifyListeners();
if (onSuccess != null) { if (onSuccess != null) {
onSuccess(apiResponse); onSuccess(apiResponse);

@ -377,6 +377,7 @@ class _MyInvoicesListState extends State<MyInvoicesList> {
setupId: myInvoicesVM.allPharmacyInvoicesList[index].setupId ?? "", setupId: myInvoicesVM.allPharmacyInvoicesList[index].setupId ?? "",
invoiceNo: myInvoicesVM.allPharmacyInvoicesList[index].invoiceNo ?? 0, invoiceNo: myInvoicesVM.allPharmacyInvoicesList[index].invoiceNo ?? 0,
projectID: myInvoicesVM.allPharmacyInvoicesList[index].projectID ?? 0, projectID: myInvoicesVM.allPharmacyInvoicesList[index].projectID ?? 0,
locationID: myInvoicesVM.allPharmacyInvoicesList[index].locationID ?? 0,
onError: (err) { onError: (err) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(

Loading…
Cancel
Save