Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PFM-5577 #712

Merged
merged 2 commits into from
Feb 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ class BillGenerationProvider with ChangeNotifier {
billGenerateDetails.billYear = null;
selectedBillCycle = null;
billGenerateDetails.billCycle = null;
selectedBillPeriod = null;
notifyListeners();
}
void onChangeOfBillCycle(cycle) {
Expand Down Expand Up @@ -360,47 +361,48 @@ class BillGenerationProvider with ChangeNotifier {
navigatorKey.currentContext!,
listen: false);
var rate = rateProvider.wcBillingSlabs!.wCBillingSlabs!.where((element) => element.connectionType=='Non_Metered').toList();
showDialog(context: context, builder: (context)=>AlertDialog(
surfaceTintColor: Colors.white,
title: Text('${ApplicationLocalizations.of(context).translate(i18.common.CORE_CONFIRM)}'),
content: Container(
height: 370,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('${ApplicationLocalizations.of(context).translate(i18.demandGenerate.ARE_YOU_SURE_TO_GENERATE_DEMAND_FOR)} "${ApplicationLocalizations.of(context).translate(billGenerateDetails.serviceType!)}" ${ApplicationLocalizations.of(context).translate(i18.demandGenerate.WITH_MINIMUM_CHARGE_OF)} : '),
SizedBox(height: 10,),
FittedBox(
child: DataTable(
border: TableBorder.all(
if(selectedBillPeriod!=null){
showDialog(context: context, builder: (context)=>AlertDialog(
surfaceTintColor: Colors.white,
title: Text('${ApplicationLocalizations.of(context).translate(i18.common.CORE_CONFIRM)}'),
content: Container(
height: 370,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('${ApplicationLocalizations.of(context).translate(i18.demandGenerate.ARE_YOU_SURE_TO_GENERATE_DEMAND_FOR)} "${ApplicationLocalizations.of(context).translate(billGenerateDetails.serviceType!)}" ${ApplicationLocalizations.of(context).translate(i18.demandGenerate.WITH_MINIMUM_CHARGE_OF)} : '),
SizedBox(height: 10,),
FittedBox(
child: DataTable(
border: TableBorder.all(
width: 0.5, borderRadius: BorderRadius.all(Radius.circular(5)),
color: Colors.grey,), columns: [
DataColumn(
label: Text(
"${ApplicationLocalizations.of(context).translate(i18.searchWaterConnection.CONNECTION_TYPE)}",
style:
TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
)),
DataColumn(
label: Text(
"${ApplicationLocalizations.of(context).translate(i18.common.RATE_PERCENTAGE)}",
style:
TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
)),], rows: [
...rate.map((e) => DataRow(cells: [
DataCell(Text(
"${ApplicationLocalizations.of(context).translate("${e.buildingType}")}")),
DataCell(Text("${e.minimumCharge}"))
])).toList()
],),
color: Colors.grey,), columns: [
DataColumn(
label: Text(
"${ApplicationLocalizations.of(context).translate(i18.searchWaterConnection.CONNECTION_TYPE)}",
style:
TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
)),
DataColumn(
label: Text(
"${ApplicationLocalizations.of(context).translate(i18.common.RATE_PERCENTAGE)}",
style:
TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
)),], rows: [
...rate.map((e) => DataRow(cells: [
DataCell(Text(
"${ApplicationLocalizations.of(context).translate("${e.buildingType}")}")),
DataCell(Text("${e.minimumCharge}"))
])).toList()
],),
),
SizedBox(height: 10,),
Text('${ApplicationLocalizations.of(context).translate(i18.demandGenerate.NO_DEMAND_GEN_WITH_RATE_0)}'), //* Note : No Demand will be generated for the Service Type with rate set to 0.
],
),
SizedBox(height: 10,),
Text('${ApplicationLocalizations.of(context).translate(i18.demandGenerate.NO_DEMAND_GEN_WITH_RATE_0)}'), //* Note : No Demand will be generated for the Service Type with rate set to 0.
],
),
),
actions:
actions:
(rateProvider.wcBillingSlabs!.wCBillingSlabs!.where((element) => element.connectionType=='Non_Metered').length- rateProvider.wcBillingSlabs!.wCBillingSlabs!.where((element) => element.connectionType=='Non_Metered' && element.minimumCharge==0).length == 0 )
?
[TextButton(onPressed: (){
Expand Down Expand Up @@ -445,11 +447,14 @@ class BillGenerationProvider with ChangeNotifier {
}));
}
}, child: Text('${ApplicationLocalizations.of(context).translate(i18.common.YES)}')),
TextButton(onPressed: (){
Navigator.pop(context);
}, child: Text('${ApplicationLocalizations.of(context).translate(i18.common.NO)}')),]
,
));
TextButton(onPressed: (){
Navigator.pop(context);
}, child: Text('${ApplicationLocalizations.of(context).translate(i18.common.NO)}')),]
,
));
}else{
Notifiers.getToastMessage(context, '${ApplicationLocalizations.of(context).translate(i18.common.SELECT_BILLING_CYCLE)}', 'ERROR'); //Please select billing cycle
}
} else {
autoValidation = true;
notifyListeners();
Expand Down
Loading