@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,49 +1,50 @@
1
- import { D as e, E as t, a as n, i as r, l as i, n as a, o, r as ee, t as te, v as ne } from "./currency-ClRLIEg2.js";
2
- import { l as re, t as s, u as ie } from "./validation-Ba7puFIO.js";
3
- import { t as ae } from "./useFieldErrors-hDG8ox_x.js";
4
- import { r as c, t as l } from "./format-UOyOu75i.js";
5
- import { n as oe } from "./constants-5ZCZo-Zm.js";
6
- import { t as u } from "./MemberProfileCard-0vjO3Gzd.js";
7
- import { useMemo as d, useState as f } from "react";
8
- import { Fragment as se, jsx as p, jsxs as m } from "react/jsx-runtime";
9
- import { v4 as ce } from "uuid";
10
- import { Alert as h, Box as g, Button as _, Card as v, CardContent as y, Chip as le, Divider as b, FormControl as x, InputAdornment as ue, InputLabel as de, LinearProgress as fe, MenuItem as pe, Select as me, Stack as S, Table as C, TableBody as he, TableCell as w, TableContainer as ge, TableHead as _e, TableRow as T, TextField as E, Typography as D } from "@mui/material";
11
- import { showToast as O } from "@/common/toaster/toaster";
12
- import { useNavigate as k, useParams as A } from "react-router-dom";
13
- import j from "@mui/icons-material/SaveRounded";
1
+ import { C as e, a as t, h as n, i as r, l as i, n as a, o, r as s, t as c, w as l } from "./currency-bVQ7aEk2.js";
2
+ import { o as u } from "./PmTable-CCpaJEA_.js";
3
+ import { l as ee, t as te, u as ne } from "./validation-Ba7puFIO.js";
4
+ import { t as re } from "./useFieldErrors-hDG8ox_x.js";
5
+ import { r as d, t as f } from "./format-UOyOu75i.js";
6
+ import { n as ie } from "./constants-5ZCZo-Zm.js";
7
+ import { t as ae } from "./MemberProfileCard-CinPt09F.js";
8
+ import { useMemo as oe, useState as p } from "react";
9
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
10
+ import { v4 as se } from "uuid";
11
+ import { Alert as _, Box as v, Button as y, Card as b, CardContent as x, Chip as ce, Divider as S, InputAdornment as le, LinearProgress as ue, Stack as C, Table as de, TableBody as fe, TableCell as w, TableContainer as T, TableHead as pe, TableRow as E, TextField as D, Typography as O } from "@mui/material";
12
+ import { showToast as k } from "@/common/toaster/toaster";
13
+ import { useNavigate as me, useParams as he } from "react-router-dom";
14
+ import A from "@mui/icons-material/SaveRounded";
14
15
  //#region src/views/PaymentCreatePage.jsx
