@argusoft/medplat-product-management 1.0.2 → 1.0.3

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.
Files changed (79) hide show
  1. package/dist/{BrandsPage-CSA3meke.js → BrandsPage-NSvaMXWg.js} +76 -75
  2. package/dist/BrandsPage-NSvaMXWg.js.map +1 -0
  3. package/dist/{CategoriesPage-BrspzkJL.js → CategoriesPage-aZBZrDOi.js} +8 -8
  4. package/dist/{CategoriesPage-BrspzkJL.js.map → CategoriesPage-aZBZrDOi.js.map} +1 -1
  5. package/dist/{DashboardPage-CqaquOs2.js → DashboardPage-DjwlOhrd.js} +22 -22
  6. package/dist/DashboardPage-DjwlOhrd.js.map +1 -0
  7. package/dist/{FacilityPicker-Dv_H95WW.js → FacilityPicker-Chh-ZaR0.js} +2 -2
  8. package/dist/{FacilityPicker-Dv_H95WW.js.map → FacilityPicker-Chh-ZaR0.js.map} +1 -1
  9. package/dist/{InventoryPage-CPbzfDMR.js → InventoryPage-cy76UsMp.js} +109 -119
  10. package/dist/InventoryPage-cy76UsMp.js.map +1 -0
  11. package/dist/{MemberProfileCard-0vjO3Gzd.js → MemberProfileCard-CinPt09F.js} +6 -6
  12. package/dist/MemberProfileCard-CinPt09F.js.map +1 -0
  13. package/dist/{PaymentCreatePage-BYmDZAIB.js → PaymentCreatePage-BJe3LyFF.js} +148 -153
  14. package/dist/PaymentCreatePage-BJe3LyFF.js.map +1 -0
  15. package/dist/{PaymentsPage-BXPvKon-.js → PaymentsPage-DxHoKksN.js} +11 -11
  16. package/dist/{PaymentsPage-BXPvKon-.js.map → PaymentsPage-DxHoKksN.js.map} +1 -1
  17. package/dist/PickupCreatePage-Cq8zJ62Y.js +705 -0
  18. package/dist/PickupCreatePage-Cq8zJ62Y.js.map +1 -0
  19. package/dist/{PickupsPage-D66_Wta4.js → PickupsPage-BOygBQAb.js} +66 -74
  20. package/dist/PickupsPage-BOygBQAb.js.map +1 -0
  21. package/dist/{PmTable-B9970kPY.js → PmTable-CCpaJEA_.js} +4 -4
  22. package/dist/PmTable-CCpaJEA_.js.map +1 -0
  23. package/dist/{ProductEditPage-B8qFTCW9.js → ProductEditPage-DmdHO-fS.js} +109 -109
  24. package/dist/ProductEditPage-DmdHO-fS.js.map +1 -0
  25. package/dist/{ProductsPage-C7_r9cKn.js → ProductsPage-BglMe8EM.js} +6 -6
  26. package/dist/{ProductsPage-C7_r9cKn.js.map → ProductsPage-BglMe8EM.js.map} +1 -1
  27. package/dist/PurchaseCreatePage-1tYk41RS.js +590 -0
  28. package/dist/PurchaseCreatePage-1tYk41RS.js.map +1 -0
  29. package/dist/{PurchaseRequestDetailPage-C7aAwEqw.js → PurchaseRequestDetailPage-BYLx3aBI.js} +14 -14
  30. package/dist/PurchaseRequestDetailPage-BYLx3aBI.js.map +1 -0
  31. package/dist/{PurchaseRequestsPage-BwCkbpaX.js → PurchaseRequestsPage-D2yorc4s.js} +4 -4
  32. package/dist/{PurchaseRequestsPage-BwCkbpaX.js.map → PurchaseRequestsPage-D2yorc4s.js.map} +1 -1
  33. package/dist/{PurchasesPage-CvaZouVy.js → PurchasesPage-CanQTjlw.js} +3 -3
  34. package/dist/{PurchasesPage-CvaZouVy.js.map → PurchasesPage-CanQTjlw.js.map} +1 -1
  35. package/dist/{SaleCreatePage-DP1Qmltu.js → SaleCreatePage-DxFvPvju.js} +145 -170
  36. package/dist/SaleCreatePage-DxFvPvju.js.map +1 -0
  37. package/dist/{SalesPage-CO3cdYX5.js → SalesPage-CPMrdr5-.js} +12 -12
  38. package/dist/SalesPage-CPMrdr5-.js.map +1 -0
  39. package/dist/SettingsPage-CEy922rW.js +662 -0
  40. package/dist/SettingsPage-CEy922rW.js.map +1 -0
  41. package/dist/{StorageUnitsPage-B9Hr_RkW.js → StorageUnitsPage-DfLT6xC_.js} +13 -13
  42. package/dist/{StorageUnitsPage-B9Hr_RkW.js.map → StorageUnitsPage-DfLT6xC_.js.map} +1 -1
  43. package/dist/{TransactionsPage-HKIGwEZN.js → TransactionsPage-KFUJ4O5g.js} +4 -4
  44. package/dist/TransactionsPage-KFUJ4O5g.js.map +1 -0
  45. package/dist/TransferCreatePage-k1tsRGB3.js +315 -0
  46. package/dist/TransferCreatePage-k1tsRGB3.js.map +1 -0
  47. package/dist/TransfersPage-CDafSVO9.js +470 -0
  48. package/dist/TransfersPage-CDafSVO9.js.map +1 -0
  49. package/dist/VialsPage-DPsYFgaQ.js +897 -0
  50. package/dist/VialsPage-DPsYFgaQ.js.map +1 -0
  51. package/dist/{currency-ClRLIEg2.js → currency-bVQ7aEk2.js} +141 -506
  52. package/dist/currency-bVQ7aEk2.js.map +1 -0
  53. package/dist/index.js +1 -1
  54. package/package.json +1 -1
  55. package/dist/BrandsPage-CSA3meke.js.map +0 -1
  56. package/dist/DashboardPage-CqaquOs2.js.map +0 -1
  57. package/dist/InventoryPage-CPbzfDMR.js.map +0 -1
  58. package/dist/MemberProfileCard-0vjO3Gzd.js.map +0 -1
  59. package/dist/PaymentCreatePage-BYmDZAIB.js.map +0 -1
  60. package/dist/PickupCreatePage-CMGwoAXj.js +0 -426
  61. package/dist/PickupCreatePage-CMGwoAXj.js.map +0 -1
  62. package/dist/PickupsPage-D66_Wta4.js.map +0 -1
  63. package/dist/PmTable-B9970kPY.js.map +0 -1
  64. package/dist/ProductEditPage-B8qFTCW9.js.map +0 -1
  65. package/dist/PurchaseCreatePage-CDfNDcKG.js +0 -627
  66. package/dist/PurchaseCreatePage-CDfNDcKG.js.map +0 -1
  67. package/dist/PurchaseRequestDetailPage-C7aAwEqw.js.map +0 -1
  68. package/dist/SaleCreatePage-DP1Qmltu.js.map +0 -1
  69. package/dist/SalesPage-CO3cdYX5.js.map +0 -1
  70. package/dist/SettingsPage-DvVRwSFw.js +0 -711
  71. package/dist/SettingsPage-DvVRwSFw.js.map +0 -1
  72. package/dist/TransactionsPage-HKIGwEZN.js.map +0 -1
  73. package/dist/TransferCreatePage-DMuZqQ3c.js +0 -363
  74. package/dist/TransferCreatePage-DMuZqQ3c.js.map +0 -1
  75. package/dist/TransfersPage-COIyouL4.js +0 -480
  76. package/dist/TransfersPage-COIyouL4.js.map +0 -1
  77. package/dist/VialsPage-BNPUwGCU.js +0 -922
  78. package/dist/VialsPage-BNPUwGCU.js.map +0 -1
  79. package/dist/currency-ClRLIEg2.js.map +0 -1
