@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,56 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { d as
|
|
1
|
+
import { M as e, O as t, _ as n, a as r, i, l as ee, n as te, o as ne, r as re, t as ie, w as ae } from "./currency-bVQ7aEk2.js";
|
|
2
|
+
import { o as a, r as o } from "./PmTable-CCpaJEA_.js";
|
|
3
|
+
import { d as s, m as c, o as oe, t as l } from "./validation-Ba7puFIO.js";
|
|
4
4
|
import { t as se } from "./useFieldErrors-hDG8ox_x.js";
|
|
5
|
-
import { i as
|
|
5
|
+
import { i as u, r as d } from "./format-UOyOu75i.js";
|
|
6
6
|
import { n as ce } from "./constants-5ZCZo-Zm.js";
|
|
7
|
-
import { t as le } from "./MemberProfileCard-
|
|
8
|
-
import { useMemo as
|
|
9
|
-
import { Fragment as ue, jsx as
|
|
10
|
-
import { v4 as
|
|
11
|
-
import { Alert as
|
|
12
|
-
import
|
|
13
|
-
import { showToast as
|
|
14
|
-
import { useNavigate as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
7
|
+
import { t as le } from "./MemberProfileCard-CinPt09F.js";
|
|
8
|
+
import { useMemo as f, useState as p } from "react";
|
|
9
|
+
import { Fragment as ue, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
|
+
import { v4 as g } from "uuid";
|
|
11
|
+
import { Alert as _, Box as de, Button as v, Card as y, CardContent as b, Divider as x, Grid as S, IconButton as fe, InputAdornment as C, Stack as w, TextField as T, Typography as E } from "@mui/material";
|
|
12
|
+
import pe from "@mui/icons-material/AddRounded";
|
|
13
|
+
import { showToast as D } from "@/common/toaster/toaster";
|
|
14
|
+
import { useNavigate as me, useParams as he } from "react-router-dom";
|
|
15
|
+
import ge from "@mui/icons-material/SaveRounded";
|
|
16
|
+
import _e from "@mui/icons-material/DeleteOutlineRounded";
|
|
17
17
|
//#region src/views/SaleCreatePage.jsx
|
|
18
|
-
function
|
|
18
|
+
function O() {
|
|
19
19
|
return {
|
|
20
|
-
key:
|
|
20
|
+
key: g(),
|
|
21
21
|
batchId: "",
|
|
22
22
|
quantity: 1,
|
|
23
23
|
salePrice: ""
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
let
|
|
28
|
-
id:
|
|
29
|
-
saleDate:
|
|
26
|
+
function k() {
|
|
27
|
+
let k = me(), { memberId: A } = he(), j = ie(ee()?.currencyCode), [M, ve] = p([]), [N, P] = p([]), [ye, be] = p({}), [F, I] = p(""), [L, R] = p(""), xe = r().has("view.manage.productManagement.dues"), z = se(), Se = (/* @__PURE__ */ new Date()).toISOString().substring(0, 10), [B, V] = p({
|
|
28
|
+
id: g(),
|
|
29
|
+
saleDate: Se,
|
|
30
30
|
paymentMode: "CASH",
|
|
31
31
|
collectingNow: "",
|
|
32
32
|
notes: "",
|
|
33
|
-
items: [
|
|
33
|
+
items: [O()]
|
|
34
34
|
});
|
|
35
35
|
i("update.manage.productManagement.sale", () => {
|
|
36
36
|
async function n() {
|
|
37
37
|
try {
|
|
38
38
|
let [n, r, i] = await Promise.all([
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
e(),
|
|
40
|
+
t().catch(() => []),
|
|
41
|
+
xe ? ae().catch(() => []) : Promise.resolve([])
|
|
42
42
|
]);
|
|
43
|
-
|
|
43
|
+
ve(n), P(r), be(Object.fromEntries((i ?? []).map((e) => [e.memberId, Number(e.totalDue)])));
|
|
44
44
|
} catch (e) {
|
|
45
45
|
R(e?.response?.data?.message ?? e?.message ?? "Failed to load reference data");
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
n();
|
|
49
49
|
}, []);
|
|
50
|
-
let H = (e) =>
|
|
51
|
-
let e = new Set(
|
|
52
|
-
return
|
|
53
|
-
}, [
|
|
50
|
+
let H = (e) => M.find((t) => t.id === e), U = f(() => {
|
|
51
|
+
let e = new Set(N.filter((e) => e.notForSale === !0).map((e) => e.id));
|
|
52
|
+
return M.filter((t) => !(t.qtyRemaining <= 0 || t.isQuarantined || e.has(t.productId) || u(t.expiryDate)));
|
|
53
|
+
}, [M, N]);
|
|
54
54
|
function W(e, t, n) {
|
|
55
55
|
V((r) => {
|
|
56
56
|
let i = r.items.slice();
|
|
@@ -63,34 +63,34 @@ function j() {
|
|
|
63
63
|
};
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
let G =
|
|
67
|
-
saleDate:
|
|
68
|
-
member:
|
|
69
|
-
}, Z = B.collectingNow === "" ? "" :
|
|
70
|
-
!Z && B.collectingNow !== "" && Number(B.collectingNow) > G ? X.collectingNow = `Cannot collect more than the sale amount (${
|
|
71
|
-
let
|
|
66
|
+
let G = f(() => B.items.reduce((e, t) => !t.salePrice || !t.quantity ? e : e + Number(t.salePrice) * Number(t.quantity), 0), [B.items]), K = Number(A ? ye[A] ?? 0 : 0), Ce = Number(B.collectingNow || 0), q = Math.min(Math.max(Ce, 0), G), J = Math.max(G - q, 0), Y = J + K, X = {
|
|
67
|
+
saleDate: c(B.saleDate, "Sale date"),
|
|
68
|
+
member: A ? "" : "No member selected"
|
|
69
|
+
}, Z = B.collectingNow === "" ? "" : s(B.collectingNow);
|
|
70
|
+
!Z && B.collectingNow !== "" && Number(B.collectingNow) > G ? X.collectingNow = `Cannot collect more than the sale amount (${d(G)}). Settle old dues via Payments.` : Z && (X.collectingNow = Z);
|
|
71
|
+
let we = new Set(U.map((e) => e.id)), Q = B.items.map((e) => {
|
|
72
72
|
let t = H(e.batchId), n = oe(e.quantity, "Quantity", {
|
|
73
73
|
required: !0,
|
|
74
74
|
min: 1
|
|
75
75
|
});
|
|
76
76
|
!n && t && Number(e.quantity) > t.qtyRemaining && (n = `Only ${t.qtyRemaining} available in selected batch`);
|
|
77
|
-
let r =
|
|
78
|
-
return !r && e.batchId && !
|
|
77
|
+
let r = c(e.batchId, "Batch");
|
|
78
|
+
return !r && e.batchId && !we.has(e.batchId) && (r = "Batch is not available for sale (expired, quarantined, out of stock, or not-for-sale)."), {
|
|
79
79
|
batchId: r,
|
|
80
80
|
quantity: n,
|
|
81
|
-
salePrice:
|
|
81
|
+
salePrice: s(e.salePrice) || c(e.salePrice, "Unit price")
|
|
82
82
|
};
|
|
83
|
-
}), $ =
|
|
84
|
-
async function
|
|
83
|
+
}), $ = l(X) && Q.every(l) && B.items.length > 0 && G > 0;
|
|
84
|
+
async function Te() {
|
|
85
85
|
if (!$) {
|
|
86
86
|
z.markAllTouched(), R("Please fix the highlighted fields and try again.");
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
89
|
try {
|
|
90
|
-
await
|
|
90
|
+
await n({
|
|
91
91
|
id: B.id,
|
|
92
92
|
saleDate: B.saleDate,
|
|
93
|
-
memberId:
|
|
93
|
+
memberId: A,
|
|
94
94
|
paymentMode: B.paymentMode || null,
|
|
95
95
|
totalAmount: Number(G.toFixed(2)),
|
|
96
96
|
paidAmount: Number(q.toFixed(2)),
|
|
@@ -105,150 +105,135 @@ function j() {
|
|
|
105
105
|
salePrice: Number(e.salePrice)
|
|
106
106
|
};
|
|
107
107
|
})
|
|
108
|
-
}),
|
|
108
|
+
}), D({
|
|
109
109
|
message: "Sale recorded.",
|
|
110
110
|
type: "success"
|
|
111
|
-
}),
|
|
111
|
+
}), k("/ui/medplat/manage/pm/sales");
|
|
112
112
|
} catch (e) {
|
|
113
113
|
R(e?.response?.data?.message ?? e?.message ?? "Failed to record sale");
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
return /* @__PURE__ */
|
|
116
|
+
return /* @__PURE__ */ h(de, { children: [/* @__PURE__ */ m(re, {}), /* @__PURE__ */ m(te, {
|
|
117
117
|
perm: "update.manage.productManagement.sale",
|
|
118
118
|
title: "You don’t have permission to record sales",
|
|
119
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ h(ne, {
|
|
120
120
|
title: "Record Sale",
|
|
121
|
-
actions: /* @__PURE__ */
|
|
121
|
+
actions: /* @__PURE__ */ h(w, {
|
|
122
122
|
direction: "row",
|
|
123
123
|
spacing: 1,
|
|
124
|
-
children: [/* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ m(v, {
|
|
125
125
|
variant: "outlined",
|
|
126
|
-
onClick: () =>
|
|
126
|
+
onClick: () => k("/ui/medplat/manage/pm/sales"),
|
|
127
127
|
children: "Cancel"
|
|
128
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ m(v, {
|
|
129
129
|
variant: "contained",
|
|
130
|
-
startIcon: /* @__PURE__ */
|
|
130
|
+
startIcon: /* @__PURE__ */ m(ge, {}),
|
|
131
131
|
disabled: !$,
|
|
132
|
-
onClick: () => void
|
|
132
|
+
onClick: () => void Te(),
|
|
133
133
|
children: "Save"
|
|
134
134
|
})]
|
|
135
135
|
}),
|
|
136
136
|
children: [
|
|
137
|
-
L ? /* @__PURE__ */
|
|
137
|
+
L ? /* @__PURE__ */ m(_, {
|
|
138
138
|
severity: "error",
|
|
139
139
|
sx: { mb: 2 },
|
|
140
140
|
children: L
|
|
141
141
|
}) : null,
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ m(y, {
|
|
143
143
|
sx: {
|
|
144
|
-
borderRadius:
|
|
144
|
+
borderRadius: 1.5,
|
|
145
145
|
mb: 2,
|
|
146
146
|
border: "1px solid",
|
|
147
147
|
borderColor: "divider",
|
|
148
148
|
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
|
|
149
149
|
},
|
|
150
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ h(b, {
|
|
151
151
|
sx: { p: 2.5 },
|
|
152
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ m(o, {
|
|
153
153
|
eyebrow: "Step 1",
|
|
154
154
|
title: "Customer",
|
|
155
155
|
hint: "The customer is set from the link you opened. Their balance shows below.",
|
|
156
156
|
sx: { mb: 2 }
|
|
157
|
-
}),
|
|
158
|
-
memberId:
|
|
157
|
+
}), A ? /* @__PURE__ */ m(le, {
|
|
158
|
+
memberId: A,
|
|
159
159
|
previousDue: K,
|
|
160
|
-
currencySymbol:
|
|
161
|
-
onLoad: (e) =>
|
|
162
|
-
}) : /* @__PURE__ */
|
|
160
|
+
currencySymbol: j,
|
|
161
|
+
onLoad: (e) => I(e?.name ?? "")
|
|
162
|
+
}) : /* @__PURE__ */ m(_, {
|
|
163
163
|
severity: "warning",
|
|
164
164
|
children: "No member selected"
|
|
165
165
|
})]
|
|
166
166
|
})
|
|
167
167
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ m(y, {
|
|
169
169
|
sx: {
|
|
170
|
-
borderRadius:
|
|
170
|
+
borderRadius: 1.5,
|
|
171
171
|
mb: 2,
|
|
172
172
|
border: "1px solid",
|
|
173
173
|
borderColor: "divider",
|
|
174
174
|
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
|
|
175
175
|
},
|
|
176
|
-
children: /* @__PURE__ */
|
|
176
|
+
children: /* @__PURE__ */ h(b, {
|
|
177
177
|
sx: { p: 2.5 },
|
|
178
178
|
children: [
|
|
179
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ h(w, {
|
|
180
180
|
direction: "row",
|
|
181
181
|
justifyContent: "space-between",
|
|
182
182
|
alignItems: "flex-start",
|
|
183
183
|
sx: { mb: 2 },
|
|
184
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ m(o, {
|
|
185
185
|
eyebrow: "Step 2",
|
|
186
186
|
title: "Line items",
|
|
187
187
|
hint: "Each item comes from a batch. Buy price is shown as a cost reference."
|
|
188
|
-
}), /* @__PURE__ */
|
|
188
|
+
}), /* @__PURE__ */ m(v, {
|
|
189
189
|
variant: "outlined",
|
|
190
|
-
startIcon: /* @__PURE__ */
|
|
190
|
+
startIcon: /* @__PURE__ */ m(pe, {}),
|
|
191
191
|
onClick: () => V({
|
|
192
192
|
...B,
|
|
193
|
-
items: [...B.items,
|
|
193
|
+
items: [...B.items, O()]
|
|
194
194
|
}),
|
|
195
195
|
children: "Add Line"
|
|
196
196
|
})]
|
|
197
197
|
}),
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ m(x, { sx: { mb: 2 } }),
|
|
199
|
+
/* @__PURE__ */ m(w, {
|
|
200
200
|
spacing: 2,
|
|
201
201
|
children: B.items.map((e, t) => {
|
|
202
202
|
let n = H(e.batchId), r = Q[t] || {}, i = e.salePrice && e.quantity ? Number(e.salePrice) * Number(e.quantity) : 0;
|
|
203
|
-
return /* @__PURE__ */
|
|
203
|
+
return /* @__PURE__ */ m(y, {
|
|
204
204
|
variant: "outlined",
|
|
205
205
|
sx: {
|
|
206
206
|
p: 2,
|
|
207
|
-
borderRadius:
|
|
207
|
+
borderRadius: 1.5
|
|
208
208
|
},
|
|
209
|
-
children: /* @__PURE__ */
|
|
209
|
+
children: /* @__PURE__ */ h(S, {
|
|
210
210
|
container: !0,
|
|
211
211
|
spacing: 2,
|
|
212
212
|
alignItems: "center",
|
|
213
213
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ m(S, {
|
|
215
215
|
item: !0,
|
|
216
216
|
xs: 12,
|
|
217
217
|
md: 5,
|
|
218
|
-
children: /* @__PURE__ */ m(
|
|
218
|
+
children: /* @__PURE__ */ m(a, {
|
|
219
|
+
label: "Batch",
|
|
219
220
|
required: !0,
|
|
220
|
-
|
|
221
|
-
|
|
221
|
+
value: e.batchId,
|
|
222
|
+
onChange: (e) => W(t, "batchId", e),
|
|
223
|
+
onBlur: z.onBlur(`items.${t}.batchId`),
|
|
222
224
|
error: z.show(`items.${t}.batchId`) && !!r.batchId,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
onChange: (e) => W(t, "batchId", e.target.value),
|
|
229
|
-
onBlur: z.onBlur(`items.${t}.batchId`),
|
|
230
|
-
children: U.map((e) => /* @__PURE__ */ m(T, {
|
|
231
|
-
value: e.id,
|
|
232
|
-
children: [
|
|
233
|
-
e.productName,
|
|
234
|
-
" · lot ",
|
|
235
|
-
e.lotNumber || "—",
|
|
236
|
-
" ·",
|
|
237
|
-
" ",
|
|
238
|
-
e.qtyRemaining,
|
|
239
|
-
" left"
|
|
240
|
-
]
|
|
241
|
-
}, e.id))
|
|
242
|
-
}),
|
|
243
|
-
/* @__PURE__ */ p(fe, { children: z.show(`items.${t}.batchId`) && r.batchId ? r.batchId : n?.buyPrice == null ? " " : `Buy price: ${N}${u(n.buyPrice)} / unit` })
|
|
244
|
-
]
|
|
225
|
+
options: U.map((e) => ({
|
|
226
|
+
value: e.id,
|
|
227
|
+
label: `${e.productName} · lot ${e.lotNumber || "—"} · ${e.qtyRemaining} left`
|
|
228
|
+
})),
|
|
229
|
+
helperText: z.show(`items.${t}.batchId`) && r.batchId ? r.batchId : n?.buyPrice == null ? " " : `Buy price: ${j}${d(n.buyPrice)} / unit`
|
|
245
230
|
})
|
|
246
231
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ m(S, {
|
|
248
233
|
item: !0,
|
|
249
234
|
xs: 6,
|
|
250
235
|
md: 2,
|
|
251
|
-
children: /* @__PURE__ */
|
|
236
|
+
children: /* @__PURE__ */ m(T, {
|
|
252
237
|
required: !0,
|
|
253
238
|
fullWidth: !0,
|
|
254
239
|
size: "small",
|
|
@@ -265,11 +250,11 @@ function j() {
|
|
|
265
250
|
helperText: z.show(`items.${t}.quantity`) ? r.quantity : ""
|
|
266
251
|
})
|
|
267
252
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ m(S, {
|
|
269
254
|
item: !0,
|
|
270
255
|
xs: 6,
|
|
271
256
|
md: 2,
|
|
272
|
-
children: /* @__PURE__ */
|
|
257
|
+
children: /* @__PURE__ */ m(T, {
|
|
273
258
|
required: !0,
|
|
274
259
|
fullWidth: !0,
|
|
275
260
|
size: "small",
|
|
@@ -279,9 +264,9 @@ function j() {
|
|
|
279
264
|
min: 0
|
|
280
265
|
},
|
|
281
266
|
label: "Unit Price",
|
|
282
|
-
InputProps: { startAdornment: /* @__PURE__ */
|
|
267
|
+
InputProps: { startAdornment: /* @__PURE__ */ m(C, {
|
|
283
268
|
position: "start",
|
|
284
|
-
children:
|
|
269
|
+
children: j
|
|
285
270
|
}) },
|
|
286
271
|
value: e.salePrice,
|
|
287
272
|
onChange: (e) => W(t, "salePrice", e.target.value),
|
|
@@ -290,38 +275,38 @@ function j() {
|
|
|
290
275
|
helperText: z.show(`items.${t}.salePrice`) ? r.salePrice : ""
|
|
291
276
|
})
|
|
292
277
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ h(S, {
|
|
294
279
|
item: !0,
|
|
295
280
|
xs: 6,
|
|
296
281
|
md: 2,
|
|
297
282
|
sx: { textAlign: "right" },
|
|
298
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ m(E, {
|
|
299
284
|
variant: "caption",
|
|
300
285
|
color: "text.secondary",
|
|
301
286
|
sx: { display: "block" },
|
|
302
287
|
children: "Subtotal"
|
|
303
|
-
}), /* @__PURE__ */
|
|
288
|
+
}), /* @__PURE__ */ h(E, {
|
|
304
289
|
variant: "body1",
|
|
305
290
|
sx: {
|
|
306
291
|
fontWeight: 800,
|
|
307
292
|
fontVariantNumeric: "tabular-nums"
|
|
308
293
|
},
|
|
309
|
-
children: [
|
|
294
|
+
children: [j, d(i)]
|
|
310
295
|
})]
|
|
311
296
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ m(S, {
|
|
313
298
|
item: !0,
|
|
314
299
|
xs: 6,
|
|
315
300
|
md: 1,
|
|
316
301
|
sx: { textAlign: "right" },
|
|
317
|
-
children: /* @__PURE__ */
|
|
302
|
+
children: /* @__PURE__ */ m(fe, {
|
|
318
303
|
color: "error",
|
|
319
304
|
onClick: () => V({
|
|
320
305
|
...B,
|
|
321
306
|
items: B.items.filter((e, n) => n !== t)
|
|
322
307
|
}),
|
|
323
308
|
disabled: B.items.length === 1,
|
|
324
|
-
children: /* @__PURE__ */
|
|
309
|
+
children: /* @__PURE__ */ m(_e, {})
|
|
325
310
|
})
|
|
326
311
|
})
|
|
327
312
|
]
|
|
@@ -332,32 +317,32 @@ function j() {
|
|
|
332
317
|
]
|
|
333
318
|
})
|
|
334
319
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ m(y, {
|
|
336
321
|
sx: {
|
|
337
|
-
borderRadius:
|
|
322
|
+
borderRadius: 1.5,
|
|
338
323
|
bgcolor: "grey.50",
|
|
339
324
|
border: "1px solid",
|
|
340
325
|
borderColor: "divider",
|
|
341
326
|
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
|
|
342
327
|
},
|
|
343
|
-
children: /* @__PURE__ */
|
|
328
|
+
children: /* @__PURE__ */ h(b, {
|
|
344
329
|
sx: { p: 2.5 },
|
|
345
330
|
children: [
|
|
346
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ m(o, {
|
|
347
332
|
eyebrow: "Step 3",
|
|
348
333
|
title: "Bill summary",
|
|
349
334
|
hint: "Shows totals, previous balance, and what you're collecting. Any remainder becomes a note of what they owe.",
|
|
350
335
|
sx: { mb: 2 }
|
|
351
336
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ h(S, {
|
|
353
338
|
container: !0,
|
|
354
339
|
spacing: 2,
|
|
355
340
|
children: [
|
|
356
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ m(S, {
|
|
357
342
|
item: !0,
|
|
358
343
|
xs: 12,
|
|
359
344
|
md: 4,
|
|
360
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ m(T, {
|
|
361
346
|
required: !0,
|
|
362
347
|
fullWidth: !0,
|
|
363
348
|
size: "small",
|
|
@@ -374,35 +359,25 @@ function j() {
|
|
|
374
359
|
helperText: z.show("saleDate") ? X.saleDate : ""
|
|
375
360
|
})
|
|
376
361
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ m(S, {
|
|
378
363
|
item: !0,
|
|
379
364
|
xs: 12,
|
|
380
365
|
md: 4,
|
|
381
|
-
children: /* @__PURE__ */ m(
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
paymentMode: e.target.value
|
|
390
|
-
}),
|
|
391
|
-
children: [/* @__PURE__ */ p(T, {
|
|
392
|
-
value: "",
|
|
393
|
-
children: /* @__PURE__ */ p("em", { children: "—" })
|
|
394
|
-
}), ce.map((e) => /* @__PURE__ */ p(T, {
|
|
395
|
-
value: e.value,
|
|
396
|
-
children: e.label
|
|
397
|
-
}, e.value))]
|
|
398
|
-
})]
|
|
366
|
+
children: /* @__PURE__ */ m(a, {
|
|
367
|
+
label: "Payment Mode",
|
|
368
|
+
value: B.paymentMode || "",
|
|
369
|
+
onChange: (e) => V({
|
|
370
|
+
...B,
|
|
371
|
+
paymentMode: e
|
|
372
|
+
}),
|
|
373
|
+
options: ce
|
|
399
374
|
})
|
|
400
375
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ m(S, {
|
|
402
377
|
item: !0,
|
|
403
378
|
xs: 12,
|
|
404
379
|
md: 4,
|
|
405
|
-
children: /* @__PURE__ */
|
|
380
|
+
children: /* @__PURE__ */ m(T, {
|
|
406
381
|
fullWidth: !0,
|
|
407
382
|
size: "small",
|
|
408
383
|
label: "Notes",
|
|
@@ -415,15 +390,15 @@ function j() {
|
|
|
415
390
|
})
|
|
416
391
|
]
|
|
417
392
|
}),
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ m(x, { sx: { my: 2 } }),
|
|
394
|
+
/* @__PURE__ */ h(w, {
|
|
420
395
|
spacing: 1.25,
|
|
421
396
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ h(w, {
|
|
423
398
|
direction: "row",
|
|
424
399
|
justifyContent: "space-between",
|
|
425
400
|
alignItems: "baseline",
|
|
426
|
-
children: [/* @__PURE__ */
|
|
401
|
+
children: [/* @__PURE__ */ h(E, {
|
|
427
402
|
variant: "body2",
|
|
428
403
|
color: "text.secondary",
|
|
429
404
|
children: [
|
|
@@ -433,45 +408,45 @@ function j() {
|
|
|
433
408
|
B.items.length === 1 ? "line" : "lines",
|
|
434
409
|
")"
|
|
435
410
|
]
|
|
436
|
-
}), /* @__PURE__ */
|
|
411
|
+
}), /* @__PURE__ */ h(E, {
|
|
437
412
|
variant: "h5",
|
|
438
413
|
sx: {
|
|
439
414
|
fontWeight: 800,
|
|
440
415
|
fontVariantNumeric: "tabular-nums"
|
|
441
416
|
},
|
|
442
|
-
children: [
|
|
417
|
+
children: [j, d(G)]
|
|
443
418
|
})]
|
|
444
419
|
}),
|
|
445
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ h(w, {
|
|
446
421
|
direction: "row",
|
|
447
422
|
justifyContent: "space-between",
|
|
448
423
|
alignItems: "baseline",
|
|
449
|
-
children: [/* @__PURE__ */
|
|
424
|
+
children: [/* @__PURE__ */ m(E, {
|
|
450
425
|
variant: "body2",
|
|
451
426
|
color: "text.secondary",
|
|
452
427
|
children: "Previous Due"
|
|
453
|
-
}), /* @__PURE__ */
|
|
428
|
+
}), /* @__PURE__ */ h(E, {
|
|
454
429
|
variant: "body1",
|
|
455
430
|
sx: {
|
|
456
431
|
fontWeight: 700,
|
|
457
432
|
fontVariantNumeric: "tabular-nums",
|
|
458
433
|
color: K > 0 ? "warning.dark" : "text.primary"
|
|
459
434
|
},
|
|
460
|
-
children: [
|
|
435
|
+
children: [j, d(K)]
|
|
461
436
|
})]
|
|
462
437
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ m(x, { sx: { my: .5 } }),
|
|
439
|
+
/* @__PURE__ */ h(w, {
|
|
465
440
|
direction: "row",
|
|
466
441
|
justifyContent: "space-between",
|
|
467
442
|
alignItems: "center",
|
|
468
443
|
spacing: 2,
|
|
469
|
-
children: [/* @__PURE__ */
|
|
444
|
+
children: [/* @__PURE__ */ m(E, {
|
|
470
445
|
variant: "body2",
|
|
471
446
|
color: "text.secondary",
|
|
472
447
|
sx: { flexShrink: 0 },
|
|
473
448
|
children: "Amount Collecting Now"
|
|
474
|
-
}), /* @__PURE__ */
|
|
449
|
+
}), /* @__PURE__ */ m(T, {
|
|
475
450
|
size: "small",
|
|
476
451
|
type: "number",
|
|
477
452
|
inputProps: {
|
|
@@ -483,9 +458,9 @@ function j() {
|
|
|
483
458
|
fontWeight: 700
|
|
484
459
|
}
|
|
485
460
|
},
|
|
486
|
-
InputProps: { startAdornment: /* @__PURE__ */
|
|
461
|
+
InputProps: { startAdornment: /* @__PURE__ */ m(C, {
|
|
487
462
|
position: "start",
|
|
488
|
-
children:
|
|
463
|
+
children: j
|
|
489
464
|
}) },
|
|
490
465
|
sx: { width: 200 },
|
|
491
466
|
value: B.collectingNow,
|
|
@@ -499,39 +474,39 @@ function j() {
|
|
|
499
474
|
helperText: z.show("collectingNow") ? X.collectingNow : ""
|
|
500
475
|
})]
|
|
501
476
|
}),
|
|
502
|
-
/* @__PURE__ */
|
|
477
|
+
/* @__PURE__ */ h(w, {
|
|
503
478
|
direction: "row",
|
|
504
479
|
justifyContent: "space-between",
|
|
505
480
|
alignItems: "baseline",
|
|
506
|
-
children: [/* @__PURE__ */
|
|
481
|
+
children: [/* @__PURE__ */ m(E, {
|
|
507
482
|
variant: "body2",
|
|
508
483
|
color: "text.secondary",
|
|
509
484
|
children: "Remaining Due (after this sale)"
|
|
510
|
-
}), /* @__PURE__ */
|
|
485
|
+
}), /* @__PURE__ */ h(E, {
|
|
511
486
|
variant: "h5",
|
|
512
487
|
sx: {
|
|
513
488
|
fontWeight: 800,
|
|
514
489
|
fontVariantNumeric: "tabular-nums",
|
|
515
490
|
color: Y > 0 ? "warning.dark" : "success.dark"
|
|
516
491
|
},
|
|
517
|
-
children: [
|
|
492
|
+
children: [j, d(Y)]
|
|
518
493
|
})]
|
|
519
494
|
})
|
|
520
495
|
]
|
|
521
496
|
}),
|
|
522
|
-
|
|
497
|
+
A && Y > 0 ? /* @__PURE__ */ h(_, {
|
|
523
498
|
severity: "warning",
|
|
524
499
|
sx: { mt: 2 },
|
|
525
500
|
children: [
|
|
526
|
-
|
|
527
|
-
|
|
501
|
+
j,
|
|
502
|
+
d(Y),
|
|
528
503
|
" will be recorded as pending dues",
|
|
529
|
-
|
|
504
|
+
F ? /* @__PURE__ */ h(ue, { children: [
|
|
530
505
|
" ",
|
|
531
506
|
"for ",
|
|
532
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ m("strong", { children: F })
|
|
533
508
|
] }) : null,
|
|
534
|
-
J > 0 && K > 0 ? ` (${
|
|
509
|
+
J > 0 && K > 0 ? ` (${j}${d(J)} from this sale + ${j}${d(K)} previously outstanding).` : J > 0 ? " from this sale." : " from previously outstanding dues."
|
|
535
510
|
]
|
|
536
511
|
}) : null
|
|
537
512
|
]
|
|
@@ -542,6 +517,6 @@ function j() {
|
|
|
542
517
|
})] });
|
|
543
518
|
}
|
|
544
519
|
//#endregion
|
|
545
|
-
export {
|
|
520
|
+
export { k as default };
|
|
546
521
|
|
|
547
|
-
//# sourceMappingURL=SaleCreatePage-
|
|
522
|
+
//# sourceMappingURL=SaleCreatePage-DxFvPvju.js.map
|