15
- function M(e) {
16
+ function j(e) {
16
17
  if (!e) return null;
17
18
  let t = new Date(e).getTime();
18
19
  if (Number.isNaN(t)) return null;
19
20
  let n = Date.now() - t;
20
21
  return Math.max(0, Math.floor(n / (24 * 3600 * 1e3)));
21
22
  }
22
- function N() {
23
- let { memberId: N } = A(), F = k(), I = te(i()?.currencyCode), L = n().has("view.manage.productManagement.dues"), [R, z] = f(""), [B, ve] = f(""), [ye, V] = f(0), [H, U] = f(null), [be, W] = f(!1), G = ae(), xe = (/* @__PURE__ */ new Date()).toISOString().substring(0, 10), [K, q] = f({
24
- id: ce(),
25
- paymentDate: xe,
23
+ function M() {
24
+ let { memberId: M } = he(), P = me(), F = c(i()?.currencyCode), I = t().has("view.manage.productManagement.dues"), [L, R] = p(""), [z, ge] = p(""), [_e, B] = p(0), [V, H] = p(null), [U, W] = p(!1), G = re(), ve = (/* @__PURE__ */ new Date()).toISOString().substring(0, 10), [K, q] = p({
25
+ id: se(),
26
+ paymentDate: ve,
26
27
  paymentMode: "CASH",
27
28
  collectingNow: "",
28
29
  notes: ""
29
30
  });
30
- async function Se() {
31
- if (!N) {
32
- U(null), W(!1), V(0);
31
+ async function ye() {
32
+ if (!M) {
33
+ H(null), W(!1), B(0);
33
34
  return;
34
35
  }
35
- if (!L) {
36
- U(null), V(0), W(!1);
36
+ if (!I) {
37
+ H(null), B(0), W(!1);
37
38
  return;
38
39
  }
39
40
  W(!0);
40
41
  try {
41
- let [n, r] = await Promise.all([t(N).catch(() => null), e().catch(() => [])]);
42
- U(n);
43
- let i = (r ?? []).find((e) => e.memberId === N);
44
- V(Number(i ? i.totalDue : n?.totalDue ?? 0));
42
+ let [t, n] = await Promise.all([e(M).catch(() => null), l().catch(() => [])]);
43
+ H(t);
44
+ let r = (n ?? []).find((e) => e.memberId === M);
45
+ B(Number(r ? r.totalDue : t?.totalDue ?? 0));
45
46
  } catch (e) {
46
- O({
47
+ k({
47
48
  message: e?.response?.data?.message ?? e?.message ?? "Failed to load member dues",
48
49
  type: "error"
49
50
  });
@@ -52,205 +53,205 @@ function N() {
52
53
  }
53
54
  }
54
55
  r("update.manage.productManagement.payment", () => {
55
- Se(), q((e) => ({
56
+ ye(), q((e) => ({
56
57
  ...e,
57
58
  collectingNow: ""
58
59
  }));
59
- }, [N]);
60
- let J = Number(H?.totalDue ?? 0), Ce = Number(K.collectingNow || 0), Y = Math.min(Math.max(Ce, 0), J), X = Math.max(J - Y, 0), we = M(H?.oldestDueDate), Te = M(H?.lastSaleDate), Z = !!N && J > 0 && L, Q = d(() => {
60
+ }, [M]);
61
+ let J = Number(V?.totalDue ?? 0), be = Number(K.collectingNow || 0), Y = Math.min(Math.max(be, 0), J), X = Math.max(J - Y, 0), xe = j(V?.oldestDueDate), Se = j(V?.lastSaleDate), Z = !!M && J > 0 && I, Q = oe(() => {
61
62
  let e = {
62
- member: N ? "" : "No member selected",
63
- paymentDate: re(K.paymentDate, {
63
+ member: M ? "" : "No member selected",
64
+ paymentDate: ee(K.paymentDate, {
64
65
  required: !0,
65
66
  label: "Payment date"
66
67
  }),
67
- collectingNow: ie(K.collectingNow, "Amount", { required: !0 })
68
+ collectingNow: ne(K.collectingNow, "Amount", { required: !0 })
68
69
  };
69
- return !e.collectingNow && J > 0 && Number(K.collectingNow) > J && (e.collectingNow = `Cannot collect more than the outstanding due (${c(J)}).`), e;
70
+ return !e.collectingNow && J > 0 && Number(K.collectingNow) > J && (e.collectingNow = `Cannot collect more than the outstanding due (${d(J)}).`), e;
70
71
  }, [
71
- N,
72
+ M,
72
73
  K.paymentDate,
73
74
  K.collectingNow,
74
75
  J
75
- ]), $ = Z && s(Q);
76
- async function Ee() {
76
+ ]), $ = Z && te(Q);
77
+ async function Ce() {
77
78
  if (!$) {
78
- G.markAllTouched(), z("Please fix the highlighted fields.");
79
+ G.markAllTouched(), R("Please fix the highlighted fields.");
79
80
  return;
80
81
  }
81
82
  try {
82
- await ne({
83
+ await n({
83
84
  id: K.id,
84
- memberId: N,
85
+ memberId: M,
85
86
  amount: Number(Y.toFixed(2)),
86
87
  paymentDate: K.paymentDate,
87
88
  paymentMode: K.paymentMode || null,
88
89
  notes: K.notes || null,
89
90
  allocations: null
90
- }), O({
91
- message: B ? `Payment recorded for ${B}. Applied to their oldest sales first.` : "Payment recorded. Applied to the oldest sales first.",
91
+ }), k({
92
+ message: z ? `Payment recorded for ${z}. Applied to their oldest sales first.` : "Payment recorded. Applied to the oldest sales first.",
92
93
  type: "success"
93
- }), F("/ui/medplat/manage/pm/payments");
94
+ }), P("/ui/medplat/manage/pm/payments");
94
95
  } catch (e) {
95
96
  let t = e?.response?.data?.message ?? e?.message ?? "Failed to record payment";
96
- z(t), O({
97
+ R(t), k({
97
98
  message: t,
98
99
  type: "error"
99
100
  });
100
101
  }
101
102
  }
102
- return /* @__PURE__ */ m(g, { children: [/* @__PURE__ */ p(ee, {}), /* @__PURE__ */ p(a, {
103
+ return /* @__PURE__ */ g(v, { children: [/* @__PURE__ */ h(s, {}), /* @__PURE__ */ h(a, {
103
104
  perm: "update.manage.productManagement.payment",
104
105
  title: "You don’t have permission to collect payments",
105
- children: /* @__PURE__ */ m(o, {
106
+ children: /* @__PURE__ */ g(o, {
106
107
  title: "Collect Payment",
107
108
  subtitle: "Collect payment for what a customer owes. Payments are matched to sales in order received.",
108
- actions: /* @__PURE__ */ m(S, {
109
+ actions: /* @__PURE__ */ g(C, {
109
110
  direction: "row",
110
111
  spacing: 1,
111
- children: [/* @__PURE__ */ p(_, {
112
+ children: [/* @__PURE__ */ h(y, {
112
113
  variant: "outlined",
113
- onClick: () => F("/ui/medplat/manage/pm/payments"),
114
+ onClick: () => P("/ui/medplat/manage/pm/payments"),
114
115
  children: "Cancel"
115
- }), /* @__PURE__ */ p(_, {
116
+ }), /* @__PURE__ */ h(y, {
116
117
  variant: "contained",
117
- startIcon: /* @__PURE__ */ p(j, {}),
118
+ startIcon: /* @__PURE__ */ h(A, {}),
118
119
  disabled: !$,
119
- onClick: () => void Ee(),
120
+ onClick: () => void Ce(),
120
121
  children: "Confirm Collection"
121
122
  })]
122
123
  }),
123
124
  children: [
124
- R ? /* @__PURE__ */ p(h, {
125
+ L ? /* @__PURE__ */ h(_, {
125
126
  severity: "error",
126
127
  sx: { mb: 2 },
127
- children: R
128
+ children: L
128
129
  }) : null,
129
- L ? null : /* @__PURE__ */ p(h, {
130
+ I ? null : /* @__PURE__ */ h(_, {
130
131
  severity: "warning",
131
132
  sx: { mb: 2 },
132
133
  children: "You don’t have access to view outstanding dues, so this collection flow can’t determine how much is owed. Ask an admin to grant the dues permission to collect payments here."
133
134
  }),
134
- /* @__PURE__ */ p(v, {
135
+ /* @__PURE__ */ h(b, {
135
136
  sx: {
136
- borderRadius: 4,
137
+ borderRadius: 1.5,
137
138
  mb: 2
138
139
  },
139
- children: /* @__PURE__ */ m(y, { children: [/* @__PURE__ */ p(D, {
140
+ children: /* @__PURE__ */ g(x, { children: [/* @__PURE__ */ h(O, {
140
141
  variant: "h6",
141
142
  sx: {
142
143
  fontWeight: 800,
143
144
  mb: 2
144
145
  },
145
146
  children: "Customer"
146
- }), N ? /* @__PURE__ */ p(u, {
147
- memberId: N,
148
- previousDue: ye,
149
- currencySymbol: I,
150
- onLoad: (e) => ve(e?.name ?? "")
151
- }) : /* @__PURE__ */ p(h, {
147
+ }), M ? /* @__PURE__ */ h(ae, {
148
+ memberId: M,
149
+ previousDue: _e,
150
+ currencySymbol: F,
151
+ onLoad: (e) => ge(e?.name ?? "")
152
+ }) : /* @__PURE__ */ h(_, {
152
153
  severity: "warning",
153
154
  children: "No member selected"
154
155
  })] })
155
156
  }),
156
- N ? /* @__PURE__ */ m(se, { children: [
157
- /* @__PURE__ */ p(v, {
157
+ M ? /* @__PURE__ */ g(m, { children: [
158
+ /* @__PURE__ */ h(b, {
158
159
  sx: {
159
- borderRadius: 4,
160
+ borderRadius: 1.5,
160
161
  mb: 2
161
162
  },
162
- children: /* @__PURE__ */ m(y, { children: [be ? /* @__PURE__ */ p(fe, { sx: { mb: 2 } }) : null, /* @__PURE__ */ p(P, {
163
+ children: /* @__PURE__ */ g(x, { children: [U ? /* @__PURE__ */ h(ue, { sx: { mb: 2 } }) : null, /* @__PURE__ */ h(N, {
163
164
  total: J,
164
- oldestDueDays: we,
165
- oldestDueDate: H?.oldestDueDate,
166
- lastSaleDays: Te,
167
- lastSaleDate: H?.lastSaleDate,
168
- currency: I
165
+ oldestDueDays: xe,
166
+ oldestDueDate: V?.oldestDueDate,
167
+ lastSaleDays: Se,
168
+ lastSaleDate: V?.lastSaleDate,
169
+ currency: F
169
170
  })] })
170
171
  }),
171
- /* @__PURE__ */ p(v, {
172
+ /* @__PURE__ */ h(b, {
172
173
  sx: {
173
- borderRadius: 4,
174
+ borderRadius: 1.5,
174
175
  mb: 2
175
176
  },
176
- children: /* @__PURE__ */ m(y, { children: [
177
- /* @__PURE__ */ m(S, {
177
+ children: /* @__PURE__ */ g(x, { children: [
178
+ /* @__PURE__ */ g(C, {
178
179
  direction: "row",
179
180
  justifyContent: "space-between",
180
181
  alignItems: "center",
181
182
  sx: { mb: 2 },
182
- children: [/* @__PURE__ */ p(D, {
183
+ children: [/* @__PURE__ */ h(O, {
183
184
  variant: "h6",
184
185
  sx: { fontWeight: 800 },
185
186
  children: "Due Breakdown"
186
- }), /* @__PURE__ */ m(D, {
187
+ }), /* @__PURE__ */ g(O, {
187
188
  variant: "caption",
188
189
  color: "text.secondary",
189
190
  children: [
190
- (H?.openSales ?? []).length,
191
+ (V?.openSales ?? []).length,
191
192
  " ",
192
- (H?.openSales ?? []).length === 1 ? "open sale" : "open sales",
193
+ (V?.openSales ?? []).length === 1 ? "open sale" : "open sales",
193
194
  " ",
194
195
  "· oldest first"
195
196
  ]
196
197
  })]
197
198
  }),
198
- /* @__PURE__ */ p(b, { sx: { mb: 1 } }),
199
- J <= 0 ? /* @__PURE__ */ p(h, {
199
+ /* @__PURE__ */ h(S, { sx: { mb: 1 } }),
200
+ J <= 0 ? /* @__PURE__ */ h(_, {
200
201
  severity: "success",
201
202
  sx: { mt: 1 },
202
203
  children: "No outstanding dues for this member — nothing to collect."
203
- }) : /* @__PURE__ */ p(ge, { children: /* @__PURE__ */ m(C, {
204
+ }) : /* @__PURE__ */ h(T, { children: /* @__PURE__ */ g(de, {
204
205
  size: "small",
205
- children: [/* @__PURE__ */ p(_e, { children: /* @__PURE__ */ m(T, { children: [
206
- /* @__PURE__ */ p(w, {
206
+ children: [/* @__PURE__ */ h(pe, { children: /* @__PURE__ */ g(E, { children: [
207
+ /* @__PURE__ */ h(w, {
207
208
  sx: { fontWeight: 800 },
208
209
  children: "Sale Date"
209
210
  }),
210
- /* @__PURE__ */ p(w, {
211
+ /* @__PURE__ */ h(w, {
211
212
  sx: { fontWeight: 800 },
212
213
  children: "Items"
213
214
  }),
214
- /* @__PURE__ */ p(w, {
215
+ /* @__PURE__ */ h(w, {
215
216
  sx: { fontWeight: 800 },
216
217
  align: "right",
217
218
  children: "Sale"
218
219
  }),
219
- /* @__PURE__ */ p(w, {
220
+ /* @__PURE__ */ h(w, {
220
221
  sx: { fontWeight: 800 },
221
222
  align: "right",
222
223
  children: "Paid"
223
224
  }),
224
- /* @__PURE__ */ p(w, {
225
+ /* @__PURE__ */ h(w, {
225
226
  sx: { fontWeight: 800 },
226
227
  align: "right",
227
228
  children: "Due"
228
229
  })
229
- ] }) }), /* @__PURE__ */ p(he, { children: (H?.openSales ?? []).map((e) => /* @__PURE__ */ m(T, {
230
+ ] }) }), /* @__PURE__ */ h(fe, { children: (V?.openSales ?? []).map((e) => /* @__PURE__ */ g(E, {
230
231
  hover: !0,
231
232
  children: [
232
- /* @__PURE__ */ p(w, { children: /* @__PURE__ */ m(S, {
233
+ /* @__PURE__ */ h(w, { children: /* @__PURE__ */ g(C, {
233
234
  direction: "row",
234
235
  spacing: 1,
235
236
  alignItems: "baseline",
236
- children: [/* @__PURE__ */ p(D, {
237
+ children: [/* @__PURE__ */ h(O, {
237
238
  variant: "body2",
238
- children: l(e.saleDate)
239
- }), /* @__PURE__ */ m(D, {
239
+ children: f(e.saleDate)
240
+ }), /* @__PURE__ */ g(O, {
240
241
  variant: "caption",
241
242
  color: "text.secondary",
242
243
  children: [
243
244
  "(",
244
- M(e.saleDate),
245
+ j(e.saleDate),
245
246
  "d ago)"
246
247
  ]
247
248
  })]
248
249
  }) }),
249
- /* @__PURE__ */ p(w, { children: /* @__PURE__ */ p(S, {
250
+ /* @__PURE__ */ h(w, { children: /* @__PURE__ */ h(C, {
250
251
  direction: "row",
251
252
  spacing: .5,
252
253
  flexWrap: "wrap",
253
- children: (e.items ?? []).map((e) => /* @__PURE__ */ p(le, {
254
+ children: (e.items ?? []).map((e) => /* @__PURE__ */ h(ce, {
254
255
  size: "small",
255
256
  variant: "outlined",
256
257
  label: `${e.productName} × ${e.quantity}`,
@@ -260,48 +261,48 @@ function N() {
260
261
  }
261
262
  }, e.id))
262
263
  }) }),
263
- /* @__PURE__ */ m(w, {
264
+ /* @__PURE__ */ g(w, {
264
265
  align: "right",
265
266
  sx: { fontVariantNumeric: "tabular-nums" },
266
- children: [I, c(e.totalAmount)]
267
+ children: [F, d(e.totalAmount)]
267
268
  }),
268
- /* @__PURE__ */ m(w, {
269
+ /* @__PURE__ */ g(w, {
269
270
  align: "right",
270
271
  sx: {
271
272
  fontVariantNumeric: "tabular-nums",
272
273
  color: "text.secondary"
273
274
  },
274
- children: [I, c(e.paidAmount)]
275
+ children: [F, d(e.paidAmount)]
275
276
  }),
276
- /* @__PURE__ */ m(w, {
277
+ /* @__PURE__ */ g(w, {
277
278
  align: "right",
278
279
  sx: {
279
280
  fontVariantNumeric: "tabular-nums",
280
281
  fontWeight: 700,
281
282
  color: "warning.dark"
282
283
  },
283
- children: [I, c(e.dueAmount)]
284
+ children: [F, d(e.dueAmount)]
284
285
  })
285
286
  ]
286
287
  }, e.id)) })]
287
288
  }) })
288
289
  ] })
289
290
  }),
290
- Z ? /* @__PURE__ */ p(v, {
291
+ Z ? /* @__PURE__ */ h(b, {
291
292
  sx: {
292
- borderRadius: 4,
293
+ borderRadius: 1.5,
293
294
  bgcolor: "grey.50",
294
295
  mb: 3
295
296
  },
296
- children: /* @__PURE__ */ m(y, { children: [
297
- /* @__PURE__ */ m(S, {
297
+ children: /* @__PURE__ */ g(x, { children: [
298
+ /* @__PURE__ */ g(C, {
298
299
  direction: {
299
300
  xs: "column",
300
301
  md: "row"
301
302
  },
302
303
  spacing: 2,
303
304
  children: [
304
- /* @__PURE__ */ p(E, {
305
+ /* @__PURE__ */ h(D, {
305
306
  required: !0,
306
307
  size: "small",
307
308
  type: "date",
@@ -317,23 +318,17 @@ function N() {
317
318
  error: G.show("paymentDate") && !!Q.paymentDate,
318
319
  helperText: G.show("paymentDate") ? Q.paymentDate : ""
319
320
  }),
320
- /* @__PURE__ */ m(x, {
321
- size: "small",
322
- sx: { flex: 1 },
323
- children: [/* @__PURE__ */ p(de, { children: "Payment Mode" }), /* @__PURE__ */ p(me, {
324
- label: "Payment Mode",
325
- value: K.paymentMode,
326
- onChange: (e) => q({
327
- ...K,
328
- paymentMode: e.target.value
329
- }),
330
- children: oe.map((e) => /* @__PURE__ */ p(pe, {
331
- value: e.value,
332
- children: e.label
333
- }, e.value))
334
- })]
321
+ /* @__PURE__ */ h(u, {
322
+ label: "Payment Mode",
323
+ value: K.paymentMode,
324
+ onChange: (e) => q({
325
+ ...K,
326
+ paymentMode: e
327
+ }),
328
+ options: ie,
329
+ sx: { flex: 1 }
335
330
  }),
336
- /* @__PURE__ */ p(E, {
331
+ /* @__PURE__ */ h(D, {
337
332
  size: "small",
338
333
  label: "Notes",
339
334
  sx: { flex: 2 },
@@ -345,39 +340,39 @@ function N() {
345
340
  })
346
341
  ]
347
342
  }),
348
- /* @__PURE__ */ p(b, { sx: { my: 2 } }),
349
- /* @__PURE__ */ m(S, {
343
+ /* @__PURE__ */ h(S, { sx: { my: 2 } }),
344
+ /* @__PURE__ */ g(C, {
350
345
  spacing: 1.25,
351
346
  children: [
352
- /* @__PURE__ */ m(S, {
347
+ /* @__PURE__ */ g(C, {
353
348
  direction: "row",
354
349
  justifyContent: "space-between",
355
350
  alignItems: "baseline",
356
- children: [/* @__PURE__ */ p(D, {
351
+ children: [/* @__PURE__ */ h(O, {
357
352
  variant: "body2",
358
353
  color: "text.secondary",
359
354
  children: "Total Due"
360
- }), /* @__PURE__ */ m(D, {
355
+ }), /* @__PURE__ */ g(O, {
361
356
  variant: "h5",
362
357
  sx: {
363
358
  fontWeight: 800,
364
359
  fontVariantNumeric: "tabular-nums",
365
360
  color: J > 0 ? "warning.dark" : "text.primary"
366
361
  },
367
- children: [I, c(J)]
362
+ children: [F, d(J)]
368
363
  })]
369
364
  }),
370
- /* @__PURE__ */ m(S, {
365
+ /* @__PURE__ */ g(C, {
371
366
  direction: "row",
372
367
  justifyContent: "space-between",
373
368
  alignItems: "center",
374
369
  spacing: 2,
375
- children: [/* @__PURE__ */ p(D, {
370
+ children: [/* @__PURE__ */ h(O, {
376
371
  variant: "body2",
377
372
  color: "text.secondary",
378
373
  sx: { flexShrink: 0 },
379
374
  children: "Amount Collecting Now"
380
- }), /* @__PURE__ */ p(E, {
375
+ }), /* @__PURE__ */ h(D, {
381
376
  required: !0,
382
377
  size: "small",
383
378
  type: "number",
@@ -390,9 +385,9 @@ function N() {
390
385
  fontWeight: 700
391
386
  }
392
387
  },
393
- InputProps: { startAdornment: /* @__PURE__ */ p(ue, {
388
+ InputProps: { startAdornment: /* @__PURE__ */ h(le, {
394
389
  position: "start",
395
- children: I
390
+ children: F
396
391
  }) },
397
392
  sx: { width: 220 },
398
393
  placeholder: "0.00",
@@ -406,23 +401,23 @@ function N() {
406
401
  helperText: G.show("collectingNow") ? Q.collectingNow : "Partial amounts accepted"
407
402
  })]
408
403
  }),
409
- /* @__PURE__ */ p(b, { sx: { my: .5 } }),
410
- /* @__PURE__ */ m(S, {
404
+ /* @__PURE__ */ h(S, { sx: { my: .5 } }),
405
+ /* @__PURE__ */ g(C, {
411
406
  direction: "row",
412
407
  justifyContent: "space-between",
413
408
  alignItems: "baseline",
414
- children: [/* @__PURE__ */ p(D, {
409
+ children: [/* @__PURE__ */ h(O, {
415
410
  variant: "body2",
416
411
  color: "text.secondary",
417
412
  children: "Remaining Due After"
418
- }), /* @__PURE__ */ m(D, {
413
+ }), /* @__PURE__ */ g(O, {
419
414
  variant: "h5",
420
415
  sx: {
421
416
  fontWeight: 800,
422
417
  fontVariantNumeric: "tabular-nums",
423
418
  color: X > 0 ? "warning.dark" : "success.dark"
424
419
  },
425
- children: [I, c(X)]
420
+ children: [F, d(X)]
426
421
  })]
427
422
  })
428
423
  ]
@@ -434,8 +429,8 @@ function N() {
434
429
  })
435
430
  })] });
436
431
  }
437
- function P({ total: e, oldestDueDays: t, oldestDueDate: n, lastSaleDays: r, lastSaleDate: i, currency: a = "₹" }) {
438
- let o = (e, t, n, r) => /* @__PURE__ */ m(g, {
432
+ function N({ total: e, oldestDueDays: t, oldestDueDate: n, lastSaleDays: r, lastSaleDate: i, currency: a = "₹" }) {
433
+ let o = (e, t, n, r) => /* @__PURE__ */ g(v, {
439
434
  sx: {
440
435
  flex: 1,
441
436
  p: 1.5,
@@ -446,12 +441,12 @@ function P({ total: e, oldestDueDays: t, oldestDueDate: n, lastSaleDays: r, last
446
441
  textAlign: "left"
447
442
  },
448
443
  children: [
449
- /* @__PURE__ */ p(D, {
444
+ /* @__PURE__ */ h(O, {
450
445
  variant: "caption",
451
446
  color: "text.secondary",
452
447
  children: e
453
448
  }),
454
- /* @__PURE__ */ p(D, {
449
+ /* @__PURE__ */ h(O, {
455
450
  variant: "h6",
456
451
  sx: {
457
452
  fontWeight: 800,
@@ -460,27 +455,27 @@ function P({ total: e, oldestDueDays: t, oldestDueDate: n, lastSaleDays: r, last
460
455
  },
461
456
  children: t
462
457
  }),
463
- n ? /* @__PURE__ */ p(D, {
458
+ n ? /* @__PURE__ */ h(O, {
464
459
  variant: "caption",
465
460
  color: "text.secondary",
466
461
  children: n
467
462
  }) : null
468
463
  ]
469
464
  });
470
- return /* @__PURE__ */ m(S, {
465
+ return /* @__PURE__ */ g(C, {
471
466
  direction: {
472
467
  xs: "column",
473
468
  md: "row"
474
469
  },
475
470
  spacing: 1.5,
476
471
  children: [
477
- o("Total Due", `${a}${c(e)}`, null, e > 0 ? "warning.dark" : "text.primary"),
478
- o("Last Sale", r == null ? "—" : `${r} day${r === 1 ? "" : "s"} ago`, i ? l(i) : "No prior sale", "text.primary"),
479
- o("Due Since", t == null ? "—" : `${t} day${t === 1 ? "" : "s"}`, n ? l(n) : "No open sales", t != null && t >= 30 ? "error.dark" : "text.primary")
472
+ o("Total Due", `${a}${d(e)}`, null, e > 0 ? "warning.dark" : "text.primary"),
473
+ o("Last Sale", r == null ? "—" : `${r} day${r === 1 ? "" : "s"} ago`, i ? f(i) : "No prior sale", "text.primary"),
474
+ o("Due Since", t == null ? "—" : `${t} day${t === 1 ? "" : "s"}`, n ? f(n) : "No open sales", t != null && t >= 30 ? "error.dark" : "text.primary")
480
475
  ]
481
476
  });
482
477
  }
483
478
  //#endregion
484
- export { N as default };
479
+ export { M as default };
485
480
 
486
- //# sourceMappingURL=PaymentCreatePage-BYmDZAIB.js.map
481
+ //# sourceMappingURL=PaymentCreatePage-BJe3LyFF.js.map