@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.
- package/dist/{BrandsPage-CSA3meke.js → BrandsPage-NSvaMXWg.js} +76 -75
- package/dist/BrandsPage-NSvaMXWg.js.map +1 -0
- package/dist/{CategoriesPage-BrspzkJL.js → CategoriesPage-aZBZrDOi.js} +8 -8
- package/dist/{CategoriesPage-BrspzkJL.js.map → CategoriesPage-aZBZrDOi.js.map} +1 -1
- package/dist/{DashboardPage-CqaquOs2.js → DashboardPage-DjwlOhrd.js} +22 -22
- package/dist/DashboardPage-DjwlOhrd.js.map +1 -0
- package/dist/{FacilityPicker-Dv_H95WW.js → FacilityPicker-Chh-ZaR0.js} +2 -2
- package/dist/{FacilityPicker-Dv_H95WW.js.map → FacilityPicker-Chh-ZaR0.js.map} +1 -1
- package/dist/{InventoryPage-CPbzfDMR.js → InventoryPage-cy76UsMp.js} +109 -119
- package/dist/InventoryPage-cy76UsMp.js.map +1 -0
- package/dist/{MemberProfileCard-0vjO3Gzd.js → MemberProfileCard-CinPt09F.js} +6 -6
- package/dist/MemberProfileCard-CinPt09F.js.map +1 -0
- package/dist/{PaymentCreatePage-BYmDZAIB.js → PaymentCreatePage-BJe3LyFF.js} +148 -153
- package/dist/PaymentCreatePage-BJe3LyFF.js.map +1 -0
- package/dist/{PaymentsPage-BXPvKon-.js → PaymentsPage-DxHoKksN.js} +11 -11
- package/dist/{PaymentsPage-BXPvKon-.js.map → PaymentsPage-DxHoKksN.js.map} +1 -1
- package/dist/PickupCreatePage-Cq8zJ62Y.js +705 -0
- package/dist/PickupCreatePage-Cq8zJ62Y.js.map +1 -0
- package/dist/{PickupsPage-D66_Wta4.js → PickupsPage-BOygBQAb.js} +66 -74
- package/dist/PickupsPage-BOygBQAb.js.map +1 -0
- package/dist/{PmTable-B9970kPY.js → PmTable-CCpaJEA_.js} +4 -4
- package/dist/PmTable-CCpaJEA_.js.map +1 -0
- package/dist/{ProductEditPage-B8qFTCW9.js → ProductEditPage-DmdHO-fS.js} +109 -109
- package/dist/ProductEditPage-DmdHO-fS.js.map +1 -0
- package/dist/{ProductsPage-C7_r9cKn.js → ProductsPage-BglMe8EM.js} +6 -6
- package/dist/{ProductsPage-C7_r9cKn.js.map → ProductsPage-BglMe8EM.js.map} +1 -1
- package/dist/PurchaseCreatePage-1tYk41RS.js +590 -0
- package/dist/PurchaseCreatePage-1tYk41RS.js.map +1 -0
- package/dist/{PurchaseRequestDetailPage-C7aAwEqw.js → PurchaseRequestDetailPage-BYLx3aBI.js} +14 -14
- package/dist/PurchaseRequestDetailPage-BYLx3aBI.js.map +1 -0
- package/dist/{PurchaseRequestsPage-BwCkbpaX.js → PurchaseRequestsPage-D2yorc4s.js} +4 -4
- package/dist/{PurchaseRequestsPage-BwCkbpaX.js.map → PurchaseRequestsPage-D2yorc4s.js.map} +1 -1
- package/dist/{PurchasesPage-CvaZouVy.js → PurchasesPage-CanQTjlw.js} +3 -3
- package/dist/{PurchasesPage-CvaZouVy.js.map → PurchasesPage-CanQTjlw.js.map} +1 -1
- package/dist/{SaleCreatePage-DP1Qmltu.js → SaleCreatePage-DxFvPvju.js} +145 -170
- package/dist/SaleCreatePage-DxFvPvju.js.map +1 -0
- package/dist/{SalesPage-CO3cdYX5.js → SalesPage-CPMrdr5-.js} +12 -12
- package/dist/SalesPage-CPMrdr5-.js.map +1 -0
- package/dist/SettingsPage-CEy922rW.js +662 -0
- package/dist/SettingsPage-CEy922rW.js.map +1 -0
- package/dist/{StorageUnitsPage-B9Hr_RkW.js → StorageUnitsPage-DfLT6xC_.js} +13 -13
- package/dist/{StorageUnitsPage-B9Hr_RkW.js.map → StorageUnitsPage-DfLT6xC_.js.map} +1 -1
- package/dist/{TransactionsPage-HKIGwEZN.js → TransactionsPage-KFUJ4O5g.js} +4 -4
- package/dist/TransactionsPage-KFUJ4O5g.js.map +1 -0
- package/dist/TransferCreatePage-k1tsRGB3.js +315 -0
- package/dist/TransferCreatePage-k1tsRGB3.js.map +1 -0
- package/dist/TransfersPage-CDafSVO9.js +470 -0
- package/dist/TransfersPage-CDafSVO9.js.map +1 -0
- package/dist/VialsPage-DPsYFgaQ.js +897 -0
- package/dist/VialsPage-DPsYFgaQ.js.map +1 -0
- package/dist/{currency-ClRLIEg2.js → currency-bVQ7aEk2.js} +141 -506
- package/dist/currency-bVQ7aEk2.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/BrandsPage-CSA3meke.js.map +0 -1
- package/dist/DashboardPage-CqaquOs2.js.map +0 -1
- package/dist/InventoryPage-CPbzfDMR.js.map +0 -1
- package/dist/MemberProfileCard-0vjO3Gzd.js.map +0 -1
- package/dist/PaymentCreatePage-BYmDZAIB.js.map +0 -1
- package/dist/PickupCreatePage-CMGwoAXj.js +0 -426
- package/dist/PickupCreatePage-CMGwoAXj.js.map +0 -1
- package/dist/PickupsPage-D66_Wta4.js.map +0 -1
- package/dist/PmTable-B9970kPY.js.map +0 -1
- package/dist/ProductEditPage-B8qFTCW9.js.map +0 -1
- package/dist/PurchaseCreatePage-CDfNDcKG.js +0 -627
- package/dist/PurchaseCreatePage-CDfNDcKG.js.map +0 -1
- package/dist/PurchaseRequestDetailPage-C7aAwEqw.js.map +0 -1
- package/dist/SaleCreatePage-DP1Qmltu.js.map +0 -1
- package/dist/SalesPage-CO3cdYX5.js.map +0 -1
- package/dist/SettingsPage-DvVRwSFw.js +0 -711
- package/dist/SettingsPage-DvVRwSFw.js.map +0 -1
- package/dist/TransactionsPage-HKIGwEZN.js.map +0 -1
- package/dist/TransferCreatePage-DMuZqQ3c.js +0 -363
- package/dist/TransferCreatePage-DMuZqQ3c.js.map +0 -1
- package/dist/TransfersPage-COIyouL4.js +0 -480
- package/dist/TransfersPage-COIyouL4.js.map +0 -1
- package/dist/VialsPage-BNPUwGCU.js +0 -922
- package/dist/VialsPage-BNPUwGCU.js.map +0 -1
- package/dist/currency-ClRLIEg2.js.map +0 -1
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
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
|
|
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
|
|
23
|
-
let { memberId:
|
|
24
|
-
id:
|
|
25
|
-
paymentDate:
|
|
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
|
|
31
|
-
if (!
|
|
32
|
-
|
|
31
|
+
async function ye() {
|
|
32
|
+
if (!M) {
|
|
33
|
+
H(null), W(!1), B(0);
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
|
-
if (!
|
|
36
|
-
|
|
36
|
+
if (!I) {
|
|
37
|
+
H(null), B(0), W(!1);
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
40
|
W(!0);
|
|
40
41
|
try {
|
|
41
|
-
let [
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
|
|
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
|
-
|
|
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
|
-
|
|
56
|
+
ye(), q((e) => ({
|
|
56
57
|
...e,
|
|
57
58
|
collectingNow: ""
|
|
58
59
|
}));
|
|
59
|
-
}, [
|
|
60
|
-
let J = Number(
|
|
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:
|
|
63
|
-
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:
|
|
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 (${
|
|
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
|
-
|
|
72
|
+
M,
|
|
72
73
|
K.paymentDate,
|
|
73
74
|
K.collectingNow,
|
|
74
75
|
J
|
|
75
|
-
]), $ = Z &&
|
|
76
|
-
async function
|
|
76
|
+
]), $ = Z && te(Q);
|
|
77
|
+
async function Ce() {
|
|
77
78
|
if (!$) {
|
|
78
|
-
G.markAllTouched(),
|
|
79
|
+
G.markAllTouched(), R("Please fix the highlighted fields.");
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
81
82
|
try {
|
|
82
|
-
await
|
|
83
|
+
await n({
|
|
83
84
|
id: K.id,
|
|
84
|
-
memberId:
|
|
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
|
-
}),
|
|
91
|
-
message:
|
|
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
|
-
}),
|
|
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
|
-
|
|
97
|
+
R(t), k({
|
|
97
98
|
message: t,
|
|
98
99
|
type: "error"
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
109
|
+
actions: /* @__PURE__ */ g(C, {
|
|
109
110
|
direction: "row",
|
|
110
111
|
spacing: 1,
|
|
111
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ h(y, {
|
|
112
113
|
variant: "outlined",
|
|
113
|
-
onClick: () =>
|
|
114
|
+
onClick: () => P("/ui/medplat/manage/pm/payments"),
|
|
114
115
|
children: "Cancel"
|
|
115
|
-
}), /* @__PURE__ */
|
|
116
|
+
}), /* @__PURE__ */ h(y, {
|
|
116
117
|
variant: "contained",
|
|
117
|
-
startIcon: /* @__PURE__ */
|
|
118
|
+
startIcon: /* @__PURE__ */ h(A, {}),
|
|
118
119
|
disabled: !$,
|
|
119
|
-
onClick: () => void
|
|
120
|
+
onClick: () => void Ce(),
|
|
120
121
|
children: "Confirm Collection"
|
|
121
122
|
})]
|
|
122
123
|
}),
|
|
123
124
|
children: [
|
|
124
|
-
|
|
125
|
+
L ? /* @__PURE__ */ h(_, {
|
|
125
126
|
severity: "error",
|
|
126
127
|
sx: { mb: 2 },
|
|
127
|
-
children:
|
|
128
|
+
children: L
|
|
128
129
|
}) : null,
|
|
129
|
-
|
|
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__ */
|
|
135
|
+
/* @__PURE__ */ h(b, {
|
|
135
136
|
sx: {
|
|
136
|
-
borderRadius:
|
|
137
|
+
borderRadius: 1.5,
|
|
137
138
|
mb: 2
|
|
138
139
|
},
|
|
139
|
-
children: /* @__PURE__ */
|
|
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
|
-
}),
|
|
147
|
-
memberId:
|
|
148
|
-
previousDue:
|
|
149
|
-
currencySymbol:
|
|
150
|
-
onLoad: (e) =>
|
|
151
|
-
}) : /* @__PURE__ */
|
|
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
|
-
|
|
157
|
-
/* @__PURE__ */
|
|
157
|
+
M ? /* @__PURE__ */ g(m, { children: [
|
|
158
|
+
/* @__PURE__ */ h(b, {
|
|
158
159
|
sx: {
|
|
159
|
-
borderRadius:
|
|
160
|
+
borderRadius: 1.5,
|
|
160
161
|
mb: 2
|
|
161
162
|
},
|
|
162
|
-
children: /* @__PURE__ */
|
|
163
|
+
children: /* @__PURE__ */ g(x, { children: [U ? /* @__PURE__ */ h(ue, { sx: { mb: 2 } }) : null, /* @__PURE__ */ h(N, {
|
|
163
164
|
total: J,
|
|
164
|
-
oldestDueDays:
|
|
165
|
-
oldestDueDate:
|
|
166
|
-
lastSaleDays:
|
|
167
|
-
lastSaleDate:
|
|
168
|
-
currency:
|
|
165
|
+
oldestDueDays: xe,
|
|
166
|
+
oldestDueDate: V?.oldestDueDate,
|
|
167
|
+
lastSaleDays: Se,
|
|
168
|
+
lastSaleDate: V?.lastSaleDate,
|
|
169
|
+
currency: F
|
|
169
170
|
})] })
|
|
170
171
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ h(b, {
|
|
172
173
|
sx: {
|
|
173
|
-
borderRadius:
|
|
174
|
+
borderRadius: 1.5,
|
|
174
175
|
mb: 2
|
|
175
176
|
},
|
|
176
|
-
children: /* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
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__ */
|
|
183
|
+
children: [/* @__PURE__ */ h(O, {
|
|
183
184
|
variant: "h6",
|
|
184
185
|
sx: { fontWeight: 800 },
|
|
185
186
|
children: "Due Breakdown"
|
|
186
|
-
}), /* @__PURE__ */
|
|
187
|
+
}), /* @__PURE__ */ g(O, {
|
|
187
188
|
variant: "caption",
|
|
188
189
|
color: "text.secondary",
|
|
189
190
|
children: [
|
|
190
|
-
(
|
|
191
|
+
(V?.openSales ?? []).length,
|
|
191
192
|
" ",
|
|
192
|
-
(
|
|
193
|
+
(V?.openSales ?? []).length === 1 ? "open sale" : "open sales",
|
|
193
194
|
" ",
|
|
194
195
|
"· oldest first"
|
|
195
196
|
]
|
|
196
197
|
})]
|
|
197
198
|
}),
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
J <= 0 ? /* @__PURE__ */
|
|
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__ */
|
|
204
|
+
}) : /* @__PURE__ */ h(T, { children: /* @__PURE__ */ g(de, {
|
|
204
205
|
size: "small",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
206
|
-
/* @__PURE__ */
|
|
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__ */
|
|
211
|
+
/* @__PURE__ */ h(w, {
|
|
211
212
|
sx: { fontWeight: 800 },
|
|
212
213
|
children: "Items"
|
|
213
214
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ h(w, {
|
|
215
216
|
sx: { fontWeight: 800 },
|
|
216
217
|
align: "right",
|
|
217
218
|
children: "Sale"
|
|
218
219
|
}),
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ h(w, {
|
|
220
221
|
sx: { fontWeight: 800 },
|
|
221
222
|
align: "right",
|
|
222
223
|
children: "Paid"
|
|
223
224
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ h(w, {
|
|
225
226
|
sx: { fontWeight: 800 },
|
|
226
227
|
align: "right",
|
|
227
228
|
children: "Due"
|
|
228
229
|
})
|
|
229
|
-
] }) }), /* @__PURE__ */
|
|
230
|
+
] }) }), /* @__PURE__ */ h(fe, { children: (V?.openSales ?? []).map((e) => /* @__PURE__ */ g(E, {
|
|
230
231
|
hover: !0,
|
|
231
232
|
children: [
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ h(w, { children: /* @__PURE__ */ g(C, {
|
|
233
234
|
direction: "row",
|
|
234
235
|
spacing: 1,
|
|
235
236
|
alignItems: "baseline",
|
|
236
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ h(O, {
|
|
237
238
|
variant: "body2",
|
|
238
|
-
children:
|
|
239
|
-
}), /* @__PURE__ */
|
|
239
|
+
children: f(e.saleDate)
|
|
240
|
+
}), /* @__PURE__ */ g(O, {
|
|
240
241
|
variant: "caption",
|
|
241
242
|
color: "text.secondary",
|
|
242
243
|
children: [
|
|
243
244
|
"(",
|
|
244
|
-
|
|
245
|
+
j(e.saleDate),
|
|
245
246
|
"d ago)"
|
|
246
247
|
]
|
|
247
248
|
})]
|
|
248
249
|
}) }),
|
|
249
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
264
|
+
/* @__PURE__ */ g(w, {
|
|
264
265
|
align: "right",
|
|
265
266
|
sx: { fontVariantNumeric: "tabular-nums" },
|
|
266
|
-
children: [
|
|
267
|
+
children: [F, d(e.totalAmount)]
|
|
267
268
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
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: [
|
|
275
|
+
children: [F, d(e.paidAmount)]
|
|
275
276
|
}),
|
|
276
|
-
/* @__PURE__ */
|
|
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: [
|
|
284
|
+
children: [F, d(e.dueAmount)]
|
|
284
285
|
})
|
|
285
286
|
]
|
|
286
287
|
}, e.id)) })]
|
|
287
288
|
}) })
|
|
288
289
|
] })
|
|
289
290
|
}),
|
|
290
|
-
Z ? /* @__PURE__ */
|
|
291
|
+
Z ? /* @__PURE__ */ h(b, {
|
|
291
292
|
sx: {
|
|
292
|
-
borderRadius:
|
|
293
|
+
borderRadius: 1.5,
|
|
293
294
|
bgcolor: "grey.50",
|
|
294
295
|
mb: 3
|
|
295
296
|
},
|
|
296
|
-
children: /* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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__ */
|
|
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__ */
|
|
349
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ h(S, { sx: { my: 2 } }),
|
|
344
|
+
/* @__PURE__ */ g(C, {
|
|
350
345
|
spacing: 1.25,
|
|
351
346
|
children: [
|
|
352
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ g(C, {
|
|
353
348
|
direction: "row",
|
|
354
349
|
justifyContent: "space-between",
|
|
355
350
|
alignItems: "baseline",
|
|
356
|
-
children: [/* @__PURE__ */
|
|
351
|
+
children: [/* @__PURE__ */ h(O, {
|
|
357
352
|
variant: "body2",
|
|
358
353
|
color: "text.secondary",
|
|
359
354
|
children: "Total Due"
|
|
360
|
-
}), /* @__PURE__ */
|
|
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: [
|
|
362
|
+
children: [F, d(J)]
|
|
368
363
|
})]
|
|
369
364
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ g(C, {
|
|
371
366
|
direction: "row",
|
|
372
367
|
justifyContent: "space-between",
|
|
373
368
|
alignItems: "center",
|
|
374
369
|
spacing: 2,
|
|
375
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
388
|
+
InputProps: { startAdornment: /* @__PURE__ */ h(le, {
|
|
394
389
|
position: "start",
|
|
395
|
-
children:
|
|
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__ */
|
|
410
|
-
/* @__PURE__ */
|
|
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__ */
|
|
409
|
+
children: [/* @__PURE__ */ h(O, {
|
|
415
410
|
variant: "body2",
|
|
416
411
|
color: "text.secondary",
|
|
417
412
|
children: "Remaining Due After"
|
|
418
|
-
}), /* @__PURE__ */
|
|
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: [
|
|
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
|
|
438
|
-
let o = (e, t, n, r) => /* @__PURE__ */
|
|
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__ */
|
|
444
|
+
/* @__PURE__ */ h(O, {
|
|
450
445
|
variant: "caption",
|
|
451
446
|
color: "text.secondary",
|
|
452
447
|
children: e
|
|
453
448
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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}${
|
|
478
|
-
o("Last Sale", r == null ? "—" : `${r} day${r === 1 ? "" : "s"} ago`, i ?
|
|
479
|
-
o("Due Since", t == null ? "—" : `${t} day${t === 1 ? "" : "s"}`, n ?
|
|
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 {
|
|
479
|
+
export { M as default };
|
|
485
480
|
|
|
486
|
-
//# sourceMappingURL=PaymentCreatePage-
|
|
481
|
+
//# sourceMappingURL=PaymentCreatePage-BJe3LyFF.js.map
|