Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/misdwss/punjab-mgramseva
Browse files Browse the repository at this point in the history
…into develop-v1.2
  • Loading branch information
Ramkrishna-egov committed Sep 14, 2022
2 parents ace3450 + 9fc0fdf commit 631db5e
Show file tree
Hide file tree
Showing 38 changed files with 748 additions and 153 deletions.
5 changes: 5 additions & 0 deletions business-services/billing-service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

All notable changes to this module will be documented in this file.

## 1.4.0 - 2022-09-13
- Allowing the creation of bills for advance amount
- Adding a new api to get the demand audit history
- Updating the demand search api to filter for active demands

## 1.3.6 - 2022-04-19
- Allowing payment for employee as well

Expand Down
2 changes: 1 addition & 1 deletion business-services/billing-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</parent>
<groupId>com.egov.demand</groupId>
<artifactId>billing-service</artifactId>
<version>1.3.6-SNAPSHOT</version>
<version>1.4.0-SNAPSHOT</version>
<name>billing-service</name>
<description>Demo project for Spring Boot</description>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ import '../../widgets/CustomDetails.dart';

class NewConsumerBill extends StatefulWidget {
final String? mode;
final String? status;
final WaterConnection? waterConnection;
final List<Demands> demandList;

const NewConsumerBill(this.mode, this.waterConnection, this.demandList);
const NewConsumerBill(this.mode, this.status, this.waterConnection, this.demandList);
@override
State<StatefulWidget> createState() {
return NewConsumerBillState();
Expand Down Expand Up @@ -410,7 +411,8 @@ class NewConsumerBillState extends State<NewConsumerBill> {
'businessService': bill.first.businessService,
'tenantId': commonProvider.userDetails?.selectedtenant?.code,
'demandList' : widget.demandList,
'fetchBill' : bill
'fetchBill' : bill,
'status': widget.status
};
Navigator.pushNamed(context, Routes.HOUSEHOLD_DETAILS_COLLECT_PAYMENT,
arguments: query);
Expand Down
59 changes: 31 additions & 28 deletions frontend/mgramseva/lib/providers/collect_payment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,35 +84,38 @@ class CollectPaymentProvider with ChangeNotifier {
}
}

if(updateDemandList == null) {
var demand = await BillingServiceRepository().fetchUpdateDemand({
"tenantId": query['tenantId'],
"consumerCodes": query['consumerCode'],
"isGetPenaltyEstimate": "true"
},
{
"GetBillCriteria": {
"tenantId": query['tenantId'],
"billId": null,
"isGetPenaltyEstimate": true,
"consumerCodes": [query['consumerCode']]
}
});
updateDemandList = demand.demands;
updateDemand?.totalApplicablePenalty = demand.totalApplicablePenalty;
updateDemandList?.forEach((e){
e.totalApplicablePenalty = demand.totalApplicablePenalty;
});


if (updateDemandList != null && updateDemandList.length > 0) {
updateDemandList.sort((a, b) =>
b
.demandDetails!.first.auditDetails!.createdTime!
.compareTo(
a.demandDetails!.first.auditDetails!.createdTime!));
if (query['status'] != Constants.CONNECTION_STATUS.first){
if (updateDemandList == null) {
var demand = await BillingServiceRepository().fetchUpdateDemand({
"tenantId": query['tenantId'],
"consumerCodes": query['consumerCode'],
"isGetPenaltyEstimate": "true"
},
{
"GetBillCriteria": {
"tenantId": query['tenantId'],
"billId": null,
"isGetPenaltyEstimate": true,
"consumerCodes": [query['consumerCode']]
}
});
updateDemandList = demand.demands;
updateDemand?.totalApplicablePenalty = demand.totalApplicablePenalty;
updateDemandList?.forEach((e) {
e.totalApplicablePenalty = demand.totalApplicablePenalty;
});


if (updateDemandList != null && updateDemandList.length > 0) {
updateDemandList.sort((a, b) =>
b
.demandDetails!.first.auditDetails!.createdTime!
.compareTo(
a.demandDetails!.first.auditDetails!.createdTime!));
}
}
}
}
else{}

if (paymentDetails != null) {
if(mdmsData == null){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,12 @@ class ConsumerProvider with ChangeNotifier {
property.address.geoLocation?.latitude = null;
property.address.geoLocation?.longitude = null;
property.source = 'WS';
if(waterconnection.status == 'Inactive'){
waterconnection.paymentType = null;
waterconnection.penalty = null;
waterconnection.arrears = null;
waterconnection.advance = null;
}
var result1 =
await ConsumerRepository().updateProperty(property.toJson());
var result2 = await ConsumerRepository()
Expand Down
67 changes: 36 additions & 31 deletions frontend/mgramseva/lib/providers/household_details_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:mgramseva/utils/error_logging.dart';
import 'package:mgramseva/utils/global_variables.dart';
import 'package:provider/provider.dart';

import '../utils/constants.dart';
import 'common_provider.dart';
import 'fetch_bill_provider.dart';

Expand Down Expand Up @@ -49,7 +50,7 @@ class HouseHoldProvider with ChangeNotifier {
}
}

Future<void> fetchDemand(data,List<UpdateDemands>? demandList, [String? id]) async {
Future<void> fetchDemand(data,List<UpdateDemands>? demandList, [String? id, String? status]) async {
var commonProvider = Provider.of<CommonProvider>(
navigatorKey.currentContext!,
listen: false);
Expand All @@ -72,40 +73,44 @@ class HouseHoldProvider with ChangeNotifier {

waterConnection?.mdmsData = await CommonProvider.getMdmsBillingService();

if(demandList == null) {
var demand = await BillingServiceRepository().fetchUpdateDemand({
"tenantId": data.tenantId,
"consumerCodes": data.connectionNo.toString(),
"isGetPenaltyEstimate": "true"
},
{
"GetBillCriteria": {
"tenantId": data.tenantId,
"billId": null,
"isGetPenaltyEstimate": true,
"consumerCodes": [data.connectionNo.toString()]
}
});

demandList = demand.demands;
updateDemandList?.totalApplicablePenalty = demand.totalApplicablePenalty;
demandList?.forEach((e){
e.totalApplicablePenalty = demand.totalApplicablePenalty;
});

if(status != Constants.CONNECTION_STATUS.first) {
if (demandList == null) {
var demand = await BillingServiceRepository().fetchUpdateDemand({
"tenantId": data.tenantId,
"consumerCodes": data.connectionNo.toString(),
"isGetPenaltyEstimate": "true"
},
{
"GetBillCriteria": {
"tenantId": data.tenantId,
"billId": null,
"isGetPenaltyEstimate": true,
"consumerCodes": [data.connectionNo.toString()]
}
});

demandList = demand.demands;
updateDemandList?.totalApplicablePenalty =
demand.totalApplicablePenalty;
demandList?.forEach((e) {
e.totalApplicablePenalty = demand.totalApplicablePenalty;
});


if (demandList != null && demandList.length > 0) {
demandList.sort((a, b) =>
b
.demandDetails!.first.auditDetails!.createdTime!
.compareTo(
a.demandDetails!.first.auditDetails!.createdTime!));
if (demandList != null && demandList.length > 0) {
demandList.sort((a, b) =>
b
.demandDetails!.first.auditDetails!.createdTime!
.compareTo(
a.demandDetails!.first.auditDetails!.createdTime!));
}
}
demandList = demandList?.where((element) => element.status != 'CANCELLED')
.toList();
waterConnection?.demands = demandList;
updateDemandList?.demands = demandList;
}
demandList = demandList?.where((element) => element.status != 'CANCELLED').toList();
waterConnection?.demands = demandList;
updateDemandList?.demands = demandList;
else{}

try {
await BillingServiceRepository().fetchdDemand({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class HouseholdRegisterProvider with ChangeNotifier {
var waterConnection = waterConnectionsDetails?.waterConnection
?.firstWhere((element) => element.connectionNo == tableData.apiKey);
Navigator.pushNamed(navigatorKey.currentContext!, Routes.HOUSEHOLD_DETAILS,
arguments: {'waterconnections': waterConnection, 'mode': 'collect'});
arguments: {'waterconnections': waterConnection, 'mode': 'collect', 'status': waterConnection?.status});
}

onSort(TableHeader header) {
Expand Down
6 changes: 5 additions & 1 deletion frontend/mgramseva/lib/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,18 @@ class router {
case Routes.HOUSEHOLD_DETAILS:
String? id;
String? mode;
String? status;
if (settings.arguments != null) {
id = ((settings.arguments as Map)['waterconnections']
as WaterConnection)
.connectionNo;
mode = (settings.arguments as Map)['mode'];
status = (settings.arguments as Map)['status'];
} else {
if (queryValidator(Routes.HOUSEHOLD_DETAILS, query)) {
id = query['applicationNo'];
mode = query['mode'];
status = query['status'];
} else {
return pageNotAvailable;
}
Expand All @@ -277,13 +280,14 @@ class router {
builder: (_) => HouseholdDetail(
id: id,
mode: mode,
status: status,
waterconnection: settings.arguments != null
? (settings.arguments as Map)['waterconnections']
as WaterConnection
: null),
settings: RouteSettings(
name:
'${Routes.HOUSEHOLD_DETAILS}?applicationNo=$id&mode=$mode'));
'${Routes.HOUSEHOLD_DETAILS}?applicationNo=$id&mode=$mode&status=$status'));

case Routes.DASHBOARD:
int? tabIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ class SearchConnectionDetailCard extends StatelessWidget {
"waterconnections": isNameSearch == true ? waterconnections
.waterConnectionData![index] : waterconnections
.waterConnection![index],
"mode": arguments['Mode']
"mode": arguments['Mode'],
"status": isNameSearch == true ? waterconnections
.waterConnectionData![index].status : waterconnections
.waterConnection![index].status
})),
SizedBox(
height: 8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import 'package:mgramseva/components/HouseConnectionandBill/ConsumerBillPayments
import 'package:mgramseva/components/HouseConnectionandBill/GenerateNewBill.dart';
import 'package:mgramseva/components/HouseConnectionandBill/HouseConnectionDetailCard.dart';
import 'package:mgramseva/components/HouseConnectionandBill/NewConsumerBill.dart';
import 'package:mgramseva/model/bill/billing.dart';
import 'package:mgramseva/model/common/demand.dart';
import 'package:mgramseva/model/connection/water_connection.dart';
import 'package:mgramseva/model/demand/demand_list.dart';
import 'package:mgramseva/model/demand/update_demand_list.dart';
import 'package:mgramseva/providers/household_details_provider.dart';
import 'package:mgramseva/routers/Routers.dart';
import 'package:mgramseva/utils/constants.dart';
Expand All @@ -26,9 +23,10 @@ import 'package:provider/provider.dart';
class HouseholdDetail extends StatefulWidget {
final String? id;
final String? mode;
final String? status;
final WaterConnection? waterconnection;

HouseholdDetail({Key? key, this.id, this.mode, this.waterconnection});
HouseholdDetail({Key? key, this.id, this.mode, this.status, this.waterconnection});
@override
State<StatefulWidget> createState() {
return _HouseholdDetailState();
Expand All @@ -44,7 +42,7 @@ class _HouseholdDetailState extends State<HouseholdDetail> {
afterViewBuild() {
Provider.of<HouseHoldProvider>(context, listen: false)
..isVisible = false
..fetchDemand(widget.waterconnection, widget.waterconnection?.demands, widget.id);
..fetchDemand(widget.waterconnection, widget.waterconnection?.demands, widget.id, widget.status);
}

buildDemandView(DemandList data) {
Expand Down Expand Up @@ -74,7 +72,7 @@ class _HouseholdDetailState extends State<HouseholdDetail> {
'Metered' &&
houseHoldProvider.isfirstdemand == false)
? Text("")
: NewConsumerBill(widget.mode, houseHoldProvider.waterConnection, data.demands!),
: NewConsumerBill(widget.mode,widget.status, houseHoldProvider.waterConnection, data.demands!),
ConsumerBillPayments(houseHoldProvider.waterConnection)
],
);
Expand Down
3 changes: 2 additions & 1 deletion frontend/mgramseva/lib/screeens/common/collect_payment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import '../../model/demand/update_demand_list.dart';
import '../../model/localization/language.dart';
import '../../providers/common_provider.dart';
import '../../utils/global_variables.dart';
import '../../utils/models.dart';
import '../../widgets/CustomDetails.dart';
import '../../widgets/customAppbar.dart';

Expand Down Expand Up @@ -238,7 +239,7 @@ class _ConnectionPaymentViewState extends State<ConnectionPaymentView> {
}

Widget _buildViewDetails(FetchBill fetchBill) {
var penalty = CommonProvider.getPenalty(fetchBill.updateDemandList ?? []);
var penalty = widget.query['status'] != Constants.CONNECTION_STATUS.first ? CommonProvider.getPenalty(fetchBill.updateDemandList ?? []) : Penalty(0.0, '0', false);
var isFirstDemand = CommonProvider.isFirstDemand(fetchBill.demandList ?? []);
List res = [];
num len = fetchBill.billDetails?.first.billAccountDetails?.length as num;
Expand Down
4 changes: 4 additions & 0 deletions municipal-services/echallan-calculator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this module will be documented in this file.

## 1.1.0 - 2022-09-13
- the referenceId of the eChallan object is mapped to consumerCode of billing-service and collection-service
- If referenceId is not passed in the request, it will get set to same as the challanNo

## 1.0.1 - 2022-02-02
- Updated to log4j2 version 2.17.1

Expand Down
2 changes: 1 addition & 1 deletion municipal-services/echallan-calculator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<groupId>org.egov</groupId>
<artifactId>echallan-calculator</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
<name>echallan-calculator</name>
<properties>
<java.version>1.8</java.version>
Expand Down
5 changes: 5 additions & 0 deletions municipal-services/echallan-services/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this module will be documented in this file.

## 1.2.0 - 2022-09-13

- the referenceId of the eChallan object is mapped to consumerCode of billing-service and collection-service
- If referenceId is not passed in the request, it will get set to same as the challanNo

## 1.1.2 - 2022-02-02

- Dashboard Screen enhancements
Expand Down
2 changes: 1 addition & 1 deletion municipal-services/echallan-services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<groupId>org.egov</groupId>
<artifactId>echallan-services</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<name>echallan-services</name>
<properties>
<java.version>1.8</java.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectM

@Value("${egov.today.collection.link}")
private String todayCollectionLink;



@Value("${billing.service.host}")
private String billingServiceHost;

@Value("${billing.service.search.bill.endpoint}")
private String billingServiceSearchBillEndpoint;


}
Loading

0 comments on commit 631db5e

Please sign in to comment.