@tallyui/components 3.5.1 → 3.5.2

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/dist/index.js CHANGED
@@ -5064,11 +5064,11 @@ function Receipt({
5064
5064
  receipt.currency
5065
5065
  )} off`, `\u2212${money(discount.amountMinor)}`) }, i))
5066
5066
  ] }, index)),
5067
- receipt.fees.map((charge, index) => row(charge.name, money(charge.amountMinor), false, index)),
5068
- receipt.shipping.map((charge, index) => row(charge.name, money(charge.amountMinor), false, index)),
5069
5067
  row("Subtotal", money(totals.subtotalMinor)),
5070
5068
  lineDiscountMinor > 0 ? row("Line discounts", `\u2212${money(lineDiscountMinor)}`) : null,
5071
5069
  receipt.orderDiscountMinor > 0 ? row("Order discount", `\u2212${money(receipt.orderDiscountMinor)}`) : null,
5070
+ receipt.fees.map((charge, index) => row(charge.name, money(charge.amountMinor), false, index)),
5071
+ receipt.shipping.map((charge, index) => row(charge.name, money(charge.amountMinor), false, index)),
5072
5072
  taxRows,
5073
5073
  row("Total", money(totals.totalMinor), true),
5074
5074
  receipt.payments.map((payment, index) => row(
@@ -5277,7 +5277,7 @@ function OrdersList({ orders, onRetry, formatDate = defaultFormatDate2, footer,
5277
5277
  setRetryingIds(new Set(retrying.current));
5278
5278
  }
5279
5279
  }, className: "rounded-md bg-primary px-4 py-2", children: /* @__PURE__ */ jsx100(Text43, { className: "text-center font-semibold text-primary-foreground", children: "Retry" }) }) : null,
5280
- knownWarnings(order.warnings).map((warning, index) => /* @__PURE__ */ jsx100(View65, { className: "border-l-4 border-warning pl-2", children: /* @__PURE__ */ jsx100(Text43, { className: "text-foreground", children: warning.code === "insufficient_stock" ? `Stock short by ${warning.quantity} for ${order.lines.find((line) => line.variantId === warning.variantId)?.name}` : warning.code === "tax_rate_mismatch" ? `Tax at ${(warning.ratePpm / 1e4).toLocaleString(void 0, { maximumFractionDigits: 4 })}%: store ${formatMoney17({ amount: warning.serverMinor, currency: order.currency })} vs POS ${formatMoney17({ amount: warning.expectedMinor, currency: order.currency })}` : warning.code === "customer_ignored" ? `The online store didn't recognise the customer on this sale, so it was saved as a guest sale. Customer id: ${warning.customerId}.` : warning.code === "figures_mismatch" ? `The online store worked out different figures for this sale. ${warning.fields.map(({ field, tillMinor, serverMinor }) => `${FIGURE_LABELS.get(field) ?? field}: till ${formatMoney17({ amount: tillMinor, currency: order.currency })}, store ${formatMoney17({ amount: serverMinor, currency: order.currency })}.`).join(" ")}` : warning.bridgeMinor !== void 0 ? `Store calculated ${formatMoney17({ amount: warning.serverMinor, currency: order.currency })}; a rounding line of ${warning.bridgeMinor > 0 ? "+" : ""}${formatMoney17({ amount: warning.bridgeMinor, currency: order.currency })} brought it to ${formatMoney17({ amount: warning.expectedMinor, currency: order.currency })}` : `Store total ${formatMoney17({ amount: warning.serverMinor, currency: order.currency })} vs POS ${formatMoney17({ amount: warning.expectedMinor, currency: order.currency })}` }) }, index))
5280
+ knownWarnings(order.warnings).map((warning, index) => /* @__PURE__ */ jsx100(View65, { className: "border-l-4 border-warning pl-2", children: /* @__PURE__ */ jsx100(Text43, { className: "text-foreground", children: warning.code === "insufficient_stock" ? `${warning.quantity} sold without stock: ${order.lines.find((line) => line.variantId === warning.variantId)?.name}` : warning.code === "tax_rate_mismatch" ? `Tax at ${(warning.ratePpm / 1e4).toLocaleString(void 0, { maximumFractionDigits: 4 })}%: store ${formatMoney17({ amount: warning.serverMinor, currency: order.currency })} vs POS ${formatMoney17({ amount: warning.expectedMinor, currency: order.currency })}` : warning.code === "customer_ignored" ? `The online store didn't recognise the customer on this sale, so it was saved as a guest sale. Customer id: ${warning.customerId}.` : warning.code === "figures_mismatch" ? `The online store worked out different figures for this sale. ${warning.fields.map(({ field, tillMinor, serverMinor }) => `${FIGURE_LABELS.get(field) ?? field}: till ${formatMoney17({ amount: tillMinor, currency: order.currency })}, store ${formatMoney17({ amount: serverMinor, currency: order.currency })}.`).join(" ")}` : warning.bridgeMinor !== void 0 ? `Store calculated ${formatMoney17({ amount: warning.serverMinor, currency: order.currency })}; a rounding line of ${warning.bridgeMinor > 0 ? "+" : ""}${formatMoney17({ amount: warning.bridgeMinor, currency: order.currency })} brought it to ${formatMoney17({ amount: warning.expectedMinor, currency: order.currency })}` : `Store total ${formatMoney17({ amount: warning.serverMinor, currency: order.currency })} vs POS ${formatMoney17({ amount: warning.expectedMinor, currency: order.currency })}` }) }, index))
5281
5281
  ] }, order.id);
