@burdenoff/microfe-healthybowl 2026.1018.2 → 2026.1018.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/healthybowl/offline/OfflineStatusPill.js +1 -1
- package/dist/healthybowl/pages/contracts/ContractsPage.js +391 -344
- package/dist/healthybowl/pages/crops/CropDetailsPage.js +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +1 -1
- package/dist/healthybowl/pages/financial/FinancialDashboardPage.js +10 -7
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js +1 -1
- package/dist/healthybowl/pages/livestock/VaccinationSchedulePage.js +1 -1
- package/dist/healthybowl/pages/marketplace/MarketplacePage.js +1 -1
- package/dist/healthybowl/pages/storage/StoragePage.js +1 -1
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ var p = ({ inline: p, compact: m, className: h }) => {
|
|
|
17
17
|
onClick: () => void T({ manual: !0 }),
|
|
18
18
|
disabled: y || !v,
|
|
19
19
|
title: v ? "Sync now" : "Reconnect to sync",
|
|
20
|
-
className: `
|
|
20
|
+
className: `shrink-0 items-center gap-1.5 rounded-lg bg-bg-surface px-2.5 py-1 text-xs font-semibold text-text-primary shadow-sm ring-1 ring-border-subtle transition hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50 ${m ? "hidden lg:inline-flex" : "inline-flex"}`,
|
|
21
21
|
children: [/* @__PURE__ */ d(s, { className: `h-3.5 w-3.5 ${y ? "animate-spin" : ""}` }), "Sync Now"]
|
|
22
22
|
});
|
|
23
23
|
return m ? /* @__PURE__ */ f("div", {
|
|
@@ -1,575 +1,622 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { useHealthyBowl as e } from "../../context/HealthyBowlContext.js";
|
|
2
|
+
import { formatCurrency as t, formatDateOnly as n } from "../../utils/helpers.js";
|
|
3
|
+
import { PageLayout as r } from "../../components/PageLayout.js";
|
|
4
|
+
import { StatCard as i } from "../../components/StatCard.js";
|
|
5
|
+
import { StatusBadge as a } from "../../components/StatusBadge.js";
|
|
6
|
+
import { EmptyState as ee } from "../../components/EmptyState.js";
|
|
6
7
|
import { ErrorState as o } from "../../components/ErrorState.js";
|
|
7
8
|
import { useConfirm as s } from "../../components/ConfirmDialog.js";
|
|
8
9
|
import { PageLoader as c } from "../../components/PageLoader.js";
|
|
9
10
|
import { Modal as l } from "../../components/Modal.js";
|
|
10
|
-
import { useToast as
|
|
11
|
+
import { useToast as te } from "../../hooks/useToast.js";
|
|
11
12
|
import "../../components/index.js";
|
|
12
|
-
import { useHealthyBowlContractDetail as
|
|
13
|
-
import { assignmentStatusVariant as
|
|
14
|
-
import { gradedDeliveries as
|
|
15
|
-
import { CreateContractModal as
|
|
16
|
-
import { InviteFarmModal as
|
|
17
|
-
import { RecordDeliveryModal as
|
|
18
|
-
import { DeliveryActionModal as
|
|
19
|
-
import { DeliveryGrade as
|
|
20
|
-
import { useMemo as
|
|
21
|
-
import { useI18n as
|
|
22
|
-
import { BadgeIndianRupee as
|
|
23
|
-
import { Fragment as
|
|
24
|
-
import { Button as
|
|
13
|
+
import { useHealthyBowlContractDetail as ne, useHealthyBowlContracts as re } from "../../hooks/useHealthyBowlContracts.js";
|
|
14
|
+
import { assignmentStatusVariant as ie, contractStatusVariant as u, deliveryStatusVariant as ae, formatQty as d, fulfilmentLabel as oe, healthLabel as se, healthVariant as ce, humanizeEnum as f } from "../../utils/contracts.js";
|
|
15
|
+
import { gradedDeliveries as le, parseGradeResult as ue, summariseGrade as p } from "../../utils/qualitySpec.js";
|
|
16
|
+
import { CreateContractModal as de } from "./contract-forms/CreateContractModal.js";
|
|
17
|
+
import { InviteFarmModal as fe } from "./contract-forms/InviteFarmModal.js";
|
|
18
|
+
import { RecordDeliveryModal as pe } from "./contract-forms/RecordDeliveryModal.js";
|
|
19
|
+
import { DeliveryActionModal as me } from "./contract-forms/DeliveryActionModal.js";
|
|
20
|
+
import { DeliveryGrade as m } from "./DeliveryGrade.js";
|
|
21
|
+
import { useEffect as he, useMemo as ge, useRef as h, useState as g } from "react";
|
|
22
|
+
import { useI18n as _e } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
23
|
+
import { BadgeIndianRupee as _, CheckCircle2 as v, ClipboardCheck as ve, FileSignature as y, Gauge as ye, Handshake as be, Inbox as xe, Info as Se, Plus as b, Trash2 as Ce, Truck as we, UserPlus as Te, Users as Ee, Wallet as De } from "lucide-react";
|
|
24
|
+
import { Fragment as Oe, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
25
|
+
import { Button as C } from "@burdenoff/fe-libs/ui";
|
|
26
|
+
import { CombinedGraphQLErrors as w } from "@apollo/client";
|
|
27
|
+
import { PermissionProvider as T, usePermissions as ke } from "@burdenoff/fe-libs/shared/providers/shell/PermissionProvider";
|
|
25
28
|
//#region src/healthybowl/pages/contracts/ContractsPage.tsx
|
|
26
|
-
var
|
|
27
|
-
function
|
|
28
|
-
let {
|
|
29
|
-
|
|
29
|
+
var E = "px-3 py-2 text-start text-xs font-medium uppercase tracking-wide text-text-secondary", D = "px-3 py-2 text-sm text-text-primary";
|
|
30
|
+
function O() {
|
|
31
|
+
let { workspaceId: t, currentUser: n } = e();
|
|
32
|
+
return /* @__PURE__ */ x(T, {
|
|
33
|
+
scopeId: t || null,
|
|
34
|
+
gateway: "workspace",
|
|
35
|
+
children: /* @__PURE__ */ x(k, { workspaceId: t })
|
|
36
|
+
}, JSON.stringify([t, n?.id]));
|
|
37
|
+
}
|
|
38
|
+
function k({ workspaceId: e }) {
|
|
39
|
+
let { t: T } = _e(), { toast: O } = te(), k = s(), { hasPermission: A, isLoading: Ae, error: je, scopeId: Me } = ke(), j = !!e && Me === e && !Ae && !je, M = !!(j && A("healthybowl_contract_assignment:update")), N = !!(j && A("healthybowl_contract_assignment:delete")), P = h({
|
|
40
|
+
canAccept: M,
|
|
41
|
+
canRevoke: N
|
|
42
|
+
});
|
|
43
|
+
P.current = {
|
|
44
|
+
canAccept: M,
|
|
45
|
+
canRevoke: N
|
|
46
|
+
};
|
|
47
|
+
let F = h(!1);
|
|
48
|
+
he(() => (F.current = !0, () => {
|
|
49
|
+
F.current = !1;
|
|
50
|
+
}), []);
|
|
51
|
+
let { dashboard: I, contracts: L, invitations: R, obligations: z, loading: Ne, error: Pe, refetchAll: Fe, createContract: Ie, activateContract: Le, inviteFarm: Re, acceptAssignment: ze, revokeAssignment: Be, recordDelivery: Ve, gradeDelivery: He, settleDelivery: Ue } = re(), [We, B] = g(!1), [Ge, V] = g(!1), [Ke, H] = g(!1), [U, W] = g(null), [G, K] = g(null), q = ne(U), J = ge(() => L.find((e) => e.id === U) ?? null, [L, U]), Y = (e) => O({
|
|
52
|
+
title: T("healthybowl.common.error", "Something went wrong"),
|
|
30
53
|
description: e instanceof Error ? e.message : void 0,
|
|
31
54
|
variant: "error"
|
|
32
|
-
}),
|
|
33
|
-
|
|
34
|
-
|
|
55
|
+
}), X = () => O({
|
|
56
|
+
title: T("healthybowl.contracts.permissionDenied.title", "Contract action not permitted"),
|
|
57
|
+
description: T("healthybowl.contracts.permissionDenied.description", "Your current permissions do not allow this action on this farm assignment. Ask your workspace administrator for access."),
|
|
58
|
+
variant: "error"
|
|
59
|
+
}), Z = (e) => {
|
|
60
|
+
w.is(e) && e.errors.some((e) => e.extensions?.code === "FORBIDDEN" && !e.extensions?.authFailure) ? X() : Y(e);
|
|
61
|
+
}, Q = async (e) => {
|
|
62
|
+
await Ie(e), O({
|
|
63
|
+
title: T("healthybowl.contracts.toast.created", "Contract created"),
|
|
35
64
|
variant: "success"
|
|
36
65
|
});
|
|
37
|
-
},
|
|
38
|
-
|
|
66
|
+
}, qe = async (e) => {
|
|
67
|
+
U && (await Re({
|
|
39
68
|
...e,
|
|
40
|
-
contractId:
|
|
41
|
-
}), await
|
|
42
|
-
title:
|
|
69
|
+
contractId: U
|
|
70
|
+
}), await q.refetch(), O({
|
|
71
|
+
title: T("healthybowl.contracts.toast.invited", "Farm invited"),
|
|
43
72
|
variant: "success"
|
|
44
73
|
}));
|
|
45
|
-
},
|
|
46
|
-
await
|
|
47
|
-
title:
|
|
74
|
+
}, Je = async (e) => {
|
|
75
|
+
await Ve(e), await q.refetch(), O({
|
|
76
|
+
title: T("healthybowl.contracts.toast.recorded", "Delivery recorded"),
|
|
48
77
|
variant: "success"
|
|
49
78
|
});
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
title:
|
|
79
|
+
}, Ye = async (e) => {
|
|
80
|
+
G && (G.mode === "grade" ? (await He(e), O({
|
|
81
|
+
title: T("healthybowl.contracts.toast.graded", "Delivery graded"),
|
|
53
82
|
variant: "success"
|
|
54
|
-
})) : (await
|
|
55
|
-
title:
|
|
83
|
+
})) : (await Ue(e), O({
|
|
84
|
+
title: T("healthybowl.contracts.toast.settled", "Delivery settled"),
|
|
56
85
|
variant: "success"
|
|
57
|
-
})), await
|
|
58
|
-
},
|
|
86
|
+
})), await q.refetch());
|
|
87
|
+
}, Xe = async (e) => {
|
|
59
88
|
try {
|
|
60
|
-
await
|
|
61
|
-
title:
|
|
89
|
+
await Le(e.id), await q.refetch(), O({
|
|
90
|
+
title: T("healthybowl.contracts.toast.activated", "Contract activated"),
|
|
62
91
|
variant: "success"
|
|
63
92
|
});
|
|
64
93
|
} catch (e) {
|
|
65
|
-
|
|
94
|
+
Y(e);
|
|
66
95
|
}
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
96
|
+
}, Ze = async (e) => {
|
|
97
|
+
if (F.current) {
|
|
98
|
+
if (!P.current.canAccept) {
|
|
99
|
+
X();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
await ze(e), O({
|
|
104
|
+
title: T("healthybowl.contracts.toast.accepted", "Invitation accepted"),
|
|
105
|
+
variant: "success"
|
|
106
|
+
});
|
|
107
|
+
} catch (e) {
|
|
108
|
+
Z(e);
|
|
109
|
+
}
|
|
75
110
|
}
|
|
76
|
-
},
|
|
77
|
-
if (
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
111
|
+
}, Qe = async (e, t) => {
|
|
112
|
+
if (F.current) {
|
|
113
|
+
if (!P.current.canRevoke) {
|
|
114
|
+
X();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (!(!await k({
|
|
118
|
+
title: T("healthybowl.contracts.revoke.title", "Revoke assignment?"),
|
|
119
|
+
message: T("healthybowl.contracts.revoke.body", "This immediately stops all data sharing with {{f}}.", { f: t }),
|
|
120
|
+
okButtonTitle: T("healthybowl.common.remove", "Revoke"),
|
|
121
|
+
destructive: !0
|
|
122
|
+
}) || !F.current)) {
|
|
123
|
+
if (!P.current.canRevoke) {
|
|
124
|
+
X();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
await Be(e), await q.refetch(), O({
|
|
129
|
+
title: T("healthybowl.contracts.toast.revoked", "Assignment revoked"),
|
|
130
|
+
variant: "success"
|
|
131
|
+
});
|
|
132
|
+
} catch (e) {
|
|
133
|
+
Z(e);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
89
136
|
}
|
|
90
|
-
}, $ =
|
|
137
|
+
}, $ = R.length > 0 || z.length > 0, $e = L.length > 0 || !$, et = /* @__PURE__ */ S(C, {
|
|
91
138
|
size: "sm",
|
|
92
|
-
onClick: () =>
|
|
93
|
-
children: [/* @__PURE__ */
|
|
94
|
-
}),
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
open:
|
|
97
|
-
onClose: () =>
|
|
98
|
-
onSubmit:
|
|
139
|
+
onClick: () => B(!0),
|
|
140
|
+
children: [/* @__PURE__ */ x(b, { className: "h-3.5 w-3.5" }), T("healthybowl.contracts.newContract", "New contract")]
|
|
141
|
+
}), tt = /* @__PURE__ */ S(Oe, { children: [
|
|
142
|
+
/* @__PURE__ */ x(de, {
|
|
143
|
+
open: We,
|
|
144
|
+
onClose: () => B(!1),
|
|
145
|
+
onSubmit: Q
|
|
99
146
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
open:
|
|
102
|
-
onClose: () =>
|
|
103
|
-
contractCrop:
|
|
104
|
-
onSubmit:
|
|
147
|
+
/* @__PURE__ */ x(fe, {
|
|
148
|
+
open: Ge,
|
|
149
|
+
onClose: () => V(!1),
|
|
150
|
+
contractCrop: J?.crop,
|
|
151
|
+
onSubmit: qe
|
|
105
152
|
}),
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
open:
|
|
108
|
-
onClose: () =>
|
|
109
|
-
contractId:
|
|
110
|
-
assignments:
|
|
111
|
-
onSubmit:
|
|
153
|
+
/* @__PURE__ */ x(pe, {
|
|
154
|
+
open: Ke,
|
|
155
|
+
onClose: () => H(!1),
|
|
156
|
+
contractId: U ?? "",
|
|
157
|
+
assignments: q.assignments,
|
|
158
|
+
onSubmit: Je
|
|
112
159
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
open:
|
|
115
|
-
mode:
|
|
116
|
-
delivery:
|
|
117
|
-
agreedPrice:
|
|
118
|
-
qualitySpec:
|
|
119
|
-
unit:
|
|
120
|
-
onClose: () =>
|
|
121
|
-
onSubmit:
|
|
160
|
+
/* @__PURE__ */ x(me, {
|
|
161
|
+
open: G != null,
|
|
162
|
+
mode: G?.mode ?? "grade",
|
|
163
|
+
delivery: G?.delivery ?? null,
|
|
164
|
+
agreedPrice: J?.agreedPrice ?? 0,
|
|
165
|
+
qualitySpec: J?.qualitySpec ?? null,
|
|
166
|
+
unit: J?.unit,
|
|
167
|
+
onClose: () => K(null),
|
|
168
|
+
onSubmit: Ye
|
|
122
169
|
})
|
|
123
170
|
] });
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
title:
|
|
126
|
-
description:
|
|
171
|
+
return /* @__PURE__ */ S(r, {
|
|
172
|
+
title: T("healthybowl.contracts.title", "Contracts"),
|
|
173
|
+
description: T("healthybowl.contracts.subtitle", "Contract & managed farming"),
|
|
127
174
|
purpose: "Run forward crop programmes across your contracted farms: agree a crop, quota, quality spec and price, invite farms (they accept from their own workspace before any data is shared), then track fulfilment as harvest is delivered, graded, and settled back to the farm — net of any input advance. Contracted farmers see their own quota, agreed price and payments received.",
|
|
128
|
-
actions:
|
|
129
|
-
children: [
|
|
175
|
+
actions: et,
|
|
176
|
+
children: [Ne && L.length === 0 && !$ ? /* @__PURE__ */ x(c, {}) : Pe && L.length === 0 && !$ ? /* @__PURE__ */ x(o, { onRetry: Fe }) : /* @__PURE__ */ S("div", {
|
|
130
177
|
className: "space-y-8",
|
|
131
178
|
children: [
|
|
132
|
-
|
|
179
|
+
$e ? /* @__PURE__ */ S("section", {
|
|
133
180
|
className: "space-y-4",
|
|
134
181
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ S("div", {
|
|
136
183
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
137
184
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ x(i, {
|
|
139
186
|
hero: !0,
|
|
140
|
-
label:
|
|
141
|
-
value:
|
|
142
|
-
icon: /* @__PURE__ */
|
|
187
|
+
label: T("healthybowl.contracts.kpi.active", "Active contracts"),
|
|
188
|
+
value: I?.activeContracts ?? 0,
|
|
189
|
+
icon: /* @__PURE__ */ x(be, { className: "h-4 w-4" })
|
|
143
190
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
label:
|
|
146
|
-
value:
|
|
147
|
-
icon: /* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ x(i, {
|
|
192
|
+
label: T("healthybowl.contracts.kpi.farms", "Contracted farms"),
|
|
193
|
+
value: I?.contractedFarms ?? 0,
|
|
194
|
+
icon: /* @__PURE__ */ x(Ee, { className: "h-4 w-4" })
|
|
148
195
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
label:
|
|
151
|
-
value: `${
|
|
152
|
-
icon: /* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ x(i, {
|
|
197
|
+
label: T("healthybowl.contracts.kpi.fulfilment", "Avg fulfilment %"),
|
|
198
|
+
value: `${I?.avgFulfilmentPct ?? 0}%`,
|
|
199
|
+
icon: /* @__PURE__ */ x(ye, { className: "h-4 w-4" })
|
|
153
200
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
label:
|
|
156
|
-
value:
|
|
157
|
-
icon: /* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ x(i, {
|
|
202
|
+
label: T("healthybowl.contracts.kpi.settlementDue", "Settlement due"),
|
|
203
|
+
value: t(I?.settlementDue ?? 0, "INR"),
|
|
204
|
+
icon: /* @__PURE__ */ x(De, { className: "h-4 w-4" })
|
|
158
205
|
})
|
|
159
206
|
]
|
|
160
207
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ S("div", {
|
|
162
209
|
className: "flex items-start gap-2 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3 text-xs text-text-secondary",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ x(Se, { className: "mt-0.5 h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ x("p", { children: T("healthybowl.contracts.dashboard.scopeNotice", "Fulfilment % and contracted-farm totals roll up delivered quantity across all farms on a contract. Delivery does not yet combine farms into one lot, order or shipment — each farm’s delivery creates its own order and shipment in its own workspace, so received produce is still reconciled per farm, one delivery at a time.") })]
|
|
164
211
|
}),
|
|
165
|
-
|
|
166
|
-
icon: /* @__PURE__ */
|
|
167
|
-
title:
|
|
168
|
-
description:
|
|
169
|
-
action: /* @__PURE__ */
|
|
170
|
-
onClick: () =>
|
|
171
|
-
children: [/* @__PURE__ */
|
|
212
|
+
L.length === 0 ? /* @__PURE__ */ x(ee, {
|
|
213
|
+
icon: /* @__PURE__ */ x(y, { className: "h-8 w-8 text-success" }),
|
|
214
|
+
title: T("healthybowl.contracts.empty.title", "No contracts yet"),
|
|
215
|
+
description: T("healthybowl.contracts.empty.description", "Create a forward crop programme, invite your contracted farms, and track fulfilment and settlement here."),
|
|
216
|
+
action: /* @__PURE__ */ S(C, {
|
|
217
|
+
onClick: () => B(!0),
|
|
218
|
+
children: [/* @__PURE__ */ x(b, { className: "h-4 w-4" }), T("healthybowl.contracts.newContract", "New contract")]
|
|
172
219
|
})
|
|
173
|
-
}) : /* @__PURE__ */
|
|
220
|
+
}) : /* @__PURE__ */ x("div", {
|
|
174
221
|
className: "overflow-x-auto rounded-lg border border-border-subtle",
|
|
175
|
-
children: /* @__PURE__ */
|
|
222
|
+
children: /* @__PURE__ */ S("table", {
|
|
176
223
|
className: "min-w-full divide-y divide-border-subtle",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
224
|
+
children: [/* @__PURE__ */ x("thead", {
|
|
178
225
|
className: "bg-bg-surface",
|
|
179
|
-
children: /* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
className:
|
|
182
|
-
children:
|
|
226
|
+
children: /* @__PURE__ */ S("tr", { children: [
|
|
227
|
+
/* @__PURE__ */ x("th", {
|
|
228
|
+
className: E,
|
|
229
|
+
children: T("healthybowl.contracts.col.crop", "Crop")
|
|
183
230
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
className:
|
|
186
|
-
children:
|
|
231
|
+
/* @__PURE__ */ x("th", {
|
|
232
|
+
className: E,
|
|
233
|
+
children: T("healthybowl.contracts.col.status", "Status")
|
|
187
234
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
className:
|
|
190
|
-
children:
|
|
235
|
+
/* @__PURE__ */ x("th", {
|
|
236
|
+
className: E,
|
|
237
|
+
children: T("healthybowl.contracts.col.fulfilment", "Delivered / quota")
|
|
191
238
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
className:
|
|
194
|
-
children:
|
|
239
|
+
/* @__PURE__ */ x("th", {
|
|
240
|
+
className: E,
|
|
241
|
+
children: T("healthybowl.contracts.col.pct", "Fulfilment")
|
|
195
242
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
className:
|
|
198
|
-
children:
|
|
243
|
+
/* @__PURE__ */ x("th", {
|
|
244
|
+
className: E,
|
|
245
|
+
children: T("healthybowl.contracts.col.price", "Price")
|
|
199
246
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
className:
|
|
202
|
-
children:
|
|
247
|
+
/* @__PURE__ */ x("th", {
|
|
248
|
+
className: E,
|
|
249
|
+
children: T("healthybowl.contracts.col.farms", "Farms")
|
|
203
250
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
className:
|
|
206
|
-
children:
|
|
251
|
+
/* @__PURE__ */ x("th", {
|
|
252
|
+
className: E,
|
|
253
|
+
children: T("healthybowl.contracts.col.due", "Settlement due")
|
|
207
254
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
className:
|
|
210
|
-
children:
|
|
255
|
+
/* @__PURE__ */ x("th", {
|
|
256
|
+
className: E,
|
|
257
|
+
children: T("healthybowl.contracts.col.health", "Health")
|
|
211
258
|
})
|
|
212
259
|
] })
|
|
213
|
-
}), /* @__PURE__ */
|
|
260
|
+
}), /* @__PURE__ */ x("tbody", {
|
|
214
261
|
className: "divide-y divide-border-subtle",
|
|
215
|
-
children:
|
|
216
|
-
let n =
|
|
217
|
-
return /* @__PURE__ */
|
|
262
|
+
children: L.map((e) => {
|
|
263
|
+
let n = I?.contracts.find((t) => t.contractId === e.id);
|
|
264
|
+
return /* @__PURE__ */ S("tr", {
|
|
218
265
|
className: "cursor-pointer hover:bg-bg-surface",
|
|
219
|
-
onClick: () =>
|
|
266
|
+
onClick: () => W(e.id),
|
|
220
267
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
-
className:
|
|
223
|
-
children: [/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ S("td", {
|
|
269
|
+
className: D,
|
|
270
|
+
children: [/* @__PURE__ */ x("div", {
|
|
224
271
|
className: "font-medium",
|
|
225
|
-
children:
|
|
226
|
-
}),
|
|
272
|
+
children: e.crop
|
|
273
|
+
}), e.variety ? /* @__PURE__ */ x("div", {
|
|
227
274
|
className: "text-xs text-text-secondary",
|
|
228
|
-
children:
|
|
275
|
+
children: e.variety
|
|
229
276
|
}) : null]
|
|
230
277
|
}),
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
className:
|
|
233
|
-
children: /* @__PURE__ */
|
|
234
|
-
variant:
|
|
235
|
-
label:
|
|
278
|
+
/* @__PURE__ */ x("td", {
|
|
279
|
+
className: D,
|
|
280
|
+
children: /* @__PURE__ */ x(a, {
|
|
281
|
+
variant: u(e.status),
|
|
282
|
+
label: f(e.status)
|
|
236
283
|
})
|
|
237
284
|
}),
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
className: `${
|
|
240
|
-
children:
|
|
285
|
+
/* @__PURE__ */ x("td", {
|
|
286
|
+
className: `${D} tabular-nums`,
|
|
287
|
+
children: oe(n?.deliveredQty ?? 0, e.quotaQty, e.unit)
|
|
241
288
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
className: `${
|
|
289
|
+
/* @__PURE__ */ S("td", {
|
|
290
|
+
className: `${D} tabular-nums`,
|
|
244
291
|
children: [n?.fulfilmentPct ?? 0, "%"]
|
|
245
292
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
className: `${
|
|
248
|
-
children: [e
|
|
293
|
+
/* @__PURE__ */ S("td", {
|
|
294
|
+
className: `${D} tabular-nums`,
|
|
295
|
+
children: [t(e.agreedPrice, "INR"), /* @__PURE__ */ S("span", {
|
|
249
296
|
className: "text-xs text-text-secondary",
|
|
250
|
-
children: ["/",
|
|
297
|
+
children: ["/", e.unit]
|
|
251
298
|
})]
|
|
252
299
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
-
className: `${
|
|
255
|
-
children:
|
|
300
|
+
/* @__PURE__ */ x("td", {
|
|
301
|
+
className: `${D} tabular-nums`,
|
|
302
|
+
children: e.acceptedFarmCount
|
|
256
303
|
}),
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
className: `${
|
|
259
|
-
children:
|
|
304
|
+
/* @__PURE__ */ x("td", {
|
|
305
|
+
className: `${D} tabular-nums`,
|
|
306
|
+
children: t(n?.settlementDue ?? 0, "INR")
|
|
260
307
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
className:
|
|
263
|
-
children: n ? /* @__PURE__ */
|
|
264
|
-
variant:
|
|
265
|
-
label:
|
|
308
|
+
/* @__PURE__ */ x("td", {
|
|
309
|
+
className: D,
|
|
310
|
+
children: n ? /* @__PURE__ */ x(a, {
|
|
311
|
+
variant: ce(n.health),
|
|
312
|
+
label: se(n.health)
|
|
266
313
|
}) : "—"
|
|
267
314
|
})
|
|
268
315
|
]
|
|
269
|
-
},
|
|
316
|
+
}, e.id);
|
|
270
317
|
})
|
|
271
318
|
})]
|
|
272
319
|
})
|
|
273
320
|
})
|
|
274
321
|
]
|
|
275
322
|
}) : null,
|
|
276
|
-
|
|
323
|
+
R.length > 0 ? /* @__PURE__ */ S("section", {
|
|
277
324
|
className: "space-y-3",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ S("h2", {
|
|
279
326
|
className: "flex items-center gap-2 text-lg font-semibold text-text-primary",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
281
|
-
}), /* @__PURE__ */
|
|
327
|
+
children: [/* @__PURE__ */ x(xe, { className: "h-5 w-5 text-info" }), T("healthybowl.contracts.invitations.title", "Contract invitations")]
|
|
328
|
+
}), /* @__PURE__ */ x("ul", {
|
|
282
329
|
className: "space-y-2",
|
|
283
|
-
children:
|
|
330
|
+
children: R.map((e) => /* @__PURE__ */ S("li", {
|
|
284
331
|
className: "flex flex-wrap items-center justify-between gap-3 rounded-lg border border-border-subtle bg-bg-surface px-4 py-3",
|
|
285
|
-
children: [/* @__PURE__ */
|
|
332
|
+
children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("div", {
|
|
286
333
|
className: "font-medium text-text-primary",
|
|
287
|
-
children: [e.crop ??
|
|
334
|
+
children: [e.crop ?? T("healthybowl.contracts.aContract", "A contract"), e.allocationQty ? /* @__PURE__ */ S("span", {
|
|
288
335
|
className: "ms-2 text-sm text-text-secondary",
|
|
289
336
|
children: [
|
|
290
|
-
|
|
337
|
+
d(e.allocationQty),
|
|
291
338
|
" ",
|
|
292
|
-
|
|
339
|
+
T("healthybowl.contracts.allocated", "allocated")
|
|
293
340
|
]
|
|
294
341
|
}) : null]
|
|
295
|
-
}), /* @__PURE__ */
|
|
342
|
+
}), /* @__PURE__ */ x("div", {
|
|
296
343
|
className: "text-xs text-text-secondary",
|
|
297
|
-
children:
|
|
298
|
-
})] }), /* @__PURE__ */
|
|
344
|
+
children: T("healthybowl.contracts.invitedOn", "Invited {{d}}", { d: n(e.invitedAt) })
|
|
345
|
+
})] }), M ? /* @__PURE__ */ S(C, {
|
|
299
346
|
size: "sm",
|
|
300
|
-
onClick: () =>
|
|
301
|
-
children: [/* @__PURE__ */
|
|
302
|
-
})]
|
|
347
|
+
onClick: () => Ze(e.id),
|
|
348
|
+
children: [/* @__PURE__ */ x(v, { className: "h-3.5 w-3.5" }), T("healthybowl.contracts.accept", "Accept")]
|
|
349
|
+
}) : null]
|
|
303
350
|
}, e.id))
|
|
304
351
|
})]
|
|
305
352
|
}) : null,
|
|
306
|
-
|
|
353
|
+
z.length > 0 ? /* @__PURE__ */ S("section", {
|
|
307
354
|
className: "space-y-3",
|
|
308
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ S("h2", {
|
|
309
356
|
className: "flex items-center gap-2 text-lg font-semibold text-text-primary",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
311
|
-
}), /* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ x(_, { className: "h-5 w-5 text-success" }), T("healthybowl.contracts.obligations.title", "My contract obligations")]
|
|
358
|
+
}), /* @__PURE__ */ x("div", {
|
|
312
359
|
className: "grid grid-cols-1 gap-3 md:grid-cols-2",
|
|
313
|
-
children:
|
|
314
|
-
let r =
|
|
315
|
-
return /* @__PURE__ */
|
|
360
|
+
children: z.map((e) => {
|
|
361
|
+
let r = le(e.deliveries);
|
|
362
|
+
return /* @__PURE__ */ S("div", {
|
|
316
363
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
317
364
|
children: [
|
|
318
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ S("div", {
|
|
319
366
|
className: "flex items-center justify-between",
|
|
320
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ x("div", {
|
|
321
368
|
className: "font-semibold text-text-primary",
|
|
322
|
-
children:
|
|
323
|
-
}), /* @__PURE__ */
|
|
369
|
+
children: e.crop
|
|
370
|
+
}), /* @__PURE__ */ x(a, {
|
|
324
371
|
variant: "success",
|
|
325
|
-
label:
|
|
372
|
+
label: T("healthybowl.contracts.status.active", "Active")
|
|
326
373
|
})]
|
|
327
374
|
}),
|
|
328
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ S("dl", {
|
|
329
376
|
className: "mt-3 grid grid-cols-2 gap-x-4 gap-y-2 text-sm",
|
|
330
377
|
children: [
|
|
331
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ x("dt", {
|
|
332
379
|
className: "text-text-secondary",
|
|
333
|
-
children:
|
|
380
|
+
children: T("healthybowl.contracts.obl.quota", "My quota")
|
|
334
381
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ x("dd", {
|
|
336
383
|
className: "text-end tabular-nums text-text-primary",
|
|
337
|
-
children:
|
|
384
|
+
children: d(e.quotaQty, e.unit)
|
|
338
385
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ x("dt", {
|
|
340
387
|
className: "text-text-secondary",
|
|
341
|
-
children:
|
|
388
|
+
children: T("healthybowl.contracts.obl.price", "Agreed price")
|
|
342
389
|
}),
|
|
343
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ S("dd", {
|
|
344
391
|
className: "text-end tabular-nums text-text-primary",
|
|
345
392
|
children: [
|
|
346
|
-
e
|
|
393
|
+
t(e.agreedPrice, "INR"),
|
|
347
394
|
"/",
|
|
348
|
-
|
|
395
|
+
e.unit
|
|
349
396
|
]
|
|
350
397
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ x("dt", {
|
|
352
399
|
className: "text-text-secondary",
|
|
353
|
-
children:
|
|
400
|
+
children: T("healthybowl.contracts.obl.delivered", "Delivered / accepted")
|
|
354
401
|
}),
|
|
355
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ S("dd", {
|
|
356
403
|
className: "text-end tabular-nums text-text-primary",
|
|
357
404
|
children: [
|
|
358
|
-
|
|
405
|
+
d(e.deliveredQty, e.unit),
|
|
359
406
|
" / ",
|
|
360
|
-
|
|
407
|
+
d(e.acceptedQty, e.unit)
|
|
361
408
|
]
|
|
362
409
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ x("dt", {
|
|
364
411
|
className: "text-text-secondary",
|
|
365
|
-
children:
|
|
412
|
+
children: T("healthybowl.contracts.obl.paid", "Payments received")
|
|
366
413
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ x("dd", {
|
|
368
415
|
className: "text-end font-semibold tabular-nums text-success",
|
|
369
|
-
children: e
|
|
416
|
+
children: t(e.paymentsReceived, "INR")
|
|
370
417
|
})
|
|
371
418
|
]
|
|
372
419
|
}),
|
|
373
|
-
r.length > 0 ? /* @__PURE__ */
|
|
420
|
+
r.length > 0 ? /* @__PURE__ */ S("div", {
|
|
374
421
|
className: "mt-3 border-t border-border-subtle pt-3",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
422
|
+
children: [/* @__PURE__ */ x("div", {
|
|
376
423
|
className: "text-xs font-medium text-text-secondary",
|
|
377
|
-
children:
|
|
378
|
-
}), /* @__PURE__ */
|
|
424
|
+
children: T("healthybowl.contracts.obl.graded", "How your deliveries were graded")
|
|
425
|
+
}), /* @__PURE__ */ x("ul", {
|
|
379
426
|
className: "mt-2 space-y-2",
|
|
380
|
-
children: r.map(({ delivery:
|
|
427
|
+
children: r.map(({ delivery: t, grade: r }) => /* @__PURE__ */ S("li", { children: [/* @__PURE__ */ S("div", {
|
|
381
428
|
className: "flex flex-wrap items-baseline justify-between gap-x-3 text-xs text-text-secondary tabular-nums",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ x("span", {
|
|
383
430
|
className: "text-text-primary",
|
|
384
|
-
children:
|
|
385
|
-
}), /* @__PURE__ */
|
|
386
|
-
|
|
431
|
+
children: t.deliveryWindow || (t.windowDate ? n(t.windowDate) : "") || T("healthybowl.contracts.obl.aDelivery", "Delivery")
|
|
432
|
+
}), /* @__PURE__ */ S("span", { children: [
|
|
433
|
+
d(t.acceptedQty, e.unit),
|
|
387
434
|
" /",
|
|
388
435
|
" ",
|
|
389
|
-
|
|
390
|
-
|
|
436
|
+
d(t.deliveredQty, e.unit),
|
|
437
|
+
t.rejectedQty > 0 ? /* @__PURE__ */ S("span", {
|
|
391
438
|
className: "ms-2 text-status-error-text",
|
|
392
439
|
children: [
|
|
393
|
-
|
|
440
|
+
T("healthybowl.contracts.rejectedShort", "Rejected"),
|
|
394
441
|
":",
|
|
395
442
|
" ",
|
|
396
|
-
|
|
443
|
+
d(t.rejectedQty, e.unit)
|
|
397
444
|
]
|
|
398
445
|
}) : null
|
|
399
446
|
] })]
|
|
400
|
-
}), /* @__PURE__ */
|
|
447
|
+
}), /* @__PURE__ */ x(m, {
|
|
401
448
|
grade: r,
|
|
402
|
-
summary:
|
|
403
|
-
t:
|
|
404
|
-
})] },
|
|
449
|
+
summary: p(r),
|
|
450
|
+
t: T
|
|
451
|
+
})] }, t.id))
|
|
405
452
|
})]
|
|
406
453
|
}) : null
|
|
407
454
|
]
|
|
408
|
-
},
|
|
455
|
+
}, e.assignmentId);
|
|
409
456
|
})
|
|
410
457
|
})]
|
|
411
458
|
}) : null,
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
open:
|
|
414
|
-
onClose: () =>
|
|
415
|
-
title:
|
|
416
|
-
description:
|
|
459
|
+
/* @__PURE__ */ x(l, {
|
|
460
|
+
open: U != null,
|
|
461
|
+
onClose: () => W(null),
|
|
462
|
+
title: J ? T("healthybowl.contracts.detail.title", "{{crop}} contract", { crop: J.crop }) : T("healthybowl.contracts.detail.titleGeneric", "Contract"),
|
|
463
|
+
description: J ? `${f(J.pricingModel)} · ${t(J.agreedPrice, "INR")}/${J.unit} · ${T("healthybowl.contracts.quota", "quota")} ${d(J.quotaQty, J.unit)}` : void 0,
|
|
417
464
|
size: "xl",
|
|
418
|
-
footer:
|
|
419
|
-
onClick: () =>
|
|
420
|
-
disabled:
|
|
421
|
-
title:
|
|
422
|
-
children: [/* @__PURE__ */
|
|
465
|
+
footer: J && String(J.status).toLowerCase() === "draft" ? /* @__PURE__ */ S(C, {
|
|
466
|
+
onClick: () => Xe(J),
|
|
467
|
+
disabled: J.acceptedFarmCount < 1,
|
|
468
|
+
title: J.acceptedFarmCount < 1 ? T("healthybowl.contracts.activateHint", "At least one farm must accept before activating") : void 0,
|
|
469
|
+
children: [/* @__PURE__ */ x(v, { className: "h-4 w-4" }), T("healthybowl.contracts.activate", "Activate contract")]
|
|
423
470
|
}) : null,
|
|
424
|
-
children:
|
|
471
|
+
children: J ? /* @__PURE__ */ S("div", {
|
|
425
472
|
className: "space-y-6",
|
|
426
473
|
children: [
|
|
427
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ S("div", {
|
|
428
475
|
className: "flex items-center gap-2",
|
|
429
|
-
children: [/* @__PURE__ */
|
|
430
|
-
variant:
|
|
431
|
-
label:
|
|
432
|
-
}),
|
|
476
|
+
children: [/* @__PURE__ */ x(a, {
|
|
477
|
+
variant: u(J.status),
|
|
478
|
+
label: f(J.status)
|
|
479
|
+
}), J.documentFileId ? /* @__PURE__ */ S("span", {
|
|
433
480
|
className: "inline-flex items-center gap-1 text-xs text-text-secondary",
|
|
434
|
-
children: [/* @__PURE__ */
|
|
481
|
+
children: [/* @__PURE__ */ x(y, { className: "h-3.5 w-3.5" }), T("healthybowl.contracts.signedDoc", "Signed document attached")]
|
|
435
482
|
}) : null]
|
|
436
483
|
}),
|
|
437
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("div", {
|
|
438
485
|
className: "mb-2 flex items-center justify-between",
|
|
439
|
-
children: [/* @__PURE__ */
|
|
486
|
+
children: [/* @__PURE__ */ x("h3", {
|
|
440
487
|
className: "text-sm font-semibold text-text-primary",
|
|
441
|
-
children:
|
|
442
|
-
}), /* @__PURE__ */
|
|
488
|
+
children: T("healthybowl.contracts.assignments", "Farms")
|
|
489
|
+
}), /* @__PURE__ */ S(C, {
|
|
443
490
|
variant: "outline",
|
|
444
491
|
size: "sm",
|
|
445
|
-
onClick: () =>
|
|
446
|
-
children: [/* @__PURE__ */
|
|
492
|
+
onClick: () => V(!0),
|
|
493
|
+
children: [/* @__PURE__ */ x(Te, { className: "h-3.5 w-3.5" }), T("healthybowl.contracts.inviteFarm", "Invite farm")]
|
|
447
494
|
})]
|
|
448
|
-
}),
|
|
495
|
+
}), q.assignments.length === 0 ? /* @__PURE__ */ x("p", {
|
|
449
496
|
className: "text-sm text-text-secondary",
|
|
450
|
-
children:
|
|
451
|
-
}) : /* @__PURE__ */
|
|
497
|
+
children: T("healthybowl.contracts.noFarms", "No farms invited yet.")
|
|
498
|
+
}) : /* @__PURE__ */ x("ul", {
|
|
452
499
|
className: "space-y-2",
|
|
453
|
-
children:
|
|
500
|
+
children: q.assignments.map((e) => /* @__PURE__ */ S("li", {
|
|
454
501
|
className: "flex items-center justify-between gap-3 rounded-md border border-border-subtle px-3 py-2",
|
|
455
|
-
children: [/* @__PURE__ */
|
|
502
|
+
children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("span", {
|
|
456
503
|
className: "text-sm font-medium text-text-primary",
|
|
457
504
|
children: e.farmName || e.farmWorkspaceId
|
|
458
|
-
}), e.allocationQty ? /* @__PURE__ */
|
|
505
|
+
}), e.allocationQty ? /* @__PURE__ */ x("span", {
|
|
459
506
|
className: "ms-2 text-xs text-text-secondary",
|
|
460
|
-
children:
|
|
461
|
-
}) : null] }), /* @__PURE__ */
|
|
507
|
+
children: d(e.allocationQty)
|
|
508
|
+
}) : null] }), /* @__PURE__ */ S("div", {
|
|
462
509
|
className: "flex items-center gap-2",
|
|
463
|
-
children: [/* @__PURE__ */
|
|
464
|
-
variant:
|
|
465
|
-
label:
|
|
466
|
-
}), String(e.status).toLowerCase()
|
|
510
|
+
children: [/* @__PURE__ */ x(a, {
|
|
511
|
+
variant: ie(e.status),
|
|
512
|
+
label: f(e.status)
|
|
513
|
+
}), N && String(e.status).toLowerCase() !== "revoked" ? /* @__PURE__ */ x(C, {
|
|
467
514
|
variant: "ghost",
|
|
468
515
|
size: "icon-sm",
|
|
469
|
-
onClick: () =>
|
|
470
|
-
title:
|
|
471
|
-
children: /* @__PURE__ */
|
|
472
|
-
})]
|
|
516
|
+
onClick: () => Qe(e.id, e.farmName || e.farmWorkspaceId),
|
|
517
|
+
title: T("healthybowl.common.remove", "Revoke"),
|
|
518
|
+
children: /* @__PURE__ */ x(Ce, { className: "h-3.5 w-3.5" })
|
|
519
|
+
}) : null]
|
|
473
520
|
})]
|
|
474
521
|
}, e.id))
|
|
475
522
|
})] }),
|
|
476
|
-
/* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ S("div", { children: [
|
|
524
|
+
/* @__PURE__ */ S("div", {
|
|
478
525
|
className: "mb-2 flex items-center justify-between",
|
|
479
|
-
children: [/* @__PURE__ */
|
|
526
|
+
children: [/* @__PURE__ */ x("h3", {
|
|
480
527
|
className: "text-sm font-semibold text-text-primary",
|
|
481
|
-
children:
|
|
482
|
-
}), /* @__PURE__ */
|
|
528
|
+
children: T("healthybowl.contracts.deliveries", "Deliveries")
|
|
529
|
+
}), /* @__PURE__ */ S(C, {
|
|
483
530
|
variant: "outline",
|
|
484
531
|
size: "sm",
|
|
485
|
-
onClick: () =>
|
|
486
|
-
disabled:
|
|
487
|
-
children: [/* @__PURE__ */
|
|
532
|
+
onClick: () => H(!0),
|
|
533
|
+
disabled: q.assignments.filter((e) => String(e.status).toLowerCase() === "accepted").length === 0,
|
|
534
|
+
children: [/* @__PURE__ */ x(we, { className: "h-3.5 w-3.5" }), T("healthybowl.contracts.recordDelivery", "Record delivery")]
|
|
488
535
|
})]
|
|
489
536
|
}),
|
|
490
|
-
/* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ x("p", {
|
|
491
538
|
className: "mb-2 text-xs text-text-secondary",
|
|
492
|
-
children:
|
|
539
|
+
children: T("healthybowl.contracts.deliveriesScopeNote", "Each delivery is per farm — it creates its own order and shipment in that farm’s workspace. There is no combined cross-farm lot or shipment yet.")
|
|
493
540
|
}),
|
|
494
|
-
|
|
541
|
+
q.deliveries.length === 0 ? /* @__PURE__ */ x("p", {
|
|
495
542
|
className: "text-sm text-text-secondary",
|
|
496
|
-
children:
|
|
497
|
-
}) : /* @__PURE__ */
|
|
543
|
+
children: T("healthybowl.contracts.noDeliveries", "No deliveries recorded yet.")
|
|
544
|
+
}) : /* @__PURE__ */ x("ul", {
|
|
498
545
|
className: "space-y-2",
|
|
499
|
-
children:
|
|
500
|
-
let n = String(
|
|
501
|
-
return /* @__PURE__ */
|
|
546
|
+
children: q.deliveries.map((e) => {
|
|
547
|
+
let n = String(e.status).toLowerCase(), r = ue(e.gradeResult), i = p(r);
|
|
548
|
+
return /* @__PURE__ */ S("li", {
|
|
502
549
|
className: "rounded-md border border-border-subtle px-3 py-2",
|
|
503
550
|
children: [
|
|
504
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ S("div", {
|
|
505
552
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
506
|
-
children: [/* @__PURE__ */
|
|
553
|
+
children: [/* @__PURE__ */ S("div", {
|
|
507
554
|
className: "text-sm text-text-primary",
|
|
508
|
-
children: [/* @__PURE__ */
|
|
555
|
+
children: [/* @__PURE__ */ x("span", {
|
|
509
556
|
className: "font-medium",
|
|
510
|
-
children:
|
|
511
|
-
}),
|
|
557
|
+
children: e.farmName || e.farmWorkspaceId
|
|
558
|
+
}), e.deliveryWindow ? /* @__PURE__ */ x("span", {
|
|
512
559
|
className: "ms-2 text-xs text-text-secondary",
|
|
513
|
-
children:
|
|
560
|
+
children: e.deliveryWindow
|
|
514
561
|
}) : null]
|
|
515
|
-
}), /* @__PURE__ */
|
|
516
|
-
variant:
|
|
517
|
-
label:
|
|
562
|
+
}), /* @__PURE__ */ x(a, {
|
|
563
|
+
variant: ae(e.status),
|
|
564
|
+
label: f(e.status)
|
|
518
565
|
})]
|
|
519
566
|
}),
|
|
520
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ S("div", {
|
|
521
568
|
className: "mt-1 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-secondary tabular-nums",
|
|
522
569
|
children: [
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
|
|
570
|
+
/* @__PURE__ */ S("span", { children: [
|
|
571
|
+
T("healthybowl.contracts.delivered", "Delivered"),
|
|
525
572
|
":",
|
|
526
573
|
" ",
|
|
527
|
-
|
|
574
|
+
d(e.deliveredQty, J.unit)
|
|
528
575
|
] }),
|
|
529
|
-
|
|
530
|
-
|
|
576
|
+
e.acceptedQty > 0 || n !== "scheduled" ? /* @__PURE__ */ S("span", { children: [
|
|
577
|
+
T("healthybowl.contracts.acceptedShort", "Accepted"),
|
|
531
578
|
":",
|
|
532
579
|
" ",
|
|
533
|
-
|
|
580
|
+
d(e.acceptedQty, J.unit)
|
|
534
581
|
] }) : null,
|
|
535
|
-
|
|
582
|
+
e.rejectedQty > 0 ? /* @__PURE__ */ S("span", {
|
|
536
583
|
className: "text-status-error-text",
|
|
537
584
|
children: [
|
|
538
|
-
|
|
585
|
+
T("healthybowl.contracts.rejectedShort", "Rejected"),
|
|
539
586
|
":",
|
|
540
587
|
" ",
|
|
541
|
-
|
|
588
|
+
d(e.rejectedQty, J.unit)
|
|
542
589
|
]
|
|
543
590
|
}) : null,
|
|
544
|
-
|
|
591
|
+
e.valuedAmount > 0 ? /* @__PURE__ */ x("span", { children: t(e.valuedAmount, "INR") }) : null
|
|
545
592
|
]
|
|
546
593
|
}),
|
|
547
|
-
r ? /* @__PURE__ */
|
|
594
|
+
r ? /* @__PURE__ */ x(m, {
|
|
548
595
|
grade: r,
|
|
549
|
-
summary:
|
|
550
|
-
t:
|
|
596
|
+
summary: i,
|
|
597
|
+
t: T
|
|
551
598
|
}) : null,
|
|
552
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ S("div", {
|
|
553
600
|
className: "mt-2 flex items-center gap-2",
|
|
554
|
-
children: [n === "scheduled" || n === "partial" || n === "accepted" ? /* @__PURE__ */
|
|
601
|
+
children: [n === "scheduled" || n === "partial" || n === "accepted" ? /* @__PURE__ */ S(C, {
|
|
555
602
|
variant: "outline",
|
|
556
603
|
size: "sm",
|
|
557
|
-
onClick: () =>
|
|
604
|
+
onClick: () => K({
|
|
558
605
|
mode: "grade",
|
|
559
|
-
delivery:
|
|
606
|
+
delivery: e
|
|
560
607
|
}),
|
|
561
|
-
children: [/* @__PURE__ */
|
|
562
|
-
}) : null, n === "accepted" || n === "partial" ? /* @__PURE__ */
|
|
608
|
+
children: [/* @__PURE__ */ x(ve, { className: "h-3.5 w-3.5" }), T("healthybowl.contracts.grade", "Grade")]
|
|
609
|
+
}) : null, n === "accepted" || n === "partial" ? /* @__PURE__ */ S(C, {
|
|
563
610
|
size: "sm",
|
|
564
|
-
onClick: () =>
|
|
611
|
+
onClick: () => K({
|
|
565
612
|
mode: "settle",
|
|
566
|
-
delivery:
|
|
613
|
+
delivery: e
|
|
567
614
|
}),
|
|
568
|
-
children: [/* @__PURE__ */
|
|
615
|
+
children: [/* @__PURE__ */ x(_, { className: "h-3.5 w-3.5" }), T("healthybowl.contracts.settle", "Settle")]
|
|
569
616
|
}) : null]
|
|
570
617
|
})
|
|
571
618
|
]
|
|
572
|
-
},
|
|
619
|
+
}, e.id);
|
|
573
620
|
})
|
|
574
621
|
})
|
|
575
622
|
] })
|
|
@@ -577,8 +624,8 @@ function F() {
|
|
|
577
624
|
}) : null
|
|
578
625
|
})
|
|
579
626
|
]
|
|
580
|
-
}),
|
|
627
|
+
}), tt]
|
|
581
628
|
});
|
|
582
629
|
}
|
|
583
630
|
//#endregion
|
|
584
|
-
export {
|
|
631
|
+
export { O as ContractsPage };
|
|
@@ -416,7 +416,7 @@ var xt = 1440 * 60 * 1e3, St = 52, Ct = (e) => {
|
|
|
416
416
|
soilType: D.soilType
|
|
417
417
|
}),
|
|
418
418
|
actions: /* @__PURE__ */ h("div", {
|
|
419
|
-
className: "flex items-center gap-2",
|
|
419
|
+
className: "flex flex-wrap items-center gap-2",
|
|
420
420
|
children: [
|
|
421
421
|
/* @__PURE__ */ m(_e, {
|
|
422
422
|
entityType: "FIELD",
|
|
@@ -143,7 +143,7 @@ var O = [
|
|
|
143
143
|
}
|
|
144
144
|
],
|
|
145
145
|
actions: /* @__PURE__ */ E("div", {
|
|
146
|
-
className: "flex items-center gap-2",
|
|
146
|
+
className: "flex flex-wrap items-center gap-2",
|
|
147
147
|
children: [
|
|
148
148
|
/* @__PURE__ */ T(D, {
|
|
149
149
|
variant: "outline",
|
|
@@ -163,12 +163,15 @@ var O = [
|
|
|
163
163
|
A("healthybowl.financial.dashboard.actions.financierAccess", "Financier Access")
|
|
164
164
|
]
|
|
165
165
|
}),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
/* @__PURE__ */ T("div", {
|
|
167
|
+
className: "flex items-center gap-2",
|
|
168
|
+
children: Object.keys($).map((t) => /* @__PURE__ */ T("button", {
|
|
169
|
+
type: "button",
|
|
170
|
+
onClick: () => be(t),
|
|
171
|
+
className: e("rounded-md px-3 py-1.5 text-xs font-medium transition-colors", R === t ? "bg-foreground text-background" : "border border-border-subtle text-text-secondary hover:text-text-primary"),
|
|
172
|
+
children: $[t]
|
|
173
|
+
}, t))
|
|
174
|
+
})
|
|
172
175
|
]
|
|
173
176
|
}),
|
|
174
177
|
children: [we ? /* @__PURE__ */ T(ne, {
|
|
@@ -175,7 +175,7 @@ var be = (e) => {
|
|
|
175
175
|
description: E("healthybowl.livestock.healthRecords.description", "Track and manage animal health history"),
|
|
176
176
|
purpose: "Keep each animal's medical history in one place — illnesses, treatments, vet visits. Good records help you spot health patterns, prove humane care, and stay compliant with organic livestock rules.",
|
|
177
177
|
actions: /* @__PURE__ */ h("div", {
|
|
178
|
-
className: "flex items-center gap-2",
|
|
178
|
+
className: "flex flex-wrap items-center gap-2",
|
|
179
179
|
children: [
|
|
180
180
|
/* @__PURE__ */ h(g, {
|
|
181
181
|
variant: "outline",
|
|
@@ -314,7 +314,7 @@ var v = (e) => {
|
|
|
314
314
|
description: y("healthybowl.livestock.vaccinationSchedule.description", "Manage and track all vaccination schedules"),
|
|
315
315
|
purpose: "Stay on top of which animals need which shots and when. Keeping vaccinations on schedule protects your herd from preventable disease and gives you the records vets and certifiers expect to see.",
|
|
316
316
|
actions: /* @__PURE__ */ d("div", {
|
|
317
|
-
className: "flex items-center gap-2",
|
|
317
|
+
className: "flex flex-wrap items-center gap-2",
|
|
318
318
|
children: [
|
|
319
319
|
/* @__PURE__ */ d(f, {
|
|
320
320
|
variant: "outline",
|
|
@@ -304,7 +304,7 @@ var x = () => {
|
|
|
304
304
|
description: S("healthybowl.marketplace.description", "Browse organic products from verified sellers"),
|
|
305
305
|
purpose: "Buy organic inputs and produce from verified sellers — seeds, supplies and goods from other farms. Browse, compare and order what your farm needs, with sellers vetted so you can buy with confidence.",
|
|
306
306
|
actions: /* @__PURE__ */ v("div", {
|
|
307
|
-
className: "flex items-center gap-2",
|
|
307
|
+
className: "flex flex-wrap items-center gap-2",
|
|
308
308
|
children: [
|
|
309
309
|
/* @__PURE__ */ v(y, {
|
|
310
310
|
variant: "outline",
|
|
@@ -40,7 +40,7 @@ var O = () => {
|
|
|
40
40
|
titleAccent: O("healthybowl.storage.titleAccent", "Storage"),
|
|
41
41
|
description: O("healthybowl.storage.description", "Warehouses, cold-stores and bins — where each batch of produce and milk is stored, and its in/out history."),
|
|
42
42
|
actions: /* @__PURE__ */ E("div", {
|
|
43
|
-
className: "flex items-center gap-2",
|
|
43
|
+
className: "flex flex-wrap items-center gap-2",
|
|
44
44
|
children: [
|
|
45
45
|
/* @__PURE__ */ E(D, {
|
|
46
46
|
variant: "outline",
|
package/package.json
CHANGED