@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.
- package/dist/{BrandsPage-CSA3meke.js → BrandsPage-BE3kn-8b.js} +77 -75
- package/dist/BrandsPage-BE3kn-8b.js.map +1 -0
- package/dist/{CategoriesPage-BrspzkJL.js → CategoriesPage-COqi3pMi.js} +71 -70
- package/dist/{CategoriesPage-BrspzkJL.js.map → CategoriesPage-COqi3pMi.js.map} +1 -1
- package/dist/{DashboardPage-CqaquOs2.js → DashboardPage-C_H1Jrey.js} +90 -89
- package/dist/DashboardPage-C_H1Jrey.js.map +1 -0
- package/dist/{FacilityPicker-Dv_H95WW.js → FacilityPicker-Diq2hnYg.js} +2 -2
- package/dist/{FacilityPicker-Dv_H95WW.js.map → FacilityPicker-Diq2hnYg.js.map} +1 -1
- package/dist/{InventoryPage-CPbzfDMR.js → InventoryPage-Bjpw6vTz.js} +106 -115
- package/dist/InventoryPage-Bjpw6vTz.js.map +1 -0
- package/dist/{MemberProfileCard-0vjO3Gzd.js → MemberProfileCard-BLUVRILO.js} +10 -9
- package/dist/MemberProfileCard-BLUVRILO.js.map +1 -0
- package/dist/{PaymentCreatePage-BYmDZAIB.js → PaymentCreatePage-B5VOgTx9.js} +173 -177
- package/dist/PaymentCreatePage-B5VOgTx9.js.map +1 -0
- package/dist/{PaymentsPage-BXPvKon-.js → PaymentsPage-DY6BclkN.js} +24 -23
- package/dist/{PaymentsPage-BXPvKon-.js.map → PaymentsPage-DY6BclkN.js.map} +1 -1
- package/dist/PickupCreatePage-CCSiyFQF.js +706 -0
- package/dist/PickupCreatePage-CCSiyFQF.js.map +1 -0
- package/dist/{PickupsPage-D66_Wta4.js → PickupsPage-DGi6T5Of.js} +83 -90
- package/dist/PickupsPage-DGi6T5Of.js.map +1 -0
- package/dist/PmGuard-C90yhpsN.js +592 -0
- package/dist/PmGuard-C90yhpsN.js.map +1 -0
- package/dist/{PmTable-B9970kPY.js → PmTable-BkK65bJQ.js} +98 -98
- package/dist/PmTable-BkK65bJQ.js.map +1 -0
- package/dist/{ProductEditPage-B8qFTCW9.js → ProductEditPage-CQj9egzW.js} +138 -137
- package/dist/ProductEditPage-CQj9egzW.js.map +1 -0
- package/dist/{ProductsPage-C7_r9cKn.js → ProductsPage-i8QVw_Jm.js} +65 -64
- package/dist/{ProductsPage-C7_r9cKn.js.map → ProductsPage-i8QVw_Jm.js.map} +1 -1
- package/dist/PurchaseCreatePage-Bp6bl9n8.js +591 -0
- package/dist/PurchaseCreatePage-Bp6bl9n8.js.map +1 -0
- package/dist/{PurchaseRequestDetailPage-C7aAwEqw.js → PurchaseRequestDetailPage-CNAqIFef.js} +216 -215
- package/dist/PurchaseRequestDetailPage-CNAqIFef.js.map +1 -0
- package/dist/{PurchaseRequestsPage-BwCkbpaX.js → PurchaseRequestsPage-BJqDlNrc.js} +57 -56
- package/dist/{PurchaseRequestsPage-BwCkbpaX.js.map → PurchaseRequestsPage-BJqDlNrc.js.map} +1 -1
- package/dist/{PurchasesPage-CvaZouVy.js → PurchasesPage-BQEToymQ.js} +76 -75
- package/dist/{PurchasesPage-CvaZouVy.js.map → PurchasesPage-BQEToymQ.js.map} +1 -1
- package/dist/{SaleCreatePage-DP1Qmltu.js → SaleCreatePage-DbfBK4PH.js} +149 -173
- package/dist/SaleCreatePage-DbfBK4PH.js.map +1 -0
- package/dist/{SalesPage-CO3cdYX5.js → SalesPage-CTBJMxZe.js} +50 -49
- package/dist/SalesPage-CTBJMxZe.js.map +1 -0
- package/dist/SettingsPage-CiwVmzM3.js +663 -0
- package/dist/SettingsPage-CiwVmzM3.js.map +1 -0
- package/dist/{StorageUnitsPage-B9Hr_RkW.js → StorageUnitsPage-BV7nK_iE.js} +57 -56
- package/dist/{StorageUnitsPage-B9Hr_RkW.js.map → StorageUnitsPage-BV7nK_iE.js.map} +1 -1
- package/dist/{TransactionsPage-HKIGwEZN.js → TransactionsPage-Cocn4901.js} +55 -54
- package/dist/TransactionsPage-Cocn4901.js.map +1 -0
- package/dist/TransferCreatePage-DbjcjuOg.js +316 -0
- package/dist/TransferCreatePage-DbjcjuOg.js.map +1 -0
- package/dist/TransfersPage-BFVF7Xvc.js +471 -0
- package/dist/TransfersPage-BFVF7Xvc.js.map +1 -0
- 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/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 +0 -1372
- package/dist/currency-ClRLIEg2.js.map +0 -1
|
@@ -1,256 +1,258 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { r as
|
|
5
|
-
import {
|
|
6
|
-
import { t as u } from "./
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
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
|
|
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
|
|
23
|
-
let { memberId:
|
|
24
|
-
id:
|
|
25
|
-
paymentDate:
|
|
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
|
|
31
|
-
if (!
|
|
32
|
-
|
|
32
|
+
async function q() {
|
|
33
|
+
if (!M) {
|
|
34
|
+
H(null), U(!1), B(0);
|
|
33
35
|
return;
|
|
34
36
|
}
|
|
35
|
-
if (!
|
|
36
|
-
|
|
37
|
+
if (!I) {
|
|
38
|
+
H(null), B(0), U(!1);
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
|
-
|
|
41
|
+
U(!0);
|
|
40
42
|
try {
|
|
41
|
-
let [
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
|
|
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
|
-
|
|
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
|
-
|
|
53
|
+
U(!1);
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
d("update.manage.productManagement.payment", () => {
|
|
57
|
+
q(), K((e) => ({
|
|
56
58
|
...e,
|
|
57
59
|
collectingNow: ""
|
|
58
60
|
}));
|
|
59
|
-
}, [
|
|
60
|
-
let J = Number(
|
|
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:
|
|
63
|
-
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:
|
|
69
|
+
collectingNow: te(G.collectingNow, "Amount", { required: !0 })
|
|
68
70
|
};
|
|
69
|
-
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;
|
|
70
72
|
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
M,
|
|
74
|
+
G.paymentDate,
|
|
75
|
+
G.collectingNow,
|
|
74
76
|
J
|
|
75
|
-
]), $ = Z &&
|
|
76
|
-
async function
|
|
77
|
+
]), $ = Z && l(Q);
|
|
78
|
+
async function Ce() {
|
|
77
79
|
if (!$) {
|
|
78
|
-
|
|
80
|
+
W.markAllTouched(), R("Please fix the highlighted fields.");
|
|
79
81
|
return;
|
|
80
82
|
}
|
|
81
83
|
try {
|
|
82
|
-
await
|
|
83
|
-
id:
|
|
84
|
-
memberId:
|
|
84
|
+
await n({
|
|
85
|
+
id: G.id,
|
|
86
|
+
memberId: M,
|
|
85
87
|
amount: Number(Y.toFixed(2)),
|
|
86
|
-
paymentDate:
|
|
87
|
-
paymentMode:
|
|
88
|
-
notes:
|
|
88
|
+
paymentDate: G.paymentDate,
|
|
89
|
+
paymentMode: G.paymentMode || null,
|
|
90
|
+
notes: G.notes || null,
|
|
89
91
|
allocations: null
|
|
90
|
-
}),
|
|
91
|
-
message:
|
|
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
|
-
}),
|
|
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
|
-
|
|
98
|
+
R(t), k({
|
|
97
99
|
message: t,
|
|
98
100
|
type: "error"
|
|
99
101
|
});
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
110
|
+
actions: /* @__PURE__ */ h(w, {
|
|
109
111
|
direction: "row",
|
|
110
112
|
spacing: 1,
|
|
111
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ m(v, {
|
|
112
114
|
variant: "outlined",
|
|
113
|
-
onClick: () =>
|
|
115
|
+
onClick: () => P("/ui/medplat/manage/pm/payments"),
|
|
114
116
|
children: "Cancel"
|
|
115
|
-
}), /* @__PURE__ */
|
|
117
|
+
}), /* @__PURE__ */ m(v, {
|
|
116
118
|
variant: "contained",
|
|
117
|
-
startIcon: /* @__PURE__ */
|
|
119
|
+
startIcon: /* @__PURE__ */ m(A, {}),
|
|
118
120
|
disabled: !$,
|
|
119
|
-
onClick: () => void
|
|
121
|
+
onClick: () => void Ce(),
|
|
120
122
|
children: "Confirm Collection"
|
|
121
123
|
})]
|
|
122
124
|
}),
|
|
123
125
|
children: [
|
|
124
|
-
|
|
126
|
+
L ? /* @__PURE__ */ m(g, {
|
|
125
127
|
severity: "error",
|
|
126
128
|
sx: { mb: 2 },
|
|
127
|
-
children:
|
|
129
|
+
children: L
|
|
128
130
|
}) : null,
|
|
129
|
-
|
|
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__ */
|
|
136
|
+
/* @__PURE__ */ m(y, {
|
|
135
137
|
sx: {
|
|
136
|
-
borderRadius:
|
|
138
|
+
borderRadius: 1.5,
|
|
137
139
|
mb: 2
|
|
138
140
|
},
|
|
139
|
-
children: /* @__PURE__ */
|
|
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
|
-
}),
|
|
147
|
-
memberId:
|
|
148
|
-
previousDue:
|
|
149
|
-
currencySymbol:
|
|
150
|
-
onLoad: (e) =>
|
|
151
|
-
}) : /* @__PURE__ */
|
|
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
|
-
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
+
M ? /* @__PURE__ */ h(se, { children: [
|
|
159
|
+
/* @__PURE__ */ m(y, {
|
|
158
160
|
sx: {
|
|
159
|
-
borderRadius:
|
|
161
|
+
borderRadius: 1.5,
|
|
160
162
|
mb: 2
|
|
161
163
|
},
|
|
162
|
-
children: /* @__PURE__ */
|
|
164
|
+
children: /* @__PURE__ */ h(b, { children: [ve ? /* @__PURE__ */ m(C, { sx: { mb: 2 } }) : null, /* @__PURE__ */ m(N, {
|
|
163
165
|
total: J,
|
|
164
|
-
oldestDueDays:
|
|
165
|
-
oldestDueDate:
|
|
166
|
-
lastSaleDays:
|
|
167
|
-
lastSaleDate:
|
|
168
|
-
currency:
|
|
166
|
+
oldestDueDays: xe,
|
|
167
|
+
oldestDueDate: V?.oldestDueDate,
|
|
168
|
+
lastSaleDays: Se,
|
|
169
|
+
lastSaleDate: V?.lastSaleDate,
|
|
170
|
+
currency: F
|
|
169
171
|
})] })
|
|
170
172
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ m(y, {
|
|
172
174
|
sx: {
|
|
173
|
-
borderRadius:
|
|
175
|
+
borderRadius: 1.5,
|
|
174
176
|
mb: 2
|
|
175
177
|
},
|
|
176
|
-
children: /* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
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__ */
|
|
184
|
+
children: [/* @__PURE__ */ m(O, {
|
|
183
185
|
variant: "h6",
|
|
184
186
|
sx: { fontWeight: 800 },
|
|
185
187
|
children: "Due Breakdown"
|
|
186
|
-
}), /* @__PURE__ */
|
|
188
|
+
}), /* @__PURE__ */ h(O, {
|
|
187
189
|
variant: "caption",
|
|
188
190
|
color: "text.secondary",
|
|
189
191
|
children: [
|
|
190
|
-
(
|
|
192
|
+
(V?.openSales ?? []).length,
|
|
191
193
|
" ",
|
|
192
|
-
(
|
|
194
|
+
(V?.openSales ?? []).length === 1 ? "open sale" : "open sales",
|
|
193
195
|
" ",
|
|
194
196
|
"· oldest first"
|
|
195
197
|
]
|
|
196
198
|
})]
|
|
197
199
|
}),
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
J <= 0 ? /* @__PURE__ */
|
|
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__ */
|
|
205
|
+
}) : /* @__PURE__ */ m(de, { children: /* @__PURE__ */ h(le, {
|
|
204
206
|
size: "small",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
206
|
-
/* @__PURE__ */
|
|
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__ */
|
|
212
|
+
/* @__PURE__ */ m(T, {
|
|
211
213
|
sx: { fontWeight: 800 },
|
|
212
214
|
children: "Items"
|
|
213
215
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ m(T, {
|
|
215
217
|
sx: { fontWeight: 800 },
|
|
216
218
|
align: "right",
|
|
217
219
|
children: "Sale"
|
|
218
220
|
}),
|
|
219
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ m(T, {
|
|
220
222
|
sx: { fontWeight: 800 },
|
|
221
223
|
align: "right",
|
|
222
224
|
children: "Paid"
|
|
223
225
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ m(T, {
|
|
225
227
|
sx: { fontWeight: 800 },
|
|
226
228
|
align: "right",
|
|
227
229
|
children: "Due"
|
|
228
230
|
})
|
|
229
|
-
] }) }), /* @__PURE__ */
|
|
231
|
+
] }) }), /* @__PURE__ */ m(ue, { children: (V?.openSales ?? []).map((e) => /* @__PURE__ */ h(E, {
|
|
230
232
|
hover: !0,
|
|
231
233
|
children: [
|
|
232
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ m(T, { children: /* @__PURE__ */ h(w, {
|
|
233
235
|
direction: "row",
|
|
234
236
|
spacing: 1,
|
|
235
237
|
alignItems: "baseline",
|
|
236
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ m(O, {
|
|
237
239
|
variant: "body2",
|
|
238
|
-
children:
|
|
239
|
-
}), /* @__PURE__ */
|
|
240
|
+
children: c(e.saleDate)
|
|
241
|
+
}), /* @__PURE__ */ h(O, {
|
|
240
242
|
variant: "caption",
|
|
241
243
|
color: "text.secondary",
|
|
242
244
|
children: [
|
|
243
245
|
"(",
|
|
244
|
-
|
|
246
|
+
j(e.saleDate),
|
|
245
247
|
"d ago)"
|
|
246
248
|
]
|
|
247
249
|
})]
|
|
248
250
|
}) }),
|
|
249
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
265
|
+
/* @__PURE__ */ h(T, {
|
|
264
266
|
align: "right",
|
|
265
267
|
sx: { fontVariantNumeric: "tabular-nums" },
|
|
266
|
-
children: [
|
|
268
|
+
children: [F, s(e.totalAmount)]
|
|
267
269
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
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: [
|
|
276
|
+
children: [F, s(e.paidAmount)]
|
|
275
277
|
}),
|
|
276
|
-
/* @__PURE__ */
|
|
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: [
|
|
285
|
+
children: [F, s(e.dueAmount)]
|
|
284
286
|
})
|
|
285
287
|
]
|
|
286
288
|
}, e.id)) })]
|
|
287
289
|
}) })
|
|
288
290
|
] })
|
|
289
291
|
}),
|
|
290
|
-
Z ? /* @__PURE__ */
|
|
292
|
+
Z ? /* @__PURE__ */ m(y, {
|
|
291
293
|
sx: {
|
|
292
|
-
borderRadius:
|
|
294
|
+
borderRadius: 1.5,
|
|
293
295
|
bgcolor: "grey.50",
|
|
294
296
|
mb: 3
|
|
295
297
|
},
|
|
296
|
-
children: /* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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:
|
|
312
|
-
onChange: (e) =>
|
|
313
|
-
...
|
|
313
|
+
value: G.paymentDate,
|
|
314
|
+
onChange: (e) => K({
|
|
315
|
+
...G,
|
|
314
316
|
paymentDate: e.target.value
|
|
315
317
|
}),
|
|
316
|
-
onBlur:
|
|
317
|
-
error:
|
|
318
|
-
helperText:
|
|
318
|
+
onBlur: W.onBlur("paymentDate"),
|
|
319
|
+
error: W.show("paymentDate") && !!Q.paymentDate,
|
|
320
|
+
helperText: W.show("paymentDate") ? Q.paymentDate : ""
|
|
319
321
|
}),
|
|
320
|
-
/* @__PURE__ */ m(
|
|
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
|
-
})]
|
|
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__ */
|
|
332
|
+
/* @__PURE__ */ m(D, {
|
|
337
333
|
size: "small",
|
|
338
334
|
label: "Notes",
|
|
339
335
|
sx: { flex: 2 },
|
|
340
|
-
value:
|
|
341
|
-
onChange: (e) =>
|
|
342
|
-
...
|
|
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__ */
|
|
349
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ m(x, { sx: { my: 2 } }),
|
|
345
|
+
/* @__PURE__ */ h(w, {
|
|
350
346
|
spacing: 1.25,
|
|
351
347
|
children: [
|
|
352
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ h(w, {
|
|
353
349
|
direction: "row",
|
|
354
350
|
justifyContent: "space-between",
|
|
355
351
|
alignItems: "baseline",
|
|
356
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ m(O, {
|
|
357
353
|
variant: "body2",
|
|
358
354
|
color: "text.secondary",
|
|
359
355
|
children: "Total Due"
|
|
360
|
-
}), /* @__PURE__ */
|
|
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: [
|
|
363
|
+
children: [F, s(J)]
|
|
368
364
|
})]
|
|
369
365
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ h(w, {
|
|
371
367
|
direction: "row",
|
|
372
368
|
justifyContent: "space-between",
|
|
373
369
|
alignItems: "center",
|
|
374
370
|
spacing: 2,
|
|
375
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
389
|
+
InputProps: { startAdornment: /* @__PURE__ */ m(S, {
|
|
394
390
|
position: "start",
|
|
395
|
-
children:
|
|
391
|
+
children: F
|
|
396
392
|
}) },
|
|
397
393
|
sx: { width: 220 },
|
|
398
394
|
placeholder: "0.00",
|
|
399
|
-
value:
|
|
400
|
-
onChange: (e) =>
|
|
401
|
-
...
|
|
395
|
+
value: G.collectingNow,
|
|
396
|
+
onChange: (e) => K({
|
|
397
|
+
...G,
|
|
402
398
|
collectingNow: e.target.value
|
|
403
399
|
}),
|
|
404
|
-
onBlur:
|
|
405
|
-
error:
|
|
406
|
-
helperText:
|
|
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__ */
|
|
410
|
-
/* @__PURE__ */
|
|
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__ */
|
|
410
|
+
children: [/* @__PURE__ */ m(O, {
|
|
415
411
|
variant: "body2",
|
|
416
412
|
color: "text.secondary",
|
|
417
413
|
children: "Remaining Due After"
|
|
418
|
-
}), /* @__PURE__ */
|
|
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: [
|
|
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
|
|
438
|
-
let o = (e, t, n, r) => /* @__PURE__ */
|
|
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__ */
|
|
445
|
+
/* @__PURE__ */ m(O, {
|
|
450
446
|
variant: "caption",
|
|
451
447
|
color: "text.secondary",
|
|
452
448
|
children: e
|
|
453
449
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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}${
|
|
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 ?
|
|
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 {
|
|
480
|
+
export { M as default };
|
|
485
481
|
|
|
486
|
-
//# sourceMappingURL=PaymentCreatePage-
|
|
482
|
+
//# sourceMappingURL=PaymentCreatePage-B5VOgTx9.js.map
|