kaafil-react-uikit 0.11.7 → 0.11.8
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 +27 -0
- package/dist/manager/index.cjs +31 -1
- package/dist/manager/index.cjs.map +1 -1
- package/dist/manager/index.js +31 -1
- package/dist/manager/index.js.map +1 -1
- package/package.json +1 -1
package/dist/manager/index.js
CHANGED
|
@@ -6042,7 +6042,37 @@ function ReadyManagerMoneySection({
|
|
|
6042
6042
|
issuedMinor: floatRow.issuedMinor,
|
|
6043
6043
|
currency: floatRow.currency
|
|
6044
6044
|
} : void 0,
|
|
6045
|
-
spend:
|
|
6045
|
+
spend: (
|
|
6046
|
+
/*
|
|
6047
|
+
* THE SERVER'S OWN ROLLUP FIRST, the local sum only as a fallback.
|
|
6048
|
+
*
|
|
6049
|
+
* This summed `active` — the snapshot-backed rows — and nothing
|
|
6050
|
+
* else. `useExpenses` deliberately enqueues its writes WITHOUT an
|
|
6051
|
+
* optimistic row (its own DECISION comment: a fabricated
|
|
6052
|
+
* `ExpenseResponse` would have to guess `floatMovementId`,
|
|
6053
|
+
* `receiptRequired` and the negative-float guard, none of which a
|
|
6054
|
+
* client can compute). That decision is right, and its consequence
|
|
6055
|
+
* is that a freshly logged expense is absent from `expenses[]` until
|
|
6056
|
+
* a pull brings it down — so this tile read ₹0 with the money
|
|
6057
|
+
* already spent, on the one screen a manager checks it on.
|
|
6058
|
+
*
|
|
6059
|
+
* `totals.spendTotalMinor` is the server's own spend rollup and the
|
|
6060
|
+
* hook already re-reads it on every `sync.drained`, so it reflects
|
|
6061
|
+
* the write as soon as the queue reaches the server. Using it here
|
|
6062
|
+
* is also simply more correct than summing whichever rows this
|
|
6063
|
+
* device happens to hold.
|
|
6064
|
+
*
|
|
6065
|
+
* The local sum stays as the fallback rather than the primary. Its
|
|
6066
|
+
* own doc says `spendTotalMinor` is `undefined` until a read lands
|
|
6067
|
+
* and must never be drawn as zero — offline, where that read cannot
|
|
6068
|
+
* happen, a sum of the rows actually held is the honest answer, and
|
|
6069
|
+
* it is what offline-first means here.
|
|
6070
|
+
*/
|
|
6071
|
+
expensesReady !== void 0 ? {
|
|
6072
|
+
amountMinor: expensesReady.totals.spendTotalMinor ?? sumSpendMinor(active),
|
|
6073
|
+
currency
|
|
6074
|
+
} : void 0
|
|
6075
|
+
),
|
|
6046
6076
|
collect: collectionsReady !== void 0 ? {
|
|
6047
6077
|
amountMinor: balancesDueRows.reduce((sum, row) => sum + row.outstandingMinor, 0),
|
|
6048
6078
|
travellerCount: balancesDueRows.length,
|