Handle no price in OCPI CDR
MODIFY
src/authorization/Authorizations.ts
src/authorization/Authorizations.ts
@@ -670,7 +670,6 @@ export default class Authorizations {
message: `Charging Station '${chargingStation.id}' is not assigned to a Site Area!`,
});
}
-
// Access Control Enabled?
if (!chargingStation.siteArea.accessControl) {
// No control

MODIFY
src/client/ocpi/CpoOCPIClient.ts
src/client/ocpi/CpoOCPIClient.ts
@@ -434,8 +434,8 @@ export default class CpoOCPIClient extends OCPIClient {
total_parking_time: transaction.stop.totalInactivitySecs,
total_time: transaction.stop.totalDurationSecs / 3600, // In hours
total_energy: transaction.stop.totalConsumptionWh / 1000,
- total_cost: transaction.stop.roundedPrice,
- currency: transaction.priceUnit,
+ total_cost: transaction.stop.roundedPrice > 0 ? transaction.stop.roundedPrice : 0,
+ currency: transaction.priceUnit ? transaction.priceUnit : '',
auth_id: transaction.ocpiData.session.auth_id,
authorization_id: transaction.ocpiData.session.authorization_id,
auth_method: transaction.ocpiData.session.auth_method,

MODIFY
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/CPOCdrsEndpoint.ts
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/CPOCdrsEndpoint.ts
@@ -10,8 +10,7 @@ import Tenant from '../../../../types/Tenant';
import Utils from '../../../../utils/Utils';
const EP_IDENTIFIER = 'cdrs';
-const MODULE_NAME = 'CPOSessionsEndpoint';
-
+const MODULE_NAME = 'CPOCdrsEndpoint';
const RECORDS_LIMIT = 25;
/**

Handle no price in OCPI CDR