warqadui 0.0.98 → 0.0.101
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/index.d.mts +39 -3
- package/dist/index.d.ts +39 -3
- package/dist/index.js +1191 -665
- package/dist/index.mjs +1183 -651
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -114,6 +114,8 @@ __export(index_exports, {
|
|
|
114
114
|
UserProfile: () => UserProfile_default,
|
|
115
115
|
Users: () => users_default,
|
|
116
116
|
Views: () => Views_default,
|
|
117
|
+
WalletAdjustmentForm: () => WalletAdjustmentForm_default,
|
|
118
|
+
WalletAdjustments: () => WalletAdjustments_default,
|
|
117
119
|
WalletField: () => Feilds_default2,
|
|
118
120
|
WalletForm: () => WalletForm_default,
|
|
119
121
|
WalletReport: () => Report_default2,
|
|
@@ -152,7 +154,8 @@ __export(index_exports, {
|
|
|
152
154
|
useTheme: () => useTheme,
|
|
153
155
|
useTransaction: () => useTransaction_default,
|
|
154
156
|
useWarqadConfig: () => useWarqadConfig,
|
|
155
|
-
verifyUserEmailSchema: () => verifyUserEmailSchema
|
|
157
|
+
verifyUserEmailSchema: () => verifyUserEmailSchema,
|
|
158
|
+
walletAdjustmentSchema: () => walletAdjustmentSchema
|
|
156
159
|
});
|
|
157
160
|
module.exports = __toCommonJS(index_exports);
|
|
158
161
|
|
|
@@ -471,7 +474,8 @@ var Enums = {
|
|
|
471
474
|
"journal",
|
|
472
475
|
"payment",
|
|
473
476
|
"money transfer",
|
|
474
|
-
"expense"
|
|
477
|
+
"expense",
|
|
478
|
+
"adjustment"
|
|
475
479
|
]
|
|
476
480
|
};
|
|
477
481
|
var Enums_default = Enums;
|
|
@@ -721,16 +725,23 @@ function Breadcrumbs() {
|
|
|
721
725
|
let url = "";
|
|
722
726
|
let typeProfile = profile;
|
|
723
727
|
if (profile === "statements") {
|
|
728
|
+
console.log(prevprofile);
|
|
724
729
|
typeProfile = prevprofile;
|
|
725
730
|
}
|
|
726
731
|
if (["shop", "store", "office"].includes(typeProfile))
|
|
727
732
|
url = `/branches/get?id=${id}`;
|
|
728
733
|
if (typeProfile === "users") url = `/users/get?id=${id}`;
|
|
729
|
-
if ([
|
|
734
|
+
if ([
|
|
735
|
+
"customers",
|
|
736
|
+
"employees",
|
|
737
|
+
"suppliers",
|
|
738
|
+
"investors",
|
|
739
|
+
"account"
|
|
740
|
+
].includes(typeProfile))
|
|
741
|
+
url = `/accounts/get?id=${id}`;
|
|
742
|
+
if (["customer", "employee", "supplier", "investor", "account"].includes(
|
|
730
743
|
typeProfile
|
|
731
744
|
))
|
|
732
|
-
url = `/accounts/get?id=${id}`;
|
|
733
|
-
if (["customer", "employee", "supplier", "investor"].includes(typeProfile))
|
|
734
745
|
url = `/accounts/get/${typeProfile}?id=${id}`;
|
|
735
746
|
if (typeProfile === "wallets") url = `/wallets/get?id=${id}`;
|
|
736
747
|
try {
|
|
@@ -1513,13 +1524,13 @@ var Input = (0, import_react10.forwardRef)(
|
|
|
1513
1524
|
}
|
|
1514
1525
|
}
|
|
1515
1526
|
}, [props.value, name, form]);
|
|
1516
|
-
let
|
|
1527
|
+
let message30 = error;
|
|
1517
1528
|
if (form && name) {
|
|
1518
1529
|
const {
|
|
1519
1530
|
formState: { errors }
|
|
1520
1531
|
} = form;
|
|
1521
1532
|
const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
|
|
1522
|
-
|
|
1533
|
+
message30 = errorObj?.message;
|
|
1523
1534
|
}
|
|
1524
1535
|
const watchedValue = form?.watch(name);
|
|
1525
1536
|
(0, import_react10.useEffect)(() => {
|
|
@@ -1588,7 +1599,7 @@ var Input = (0, import_react10.forwardRef)(
|
|
|
1588
1599
|
}
|
|
1589
1600
|
)
|
|
1590
1601
|
] }),
|
|
1591
|
-
|
|
1602
|
+
message30 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message30 })
|
|
1592
1603
|
]
|
|
1593
1604
|
}
|
|
1594
1605
|
);
|
|
@@ -1922,7 +1933,7 @@ var PhoneInput = (0, import_react13.forwardRef)(
|
|
|
1922
1933
|
const [isFocused, setIsFocused] = (0, import_react13.useState)(false);
|
|
1923
1934
|
const { theme } = useWarqadConfig();
|
|
1924
1935
|
const primaryColor = theme?.primaryColor;
|
|
1925
|
-
let
|
|
1936
|
+
let message30 = error;
|
|
1926
1937
|
if (form && name) {
|
|
1927
1938
|
const {
|
|
1928
1939
|
formState: { errors }
|
|
@@ -1932,7 +1943,7 @@ var PhoneInput = (0, import_react13.forwardRef)(
|
|
|
1932
1943
|
for (const part of nameParts) {
|
|
1933
1944
|
currentError = currentError?.[part];
|
|
1934
1945
|
}
|
|
1935
|
-
|
|
1946
|
+
message30 = currentError?.message || message30;
|
|
1936
1947
|
}
|
|
1937
1948
|
const renderInput = (onChangeHandler, currentValue) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: `space-y-2 group relative ${containerClassName}`, children: [
|
|
1938
1949
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
@@ -1983,7 +1994,7 @@ var PhoneInput = (0, import_react13.forwardRef)(
|
|
|
1983
1994
|
}
|
|
1984
1995
|
)
|
|
1985
1996
|
] }),
|
|
1986
|
-
|
|
1997
|
+
message30 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message30 })
|
|
1987
1998
|
] });
|
|
1988
1999
|
if (form && name) {
|
|
1989
2000
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
@@ -2156,7 +2167,7 @@ var SelectRoot = ({
|
|
|
2156
2167
|
document.addEventListener("mousedown", handleClickOutside);
|
|
2157
2168
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2158
2169
|
}, [fieldInternalProps]);
|
|
2159
|
-
let
|
|
2170
|
+
let message30 = error;
|
|
2160
2171
|
if (form && name) {
|
|
2161
2172
|
const {
|
|
2162
2173
|
formState: { errors }
|
|
@@ -2166,7 +2177,7 @@ var SelectRoot = ({
|
|
|
2166
2177
|
for (const part of nameParts) {
|
|
2167
2178
|
currentError = currentError?.[part];
|
|
2168
2179
|
}
|
|
2169
|
-
|
|
2180
|
+
message30 = currentError?.message || message30;
|
|
2170
2181
|
}
|
|
2171
2182
|
const allOptions = initialOptions?.length ? initialOptions : registeredOptions;
|
|
2172
2183
|
const valueCtx = {
|
|
@@ -2227,7 +2238,7 @@ var SelectRoot = ({
|
|
|
2227
2238
|
String(opt.value) || index
|
|
2228
2239
|
)) })
|
|
2229
2240
|
] }),
|
|
2230
|
-
|
|
2241
|
+
message30 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message30 })
|
|
2231
2242
|
]
|
|
2232
2243
|
}
|
|
2233
2244
|
) });
|
|
@@ -2463,13 +2474,13 @@ var Textarea = (0, import_react15.forwardRef)(
|
|
|
2463
2474
|
const [isFocused, setIsFocused] = (0, import_react15.useState)(false);
|
|
2464
2475
|
const { theme } = useWarqadConfig();
|
|
2465
2476
|
const primaryColor = theme?.primaryColor;
|
|
2466
|
-
let
|
|
2477
|
+
let message30 = error;
|
|
2467
2478
|
if (form && name) {
|
|
2468
2479
|
const {
|
|
2469
2480
|
formState: { errors }
|
|
2470
2481
|
} = form;
|
|
2471
2482
|
const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
|
|
2472
|
-
|
|
2483
|
+
message30 = errorObj?.message;
|
|
2473
2484
|
}
|
|
2474
2485
|
const renderInput = (inputProps, ref2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: `space-y-2 group w-full! relative ${containerClassName}`, children: [
|
|
2475
2486
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
@@ -2507,7 +2518,7 @@ var Textarea = (0, import_react15.forwardRef)(
|
|
|
2507
2518
|
}
|
|
2508
2519
|
}
|
|
2509
2520
|
) }),
|
|
2510
|
-
|
|
2521
|
+
message30 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message30 })
|
|
2511
2522
|
] });
|
|
2512
2523
|
(0, import_react15.useEffect)(() => {
|
|
2513
2524
|
if (form && name && props.value !== void 0 && props.value !== null && props.value !== "") {
|
|
@@ -2826,7 +2837,7 @@ var SearchApiRoot = ({
|
|
|
2826
2837
|
const filteredOptions = options3.filter(
|
|
2827
2838
|
(option) => !filter.includes(getOptionValue(option))
|
|
2828
2839
|
);
|
|
2829
|
-
let
|
|
2840
|
+
let message30 = error || errorMessage;
|
|
2830
2841
|
if (form && name) {
|
|
2831
2842
|
const {
|
|
2832
2843
|
formState: { errors }
|
|
@@ -2836,7 +2847,7 @@ var SearchApiRoot = ({
|
|
|
2836
2847
|
for (const part of nameParts) {
|
|
2837
2848
|
currentError = currentError?.[part];
|
|
2838
2849
|
}
|
|
2839
|
-
|
|
2850
|
+
message30 = currentError?.message || message30;
|
|
2840
2851
|
}
|
|
2841
2852
|
const valueCtx = {
|
|
2842
2853
|
isOpen,
|
|
@@ -2870,7 +2881,7 @@ var SearchApiRoot = ({
|
|
|
2870
2881
|
form,
|
|
2871
2882
|
name,
|
|
2872
2883
|
obj,
|
|
2873
|
-
error:
|
|
2884
|
+
error: message30,
|
|
2874
2885
|
onSelect,
|
|
2875
2886
|
onClear
|
|
2876
2887
|
};
|
|
@@ -3237,19 +3248,19 @@ var DateInput = (0, import_react17.forwardRef)(
|
|
|
3237
3248
|
const { theme } = useWarqadConfig();
|
|
3238
3249
|
const primaryColor = theme?.primaryColor;
|
|
3239
3250
|
const [isFocused, setIsFocused] = (0, import_react17.useState)(false);
|
|
3240
|
-
let
|
|
3251
|
+
let message30 = error;
|
|
3241
3252
|
if (form && name) {
|
|
3242
3253
|
const {
|
|
3243
3254
|
formState: { errors }
|
|
3244
3255
|
} = form;
|
|
3245
3256
|
const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
|
|
3246
|
-
|
|
3257
|
+
message30 = errorObj?.message;
|
|
3247
3258
|
}
|
|
3248
3259
|
const inputStyles = `w-full px-2.5 py-1 rounded-md border! shadow-none transition-all! duration-200! outline-none!
|
|
3249
3260
|
bg-white! dark:bg-zinc-900!
|
|
3250
3261
|
text-gray-900! dark:text-zinc-100!
|
|
3251
3262
|
hover:bg-white! dark:hover:bg-zinc-900!
|
|
3252
|
-
${
|
|
3263
|
+
${message30 ? "border-red-500 hover:border-red-500 [&.ant-picker-focused]:border-red-500 [&.ant-picker-focused]:ring-red-500/20" : "border-gray-200 dark:border-zinc-700 hover:border-gray-200 dark:hover:border-zinc-700 [&.ant-picker-focused]:ring-2"}
|
|
3253
3264
|
[&.ant-picker-focused]:bg-white dark:[&.ant-picker-focused]:bg-zinc-900
|
|
3254
3265
|
${className}`;
|
|
3255
3266
|
const renderDatePicker = (val, changeHandler, blurHandler, refProps) => {
|
|
@@ -3272,8 +3283,8 @@ var DateInput = (0, import_react17.forwardRef)(
|
|
|
3272
3283
|
needConfirm: false,
|
|
3273
3284
|
style: {
|
|
3274
3285
|
height: "var(--input-height, 40px)",
|
|
3275
|
-
borderColor: isFocused && !
|
|
3276
|
-
boxShadow: isFocused && !
|
|
3286
|
+
borderColor: isFocused && !message30 ? primaryColor : void 0,
|
|
3287
|
+
boxShadow: isFocused && !message30 ? `${primaryColor}33 0px 0px 0px 2px` : void 0
|
|
3277
3288
|
},
|
|
3278
3289
|
classNames: { popup: { root: "z-50" } },
|
|
3279
3290
|
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
@@ -3303,7 +3314,7 @@ var DateInput = (0, import_react17.forwardRef)(
|
|
|
3303
3314
|
{
|
|
3304
3315
|
className: "block text-xs font-medium transition-colors duration-200",
|
|
3305
3316
|
style: {
|
|
3306
|
-
color:
|
|
3317
|
+
color: message30 ? "#ef4444" : isFocused ? primaryColor : void 0
|
|
3307
3318
|
},
|
|
3308
3319
|
children: [
|
|
3309
3320
|
label,
|
|
@@ -3324,7 +3335,7 @@ var DateInput = (0, import_react17.forwardRef)(
|
|
|
3324
3335
|
)
|
|
3325
3336
|
}
|
|
3326
3337
|
) : renderDatePicker(value, onChange, onBlur, ref),
|
|
3327
|
-
|
|
3338
|
+
message30 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message30 })
|
|
3328
3339
|
] });
|
|
3329
3340
|
}
|
|
3330
3341
|
);
|
|
@@ -7775,17 +7786,17 @@ var preWarningFns = [];
|
|
|
7775
7786
|
var preMessage = (fn) => {
|
|
7776
7787
|
preWarningFns.push(fn);
|
|
7777
7788
|
};
|
|
7778
|
-
function warning(valid,
|
|
7789
|
+
function warning(valid, message30) {
|
|
7779
7790
|
if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
|
|
7780
|
-
const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "warning"),
|
|
7791
|
+
const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "warning"), message30);
|
|
7781
7792
|
if (finalMessage) {
|
|
7782
7793
|
console.error(`Warning: ${finalMessage}`);
|
|
7783
7794
|
}
|
|
7784
7795
|
}
|
|
7785
7796
|
}
|
|
7786
|
-
function note(valid,
|
|
7797
|
+
function note(valid, message30) {
|
|
7787
7798
|
if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
|
|
7788
|
-
const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "note"),
|
|
7799
|
+
const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "note"), message30);
|
|
7789
7800
|
if (finalMessage) {
|
|
7790
7801
|
console.warn(`Note: ${finalMessage}`);
|
|
7791
7802
|
}
|
|
@@ -7794,17 +7805,17 @@ function note(valid, message29) {
|
|
|
7794
7805
|
function resetWarned() {
|
|
7795
7806
|
warned = {};
|
|
7796
7807
|
}
|
|
7797
|
-
function call(method, valid,
|
|
7798
|
-
if (!valid && !warned[
|
|
7799
|
-
method(false,
|
|
7800
|
-
warned[
|
|
7808
|
+
function call(method, valid, message30) {
|
|
7809
|
+
if (!valid && !warned[message30]) {
|
|
7810
|
+
method(false, message30);
|
|
7811
|
+
warned[message30] = true;
|
|
7801
7812
|
}
|
|
7802
7813
|
}
|
|
7803
|
-
function warningOnce(valid,
|
|
7804
|
-
call(warning, valid,
|
|
7814
|
+
function warningOnce(valid, message30) {
|
|
7815
|
+
call(warning, valid, message30);
|
|
7805
7816
|
}
|
|
7806
|
-
function noteOnce(valid,
|
|
7807
|
-
call(note, valid,
|
|
7817
|
+
function noteOnce(valid, message30) {
|
|
7818
|
+
call(note, valid, message30);
|
|
7808
7819
|
}
|
|
7809
7820
|
warningOnce.preMessage = preMessage;
|
|
7810
7821
|
warningOnce.resetWarned = resetWarned;
|
|
@@ -7815,8 +7826,8 @@ var import_react31 = __toESM(require("react"));
|
|
|
7815
7826
|
function camelCase(input) {
|
|
7816
7827
|
return input.replace(/-(.)/g, (match, g) => g.toUpperCase());
|
|
7817
7828
|
}
|
|
7818
|
-
function warning2(valid,
|
|
7819
|
-
warningOnce(valid, `[@ant-design/icons] ${
|
|
7829
|
+
function warning2(valid, message30) {
|
|
7830
|
+
warningOnce(valid, `[@ant-design/icons] ${message30}`);
|
|
7820
7831
|
}
|
|
7821
7832
|
function isIconDefinition(target) {
|
|
7822
7833
|
return typeof target === "object" && typeof target.name === "string" && typeof target.theme === "string" && (typeof target.icon === "object" || typeof target.icon === "function");
|
|
@@ -9194,8 +9205,199 @@ var ExpenseView_default = ExpenseView;
|
|
|
9194
9205
|
|
|
9195
9206
|
// src/components/Views/Transaction.tsx
|
|
9196
9207
|
var import_antd6 = require("antd");
|
|
9208
|
+
var import_lucide_react25 = require("lucide-react");
|
|
9209
|
+
|
|
9210
|
+
// src/components/Views/TransactionViewComponents/WalletAdjustmentView.tsx
|
|
9197
9211
|
var import_lucide_react24 = require("lucide-react");
|
|
9198
9212
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
9213
|
+
function WalletAdjustmentView({
|
|
9214
|
+
data,
|
|
9215
|
+
isLoading
|
|
9216
|
+
}) {
|
|
9217
|
+
const Skeleton = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9218
|
+
"div",
|
|
9219
|
+
{
|
|
9220
|
+
className: `animate-pulse bg-gray-200 dark:bg-zinc-800 rounded ${className}`
|
|
9221
|
+
}
|
|
9222
|
+
);
|
|
9223
|
+
const InfoSection = ({ title, icon: Icon2, children }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "bg-white dark:bg-zinc-900/30 rounded-xl border border-gray-100 dark:border-zinc-800/50 p-5 space-y-4", children: [
|
|
9224
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-2 pb-3 border-b border-gray-50 dark:border-zinc-800/50", children: [
|
|
9225
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "p-1.5 bg-gray-50 dark:bg-zinc-800 rounded-lg text-gray-500 dark:text-zinc-400", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Icon2, { size: 18 }) }),
|
|
9226
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h3", { className: "font-semibold text-gray-900 dark:text-zinc-100", children: title })
|
|
9227
|
+
] }),
|
|
9228
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-5", children })
|
|
9229
|
+
] });
|
|
9230
|
+
const DataItem = ({
|
|
9231
|
+
label,
|
|
9232
|
+
value,
|
|
9233
|
+
subValue,
|
|
9234
|
+
className = "",
|
|
9235
|
+
isSkeleton
|
|
9236
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: `space-y-1 ${className}`, children: [
|
|
9237
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-widest", children: label }),
|
|
9238
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex flex-col gap-1.5", children: isSkeleton ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
9239
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Skeleton, { className: "h-4 w-3/4" }),
|
|
9240
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Skeleton, { className: "h-3 w-1/2" })
|
|
9241
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
9242
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-sm font-semibold text-gray-800 dark:text-zinc-200", children: value || "---" }),
|
|
9243
|
+
subValue && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-[11px] text-gray-400 dark:text-zinc-500 font-medium", children: subValue })
|
|
9244
|
+
] }) })
|
|
9245
|
+
] });
|
|
9246
|
+
if (isLoading) {
|
|
9247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "p-2 space-y-6", children: [
|
|
9248
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "bg-white dark:bg-zinc-900 rounded-2xl border border-gray-100 dark:border-zinc-800 p-6 flex flex-wrap items-center justify-between gap-6", children: [
|
|
9249
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-5", children: [
|
|
9250
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Skeleton, { className: "w-14 h-14 rounded-2xl" }),
|
|
9251
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "space-y-3", children: [
|
|
9252
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Skeleton, { className: "h-7 w-48" }),
|
|
9253
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Skeleton, { className: "h-4 w-32" })
|
|
9254
|
+
] })
|
|
9255
|
+
] }),
|
|
9256
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "text-right space-y-3", children: [
|
|
9257
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Skeleton, { className: "h-8 w-40 ml-auto" }),
|
|
9258
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Skeleton, { className: "h-4 w-20 ml-auto" })
|
|
9259
|
+
] })
|
|
9260
|
+
] }),
|
|
9261
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
9262
|
+
InfoSection,
|
|
9263
|
+
{
|
|
9264
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Skeleton, { className: "h-5 w-32" }),
|
|
9265
|
+
icon: import_lucide_react24.FileText,
|
|
9266
|
+
children: [
|
|
9267
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DataItem, { isSkeleton: true, label: "Loading..." }),
|
|
9268
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DataItem, { isSkeleton: true, label: "Loading..." }),
|
|
9269
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DataItem, { isSkeleton: true, label: "Loading..." }),
|
|
9270
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DataItem, { isSkeleton: true, label: "Loading..." })
|
|
9271
|
+
]
|
|
9272
|
+
},
|
|
9273
|
+
i
|
|
9274
|
+
)) })
|
|
9275
|
+
] });
|
|
9276
|
+
}
|
|
9277
|
+
if (!data) return null;
|
|
9278
|
+
const isCredit = data.action === "credit";
|
|
9279
|
+
const statusColor = isCredit ? "green" : "red";
|
|
9280
|
+
const ActionIcon = isCredit ? import_lucide_react24.ArrowUpCircle : import_lucide_react24.ArrowDownCircle;
|
|
9281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "p-2 space-y-6", children: [
|
|
9282
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "relative overflow-hidden bg-white dark:bg-zinc-900 rounded-2xl border border-gray-100 dark:border-zinc-800", children: [
|
|
9283
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9284
|
+
"div",
|
|
9285
|
+
{
|
|
9286
|
+
className: `absolute top-0 left-0 w-1.5 h-full ${isCredit ? "bg-green-500" : "bg-red-500"}`
|
|
9287
|
+
}
|
|
9288
|
+
),
|
|
9289
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "p-6 flex flex-wrap items-center justify-between gap-6", children: [
|
|
9290
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-5", children: [
|
|
9291
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9292
|
+
"div",
|
|
9293
|
+
{
|
|
9294
|
+
className: `p-4 rounded-2xl ${isCredit ? "bg-green-50 text-green-600 dark:bg-green-500/10 dark:text-green-400" : "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400"}`,
|
|
9295
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react24.Activity, { size: 28, strokeWidth: 1.5 })
|
|
9296
|
+
}
|
|
9297
|
+
),
|
|
9298
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "space-y-1", children: [
|
|
9299
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
9300
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h1", { className: "text-2xl font-black tracking-tight text-gray-900 dark:text-zinc-100", children: data.ref }),
|
|
9301
|
+
data.isDeleted && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: "flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[10px] font-black uppercase tracking-wider border bg-red-50 text-red-600 border-red-200 shadow-sm shadow-red-100", children: [
|
|
9302
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react24.AlertCircle, { size: 12 }),
|
|
9303
|
+
"REVERSED"
|
|
9304
|
+
] })
|
|
9305
|
+
] }),
|
|
9306
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-xs font-bold text-gray-500 dark:text-zinc-400 uppercase tracking-tight truncate max-w-md", children: data.description })
|
|
9307
|
+
] })
|
|
9308
|
+
] }),
|
|
9309
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "text-right space-y-1", children: [
|
|
9310
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-3xl font-black tracking-tighter text-gray-900 dark:text-zinc-50", children: Formats_default.Price(data.amount || 0, data.currency || "USD") }),
|
|
9311
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
9312
|
+
"p",
|
|
9313
|
+
{
|
|
9314
|
+
className: `text-xs font-black uppercase tracking-[0.2em] ${isCredit ? "text-green-500" : "text-red-500"}`,
|
|
9315
|
+
children: [
|
|
9316
|
+
"Wallet ",
|
|
9317
|
+
data.action
|
|
9318
|
+
]
|
|
9319
|
+
}
|
|
9320
|
+
)
|
|
9321
|
+
] })
|
|
9322
|
+
] })
|
|
9323
|
+
] }),
|
|
9324
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
|
|
9325
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(InfoSection, { title: "Adjustment Details", icon: import_lucide_react24.FileText, children: [
|
|
9326
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9327
|
+
DataItem,
|
|
9328
|
+
{
|
|
9329
|
+
label: "Description",
|
|
9330
|
+
value: data.description,
|
|
9331
|
+
className: "col-span-full bg-gray-50 dark:bg-zinc-800/20 p-3 rounded-lg border border-gray-100 dark:border-zinc-800/40"
|
|
9332
|
+
}
|
|
9333
|
+
),
|
|
9334
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DataItem, { label: "Transaction Date", value: data.date }),
|
|
9335
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DataItem, { label: "Action Type", value: isCredit ? "Increase (+)" : "Decrease (-)", className: isCredit ? "text-green-600 font-bold" : "text-red-600 font-bold" }),
|
|
9336
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DataItem, { label: "Reference ID", value: data.ref }),
|
|
9337
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DataItem, { label: "Currency", value: data.currency })
|
|
9338
|
+
] }),
|
|
9339
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(InfoSection, { title: "Target Wallet", icon: import_lucide_react24.Wallet, children: [
|
|
9340
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9341
|
+
DataItem,
|
|
9342
|
+
{
|
|
9343
|
+
label: "Wallet Name",
|
|
9344
|
+
value: data.fromWalletData?.name || data.toWalletData?.name || "N/A"
|
|
9345
|
+
}
|
|
9346
|
+
),
|
|
9347
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9348
|
+
DataItem,
|
|
9349
|
+
{
|
|
9350
|
+
label: "Wallet Type",
|
|
9351
|
+
value: data.fromWalletData?.type || data.toWalletData?.type || "N/A",
|
|
9352
|
+
className: "capitalize"
|
|
9353
|
+
}
|
|
9354
|
+
),
|
|
9355
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9356
|
+
DataItem,
|
|
9357
|
+
{
|
|
9358
|
+
label: "Transaction ID",
|
|
9359
|
+
value: data._id,
|
|
9360
|
+
className: "col-span-full"
|
|
9361
|
+
}
|
|
9362
|
+
)
|
|
9363
|
+
] }),
|
|
9364
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(InfoSection, { title: "Additional Information", icon: import_lucide_react24.Calendar, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9365
|
+
DataItem,
|
|
9366
|
+
{
|
|
9367
|
+
label: "Note",
|
|
9368
|
+
value: data.note || "No additional notes provided",
|
|
9369
|
+
className: "col-span-full"
|
|
9370
|
+
}
|
|
9371
|
+
) })
|
|
9372
|
+
] }),
|
|
9373
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-6 p-6 bg-gray-50/50 dark:bg-zinc-900/20 rounded-2xl border border-gray-100 dark:border-zinc-800", children: [
|
|
9374
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-wrap items-center gap-8", children: [
|
|
9375
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
9376
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react24.Clock, { size: 16, className: "text-gray-400 dark:text-zinc-500" }),
|
|
9377
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-col", children: [
|
|
9378
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-[9px] font-bold text-gray-400 dark:text-zinc-500 uppercase", children: "Date Created" }),
|
|
9379
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs font-semibold text-gray-600 dark:text-zinc-300", children: new Date(data.createdAt).toLocaleString() })
|
|
9380
|
+
] })
|
|
9381
|
+
] }),
|
|
9382
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
9383
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react24.Activity, { size: 16, className: "text-gray-400 dark:text-zinc-500" }),
|
|
9384
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-col", children: [
|
|
9385
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-[9px] font-bold text-gray-400 dark:text-zinc-500 uppercase", children: "Created By" }),
|
|
9386
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs font-semibold text-gray-600 dark:text-zinc-300", children: data.by?.name || "System" })
|
|
9387
|
+
] })
|
|
9388
|
+
] })
|
|
9389
|
+
] }),
|
|
9390
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "px-4 py-2 bg-gray-100 dark:bg-zinc-800 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: "text-[10px] font-mono text-gray-500 dark:text-zinc-400 uppercase tracking-tighter", children: [
|
|
9391
|
+
"Ref: ",
|
|
9392
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "font-bold", children: data.ref })
|
|
9393
|
+
] }) })
|
|
9394
|
+
] })
|
|
9395
|
+
] });
|
|
9396
|
+
}
|
|
9397
|
+
var WalletAdjustmentView_default = WalletAdjustmentView;
|
|
9398
|
+
|
|
9399
|
+
// src/components/Views/Transaction.tsx
|
|
9400
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
9199
9401
|
var Transaction = ({
|
|
9200
9402
|
id,
|
|
9201
9403
|
type,
|
|
@@ -9243,35 +9445,35 @@ var Transaction = ({
|
|
|
9243
9445
|
value: h.ref
|
|
9244
9446
|
}));
|
|
9245
9447
|
}, [data?.history]);
|
|
9246
|
-
return /* @__PURE__ */ (0,
|
|
9448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
9247
9449
|
Modal,
|
|
9248
9450
|
{
|
|
9249
9451
|
isOpen: true,
|
|
9250
9452
|
onClose: close,
|
|
9251
|
-
title: /* @__PURE__ */ (0,
|
|
9252
|
-
/* @__PURE__ */ (0,
|
|
9253
|
-
/* @__PURE__ */ (0,
|
|
9453
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center justify-between w-full ", children: [
|
|
9454
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
9455
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "capitalize", children: [
|
|
9254
9456
|
type,
|
|
9255
9457
|
" Transaction"
|
|
9256
9458
|
] }),
|
|
9257
|
-
!isLoading && data?.data?.ref && /* @__PURE__ */ (0,
|
|
9459
|
+
!isLoading && data?.data?.ref && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-xs font-mono bg-gray-100 dark:bg-zinc-800 px-2 py-1 rounded text-gray-500 uppercase", children: data.data.ref })
|
|
9258
9460
|
] }),
|
|
9259
|
-
reverseable?.reload && /* @__PURE__ */ (0,
|
|
9260
|
-
!isLoading && data?.data && !data.data.isDeleted && /* @__PURE__ */ (0,
|
|
9461
|
+
reverseable?.reload && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
9462
|
+
!isLoading && data?.data && !data.data.isDeleted && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9261
9463
|
import_antd6.Button,
|
|
9262
9464
|
{
|
|
9263
9465
|
danger: true,
|
|
9264
9466
|
type: "primary",
|
|
9265
9467
|
size: "small",
|
|
9266
|
-
icon: /* @__PURE__ */ (0,
|
|
9468
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react25.RotateCcw, { size: 14 }),
|
|
9267
9469
|
className: "flex items-center gap-1.5 font-bold uppercase text-[10px] px-3 transition-all hover:scale-105",
|
|
9268
9470
|
onClick: () => setShowReverseModal(true),
|
|
9269
9471
|
children: "Reverse Transaction"
|
|
9270
9472
|
}
|
|
9271
9473
|
),
|
|
9272
|
-
historyOptions.length > 1 && /* @__PURE__ */ (0,
|
|
9273
|
-
/* @__PURE__ */ (0,
|
|
9274
|
-
/* @__PURE__ */ (0,
|
|
9474
|
+
historyOptions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9475
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react25.History, { size: 14, className: "text-gray-400" }),
|
|
9476
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9275
9477
|
import_antd6.Select,
|
|
9276
9478
|
{
|
|
9277
9479
|
value: data?.data?.ref,
|
|
@@ -9288,26 +9490,27 @@ var Transaction = ({
|
|
|
9288
9490
|
] }),
|
|
9289
9491
|
width: 1100,
|
|
9290
9492
|
children: [
|
|
9291
|
-
!type && /* @__PURE__ */ (0,
|
|
9292
|
-
type === "journal" && /* @__PURE__ */ (0,
|
|
9293
|
-
type === "payment" && /* @__PURE__ */ (0,
|
|
9294
|
-
type === "money transfer" && /* @__PURE__ */ (0,
|
|
9295
|
-
type === "expense" && /* @__PURE__ */ (0,
|
|
9296
|
-
/* @__PURE__ */ (0,
|
|
9493
|
+
!type && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { children: "No transaction type" }),
|
|
9494
|
+
type === "journal" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(JournalView_default, { data: data?.data, isLoading }),
|
|
9495
|
+
type === "payment" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PaymentView_default, { data: data?.data, isLoading }),
|
|
9496
|
+
type === "money transfer" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(MoneyTransfer_default, { data: data?.data, isLoading }),
|
|
9497
|
+
type === "expense" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ExpenseView_default, { data: data?.data, isLoading }),
|
|
9498
|
+
type === "adjustment" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(WalletAdjustmentView_default, { data: data?.data, isLoading }),
|
|
9499
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9297
9500
|
ConfirmModal,
|
|
9298
9501
|
{
|
|
9299
9502
|
isOpen: showReverseModal,
|
|
9300
9503
|
isLoading: isActionLoading,
|
|
9301
9504
|
onClose: () => setShowReverseModal(false),
|
|
9302
9505
|
title: "Reverse Transaction",
|
|
9303
|
-
description: /* @__PURE__ */ (0,
|
|
9304
|
-
/* @__PURE__ */ (0,
|
|
9506
|
+
description: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-3", children: [
|
|
9507
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("p", { children: [
|
|
9305
9508
|
"Are you sure you want to reverse",
|
|
9306
9509
|
" ",
|
|
9307
|
-
/* @__PURE__ */ (0,
|
|
9510
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "font-bold text-red-600 underline", children: data?.data?.ref }),
|
|
9308
9511
|
"?"
|
|
9309
9512
|
] }),
|
|
9310
|
-
/* @__PURE__ */ (0,
|
|
9513
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "text-xs text-gray-500 bg-gray-50 p-3 rounded-lg border border-gray-100 italic", children: '"This action will invalidate the transaction and adjust all linked account balances. This process cannot be undone."' })
|
|
9311
9514
|
] }),
|
|
9312
9515
|
confirmationWord: "reverse",
|
|
9313
9516
|
onSubmit: onReverse,
|
|
@@ -9431,7 +9634,7 @@ var useAuth = () => {
|
|
|
9431
9634
|
var useAuth_default = useAuth;
|
|
9432
9635
|
|
|
9433
9636
|
// src/components/Guard.tsx
|
|
9434
|
-
var
|
|
9637
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
9435
9638
|
var Guard = () => {
|
|
9436
9639
|
const { get } = useApis_default();
|
|
9437
9640
|
const location = (0, import_react_router_dom5.useLocation)();
|
|
@@ -9455,18 +9658,18 @@ var Guard = () => {
|
|
|
9455
9658
|
fetchProfile();
|
|
9456
9659
|
}, [location.pathname]);
|
|
9457
9660
|
if (!isFetched) {
|
|
9458
|
-
return /* @__PURE__ */ (0,
|
|
9661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(LoadingSpin, { size: "lg" }) });
|
|
9459
9662
|
}
|
|
9460
|
-
return /* @__PURE__ */ (0,
|
|
9663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_router_dom5.Outlet, {});
|
|
9461
9664
|
};
|
|
9462
9665
|
var ProtectedRoute = () => {
|
|
9463
9666
|
const { isLoggedIn } = useAuth();
|
|
9464
9667
|
const location = (0, import_react_router_dom5.useLocation)();
|
|
9465
|
-
return isLoggedIn ? /* @__PURE__ */ (0,
|
|
9668
|
+
return isLoggedIn ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_router_dom5.Outlet, {}) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_router_dom5.Navigate, { to: "/login", state: { from: location }, replace: true });
|
|
9466
9669
|
};
|
|
9467
9670
|
var UnProtectedRoute = () => {
|
|
9468
9671
|
const { isLoggedIn, user } = useAuth();
|
|
9469
|
-
return !isLoggedIn ? /* @__PURE__ */ (0,
|
|
9672
|
+
return !isLoggedIn ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_router_dom5.Outlet, {}) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_router_dom5.Navigate, { to: user?.homePath || "/", replace: true });
|
|
9470
9673
|
};
|
|
9471
9674
|
var AdminProtectedRoute = () => {
|
|
9472
9675
|
const { role } = useAuth();
|
|
@@ -9475,15 +9678,15 @@ var AdminProtectedRoute = () => {
|
|
|
9475
9678
|
import_antd7.message.error("Only admin can access this page");
|
|
9476
9679
|
}
|
|
9477
9680
|
}, [role]);
|
|
9478
|
-
return role && ["admin"].includes(role) ? /* @__PURE__ */ (0,
|
|
9681
|
+
return role && ["admin"].includes(role) ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_router_dom5.Outlet, {}) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_router_dom5.Navigate, { to: "/", replace: true });
|
|
9479
9682
|
};
|
|
9480
9683
|
|
|
9481
9684
|
// src/components/accounts/Accounts.tsx
|
|
9482
9685
|
var import_react_router_dom6 = require("react-router-dom");
|
|
9483
|
-
var
|
|
9686
|
+
var import_lucide_react26 = require("lucide-react");
|
|
9484
9687
|
var import_react35 = require("react");
|
|
9485
9688
|
var import_antd8 = require("antd");
|
|
9486
|
-
var
|
|
9689
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
9487
9690
|
function Accounts({ v, url }) {
|
|
9488
9691
|
const { enums } = useWarqadConfig();
|
|
9489
9692
|
const { branchId } = (0, import_react_router_dom6.useParams)();
|
|
@@ -9504,17 +9707,17 @@ function Accounts({ v, url }) {
|
|
|
9504
9707
|
const items = (data2) => [
|
|
9505
9708
|
{
|
|
9506
9709
|
label: `Edit ${type}`,
|
|
9507
|
-
icon: /* @__PURE__ */ (0,
|
|
9710
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react26.FilePenLine, { size: 16 }),
|
|
9508
9711
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
9509
9712
|
},
|
|
9510
9713
|
{
|
|
9511
9714
|
label: `Delete ${type}`,
|
|
9512
|
-
icon: /* @__PURE__ */ (0,
|
|
9715
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react26.Trash2, { className: "text-red-500", size: 16 }),
|
|
9513
9716
|
onClick: () => setDeleteAccount(data2)
|
|
9514
9717
|
},
|
|
9515
9718
|
isEmployee && !data2?.user && {
|
|
9516
9719
|
label: `Link User`,
|
|
9517
|
-
icon: /* @__PURE__ */ (0,
|
|
9720
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react26.Cable, { size: 16 }),
|
|
9518
9721
|
onClick: () => navigate(`link-user?id=${data2?._id}`)
|
|
9519
9722
|
}
|
|
9520
9723
|
].filter(Boolean);
|
|
@@ -9524,7 +9727,7 @@ function Accounts({ v, url }) {
|
|
|
9524
9727
|
header: "Name",
|
|
9525
9728
|
cell: ({ row }) => {
|
|
9526
9729
|
const account = row.original;
|
|
9527
|
-
return /* @__PURE__ */ (0,
|
|
9730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9528
9731
|
"span",
|
|
9529
9732
|
{
|
|
9530
9733
|
onClick: () => navigate(`statements/${account?._id}`),
|
|
@@ -9539,7 +9742,7 @@ function Accounts({ v, url }) {
|
|
|
9539
9742
|
header: "Sex",
|
|
9540
9743
|
cell: ({ row }) => {
|
|
9541
9744
|
const account = row.original;
|
|
9542
|
-
return /* @__PURE__ */ (0,
|
|
9745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: account?.sex || "N/A" });
|
|
9543
9746
|
}
|
|
9544
9747
|
},
|
|
9545
9748
|
{
|
|
@@ -9547,7 +9750,7 @@ function Accounts({ v, url }) {
|
|
|
9547
9750
|
header: "Email",
|
|
9548
9751
|
cell: ({ row }) => {
|
|
9549
9752
|
const account = row.original;
|
|
9550
|
-
return /* @__PURE__ */ (0,
|
|
9753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: account?.email || "N/A" });
|
|
9551
9754
|
}
|
|
9552
9755
|
},
|
|
9553
9756
|
{
|
|
@@ -9555,7 +9758,7 @@ function Accounts({ v, url }) {
|
|
|
9555
9758
|
header: "Phone",
|
|
9556
9759
|
cell: ({ row }) => {
|
|
9557
9760
|
const account = row.original;
|
|
9558
|
-
return /* @__PURE__ */ (0,
|
|
9761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: account?.phoneNumber || "N/A" });
|
|
9559
9762
|
}
|
|
9560
9763
|
},
|
|
9561
9764
|
isEmployee && {
|
|
@@ -9563,7 +9766,7 @@ function Accounts({ v, url }) {
|
|
|
9563
9766
|
header: "User",
|
|
9564
9767
|
cell: ({ row }) => {
|
|
9565
9768
|
const account = row.original;
|
|
9566
|
-
return /* @__PURE__ */ (0,
|
|
9769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Badge, { variant: account?.user ? "success" : "danger", size: "sm", children: account?.user ? "Linked" : "Not Linked" });
|
|
9567
9770
|
}
|
|
9568
9771
|
},
|
|
9569
9772
|
{
|
|
@@ -9571,13 +9774,13 @@ function Accounts({ v, url }) {
|
|
|
9571
9774
|
header: "Actions",
|
|
9572
9775
|
cell: ({ row }) => {
|
|
9573
9776
|
const data2 = row.original;
|
|
9574
|
-
return /* @__PURE__ */ (0,
|
|
9777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9575
9778
|
Dropdown,
|
|
9576
9779
|
{
|
|
9577
9780
|
className: "cursor-pointer w-[150px]",
|
|
9578
9781
|
items: items(data2),
|
|
9579
9782
|
triggerMode: "hover",
|
|
9580
|
-
children: /* @__PURE__ */ (0,
|
|
9783
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react26.EllipsisVertical, {})
|
|
9581
9784
|
}
|
|
9582
9785
|
);
|
|
9583
9786
|
}
|
|
@@ -9595,9 +9798,9 @@ function Accounts({ v, url }) {
|
|
|
9595
9798
|
return error;
|
|
9596
9799
|
}
|
|
9597
9800
|
};
|
|
9598
|
-
return /* @__PURE__ */ (0,
|
|
9599
|
-
/* @__PURE__ */ (0,
|
|
9600
|
-
/* @__PURE__ */ (0,
|
|
9801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
9802
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Modal2, {}),
|
|
9803
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9601
9804
|
ConfirmModal,
|
|
9602
9805
|
{
|
|
9603
9806
|
isOpen: !!deleteAccount,
|
|
@@ -9610,7 +9813,7 @@ function Accounts({ v, url }) {
|
|
|
9610
9813
|
children: null
|
|
9611
9814
|
}
|
|
9612
9815
|
),
|
|
9613
|
-
/* @__PURE__ */ (0,
|
|
9816
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9614
9817
|
TransactionViewComponent,
|
|
9615
9818
|
{
|
|
9616
9819
|
columns,
|
|
@@ -9671,7 +9874,7 @@ var import_react37 = require("react");
|
|
|
9671
9874
|
|
|
9672
9875
|
// src/hooks/useAccountBalance.tsx
|
|
9673
9876
|
var import_react36 = require("react");
|
|
9674
|
-
var
|
|
9877
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
9675
9878
|
var useAccountbalance = ({
|
|
9676
9879
|
url,
|
|
9677
9880
|
showBalance,
|
|
@@ -9705,15 +9908,15 @@ var useAccountbalance = ({
|
|
|
9705
9908
|
return null;
|
|
9706
9909
|
}
|
|
9707
9910
|
if (isLoading) {
|
|
9708
|
-
return /* @__PURE__ */ (0,
|
|
9911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h2", { className: "text-gray-500", children: "Getting Balance..." });
|
|
9709
9912
|
}
|
|
9710
9913
|
if (error) {
|
|
9711
|
-
return /* @__PURE__ */ (0,
|
|
9914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("h2", { className: "text-red-500", children: [
|
|
9712
9915
|
"Error: ",
|
|
9713
9916
|
error
|
|
9714
9917
|
] });
|
|
9715
9918
|
}
|
|
9716
|
-
return /* @__PURE__ */ (0,
|
|
9919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
9717
9920
|
"h2",
|
|
9718
9921
|
{
|
|
9719
9922
|
className: `${balance.startsWith("-") ? "text-red-500" : "text-green-500"}`,
|
|
@@ -9730,7 +9933,7 @@ var useAccountBalance_default = useAccountbalance;
|
|
|
9730
9933
|
|
|
9731
9934
|
// src/components/accounts/Feilds/Account.tsx
|
|
9732
9935
|
var import_react_router_dom8 = require("react-router-dom");
|
|
9733
|
-
var
|
|
9936
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
9734
9937
|
function Account({
|
|
9735
9938
|
name,
|
|
9736
9939
|
label,
|
|
@@ -9752,8 +9955,8 @@ function Account({
|
|
|
9752
9955
|
showBalance,
|
|
9753
9956
|
accountId
|
|
9754
9957
|
});
|
|
9755
|
-
return /* @__PURE__ */ (0,
|
|
9756
|
-
/* @__PURE__ */ (0,
|
|
9958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
9959
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9757
9960
|
Fields_default.SearchApi,
|
|
9758
9961
|
{
|
|
9759
9962
|
name,
|
|
@@ -9771,13 +9974,13 @@ function Account({
|
|
|
9771
9974
|
obj
|
|
9772
9975
|
}
|
|
9773
9976
|
),
|
|
9774
|
-
/* @__PURE__ */ (0,
|
|
9977
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(BalanceView, {})
|
|
9775
9978
|
] });
|
|
9776
9979
|
}
|
|
9777
9980
|
var Account_default = Account;
|
|
9778
9981
|
|
|
9779
9982
|
// src/components/accounts/Feilds/Customers.tsx
|
|
9780
|
-
var
|
|
9983
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
9781
9984
|
function Customer({
|
|
9782
9985
|
name = "customer",
|
|
9783
9986
|
label = "Customer",
|
|
@@ -9791,7 +9994,7 @@ function Customer({
|
|
|
9791
9994
|
v,
|
|
9792
9995
|
obj
|
|
9793
9996
|
}) {
|
|
9794
|
-
return /* @__PURE__ */ (0,
|
|
9997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
9795
9998
|
Account_default,
|
|
9796
9999
|
{
|
|
9797
10000
|
name,
|
|
@@ -9811,7 +10014,7 @@ function Customer({
|
|
|
9811
10014
|
var Customers_default = Customer;
|
|
9812
10015
|
|
|
9813
10016
|
// src/components/accounts/Feilds/Employee.tsx
|
|
9814
|
-
var
|
|
10017
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
9815
10018
|
function Employee({
|
|
9816
10019
|
name = "employee",
|
|
9817
10020
|
label = "Employee",
|
|
@@ -9825,7 +10028,7 @@ function Employee({
|
|
|
9825
10028
|
obj,
|
|
9826
10029
|
v
|
|
9827
10030
|
}) {
|
|
9828
|
-
return /* @__PURE__ */ (0,
|
|
10031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9829
10032
|
Account_default,
|
|
9830
10033
|
{
|
|
9831
10034
|
name,
|
|
@@ -9845,7 +10048,7 @@ function Employee({
|
|
|
9845
10048
|
var Employee_default = Employee;
|
|
9846
10049
|
|
|
9847
10050
|
// src/components/accounts/Feilds/Branches.tsx
|
|
9848
|
-
var
|
|
10051
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
9849
10052
|
function Branches({
|
|
9850
10053
|
name = "branch",
|
|
9851
10054
|
label = "Branch",
|
|
@@ -9858,7 +10061,7 @@ function Branches({
|
|
|
9858
10061
|
v,
|
|
9859
10062
|
disabled
|
|
9860
10063
|
}) {
|
|
9861
|
-
return /* @__PURE__ */ (0,
|
|
10064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
9862
10065
|
Account_default,
|
|
9863
10066
|
{
|
|
9864
10067
|
name,
|
|
@@ -9887,7 +10090,7 @@ var Feilds_default = AccountFields;
|
|
|
9887
10090
|
|
|
9888
10091
|
// src/components/accounts/AccountForm.tsx
|
|
9889
10092
|
var import_react_router_dom9 = require("react-router-dom");
|
|
9890
|
-
var
|
|
10093
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
9891
10094
|
function AccountForm() {
|
|
9892
10095
|
const { enums } = useWarqadConfig();
|
|
9893
10096
|
const { branchId } = (0, import_react_router_dom9.useParams)();
|
|
@@ -9952,24 +10155,24 @@ function AccountForm() {
|
|
|
9952
10155
|
fetches();
|
|
9953
10156
|
}
|
|
9954
10157
|
}, [id]);
|
|
9955
|
-
return /* @__PURE__ */ (0,
|
|
10158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
9956
10159
|
Card,
|
|
9957
10160
|
{
|
|
9958
10161
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
9959
10162
|
isLoading: isLoadingGet,
|
|
9960
10163
|
loadingText: "Processing...",
|
|
9961
10164
|
children: [
|
|
9962
|
-
/* @__PURE__ */ (0,
|
|
9963
|
-
/* @__PURE__ */ (0,
|
|
9964
|
-
/* @__PURE__ */ (0,
|
|
10165
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Card.Header, { children: [
|
|
10166
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} ${type}` }),
|
|
10167
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Card.Description, { children: isEdit ? `Update the details for this ${type}` : `Create a new ${type} and add it to your list` })
|
|
9965
10168
|
] }),
|
|
9966
|
-
/* @__PURE__ */ (0,
|
|
10169
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
9967
10170
|
"form",
|
|
9968
10171
|
{
|
|
9969
10172
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
9970
10173
|
children: [
|
|
9971
|
-
/* @__PURE__ */ (0,
|
|
9972
|
-
/* @__PURE__ */ (0,
|
|
10174
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
10175
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9973
10176
|
Fields_default.Input,
|
|
9974
10177
|
{
|
|
9975
10178
|
label: "Name",
|
|
@@ -9980,7 +10183,7 @@ function AccountForm() {
|
|
|
9980
10183
|
required: true
|
|
9981
10184
|
}
|
|
9982
10185
|
),
|
|
9983
|
-
/* @__PURE__ */ (0,
|
|
10186
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9984
10187
|
Fields_default.Select,
|
|
9985
10188
|
{
|
|
9986
10189
|
label: "Sex",
|
|
@@ -9989,7 +10192,7 @@ function AccountForm() {
|
|
|
9989
10192
|
enumName: "sex"
|
|
9990
10193
|
}
|
|
9991
10194
|
),
|
|
9992
|
-
/* @__PURE__ */ (0,
|
|
10195
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9993
10196
|
Fields_default.Input,
|
|
9994
10197
|
{
|
|
9995
10198
|
label: "Email",
|
|
@@ -9999,7 +10202,7 @@ function AccountForm() {
|
|
|
9999
10202
|
placeholder: "e.g maoo@exapmle.com"
|
|
10000
10203
|
}
|
|
10001
10204
|
),
|
|
10002
|
-
/* @__PURE__ */ (0,
|
|
10205
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
10003
10206
|
Fields_default.PhoneInput,
|
|
10004
10207
|
{
|
|
10005
10208
|
label: "Phone Number",
|
|
@@ -10008,7 +10211,7 @@ function AccountForm() {
|
|
|
10008
10211
|
placeholder: "Enter phone number"
|
|
10009
10212
|
}
|
|
10010
10213
|
),
|
|
10011
|
-
!branchId && /* @__PURE__ */ (0,
|
|
10214
|
+
!branchId && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
10012
10215
|
Feilds_default.Branches,
|
|
10013
10216
|
{
|
|
10014
10217
|
label: "Branch",
|
|
@@ -10018,7 +10221,7 @@ function AccountForm() {
|
|
|
10018
10221
|
api: "/branches/get?noStore=true"
|
|
10019
10222
|
}
|
|
10020
10223
|
),
|
|
10021
|
-
/* @__PURE__ */ (0,
|
|
10224
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
10022
10225
|
Fields_default.Select,
|
|
10023
10226
|
{
|
|
10024
10227
|
label: "Currency",
|
|
@@ -10028,7 +10231,7 @@ function AccountForm() {
|
|
|
10028
10231
|
}
|
|
10029
10232
|
)
|
|
10030
10233
|
] }),
|
|
10031
|
-
/* @__PURE__ */ (0,
|
|
10234
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
10032
10235
|
Button,
|
|
10033
10236
|
{
|
|
10034
10237
|
isLoading,
|
|
@@ -10087,7 +10290,7 @@ var import_react_hook_form9 = require("react-hook-form");
|
|
|
10087
10290
|
var import_zod5 = require("@hookform/resolvers/zod");
|
|
10088
10291
|
var import_antd10 = require("antd");
|
|
10089
10292
|
var import_react38 = require("react");
|
|
10090
|
-
var
|
|
10293
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
10091
10294
|
function LinkUser({ type: initialType = "employee" }) {
|
|
10092
10295
|
const { getQuery, navigate, getParams } = useApp_default();
|
|
10093
10296
|
const id = getQuery("id");
|
|
@@ -10143,26 +10346,26 @@ function LinkUser({ type: initialType = "employee" }) {
|
|
|
10143
10346
|
navigate(-1);
|
|
10144
10347
|
}
|
|
10145
10348
|
}, [id]);
|
|
10146
|
-
return /* @__PURE__ */ (0,
|
|
10349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
10147
10350
|
Card,
|
|
10148
10351
|
{
|
|
10149
10352
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
10150
10353
|
isLoading: isLoadingGet,
|
|
10151
10354
|
loadingText: "Processing...",
|
|
10152
10355
|
children: [
|
|
10153
|
-
/* @__PURE__ */ (0,
|
|
10154
|
-
/* @__PURE__ */ (0,
|
|
10155
|
-
/* @__PURE__ */ (0,
|
|
10356
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Card.Header, { children: [
|
|
10357
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Card.Title, { children: `Link User ` }),
|
|
10358
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Card.Description, { children: "Link User Employee and add it to your list" })
|
|
10156
10359
|
] }),
|
|
10157
|
-
/* @__PURE__ */ (0,
|
|
10360
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
10158
10361
|
"form",
|
|
10159
10362
|
{
|
|
10160
10363
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
10161
10364
|
className: "space-y-4",
|
|
10162
10365
|
children: [
|
|
10163
|
-
/* @__PURE__ */ (0,
|
|
10366
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
10164
10367
|
" ",
|
|
10165
|
-
/* @__PURE__ */ (0,
|
|
10368
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
10166
10369
|
Fields_default.Input,
|
|
10167
10370
|
{
|
|
10168
10371
|
label: "Name",
|
|
@@ -10173,7 +10376,7 @@ function LinkUser({ type: initialType = "employee" }) {
|
|
|
10173
10376
|
disabled: true
|
|
10174
10377
|
}
|
|
10175
10378
|
),
|
|
10176
|
-
/* @__PURE__ */ (0,
|
|
10379
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
10177
10380
|
Fields_default.Input,
|
|
10178
10381
|
{
|
|
10179
10382
|
label: "Email",
|
|
@@ -10184,7 +10387,7 @@ function LinkUser({ type: initialType = "employee" }) {
|
|
|
10184
10387
|
required: true
|
|
10185
10388
|
}
|
|
10186
10389
|
),
|
|
10187
|
-
/* @__PURE__ */ (0,
|
|
10390
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
10188
10391
|
Fields_default.Select,
|
|
10189
10392
|
{
|
|
10190
10393
|
label: "Role",
|
|
@@ -10195,7 +10398,7 @@ function LinkUser({ type: initialType = "employee" }) {
|
|
|
10195
10398
|
}
|
|
10196
10399
|
)
|
|
10197
10400
|
] }),
|
|
10198
|
-
/* @__PURE__ */ (0,
|
|
10401
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
10199
10402
|
Button,
|
|
10200
10403
|
{
|
|
10201
10404
|
isLoading,
|
|
@@ -10217,14 +10420,14 @@ var linkUser_default = LinkUser;
|
|
|
10217
10420
|
|
|
10218
10421
|
// src/components/users/users.tsx
|
|
10219
10422
|
var import_react42 = require("react");
|
|
10220
|
-
var
|
|
10423
|
+
var import_lucide_react27 = require("lucide-react");
|
|
10221
10424
|
|
|
10222
10425
|
// src/components/users/VerifyEmailForm.tsx
|
|
10223
10426
|
var import_react_hook_form10 = require("react-hook-form");
|
|
10224
10427
|
var import_zod6 = require("@hookform/resolvers/zod");
|
|
10225
10428
|
var import_antd11 = require("antd");
|
|
10226
10429
|
var import_react39 = require("react");
|
|
10227
|
-
var
|
|
10430
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
10228
10431
|
var { Countdown } = import_antd11.Statistic;
|
|
10229
10432
|
function VerifyEmailForm({
|
|
10230
10433
|
data,
|
|
@@ -10292,9 +10495,9 @@ function VerifyEmailForm({
|
|
|
10292
10495
|
import_antd11.message.error(error?.message || "Something went wrong");
|
|
10293
10496
|
}
|
|
10294
10497
|
};
|
|
10295
|
-
return /* @__PURE__ */ (0,
|
|
10296
|
-
/* @__PURE__ */ (0,
|
|
10297
|
-
oldEmail && /* @__PURE__ */ (0,
|
|
10498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("form", { onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)), children: [
|
|
10499
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "space-y-2", children: [
|
|
10500
|
+
oldEmail && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "border-b-2 pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10298
10501
|
Fields_default.Input,
|
|
10299
10502
|
{
|
|
10300
10503
|
label: "Current Email",
|
|
@@ -10304,7 +10507,7 @@ function VerifyEmailForm({
|
|
|
10304
10507
|
disabled: true
|
|
10305
10508
|
}
|
|
10306
10509
|
) }),
|
|
10307
|
-
/* @__PURE__ */ (0,
|
|
10510
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10308
10511
|
Fields_default.Input,
|
|
10309
10512
|
{
|
|
10310
10513
|
label: "New Email",
|
|
@@ -10315,7 +10518,7 @@ function VerifyEmailForm({
|
|
|
10315
10518
|
disabled: true
|
|
10316
10519
|
}
|
|
10317
10520
|
),
|
|
10318
|
-
/* @__PURE__ */ (0,
|
|
10521
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10319
10522
|
Fields_default.Input,
|
|
10320
10523
|
{
|
|
10321
10524
|
label: "Token",
|
|
@@ -10326,19 +10529,19 @@ function VerifyEmailForm({
|
|
|
10326
10529
|
}
|
|
10327
10530
|
)
|
|
10328
10531
|
] }),
|
|
10329
|
-
/* @__PURE__ */ (0,
|
|
10330
|
-
/* @__PURE__ */ (0,
|
|
10532
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center gap-2 mt-2", children: [
|
|
10533
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("h1", { className: "text-sm text-gray-600 dark:text-gray-400", children: [
|
|
10331
10534
|
"Didn't receive a verification token or expired?",
|
|
10332
10535
|
" "
|
|
10333
10536
|
] }),
|
|
10334
|
-
hasPassed || !threeMinutesLater ? /* @__PURE__ */ (0,
|
|
10537
|
+
hasPassed || !threeMinutesLater ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10335
10538
|
"span",
|
|
10336
10539
|
{
|
|
10337
10540
|
onClick: resend,
|
|
10338
10541
|
className: "text-blue-600 cursor-pointer underline text-sm",
|
|
10339
10542
|
children: "Resend"
|
|
10340
10543
|
}
|
|
10341
|
-
) : /* @__PURE__ */ (0,
|
|
10544
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-blue-600 cursor-pointer underline text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10342
10545
|
Countdown,
|
|
10343
10546
|
{
|
|
10344
10547
|
styles: { content: { fontSize: 14, color: "#3b82f6" } },
|
|
@@ -10348,7 +10551,7 @@ function VerifyEmailForm({
|
|
|
10348
10551
|
threeMinutesLater
|
|
10349
10552
|
) })
|
|
10350
10553
|
] }),
|
|
10351
|
-
/* @__PURE__ */ (0,
|
|
10554
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10352
10555
|
Button,
|
|
10353
10556
|
{
|
|
10354
10557
|
isLoading,
|
|
@@ -10366,7 +10569,7 @@ var VerifyEmailForm_default = VerifyEmailForm;
|
|
|
10366
10569
|
var import_react_hook_form11 = require("react-hook-form");
|
|
10367
10570
|
var import_zod7 = require("@hookform/resolvers/zod");
|
|
10368
10571
|
var import_antd12 = require("antd");
|
|
10369
|
-
var
|
|
10572
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
10370
10573
|
function UpdateEmailForm({
|
|
10371
10574
|
data,
|
|
10372
10575
|
close,
|
|
@@ -10399,9 +10602,9 @@ function UpdateEmailForm({
|
|
|
10399
10602
|
import_antd12.message.error(error?.message || "Something went wrong");
|
|
10400
10603
|
}
|
|
10401
10604
|
};
|
|
10402
|
-
return /* @__PURE__ */ (0,
|
|
10403
|
-
/* @__PURE__ */ (0,
|
|
10404
|
-
/* @__PURE__ */ (0,
|
|
10605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("form", { onSubmit: handleSubmit(onSubmit), children: [
|
|
10606
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "space-y-4", children: [
|
|
10607
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10405
10608
|
Fields_default.Input,
|
|
10406
10609
|
{
|
|
10407
10610
|
label: "Current Email",
|
|
@@ -10410,7 +10613,7 @@ function UpdateEmailForm({
|
|
|
10410
10613
|
disabled: true
|
|
10411
10614
|
}
|
|
10412
10615
|
),
|
|
10413
|
-
/* @__PURE__ */ (0,
|
|
10616
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10414
10617
|
Fields_default.Input,
|
|
10415
10618
|
{
|
|
10416
10619
|
label: "New Email Address",
|
|
@@ -10421,10 +10624,10 @@ function UpdateEmailForm({
|
|
|
10421
10624
|
required: true
|
|
10422
10625
|
}
|
|
10423
10626
|
),
|
|
10424
|
-
/* @__PURE__ */ (0,
|
|
10627
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "bg-blue-50 dark:bg-blue-900/10 border-l-4 border-blue-400 p-3 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-xs text-blue-700 dark:text-blue-400", children: "Note: You will need to verify the new email address before it becomes primary." }) })
|
|
10425
10628
|
] }),
|
|
10426
|
-
/* @__PURE__ */ (0,
|
|
10427
|
-
/* @__PURE__ */ (0,
|
|
10629
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("footer", { className: "flex justify-end mt-6 gap-3", children: [
|
|
10630
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10428
10631
|
Button,
|
|
10429
10632
|
{
|
|
10430
10633
|
type: "button",
|
|
@@ -10434,7 +10637,7 @@ function UpdateEmailForm({
|
|
|
10434
10637
|
children: "Cancel"
|
|
10435
10638
|
}
|
|
10436
10639
|
),
|
|
10437
|
-
/* @__PURE__ */ (0,
|
|
10640
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10438
10641
|
Button,
|
|
10439
10642
|
{
|
|
10440
10643
|
isLoading,
|
|
@@ -10453,7 +10656,7 @@ var UpdateEmailForm_default = UpdateEmailForm;
|
|
|
10453
10656
|
var import_react_hook_form12 = require("react-hook-form");
|
|
10454
10657
|
var import_antd13 = require("antd");
|
|
10455
10658
|
var import_react40 = require("react");
|
|
10456
|
-
var
|
|
10659
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
10457
10660
|
var { Countdown: Countdown2 } = import_antd13.Statistic;
|
|
10458
10661
|
function ResetPasswordForm({
|
|
10459
10662
|
data,
|
|
@@ -10508,9 +10711,9 @@ function ResetPasswordForm({
|
|
|
10508
10711
|
import_antd13.message.error(error?.message || "Something went wrong");
|
|
10509
10712
|
}
|
|
10510
10713
|
};
|
|
10511
|
-
return /* @__PURE__ */ (0,
|
|
10512
|
-
/* @__PURE__ */ (0,
|
|
10513
|
-
/* @__PURE__ */ (0,
|
|
10714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("form", { onSubmit: handleSubmit(onSubmit), children: [
|
|
10715
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "space-y-4", children: [
|
|
10716
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "border-b-2 pb-4 dark:border-zinc-800", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
10514
10717
|
Fields_default.Input,
|
|
10515
10718
|
{
|
|
10516
10719
|
label: "Target Email",
|
|
@@ -10519,10 +10722,10 @@ function ResetPasswordForm({
|
|
|
10519
10722
|
disabled: true
|
|
10520
10723
|
}
|
|
10521
10724
|
) }),
|
|
10522
|
-
/* @__PURE__ */ (0,
|
|
10523
|
-
!hasPassed && threeMinutesLater && /* @__PURE__ */ (0,
|
|
10524
|
-
/* @__PURE__ */ (0,
|
|
10525
|
-
/* @__PURE__ */ (0,
|
|
10725
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-orange-50 dark:bg-orange-900/10 border-l-4 border-orange-400 p-4 rounded-xl", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "text-sm text-orange-700 dark:text-orange-300", children: "Click context below to send a secure password reset link to this user." }) }),
|
|
10726
|
+
!hasPassed && threeMinutesLater && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex items-center gap-2 mt-2 bg-blue-50 dark:bg-blue-900/10 p-2 rounded-lg", children: [
|
|
10727
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "text-xs text-blue-600 dark:text-blue-400 font-medium", children: "You can request another link in:" }),
|
|
10728
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-blue-600 font-bold text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
10526
10729
|
Countdown2,
|
|
10527
10730
|
{
|
|
10528
10731
|
styles: { content: { fontSize: 12, color: "#3b82f6" } },
|
|
@@ -10533,8 +10736,8 @@ function ResetPasswordForm({
|
|
|
10533
10736
|
) })
|
|
10534
10737
|
] })
|
|
10535
10738
|
] }),
|
|
10536
|
-
/* @__PURE__ */ (0,
|
|
10537
|
-
/* @__PURE__ */ (0,
|
|
10739
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("footer", { className: "flex justify-end mt-8 gap-3", children: [
|
|
10740
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
10538
10741
|
Button,
|
|
10539
10742
|
{
|
|
10540
10743
|
type: "button",
|
|
@@ -10544,7 +10747,7 @@ function ResetPasswordForm({
|
|
|
10544
10747
|
children: "Cancel"
|
|
10545
10748
|
}
|
|
10546
10749
|
),
|
|
10547
|
-
/* @__PURE__ */ (0,
|
|
10750
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
10548
10751
|
Button,
|
|
10549
10752
|
{
|
|
10550
10753
|
isLoading,
|
|
@@ -10562,11 +10765,11 @@ var ResetPasswordForm_default = ResetPasswordForm;
|
|
|
10562
10765
|
// src/components/users/Activate.tsx
|
|
10563
10766
|
var import_antd14 = require("antd");
|
|
10564
10767
|
var import_react41 = require("react");
|
|
10565
|
-
var
|
|
10768
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
10566
10769
|
var ActivateUser = ({ data }) => {
|
|
10567
10770
|
const [checked, setChecked] = (0, import_react41.useState)(data?.isActive);
|
|
10568
10771
|
const { put, isLoading } = useApis_default();
|
|
10569
|
-
return /* @__PURE__ */ (0,
|
|
10772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_jsx_runtime60.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
10570
10773
|
import_antd14.Switch,
|
|
10571
10774
|
{
|
|
10572
10775
|
onChange: async (e) => {
|
|
@@ -10594,7 +10797,7 @@ var Activate_default = ActivateUser;
|
|
|
10594
10797
|
|
|
10595
10798
|
// src/components/users/users.tsx
|
|
10596
10799
|
var import_react_router_dom10 = require("react-router-dom");
|
|
10597
|
-
var
|
|
10800
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
10598
10801
|
function Users() {
|
|
10599
10802
|
const navigate = (0, import_react_router_dom10.useNavigate)();
|
|
10600
10803
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -10606,11 +10809,11 @@ function Users() {
|
|
|
10606
10809
|
const items = (data2) => [
|
|
10607
10810
|
{
|
|
10608
10811
|
label: `Reset Password`,
|
|
10609
|
-
icon: /* @__PURE__ */ (0,
|
|
10812
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react27.Key, { size: 16 }),
|
|
10610
10813
|
onClick: () => openState({
|
|
10611
10814
|
title: "Request Password Reset",
|
|
10612
10815
|
type: "form",
|
|
10613
|
-
content: /* @__PURE__ */ (0,
|
|
10816
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10614
10817
|
ResetPasswordForm_default,
|
|
10615
10818
|
{
|
|
10616
10819
|
data: data2,
|
|
@@ -10623,11 +10826,11 @@ function Users() {
|
|
|
10623
10826
|
},
|
|
10624
10827
|
{
|
|
10625
10828
|
label: `Update Email`,
|
|
10626
|
-
icon: /* @__PURE__ */ (0,
|
|
10829
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react27.Mail, { size: 16 }),
|
|
10627
10830
|
onClick: () => openState({
|
|
10628
10831
|
title: "Update Email Address",
|
|
10629
10832
|
type: "form",
|
|
10630
|
-
content: /* @__PURE__ */ (0,
|
|
10833
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10631
10834
|
UpdateEmailForm_default,
|
|
10632
10835
|
{
|
|
10633
10836
|
data: data2,
|
|
@@ -10640,11 +10843,11 @@ function Users() {
|
|
|
10640
10843
|
},
|
|
10641
10844
|
data2?.emailVerification && {
|
|
10642
10845
|
label: `Verify Email`,
|
|
10643
|
-
icon: /* @__PURE__ */ (0,
|
|
10846
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react27.ShieldCheck, {}),
|
|
10644
10847
|
onClick: () => openState({
|
|
10645
10848
|
title: "Verify Email",
|
|
10646
10849
|
type: "form",
|
|
10647
|
-
content: /* @__PURE__ */ (0,
|
|
10850
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10648
10851
|
VerifyEmailForm_default,
|
|
10649
10852
|
{
|
|
10650
10853
|
data: data2,
|
|
@@ -10665,16 +10868,16 @@ function Users() {
|
|
|
10665
10868
|
const data2 = row.original;
|
|
10666
10869
|
const emailVerification = data2?.emailVerification;
|
|
10667
10870
|
const newEmail = emailVerification?.email !== data2?.email ? emailVerification?.email : null;
|
|
10668
|
-
return /* @__PURE__ */ (0,
|
|
10669
|
-
/* @__PURE__ */ (0,
|
|
10871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "space-y-1", children: [
|
|
10872
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("section", { className: "flex items-center gap-2", children: [
|
|
10670
10873
|
" ",
|
|
10671
|
-
/* @__PURE__ */ (0,
|
|
10672
|
-
data2?.isEmailVerified && /* @__PURE__ */ (0,
|
|
10673
|
-
!data2?.isEmailVerified && /* @__PURE__ */ (0,
|
|
10874
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { children: data2?.email }),
|
|
10875
|
+
data2?.isEmailVerified && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Badge, { variant: "success", size: "sm", children: "Verified" }),
|
|
10876
|
+
!data2?.isEmailVerified && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Badge, { variant: "warning", size: "sm", children: "Not Verified" })
|
|
10674
10877
|
] }),
|
|
10675
|
-
newEmail && /* @__PURE__ */ (0,
|
|
10676
|
-
/* @__PURE__ */ (0,
|
|
10677
|
-
/* @__PURE__ */ (0,
|
|
10878
|
+
newEmail && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("section", { className: "flex items-center gap-2", children: [
|
|
10879
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react27.Info, { size: 16, className: "text-orange-600" }),
|
|
10880
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { children: newEmail })
|
|
10678
10881
|
] })
|
|
10679
10882
|
] });
|
|
10680
10883
|
}
|
|
@@ -10684,7 +10887,7 @@ function Users() {
|
|
|
10684
10887
|
header: "Role",
|
|
10685
10888
|
cell: ({ row }) => {
|
|
10686
10889
|
const data2 = row.original;
|
|
10687
|
-
return /* @__PURE__ */ (0,
|
|
10890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10688
10891
|
Badge,
|
|
10689
10892
|
{
|
|
10690
10893
|
variant: data2?.role === "admin" ? "primary" : "warning",
|
|
@@ -10699,7 +10902,7 @@ function Users() {
|
|
|
10699
10902
|
header: "Employee Name",
|
|
10700
10903
|
cell: ({ row }) => {
|
|
10701
10904
|
const account = row.original?.account;
|
|
10702
|
-
return /* @__PURE__ */ (0,
|
|
10905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { children: account?.name || "N/A" });
|
|
10703
10906
|
}
|
|
10704
10907
|
},
|
|
10705
10908
|
{
|
|
@@ -10707,7 +10910,7 @@ function Users() {
|
|
|
10707
10910
|
header: "Status",
|
|
10708
10911
|
cell: ({ row }) => {
|
|
10709
10912
|
const data2 = row.original;
|
|
10710
|
-
return /* @__PURE__ */ (0,
|
|
10913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Activate_default, { data: data2 });
|
|
10711
10914
|
}
|
|
10712
10915
|
},
|
|
10713
10916
|
{
|
|
@@ -10715,13 +10918,13 @@ function Users() {
|
|
|
10715
10918
|
header: "Actions",
|
|
10716
10919
|
cell: ({ row }) => {
|
|
10717
10920
|
const data2 = row.original;
|
|
10718
|
-
return /* @__PURE__ */ (0,
|
|
10921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10719
10922
|
Dropdown,
|
|
10720
10923
|
{
|
|
10721
10924
|
className: "w-fit! cursor-pointer",
|
|
10722
10925
|
items: items(data2),
|
|
10723
10926
|
triggerMode: "hover",
|
|
10724
|
-
children: /* @__PURE__ */ (0,
|
|
10927
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react27.EllipsisVertical, {})
|
|
10725
10928
|
}
|
|
10726
10929
|
);
|
|
10727
10930
|
}
|
|
@@ -10730,9 +10933,9 @@ function Users() {
|
|
|
10730
10933
|
[items]
|
|
10731
10934
|
);
|
|
10732
10935
|
const users = data?.data || [];
|
|
10733
|
-
return /* @__PURE__ */ (0,
|
|
10734
|
-
/* @__PURE__ */ (0,
|
|
10735
|
-
/* @__PURE__ */ (0,
|
|
10936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
10937
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Modal2, {}),
|
|
10938
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10736
10939
|
TransactionViewComponent,
|
|
10737
10940
|
{
|
|
10738
10941
|
columns,
|
|
@@ -10753,7 +10956,7 @@ var users_default = Users;
|
|
|
10753
10956
|
var import_react_hook_form13 = require("react-hook-form");
|
|
10754
10957
|
var import_zod8 = require("@hookform/resolvers/zod");
|
|
10755
10958
|
var import_antd15 = require("antd");
|
|
10756
|
-
var
|
|
10959
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
10757
10960
|
function UserForm() {
|
|
10758
10961
|
const { navigate } = useApp_default();
|
|
10759
10962
|
const { post, isLoading } = useApis_default();
|
|
@@ -10778,14 +10981,14 @@ function UserForm() {
|
|
|
10778
10981
|
import_antd15.message.error(error?.message || "Something went wrong");
|
|
10779
10982
|
}
|
|
10780
10983
|
};
|
|
10781
|
-
return /* @__PURE__ */ (0,
|
|
10782
|
-
/* @__PURE__ */ (0,
|
|
10783
|
-
/* @__PURE__ */ (0,
|
|
10784
|
-
/* @__PURE__ */ (0,
|
|
10984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Card, { className: "max-w-xl mx-auto mt-10 relative", children: [
|
|
10985
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Card.Header, { children: [
|
|
10986
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Card.Title, { children: "Add User" }),
|
|
10987
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Card.Description, { children: "Create a new user by providing their email and phone number." })
|
|
10785
10988
|
] }),
|
|
10786
|
-
/* @__PURE__ */ (0,
|
|
10787
|
-
/* @__PURE__ */ (0,
|
|
10788
|
-
/* @__PURE__ */ (0,
|
|
10989
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("form", { onSubmit: handleSubmit(onSubmit), children: [
|
|
10990
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "space-y-4", children: [
|
|
10991
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
10789
10992
|
Fields_default.Input,
|
|
10790
10993
|
{
|
|
10791
10994
|
label: "Email",
|
|
@@ -10796,7 +10999,7 @@ function UserForm() {
|
|
|
10796
10999
|
required: true
|
|
10797
11000
|
}
|
|
10798
11001
|
),
|
|
10799
|
-
/* @__PURE__ */ (0,
|
|
11002
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
10800
11003
|
Fields_default.PhoneInput,
|
|
10801
11004
|
{
|
|
10802
11005
|
label: "Phone Number",
|
|
@@ -10805,7 +11008,7 @@ function UserForm() {
|
|
|
10805
11008
|
placeholder: "Enter phone number"
|
|
10806
11009
|
}
|
|
10807
11010
|
),
|
|
10808
|
-
/* @__PURE__ */ (0,
|
|
11011
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
10809
11012
|
Fields_default.Select,
|
|
10810
11013
|
{
|
|
10811
11014
|
label: "Role",
|
|
@@ -10816,7 +11019,7 @@ function UserForm() {
|
|
|
10816
11019
|
}
|
|
10817
11020
|
)
|
|
10818
11021
|
] }),
|
|
10819
|
-
/* @__PURE__ */ (0,
|
|
11022
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("footer", { className: "flex justify-end mt-6", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
10820
11023
|
Button,
|
|
10821
11024
|
{
|
|
10822
11025
|
isLoading,
|
|
@@ -10834,12 +11037,12 @@ var UserForm_default = UserForm;
|
|
|
10834
11037
|
// src/components/users/ResetPasswordPage.tsx
|
|
10835
11038
|
var import_react43 = require("react");
|
|
10836
11039
|
var import_react_router_dom11 = require("react-router-dom");
|
|
10837
|
-
var
|
|
11040
|
+
var import_lucide_react28 = require("lucide-react");
|
|
10838
11041
|
var import_react_hook_form14 = require("react-hook-form");
|
|
10839
11042
|
var import_zod9 = require("@hookform/resolvers/zod");
|
|
10840
11043
|
var z4 = __toESM(require("zod"));
|
|
10841
11044
|
var import_antd16 = require("antd");
|
|
10842
|
-
var
|
|
11045
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
10843
11046
|
var resetPageSchema = z4.object({
|
|
10844
11047
|
password: z4.string().min(6, "Password must be at least 6 characters"),
|
|
10845
11048
|
confirmPassword: z4.string().min(6, "Password must be at least 6 characters")
|
|
@@ -10905,14 +11108,14 @@ function ResetPasswordPage() {
|
|
|
10905
11108
|
}
|
|
10906
11109
|
};
|
|
10907
11110
|
if (verifying) {
|
|
10908
|
-
return /* @__PURE__ */ (0,
|
|
10909
|
-
/* @__PURE__ */ (0,
|
|
10910
|
-
/* @__PURE__ */ (0,
|
|
11111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "h-screen w-full flex items-center justify-center bg-slate-50 dark:bg-[#0A0B10]", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "text-center space-y-4", children: [
|
|
11112
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_antd16.Spin, { size: "large" }),
|
|
11113
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "text-slate-500 animate-pulse", children: "Verifying reset link..." })
|
|
10911
11114
|
] }) });
|
|
10912
11115
|
}
|
|
10913
|
-
return /* @__PURE__ */ (0,
|
|
10914
|
-
/* @__PURE__ */ (0,
|
|
10915
|
-
/* @__PURE__ */ (0,
|
|
11116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex h-screen w-full overflow-hidden bg-white dark:bg-[#0A0B10]", children: [
|
|
11117
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "hidden lg:flex lg:w-1/2 relative overflow-hidden bg-slate-900 border-r border-slate-800", children: [
|
|
11118
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10916
11119
|
"div",
|
|
10917
11120
|
{
|
|
10918
11121
|
className: "absolute inset-0 z-0 opacity-40 bg-cover bg-center",
|
|
@@ -10921,35 +11124,35 @@ function ResetPasswordPage() {
|
|
|
10921
11124
|
}
|
|
10922
11125
|
}
|
|
10923
11126
|
),
|
|
10924
|
-
/* @__PURE__ */ (0,
|
|
10925
|
-
/* @__PURE__ */ (0,
|
|
10926
|
-
/* @__PURE__ */ (0,
|
|
10927
|
-
/* @__PURE__ */ (0,
|
|
10928
|
-
/* @__PURE__ */ (0,
|
|
11127
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "absolute inset-0 bg-linear-to-tr from-[#0A0B10] via-transparent to-indigo-500/10 z-10" }),
|
|
11128
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "relative z-20 p-12 flex flex-col justify-between w-full h-full", children: [
|
|
11129
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
11130
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "h-10 w-10 bg-indigo-600 rounded-lg flex items-center justify-center shadow-indigo-500/20 shadow-xl", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react28.Terminal, { className: "text-white w-6 h-6" }) }),
|
|
11131
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "text-2xl font-bold text-white tracking-widest uppercase", children: "Warqad UI" })
|
|
10929
11132
|
] }),
|
|
10930
|
-
/* @__PURE__ */ (0,
|
|
10931
|
-
/* @__PURE__ */ (0,
|
|
11133
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "max-w-md", children: [
|
|
11134
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("h1", { className: "text-5xl font-extrabold text-white mb-6 leading-tight", children: [
|
|
10932
11135
|
"Secure ",
|
|
10933
|
-
/* @__PURE__ */ (0,
|
|
11136
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "text-indigo-400", children: "Access" }),
|
|
10934
11137
|
" ",
|
|
10935
|
-
/* @__PURE__ */ (0,
|
|
11138
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("br", {}),
|
|
10936
11139
|
" ",
|
|
10937
11140
|
"Simplified."
|
|
10938
11141
|
] }),
|
|
10939
|
-
/* @__PURE__ */ (0,
|
|
11142
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "text-slate-400 text-lg leading-relaxed", children: "Reset your credentials securely and regain access to your dashboard in minutes." })
|
|
10940
11143
|
] }),
|
|
10941
|
-
/* @__PURE__ */ (0,
|
|
11144
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "text-slate-500 text-sm italic", children: "Trusted by developers worldwide." })
|
|
10942
11145
|
] })
|
|
10943
11146
|
] }),
|
|
10944
|
-
/* @__PURE__ */ (0,
|
|
10945
|
-
/* @__PURE__ */ (0,
|
|
10946
|
-
/* @__PURE__ */ (0,
|
|
10947
|
-
/* @__PURE__ */ (0,
|
|
10948
|
-
/* @__PURE__ */ (0,
|
|
10949
|
-
/* @__PURE__ */ (0,
|
|
10950
|
-
/* @__PURE__ */ (0,
|
|
11147
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "w-full lg:w-1/2 p-8 lg:p-16 flex flex-col justify-center bg-white dark:bg-[#0A0B10] relative", children: [
|
|
11148
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ThemeToggle, {}) }),
|
|
11149
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "max-w-md w-full mx-auto", children: !isVerified || error ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "text-center space-y-6", children: [
|
|
11150
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "mx-auto w-16 h-16 bg-red-100 dark:bg-red-900/20 rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react28.ShieldCheck, { className: "text-red-600 dark:text-red-400 w-8 h-8" }) }),
|
|
11151
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { children: [
|
|
11152
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h2", { className: "text-3xl font-bold text-slate-900 dark:text-white mb-2", children: "Link Invalid" }),
|
|
11153
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "text-slate-500 dark:text-slate-400", children: error || "The reset link is invalid or has already been used." })
|
|
10951
11154
|
] }),
|
|
10952
|
-
/* @__PURE__ */ (0,
|
|
11155
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10953
11156
|
Button,
|
|
10954
11157
|
{
|
|
10955
11158
|
onClick: () => navigate("/login"),
|
|
@@ -10957,22 +11160,22 @@ function ResetPasswordPage() {
|
|
|
10957
11160
|
children: "Back to Login"
|
|
10958
11161
|
}
|
|
10959
11162
|
)
|
|
10960
|
-
] }) : /* @__PURE__ */ (0,
|
|
10961
|
-
/* @__PURE__ */ (0,
|
|
10962
|
-
/* @__PURE__ */ (0,
|
|
10963
|
-
/* @__PURE__ */ (0,
|
|
11163
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
11164
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "mb-10", children: [
|
|
11165
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h2", { className: "text-3xl font-bold text-slate-900 dark:text-white mb-3 tracking-tight", children: "Reset Password" }),
|
|
11166
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("p", { className: "text-slate-500 dark:text-slate-400", children: [
|
|
10964
11167
|
"Set a new, strong password for",
|
|
10965
11168
|
" ",
|
|
10966
|
-
/* @__PURE__ */ (0,
|
|
11169
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "text-indigo-600 font-medium", children: email })
|
|
10967
11170
|
] })
|
|
10968
11171
|
] }),
|
|
10969
|
-
/* @__PURE__ */ (0,
|
|
11172
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
10970
11173
|
"form",
|
|
10971
11174
|
{
|
|
10972
11175
|
onSubmit: methods.handleSubmit(onSubmit),
|
|
10973
11176
|
className: "space-y-6",
|
|
10974
11177
|
children: [
|
|
10975
|
-
/* @__PURE__ */ (0,
|
|
11178
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10976
11179
|
Fields_default.Input,
|
|
10977
11180
|
{
|
|
10978
11181
|
form: methods,
|
|
@@ -10981,11 +11184,11 @@ function ResetPasswordPage() {
|
|
|
10981
11184
|
type: "password",
|
|
10982
11185
|
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
10983
11186
|
required: true,
|
|
10984
|
-
icon: /* @__PURE__ */ (0,
|
|
11187
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react28.Lock, { size: 18, className: "text-slate-400" }),
|
|
10985
11188
|
className: "bg-slate-50 dark:bg-slate-900/50 h-12"
|
|
10986
11189
|
}
|
|
10987
11190
|
),
|
|
10988
|
-
/* @__PURE__ */ (0,
|
|
11191
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10989
11192
|
Fields_default.Input,
|
|
10990
11193
|
{
|
|
10991
11194
|
form: methods,
|
|
@@ -10994,11 +11197,11 @@ function ResetPasswordPage() {
|
|
|
10994
11197
|
type: "password",
|
|
10995
11198
|
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
10996
11199
|
required: true,
|
|
10997
|
-
icon: /* @__PURE__ */ (0,
|
|
11200
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react28.ShieldCheck, { size: 18, className: "text-slate-400" }),
|
|
10998
11201
|
className: "bg-slate-50 dark:bg-slate-900/50 h-12"
|
|
10999
11202
|
}
|
|
11000
11203
|
),
|
|
11001
|
-
/* @__PURE__ */ (0,
|
|
11204
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
11002
11205
|
Button,
|
|
11003
11206
|
{
|
|
11004
11207
|
type: "submit",
|
|
@@ -11006,7 +11209,7 @@ function ResetPasswordPage() {
|
|
|
11006
11209
|
className: "w-full h-12 bg-indigo-600 hover:bg-indigo-500 text-white font-semibold flex items-center justify-center gap-2",
|
|
11007
11210
|
children: [
|
|
11008
11211
|
"Update Password",
|
|
11009
|
-
!isLoading && /* @__PURE__ */ (0,
|
|
11212
|
+
!isLoading && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react28.ArrowRight, { size: 18 })
|
|
11010
11213
|
]
|
|
11011
11214
|
}
|
|
11012
11215
|
)
|
|
@@ -11020,10 +11223,10 @@ function ResetPasswordPage() {
|
|
|
11020
11223
|
var ResetPasswordPage_default = ResetPasswordPage;
|
|
11021
11224
|
|
|
11022
11225
|
// src/components/users/UserProfile.tsx
|
|
11023
|
-
var
|
|
11226
|
+
var import_lucide_react29 = require("lucide-react");
|
|
11024
11227
|
var import_react_router_dom12 = require("react-router-dom");
|
|
11025
11228
|
var import_antd17 = require("antd");
|
|
11026
|
-
var
|
|
11229
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
11027
11230
|
var UserProfile = ({
|
|
11028
11231
|
items,
|
|
11029
11232
|
name,
|
|
@@ -11056,21 +11259,21 @@ var UserProfile = ({
|
|
|
11056
11259
|
const defaultItems = [
|
|
11057
11260
|
{
|
|
11058
11261
|
label: "My Profile",
|
|
11059
|
-
icon: /* @__PURE__ */ (0,
|
|
11262
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_lucide_react29.User, { size: 18 }),
|
|
11060
11263
|
onClick: () => navigate("profile"),
|
|
11061
11264
|
className: "min-w-[150px]"
|
|
11062
11265
|
},
|
|
11063
11266
|
{
|
|
11064
11267
|
label: "Logout",
|
|
11065
|
-
icon: /* @__PURE__ */ (0,
|
|
11268
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_lucide_react29.LogOut, { size: 18 }),
|
|
11066
11269
|
onClick: logout,
|
|
11067
11270
|
className: "text-red-500 hover:bg-red-50 dark:hover:bg-red-950/20"
|
|
11068
11271
|
}
|
|
11069
11272
|
];
|
|
11070
|
-
return /* @__PURE__ */ (0,
|
|
11071
|
-
showThemeToggle && /* @__PURE__ */ (0,
|
|
11072
|
-
showThemeToggle && /* @__PURE__ */ (0,
|
|
11073
|
-
/* @__PURE__ */ (0,
|
|
11273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
11274
|
+
showThemeToggle && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ThemeToggle, {}),
|
|
11275
|
+
showThemeToggle && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "w-px h-6 mx-2 bg-gray-200 dark:bg-gray-800" }),
|
|
11276
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
11074
11277
|
ProfileDropdown,
|
|
11075
11278
|
{
|
|
11076
11279
|
name: name || account?.name || "User",
|
|
@@ -11087,13 +11290,13 @@ var UserProfile_default = UserProfile;
|
|
|
11087
11290
|
|
|
11088
11291
|
// src/components/users/ProfilePage.tsx
|
|
11089
11292
|
var import_react_router_dom13 = require("react-router-dom");
|
|
11090
|
-
var
|
|
11091
|
-
var
|
|
11293
|
+
var import_lucide_react30 = require("lucide-react");
|
|
11294
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
11092
11295
|
var ProfilePage = () => {
|
|
11093
11296
|
const navigate = (0, import_react_router_dom13.useNavigate)();
|
|
11094
11297
|
const { user, account } = useAuth();
|
|
11095
11298
|
if (!user) {
|
|
11096
|
-
return /* @__PURE__ */ (0,
|
|
11299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h1", { children: "Please login to view your profile" }) });
|
|
11097
11300
|
}
|
|
11098
11301
|
const extraInfo = [
|
|
11099
11302
|
{
|
|
@@ -11112,19 +11315,19 @@ var ProfilePage = () => {
|
|
|
11112
11315
|
copiable: false
|
|
11113
11316
|
}
|
|
11114
11317
|
];
|
|
11115
|
-
return /* @__PURE__ */ (0,
|
|
11116
|
-
/* @__PURE__ */ (0,
|
|
11318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "p-4 sm:p-8 space-y-6", children: [
|
|
11319
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "max-w-5xl mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
11117
11320
|
Button,
|
|
11118
11321
|
{
|
|
11119
11322
|
variant: "outline",
|
|
11120
11323
|
size: "sm",
|
|
11121
11324
|
onClick: () => navigate(-1),
|
|
11122
|
-
icon: /* @__PURE__ */ (0,
|
|
11325
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react30.ArrowLeft, { size: 16 }),
|
|
11123
11326
|
className: "rounded-full font-bold px-5",
|
|
11124
11327
|
children: "Back"
|
|
11125
11328
|
}
|
|
11126
11329
|
) }),
|
|
11127
|
-
/* @__PURE__ */ (0,
|
|
11330
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
11128
11331
|
ProfileView,
|
|
11129
11332
|
{
|
|
11130
11333
|
name: account?.name || "User Account",
|
|
@@ -11141,10 +11344,10 @@ var ProfilePage_default = ProfilePage;
|
|
|
11141
11344
|
|
|
11142
11345
|
// src/components/wallets/Wallets.tsx
|
|
11143
11346
|
var import_react_router_dom14 = require("react-router-dom");
|
|
11144
|
-
var
|
|
11347
|
+
var import_lucide_react31 = require("lucide-react");
|
|
11145
11348
|
var import_react44 = require("react");
|
|
11146
11349
|
var import_antd18 = require("antd");
|
|
11147
|
-
var
|
|
11350
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
11148
11351
|
function Wallets({ v, url }) {
|
|
11149
11352
|
const { branchId } = (0, import_react_router_dom14.useParams)();
|
|
11150
11353
|
const [deleteWallet, setDeleteWallet] = (0, import_react44.useState)(null);
|
|
@@ -11159,12 +11362,12 @@ function Wallets({ v, url }) {
|
|
|
11159
11362
|
const items = (data2) => [
|
|
11160
11363
|
{
|
|
11161
11364
|
label: `Edit Wallet`,
|
|
11162
|
-
icon: /* @__PURE__ */ (0,
|
|
11365
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react31.FilePenLine, { size: 16 }),
|
|
11163
11366
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
11164
11367
|
},
|
|
11165
11368
|
{
|
|
11166
11369
|
label: `Delete Wallet`,
|
|
11167
|
-
icon: /* @__PURE__ */ (0,
|
|
11370
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react31.Trash2, { className: "text-red-500", size: 16 }),
|
|
11168
11371
|
onClick: () => setDeleteWallet(data2)
|
|
11169
11372
|
}
|
|
11170
11373
|
].filter(Boolean);
|
|
@@ -11174,7 +11377,7 @@ function Wallets({ v, url }) {
|
|
|
11174
11377
|
header: "Name",
|
|
11175
11378
|
cell: ({ row }) => {
|
|
11176
11379
|
const wallet = row.original;
|
|
11177
|
-
return /* @__PURE__ */ (0,
|
|
11380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11178
11381
|
"span",
|
|
11179
11382
|
{
|
|
11180
11383
|
onClick: () => navigate(`statements/${wallet?._id}`),
|
|
@@ -11189,7 +11392,7 @@ function Wallets({ v, url }) {
|
|
|
11189
11392
|
header: "Type",
|
|
11190
11393
|
cell: ({ row }) => {
|
|
11191
11394
|
const wallet = row.original;
|
|
11192
|
-
return /* @__PURE__ */ (0,
|
|
11395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "capitalize", children: wallet?.type });
|
|
11193
11396
|
}
|
|
11194
11397
|
},
|
|
11195
11398
|
{
|
|
@@ -11197,7 +11400,7 @@ function Wallets({ v, url }) {
|
|
|
11197
11400
|
header: "Currency",
|
|
11198
11401
|
cell: ({ row }) => {
|
|
11199
11402
|
const wallet = row.original;
|
|
11200
|
-
return /* @__PURE__ */ (0,
|
|
11403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { children: wallet?.currency });
|
|
11201
11404
|
}
|
|
11202
11405
|
},
|
|
11203
11406
|
{
|
|
@@ -11205,7 +11408,7 @@ function Wallets({ v, url }) {
|
|
|
11205
11408
|
header: "Account No",
|
|
11206
11409
|
cell: ({ row }) => {
|
|
11207
11410
|
const wallet = row.original;
|
|
11208
|
-
return /* @__PURE__ */ (0,
|
|
11411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { children: wallet?.accountNo || "N/A" });
|
|
11209
11412
|
}
|
|
11210
11413
|
},
|
|
11211
11414
|
{
|
|
@@ -11213,13 +11416,13 @@ function Wallets({ v, url }) {
|
|
|
11213
11416
|
header: "Actions",
|
|
11214
11417
|
cell: ({ row }) => {
|
|
11215
11418
|
const data2 = row.original;
|
|
11216
|
-
return /* @__PURE__ */ (0,
|
|
11419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11217
11420
|
Dropdown,
|
|
11218
11421
|
{
|
|
11219
11422
|
className: "cursor-pointer w-[150px]",
|
|
11220
11423
|
items: items(data2),
|
|
11221
11424
|
triggerMode: "hover",
|
|
11222
|
-
children: /* @__PURE__ */ (0,
|
|
11425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react31.EllipsisVertical, {})
|
|
11223
11426
|
}
|
|
11224
11427
|
);
|
|
11225
11428
|
}
|
|
@@ -11237,9 +11440,9 @@ function Wallets({ v, url }) {
|
|
|
11237
11440
|
return error;
|
|
11238
11441
|
}
|
|
11239
11442
|
};
|
|
11240
|
-
return /* @__PURE__ */ (0,
|
|
11241
|
-
/* @__PURE__ */ (0,
|
|
11242
|
-
/* @__PURE__ */ (0,
|
|
11443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
11444
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Modal2, {}),
|
|
11445
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11243
11446
|
ConfirmModal,
|
|
11244
11447
|
{
|
|
11245
11448
|
isOpen: !!deleteWallet,
|
|
@@ -11252,7 +11455,7 @@ function Wallets({ v, url }) {
|
|
|
11252
11455
|
children: null
|
|
11253
11456
|
}
|
|
11254
11457
|
),
|
|
11255
|
-
/* @__PURE__ */ (0,
|
|
11458
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11256
11459
|
TransactionViewComponent,
|
|
11257
11460
|
{
|
|
11258
11461
|
columns,
|
|
@@ -11286,7 +11489,7 @@ var import_zod11 = require("@hookform/resolvers/zod");
|
|
|
11286
11489
|
var import_antd19 = require("antd");
|
|
11287
11490
|
var import_react45 = require("react");
|
|
11288
11491
|
var import_react_router_dom15 = require("react-router-dom");
|
|
11289
|
-
var
|
|
11492
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
11290
11493
|
function WalletForm() {
|
|
11291
11494
|
const { enums } = useWarqadConfig();
|
|
11292
11495
|
const { branchId } = (0, import_react_router_dom15.useParams)();
|
|
@@ -11348,24 +11551,24 @@ function WalletForm() {
|
|
|
11348
11551
|
fetches();
|
|
11349
11552
|
}
|
|
11350
11553
|
}, [id]);
|
|
11351
|
-
return /* @__PURE__ */ (0,
|
|
11554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
11352
11555
|
Card,
|
|
11353
11556
|
{
|
|
11354
11557
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
11355
11558
|
isLoading: isLoadingGet,
|
|
11356
11559
|
loadingText: "Processing...",
|
|
11357
11560
|
children: [
|
|
11358
|
-
/* @__PURE__ */ (0,
|
|
11359
|
-
/* @__PURE__ */ (0,
|
|
11360
|
-
/* @__PURE__ */ (0,
|
|
11561
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Card.Header, { children: [
|
|
11562
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Wallet` }),
|
|
11563
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card.Description, { children: isEdit ? `Update the details for this wallet` : `Create a new wallet and add it to your list` })
|
|
11361
11564
|
] }),
|
|
11362
|
-
/* @__PURE__ */ (0,
|
|
11565
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
11363
11566
|
"form",
|
|
11364
11567
|
{
|
|
11365
11568
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
11366
11569
|
children: [
|
|
11367
|
-
/* @__PURE__ */ (0,
|
|
11368
|
-
/* @__PURE__ */ (0,
|
|
11570
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
11571
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11369
11572
|
Fields_default.Input,
|
|
11370
11573
|
{
|
|
11371
11574
|
label: "Name",
|
|
@@ -11376,7 +11579,7 @@ function WalletForm() {
|
|
|
11376
11579
|
required: true
|
|
11377
11580
|
}
|
|
11378
11581
|
),
|
|
11379
|
-
/* @__PURE__ */ (0,
|
|
11582
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11380
11583
|
Fields_default.Select,
|
|
11381
11584
|
{
|
|
11382
11585
|
label: "Wallet Type",
|
|
@@ -11386,7 +11589,7 @@ function WalletForm() {
|
|
|
11386
11589
|
enumName: "walletTypes"
|
|
11387
11590
|
}
|
|
11388
11591
|
),
|
|
11389
|
-
/* @__PURE__ */ (0,
|
|
11592
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11390
11593
|
Fields_default.Select,
|
|
11391
11594
|
{
|
|
11392
11595
|
label: "Currency",
|
|
@@ -11396,7 +11599,7 @@ function WalletForm() {
|
|
|
11396
11599
|
enumName: "currencies"
|
|
11397
11600
|
}
|
|
11398
11601
|
),
|
|
11399
|
-
/* @__PURE__ */ (0,
|
|
11602
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11400
11603
|
Fields_default.Input,
|
|
11401
11604
|
{
|
|
11402
11605
|
label: "Account Number",
|
|
@@ -11406,7 +11609,7 @@ function WalletForm() {
|
|
|
11406
11609
|
placeholder: "Enter account number (optional)"
|
|
11407
11610
|
}
|
|
11408
11611
|
),
|
|
11409
|
-
!branchId && /* @__PURE__ */ (0,
|
|
11612
|
+
!branchId && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11410
11613
|
Feilds_default.Branches,
|
|
11411
11614
|
{
|
|
11412
11615
|
label: "Branch",
|
|
@@ -11417,7 +11620,7 @@ function WalletForm() {
|
|
|
11417
11620
|
}
|
|
11418
11621
|
)
|
|
11419
11622
|
] }),
|
|
11420
|
-
/* @__PURE__ */ (0,
|
|
11623
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11421
11624
|
Button,
|
|
11422
11625
|
{
|
|
11423
11626
|
isLoading,
|
|
@@ -11439,8 +11642,8 @@ var WalletForm_default = WalletForm;
|
|
|
11439
11642
|
|
|
11440
11643
|
// src/components/wallets/Feilds/Wallet.tsx
|
|
11441
11644
|
var import_react_router_dom16 = require("react-router-dom");
|
|
11442
|
-
var
|
|
11443
|
-
function
|
|
11645
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
11646
|
+
function Wallet5({
|
|
11444
11647
|
name,
|
|
11445
11648
|
label,
|
|
11446
11649
|
placeholder,
|
|
@@ -11461,8 +11664,8 @@ function Wallet4({
|
|
|
11461
11664
|
showBalance,
|
|
11462
11665
|
accountId: walletId
|
|
11463
11666
|
});
|
|
11464
|
-
return /* @__PURE__ */ (0,
|
|
11465
|
-
/* @__PURE__ */ (0,
|
|
11667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
11668
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
11466
11669
|
Fields_default.SearchApi,
|
|
11467
11670
|
{
|
|
11468
11671
|
name,
|
|
@@ -11480,10 +11683,10 @@ function Wallet4({
|
|
|
11480
11683
|
obj
|
|
11481
11684
|
}
|
|
11482
11685
|
),
|
|
11483
|
-
/* @__PURE__ */ (0,
|
|
11686
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(BalanceView, {})
|
|
11484
11687
|
] });
|
|
11485
11688
|
}
|
|
11486
|
-
var Wallet_default =
|
|
11689
|
+
var Wallet_default = Wallet5;
|
|
11487
11690
|
|
|
11488
11691
|
// src/components/wallets/Feilds/index.tsx
|
|
11489
11692
|
var WalletField = {
|
|
@@ -11493,10 +11696,10 @@ var Feilds_default2 = WalletField;
|
|
|
11493
11696
|
|
|
11494
11697
|
// src/components/brands/Brands.tsx
|
|
11495
11698
|
var import_react_router_dom17 = require("react-router-dom");
|
|
11496
|
-
var
|
|
11699
|
+
var import_lucide_react32 = require("lucide-react");
|
|
11497
11700
|
var import_react46 = require("react");
|
|
11498
11701
|
var import_antd20 = require("antd");
|
|
11499
|
-
var
|
|
11702
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
11500
11703
|
function Brands({ v, url }) {
|
|
11501
11704
|
const [deleteBrand, setDeleteBrand] = (0, import_react46.useState)(null);
|
|
11502
11705
|
const { isLoading, remove } = useApis_default();
|
|
@@ -11510,12 +11713,12 @@ function Brands({ v, url }) {
|
|
|
11510
11713
|
const items = (data2) => [
|
|
11511
11714
|
{
|
|
11512
11715
|
label: `Edit Brand`,
|
|
11513
|
-
icon: /* @__PURE__ */ (0,
|
|
11716
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react32.FilePenLine, { size: 16 }),
|
|
11514
11717
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
11515
11718
|
},
|
|
11516
11719
|
{
|
|
11517
11720
|
label: `Delete Brand`,
|
|
11518
|
-
icon: /* @__PURE__ */ (0,
|
|
11721
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react32.Trash2, { className: "text-red-500", size: 16 }),
|
|
11519
11722
|
onClick: () => setDeleteBrand(data2)
|
|
11520
11723
|
}
|
|
11521
11724
|
].filter(Boolean);
|
|
@@ -11525,7 +11728,7 @@ function Brands({ v, url }) {
|
|
|
11525
11728
|
header: "Name",
|
|
11526
11729
|
cell: ({ row }) => {
|
|
11527
11730
|
const brand = row.original;
|
|
11528
|
-
return /* @__PURE__ */ (0,
|
|
11731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: brand?.name });
|
|
11529
11732
|
}
|
|
11530
11733
|
},
|
|
11531
11734
|
{
|
|
@@ -11533,13 +11736,13 @@ function Brands({ v, url }) {
|
|
|
11533
11736
|
header: "Actions",
|
|
11534
11737
|
cell: ({ row }) => {
|
|
11535
11738
|
const data2 = row.original;
|
|
11536
|
-
return /* @__PURE__ */ (0,
|
|
11739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11537
11740
|
Dropdown,
|
|
11538
11741
|
{
|
|
11539
11742
|
className: "cursor-pointer w-[150px]",
|
|
11540
11743
|
items: items(data2),
|
|
11541
11744
|
triggerMode: "hover",
|
|
11542
|
-
children: /* @__PURE__ */ (0,
|
|
11745
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react32.EllipsisVertical, {})
|
|
11543
11746
|
}
|
|
11544
11747
|
);
|
|
11545
11748
|
}
|
|
@@ -11557,9 +11760,9 @@ function Brands({ v, url }) {
|
|
|
11557
11760
|
return error;
|
|
11558
11761
|
}
|
|
11559
11762
|
};
|
|
11560
|
-
return /* @__PURE__ */ (0,
|
|
11561
|
-
/* @__PURE__ */ (0,
|
|
11562
|
-
/* @__PURE__ */ (0,
|
|
11763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
11764
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Modal2, {}),
|
|
11765
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11563
11766
|
ConfirmModal,
|
|
11564
11767
|
{
|
|
11565
11768
|
isOpen: !!deleteBrand,
|
|
@@ -11572,7 +11775,7 @@ function Brands({ v, url }) {
|
|
|
11572
11775
|
children: null
|
|
11573
11776
|
}
|
|
11574
11777
|
),
|
|
11575
|
-
/* @__PURE__ */ (0,
|
|
11778
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11576
11779
|
TransactionViewComponent,
|
|
11577
11780
|
{
|
|
11578
11781
|
columns,
|
|
@@ -11601,7 +11804,7 @@ var import_react_hook_form16 = require("react-hook-form");
|
|
|
11601
11804
|
var import_zod13 = require("@hookform/resolvers/zod");
|
|
11602
11805
|
var import_antd21 = require("antd");
|
|
11603
11806
|
var import_react47 = require("react");
|
|
11604
|
-
var
|
|
11807
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
11605
11808
|
function BrandForm() {
|
|
11606
11809
|
const { getQuery, navigate } = useApp_default();
|
|
11607
11810
|
const id = getQuery("id");
|
|
@@ -11651,23 +11854,23 @@ function BrandForm() {
|
|
|
11651
11854
|
fetches();
|
|
11652
11855
|
}
|
|
11653
11856
|
}, [id]);
|
|
11654
|
-
return /* @__PURE__ */ (0,
|
|
11857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
11655
11858
|
Card,
|
|
11656
11859
|
{
|
|
11657
11860
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
11658
11861
|
isLoading: isLoadingGet,
|
|
11659
11862
|
loadingText: "Processing...",
|
|
11660
11863
|
children: [
|
|
11661
|
-
/* @__PURE__ */ (0,
|
|
11662
|
-
/* @__PURE__ */ (0,
|
|
11663
|
-
/* @__PURE__ */ (0,
|
|
11864
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(Card.Header, { children: [
|
|
11865
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Brand` }),
|
|
11866
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Card.Description, { children: isEdit ? `Update the details for this brand` : `Create a new brand and add it to your list` })
|
|
11664
11867
|
] }),
|
|
11665
|
-
/* @__PURE__ */ (0,
|
|
11868
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
11666
11869
|
"form",
|
|
11667
11870
|
{
|
|
11668
11871
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
11669
11872
|
children: [
|
|
11670
|
-
/* @__PURE__ */ (0,
|
|
11873
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
11671
11874
|
Fields_default.Input,
|
|
11672
11875
|
{
|
|
11673
11876
|
label: "Name",
|
|
@@ -11678,7 +11881,7 @@ function BrandForm() {
|
|
|
11678
11881
|
required: true
|
|
11679
11882
|
}
|
|
11680
11883
|
) }),
|
|
11681
|
-
/* @__PURE__ */ (0,
|
|
11884
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
11682
11885
|
Button,
|
|
11683
11886
|
{
|
|
11684
11887
|
isLoading,
|
|
@@ -11700,7 +11903,7 @@ var BrandForm_default = BrandForm;
|
|
|
11700
11903
|
|
|
11701
11904
|
// src/components/brands/Feilds/Brand.tsx
|
|
11702
11905
|
var import_react_router_dom18 = require("react-router-dom");
|
|
11703
|
-
var
|
|
11906
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
11704
11907
|
function Brand({
|
|
11705
11908
|
name,
|
|
11706
11909
|
label,
|
|
@@ -11713,7 +11916,7 @@ function Brand({
|
|
|
11713
11916
|
disabled
|
|
11714
11917
|
}) {
|
|
11715
11918
|
const { branchId } = (0, import_react_router_dom18.useParams)();
|
|
11716
|
-
return /* @__PURE__ */ (0,
|
|
11919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
11717
11920
|
Fields_default.SearchApi,
|
|
11718
11921
|
{
|
|
11719
11922
|
name,
|
|
@@ -11741,10 +11944,10 @@ var Feilds_default3 = BrandField;
|
|
|
11741
11944
|
|
|
11742
11945
|
// src/components/categories/Categories.tsx
|
|
11743
11946
|
var import_react_router_dom19 = require("react-router-dom");
|
|
11744
|
-
var
|
|
11947
|
+
var import_lucide_react33 = require("lucide-react");
|
|
11745
11948
|
var import_react48 = require("react");
|
|
11746
11949
|
var import_antd22 = require("antd");
|
|
11747
|
-
var
|
|
11950
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
11748
11951
|
function Categories({ v, url }) {
|
|
11749
11952
|
const [deleteCategory, setDeleteCategory] = (0, import_react48.useState)(null);
|
|
11750
11953
|
const { isLoading, remove } = useApis_default();
|
|
@@ -11758,12 +11961,12 @@ function Categories({ v, url }) {
|
|
|
11758
11961
|
const items = (data2) => [
|
|
11759
11962
|
{
|
|
11760
11963
|
label: `Edit Category`,
|
|
11761
|
-
icon: /* @__PURE__ */ (0,
|
|
11964
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react33.FilePenLine, { size: 16 }),
|
|
11762
11965
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
11763
11966
|
},
|
|
11764
11967
|
{
|
|
11765
11968
|
label: `Delete Category`,
|
|
11766
|
-
icon: /* @__PURE__ */ (0,
|
|
11969
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react33.Trash2, { className: "text-red-500", size: 16 }),
|
|
11767
11970
|
onClick: () => setDeleteCategory(data2)
|
|
11768
11971
|
}
|
|
11769
11972
|
].filter(Boolean);
|
|
@@ -11773,7 +11976,7 @@ function Categories({ v, url }) {
|
|
|
11773
11976
|
header: "Name",
|
|
11774
11977
|
cell: ({ row }) => {
|
|
11775
11978
|
const category = row.original;
|
|
11776
|
-
return /* @__PURE__ */ (0,
|
|
11979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { children: category?.name });
|
|
11777
11980
|
}
|
|
11778
11981
|
},
|
|
11779
11982
|
{
|
|
@@ -11781,13 +11984,13 @@ function Categories({ v, url }) {
|
|
|
11781
11984
|
header: "Actions",
|
|
11782
11985
|
cell: ({ row }) => {
|
|
11783
11986
|
const data2 = row.original;
|
|
11784
|
-
return /* @__PURE__ */ (0,
|
|
11987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
11785
11988
|
Dropdown,
|
|
11786
11989
|
{
|
|
11787
11990
|
className: "cursor-pointer w-[150px]",
|
|
11788
11991
|
items: items(data2),
|
|
11789
11992
|
triggerMode: "hover",
|
|
11790
|
-
children: /* @__PURE__ */ (0,
|
|
11993
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react33.EllipsisVertical, {})
|
|
11791
11994
|
}
|
|
11792
11995
|
);
|
|
11793
11996
|
}
|
|
@@ -11805,9 +12008,9 @@ function Categories({ v, url }) {
|
|
|
11805
12008
|
return error;
|
|
11806
12009
|
}
|
|
11807
12010
|
};
|
|
11808
|
-
return /* @__PURE__ */ (0,
|
|
11809
|
-
/* @__PURE__ */ (0,
|
|
11810
|
-
/* @__PURE__ */ (0,
|
|
12011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
|
|
12012
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Modal2, {}),
|
|
12013
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
11811
12014
|
ConfirmModal,
|
|
11812
12015
|
{
|
|
11813
12016
|
isOpen: !!deleteCategory,
|
|
@@ -11820,7 +12023,7 @@ function Categories({ v, url }) {
|
|
|
11820
12023
|
children: null
|
|
11821
12024
|
}
|
|
11822
12025
|
),
|
|
11823
|
-
/* @__PURE__ */ (0,
|
|
12026
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
11824
12027
|
TransactionViewComponent,
|
|
11825
12028
|
{
|
|
11826
12029
|
columns,
|
|
@@ -11849,7 +12052,7 @@ var import_react_hook_form17 = require("react-hook-form");
|
|
|
11849
12052
|
var import_zod15 = require("@hookform/resolvers/zod");
|
|
11850
12053
|
var import_antd23 = require("antd");
|
|
11851
12054
|
var import_react49 = require("react");
|
|
11852
|
-
var
|
|
12055
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
11853
12056
|
function CategoryForm() {
|
|
11854
12057
|
const { getQuery, navigate } = useApp_default();
|
|
11855
12058
|
const id = getQuery("id");
|
|
@@ -11899,23 +12102,23 @@ function CategoryForm() {
|
|
|
11899
12102
|
fetches();
|
|
11900
12103
|
}
|
|
11901
12104
|
}, [id]);
|
|
11902
|
-
return /* @__PURE__ */ (0,
|
|
12105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
11903
12106
|
Card,
|
|
11904
12107
|
{
|
|
11905
12108
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
11906
12109
|
isLoading: isLoadingGet,
|
|
11907
12110
|
loadingText: "Processing...",
|
|
11908
12111
|
children: [
|
|
11909
|
-
/* @__PURE__ */ (0,
|
|
11910
|
-
/* @__PURE__ */ (0,
|
|
11911
|
-
/* @__PURE__ */ (0,
|
|
12112
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Card.Header, { children: [
|
|
12113
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Category` }),
|
|
12114
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Card.Description, { children: isEdit ? `Update the details for this category` : `Create a new category and add it to your list` })
|
|
11912
12115
|
] }),
|
|
11913
|
-
/* @__PURE__ */ (0,
|
|
12116
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
11914
12117
|
"form",
|
|
11915
12118
|
{
|
|
11916
12119
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
11917
12120
|
children: [
|
|
11918
|
-
/* @__PURE__ */ (0,
|
|
12121
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
11919
12122
|
Fields_default.Input,
|
|
11920
12123
|
{
|
|
11921
12124
|
label: "Name",
|
|
@@ -11926,7 +12129,7 @@ function CategoryForm() {
|
|
|
11926
12129
|
required: true
|
|
11927
12130
|
}
|
|
11928
12131
|
) }),
|
|
11929
|
-
/* @__PURE__ */ (0,
|
|
12132
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
11930
12133
|
Button,
|
|
11931
12134
|
{
|
|
11932
12135
|
isLoading,
|
|
@@ -11948,7 +12151,7 @@ var CategoryForm_default = CategoryForm;
|
|
|
11948
12151
|
|
|
11949
12152
|
// src/components/categories/Feilds/Category.tsx
|
|
11950
12153
|
var import_react_router_dom20 = require("react-router-dom");
|
|
11951
|
-
var
|
|
12154
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
11952
12155
|
function Category({
|
|
11953
12156
|
name,
|
|
11954
12157
|
label,
|
|
@@ -11961,7 +12164,7 @@ function Category({
|
|
|
11961
12164
|
disabled
|
|
11962
12165
|
}) {
|
|
11963
12166
|
const { branchId } = (0, import_react_router_dom20.useParams)();
|
|
11964
|
-
return /* @__PURE__ */ (0,
|
|
12167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
11965
12168
|
Fields_default.SearchApi,
|
|
11966
12169
|
{
|
|
11967
12170
|
name,
|
|
@@ -11989,10 +12192,10 @@ var Feilds_default4 = CategoryField;
|
|
|
11989
12192
|
|
|
11990
12193
|
// src/components/products/Products.tsx
|
|
11991
12194
|
var import_react_router_dom21 = require("react-router-dom");
|
|
11992
|
-
var
|
|
12195
|
+
var import_lucide_react34 = require("lucide-react");
|
|
11993
12196
|
var import_react50 = require("react");
|
|
11994
12197
|
var import_antd24 = require("antd");
|
|
11995
|
-
var
|
|
12198
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
11996
12199
|
function Products({ v, url }) {
|
|
11997
12200
|
const [deleteProduct, setDeleteProduct] = (0, import_react50.useState)(null);
|
|
11998
12201
|
const { isLoading, remove } = useApis_default();
|
|
@@ -12006,12 +12209,12 @@ function Products({ v, url }) {
|
|
|
12006
12209
|
const items = (data2) => [
|
|
12007
12210
|
{
|
|
12008
12211
|
label: `Edit Product`,
|
|
12009
|
-
icon: /* @__PURE__ */ (0,
|
|
12212
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react34.FilePenLine, { size: 16 }),
|
|
12010
12213
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
12011
12214
|
},
|
|
12012
12215
|
{
|
|
12013
12216
|
label: `Delete Product`,
|
|
12014
|
-
icon: /* @__PURE__ */ (0,
|
|
12217
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react34.Trash2, { className: "text-red-500", size: 16 }),
|
|
12015
12218
|
onClick: () => setDeleteProduct(data2)
|
|
12016
12219
|
}
|
|
12017
12220
|
].filter(Boolean);
|
|
@@ -12021,7 +12224,7 @@ function Products({ v, url }) {
|
|
|
12021
12224
|
header: "Name",
|
|
12022
12225
|
cell: ({ row }) => {
|
|
12023
12226
|
const product = row.original;
|
|
12024
|
-
return /* @__PURE__ */ (0,
|
|
12227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { children: product?.name });
|
|
12025
12228
|
}
|
|
12026
12229
|
},
|
|
12027
12230
|
{
|
|
@@ -12029,7 +12232,7 @@ function Products({ v, url }) {
|
|
|
12029
12232
|
header: "Category",
|
|
12030
12233
|
cell: ({ row }) => {
|
|
12031
12234
|
const product = row.original;
|
|
12032
|
-
return /* @__PURE__ */ (0,
|
|
12235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { children: product?.categoryData?.name || "N/A" });
|
|
12033
12236
|
}
|
|
12034
12237
|
},
|
|
12035
12238
|
{
|
|
@@ -12037,7 +12240,7 @@ function Products({ v, url }) {
|
|
|
12037
12240
|
header: "Brand",
|
|
12038
12241
|
cell: ({ row }) => {
|
|
12039
12242
|
const product = row.original;
|
|
12040
|
-
return /* @__PURE__ */ (0,
|
|
12243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { children: product?.brandData?.name || "N/A" });
|
|
12041
12244
|
}
|
|
12042
12245
|
},
|
|
12043
12246
|
{
|
|
@@ -12045,7 +12248,7 @@ function Products({ v, url }) {
|
|
|
12045
12248
|
header: "Cost",
|
|
12046
12249
|
cell: ({ row }) => {
|
|
12047
12250
|
const product = row.original;
|
|
12048
|
-
return /* @__PURE__ */ (0,
|
|
12251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("span", { children: [
|
|
12049
12252
|
" ",
|
|
12050
12253
|
product?.cost?.toLocaleString()
|
|
12051
12254
|
] });
|
|
@@ -12056,13 +12259,13 @@ function Products({ v, url }) {
|
|
|
12056
12259
|
header: "Actions",
|
|
12057
12260
|
cell: ({ row }) => {
|
|
12058
12261
|
const data2 = row.original;
|
|
12059
|
-
return /* @__PURE__ */ (0,
|
|
12262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
12060
12263
|
Dropdown,
|
|
12061
12264
|
{
|
|
12062
12265
|
className: "cursor-pointer w-[150px]",
|
|
12063
12266
|
items: items(data2),
|
|
12064
12267
|
triggerMode: "hover",
|
|
12065
|
-
children: /* @__PURE__ */ (0,
|
|
12268
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react34.EllipsisVertical, {})
|
|
12066
12269
|
}
|
|
12067
12270
|
);
|
|
12068
12271
|
}
|
|
@@ -12080,9 +12283,9 @@ function Products({ v, url }) {
|
|
|
12080
12283
|
return error;
|
|
12081
12284
|
}
|
|
12082
12285
|
};
|
|
12083
|
-
return /* @__PURE__ */ (0,
|
|
12084
|
-
/* @__PURE__ */ (0,
|
|
12085
|
-
/* @__PURE__ */ (0,
|
|
12286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
12287
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Modal2, {}),
|
|
12288
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
12086
12289
|
ConfirmModal,
|
|
12087
12290
|
{
|
|
12088
12291
|
isOpen: !!deleteProduct,
|
|
@@ -12095,7 +12298,7 @@ function Products({ v, url }) {
|
|
|
12095
12298
|
children: null
|
|
12096
12299
|
}
|
|
12097
12300
|
),
|
|
12098
|
-
/* @__PURE__ */ (0,
|
|
12301
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
12099
12302
|
TransactionViewComponent,
|
|
12100
12303
|
{
|
|
12101
12304
|
columns,
|
|
@@ -12127,7 +12330,7 @@ var import_react_hook_form18 = require("react-hook-form");
|
|
|
12127
12330
|
var import_zod17 = require("@hookform/resolvers/zod");
|
|
12128
12331
|
var import_antd25 = require("antd");
|
|
12129
12332
|
var import_react51 = require("react");
|
|
12130
|
-
var
|
|
12333
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
12131
12334
|
function ProductForm() {
|
|
12132
12335
|
const { getQuery, navigate } = useApp_default();
|
|
12133
12336
|
const id = getQuery("id");
|
|
@@ -12180,24 +12383,24 @@ function ProductForm() {
|
|
|
12180
12383
|
fetches();
|
|
12181
12384
|
}
|
|
12182
12385
|
}, [id]);
|
|
12183
|
-
return /* @__PURE__ */ (0,
|
|
12386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
12184
12387
|
Card,
|
|
12185
12388
|
{
|
|
12186
12389
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
12187
12390
|
isLoading: isLoadingGet,
|
|
12188
12391
|
loadingText: "Processing...",
|
|
12189
12392
|
children: [
|
|
12190
|
-
/* @__PURE__ */ (0,
|
|
12191
|
-
/* @__PURE__ */ (0,
|
|
12192
|
-
/* @__PURE__ */ (0,
|
|
12393
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Card.Header, { children: [
|
|
12394
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Product` }),
|
|
12395
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Card.Description, { children: isEdit ? `Update the details for this product` : `Create a new product and add it to your list` })
|
|
12193
12396
|
] }),
|
|
12194
|
-
/* @__PURE__ */ (0,
|
|
12397
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
12195
12398
|
"form",
|
|
12196
12399
|
{
|
|
12197
12400
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
12198
12401
|
children: [
|
|
12199
|
-
/* @__PURE__ */ (0,
|
|
12200
|
-
/* @__PURE__ */ (0,
|
|
12402
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
12403
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
12201
12404
|
Fields_default.Input,
|
|
12202
12405
|
{
|
|
12203
12406
|
label: "Name",
|
|
@@ -12208,7 +12411,7 @@ function ProductForm() {
|
|
|
12208
12411
|
required: true
|
|
12209
12412
|
}
|
|
12210
12413
|
),
|
|
12211
|
-
/* @__PURE__ */ (0,
|
|
12414
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
12212
12415
|
Fields_default.Input,
|
|
12213
12416
|
{
|
|
12214
12417
|
label: "Cost",
|
|
@@ -12219,7 +12422,7 @@ function ProductForm() {
|
|
|
12219
12422
|
required: true
|
|
12220
12423
|
}
|
|
12221
12424
|
),
|
|
12222
|
-
/* @__PURE__ */ (0,
|
|
12425
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
12223
12426
|
Feilds_default4.Category,
|
|
12224
12427
|
{
|
|
12225
12428
|
label: "Category",
|
|
@@ -12228,7 +12431,7 @@ function ProductForm() {
|
|
|
12228
12431
|
api: "/categories/get"
|
|
12229
12432
|
}
|
|
12230
12433
|
),
|
|
12231
|
-
/* @__PURE__ */ (0,
|
|
12434
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
12232
12435
|
Feilds_default3.Brand,
|
|
12233
12436
|
{
|
|
12234
12437
|
label: "Brand",
|
|
@@ -12238,7 +12441,7 @@ function ProductForm() {
|
|
|
12238
12441
|
}
|
|
12239
12442
|
)
|
|
12240
12443
|
] }),
|
|
12241
|
-
/* @__PURE__ */ (0,
|
|
12444
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
12242
12445
|
Button,
|
|
12243
12446
|
{
|
|
12244
12447
|
isLoading,
|
|
@@ -12260,7 +12463,7 @@ var ProductForm_default = ProductForm;
|
|
|
12260
12463
|
|
|
12261
12464
|
// src/components/products/Feilds/Product.tsx
|
|
12262
12465
|
var import_react_router_dom22 = require("react-router-dom");
|
|
12263
|
-
var
|
|
12466
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
12264
12467
|
function Product({
|
|
12265
12468
|
name,
|
|
12266
12469
|
label,
|
|
@@ -12275,7 +12478,7 @@ function Product({
|
|
|
12275
12478
|
obj
|
|
12276
12479
|
}) {
|
|
12277
12480
|
const { branchId } = (0, import_react_router_dom22.useParams)();
|
|
12278
|
-
return /* @__PURE__ */ (0,
|
|
12481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
12279
12482
|
Fields_default.SearchApi,
|
|
12280
12483
|
{
|
|
12281
12484
|
name,
|
|
@@ -12305,10 +12508,10 @@ var Feilds_default5 = ProductField;
|
|
|
12305
12508
|
|
|
12306
12509
|
// src/components/packs/Packs.tsx
|
|
12307
12510
|
var import_react_router_dom23 = require("react-router-dom");
|
|
12308
|
-
var
|
|
12511
|
+
var import_lucide_react35 = require("lucide-react");
|
|
12309
12512
|
var import_react52 = require("react");
|
|
12310
12513
|
var import_antd26 = require("antd");
|
|
12311
|
-
var
|
|
12514
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
12312
12515
|
function Packs({ v, url }) {
|
|
12313
12516
|
const [deletePack, setDeletePack] = (0, import_react52.useState)(null);
|
|
12314
12517
|
const { isLoading, remove } = useApis_default();
|
|
@@ -12322,12 +12525,12 @@ function Packs({ v, url }) {
|
|
|
12322
12525
|
const items = (data2) => [
|
|
12323
12526
|
{
|
|
12324
12527
|
label: `Edit Pack`,
|
|
12325
|
-
icon: /* @__PURE__ */ (0,
|
|
12528
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_lucide_react35.FilePenLine, { size: 16 }),
|
|
12326
12529
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
12327
12530
|
},
|
|
12328
12531
|
{
|
|
12329
12532
|
label: `Delete Pack`,
|
|
12330
|
-
icon: /* @__PURE__ */ (0,
|
|
12533
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_lucide_react35.Trash2, { className: "text-red-500", size: 16 }),
|
|
12331
12534
|
onClick: () => setDeletePack(data2)
|
|
12332
12535
|
}
|
|
12333
12536
|
].filter(Boolean);
|
|
@@ -12337,7 +12540,7 @@ function Packs({ v, url }) {
|
|
|
12337
12540
|
header: "Name",
|
|
12338
12541
|
cell: ({ row }) => {
|
|
12339
12542
|
const pack = row.original;
|
|
12340
|
-
return /* @__PURE__ */ (0,
|
|
12543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { children: pack?.name });
|
|
12341
12544
|
}
|
|
12342
12545
|
},
|
|
12343
12546
|
{
|
|
@@ -12345,7 +12548,7 @@ function Packs({ v, url }) {
|
|
|
12345
12548
|
header: "Type",
|
|
12346
12549
|
cell: ({ row }) => {
|
|
12347
12550
|
const pack = row.original;
|
|
12348
|
-
return /* @__PURE__ */ (0,
|
|
12551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "capitalize", children: pack?.type });
|
|
12349
12552
|
}
|
|
12350
12553
|
},
|
|
12351
12554
|
{
|
|
@@ -12353,7 +12556,7 @@ function Packs({ v, url }) {
|
|
|
12353
12556
|
header: "Products Count",
|
|
12354
12557
|
cell: ({ row }) => {
|
|
12355
12558
|
const pack = row.original;
|
|
12356
|
-
return /* @__PURE__ */ (0,
|
|
12559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("span", { children: [
|
|
12357
12560
|
pack?.products?.length || 0,
|
|
12358
12561
|
" Products"
|
|
12359
12562
|
] });
|
|
@@ -12364,13 +12567,13 @@ function Packs({ v, url }) {
|
|
|
12364
12567
|
header: "Actions",
|
|
12365
12568
|
cell: ({ row }) => {
|
|
12366
12569
|
const data2 = row.original;
|
|
12367
|
-
return /* @__PURE__ */ (0,
|
|
12570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
12368
12571
|
Dropdown,
|
|
12369
12572
|
{
|
|
12370
12573
|
className: "cursor-pointer w-[150px]",
|
|
12371
12574
|
items: items(data2),
|
|
12372
12575
|
triggerMode: "hover",
|
|
12373
|
-
children: /* @__PURE__ */ (0,
|
|
12576
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_lucide_react35.EllipsisVertical, {})
|
|
12374
12577
|
}
|
|
12375
12578
|
);
|
|
12376
12579
|
}
|
|
@@ -12388,9 +12591,9 @@ function Packs({ v, url }) {
|
|
|
12388
12591
|
return error;
|
|
12389
12592
|
}
|
|
12390
12593
|
};
|
|
12391
|
-
return /* @__PURE__ */ (0,
|
|
12392
|
-
/* @__PURE__ */ (0,
|
|
12393
|
-
/* @__PURE__ */ (0,
|
|
12594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
12595
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Modal2, {}),
|
|
12596
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
12394
12597
|
ConfirmModal,
|
|
12395
12598
|
{
|
|
12396
12599
|
isOpen: !!deletePack,
|
|
@@ -12403,7 +12606,7 @@ function Packs({ v, url }) {
|
|
|
12403
12606
|
children: null
|
|
12404
12607
|
}
|
|
12405
12608
|
),
|
|
12406
|
-
/* @__PURE__ */ (0,
|
|
12609
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
12407
12610
|
TransactionViewComponent,
|
|
12408
12611
|
{
|
|
12409
12612
|
columns,
|
|
@@ -12446,8 +12649,8 @@ var import_react_hook_form19 = require("react-hook-form");
|
|
|
12446
12649
|
var import_zod19 = require("@hookform/resolvers/zod");
|
|
12447
12650
|
var import_antd27 = require("antd");
|
|
12448
12651
|
var import_react53 = require("react");
|
|
12449
|
-
var
|
|
12450
|
-
var
|
|
12652
|
+
var import_lucide_react36 = require("lucide-react");
|
|
12653
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
12451
12654
|
function PackForm() {
|
|
12452
12655
|
const { getQuery, navigate } = useApp_default();
|
|
12453
12656
|
const id = getQuery("id");
|
|
@@ -12539,24 +12742,24 @@ function PackForm() {
|
|
|
12539
12742
|
setValue("tempCost", currentProduct.cost || 0);
|
|
12540
12743
|
}
|
|
12541
12744
|
}, [currentProduct]);
|
|
12542
|
-
return /* @__PURE__ */ (0,
|
|
12745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
12543
12746
|
Card,
|
|
12544
12747
|
{
|
|
12545
12748
|
className: "max-w-5xl mx-auto mt-10 relative",
|
|
12546
12749
|
isLoading: isLoadingGet,
|
|
12547
12750
|
loadingText: "Processing...",
|
|
12548
12751
|
children: [
|
|
12549
|
-
/* @__PURE__ */ (0,
|
|
12550
|
-
/* @__PURE__ */ (0,
|
|
12551
|
-
/* @__PURE__ */ (0,
|
|
12752
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Card.Header, { children: [
|
|
12753
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Pack` }),
|
|
12754
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Card.Description, { children: isEdit ? `Update the details for this product pack` : `Create a new product pack and define its components` })
|
|
12552
12755
|
] }),
|
|
12553
|
-
/* @__PURE__ */ (0,
|
|
12756
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
12554
12757
|
"form",
|
|
12555
12758
|
{
|
|
12556
12759
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
12557
12760
|
children: [
|
|
12558
|
-
/* @__PURE__ */ (0,
|
|
12559
|
-
/* @__PURE__ */ (0,
|
|
12761
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4 mb-8", children: [
|
|
12762
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12560
12763
|
Fields_default.Input,
|
|
12561
12764
|
{
|
|
12562
12765
|
label: "Pack Name",
|
|
@@ -12567,7 +12770,7 @@ function PackForm() {
|
|
|
12567
12770
|
required: true
|
|
12568
12771
|
}
|
|
12569
12772
|
),
|
|
12570
|
-
/* @__PURE__ */ (0,
|
|
12773
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12571
12774
|
Fields_default.Select,
|
|
12572
12775
|
{
|
|
12573
12776
|
label: "Pack Type",
|
|
@@ -12578,10 +12781,10 @@ function PackForm() {
|
|
|
12578
12781
|
}
|
|
12579
12782
|
)
|
|
12580
12783
|
] }),
|
|
12581
|
-
/* @__PURE__ */ (0,
|
|
12582
|
-
/* @__PURE__ */ (0,
|
|
12583
|
-
/* @__PURE__ */ (0,
|
|
12584
|
-
/* @__PURE__ */ (0,
|
|
12784
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "border rounded-lg p-4 bg-gray-50/50 dark:bg-gray-800/20", children: [
|
|
12785
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("h3", { className: "text-lg font-semibold mb-4", children: "Products in Pack" }),
|
|
12786
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "mb-6 bg-white dark:bg-gray-900 p-4 rounded-lg border shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "grid grid-cols-12 gap-3 items-end", children: [
|
|
12787
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "col-span-12 sm:col-span-5", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12585
12788
|
Feilds_default5.Product,
|
|
12586
12789
|
{
|
|
12587
12790
|
label: "Find Product",
|
|
@@ -12591,7 +12794,7 @@ function PackForm() {
|
|
|
12591
12794
|
obj: "tempData"
|
|
12592
12795
|
}
|
|
12593
12796
|
) }),
|
|
12594
|
-
/* @__PURE__ */ (0,
|
|
12797
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "col-span-4 sm:col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12595
12798
|
Fields_default.Input,
|
|
12596
12799
|
{
|
|
12597
12800
|
label: "Qty",
|
|
@@ -12601,7 +12804,7 @@ function PackForm() {
|
|
|
12601
12804
|
placeholder: "1"
|
|
12602
12805
|
}
|
|
12603
12806
|
) }),
|
|
12604
|
-
/* @__PURE__ */ (0,
|
|
12807
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "col-span-5 sm:col-span-3", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12605
12808
|
Fields_default.Input,
|
|
12606
12809
|
{
|
|
12607
12810
|
label: "Cost",
|
|
@@ -12611,39 +12814,39 @@ function PackForm() {
|
|
|
12611
12814
|
placeholder: "0.00"
|
|
12612
12815
|
}
|
|
12613
12816
|
) }),
|
|
12614
|
-
/* @__PURE__ */ (0,
|
|
12817
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "col-span-3 sm:col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12615
12818
|
Button,
|
|
12616
12819
|
{
|
|
12617
12820
|
type: "button",
|
|
12618
12821
|
onClick: onAddProduct,
|
|
12619
12822
|
className: "w-full h-[40px]",
|
|
12620
|
-
icon: /* @__PURE__ */ (0,
|
|
12823
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_lucide_react36.Plus, { size: 16 }),
|
|
12621
12824
|
children: "Add"
|
|
12622
12825
|
}
|
|
12623
12826
|
) })
|
|
12624
12827
|
] }) }),
|
|
12625
|
-
/* @__PURE__ */ (0,
|
|
12626
|
-
/* @__PURE__ */ (0,
|
|
12627
|
-
/* @__PURE__ */ (0,
|
|
12628
|
-
/* @__PURE__ */ (0,
|
|
12629
|
-
/* @__PURE__ */ (0,
|
|
12630
|
-
/* @__PURE__ */ (0,
|
|
12631
|
-
/* @__PURE__ */ (0,
|
|
12828
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("table", { className: "w-full text-left border-collapse", children: [
|
|
12829
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("thead", { className: "bg-gray-100 dark:bg-gray-800/50", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("tr", { children: [
|
|
12830
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("th", { className: "px-3 py-2 text-xs font-bold uppercase text-gray-500", children: "Product" }),
|
|
12831
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("th", { className: "px-3 py-2 text-xs font-bold uppercase text-gray-500 w-24", children: "Qty" }),
|
|
12832
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("th", { className: "px-3 py-2 text-xs font-bold uppercase text-gray-500 w-32", children: "Cost" }),
|
|
12833
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("th", { className: "px-3 py-2 text-xs font-bold uppercase text-gray-500 w-32", children: "Line Total" }),
|
|
12834
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("th", { className: "px-3 py-2 text-xs font-bold uppercase text-gray-500 w-16 text-center", children: "Action" })
|
|
12632
12835
|
] }) }),
|
|
12633
|
-
/* @__PURE__ */ (0,
|
|
12634
|
-
fields.map((field, index) => /* @__PURE__ */ (0,
|
|
12836
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("tbody", { className: "divide-y divide-gray-100 dark:divide-gray-800 bg-white dark:bg-gray-900", children: [
|
|
12837
|
+
fields.map((field, index) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
12635
12838
|
"tr",
|
|
12636
12839
|
{
|
|
12637
12840
|
className: "hover:bg-gray-50/50 dark:hover:bg-gray-800/50 transition-colors",
|
|
12638
12841
|
children: [
|
|
12639
|
-
/* @__PURE__ */ (0,
|
|
12640
|
-
/* @__PURE__ */ (0,
|
|
12641
|
-
field.productData?.sku && /* @__PURE__ */ (0,
|
|
12842
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("td", { className: "px-3 py-2", children: [
|
|
12843
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: field.productData?.name || "Product" }),
|
|
12844
|
+
field.productData?.sku && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("p", { className: "text-[10px] text-gray-500", children: [
|
|
12642
12845
|
"SKU: ",
|
|
12643
12846
|
field.productData?.sku
|
|
12644
12847
|
] })
|
|
12645
12848
|
] }),
|
|
12646
|
-
/* @__PURE__ */ (0,
|
|
12849
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("td", { className: "px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12647
12850
|
Fields_default.Input,
|
|
12648
12851
|
{
|
|
12649
12852
|
form: methods,
|
|
@@ -12654,7 +12857,7 @@ function PackForm() {
|
|
|
12654
12857
|
className: "h-8 py-1!"
|
|
12655
12858
|
}
|
|
12656
12859
|
) }),
|
|
12657
|
-
/* @__PURE__ */ (0,
|
|
12860
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("td", { className: "px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12658
12861
|
Fields_default.Input,
|
|
12659
12862
|
{
|
|
12660
12863
|
form: methods,
|
|
@@ -12665,8 +12868,8 @@ function PackForm() {
|
|
|
12665
12868
|
className: "h-8 py-1!"
|
|
12666
12869
|
}
|
|
12667
12870
|
) }),
|
|
12668
|
-
/* @__PURE__ */ (0,
|
|
12669
|
-
/* @__PURE__ */ (0,
|
|
12871
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("td", { className: "px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-sm font-semibold", children: ((Number(watch(`products.${index}.quantity`)) || 0) * (Number(watch(`products.${index}.cost`)) || 0)).toLocaleString() }) }),
|
|
12872
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("td", { className: "px-3 py-2 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12670
12873
|
Button,
|
|
12671
12874
|
{
|
|
12672
12875
|
type: "button",
|
|
@@ -12674,42 +12877,42 @@ function PackForm() {
|
|
|
12674
12877
|
size: "sm",
|
|
12675
12878
|
className: "text-red-500 hover:text-red-700 hover:bg-red-50 p-1 h-8 w-8",
|
|
12676
12879
|
onClick: () => remove(index),
|
|
12677
|
-
children: /* @__PURE__ */ (0,
|
|
12880
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_lucide_react36.Trash2, { size: 16 })
|
|
12678
12881
|
}
|
|
12679
12882
|
) })
|
|
12680
12883
|
]
|
|
12681
12884
|
},
|
|
12682
12885
|
field.id
|
|
12683
12886
|
)),
|
|
12684
|
-
fields.length === 0 && /* @__PURE__ */ (0,
|
|
12887
|
+
fields.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("td", { colSpan: 5, className: "text-center py-10", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "text-sm text-gray-500", children: "No products added yet. Use the search above to add products." }) }) })
|
|
12685
12888
|
] })
|
|
12686
12889
|
] }) }),
|
|
12687
|
-
/* @__PURE__ */ (0,
|
|
12688
|
-
/* @__PURE__ */ (0,
|
|
12689
|
-
/* @__PURE__ */ (0,
|
|
12690
|
-
/* @__PURE__ */ (0,
|
|
12890
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "mt-6 pt-6 border-t grid grid-cols-1 sm:grid-cols-3 gap-3", children: [
|
|
12891
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "bg-white dark:bg-gray-900 p-3 rounded-lg border shadow-sm", children: [
|
|
12892
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "text-[10px] text-gray-500 uppercase font-bold mb-0.5", children: "Total Lines" }),
|
|
12893
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "text-lg font-bold text-blue-600", children: watch("products")?.length || 0 })
|
|
12691
12894
|
] }),
|
|
12692
|
-
/* @__PURE__ */ (0,
|
|
12693
|
-
/* @__PURE__ */ (0,
|
|
12694
|
-
/* @__PURE__ */ (0,
|
|
12895
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "bg-white dark:bg-gray-900 p-3 rounded-lg border shadow-sm", children: [
|
|
12896
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "text-[10px] text-gray-500 uppercase font-bold mb-0.5", children: "Total Quantity" }),
|
|
12897
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "text-lg font-bold text-indigo-600", children: watch("products")?.reduce(
|
|
12695
12898
|
(acc, curr) => acc + (Number(curr.quantity) || 0),
|
|
12696
12899
|
0
|
|
12697
12900
|
) })
|
|
12698
12901
|
] }),
|
|
12699
|
-
/* @__PURE__ */ (0,
|
|
12700
|
-
/* @__PURE__ */ (0,
|
|
12701
|
-
/* @__PURE__ */ (0,
|
|
12902
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "bg-white dark:bg-gray-900 p-3 rounded-lg border shadow-sm", children: [
|
|
12903
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "text-[10px] text-gray-500 uppercase font-bold mb-0.5", children: "Total Cost" }),
|
|
12904
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("p", { className: "text-lg font-bold text-emerald-600", children: [
|
|
12702
12905
|
watch("products")?.reduce(
|
|
12703
12906
|
(acc, curr) => acc + (Number(curr.quantity) || 0) * (Number(curr.cost) || 0),
|
|
12704
12907
|
0
|
|
12705
12908
|
).toLocaleString(),
|
|
12706
12909
|
" ",
|
|
12707
|
-
/* @__PURE__ */ (0,
|
|
12910
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-[10px] font-normal text-gray-400", children: "USD" })
|
|
12708
12911
|
] })
|
|
12709
12912
|
] })
|
|
12710
12913
|
] })
|
|
12711
12914
|
] }),
|
|
12712
|
-
/* @__PURE__ */ (0,
|
|
12915
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("footer", { className: "flex justify-end mt-8", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12713
12916
|
Button,
|
|
12714
12917
|
{
|
|
12715
12918
|
isLoading,
|
|
@@ -12730,7 +12933,7 @@ function PackForm() {
|
|
|
12730
12933
|
var PackForm_default = PackForm;
|
|
12731
12934
|
|
|
12732
12935
|
// src/components/packs/Feilds/Pack.tsx
|
|
12733
|
-
var
|
|
12936
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
12734
12937
|
function Pack({
|
|
12735
12938
|
name,
|
|
12736
12939
|
label,
|
|
@@ -12742,7 +12945,7 @@ function Pack({
|
|
|
12742
12945
|
required,
|
|
12743
12946
|
disabled
|
|
12744
12947
|
}) {
|
|
12745
|
-
return /* @__PURE__ */ (0,
|
|
12948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12746
12949
|
Fields_default.SearchApi,
|
|
12747
12950
|
{
|
|
12748
12951
|
label,
|
|
@@ -12764,11 +12967,11 @@ var Pack_default = { Pack };
|
|
|
12764
12967
|
|
|
12765
12968
|
// src/components/journals/Journals.tsx
|
|
12766
12969
|
var import_react_router_dom24 = require("react-router-dom");
|
|
12767
|
-
var
|
|
12970
|
+
var import_lucide_react37 = require("lucide-react");
|
|
12768
12971
|
|
|
12769
12972
|
// src/hooks/useTransactionView.tsx
|
|
12770
12973
|
var import_react54 = require("react");
|
|
12771
|
-
var
|
|
12974
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
12772
12975
|
var useTransactionView = () => {
|
|
12773
12976
|
const [open, setOpen] = (0, import_react54.useState)(false);
|
|
12774
12977
|
const [id, setId] = (0, import_react54.useState)("");
|
|
@@ -12794,7 +12997,7 @@ var useTransactionView = () => {
|
|
|
12794
12997
|
};
|
|
12795
12998
|
const TransactionView = () => {
|
|
12796
12999
|
if (!open) return null;
|
|
12797
|
-
return /* @__PURE__ */ (0,
|
|
13000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
12798
13001
|
Views_default.Transaction,
|
|
12799
13002
|
{
|
|
12800
13003
|
close: closeTransaction,
|
|
@@ -12817,7 +13020,7 @@ var useTransactionView = () => {
|
|
|
12817
13020
|
var useTransactionView_default = useTransactionView;
|
|
12818
13021
|
|
|
12819
13022
|
// src/components/journals/Journals.tsx
|
|
12820
|
-
var
|
|
13023
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
12821
13024
|
function Journals({
|
|
12822
13025
|
url,
|
|
12823
13026
|
journalType
|
|
@@ -12833,7 +13036,7 @@ function Journals({
|
|
|
12833
13036
|
const items = (data2) => [
|
|
12834
13037
|
{
|
|
12835
13038
|
label: `View Journal`,
|
|
12836
|
-
icon: /* @__PURE__ */ (0,
|
|
13039
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react37.Eye, { size: 16 }),
|
|
12837
13040
|
className: "min-w-[200px]",
|
|
12838
13041
|
onClick: () => openTransaction({
|
|
12839
13042
|
id: data2?._id,
|
|
@@ -12842,12 +13045,12 @@ function Journals({
|
|
|
12842
13045
|
},
|
|
12843
13046
|
{
|
|
12844
13047
|
label: `Edit Journal`,
|
|
12845
|
-
icon: /* @__PURE__ */ (0,
|
|
13048
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react37.FilePenLine, { size: 16 }),
|
|
12846
13049
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
12847
13050
|
},
|
|
12848
13051
|
{
|
|
12849
13052
|
label: `Delete Journal`,
|
|
12850
|
-
icon: /* @__PURE__ */ (0,
|
|
13053
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react37.Trash2, { className: "text-red-500", size: 16 }),
|
|
12851
13054
|
onClick: () => {
|
|
12852
13055
|
openTransaction({
|
|
12853
13056
|
id: data2?._id,
|
|
@@ -12863,9 +13066,9 @@ function Journals({
|
|
|
12863
13066
|
header: "Date",
|
|
12864
13067
|
cell: ({ row }) => {
|
|
12865
13068
|
const journal = row.original;
|
|
12866
|
-
return /* @__PURE__ */ (0,
|
|
12867
|
-
/* @__PURE__ */ (0,
|
|
12868
|
-
/* @__PURE__ */ (0,
|
|
13069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex flex-col", children: [
|
|
13070
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: journal?.date }),
|
|
13071
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
12869
13072
|
"span",
|
|
12870
13073
|
{
|
|
12871
13074
|
onClick: () => openTransaction({
|
|
@@ -12884,7 +13087,7 @@ function Journals({
|
|
|
12884
13087
|
header: "Account",
|
|
12885
13088
|
cell: ({ row }) => {
|
|
12886
13089
|
const journal = row.original;
|
|
12887
|
-
return /* @__PURE__ */ (0,
|
|
13090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: journal?.accountData?.name || "N/A" });
|
|
12888
13091
|
}
|
|
12889
13092
|
},
|
|
12890
13093
|
{
|
|
@@ -12892,9 +13095,9 @@ function Journals({
|
|
|
12892
13095
|
header: "Description",
|
|
12893
13096
|
cell: ({ row }) => {
|
|
12894
13097
|
const journal = row.original;
|
|
12895
|
-
return /* @__PURE__ */ (0,
|
|
12896
|
-
/* @__PURE__ */ (0,
|
|
12897
|
-
journal?.note && /* @__PURE__ */ (0,
|
|
13098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex flex-col", children: [
|
|
13099
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "capitalize", children: journal?.description }),
|
|
13100
|
+
journal?.note && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("span", { className: "text-xs text-gray-400 italic", children: [
|
|
12898
13101
|
"Note: ",
|
|
12899
13102
|
journal?.note
|
|
12900
13103
|
] })
|
|
@@ -12906,13 +13109,13 @@ function Journals({
|
|
|
12906
13109
|
header: "Amount",
|
|
12907
13110
|
cell: ({ row }) => {
|
|
12908
13111
|
const journal = row.original;
|
|
12909
|
-
return /* @__PURE__ */ (0,
|
|
12910
|
-
/* @__PURE__ */ (0,
|
|
12911
|
-
journal?.feeAmount > 0 && /* @__PURE__ */ (0,
|
|
13112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex flex-col", children: [
|
|
13113
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: Formats_default.Price(journal?.amount, journal?.currency) }),
|
|
13114
|
+
journal?.feeAmount > 0 && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("span", { className: "text-xs text-green-600", children: [
|
|
12912
13115
|
"with fee: ",
|
|
12913
13116
|
Formats_default.Price(journal?.feeAmount, journal?.currency)
|
|
12914
13117
|
] }),
|
|
12915
|
-
journal?.exchange?.rate && /* @__PURE__ */ (0,
|
|
13118
|
+
journal?.exchange?.rate && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("span", { className: "text-xs text-green-600", children: [
|
|
12916
13119
|
"Exchanged:",
|
|
12917
13120
|
" ",
|
|
12918
13121
|
Formats_default.Price(
|
|
@@ -12928,7 +13131,7 @@ function Journals({
|
|
|
12928
13131
|
header: "Type",
|
|
12929
13132
|
cell: ({ row }) => {
|
|
12930
13133
|
const journal = row.original;
|
|
12931
|
-
return /* @__PURE__ */ (0,
|
|
13134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "capitalize", children: journal?.journal });
|
|
12932
13135
|
}
|
|
12933
13136
|
},
|
|
12934
13137
|
{
|
|
@@ -12936,9 +13139,9 @@ function Journals({
|
|
|
12936
13139
|
header: "Via",
|
|
12937
13140
|
cell: ({ row }) => {
|
|
12938
13141
|
const journal = row.original;
|
|
12939
|
-
return /* @__PURE__ */ (0,
|
|
12940
|
-
/* @__PURE__ */ (0,
|
|
12941
|
-
journal?.journalVia === "via account" && /* @__PURE__ */ (0,
|
|
13142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "", children: [
|
|
13143
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "capitalize", children: journal?.journalVia }),
|
|
13144
|
+
journal?.journalVia === "via account" && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "capitalize text-xs text-gray-600", children: journal?.viaAccountData?.name })
|
|
12942
13145
|
] });
|
|
12943
13146
|
}
|
|
12944
13147
|
},
|
|
@@ -12947,7 +13150,7 @@ function Journals({
|
|
|
12947
13150
|
header: "Action",
|
|
12948
13151
|
cell: ({ row }) => {
|
|
12949
13152
|
const journal = row.original;
|
|
12950
|
-
return /* @__PURE__ */ (0,
|
|
13153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "capitalize", children: journal?.action });
|
|
12951
13154
|
}
|
|
12952
13155
|
},
|
|
12953
13156
|
{
|
|
@@ -12955,23 +13158,23 @@ function Journals({
|
|
|
12955
13158
|
header: "Actions",
|
|
12956
13159
|
cell: ({ row }) => {
|
|
12957
13160
|
const data2 = row.original;
|
|
12958
|
-
return /* @__PURE__ */ (0,
|
|
13161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
12959
13162
|
Dropdown,
|
|
12960
13163
|
{
|
|
12961
13164
|
className: "cursor-pointer ",
|
|
12962
13165
|
items: items(data2),
|
|
12963
13166
|
triggerMode: "hover",
|
|
12964
|
-
children: /* @__PURE__ */ (0,
|
|
13167
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react37.EllipsisVertical, {})
|
|
12965
13168
|
}
|
|
12966
13169
|
);
|
|
12967
13170
|
}
|
|
12968
13171
|
}
|
|
12969
13172
|
];
|
|
12970
13173
|
const journals = data?.data || [];
|
|
12971
|
-
return /* @__PURE__ */ (0,
|
|
12972
|
-
/* @__PURE__ */ (0,
|
|
12973
|
-
/* @__PURE__ */ (0,
|
|
12974
|
-
/* @__PURE__ */ (0,
|
|
13174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
13175
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Modal2, {}),
|
|
13176
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TransactionView, {}),
|
|
13177
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
12975
13178
|
TransactionViewComponent,
|
|
12976
13179
|
{
|
|
12977
13180
|
columns,
|
|
@@ -13063,7 +13266,7 @@ var Forex = {
|
|
|
13063
13266
|
var forex_default = Forex;
|
|
13064
13267
|
|
|
13065
13268
|
// src/components/journals/JournalForm.tsx
|
|
13066
|
-
var
|
|
13269
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
13067
13270
|
function JournalForm({
|
|
13068
13271
|
isFee = true,
|
|
13069
13272
|
accountType = "all"
|
|
@@ -13167,25 +13370,25 @@ function JournalForm({
|
|
|
13167
13370
|
fetches();
|
|
13168
13371
|
}
|
|
13169
13372
|
}, [id]);
|
|
13170
|
-
return /* @__PURE__ */ (0,
|
|
13373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
13171
13374
|
Card,
|
|
13172
13375
|
{
|
|
13173
13376
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
13174
13377
|
isLoading: isLoadingGet,
|
|
13175
13378
|
loadingText: "Processing...",
|
|
13176
13379
|
children: [
|
|
13177
|
-
/* @__PURE__ */ (0,
|
|
13178
|
-
/* @__PURE__ */ (0,
|
|
13179
|
-
/* @__PURE__ */ (0,
|
|
13380
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Card.Header, { children: [
|
|
13381
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Journal` }),
|
|
13382
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card.Description, { children: isEdit ? `Update the details for this journal entry` : `Create a new journal entry` })
|
|
13180
13383
|
] }),
|
|
13181
|
-
/* @__PURE__ */ (0,
|
|
13384
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
13182
13385
|
"form",
|
|
13183
13386
|
{
|
|
13184
13387
|
className: "space-y-4",
|
|
13185
13388
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
13186
13389
|
children: [
|
|
13187
|
-
/* @__PURE__ */ (0,
|
|
13188
|
-
/* @__PURE__ */ (0,
|
|
13390
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
13391
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13189
13392
|
Fields_default.Input,
|
|
13190
13393
|
{
|
|
13191
13394
|
label: "Description",
|
|
@@ -13195,7 +13398,7 @@ function JournalForm({
|
|
|
13195
13398
|
required: true
|
|
13196
13399
|
}
|
|
13197
13400
|
),
|
|
13198
|
-
/* @__PURE__ */ (0,
|
|
13401
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13199
13402
|
Fields_default.Select,
|
|
13200
13403
|
{
|
|
13201
13404
|
label: "Journal Via",
|
|
@@ -13206,8 +13409,8 @@ function JournalForm({
|
|
|
13206
13409
|
}
|
|
13207
13410
|
)
|
|
13208
13411
|
] }),
|
|
13209
|
-
/* @__PURE__ */ (0,
|
|
13210
|
-
/* @__PURE__ */ (0,
|
|
13412
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
13413
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13211
13414
|
Fields_default.DateInput,
|
|
13212
13415
|
{
|
|
13213
13416
|
label: "Date",
|
|
@@ -13216,7 +13419,7 @@ function JournalForm({
|
|
|
13216
13419
|
required: true
|
|
13217
13420
|
}
|
|
13218
13421
|
),
|
|
13219
|
-
journalVia === "via account" && /* @__PURE__ */ (0,
|
|
13422
|
+
journalVia === "via account" && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13220
13423
|
Feilds_default.Account,
|
|
13221
13424
|
{
|
|
13222
13425
|
label: "Via Account",
|
|
@@ -13230,7 +13433,7 @@ function JournalForm({
|
|
|
13230
13433
|
showBalance: true
|
|
13231
13434
|
}
|
|
13232
13435
|
),
|
|
13233
|
-
/* @__PURE__ */ (0,
|
|
13436
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13234
13437
|
Fields_default.Input,
|
|
13235
13438
|
{
|
|
13236
13439
|
label: "Amount",
|
|
@@ -13241,7 +13444,7 @@ function JournalForm({
|
|
|
13241
13444
|
required: true
|
|
13242
13445
|
}
|
|
13243
13446
|
),
|
|
13244
|
-
/* @__PURE__ */ (0,
|
|
13447
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13245
13448
|
Feilds_default.Account,
|
|
13246
13449
|
{
|
|
13247
13450
|
label: accountType === "all" ? "Account" : accountType,
|
|
@@ -13255,7 +13458,7 @@ function JournalForm({
|
|
|
13255
13458
|
obj: "accountObject"
|
|
13256
13459
|
}
|
|
13257
13460
|
),
|
|
13258
|
-
journalVia !== "via account" && /* @__PURE__ */ (0,
|
|
13461
|
+
journalVia !== "via account" && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13259
13462
|
Fields_default.Select,
|
|
13260
13463
|
{
|
|
13261
13464
|
label: "Action",
|
|
@@ -13265,8 +13468,8 @@ function JournalForm({
|
|
|
13265
13468
|
required: true
|
|
13266
13469
|
}
|
|
13267
13470
|
),
|
|
13268
|
-
isRate && /* @__PURE__ */ (0,
|
|
13269
|
-
/* @__PURE__ */ (0,
|
|
13471
|
+
isRate && /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
13472
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13270
13473
|
Fields_default.Input,
|
|
13271
13474
|
{
|
|
13272
13475
|
label: "Rate",
|
|
@@ -13276,7 +13479,7 @@ function JournalForm({
|
|
|
13276
13479
|
required: true
|
|
13277
13480
|
}
|
|
13278
13481
|
),
|
|
13279
|
-
/* @__PURE__ */ (0,
|
|
13482
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13280
13483
|
Fields_default.Input,
|
|
13281
13484
|
{
|
|
13282
13485
|
label: "Exchanged Amount",
|
|
@@ -13288,8 +13491,8 @@ function JournalForm({
|
|
|
13288
13491
|
),
|
|
13289
13492
|
" "
|
|
13290
13493
|
] }),
|
|
13291
|
-
isFee && /* @__PURE__ */ (0,
|
|
13292
|
-
/* @__PURE__ */ (0,
|
|
13494
|
+
isFee && /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
13495
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13293
13496
|
Fields_default.Input,
|
|
13294
13497
|
{
|
|
13295
13498
|
label: "Fee",
|
|
@@ -13299,7 +13502,7 @@ function JournalForm({
|
|
|
13299
13502
|
required: true
|
|
13300
13503
|
}
|
|
13301
13504
|
),
|
|
13302
|
-
/* @__PURE__ */ (0,
|
|
13505
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13303
13506
|
Fields_default.Input,
|
|
13304
13507
|
{
|
|
13305
13508
|
label: "Amount After Fee",
|
|
@@ -13311,7 +13514,7 @@ function JournalForm({
|
|
|
13311
13514
|
)
|
|
13312
13515
|
] })
|
|
13313
13516
|
] }),
|
|
13314
|
-
/* @__PURE__ */ (0,
|
|
13517
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13315
13518
|
Fields_default.Textarea,
|
|
13316
13519
|
{
|
|
13317
13520
|
label: "Note",
|
|
@@ -13320,7 +13523,7 @@ function JournalForm({
|
|
|
13320
13523
|
placeholder: "Add any additional notes here..."
|
|
13321
13524
|
}
|
|
13322
13525
|
),
|
|
13323
|
-
/* @__PURE__ */ (0,
|
|
13526
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13324
13527
|
Button,
|
|
13325
13528
|
{
|
|
13326
13529
|
isLoading,
|
|
@@ -13342,9 +13545,9 @@ var JournalForm_default = JournalForm;
|
|
|
13342
13545
|
|
|
13343
13546
|
// src/components/payment/Payments.tsx
|
|
13344
13547
|
var import_react_router_dom26 = require("react-router-dom");
|
|
13345
|
-
var
|
|
13346
|
-
var
|
|
13347
|
-
function Payments({
|
|
13548
|
+
var import_lucide_react38 = require("lucide-react");
|
|
13549
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
13550
|
+
function Payments({
|
|
13348
13551
|
url,
|
|
13349
13552
|
paymentType
|
|
13350
13553
|
}) {
|
|
@@ -13359,17 +13562,17 @@ function Payments({
|
|
|
13359
13562
|
const items = (data2) => [
|
|
13360
13563
|
{
|
|
13361
13564
|
label: `View Payment`,
|
|
13362
|
-
icon: /* @__PURE__ */ (0,
|
|
13565
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react38.Eye, { size: 16 }),
|
|
13363
13566
|
onClick: () => openTransaction({ id: data2?._id, type: "payment" })
|
|
13364
13567
|
},
|
|
13365
13568
|
{
|
|
13366
13569
|
label: `Edit Payment`,
|
|
13367
|
-
icon: /* @__PURE__ */ (0,
|
|
13570
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react38.FilePenLine, { size: 16 }),
|
|
13368
13571
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
13369
13572
|
},
|
|
13370
13573
|
{
|
|
13371
13574
|
label: `Delete Payment`,
|
|
13372
|
-
icon: /* @__PURE__ */ (0,
|
|
13575
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react38.Trash2, { className: "text-red-500", size: 16 }),
|
|
13373
13576
|
onClick: () => {
|
|
13374
13577
|
openTransaction({
|
|
13375
13578
|
id: data2?._id,
|
|
@@ -13385,9 +13588,9 @@ function Payments({
|
|
|
13385
13588
|
header: "Date",
|
|
13386
13589
|
cell: ({ row }) => {
|
|
13387
13590
|
const payment = row.original;
|
|
13388
|
-
return /* @__PURE__ */ (0,
|
|
13389
|
-
/* @__PURE__ */ (0,
|
|
13390
|
-
/* @__PURE__ */ (0,
|
|
13591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex flex-col", children: [
|
|
13592
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { children: payment?.date }),
|
|
13593
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
13391
13594
|
"span",
|
|
13392
13595
|
{
|
|
13393
13596
|
onClick: () => openTransaction({ id: payment?._id, type: "payment" }),
|
|
@@ -13403,7 +13606,7 @@ function Payments({
|
|
|
13403
13606
|
header: "Account",
|
|
13404
13607
|
cell: ({ row }) => {
|
|
13405
13608
|
const payment = row.original;
|
|
13406
|
-
return /* @__PURE__ */ (0,
|
|
13609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { children: payment?.accountData?.name || "N/A" });
|
|
13407
13610
|
}
|
|
13408
13611
|
},
|
|
13409
13612
|
{
|
|
@@ -13412,7 +13615,7 @@ function Payments({
|
|
|
13412
13615
|
cell: ({ row }) => {
|
|
13413
13616
|
const payment = row.original;
|
|
13414
13617
|
const walletData = payment?.fromWalletData || payment?.toWalletData;
|
|
13415
|
-
return /* @__PURE__ */ (0,
|
|
13618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { children: walletData?.name || "N/A" });
|
|
13416
13619
|
}
|
|
13417
13620
|
},
|
|
13418
13621
|
{
|
|
@@ -13420,13 +13623,13 @@ function Payments({
|
|
|
13420
13623
|
header: "Amount",
|
|
13421
13624
|
cell: ({ row }) => {
|
|
13422
13625
|
const payment = row.original;
|
|
13423
|
-
return /* @__PURE__ */ (0,
|
|
13424
|
-
/* @__PURE__ */ (0,
|
|
13425
|
-
payment?.feeAmount > 0 && /* @__PURE__ */ (0,
|
|
13626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex flex-col", children: [
|
|
13627
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { children: Formats_default.Price(payment?.amount, payment?.currency) }),
|
|
13628
|
+
payment?.feeAmount > 0 && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: "text-xs text-green-600", children: [
|
|
13426
13629
|
"fee: ",
|
|
13427
13630
|
Formats_default.Price(payment?.feeAmount, payment?.currency)
|
|
13428
13631
|
] }),
|
|
13429
|
-
payment?.exchange?.rate && /* @__PURE__ */ (0,
|
|
13632
|
+
payment?.exchange?.rate && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: "text-xs text-green-600", children: [
|
|
13430
13633
|
"Rate: ",
|
|
13431
13634
|
payment?.exchange?.rate,
|
|
13432
13635
|
" (",
|
|
@@ -13444,7 +13647,7 @@ function Payments({
|
|
|
13444
13647
|
header: "Action",
|
|
13445
13648
|
cell: ({ row }) => {
|
|
13446
13649
|
const payment = row.original;
|
|
13447
|
-
return /* @__PURE__ */ (0,
|
|
13650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
13448
13651
|
"span",
|
|
13449
13652
|
{
|
|
13450
13653
|
className: `capitalize ${payment?.action === "debit" ? "text-red-600" : "text-green-600"}`,
|
|
@@ -13458,23 +13661,23 @@ function Payments({
|
|
|
13458
13661
|
header: "Actions",
|
|
13459
13662
|
cell: ({ row }) => {
|
|
13460
13663
|
const data2 = row.original;
|
|
13461
|
-
return /* @__PURE__ */ (0,
|
|
13664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
13462
13665
|
Dropdown,
|
|
13463
13666
|
{
|
|
13464
13667
|
className: "cursor-pointer w-[150px]",
|
|
13465
13668
|
items: items(data2),
|
|
13466
13669
|
triggerMode: "hover",
|
|
13467
|
-
children: /* @__PURE__ */ (0,
|
|
13670
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react38.EllipsisVertical, {})
|
|
13468
13671
|
}
|
|
13469
13672
|
);
|
|
13470
13673
|
}
|
|
13471
13674
|
}
|
|
13472
13675
|
];
|
|
13473
13676
|
const payments = data?.data || [];
|
|
13474
|
-
return /* @__PURE__ */ (0,
|
|
13475
|
-
/* @__PURE__ */ (0,
|
|
13476
|
-
/* @__PURE__ */ (0,
|
|
13477
|
-
/* @__PURE__ */ (0,
|
|
13677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_jsx_runtime84.Fragment, { children: [
|
|
13678
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(TransactionView, {}),
|
|
13679
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Modal2, {}),
|
|
13680
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
13478
13681
|
TransactionViewComponent,
|
|
13479
13682
|
{
|
|
13480
13683
|
columns,
|
|
@@ -13519,7 +13722,7 @@ var paymentSchema = import_zod25.z.object({
|
|
|
13519
13722
|
});
|
|
13520
13723
|
|
|
13521
13724
|
// src/components/payment/PaymentForm.tsx
|
|
13522
|
-
var
|
|
13725
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
13523
13726
|
function PaymentForm({
|
|
13524
13727
|
accountType = "all"
|
|
13525
13728
|
}) {
|
|
@@ -13608,24 +13811,24 @@ function PaymentForm({
|
|
|
13608
13811
|
fetches();
|
|
13609
13812
|
}
|
|
13610
13813
|
}, [id]);
|
|
13611
|
-
return /* @__PURE__ */ (0,
|
|
13814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
13612
13815
|
Card,
|
|
13613
13816
|
{
|
|
13614
13817
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
13615
13818
|
isLoading: isLoadingGet,
|
|
13616
13819
|
loadingText: "Processing...",
|
|
13617
13820
|
children: [
|
|
13618
|
-
/* @__PURE__ */ (0,
|
|
13619
|
-
/* @__PURE__ */ (0,
|
|
13620
|
-
/* @__PURE__ */ (0,
|
|
13821
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Card.Header, { children: [
|
|
13822
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Payment` }),
|
|
13823
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Card.Description, { children: isEdit ? `Update the details for this payment entry` : `Create a new payment and link it to an account and wallet` })
|
|
13621
13824
|
] }),
|
|
13622
|
-
/* @__PURE__ */ (0,
|
|
13825
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
13623
13826
|
"form",
|
|
13624
13827
|
{
|
|
13625
13828
|
className: "space-y-4",
|
|
13626
13829
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
13627
13830
|
children: [
|
|
13628
|
-
/* @__PURE__ */ (0,
|
|
13831
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13629
13832
|
Fields_default.Input,
|
|
13630
13833
|
{
|
|
13631
13834
|
label: "Description",
|
|
@@ -13636,8 +13839,8 @@ function PaymentForm({
|
|
|
13636
13839
|
required: true
|
|
13637
13840
|
}
|
|
13638
13841
|
),
|
|
13639
|
-
/* @__PURE__ */ (0,
|
|
13640
|
-
/* @__PURE__ */ (0,
|
|
13842
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
13843
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13641
13844
|
Fields_default.DateInput,
|
|
13642
13845
|
{
|
|
13643
13846
|
label: "Date",
|
|
@@ -13646,7 +13849,7 @@ function PaymentForm({
|
|
|
13646
13849
|
required: true
|
|
13647
13850
|
}
|
|
13648
13851
|
),
|
|
13649
|
-
/* @__PURE__ */ (0,
|
|
13852
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13650
13853
|
Feilds_default.Account,
|
|
13651
13854
|
{
|
|
13652
13855
|
label: accountType === "all" ? "Account" : accountType,
|
|
@@ -13660,8 +13863,8 @@ function PaymentForm({
|
|
|
13660
13863
|
}
|
|
13661
13864
|
)
|
|
13662
13865
|
] }),
|
|
13663
|
-
/* @__PURE__ */ (0,
|
|
13664
|
-
/* @__PURE__ */ (0,
|
|
13866
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
13867
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13665
13868
|
Feilds_default2.Wallet,
|
|
13666
13869
|
{
|
|
13667
13870
|
label: "Wallet",
|
|
@@ -13673,7 +13876,7 @@ function PaymentForm({
|
|
|
13673
13876
|
obj: "walletObject"
|
|
13674
13877
|
}
|
|
13675
13878
|
),
|
|
13676
|
-
/* @__PURE__ */ (0,
|
|
13879
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13677
13880
|
Fields_default.Input,
|
|
13678
13881
|
{
|
|
13679
13882
|
label: "Amount",
|
|
@@ -13685,8 +13888,8 @@ function PaymentForm({
|
|
|
13685
13888
|
}
|
|
13686
13889
|
),
|
|
13687
13890
|
" ",
|
|
13688
|
-
isRate && /* @__PURE__ */ (0,
|
|
13689
|
-
/* @__PURE__ */ (0,
|
|
13891
|
+
isRate && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
13892
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13690
13893
|
Fields_default.Input,
|
|
13691
13894
|
{
|
|
13692
13895
|
label: `Rate (1 ${walletObj?.currency} = ? ${accountObj?.currency})`,
|
|
@@ -13696,7 +13899,7 @@ function PaymentForm({
|
|
|
13696
13899
|
required: true
|
|
13697
13900
|
}
|
|
13698
13901
|
),
|
|
13699
|
-
/* @__PURE__ */ (0,
|
|
13902
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13700
13903
|
Fields_default.Input,
|
|
13701
13904
|
{
|
|
13702
13905
|
label: "Exchanged Amount",
|
|
@@ -13707,7 +13910,7 @@ function PaymentForm({
|
|
|
13707
13910
|
}
|
|
13708
13911
|
)
|
|
13709
13912
|
] }),
|
|
13710
|
-
/* @__PURE__ */ (0,
|
|
13913
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13711
13914
|
Fields_default.Select,
|
|
13712
13915
|
{
|
|
13713
13916
|
label: "Action",
|
|
@@ -13717,9 +13920,9 @@ function PaymentForm({
|
|
|
13717
13920
|
required: true
|
|
13718
13921
|
}
|
|
13719
13922
|
),
|
|
13720
|
-
/* @__PURE__ */ (0,
|
|
13923
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Fields_default.Input, { label: "Fee", type: "number", name: "fee", form: methods })
|
|
13721
13924
|
] }),
|
|
13722
|
-
/* @__PURE__ */ (0,
|
|
13925
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13723
13926
|
Fields_default.Textarea,
|
|
13724
13927
|
{
|
|
13725
13928
|
label: "Note",
|
|
@@ -13728,7 +13931,7 @@ function PaymentForm({
|
|
|
13728
13931
|
placeholder: "Add any additional notes here..."
|
|
13729
13932
|
}
|
|
13730
13933
|
),
|
|
13731
|
-
/* @__PURE__ */ (0,
|
|
13934
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13732
13935
|
Button,
|
|
13733
13936
|
{
|
|
13734
13937
|
isLoading,
|
|
@@ -13750,8 +13953,8 @@ var PaymentForm_default = PaymentForm;
|
|
|
13750
13953
|
|
|
13751
13954
|
// src/components/moneyTransfer/MoneyTransfers.tsx
|
|
13752
13955
|
var import_react_router_dom28 = require("react-router-dom");
|
|
13753
|
-
var
|
|
13754
|
-
var
|
|
13956
|
+
var import_lucide_react39 = require("lucide-react");
|
|
13957
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
13755
13958
|
function MoneyTransfers({ url }) {
|
|
13756
13959
|
const { branchId } = (0, import_react_router_dom28.useParams)();
|
|
13757
13960
|
const navigate = (0, import_react_router_dom28.useNavigate)();
|
|
@@ -13764,17 +13967,17 @@ function MoneyTransfers({ url }) {
|
|
|
13764
13967
|
const items = (data2) => [
|
|
13765
13968
|
{
|
|
13766
13969
|
label: `View Transfer`,
|
|
13767
|
-
icon: /* @__PURE__ */ (0,
|
|
13970
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react39.FilePenLine, { size: 16 }),
|
|
13768
13971
|
onClick: () => openTransaction({ id: data2?._id, type: "money transfer" })
|
|
13769
13972
|
},
|
|
13770
13973
|
{
|
|
13771
13974
|
label: `Edit Transfer`,
|
|
13772
|
-
icon: /* @__PURE__ */ (0,
|
|
13975
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react39.FilePenLine, { size: 16 }),
|
|
13773
13976
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
13774
13977
|
},
|
|
13775
13978
|
{
|
|
13776
13979
|
label: `Reverse Transfer`,
|
|
13777
|
-
icon: /* @__PURE__ */ (0,
|
|
13980
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react39.Trash2, { className: "text-red-500", size: 16 }),
|
|
13778
13981
|
onClick: () => {
|
|
13779
13982
|
openTransaction({
|
|
13780
13983
|
id: data2?._id,
|
|
@@ -13790,9 +13993,9 @@ function MoneyTransfers({ url }) {
|
|
|
13790
13993
|
header: "Date",
|
|
13791
13994
|
cell: ({ row }) => {
|
|
13792
13995
|
const transfer = row.original;
|
|
13793
|
-
return /* @__PURE__ */ (0,
|
|
13794
|
-
/* @__PURE__ */ (0,
|
|
13795
|
-
/* @__PURE__ */ (0,
|
|
13996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col", children: [
|
|
13997
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { children: transfer?.date }),
|
|
13998
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13796
13999
|
"span",
|
|
13797
14000
|
{
|
|
13798
14001
|
onClick: () => openTransaction({ id: transfer?._id, type: "money transfer" }),
|
|
@@ -13808,7 +14011,7 @@ function MoneyTransfers({ url }) {
|
|
|
13808
14011
|
header: "From Wallet",
|
|
13809
14012
|
cell: ({ row }) => {
|
|
13810
14013
|
const transfer = row.original;
|
|
13811
|
-
return /* @__PURE__ */ (0,
|
|
14014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { children: transfer?.fromWalletData?.name || "N/A" });
|
|
13812
14015
|
}
|
|
13813
14016
|
},
|
|
13814
14017
|
{
|
|
@@ -13816,7 +14019,7 @@ function MoneyTransfers({ url }) {
|
|
|
13816
14019
|
header: "To Wallet",
|
|
13817
14020
|
cell: ({ row }) => {
|
|
13818
14021
|
const transfer = row.original;
|
|
13819
|
-
return /* @__PURE__ */ (0,
|
|
14022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { children: transfer?.toWalletData?.name || "N/A" });
|
|
13820
14023
|
}
|
|
13821
14024
|
},
|
|
13822
14025
|
{
|
|
@@ -13824,9 +14027,9 @@ function MoneyTransfers({ url }) {
|
|
|
13824
14027
|
header: "Amount",
|
|
13825
14028
|
cell: ({ row }) => {
|
|
13826
14029
|
const transfer = row.original;
|
|
13827
|
-
return /* @__PURE__ */ (0,
|
|
13828
|
-
/* @__PURE__ */ (0,
|
|
13829
|
-
transfer?.exchange?.rate && /* @__PURE__ */ (0,
|
|
14030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col", children: [
|
|
14031
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { children: Formats_default.Price(transfer?.amount, transfer?.currency) }),
|
|
14032
|
+
transfer?.exchange?.rate && /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("span", { className: "text-xs text-green-600", children: [
|
|
13830
14033
|
"Rate: ",
|
|
13831
14034
|
transfer?.exchange?.rate,
|
|
13832
14035
|
" (",
|
|
@@ -13844,23 +14047,23 @@ function MoneyTransfers({ url }) {
|
|
|
13844
14047
|
header: "Actions",
|
|
13845
14048
|
cell: ({ row }) => {
|
|
13846
14049
|
const data2 = row.original;
|
|
13847
|
-
return /* @__PURE__ */ (0,
|
|
14050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13848
14051
|
Dropdown,
|
|
13849
14052
|
{
|
|
13850
14053
|
className: "cursor-pointer w-[150px]",
|
|
13851
14054
|
items: items(data2),
|
|
13852
14055
|
triggerMode: "hover",
|
|
13853
|
-
children: /* @__PURE__ */ (0,
|
|
14056
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react39.EllipsisVertical, {})
|
|
13854
14057
|
}
|
|
13855
14058
|
);
|
|
13856
14059
|
}
|
|
13857
14060
|
}
|
|
13858
14061
|
];
|
|
13859
14062
|
const transfers = data?.data || [];
|
|
13860
|
-
return /* @__PURE__ */ (0,
|
|
13861
|
-
/* @__PURE__ */ (0,
|
|
13862
|
-
/* @__PURE__ */ (0,
|
|
13863
|
-
/* @__PURE__ */ (0,
|
|
14063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
|
|
14064
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Modal2, {}),
|
|
14065
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(TransactionView, {}),
|
|
14066
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13864
14067
|
TransactionViewComponent,
|
|
13865
14068
|
{
|
|
13866
14069
|
columns,
|
|
@@ -13902,7 +14105,7 @@ var moneyTransferSchema = import_zod28.z.object({
|
|
|
13902
14105
|
});
|
|
13903
14106
|
|
|
13904
14107
|
// src/components/moneyTransfer/MoneyTransferForm.tsx
|
|
13905
|
-
var
|
|
14108
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
13906
14109
|
function MoneyTransferForm() {
|
|
13907
14110
|
const { branchId } = (0, import_react_router_dom29.useParams)();
|
|
13908
14111
|
const { getQuery, navigate } = useApp_default();
|
|
@@ -13981,26 +14184,26 @@ function MoneyTransferForm() {
|
|
|
13981
14184
|
fetches();
|
|
13982
14185
|
}
|
|
13983
14186
|
}, [id]);
|
|
13984
|
-
return /* @__PURE__ */ (0,
|
|
14187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
13985
14188
|
Card,
|
|
13986
14189
|
{
|
|
13987
14190
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
13988
14191
|
isLoading: isLoadingGet,
|
|
13989
14192
|
loadingText: "Processing...",
|
|
13990
14193
|
children: [
|
|
13991
|
-
/* @__PURE__ */ (0,
|
|
13992
|
-
/* @__PURE__ */ (0,
|
|
13993
|
-
/* @__PURE__ */ (0,
|
|
14194
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(Card.Header, { children: [
|
|
14195
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Money Transfer` }),
|
|
14196
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Card.Description, { children: isEdit ? `Update the details for this money transfer` : `Move funds between two wallets` })
|
|
13994
14197
|
] }),
|
|
13995
|
-
/* @__PURE__ */ (0,
|
|
14198
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
13996
14199
|
"form",
|
|
13997
14200
|
{
|
|
13998
14201
|
className: "space-y-4",
|
|
13999
14202
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
14000
14203
|
children: [
|
|
14001
14204
|
" ",
|
|
14002
|
-
/* @__PURE__ */ (0,
|
|
14003
|
-
/* @__PURE__ */ (0,
|
|
14205
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
14206
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
14004
14207
|
Feilds_default2.Wallet,
|
|
14005
14208
|
{
|
|
14006
14209
|
label: "Source Wallet (From)",
|
|
@@ -14013,7 +14216,7 @@ function MoneyTransferForm() {
|
|
|
14013
14216
|
filter: [toWallet]
|
|
14014
14217
|
}
|
|
14015
14218
|
),
|
|
14016
|
-
/* @__PURE__ */ (0,
|
|
14219
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
14017
14220
|
Feilds_default2.Wallet,
|
|
14018
14221
|
{
|
|
14019
14222
|
label: "Destination Wallet (To)",
|
|
@@ -14027,8 +14230,8 @@ function MoneyTransferForm() {
|
|
|
14027
14230
|
}
|
|
14028
14231
|
)
|
|
14029
14232
|
] }),
|
|
14030
|
-
/* @__PURE__ */ (0,
|
|
14031
|
-
/* @__PURE__ */ (0,
|
|
14233
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
14234
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
14032
14235
|
Fields_default.DateInput,
|
|
14033
14236
|
{
|
|
14034
14237
|
label: "Date",
|
|
@@ -14037,7 +14240,7 @@ function MoneyTransferForm() {
|
|
|
14037
14240
|
required: true
|
|
14038
14241
|
}
|
|
14039
14242
|
),
|
|
14040
|
-
/* @__PURE__ */ (0,
|
|
14243
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
14041
14244
|
Fields_default.Input,
|
|
14042
14245
|
{
|
|
14043
14246
|
label: "Amount",
|
|
@@ -14049,8 +14252,8 @@ function MoneyTransferForm() {
|
|
|
14049
14252
|
}
|
|
14050
14253
|
)
|
|
14051
14254
|
] }),
|
|
14052
|
-
isRate && /* @__PURE__ */ (0,
|
|
14053
|
-
/* @__PURE__ */ (0,
|
|
14255
|
+
isRate && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
14256
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
14054
14257
|
Fields_default.Input,
|
|
14055
14258
|
{
|
|
14056
14259
|
label: `Rate (1 ${fromWalletObj?.currency} = ? ${toWalletObj?.currency})`,
|
|
@@ -14060,7 +14263,7 @@ function MoneyTransferForm() {
|
|
|
14060
14263
|
required: true
|
|
14061
14264
|
}
|
|
14062
14265
|
),
|
|
14063
|
-
/* @__PURE__ */ (0,
|
|
14266
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
14064
14267
|
Fields_default.Input,
|
|
14065
14268
|
{
|
|
14066
14269
|
label: "Exchanged Amount",
|
|
@@ -14071,7 +14274,7 @@ function MoneyTransferForm() {
|
|
|
14071
14274
|
}
|
|
14072
14275
|
)
|
|
14073
14276
|
] }),
|
|
14074
|
-
/* @__PURE__ */ (0,
|
|
14277
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
14075
14278
|
Fields_default.Textarea,
|
|
14076
14279
|
{
|
|
14077
14280
|
label: "Note",
|
|
@@ -14080,7 +14283,7 @@ function MoneyTransferForm() {
|
|
|
14080
14283
|
placeholder: "Add any additional notes here..."
|
|
14081
14284
|
}
|
|
14082
14285
|
),
|
|
14083
|
-
/* @__PURE__ */ (0,
|
|
14286
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
14084
14287
|
Button,
|
|
14085
14288
|
{
|
|
14086
14289
|
isLoading,
|
|
@@ -14102,8 +14305,8 @@ var MoneyTransferForm_default = MoneyTransferForm;
|
|
|
14102
14305
|
|
|
14103
14306
|
// src/components/expense/Expenses.tsx
|
|
14104
14307
|
var import_react_router_dom30 = require("react-router-dom");
|
|
14105
|
-
var
|
|
14106
|
-
var
|
|
14308
|
+
var import_lucide_react40 = require("lucide-react");
|
|
14309
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
14107
14310
|
function Expenses({ url }) {
|
|
14108
14311
|
const { branchId } = (0, import_react_router_dom30.useParams)();
|
|
14109
14312
|
const navigate = (0, import_react_router_dom30.useNavigate)();
|
|
@@ -14116,17 +14319,17 @@ function Expenses({ url }) {
|
|
|
14116
14319
|
const items = (data2) => [
|
|
14117
14320
|
{
|
|
14118
14321
|
label: `View Expense`,
|
|
14119
|
-
icon: /* @__PURE__ */ (0,
|
|
14322
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_lucide_react40.FilePenLine, { size: 16 }),
|
|
14120
14323
|
onClick: () => openTransaction({ id: data2?._id, type: "expense" })
|
|
14121
14324
|
},
|
|
14122
14325
|
{
|
|
14123
14326
|
label: `Edit Expense`,
|
|
14124
|
-
icon: /* @__PURE__ */ (0,
|
|
14327
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_lucide_react40.FilePenLine, { size: 16 }),
|
|
14125
14328
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
14126
14329
|
},
|
|
14127
14330
|
{
|
|
14128
14331
|
label: `Delete Expense`,
|
|
14129
|
-
icon: /* @__PURE__ */ (0,
|
|
14332
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_lucide_react40.Trash2, { className: "text-red-500", size: 16 }),
|
|
14130
14333
|
onClick: () => {
|
|
14131
14334
|
openTransaction({
|
|
14132
14335
|
id: data2?._id,
|
|
@@ -14142,9 +14345,9 @@ function Expenses({ url }) {
|
|
|
14142
14345
|
header: "Date",
|
|
14143
14346
|
cell: ({ row }) => {
|
|
14144
14347
|
const expense = row.original;
|
|
14145
|
-
return /* @__PURE__ */ (0,
|
|
14146
|
-
/* @__PURE__ */ (0,
|
|
14147
|
-
/* @__PURE__ */ (0,
|
|
14348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex flex-col", children: [
|
|
14349
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { children: expense?.date }),
|
|
14350
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
14148
14351
|
"span",
|
|
14149
14352
|
{
|
|
14150
14353
|
onClick: () => openTransaction({ id: expense?._id, type: "expense" }),
|
|
@@ -14160,9 +14363,9 @@ function Expenses({ url }) {
|
|
|
14160
14363
|
header: "Description",
|
|
14161
14364
|
cell: ({ row }) => {
|
|
14162
14365
|
const expense = row.original;
|
|
14163
|
-
return /* @__PURE__ */ (0,
|
|
14164
|
-
/* @__PURE__ */ (0,
|
|
14165
|
-
expense?.note && /* @__PURE__ */ (0,
|
|
14366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex flex-col", children: [
|
|
14367
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "capitalize", children: expense?.description }),
|
|
14368
|
+
expense?.note && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "text-xs text-gray-500 italic max-w-xs truncate", children: expense?.note })
|
|
14166
14369
|
] });
|
|
14167
14370
|
}
|
|
14168
14371
|
},
|
|
@@ -14172,7 +14375,7 @@ function Expenses({ url }) {
|
|
|
14172
14375
|
cell: ({ row }) => {
|
|
14173
14376
|
const expense = row.original;
|
|
14174
14377
|
const walletData = expense?.fromWalletData || expense?.toWalletData;
|
|
14175
|
-
return /* @__PURE__ */ (0,
|
|
14378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { children: walletData?.name || "N/A" });
|
|
14176
14379
|
}
|
|
14177
14380
|
},
|
|
14178
14381
|
{
|
|
@@ -14180,7 +14383,7 @@ function Expenses({ url }) {
|
|
|
14180
14383
|
header: "Amount",
|
|
14181
14384
|
cell: ({ row }) => {
|
|
14182
14385
|
const expense = row.original;
|
|
14183
|
-
return /* @__PURE__ */ (0,
|
|
14386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "font-medium text-red-600", children: Formats_default.Price(expense?.amount, expense?.currency) });
|
|
14184
14387
|
}
|
|
14185
14388
|
},
|
|
14186
14389
|
{
|
|
@@ -14188,23 +14391,23 @@ function Expenses({ url }) {
|
|
|
14188
14391
|
header: "Actions",
|
|
14189
14392
|
cell: ({ row }) => {
|
|
14190
14393
|
const data2 = row.original;
|
|
14191
|
-
return /* @__PURE__ */ (0,
|
|
14394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
14192
14395
|
Dropdown,
|
|
14193
14396
|
{
|
|
14194
14397
|
className: "cursor-pointer w-[150px]",
|
|
14195
14398
|
items: items(data2),
|
|
14196
14399
|
triggerMode: "hover",
|
|
14197
|
-
children: /* @__PURE__ */ (0,
|
|
14400
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_lucide_react40.EllipsisVertical, {})
|
|
14198
14401
|
}
|
|
14199
14402
|
);
|
|
14200
14403
|
}
|
|
14201
14404
|
}
|
|
14202
14405
|
];
|
|
14203
14406
|
const expenses = data?.data || [];
|
|
14204
|
-
return /* @__PURE__ */ (0,
|
|
14205
|
-
/* @__PURE__ */ (0,
|
|
14206
|
-
/* @__PURE__ */ (0,
|
|
14207
|
-
/* @__PURE__ */ (0,
|
|
14407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
14408
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TransactionView, {}),
|
|
14409
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Modal2, {}),
|
|
14410
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
14208
14411
|
TransactionViewComponent,
|
|
14209
14412
|
{
|
|
14210
14413
|
columns,
|
|
@@ -14243,7 +14446,7 @@ var expenseSchema = import_zod31.z.object({
|
|
|
14243
14446
|
});
|
|
14244
14447
|
|
|
14245
14448
|
// src/components/expense/ExpenseForm.tsx
|
|
14246
|
-
var
|
|
14449
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
14247
14450
|
function ExpenseForm() {
|
|
14248
14451
|
const { branchId } = (0, import_react_router_dom31.useParams)();
|
|
14249
14452
|
const { getQuery, navigate } = useApp_default();
|
|
@@ -14301,25 +14504,25 @@ function ExpenseForm() {
|
|
|
14301
14504
|
fetches();
|
|
14302
14505
|
}
|
|
14303
14506
|
}, [id]);
|
|
14304
|
-
return /* @__PURE__ */ (0,
|
|
14507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
14305
14508
|
Card,
|
|
14306
14509
|
{
|
|
14307
14510
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
14308
14511
|
isLoading: isLoadingGet,
|
|
14309
14512
|
loadingText: "Processing...",
|
|
14310
14513
|
children: [
|
|
14311
|
-
/* @__PURE__ */ (0,
|
|
14312
|
-
/* @__PURE__ */ (0,
|
|
14313
|
-
/* @__PURE__ */ (0,
|
|
14514
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Card.Header, { children: [
|
|
14515
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Expense` }),
|
|
14516
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Card.Description, { children: isEdit ? `Update the details for this expense entry` : `Record a new business expense` })
|
|
14314
14517
|
] }),
|
|
14315
|
-
/* @__PURE__ */ (0,
|
|
14518
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
14316
14519
|
"form",
|
|
14317
14520
|
{
|
|
14318
14521
|
className: "space-y-4",
|
|
14319
14522
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
14320
14523
|
children: [
|
|
14321
|
-
/* @__PURE__ */ (0,
|
|
14322
|
-
/* @__PURE__ */ (0,
|
|
14524
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
14525
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
14323
14526
|
Fields_default.Input,
|
|
14324
14527
|
{
|
|
14325
14528
|
label: "Description",
|
|
@@ -14329,7 +14532,7 @@ function ExpenseForm() {
|
|
|
14329
14532
|
required: true
|
|
14330
14533
|
}
|
|
14331
14534
|
),
|
|
14332
|
-
/* @__PURE__ */ (0,
|
|
14535
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
14333
14536
|
Feilds_default2.Wallet,
|
|
14334
14537
|
{
|
|
14335
14538
|
label: "Wallet",
|
|
@@ -14342,8 +14545,8 @@ function ExpenseForm() {
|
|
|
14342
14545
|
}
|
|
14343
14546
|
)
|
|
14344
14547
|
] }),
|
|
14345
|
-
/* @__PURE__ */ (0,
|
|
14346
|
-
/* @__PURE__ */ (0,
|
|
14548
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
14549
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
14347
14550
|
Fields_default.DateInput,
|
|
14348
14551
|
{
|
|
14349
14552
|
label: "Date",
|
|
@@ -14352,7 +14555,7 @@ function ExpenseForm() {
|
|
|
14352
14555
|
required: true
|
|
14353
14556
|
}
|
|
14354
14557
|
),
|
|
14355
|
-
/* @__PURE__ */ (0,
|
|
14558
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
14356
14559
|
Fields_default.Input,
|
|
14357
14560
|
{
|
|
14358
14561
|
label: "Amount",
|
|
@@ -14364,7 +14567,7 @@ function ExpenseForm() {
|
|
|
14364
14567
|
}
|
|
14365
14568
|
)
|
|
14366
14569
|
] }),
|
|
14367
|
-
/* @__PURE__ */ (0,
|
|
14570
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
14368
14571
|
Fields_default.Textarea,
|
|
14369
14572
|
{
|
|
14370
14573
|
label: "Note",
|
|
@@ -14373,7 +14576,7 @@ function ExpenseForm() {
|
|
|
14373
14576
|
placeholder: "Add any additional details..."
|
|
14374
14577
|
}
|
|
14375
14578
|
),
|
|
14376
|
-
/* @__PURE__ */ (0,
|
|
14579
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
14377
14580
|
Button,
|
|
14378
14581
|
{
|
|
14379
14582
|
isLoading,
|
|
@@ -14394,28 +14597,28 @@ function ExpenseForm() {
|
|
|
14394
14597
|
var ExpenseForm_default = ExpenseForm;
|
|
14395
14598
|
|
|
14396
14599
|
// src/components/ErrorPage/ErrorPage.tsx
|
|
14397
|
-
var
|
|
14600
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
14398
14601
|
var ErrorPageBase = ({
|
|
14399
14602
|
title,
|
|
14400
|
-
message:
|
|
14603
|
+
message: message30,
|
|
14401
14604
|
statusCode,
|
|
14402
14605
|
action,
|
|
14403
14606
|
className = ""
|
|
14404
14607
|
}) => {
|
|
14405
|
-
return /* @__PURE__ */ (0,
|
|
14608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
14406
14609
|
"div",
|
|
14407
14610
|
{
|
|
14408
14611
|
className: `flex-1 m-auto h-full w-full min-h-[50vh] flex flex-col items-center justify-center p-6 text-zinc-900 dark:text-zinc-100 ${className}`,
|
|
14409
|
-
children: /* @__PURE__ */ (0,
|
|
14410
|
-
statusCode && /* @__PURE__ */ (0,
|
|
14411
|
-
/* @__PURE__ */ (0,
|
|
14412
|
-
statusCode && /* @__PURE__ */ (0,
|
|
14612
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "relative flex flex-col items-center justify-center w-full max-w-2xl text-center", children: [
|
|
14613
|
+
statusCode && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "absolute inset-0 flex items-center justify-center z-0 select-none pointer-events-none opacity-[0.03] dark:opacity-5", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "text-[12rem] sm:text-[16rem] md:text-[20rem] font-bold leading-none tracking-tighter", children: statusCode }) }),
|
|
14614
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "relative z-10 space-y-6", children: [
|
|
14615
|
+
statusCode && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("h2", { className: "text-xl md:text-2xl font-semibold text-zinc-500 dark:text-zinc-400", children: [
|
|
14413
14616
|
"Error ",
|
|
14414
14617
|
statusCode
|
|
14415
14618
|
] }),
|
|
14416
|
-
title && /* @__PURE__ */ (0,
|
|
14417
|
-
|
|
14418
|
-
action && /* @__PURE__ */ (0,
|
|
14619
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("h1", { className: "text-4xl md:text-5xl font-extrabold tracking-tight drop-shadow-sm", children: title }),
|
|
14620
|
+
message30 && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("p", { className: "text-lg md:text-xl text-zinc-600 dark:text-zinc-400 max-w-md mx-auto", children: message30 }),
|
|
14621
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "pt-8", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
14419
14622
|
"button",
|
|
14420
14623
|
{
|
|
14421
14624
|
onClick: action.onClick,
|
|
@@ -14431,9 +14634,9 @@ var ErrorPageBase = ({
|
|
|
14431
14634
|
};
|
|
14432
14635
|
|
|
14433
14636
|
// src/components/ErrorPage/ErrorPage.500.tsx
|
|
14434
|
-
var
|
|
14637
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
14435
14638
|
var ErrorPage500 = (props) => {
|
|
14436
|
-
return /* @__PURE__ */ (0,
|
|
14639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14437
14640
|
ErrorPageBase,
|
|
14438
14641
|
{
|
|
14439
14642
|
statusCode: 500,
|
|
@@ -14446,9 +14649,9 @@ var ErrorPage500 = (props) => {
|
|
|
14446
14649
|
};
|
|
14447
14650
|
|
|
14448
14651
|
// src/components/ErrorPage/ErrorPage.404.tsx
|
|
14449
|
-
var
|
|
14652
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
14450
14653
|
var ErrorPage404 = (props) => {
|
|
14451
|
-
return /* @__PURE__ */ (0,
|
|
14654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
14452
14655
|
ErrorPageBase,
|
|
14453
14656
|
{
|
|
14454
14657
|
statusCode: 404,
|
|
@@ -14461,9 +14664,9 @@ var ErrorPage404 = (props) => {
|
|
|
14461
14664
|
};
|
|
14462
14665
|
|
|
14463
14666
|
// src/components/ErrorPage/ErrorPage.401.tsx
|
|
14464
|
-
var
|
|
14667
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
14465
14668
|
var ErrorPage401 = (props) => {
|
|
14466
|
-
return /* @__PURE__ */ (0,
|
|
14669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
14467
14670
|
ErrorPageBase,
|
|
14468
14671
|
{
|
|
14469
14672
|
statusCode: 401,
|
|
@@ -14476,9 +14679,9 @@ var ErrorPage401 = (props) => {
|
|
|
14476
14679
|
};
|
|
14477
14680
|
|
|
14478
14681
|
// src/components/ErrorPage/ErrorPage.400.tsx
|
|
14479
|
-
var
|
|
14682
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
14480
14683
|
var ErrorPage400 = (props) => {
|
|
14481
|
-
return /* @__PURE__ */ (0,
|
|
14684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
14482
14685
|
ErrorPageBase,
|
|
14483
14686
|
{
|
|
14484
14687
|
statusCode: 400,
|
|
@@ -14499,7 +14702,7 @@ var ErrorPage = Object.assign(ErrorPageBase, {
|
|
|
14499
14702
|
});
|
|
14500
14703
|
|
|
14501
14704
|
// src/components/accounts/Report.tsx
|
|
14502
|
-
var
|
|
14705
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
14503
14706
|
var AccountReport = () => {
|
|
14504
14707
|
const { apiConfig } = useWarqadConfig();
|
|
14505
14708
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
@@ -14518,9 +14721,9 @@ var AccountReport = () => {
|
|
|
14518
14721
|
header: "Date",
|
|
14519
14722
|
key: "date",
|
|
14520
14723
|
className: "text-xs whitespace-nowrap",
|
|
14521
|
-
render: (row) => /* @__PURE__ */ (0,
|
|
14522
|
-
/* @__PURE__ */ (0,
|
|
14523
|
-
/* @__PURE__ */ (0,
|
|
14724
|
+
render: (row) => /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "", children: [
|
|
14725
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
|
|
14726
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
14524
14727
|
"span",
|
|
14525
14728
|
{
|
|
14526
14729
|
onClick: () => {
|
|
@@ -14539,7 +14742,7 @@ var AccountReport = () => {
|
|
|
14539
14742
|
header: "Description",
|
|
14540
14743
|
key: "description",
|
|
14541
14744
|
className: "text-xs w-full break-words",
|
|
14542
|
-
render: (row) => /* @__PURE__ */ (0,
|
|
14745
|
+
render: (row) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "font-bold text-black dark:text-white print:text-black", children: row.description })
|
|
14543
14746
|
},
|
|
14544
14747
|
{
|
|
14545
14748
|
header: "Credit",
|
|
@@ -14548,16 +14751,16 @@ var AccountReport = () => {
|
|
|
14548
14751
|
render: (row) => {
|
|
14549
14752
|
const Amount = row.calculatedAmount;
|
|
14550
14753
|
const fee = 0;
|
|
14551
|
-
return /* @__PURE__ */ (0,
|
|
14552
|
-
/* @__PURE__ */ (0,
|
|
14553
|
-
fee > 0 && /* @__PURE__ */ (0,
|
|
14754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "", children: Amount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
14755
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("p", { className: "font-bold text-green-500 dark:text-green-500 print:text-green-500", children: Formats_default.Amount(Amount) }),
|
|
14756
|
+
fee > 0 && /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("span", { className: "text-[8px]", children: [
|
|
14554
14757
|
"fee:(",
|
|
14555
14758
|
fee,
|
|
14556
14759
|
")"
|
|
14557
14760
|
] })
|
|
14558
14761
|
] }) : "" });
|
|
14559
14762
|
},
|
|
14560
|
-
renderFooter: (data2) => /* @__PURE__ */ (0,
|
|
14763
|
+
renderFooter: (data2) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
|
|
14561
14764
|
data2.reduce(
|
|
14562
14765
|
(acc, row) => acc + (row.calculatedAmount > 0 ? row.calculatedAmount : 0),
|
|
14563
14766
|
0
|
|
@@ -14571,16 +14774,16 @@ var AccountReport = () => {
|
|
|
14571
14774
|
render: (row) => {
|
|
14572
14775
|
const Amount = row.calculatedAmount;
|
|
14573
14776
|
const fee = 0;
|
|
14574
|
-
return /* @__PURE__ */ (0,
|
|
14575
|
-
/* @__PURE__ */ (0,
|
|
14576
|
-
fee > 0 && /* @__PURE__ */ (0,
|
|
14777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "", children: Amount < 0 ? /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
14778
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("p", { className: "font-bold text-red-500 dark:text-red-500 print:text-red-500", children: Formats_default.Amount(Amount) }),
|
|
14779
|
+
fee > 0 && /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("span", { className: "text-[8px]", children: [
|
|
14577
14780
|
"Fee:(",
|
|
14578
14781
|
fee,
|
|
14579
14782
|
")"
|
|
14580
14783
|
] })
|
|
14581
14784
|
] }) : "" });
|
|
14582
14785
|
},
|
|
14583
|
-
renderFooter: (data2) => /* @__PURE__ */ (0,
|
|
14786
|
+
renderFooter: (data2) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
|
|
14584
14787
|
data2.reduce(
|
|
14585
14788
|
(acc, row) => acc + (row.calculatedAmount < 0 ? row.calculatedAmount : 0),
|
|
14586
14789
|
0
|
|
@@ -14591,8 +14794,8 @@ var AccountReport = () => {
|
|
|
14591
14794
|
header: "Balance",
|
|
14592
14795
|
key: "runningBalance",
|
|
14593
14796
|
className: "text-xs whitespace-nowrap text-right",
|
|
14594
|
-
render: (row) => /* @__PURE__ */ (0,
|
|
14595
|
-
renderFooter: (data2) => /* @__PURE__ */ (0,
|
|
14797
|
+
render: (row) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Price(row.runningBalance, currency) }),
|
|
14798
|
+
renderFooter: (data2) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
|
|
14596
14799
|
data2.reduce((acc, row) => acc + row.calculatedAmount, 0),
|
|
14597
14800
|
currency
|
|
14598
14801
|
) })
|
|
@@ -14611,9 +14814,9 @@ var AccountReport = () => {
|
|
|
14611
14814
|
{ label: "Account Type", value: data?.data?.type },
|
|
14612
14815
|
{ label: "Currency", value: data?.data?.currency }
|
|
14613
14816
|
];
|
|
14614
|
-
return /* @__PURE__ */ (0,
|
|
14615
|
-
/* @__PURE__ */ (0,
|
|
14616
|
-
/* @__PURE__ */ (0,
|
|
14817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
14818
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TransactionView, {}),
|
|
14819
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
14617
14820
|
A4DataView,
|
|
14618
14821
|
{
|
|
14619
14822
|
columns,
|
|
@@ -14630,7 +14833,7 @@ var AccountReport = () => {
|
|
|
14630
14833
|
var Report_default = AccountReport;
|
|
14631
14834
|
|
|
14632
14835
|
// src/components/wallets/Report.tsx
|
|
14633
|
-
var
|
|
14836
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
14634
14837
|
var WalletReport = () => {
|
|
14635
14838
|
const { apiConfig } = useWarqadConfig();
|
|
14636
14839
|
const { getParams } = useApp_default();
|
|
@@ -14648,9 +14851,9 @@ var WalletReport = () => {
|
|
|
14648
14851
|
header: "Date",
|
|
14649
14852
|
key: "date",
|
|
14650
14853
|
className: "text-xs whitespace-nowrap",
|
|
14651
|
-
render: (row) => /* @__PURE__ */ (0,
|
|
14652
|
-
/* @__PURE__ */ (0,
|
|
14653
|
-
/* @__PURE__ */ (0,
|
|
14854
|
+
render: (row) => /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "", children: [
|
|
14855
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
|
|
14856
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
14654
14857
|
"span",
|
|
14655
14858
|
{
|
|
14656
14859
|
onClick: () => {
|
|
@@ -14669,7 +14872,7 @@ var WalletReport = () => {
|
|
|
14669
14872
|
header: "Description",
|
|
14670
14873
|
key: "description",
|
|
14671
14874
|
className: "text-xs w-full break-words",
|
|
14672
|
-
render: (row) => /* @__PURE__ */ (0,
|
|
14875
|
+
render: (row) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "font-bold text-black dark:text-white print:text-black", children: row.description })
|
|
14673
14876
|
},
|
|
14674
14877
|
{
|
|
14675
14878
|
header: "Credit",
|
|
@@ -14678,9 +14881,9 @@ var WalletReport = () => {
|
|
|
14678
14881
|
render: (row) => {
|
|
14679
14882
|
const Amount = row.calculatedAmount;
|
|
14680
14883
|
const fee = 0;
|
|
14681
|
-
return /* @__PURE__ */ (0,
|
|
14682
|
-
/* @__PURE__ */ (0,
|
|
14683
|
-
fee > 0 && /* @__PURE__ */ (0,
|
|
14884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "", children: Amount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
14885
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("p", { className: "font-bold text-green-500 dark:text-green-500 print:text-green-500", children: Formats_default.Amount(Amount) }),
|
|
14886
|
+
fee > 0 && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("span", { className: "text-[8px]", children: [
|
|
14684
14887
|
"fee:(",
|
|
14685
14888
|
fee,
|
|
14686
14889
|
")"
|
|
@@ -14688,7 +14891,7 @@ var WalletReport = () => {
|
|
|
14688
14891
|
] }) : "" });
|
|
14689
14892
|
},
|
|
14690
14893
|
renderFooter: (data2) => {
|
|
14691
|
-
return /* @__PURE__ */ (0,
|
|
14894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
|
|
14692
14895
|
data2.reduce(
|
|
14693
14896
|
(acc, row) => acc + (row.calculatedAmount > 0 ? row.calculatedAmount : 0),
|
|
14694
14897
|
0
|
|
@@ -14704,16 +14907,16 @@ var WalletReport = () => {
|
|
|
14704
14907
|
render: (row) => {
|
|
14705
14908
|
const Amount = row.calculatedAmount;
|
|
14706
14909
|
const fee = 0;
|
|
14707
|
-
return /* @__PURE__ */ (0,
|
|
14708
|
-
/* @__PURE__ */ (0,
|
|
14709
|
-
fee > 0 && /* @__PURE__ */ (0,
|
|
14910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "", children: Amount < 0 ? /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
14911
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("p", { className: "font-bold text-red-500 dark:text-red-500 print:text-red-500", children: Formats_default.Amount(Amount) }),
|
|
14912
|
+
fee > 0 && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("span", { className: "text-[8px]", children: [
|
|
14710
14913
|
"Fee:(",
|
|
14711
14914
|
fee,
|
|
14712
14915
|
")"
|
|
14713
14916
|
] })
|
|
14714
14917
|
] }) : "" });
|
|
14715
14918
|
},
|
|
14716
|
-
renderFooter: (data2) => /* @__PURE__ */ (0,
|
|
14919
|
+
renderFooter: (data2) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
|
|
14717
14920
|
data2.reduce(
|
|
14718
14921
|
(acc, row) => acc + (row.calculatedAmount < 0 ? row.calculatedAmount : 0),
|
|
14719
14922
|
0
|
|
@@ -14724,8 +14927,8 @@ var WalletReport = () => {
|
|
|
14724
14927
|
header: "Balance",
|
|
14725
14928
|
key: "runningBalance",
|
|
14726
14929
|
className: "text-xs whitespace-nowrap text-right",
|
|
14727
|
-
render: (row) => /* @__PURE__ */ (0,
|
|
14728
|
-
renderFooter: (data2) => /* @__PURE__ */ (0,
|
|
14930
|
+
render: (row) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Price(row.runningBalance, currency) }),
|
|
14931
|
+
renderFooter: (data2) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
|
|
14729
14932
|
data2.reduce((acc, row) => acc + row.calculatedAmount, 0),
|
|
14730
14933
|
currency
|
|
14731
14934
|
) })
|
|
@@ -14744,9 +14947,9 @@ var WalletReport = () => {
|
|
|
14744
14947
|
{ label: "Wallet Account No", value: data?.data?.accountNo || "N/A" },
|
|
14745
14948
|
{ label: "Currency", value: data?.data?.currency }
|
|
14746
14949
|
];
|
|
14747
|
-
return /* @__PURE__ */ (0,
|
|
14748
|
-
/* @__PURE__ */ (0,
|
|
14749
|
-
/* @__PURE__ */ (0,
|
|
14950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
14951
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TransactionView, {}),
|
|
14952
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
14750
14953
|
A4DataView,
|
|
14751
14954
|
{
|
|
14752
14955
|
columns,
|
|
@@ -14765,7 +14968,7 @@ var Report_default2 = WalletReport;
|
|
|
14765
14968
|
// src/components/accounts/Statements.tsx
|
|
14766
14969
|
var import_react_router_dom32 = require("react-router-dom");
|
|
14767
14970
|
var import_react59 = require("react");
|
|
14768
|
-
var
|
|
14971
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
14769
14972
|
var options = [
|
|
14770
14973
|
{ label: "All", value: "all" },
|
|
14771
14974
|
{ label: "Debit", value: "debit" },
|
|
@@ -14830,7 +15033,7 @@ var AccountStatements = () => {
|
|
|
14830
15033
|
header: "Name",
|
|
14831
15034
|
key: "name",
|
|
14832
15035
|
className: "text-xs whitespace-nowrap ",
|
|
14833
|
-
render: (row) => /* @__PURE__ */ (0,
|
|
15036
|
+
render: (row) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
14834
15037
|
"p",
|
|
14835
15038
|
{
|
|
14836
15039
|
onClick: () => navigate(`${row._id}`),
|
|
@@ -14846,9 +15049,9 @@ var AccountStatements = () => {
|
|
|
14846
15049
|
render: (row) => {
|
|
14847
15050
|
const Amount = row.balance;
|
|
14848
15051
|
const fee = 0;
|
|
14849
|
-
return /* @__PURE__ */ (0,
|
|
14850
|
-
/* @__PURE__ */ (0,
|
|
14851
|
-
fee > 0 && /* @__PURE__ */ (0,
|
|
15052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "", children: Amount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_jsx_runtime97.Fragment, { children: [
|
|
15053
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { className: "font-bold text-green-500 dark:text-green-500 print:text-green-500", children: Formats_default.Amount(Amount) }),
|
|
15054
|
+
fee > 0 && /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "text-[8px]", children: [
|
|
14852
15055
|
"fee:(",
|
|
14853
15056
|
fee,
|
|
14854
15057
|
")"
|
|
@@ -14856,7 +15059,7 @@ var AccountStatements = () => {
|
|
|
14856
15059
|
] }) : "" });
|
|
14857
15060
|
},
|
|
14858
15061
|
renderFooter: (data2) => {
|
|
14859
|
-
return /* @__PURE__ */ (0,
|
|
15062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
|
|
14860
15063
|
data2.reduce(
|
|
14861
15064
|
(acc, row) => acc + (row.balance > 0 ? row.balance : 0),
|
|
14862
15065
|
0
|
|
@@ -14872,16 +15075,16 @@ var AccountStatements = () => {
|
|
|
14872
15075
|
render: (row) => {
|
|
14873
15076
|
const Amount = row.balance;
|
|
14874
15077
|
const fee = 0;
|
|
14875
|
-
return /* @__PURE__ */ (0,
|
|
14876
|
-
/* @__PURE__ */ (0,
|
|
14877
|
-
fee > 0 && /* @__PURE__ */ (0,
|
|
15078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "", children: Amount < 0 ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_jsx_runtime97.Fragment, { children: [
|
|
15079
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { className: "font-bold text-red-500 dark:text-red-500 print:text-red-500", children: Formats_default.Amount(Amount) }),
|
|
15080
|
+
fee > 0 && /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "text-[8px]", children: [
|
|
14878
15081
|
"Fee:(",
|
|
14879
15082
|
fee,
|
|
14880
15083
|
")"
|
|
14881
15084
|
] })
|
|
14882
15085
|
] }) : "" });
|
|
14883
15086
|
},
|
|
14884
|
-
renderFooter: (data2) => /* @__PURE__ */ (0,
|
|
15087
|
+
renderFooter: (data2) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
|
|
14885
15088
|
data2.reduce(
|
|
14886
15089
|
(acc, row) => acc + (row.balance < 0 ? row.balance : 0),
|
|
14887
15090
|
0
|
|
@@ -14892,8 +15095,8 @@ var AccountStatements = () => {
|
|
|
14892
15095
|
header: "Balance",
|
|
14893
15096
|
key: "runningBalance",
|
|
14894
15097
|
className: "text-xs whitespace-nowrap text-right",
|
|
14895
|
-
render: (row) => /* @__PURE__ */ (0,
|
|
14896
|
-
renderFooter: (data2) => /* @__PURE__ */ (0,
|
|
15098
|
+
render: (row) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Price(row.runningBalance, row.currency || currency || (currencyFilter === "all" ? void 0 : currencyFilter)) }),
|
|
15099
|
+
renderFooter: (data2) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
|
|
14897
15100
|
data2.reduce((acc, row) => acc + row.balance, 0),
|
|
14898
15101
|
currency || (currencyFilter === "all" ? void 0 : currencyFilter)
|
|
14899
15102
|
) })
|
|
@@ -14918,9 +15121,9 @@ var AccountStatements = () => {
|
|
|
14918
15121
|
if (filter === "credit")
|
|
14919
15122
|
return result.filter((item) => item.runningBalance > 0);
|
|
14920
15123
|
}, [filter, currencyFilter, data]);
|
|
14921
|
-
return /* @__PURE__ */ (0,
|
|
14922
|
-
/* @__PURE__ */ (0,
|
|
14923
|
-
/* @__PURE__ */ (0,
|
|
15124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_jsx_runtime97.Fragment, { children: [
|
|
15125
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TransactionView, {}),
|
|
15126
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
14924
15127
|
A4DataView,
|
|
14925
15128
|
{
|
|
14926
15129
|
columns,
|
|
@@ -14929,8 +15132,8 @@ var AccountStatements = () => {
|
|
|
14929
15132
|
title: `Account Statement`,
|
|
14930
15133
|
subtitle: `All Outstanding Balances`,
|
|
14931
15134
|
fixed: false,
|
|
14932
|
-
headers: /* @__PURE__ */ (0,
|
|
14933
|
-
/* @__PURE__ */ (0,
|
|
15135
|
+
headers: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex gap-2", children: [
|
|
15136
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
14934
15137
|
Fields_default.Select,
|
|
14935
15138
|
{
|
|
14936
15139
|
options,
|
|
@@ -14939,7 +15142,7 @@ var AccountStatements = () => {
|
|
|
14939
15142
|
className: "min-w-[150px] print:hidden"
|
|
14940
15143
|
}
|
|
14941
15144
|
),
|
|
14942
|
-
/* @__PURE__ */ (0,
|
|
15145
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
14943
15146
|
Fields_default.Select,
|
|
14944
15147
|
{
|
|
14945
15148
|
options: [
|
|
@@ -14964,7 +15167,7 @@ var Statements_default = AccountStatements;
|
|
|
14964
15167
|
// src/components/wallets/Statements.tsx
|
|
14965
15168
|
var import_react_router_dom33 = require("react-router-dom");
|
|
14966
15169
|
var import_react60 = require("react");
|
|
14967
|
-
var
|
|
15170
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
14968
15171
|
var options2 = [
|
|
14969
15172
|
{ label: "All", value: "all" },
|
|
14970
15173
|
{ label: "Debit", value: "debit" },
|
|
@@ -15027,7 +15230,7 @@ var WalletStatements = () => {
|
|
|
15027
15230
|
header: "Name",
|
|
15028
15231
|
key: "name",
|
|
15029
15232
|
className: "text-xs whitespace-nowrap",
|
|
15030
|
-
render: (row) => /* @__PURE__ */ (0,
|
|
15233
|
+
render: (row) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
15031
15234
|
"p",
|
|
15032
15235
|
{
|
|
15033
15236
|
onClick: () => navigate(`${row._id}`),
|
|
@@ -15043,9 +15246,9 @@ var WalletStatements = () => {
|
|
|
15043
15246
|
render: (row) => {
|
|
15044
15247
|
const Amount = row.balance;
|
|
15045
15248
|
const fee = 0;
|
|
15046
|
-
return /* @__PURE__ */ (0,
|
|
15047
|
-
/* @__PURE__ */ (0,
|
|
15048
|
-
fee > 0 && /* @__PURE__ */ (0,
|
|
15249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "", children: Amount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
15250
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("p", { className: "font-bold text-green-500 dark:text-green-500 print:text-green-500", children: Formats_default.Amount(Amount) }),
|
|
15251
|
+
fee > 0 && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("span", { className: "text-[8px]", children: [
|
|
15049
15252
|
"fee:(",
|
|
15050
15253
|
fee,
|
|
15051
15254
|
")"
|
|
@@ -15053,7 +15256,7 @@ var WalletStatements = () => {
|
|
|
15053
15256
|
] }) : "" });
|
|
15054
15257
|
},
|
|
15055
15258
|
renderFooter: (data2) => {
|
|
15056
|
-
return /* @__PURE__ */ (0,
|
|
15259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
|
|
15057
15260
|
data2.reduce(
|
|
15058
15261
|
(acc, row) => acc + (row.balance > 0 ? row.balance : 0),
|
|
15059
15262
|
0
|
|
@@ -15069,16 +15272,16 @@ var WalletStatements = () => {
|
|
|
15069
15272
|
render: (row) => {
|
|
15070
15273
|
const Amount = row.balance;
|
|
15071
15274
|
const fee = 0;
|
|
15072
|
-
return /* @__PURE__ */ (0,
|
|
15073
|
-
/* @__PURE__ */ (0,
|
|
15074
|
-
fee > 0 && /* @__PURE__ */ (0,
|
|
15275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "", children: Amount < 0 ? /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
15276
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("p", { className: "font-bold text-red-500 dark:text-red-500 print:text-red-500", children: Formats_default.Amount(Amount) }),
|
|
15277
|
+
fee > 0 && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("span", { className: "text-[8px]", children: [
|
|
15075
15278
|
"Fee:(",
|
|
15076
15279
|
fee,
|
|
15077
15280
|
")"
|
|
15078
15281
|
] })
|
|
15079
15282
|
] }) : "" });
|
|
15080
15283
|
},
|
|
15081
|
-
renderFooter: (data2) => /* @__PURE__ */ (0,
|
|
15284
|
+
renderFooter: (data2) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
|
|
15082
15285
|
data2.reduce(
|
|
15083
15286
|
(acc, row) => acc + (row.balance < 0 ? row.balance : 0),
|
|
15084
15287
|
0
|
|
@@ -15089,8 +15292,8 @@ var WalletStatements = () => {
|
|
|
15089
15292
|
header: "Balance",
|
|
15090
15293
|
key: "runningBalance",
|
|
15091
15294
|
className: "text-xs whitespace-nowrap text-right",
|
|
15092
|
-
render: (row) => /* @__PURE__ */ (0,
|
|
15093
|
-
renderFooter: (data2) => /* @__PURE__ */ (0,
|
|
15295
|
+
render: (row) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Price(row.runningBalance, row.currency || currency || (currencyFilter === "all" ? void 0 : currencyFilter)) }),
|
|
15296
|
+
renderFooter: (data2) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
|
|
15094
15297
|
data2.reduce((acc, row) => acc + row.balance, 0),
|
|
15095
15298
|
currency || (currencyFilter === "all" ? void 0 : currencyFilter)
|
|
15096
15299
|
) })
|
|
@@ -15116,9 +15319,9 @@ var WalletStatements = () => {
|
|
|
15116
15319
|
if (filter === "credit")
|
|
15117
15320
|
return result.filter((item) => item.runningBalance > 0);
|
|
15118
15321
|
}, [filter, currencyFilter, data]);
|
|
15119
|
-
return /* @__PURE__ */ (0,
|
|
15120
|
-
/* @__PURE__ */ (0,
|
|
15121
|
-
/* @__PURE__ */ (0,
|
|
15322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
15323
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(TransactionView, {}),
|
|
15324
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
15122
15325
|
A4DataView,
|
|
15123
15326
|
{
|
|
15124
15327
|
columns,
|
|
@@ -15127,8 +15330,8 @@ var WalletStatements = () => {
|
|
|
15127
15330
|
title: `Wallet Statement`,
|
|
15128
15331
|
subtitle: `All Outstanding Balances`,
|
|
15129
15332
|
fixed: false,
|
|
15130
|
-
headers: /* @__PURE__ */ (0,
|
|
15131
|
-
/* @__PURE__ */ (0,
|
|
15333
|
+
headers: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "flex gap-2", children: [
|
|
15334
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
15132
15335
|
Fields_default.Select,
|
|
15133
15336
|
{
|
|
15134
15337
|
options: options2,
|
|
@@ -15137,7 +15340,7 @@ var WalletStatements = () => {
|
|
|
15137
15340
|
className: "min-w-[150px] print:hidden"
|
|
15138
15341
|
}
|
|
15139
15342
|
),
|
|
15140
|
-
/* @__PURE__ */ (0,
|
|
15343
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
15141
15344
|
Fields_default.Select,
|
|
15142
15345
|
{
|
|
15143
15346
|
options: [
|
|
@@ -15158,6 +15361,326 @@ var WalletStatements = () => {
|
|
|
15158
15361
|
] });
|
|
15159
15362
|
};
|
|
15160
15363
|
var Statements_default2 = WalletStatements;
|
|
15364
|
+
|
|
15365
|
+
// src/components/walletAdjustment/WalletAdjustments.tsx
|
|
15366
|
+
var import_react_router_dom34 = require("react-router-dom");
|
|
15367
|
+
var import_lucide_react41 = require("lucide-react");
|
|
15368
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
15369
|
+
function WalletAdjustments({ url }) {
|
|
15370
|
+
const { branchId } = (0, import_react_router_dom34.useParams)();
|
|
15371
|
+
const navigate = (0, import_react_router_dom34.useNavigate)();
|
|
15372
|
+
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
15373
|
+
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
15374
|
+
url: url || `/transactions/get?type=adjustment&adjustment=wallet${branchId ? `&fromBranch=${branchId}` : ""}`,
|
|
15375
|
+
dateFilter: true
|
|
15376
|
+
});
|
|
15377
|
+
const { Modal: Modal2 } = useModal();
|
|
15378
|
+
const items = (data2) => [
|
|
15379
|
+
{
|
|
15380
|
+
label: `View Adjustment`,
|
|
15381
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_lucide_react41.FilePenLine, { size: 16 }),
|
|
15382
|
+
onClick: () => openTransaction({ id: data2?._id, type: "adjustment" })
|
|
15383
|
+
},
|
|
15384
|
+
{
|
|
15385
|
+
label: `Edit Adjustment`,
|
|
15386
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_lucide_react41.FilePenLine, { size: 16 }),
|
|
15387
|
+
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
15388
|
+
},
|
|
15389
|
+
{
|
|
15390
|
+
label: `Reverse Adjustment`,
|
|
15391
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_lucide_react41.Trash2, { className: "text-red-500", size: 16 }),
|
|
15392
|
+
onClick: () => {
|
|
15393
|
+
openTransaction({
|
|
15394
|
+
id: data2?._id,
|
|
15395
|
+
type: "adjustment",
|
|
15396
|
+
reverseable: { reload }
|
|
15397
|
+
});
|
|
15398
|
+
}
|
|
15399
|
+
}
|
|
15400
|
+
].filter(Boolean);
|
|
15401
|
+
const columns = [
|
|
15402
|
+
{
|
|
15403
|
+
accessorKey: "date",
|
|
15404
|
+
header: "Date",
|
|
15405
|
+
cell: ({ row }) => {
|
|
15406
|
+
const adjustment = row.original;
|
|
15407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "flex flex-col", children: [
|
|
15408
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("span", { children: adjustment?.date }),
|
|
15409
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
15410
|
+
"span",
|
|
15411
|
+
{
|
|
15412
|
+
onClick: () => openTransaction({
|
|
15413
|
+
id: adjustment?._id,
|
|
15414
|
+
type: "adjustment"
|
|
15415
|
+
}),
|
|
15416
|
+
className: "text-xs text-blue-600 italic cursor-pointer hover:underline",
|
|
15417
|
+
children: adjustment.ref
|
|
15418
|
+
}
|
|
15419
|
+
)
|
|
15420
|
+
] });
|
|
15421
|
+
}
|
|
15422
|
+
},
|
|
15423
|
+
{
|
|
15424
|
+
accessorKey: "wallet",
|
|
15425
|
+
header: "Wallet",
|
|
15426
|
+
cell: ({ row }) => {
|
|
15427
|
+
const adjustment = row.original;
|
|
15428
|
+
const walletData = adjustment?.toWalletData || adjustment?.fromWalletData;
|
|
15429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("span", { children: walletData?.name || "N/A" });
|
|
15430
|
+
}
|
|
15431
|
+
},
|
|
15432
|
+
{
|
|
15433
|
+
accessorKey: "action",
|
|
15434
|
+
header: "Action",
|
|
15435
|
+
cell: ({ row }) => {
|
|
15436
|
+
const action = row.original.action;
|
|
15437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
15438
|
+
"span",
|
|
15439
|
+
{
|
|
15440
|
+
className: action === "credit" ? "text-green-600 font-medium" : "text-red-600 font-medium",
|
|
15441
|
+
children: action?.charAt(0).toUpperCase() + action?.slice(1)
|
|
15442
|
+
}
|
|
15443
|
+
);
|
|
15444
|
+
}
|
|
15445
|
+
},
|
|
15446
|
+
{
|
|
15447
|
+
accessorKey: "description",
|
|
15448
|
+
header: "Description",
|
|
15449
|
+
cell: ({ row }) => row.original.description
|
|
15450
|
+
},
|
|
15451
|
+
{
|
|
15452
|
+
accessorKey: "amount",
|
|
15453
|
+
header: "Amount",
|
|
15454
|
+
cell: ({ row }) => {
|
|
15455
|
+
const adjustment = row.original;
|
|
15456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: "flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("span", { children: Formats_default.Price(adjustment?.amount, adjustment?.currency) }) });
|
|
15457
|
+
}
|
|
15458
|
+
},
|
|
15459
|
+
{
|
|
15460
|
+
accessorKey: "actions",
|
|
15461
|
+
header: "Actions",
|
|
15462
|
+
cell: ({ row }) => {
|
|
15463
|
+
const data2 = row.original;
|
|
15464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
15465
|
+
Dropdown,
|
|
15466
|
+
{
|
|
15467
|
+
className: "cursor-pointer w-[150px]",
|
|
15468
|
+
items: items(data2),
|
|
15469
|
+
triggerMode: "hover",
|
|
15470
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_lucide_react41.EllipsisVertical, {})
|
|
15471
|
+
}
|
|
15472
|
+
);
|
|
15473
|
+
}
|
|
15474
|
+
}
|
|
15475
|
+
];
|
|
15476
|
+
const adjustments = data?.data || [];
|
|
15477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
|
|
15478
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Modal2, {}),
|
|
15479
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TransactionView, {}),
|
|
15480
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
15481
|
+
TransactionViewComponent,
|
|
15482
|
+
{
|
|
15483
|
+
columns,
|
|
15484
|
+
data: adjustments,
|
|
15485
|
+
title: "Wallet Adjustments",
|
|
15486
|
+
description: "Manage your wallet balance adjustments",
|
|
15487
|
+
index: true,
|
|
15488
|
+
createTitle: "Add Adjustment",
|
|
15489
|
+
onCreate: () => {
|
|
15490
|
+
navigate("create");
|
|
15491
|
+
}
|
|
15492
|
+
}
|
|
15493
|
+
)
|
|
15494
|
+
] });
|
|
15495
|
+
}
|
|
15496
|
+
var WalletAdjustments_default = WalletAdjustments;
|
|
15497
|
+
|
|
15498
|
+
// src/components/walletAdjustment/WalletAdjustmentForm.tsx
|
|
15499
|
+
var import_react61 = require("react");
|
|
15500
|
+
var import_react_router_dom35 = require("react-router-dom");
|
|
15501
|
+
var import_react_hook_form24 = require("react-hook-form");
|
|
15502
|
+
var import_zod35 = require("@hookform/resolvers/zod");
|
|
15503
|
+
var import_antd32 = require("antd");
|
|
15504
|
+
|
|
15505
|
+
// src/components/walletAdjustment/schema.ts
|
|
15506
|
+
var import_zod34 = require("zod");
|
|
15507
|
+
var walletAdjustmentSchema = import_zod34.z.object({
|
|
15508
|
+
date: zodFields.date,
|
|
15509
|
+
amount: import_zod34.z.number().gt(0, "Amount must be greater than 0"),
|
|
15510
|
+
action: import_zod34.z.enum(Enums_default.actionTypes),
|
|
15511
|
+
wallet: import_zod34.z.string(),
|
|
15512
|
+
description: import_zod34.z.string(),
|
|
15513
|
+
note: import_zod34.z.string().optional(),
|
|
15514
|
+
branch: import_zod34.z.string().optional(),
|
|
15515
|
+
// Objects for frontend helpers
|
|
15516
|
+
walletObject: import_zod34.z.any().optional()
|
|
15517
|
+
});
|
|
15518
|
+
|
|
15519
|
+
// src/components/walletAdjustment/WalletAdjustmentForm.tsx
|
|
15520
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
15521
|
+
function WalletAdjustmentForm() {
|
|
15522
|
+
const { branchId } = (0, import_react_router_dom35.useParams)();
|
|
15523
|
+
const { getQuery, navigate } = useApp_default();
|
|
15524
|
+
const id = getQuery("id");
|
|
15525
|
+
const isEdit = !!id;
|
|
15526
|
+
const [ref, setRef] = (0, import_react61.useState)("");
|
|
15527
|
+
const { post, isLoading } = useApis_default();
|
|
15528
|
+
const { isLoading: isLoadingGet, get } = useApis_default();
|
|
15529
|
+
const methods = (0, import_react_hook_form24.useForm)({
|
|
15530
|
+
resolver: (0, import_zod35.zodResolver)(walletAdjustmentSchema),
|
|
15531
|
+
defaultValues: {
|
|
15532
|
+
date: (/* @__PURE__ */ new Date()).toLocaleDateString("en-GB"),
|
|
15533
|
+
amount: 0,
|
|
15534
|
+
action: "credit",
|
|
15535
|
+
wallet: "",
|
|
15536
|
+
description: "",
|
|
15537
|
+
note: ""
|
|
15538
|
+
}
|
|
15539
|
+
});
|
|
15540
|
+
const { handleSubmit, reset } = methods;
|
|
15541
|
+
const onSubmit = async (data) => {
|
|
15542
|
+
try {
|
|
15543
|
+
const payload = {
|
|
15544
|
+
...data,
|
|
15545
|
+
type: "adjustment",
|
|
15546
|
+
adjustment: "wallet",
|
|
15547
|
+
branch: branchId ?? data.branch ?? void 0
|
|
15548
|
+
};
|
|
15549
|
+
await post({
|
|
15550
|
+
url: `/transactions/add${isEdit ? `?ref=${ref}` : ""}`,
|
|
15551
|
+
body: payload
|
|
15552
|
+
});
|
|
15553
|
+
import_antd32.message.success(`Wallet adjustment saved successfully`);
|
|
15554
|
+
navigate(-1);
|
|
15555
|
+
} catch (error) {
|
|
15556
|
+
import_antd32.message.error(error?.message || "Something went wrong");
|
|
15557
|
+
}
|
|
15558
|
+
};
|
|
15559
|
+
const fetches = async () => {
|
|
15560
|
+
try {
|
|
15561
|
+
const res = await get({
|
|
15562
|
+
url: `/transactions/get?id=${id}${branchId ? `&fromBranch=${branchId}` : ""}`
|
|
15563
|
+
});
|
|
15564
|
+
const data = res.data;
|
|
15565
|
+
reset({
|
|
15566
|
+
...data,
|
|
15567
|
+
wallet: data?.toWalletData?._id || data?.fromWalletData?._id
|
|
15568
|
+
});
|
|
15569
|
+
setRef(data?.ref);
|
|
15570
|
+
} catch (error) {
|
|
15571
|
+
import_antd32.message.error(error?.message || "Something went wrong");
|
|
15572
|
+
navigate(-1);
|
|
15573
|
+
}
|
|
15574
|
+
};
|
|
15575
|
+
(0, import_react61.useEffect)(() => {
|
|
15576
|
+
if (isEdit) {
|
|
15577
|
+
fetches();
|
|
15578
|
+
}
|
|
15579
|
+
}, [id]);
|
|
15580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
15581
|
+
Card,
|
|
15582
|
+
{
|
|
15583
|
+
className: "max-w-4xl mx-auto mt-10 relative",
|
|
15584
|
+
isLoading: isLoadingGet,
|
|
15585
|
+
loadingText: "Processing...",
|
|
15586
|
+
children: [
|
|
15587
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Card.Header, { children: [
|
|
15588
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Wallet Adjustment` }),
|
|
15589
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Card.Description, { children: isEdit ? `Update the details for this wallet adjustment` : `Adjust the balance of a specific wallet` })
|
|
15590
|
+
] }),
|
|
15591
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
15592
|
+
"form",
|
|
15593
|
+
{
|
|
15594
|
+
className: "space-y-4",
|
|
15595
|
+
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
15596
|
+
children: [
|
|
15597
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
15598
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
15599
|
+
Feilds_default2.Wallet,
|
|
15600
|
+
{
|
|
15601
|
+
label: "Wallet",
|
|
15602
|
+
form: methods,
|
|
15603
|
+
name: "wallet",
|
|
15604
|
+
placeholder: "Select wallet...",
|
|
15605
|
+
required: true,
|
|
15606
|
+
showBalance: true,
|
|
15607
|
+
obj: "walletObject"
|
|
15608
|
+
}
|
|
15609
|
+
),
|
|
15610
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
15611
|
+
Fields_default.DateInput,
|
|
15612
|
+
{
|
|
15613
|
+
label: "Date",
|
|
15614
|
+
form: methods,
|
|
15615
|
+
name: "date",
|
|
15616
|
+
required: true
|
|
15617
|
+
}
|
|
15618
|
+
)
|
|
15619
|
+
] }),
|
|
15620
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
15621
|
+
Fields_default.Input,
|
|
15622
|
+
{
|
|
15623
|
+
label: "Description",
|
|
15624
|
+
form: methods,
|
|
15625
|
+
name: "description",
|
|
15626
|
+
placeholder: "Enter description...",
|
|
15627
|
+
required: true
|
|
15628
|
+
}
|
|
15629
|
+
),
|
|
15630
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
15631
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
15632
|
+
Fields_default.Select,
|
|
15633
|
+
{
|
|
15634
|
+
label: "Action",
|
|
15635
|
+
form: methods,
|
|
15636
|
+
name: "action",
|
|
15637
|
+
required: true,
|
|
15638
|
+
options: [
|
|
15639
|
+
{ label: "Credit", value: "credit" },
|
|
15640
|
+
{ label: "Debit", value: "debit" }
|
|
15641
|
+
]
|
|
15642
|
+
}
|
|
15643
|
+
),
|
|
15644
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
15645
|
+
Fields_default.Input,
|
|
15646
|
+
{
|
|
15647
|
+
label: "Amount",
|
|
15648
|
+
form: methods,
|
|
15649
|
+
name: "amount",
|
|
15650
|
+
type: "number",
|
|
15651
|
+
placeholder: "0.00",
|
|
15652
|
+
required: true
|
|
15653
|
+
}
|
|
15654
|
+
)
|
|
15655
|
+
] }),
|
|
15656
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
15657
|
+
Fields_default.Textarea,
|
|
15658
|
+
{
|
|
15659
|
+
label: "Note",
|
|
15660
|
+
form: methods,
|
|
15661
|
+
name: "note",
|
|
15662
|
+
placeholder: "Add any additional notes here..."
|
|
15663
|
+
}
|
|
15664
|
+
),
|
|
15665
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
15666
|
+
Button,
|
|
15667
|
+
{
|
|
15668
|
+
isLoading,
|
|
15669
|
+
disabled: isLoading,
|
|
15670
|
+
type: "submit",
|
|
15671
|
+
className: "min-w-[100px]",
|
|
15672
|
+
variant: !isEdit ? "primary" : "warning",
|
|
15673
|
+
children: isEdit ? "Update" : "Add"
|
|
15674
|
+
}
|
|
15675
|
+
) })
|
|
15676
|
+
]
|
|
15677
|
+
}
|
|
15678
|
+
) })
|
|
15679
|
+
]
|
|
15680
|
+
}
|
|
15681
|
+
);
|
|
15682
|
+
}
|
|
15683
|
+
var WalletAdjustmentForm_default = WalletAdjustmentForm;
|
|
15161
15684
|
// Annotate the CommonJS export names for ESM import in node:
|
|
15162
15685
|
0 && (module.exports = {
|
|
15163
15686
|
AccountFields,
|
|
@@ -15244,6 +15767,8 @@ var Statements_default2 = WalletStatements;
|
|
|
15244
15767
|
UserProfile,
|
|
15245
15768
|
Users,
|
|
15246
15769
|
Views,
|
|
15770
|
+
WalletAdjustmentForm,
|
|
15771
|
+
WalletAdjustments,
|
|
15247
15772
|
WalletField,
|
|
15248
15773
|
WalletForm,
|
|
15249
15774
|
WalletReport,
|
|
@@ -15282,5 +15807,6 @@ var Statements_default2 = WalletStatements;
|
|
|
15282
15807
|
useTheme,
|
|
15283
15808
|
useTransaction,
|
|
15284
15809
|
useWarqadConfig,
|
|
15285
|
-
verifyUserEmailSchema
|
|
15810
|
+
verifyUserEmailSchema,
|
|
15811
|
+
walletAdjustmentSchema
|
|
15286
15812
|
});
|