@@ -1,56 +1,56 @@
1
- import { D as e, F as t, a as n, b as r, i, j as ee, l as te, n as ne, o as re, r as ie, t as ae } from "./currency-ClRLIEg2.js";
2
- import { r as a } from "./PmTable-B9970kPY.js";
3
- import { d as o, m as s, o as oe, t as c } from "./validation-Ba7puFIO.js";
1
+ import { M as e, O as t, _ as n, a as r, i, l as ee, n as te, o as ne, r as re, t as ie, w as ae } from "./currency-bVQ7aEk2.js";
2
+ import { o as a, r as o } from "./PmTable-CCpaJEA_.js";
3
+ import { d as s, m as c, o as oe, t as l } from "./validation-Ba7puFIO.js";
4
4
  import { t as se } from "./useFieldErrors-hDG8ox_x.js";
5
- import { i as l, r as u } from "./format-UOyOu75i.js";
5
+ import { i as u, r as d } from "./format-UOyOu75i.js";
6
6
  import { n as ce } from "./constants-5ZCZo-Zm.js";
7
- import { t as le } from "./MemberProfileCard-0vjO3Gzd.js";
8
- import { useMemo as d, useState as f } from "react";
9
- import { Fragment as ue, jsx as p, jsxs as m } from "react/jsx-runtime";
10
- import { v4 as h } from "uuid";
11
- import { Alert as g, Box as de, Button as _, Card as v, CardContent as y, Divider as b, FormControl as x, FormHelperText as fe, Grid as S, IconButton as pe, InputAdornment as C, InputLabel as w, MenuItem as T, Select as E, Stack as D, TextField as O, Typography as k } from "@mui/material";
12
- import me from "@mui/icons-material/AddRounded";
13
- import { showToast as he } from "@/common/toaster/toaster";
14
- import { useNavigate as ge, useParams as _e } from "react-router-dom";
15
- import ve from "@mui/icons-material/SaveRounded";
16
- import ye from "@mui/icons-material/DeleteOutlineRounded";
7
+ import { t as le } from "./MemberProfileCard-CinPt09F.js";
8
+ import { useMemo as f, useState as p } from "react";
9
+ import { Fragment as ue, jsx as m, jsxs as h } from "react/jsx-runtime";
10
+ import { v4 as g } from "uuid";
11
+ import { Alert as _, Box as de, Button as v, Card as y, CardContent as b, Divider as x, Grid as S, IconButton as fe, InputAdornment as C, Stack as w, TextField as T, Typography as E } from "@mui/material";
12
+ import pe from "@mui/icons-material/AddRounded";
13
+ import { showToast as D } from "@/common/toaster/toaster";
14
+ import { useNavigate as me, useParams as he } from "react-router-dom";
15
+ import ge from "@mui/icons-material/SaveRounded";
16
+ import _e from "@mui/icons-material/DeleteOutlineRounded";
17
17
  //#region src/views/SaleCreatePage.jsx
