billing - tune item description
MODIFY
src/assets/i18n/en.json
src/assets/i18n/en.json
{
"billing": {
"generatedUser": "Generated user for '{{email}}'",
- "chargingAtSiteArea": "Charging session: {{startDate}} at {startTime} - Energy Consumption: {{totalConsumption}} kWh at {{siteArea}} - Parking time: {{timeSpent}}",
- "chargingAtChargeBox": "Charging session: {{startDate}} at {{startTime}} - Energy Consumption: {{totalConsumption}} kWh at charging station {{chargeBox}} - Parking time: {{timeSpent}}",
- "chargingStopSiteArea": "Charging {{totalConsumption}} kWh at {{siteArea}} (finished at {{time}})",
- "chargingStopChargeBox": "Charging {{totalConsumption}} kWh at charging station {{chargeBox}} (finished at {{time}})"
+ "chargingAtSiteArea": "Charging session: {{sessionID}} - Start Date: {{startDate}} at {startTime} - Energy Consumption: {{totalConsumption}} kWh at {{siteAreaName}} - Parking time: {{timeSpent}}",
+ "chargingAtChargeBox": "Charging session: {{sessionID}} - Start Date: {{startDate}} at {{startTime}} - Energy Consumption: {{totalConsumption}} kWh at charging station {{chargeBoxID}} - Parking time: {{timeSpent}}",
+ "chargingStopSiteArea": "Charging {{totalConsumption}} kWh at {{siteAreaName}} (finished at {{stopTime}})",
+ "chargingStopChargeBox": "Charging {{totalConsumption}} kWh at charging station {{chargeBoxID}} (finished at {{stopTime}})"
},
"chargers": {
"chargeBoxSN": "Charge Box S/N",

MODIFY
src/assets/i18n/it.json
src/assets/i18n/it.json
{
"billing": {
"generatedUser": "Utenza generata per '{{email}}'",
- "chargingStopSiteArea": "Caricando {{totalConsumption}} kWh a {{siteArea}} (finito a {{time}})",
- "chargingStopChargeBox": "Caricando {{totalConsumption}} kWh alla stazione di ricarica {{chargeBox}} (finito a {{time}})"
+ "chargingAtSiteArea": "Charging session: {{sessionID}} - Start Date: {{startDate}} at {startTime} - Energy Consumption: {{totalConsumption}} kWh at {{siteAreaName}} - Parking time: {{timeSpent}}",
+ "chargingAtChargeBox": "Charging session: {{sessionID}} - Start Date: {{startDate}} at {{startTime}} - Energy Consumption: {{totalConsumption}} kWh at charging station {{chargeBoxID}} - Parking time: {{timeSpent}}",
+ "chargingStopSiteArea": "Caricando {{totalConsumption}} kWh a {{siteAreaName}} (finito a {{stopTime}})",
+ "chargingStopChargeBox": "Caricando {{totalConsumption}} kWh alla stazione di ricarica {{chargeBoxID}} (finito a {{stopTime}})"
},
"chargers": {
"chargeBoxSN": "Charge Box S/N",

MODIFY
src/integration/billing/stripe/StripeBillingIntegration.ts
src/integration/billing/stripe/StripeBillingIntegration.ts
@@ -985,6 +985,7 @@ export default class StripeBillingIntegration extends BillingIntegration {
private buildLineItemDescription(transaction: Transaction) {
const chargeBox = transaction.chargeBox;
const i18nManager = I18nManager.getInstanceForLocale(transaction.user.locale);
+ const sessionID = String(transaction?.id);
const startDate = i18nManager.formatDateTime(transaction.timestamp, 'DD/MM/YYYY');
const startTime = i18nManager.formatDateTime(transaction.timestamp, 'LTS');
const stopTime = i18nManager.formatDateTime(transaction.stop.timestamp, 'LTS');
@@ -999,13 +1000,14 @@ export default class StripeBillingIntegration extends BillingIntegration {
}
// Get the translated line item description
const description = i18nManager.translate(descriptionPattern, {
+ sessionID,
startDate,
startTime,
timeSpent,
totalConsumption: consumptionkWh,
- siteArea: chargeBox?.siteArea?.name,
- chargeBox: transaction?.chargeBoxID,
- time: stopTime,
+ siteAreaName: chargeBox?.siteArea?.name,
+ chargeBoxID: transaction?.chargeBoxID,
+ stopTime,
});
return description;
}

billing - tune item description