@argusoft/medplat-product-management 1.0.2 → 1.0.4

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