nodebb-plugin-onekite-calendar 2.0.26 → 2.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog – calendar-onekite
2
2
 
3
+ ## 1.3.22
4
+ - ACP / Comptabilisation : le nombre de **sorties gratuites** correspond maintenant au **nombre de matériels sortis** (une réservation pouvant contenir plusieurs matériels).
5
+
3
6
  ## 1.3.21
4
7
  - Comptabilisation : les **sorties gratuites annulées** ne sont plus comptées (elles sont exclues si `cancelledAt` est présent, même si le statut est resté `paid`).
5
8
 
package/lib/admin.js CHANGED
@@ -530,7 +530,9 @@ admin.getAccounting = async function (req, res) {
530
530
  const endDate = formatFR(r.end);
531
531
 
532
532
  if (isFree) {
533
- freeCount += 1;
533
+ // In accounting, "Sorties gratuites" should reflect the number of items actually taken out,
534
+ // not the number of reservation lines (a single reservation can include multiple items).
535
+ freeCount += Math.max(1, itemNames.length || 0);
534
536
  } else {
535
537
  paidCount += 1;
536
538
  grandTotal += total;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-onekite-calendar",
3
- "version": "2.0.26",
3
+ "version": "2.0.27",
4
4
  "description": "FullCalendar-based equipment reservation workflow with admin approval & HelloAsso payment for NodeBB",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
package/plugin.json CHANGED
@@ -39,5 +39,5 @@
39
39
  "acpScripts": [
40
40
  "public/admin.js"
41
41
  ],
42
- "version": "2.0.26"
42
+ "version": "2.0.27"
43
43
  }