18
- function A() {
18
+ function O() {
19
19
  return {
20
- key: h(),
20
+ key: g(),
21
21
  batchId: "",
22
22
  quantity: 1,
23
23
  salePrice: ""
24
24
  };
25
25
  }
26
- function j() {
27
- let j = ge(), { memberId: M } = _e(), N = ae(te()?.currencyCode), [P, be] = f([]), [F, xe] = f([]), [Se, Ce] = f({}), [I, we] = f(""), [L, R] = f(""), Te = n().has("view.manage.productManagement.dues"), z = se(), Ee = (/* @__PURE__ */ new Date()).toISOString().substring(0, 10), [B, V] = f({
28
- id: h(),
29
- saleDate: Ee,
26
+ function k() {
27
+ let k = me(), { memberId: A } = he(), j = ie(ee()?.currencyCode), [M, ve] = p([]), [N, P] = p([]), [ye, be] = p({}), [F, I] = p(""), [L, R] = p(""), xe = r().has("view.manage.productManagement.dues"), z = se(), Se = (/* @__PURE__ */ new Date()).toISOString().substring(0, 10), [B, V] = p({
28
+ id: g(),
29
+ saleDate: Se,
30
30
  paymentMode: "CASH",
31
31
  collectingNow: "",
32
32
  notes: "",
33
- items: [A()]
33
+ items: [O()]
34
34
  });
35
35
  i("update.manage.productManagement.sale", () => {
36
36
  async function n() {
37
37
  try {
38
38
  let [n, r, i] = await Promise.all([
39
- t(),
40
- ee().catch(() => []),
41
- Te ? e().catch(() => []) : Promise.resolve([])
39
+ e(),
40
+ t().catch(() => []),
41
+ xe ? ae().catch(() => []) : Promise.resolve([])
42
42
  ]);
43
- be(n), xe(r), Ce(Object.fromEntries((i ?? []).map((e) => [e.memberId, Number(e.totalDue)])));
43
+ ve(n), P(r), be(Object.fromEntries((i ?? []).map((e) => [e.memberId, Number(e.totalDue)])));
44
44
  } catch (e) {
45
45
  R(e?.response?.data?.message ?? e?.message ?? "Failed to load reference data");
46
46
  }
47
47
  }
48
48
  n();
49
49
  }, []);
50
- let H = (e) => P.find((t) => t.id === e), U = d(() => {
51
- let e = new Set(F.filter((e) => e.notForSale === !0).map((e) => e.id));
52
- return P.filter((t) => !(t.qtyRemaining <= 0 || t.isQuarantined || e.has(t.productId) || l(t.expiryDate)));
53
- }, [P, F]);
50
+ let H = (e) => M.find((t) => t.id === e), U = f(() => {
51
+ let e = new Set(N.filter((e) => e.notForSale === !0).map((e) => e.id));
52
+ return M.filter((t) => !(t.qtyRemaining <= 0 || t.isQuarantined || e.has(t.productId) || u(t.expiryDate)));
53
+ }, [M, N]);
54
54
  function W(e, t, n) {
55
55
  V((r) => {
56
56
  let i = r.items.slice();
@@ -63,34 +63,34 @@ function j() {
63
63
  };
64
64
  });
65
65
  }
66
- let G = d(() => B.items.reduce((e, t) => !t.salePrice || !t.quantity ? e : e + Number(t.salePrice) * Number(t.quantity), 0), [B.items]), K = Number(M ? Se[M] ?? 0 : 0), De = Number(B.collectingNow || 0), q = Math.min(Math.max(De, 0), G), J = Math.max(G - q, 0), Y = J + K, X = {
67
- saleDate: s(B.saleDate, "Sale date"),
68
- member: M ? "" : "No member selected"
69
- }, Z = B.collectingNow === "" ? "" : o(B.collectingNow);
70
- !Z && B.collectingNow !== "" && Number(B.collectingNow) > G ? X.collectingNow = `Cannot collect more than the sale amount (${u(G)}). Settle old dues via Payments.` : Z && (X.collectingNow = Z);
71
- let Oe = new Set(U.map((e) => e.id)), Q = B.items.map((e) => {
66
+ let G = f(() => B.items.reduce((e, t) => !t.salePrice || !t.quantity ? e : e + Number(t.salePrice) * Number(t.quantity), 0), [B.items]), K = Number(A ? ye[A] ?? 0 : 0), Ce = Number(B.collectingNow || 0), q = Math.min(Math.max(Ce, 0), G), J = Math.max(G - q, 0), Y = J + K, X = {
67
+ saleDate: c(B.saleDate, "Sale date"),
68
+ member: A ? "" : "No member selected"
69
+ }, Z = B.collectingNow === "" ? "" : s(B.collectingNow);
70
+ !Z && B.collectingNow !== "" && Number(B.collectingNow) > G ? X.collectingNow = `Cannot collect more than the sale amount (${d(G)}). Settle old dues via Payments.` : Z && (X.collectingNow = Z);
71
+ let we = new Set(U.map((e) => e.id)), Q = B.items.map((e) => {
72
72
  let t = H(e.batchId), n = oe(e.quantity, "Quantity", {
73
73
  required: !0,
74
74
  min: 1
75
75
  });
76
76
  !n && t && Number(e.quantity) > t.qtyRemaining && (n = `Only ${t.qtyRemaining} available in selected batch`);
77
- let r = s(e.batchId, "Batch");
78
- return !r && e.batchId && !Oe.has(e.batchId) && (r = "Batch is not available for sale (expired, quarantined, out of stock, or not-for-sale)."), {
77
+ let r = c(e.batchId, "Batch");
78
+ return !r && e.batchId && !we.has(e.batchId) && (r = "Batch is not available for sale (expired, quarantined, out of stock, or not-for-sale)."), {
79
79
  batchId: r,
80
80
  quantity: n,
81
- salePrice: o(e.salePrice) || s(e.salePrice, "Unit price")
81
+ salePrice: s(e.salePrice) || c(e.salePrice, "Unit price")
82
82
  };
83
- }), $ = c(X) && Q.every(c) && B.items.length > 0 && G > 0;
84
- async function ke() {
83
+ }), $ = l(X) && Q.every(l) && B.items.length > 0 && G > 0;
84
+ async function Te() {
85
85
  if (!$) {
86
86
  z.markAllTouched(), R("Please fix the highlighted fields and try again.");
87
87
  return;
88
88
  }
89
89
  try {
90
- await r({
90
+ await n({
91
91
  id: B.id,
92
92
  saleDate: B.saleDate,
93
- memberId: M,
93
+ memberId: A,
94
94
  paymentMode: B.paymentMode || null,
95
95
  totalAmount: Number(G.toFixed(2)),
96
96
  paidAmount: Number(q.toFixed(2)),
@@ -105,150 +105,135 @@ function j() {
105
105
  salePrice: Number(e.salePrice)
106
106
  };
107
107
  })
108
- }), he({
108
+ }), D({
109
109
  message: "Sale recorded.",
110
110
  type: "success"
111
- }), j("/ui/medplat/manage/pm/sales");
111
+ }), k("/ui/medplat/manage/pm/sales");
112
112
  } catch (e) {
113
113
  R(e?.response?.data?.message ?? e?.message ?? "Failed to record sale");
114
114
  }
115
115
  }
116
- return /* @__PURE__ */ m(de, { children: [/* @__PURE__ */ p(ie, {}), /* @__PURE__ */ p(ne, {
116
+ return /* @__PURE__ */ h(de, { children: [/* @__PURE__ */ m(re, {}), /* @__PURE__ */ m(te, {
117
117
  perm: "update.manage.productManagement.sale",
118
118
  title: "You don’t have permission to record sales",
119
- children: /* @__PURE__ */ m(re, {
119
+ children: /* @__PURE__ */ h(ne, {
120
120
  title: "Record Sale",
121
- actions: /* @__PURE__ */ m(D, {
121
+ actions: /* @__PURE__ */ h(w, {
122
122
  direction: "row",
123
123
  spacing: 1,
124
- children: [/* @__PURE__ */ p(_, {
124
+ children: [/* @__PURE__ */ m(v, {
125
125
  variant: "outlined",
126
- onClick: () => j("/ui/medplat/manage/pm/sales"),
126
+ onClick: () => k("/ui/medplat/manage/pm/sales"),
127
127
  children: "Cancel"
128
- }), /* @__PURE__ */ p(_, {
128
+ }), /* @__PURE__ */ m(v, {
129
129
  variant: "contained",
130
- startIcon: /* @__PURE__ */ p(ve, {}),
130
+ startIcon: /* @__PURE__ */ m(ge, {}),
131
131
  disabled: !$,
132
- onClick: () => void ke(),
132
+ onClick: () => void Te(),
133
133
  children: "Save"
134
134
  })]
135
135
  }),
136
136
  children: [
137
- L ? /* @__PURE__ */ p(g, {
137
+ L ? /* @__PURE__ */ m(_, {
138
138
  severity: "error",
139
139
  sx: { mb: 2 },
140
140
  children: L
141
141
  }) : null,
142
- /* @__PURE__ */ p(v, {
142
+ /* @__PURE__ */ m(y, {
143
143
  sx: {
144
- borderRadius: 4,
144
+ borderRadius: 1.5,
145
145
  mb: 2,
146
146
  border: "1px solid",
147
147
  borderColor: "divider",
148
148
  boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
149
149
  },
150
- children: /* @__PURE__ */ m(y, {
150
+ children: /* @__PURE__ */ h(b, {
151
151
  sx: { p: 2.5 },
152
- children: [/* @__PURE__ */ p(a, {
152
+ children: [/* @__PURE__ */ m(o, {
153
153
  eyebrow: "Step 1",
154
154
  title: "Customer",
155
155
  hint: "The customer is set from the link you opened. Their balance shows below.",
156
156
  sx: { mb: 2 }
157
- }), M ? /* @__PURE__ */ p(le, {
158
- memberId: M,
157
+ }), A ? /* @__PURE__ */ m(le, {
158
+ memberId: A,
159
159
  previousDue: K,
160
- currencySymbol: N,
161
- onLoad: (e) => we(e?.name ?? "")
162
- }) : /* @__PURE__ */ p(g, {
160
+ currencySymbol: j,
161
+ onLoad: (e) => I(e?.name ?? "")
162
+ }) : /* @__PURE__ */ m(_, {
163
163
  severity: "warning",
164
164
  children: "No member selected"
165
165
  })]
166
166
  })
167
167
  }),
168
- /* @__PURE__ */ p(v, {
168
+ /* @__PURE__ */ m(y, {
169
169
  sx: {
170
- borderRadius: 4,
170
+ borderRadius: 1.5,
171
171
  mb: 2,
172
172
  border: "1px solid",
173
173
  borderColor: "divider",
174
174
  boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
175
175
  },
176
- children: /* @__PURE__ */ m(y, {
176
+ children: /* @__PURE__ */ h(b, {
177
177
  sx: { p: 2.5 },
178
178
  children: [
179
- /* @__PURE__ */ m(D, {
179
+ /* @__PURE__ */ h(w, {
180
180
  direction: "row",
181
181
  justifyContent: "space-between",
182
182
  alignItems: "flex-start",
183
183
  sx: { mb: 2 },
184
- children: [/* @__PURE__ */ p(a, {
184
+ children: [/* @__PURE__ */ m(o, {
185
185
  eyebrow: "Step 2",
186
186
  title: "Line items",
187
187
  hint: "Each item comes from a batch. Buy price is shown as a cost reference."
188
- }), /* @__PURE__ */ p(_, {
188
+ }), /* @__PURE__ */ m(v, {
189
189
  variant: "outlined",
190
- startIcon: /* @__PURE__ */ p(me, {}),
190
+ startIcon: /* @__PURE__ */ m(pe, {}),
191
191
  onClick: () => V({
192
192
  ...B,
193
- items: [...B.items, A()]
193
+ items: [...B.items, O()]
194
194
  }),
195
195
  children: "Add Line"
196
196
  })]
197
197
  }),
198
- /* @__PURE__ */ p(b, { sx: { mb: 2 } }),
199
- /* @__PURE__ */ p(D, {
198
+ /* @__PURE__ */ m(x, { sx: { mb: 2 } }),
199
+ /* @__PURE__ */ m(w, {
200
200
  spacing: 2,
201
201
  children: B.items.map((e, t) => {
202
202
  let n = H(e.batchId), r = Q[t] || {}, i = e.salePrice && e.quantity ? Number(e.salePrice) * Number(e.quantity) : 0;
203
- return /* @__PURE__ */ p(v, {
203
+ return /* @__PURE__ */ m(y, {
204
204
  variant: "outlined",
205
205
  sx: {
206
206
  p: 2,
207
- borderRadius: 3
207
+ borderRadius: 1.5
208
208
  },
209
- children: /* @__PURE__ */ m(S, {
209
+ children: /* @__PURE__ */ h(S, {
210
210
  container: !0,
211
211
  spacing: 2,
212
212
  alignItems: "center",
213
213
  children: [
214
- /* @__PURE__ */ p(S, {
214
+ /* @__PURE__ */ m(S, {
215
215
  item: !0,
216
216
  xs: 12,
217
217
  md: 5,
218
- children: /* @__PURE__ */ m(x, {
218
+ children: /* @__PURE__ */ m(a, {
219
+ label: "Batch",
219
220
  required: !0,
220
- fullWidth: !0,
221
- size: "small",
221
+ value: e.batchId,
222
+ onChange: (e) => W(t, "batchId", e),
223
+ onBlur: z.onBlur(`items.${t}.batchId`),
222
224
  error: z.show(`items.${t}.batchId`) && !!r.batchId,
223
- children: [
224
- /* @__PURE__ */ p(w, { children: "Batch" }),
225
- /* @__PURE__ */ p(E, {
226
- label: "Batch",
227
- value: e.batchId,
228
- onChange: (e) => W(t, "batchId", e.target.value),
229
- onBlur: z.onBlur(`items.${t}.batchId`),
230
- children: U.map((e) => /* @__PURE__ */ m(T, {
231
- value: e.id,
232
- children: [
233
- e.productName,
234
- " · lot ",
235
- e.lotNumber || "—",
236
- " ·",
237
- " ",
238
- e.qtyRemaining,
239
- " left"
240
- ]
241
- }, e.id))
242
- }),
243
- /* @__PURE__ */ p(fe, { children: z.show(`items.${t}.batchId`) && r.batchId ? r.batchId : n?.buyPrice == null ? " " : `Buy price: ${N}${u(n.buyPrice)} / unit` })
244
- ]
225
+ options: U.map((e) => ({
226
+ value: e.id,
227
+ label: `${e.productName} · lot ${e.lotNumber || "—"} · ${e.qtyRemaining} left`
228
+ })),
229
+ helperText: z.show(`items.${t}.batchId`) && r.batchId ? r.batchId : n?.buyPrice == null ? " " : `Buy price: ${j}${d(n.buyPrice)} / unit`
245
230
  })
246
231
  }),
247
- /* @__PURE__ */ p(S, {
232
+ /* @__PURE__ */ m(S, {
248
233
  item: !0,
249
234
  xs: 6,
250
235
  md: 2,
251
- children: /* @__PURE__ */ p(O, {
236
+ children: /* @__PURE__ */ m(T, {
252
237
  required: !0,
253
238
  fullWidth: !0,
254
239
  size: "small",
@@ -265,11 +250,11 @@ function j() {
265
250
  helperText: z.show(`items.${t}.quantity`) ? r.quantity : ""
266
251
  })
267
252
  }),
268
- /* @__PURE__ */ p(S, {
253
+ /* @__PURE__ */ m(S, {
269
254
  item: !0,
270
255
  xs: 6,
271
256
  md: 2,
272
- children: /* @__PURE__ */ p(O, {
257
+ children: /* @__PURE__ */ m(T, {
273
258
  required: !0,
274
259
  fullWidth: !0,
275
260
  size: "small",
@@ -279,9 +264,9 @@ function j() {
279
264
  min: 0
280
265
  },
281
266
  label: "Unit Price",
282
- InputProps: { startAdornment: /* @__PURE__ */ p(C, {
267
+ InputProps: { startAdornment: /* @__PURE__ */ m(C, {
283
268
  position: "start",
284
- children: N
269
+ children: j
285
270
  }) },
286
271
  value: e.salePrice,
287
272
  onChange: (e) => W(t, "salePrice", e.target.value),
@@ -290,38 +275,38 @@ function j() {
290
275
  helperText: z.show(`items.${t}.salePrice`) ? r.salePrice : ""
291
276
  })
292
277
  }),
293
- /* @__PURE__ */ m(S, {
278
+ /* @__PURE__ */ h(S, {
294
279
  item: !0,
295
280
  xs: 6,
296
281
  md: 2,
297
282
  sx: { textAlign: "right" },
298
- children: [/* @__PURE__ */ p(k, {
283
+ children: [/* @__PURE__ */ m(E, {
299
284
  variant: "caption",
300
285
  color: "text.secondary",
301
286
  sx: { display: "block" },
302
287
  children: "Subtotal"
303
- }), /* @__PURE__ */ m(k, {
288
+ }), /* @__PURE__ */ h(E, {
304
289
  variant: "body1",
305
290
  sx: {
306
291
  fontWeight: 800,
307
292
  fontVariantNumeric: "tabular-nums"
308
293
  },
309
- children: [N, u(i)]
294
+ children: [j, d(i)]
310
295
  })]
311
296
  }),
312
- /* @__PURE__ */ p(S, {
297
+ /* @__PURE__ */ m(S, {
313
298
  item: !0,
314
299
  xs: 6,
315
300
  md: 1,
316
301
  sx: { textAlign: "right" },
317
- children: /* @__PURE__ */ p(pe, {
302
+ children: /* @__PURE__ */ m(fe, {
318
303
  color: "error",
319
304
  onClick: () => V({
320
305
  ...B,
321
306
  items: B.items.filter((e, n) => n !== t)
322
307
  }),
323
308
  disabled: B.items.length === 1,
324
- children: /* @__PURE__ */ p(ye, {})
309
+ children: /* @__PURE__ */ m(_e, {})
325
310
  })
326
311
  })
327
312
  ]
@@ -332,32 +317,32 @@ function j() {
332
317
  ]
333
318
  })
334
319
  }),
335
- /* @__PURE__ */ p(v, {
320
+ /* @__PURE__ */ m(y, {
336
321
  sx: {
337
- borderRadius: 4,
322
+ borderRadius: 1.5,
338
323
  bgcolor: "grey.50",
339
324
  border: "1px solid",
340
325
  borderColor: "divider",
341
326
  boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
342
327
  },
343
- children: /* @__PURE__ */ m(y, {
328
+ children: /* @__PURE__ */ h(b, {
344
329
  sx: { p: 2.5 },
345
330
  children: [
346
- /* @__PURE__ */ p(a, {
331
+ /* @__PURE__ */ m(o, {
347
332
  eyebrow: "Step 3",
348
333
  title: "Bill summary",
349
334
  hint: "Shows totals, previous balance, and what you're collecting. Any remainder becomes a note of what they owe.",
350
335
  sx: { mb: 2 }
351
336
  }),
352
- /* @__PURE__ */ m(S, {
337
+ /* @__PURE__ */ h(S, {
353
338
  container: !0,
354
339
  spacing: 2,
355
340
  children: [
356
- /* @__PURE__ */ p(S, {
341
+ /* @__PURE__ */ m(S, {
357
342
  item: !0,
358
343
  xs: 12,
359
344
  md: 4,
360
- children: /* @__PURE__ */ p(O, {
345
+ children: /* @__PURE__ */ m(T, {
361
346
  required: !0,
362
347
  fullWidth: !0,
363
348
  size: "small",
@@ -374,35 +359,25 @@ function j() {
374
359
  helperText: z.show("saleDate") ? X.saleDate : ""
375
360
  })
376
361
  }),
377
- /* @__PURE__ */ p(S, {
362
+ /* @__PURE__ */ m(S, {
378
363
  item: !0,
379
364
  xs: 12,
380
365
  md: 4,
381
- children: /* @__PURE__ */ m(x, {
382
- fullWidth: !0,
383
- size: "small",
384
- children: [/* @__PURE__ */ p(w, { children: "Payment Mode" }), /* @__PURE__ */ m(E, {
385
- label: "Payment Mode",
386
- value: B.paymentMode || "",
387
- onChange: (e) => V({
388
- ...B,
389
- paymentMode: e.target.value
390
- }),
391
- children: [/* @__PURE__ */ p(T, {
392
- value: "",
393
- children: /* @__PURE__ */ p("em", { children: "—" })
394
- }), ce.map((e) => /* @__PURE__ */ p(T, {
395
- value: e.value,
396
- children: e.label
397
- }, e.value))]
398
- })]
366
+ children: /* @__PURE__ */ m(a, {
367
+ label: "Payment Mode",
368
+ value: B.paymentMode || "",
369
+ onChange: (e) => V({
370
+ ...B,
371
+ paymentMode: e
372
+ }),
373
+ options: ce
399
374
  })
400
375
  }),
401
- /* @__PURE__ */ p(S, {
376
+ /* @__PURE__ */ m(S, {
402
377
  item: !0,
403
378
  xs: 12,
404
379
  md: 4,
405
- children: /* @__PURE__ */ p(O, {
380
+ children: /* @__PURE__ */ m(T, {
406
381
  fullWidth: !0,
407
382
  size: "small",
408
383
  label: "Notes",
@@ -415,15 +390,15 @@ function j() {
415
390
  })
416
391
  ]
417
392
  }),
418
- /* @__PURE__ */ p(b, { sx: { my: 2 } }),
419
- /* @__PURE__ */ m(D, {
393
+ /* @__PURE__ */ m(x, { sx: { my: 2 } }),
394
+ /* @__PURE__ */ h(w, {
420
395
  spacing: 1.25,
421
396
  children: [
422
- /* @__PURE__ */ m(D, {
397
+ /* @__PURE__ */ h(w, {
423
398
  direction: "row",
424
399
  justifyContent: "space-between",
425
400
  alignItems: "baseline",
426
- children: [/* @__PURE__ */ m(k, {
401
+ children: [/* @__PURE__ */ h(E, {
427
402
  variant: "body2",
428
403
  color: "text.secondary",
429
404
  children: [
@@ -433,45 +408,45 @@ function j() {
433
408
  B.items.length === 1 ? "line" : "lines",
434
409
  ")"
435
410
  ]
436
- }), /* @__PURE__ */ m(k, {
411
+ }), /* @__PURE__ */ h(E, {
437
412
  variant: "h5",
438
413
  sx: {
439
414
  fontWeight: 800,
440
415
  fontVariantNumeric: "tabular-nums"
441
416
  },
442
- children: [N, u(G)]
417
+ children: [j, d(G)]
443
418
  })]
444
419
  }),
445
- /* @__PURE__ */ m(D, {
420
+ /* @__PURE__ */ h(w, {
446
421
  direction: "row",
447
422
  justifyContent: "space-between",
448
423
  alignItems: "baseline",
449
- children: [/* @__PURE__ */ p(k, {
424
+ children: [/* @__PURE__ */ m(E, {
450
425
  variant: "body2",
451
426
  color: "text.secondary",
452
427
  children: "Previous Due"
453
- }), /* @__PURE__ */ m(k, {
428
+ }), /* @__PURE__ */ h(E, {
454
429
  variant: "body1",
455
430
  sx: {
456
431
  fontWeight: 700,
457
432
  fontVariantNumeric: "tabular-nums",
458
433
  color: K > 0 ? "warning.dark" : "text.primary"
459
434
  },
460
- children: [N, u(K)]
435
+ children: [j, d(K)]
461
436
  })]
462
437
  }),
463
- /* @__PURE__ */ p(b, { sx: { my: .5 } }),
464
- /* @__PURE__ */ m(D, {
438
+ /* @__PURE__ */ m(x, { sx: { my: .5 } }),
439
+ /* @__PURE__ */ h(w, {
465
440
  direction: "row",
466
441
  justifyContent: "space-between",
467
442
  alignItems: "center",
468
443
  spacing: 2,
469
- children: [/* @__PURE__ */ p(k, {
444
+ children: [/* @__PURE__ */ m(E, {
470
445
  variant: "body2",
471
446
  color: "text.secondary",
472
447
  sx: { flexShrink: 0 },
473
448
  children: "Amount Collecting Now"
474
- }), /* @__PURE__ */ p(O, {
449
+ }), /* @__PURE__ */ m(T, {
475
450
  size: "small",
476
451
  type: "number",
477
452
  inputProps: {
@@ -483,9 +458,9 @@ function j() {
483
458
  fontWeight: 700
484
459
  }
485
460
  },
486
- InputProps: { startAdornment: /* @__PURE__ */ p(C, {
461
+ InputProps: { startAdornment: /* @__PURE__ */ m(C, {
487
462
  position: "start",
488
- children: N
463
+ children: j
489
464
  }) },
490
465
  sx: { width: 200 },
491
466
  value: B.collectingNow,
@@ -499,39 +474,39 @@ function j() {
499
474
  helperText: z.show("collectingNow") ? X.collectingNow : ""
500
475
  })]
501
476
  }),
502
- /* @__PURE__ */ m(D, {
477
+ /* @__PURE__ */ h(w, {
503
478
  direction: "row",
504
479
  justifyContent: "space-between",
505
480
  alignItems: "baseline",
506
- children: [/* @__PURE__ */ p(k, {
481
+ children: [/* @__PURE__ */ m(E, {
507
482
  variant: "body2",
508
483
  color: "text.secondary",
509
484
  children: "Remaining Due (after this sale)"
510
- }), /* @__PURE__ */ m(k, {
485
+ }), /* @__PURE__ */ h(E, {
511
486
  variant: "h5",
512
487
  sx: {
513
488
  fontWeight: 800,
514
489
  fontVariantNumeric: "tabular-nums",
515
490
  color: Y > 0 ? "warning.dark" : "success.dark"
516
491
  },
517
- children: [N, u(Y)]
492
+ children: [j, d(Y)]
518
493
  })]
519
494
  })
520
495
  ]
521
496
  }),
522
- M && Y > 0 ? /* @__PURE__ */ m(g, {
497
+ A && Y > 0 ? /* @__PURE__ */ h(_, {
523
498
  severity: "warning",
524
499
  sx: { mt: 2 },
525
500
  children: [
526
- N,
527
- u(Y),
501
+ j,
502
+ d(Y),
528
503
  " will be recorded as pending dues",
529
- I ? /* @__PURE__ */ m(ue, { children: [
504
+ F ? /* @__PURE__ */ h(ue, { children: [
530
505
  " ",
531
506
  "for ",
532
- /* @__PURE__ */ p("strong", { children: I })
507
+ /* @__PURE__ */ m("strong", { children: F })
533
508
  ] }) : null,
534
- J > 0 && K > 0 ? ` (${N}${u(J)} from this sale + ${N}${u(K)} previously outstanding).` : J > 0 ? " from this sale." : " from previously outstanding dues."
509
+ J > 0 && K > 0 ? ` (${j}${d(J)} from this sale + ${j}${d(K)} previously outstanding).` : J > 0 ? " from this sale." : " from previously outstanding dues."
535
510
  ]
536
511
  }) : null
537
512
  ]
@@ -542,6 +517,6 @@ function j() {
542
517
  })] });
543
518
  }
544
519
  //#endregion
545
- export { j as default };
520
+ export { k as default };
546
521
 
547
- //# sourceMappingURL=SaleCreatePage-DP1Qmltu.js.map
522
+ //# sourceMappingURL=SaleCreatePage-DxFvPvju.js.map