5282
5282
  })
5283
5283
  ] }, section.title)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tallyui/components",
3
- "version": "3.5.1",
3
+ "version": "3.5.2",
4
4
  "type": "module",
5
5
  "description": "Universal POS UI components for Tally UI",
6
6
  "main": "./dist/index.js",
@@ -27,22 +27,22 @@
27
27
  "directory": "packages/components"
28
28
  },
29
29
  "peerDependencies": {
30
- "@tallyui/core": "^3.5.1",
31
- "@tallyui/primitives": "^3.5.1",
32
- "@tallyui/theme": "^3.5.1",
30
+ "@tallyui/core": "^3.5.2",
31
+ "@tallyui/primitives": "^3.5.2",
32
+ "@tallyui/theme": "^3.5.2",
33
33
  "react": ">=18",
34
34
  "react-native": ">=0.74",
35
35
  "react-native-svg": ">=15"
36
36
  },
37
37
  "dependencies": {
38
38
  "class-variance-authority": "^0.7.1",
39
- "@tallyui/pos": "3.5.1"
39
+ "@tallyui/pos": "3.5.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@tallyui/connector-medusa": "3.5.1",
43
- "@tallyui/connector-vendure": "3.5.1",
44
- "@tallyui/connector-woocommerce": "3.5.1",
45
- "@tallyui/mock-api": "3.5.1",
42
+ "@tallyui/connector-medusa": "3.5.2",
43
+ "@tallyui/connector-vendure": "3.5.2",
44
+ "@tallyui/connector-woocommerce": "3.5.2",
45
+ "@tallyui/mock-api": "3.5.2",
46
46
  "@types/react": ">=18",
47
47
  "react": "^19.2.4",
48
48
  "react-native-svg": "15.12.1",
@@ -107,7 +107,7 @@ export function OrdersList({ orders, onRetry, formatDate = defaultFormatDate, fo
107
107
  </Pressable> : null}
108
108
  {knownWarnings(order.warnings).map((warning, index) => <View key={index} className="border-l-4 border-warning pl-2"><Text className="text-foreground">
109
109
  {warning.code === 'insufficient_stock'
110
- ? `Stock short by ${warning.quantity} for ${order.lines.find((line) => line.variantId === warning.variantId)?.name}`
110
+ ? `${warning.quantity} sold without stock: ${order.lines.find((line) => line.variantId === warning.variantId)?.name}`
111
111
  : warning.code === 'tax_rate_mismatch'
112
112
  ? `Tax at ${(warning.ratePpm / 10000).toLocaleString(undefined, { maximumFractionDigits: 4 })}%: store ${formatMoney({ amount: warning.serverMinor, currency: order.currency })} vs POS ${formatMoney({ amount: warning.expectedMinor, currency: order.currency })}`
113
113
  : warning.code === 'customer_ignored'
@@ -50,11 +50,12 @@ export function Receipt({ order, posOrder, store, cashier, registerId, newSale,
50
50
  </View>)}
51
51
  {/* Each discount appears once in the totals: line discounts are itemised under their lines and summed once here;
52
52
  the order discount appears once. order.display's figures (ADR-063; medusapos ADR 0008). */}
53
- {receipt.fees.map((charge, index) => row(charge.name, money(charge.amountMinor), false, index))}
54
- {receipt.shipping.map((charge, index) => row(charge.name, money(charge.amountMinor), false, index))}
55
53
  {row('Subtotal', money(totals.subtotalMinor))}
56
54
  {lineDiscountMinor > 0 ? row('Line discounts', `−${money(lineDiscountMinor)}`) : null}
57
55
  {receipt.orderDiscountMinor > 0 ? row('Order discount', `−${money(receipt.orderDiscountMinor)}`) : null}
56
+ {/* Charges are not in the subtotal (order.display): they follow it and its discounts, before tax. */}
57
+ {receipt.fees.map((charge, index) => row(charge.name, money(charge.amountMinor), false, index))}
58
+ {receipt.shipping.map((charge, index) => row(charge.name, money(charge.amountMinor), false, index))}
58
59
  {taxRows}
59
60
  {row('Total', money(totals.totalMinor), true)}
60
61
  {receipt.payments.map((payment, index) => row(payment.method === 'cash' ? 'Cash tendered' : 'Card terminal',