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