Don't compute extra inactivity when soft stop
MODIFY
src/server/ocpp/services/OCPPService.ts
src/server/ocpp/services/OCPPService.ts
@@ -490,7 +490,7 @@ export default class OCPPService {
// Signed Data
this.checkAndUpdateTransactionWithSignedDataInStopTransaction(transaction, stopTransaction);
// Update Transaction with Stop Transaction and Stop MeterValues
- OCPPUtils.updateTransactionWithStopTransaction(transaction, chargingStation, stopTransaction, user, alternateUser, tagID);
+ OCPPUtils.updateTransactionWithStopTransaction(transaction, chargingStation, stopTransaction, user, alternateUser, tagID, isSoftStop);
// Bill
await OCPPUtils.processTransactionBilling(tenant, transaction, TransactionAction.STOP);
// Roaming

MODIFY
src/server/ocpp/utils/OCPPUtils.ts
src/server/ocpp/utils/OCPPUtils.ts
@@ -572,7 +572,7 @@ export default class OCPPUtils {
}
public static updateTransactionWithStopTransaction(transaction: Transaction, chargingStation: ChargingStation,
- stopTransaction: OCPPStopTransactionRequestExtended, user: User, alternateUser: User, tagId: string): void {
+ stopTransaction: OCPPStopTransactionRequestExtended, user: User, alternateUser: User, tagId: string, isSoftStop: boolean): void {
// Set final data
transaction.stop = {
reason: stopTransaction.reason,
@@ -580,6 +580,8 @@ export default class OCPPUtils {
timestamp: Utils.convertToDate(stopTransaction.timestamp),
userID: (alternateUser ? alternateUser.id : (user ? user.id : null)),
tagID: tagId,
+ extraInactivityComputed: isSoftStop,
+ extraInactivitySecs: 0,
stateOfCharge: transaction.currentStateOfCharge,
signedData: transaction.currentSignedData ? transaction.currentSignedData : '',
totalConsumptionWh: transaction.currentTotalConsumptionWh,

Don't compute extra inactivity when soft stop