This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #605 from egovernments/PFM-4087-frontend
Pfm 4087 frontend
- Loading branch information
Showing
8 changed files
with
281 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
frontend/mgramseva/lib/model/reports/InactiveConsumerReportData.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class InactiveConsumerReportData { | ||
String? tenantName; | ||
String? connectionNo; | ||
String? status; | ||
num? inactiveDate; | ||
String? inactivatedByUuid; | ||
String? inactivatedByName; | ||
|
||
InactiveConsumerReportData(this.tenantName, this.connectionNo, this.status, | ||
this.inactiveDate, this.inactivatedByUuid, this.inactivatedByName); | ||
|
||
InactiveConsumerReportData.fromJson(Map<String, dynamic> json) { | ||
tenantName = json['tenantName']; | ||
connectionNo = json['connectionno']; | ||
status = json['status']; | ||
inactiveDate = json['inactiveDate']; | ||
inactivatedByUuid = json['inactivatedByUuid']; | ||
inactivatedByName = json['inactivatedByName']; | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
final Map<String, dynamic> data = new Map<String, dynamic>(); | ||
data['tenantName'] = this.tenantName; | ||
data['connectionno'] = this.connectionNo; | ||
data['status'] = this.status; | ||
data['inactiveDate'] = this.inactiveDate; | ||
data['inactivatedByUuid'] = this.inactivatedByUuid; | ||
data['inactivatedByName'] = this.inactivatedByName; | ||
return data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:mgramseva/model/common/BillsTableData.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
import '../../providers/reports_provider.dart'; | ||
import '../../utils/localization/application_localizations.dart'; | ||
|
||
import 'package:mgramseva/utils/constants/i18_key_constants.dart'; | ||
|
||
import '../../utils/notifiers.dart'; | ||
import '../../utils/testing_keys/testing_keys.dart'; | ||
import '../../widgets/button.dart'; | ||
import 'generic_report_table.dart'; | ||
|
||
class InactiveConsumerReport extends StatefulWidget { | ||
final Function onViewClick; | ||
|
||
InactiveConsumerReport({Key? key, required this.onViewClick}) : super(key: key); | ||
|
||
@override | ||
State<StatefulWidget> createState() { | ||
return _CollectionReport(); | ||
} | ||
} | ||
|
||
class _CollectionReport extends State<InactiveConsumerReport> | ||
with SingleTickerProviderStateMixin { | ||
@override | ||
Widget build(BuildContext context) { | ||
return LayoutBuilder(builder: (context, constraints) { | ||
return Consumer<ReportsProvider>(builder: (_, reportProvider, child) { | ||
return Container( | ||
margin: constraints.maxWidth > 700 | ||
? const EdgeInsets.only(top: 5.0, bottom: 5, right: 20, left: 10) | ||
: const EdgeInsets.only(top: 5.0, bottom: 5, right: 8, left: 8), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
children: [ | ||
SizedBox( | ||
height: 30, | ||
), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Row( | ||
children: [ | ||
Text("3. ", | ||
style: TextStyle( | ||
fontSize: 16, fontWeight: FontWeight.w700)), | ||
Text( | ||
ApplicationLocalizations.of(context) | ||
.translate(i18.dashboard.INACTIVE_CONSUMER_REPORT), | ||
style: TextStyle( | ||
fontSize: 16, fontWeight: FontWeight.w700)), | ||
], | ||
), | ||
Row( | ||
children: [ | ||
Container( | ||
width: 50, | ||
child: Button( | ||
"View", | ||
() { | ||
if (reportProvider.selectedBillPeriod == null) { | ||
Notifiers.getToastMessage( | ||
context, 'Select Billing Cycle', 'ERROR'); | ||
} else { | ||
reportProvider.clearTableData(); | ||
reportProvider.getInactiveConsumerReport(); | ||
widget.onViewClick( | ||
true, i18.dashboard.INACTIVE_CONSUMER_REPORT); | ||
} | ||
}, | ||
key: Keys.billReport.INACTIVE_CONSUMER_REPORT_VIEW_BUTTON, | ||
), | ||
), | ||
SizedBox( | ||
width: 10, | ||
), | ||
TextButton.icon( | ||
onPressed: () { | ||
if (reportProvider.selectedBillPeriod == null) { | ||
Notifiers.getToastMessage( | ||
context, 'Select Billing Cycle', 'ERROR'); | ||
} else { | ||
reportProvider.getInactiveConsumerReport( | ||
download: true); | ||
} | ||
}, | ||
icon: Icon(Icons.download_sharp), | ||
label: Text(ApplicationLocalizations.of(context) | ||
.translate(i18.common.CORE_DOWNLOAD))), | ||
], | ||
), | ||
], | ||
), | ||
], | ||
), | ||
); | ||
}); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters