warqadui 0.0.104 → 0.0.105
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 +52 -7
- package/dist/index.d.ts +52 -7
- package/dist/index.js +1332 -699
- package/dist/index.mjs +1323 -684
- package/dist/styles.js +27 -0
- package/dist/styles.mjs +27 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -309,7 +309,7 @@ var Enums = {
|
|
|
309
309
|
verificationTypes: ["email_verification", "password_reset"],
|
|
310
310
|
auditActions: ["create", "update", "delete", "login", "logout"],
|
|
311
311
|
walletTypes: ["bank", "cash", "mobile"],
|
|
312
|
-
currencies: ["USD", "TZS", "KES", "
|
|
312
|
+
currencies: ["USD", "TZS", "KES", "RMB"],
|
|
313
313
|
packTypes: ["pressure", "bag", "boxes"],
|
|
314
314
|
journalTypes: ["journal"],
|
|
315
315
|
viaTypes: ["direct", "via account"],
|
|
@@ -319,7 +319,8 @@ var Enums = {
|
|
|
319
319
|
"payment",
|
|
320
320
|
"money transfer",
|
|
321
321
|
"expense",
|
|
322
|
-
"adjustment"
|
|
322
|
+
"adjustment",
|
|
323
|
+
"forex transfer"
|
|
323
324
|
]
|
|
324
325
|
};
|
|
325
326
|
var Enums_default = Enums;
|
|
@@ -1375,13 +1376,13 @@ var Input = forwardRef(
|
|
|
1375
1376
|
}
|
|
1376
1377
|
}
|
|
1377
1378
|
}, [props.value, name, form]);
|
|
1378
|
-
let
|
|
1379
|
+
let message31 = error;
|
|
1379
1380
|
if (form && name) {
|
|
1380
1381
|
const {
|
|
1381
1382
|
formState: { errors }
|
|
1382
1383
|
} = form;
|
|
1383
1384
|
const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
|
|
1384
|
-
|
|
1385
|
+
message31 = errorObj?.message;
|
|
1385
1386
|
}
|
|
1386
1387
|
const watchedValue = form?.watch(name);
|
|
1387
1388
|
useEffect7(() => {
|
|
@@ -1450,7 +1451,7 @@ var Input = forwardRef(
|
|
|
1450
1451
|
}
|
|
1451
1452
|
)
|
|
1452
1453
|
] }),
|
|
1453
|
-
|
|
1454
|
+
message31 && /* @__PURE__ */ jsx16("p", { className: "text-sm text-red-600 dark:text-red-400", children: message31 })
|
|
1454
1455
|
]
|
|
1455
1456
|
}
|
|
1456
1457
|
);
|
|
@@ -1786,7 +1787,7 @@ var PhoneInput = forwardRef2(
|
|
|
1786
1787
|
const [isFocused, setIsFocused] = useState12(false);
|
|
1787
1788
|
const { theme } = useWarqadConfig();
|
|
1788
1789
|
const primaryColor = theme?.primaryColor;
|
|
1789
|
-
let
|
|
1790
|
+
let message31 = error;
|
|
1790
1791
|
if (form && name) {
|
|
1791
1792
|
const {
|
|
1792
1793
|
formState: { errors }
|
|
@@ -1796,7 +1797,7 @@ var PhoneInput = forwardRef2(
|
|
|
1796
1797
|
for (const part of nameParts) {
|
|
1797
1798
|
currentError = currentError?.[part];
|
|
1798
1799
|
}
|
|
1799
|
-
|
|
1800
|
+
message31 = currentError?.message || message31;
|
|
1800
1801
|
}
|
|
1801
1802
|
const renderInput = (onChangeHandler, currentValue) => /* @__PURE__ */ jsxs15("div", { className: `space-y-2 group relative ${containerClassName}`, children: [
|
|
1802
1803
|
/* @__PURE__ */ jsxs15(
|
|
@@ -1847,7 +1848,7 @@ var PhoneInput = forwardRef2(
|
|
|
1847
1848
|
}
|
|
1848
1849
|
)
|
|
1849
1850
|
] }),
|
|
1850
|
-
|
|
1851
|
+
message31 && /* @__PURE__ */ jsx20("p", { className: "text-sm text-red-600 dark:text-red-400", children: message31 })
|
|
1851
1852
|
] });
|
|
1852
1853
|
if (form && name) {
|
|
1853
1854
|
return /* @__PURE__ */ jsx20(
|
|
@@ -2028,7 +2029,7 @@ var SelectRoot = ({
|
|
|
2028
2029
|
document.addEventListener("mousedown", handleClickOutside);
|
|
2029
2030
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2030
2031
|
}, [fieldInternalProps]);
|
|
2031
|
-
let
|
|
2032
|
+
let message31 = error;
|
|
2032
2033
|
if (form && name) {
|
|
2033
2034
|
const {
|
|
2034
2035
|
formState: { errors }
|
|
@@ -2038,7 +2039,7 @@ var SelectRoot = ({
|
|
|
2038
2039
|
for (const part of nameParts) {
|
|
2039
2040
|
currentError = currentError?.[part];
|
|
2040
2041
|
}
|
|
2041
|
-
|
|
2042
|
+
message31 = currentError?.message || message31;
|
|
2042
2043
|
}
|
|
2043
2044
|
const allOptions = initialOptions?.length ? initialOptions : registeredOptions;
|
|
2044
2045
|
const valueCtx = {
|
|
@@ -2099,7 +2100,7 @@ var SelectRoot = ({
|
|
|
2099
2100
|
String(opt.value) || index
|
|
2100
2101
|
)) })
|
|
2101
2102
|
] }),
|
|
2102
|
-
|
|
2103
|
+
message31 && /* @__PURE__ */ jsx21("p", { className: "text-sm text-red-600 dark:text-red-400", children: message31 })
|
|
2103
2104
|
]
|
|
2104
2105
|
}
|
|
2105
2106
|
) });
|
|
@@ -2337,13 +2338,13 @@ var Textarea = forwardRef4(
|
|
|
2337
2338
|
const [isFocused, setIsFocused] = useState14(false);
|
|
2338
2339
|
const { theme } = useWarqadConfig();
|
|
2339
2340
|
const primaryColor = theme?.primaryColor;
|
|
2340
|
-
let
|
|
2341
|
+
let message31 = error;
|
|
2341
2342
|
if (form && name) {
|
|
2342
2343
|
const {
|
|
2343
2344
|
formState: { errors }
|
|
2344
2345
|
} = form;
|
|
2345
2346
|
const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
|
|
2346
|
-
|
|
2347
|
+
message31 = errorObj?.message;
|
|
2347
2348
|
}
|
|
2348
2349
|
const renderInput = (inputProps, ref2) => /* @__PURE__ */ jsxs17("div", { className: `space-y-2 group w-full! relative ${containerClassName}`, children: [
|
|
2349
2350
|
/* @__PURE__ */ jsxs17(
|
|
@@ -2381,7 +2382,7 @@ var Textarea = forwardRef4(
|
|
|
2381
2382
|
}
|
|
2382
2383
|
}
|
|
2383
2384
|
) }),
|
|
2384
|
-
|
|
2385
|
+
message31 && /* @__PURE__ */ jsx22("p", { className: "text-sm text-red-600 dark:text-red-400", children: message31 })
|
|
2385
2386
|
] });
|
|
2386
2387
|
useEffect9(() => {
|
|
2387
2388
|
if (form && name && props.value !== void 0 && props.value !== null && props.value !== "") {
|
|
@@ -2707,7 +2708,7 @@ var SearchApiRoot = ({
|
|
|
2707
2708
|
const filteredOptions = options3.filter(
|
|
2708
2709
|
(option) => !filter.includes(getOptionValue(option))
|
|
2709
2710
|
);
|
|
2710
|
-
let
|
|
2711
|
+
let message31 = error || errorMessage;
|
|
2711
2712
|
if (form && name) {
|
|
2712
2713
|
const {
|
|
2713
2714
|
formState: { errors }
|
|
@@ -2717,7 +2718,7 @@ var SearchApiRoot = ({
|
|
|
2717
2718
|
for (const part of nameParts) {
|
|
2718
2719
|
currentError = currentError?.[part];
|
|
2719
2720
|
}
|
|
2720
|
-
|
|
2721
|
+
message31 = currentError?.message || message31;
|
|
2721
2722
|
}
|
|
2722
2723
|
const valueCtx = {
|
|
2723
2724
|
isOpen,
|
|
@@ -2751,7 +2752,7 @@ var SearchApiRoot = ({
|
|
|
2751
2752
|
form,
|
|
2752
2753
|
name,
|
|
2753
2754
|
obj,
|
|
2754
|
-
error:
|
|
2755
|
+
error: message31,
|
|
2755
2756
|
onSelect,
|
|
2756
2757
|
onClear
|
|
2757
2758
|
};
|
|
@@ -3120,19 +3121,19 @@ var DateInput = forwardRef6(
|
|
|
3120
3121
|
const { theme } = useWarqadConfig();
|
|
3121
3122
|
const primaryColor = theme?.primaryColor;
|
|
3122
3123
|
const [isFocused, setIsFocused] = useState16(false);
|
|
3123
|
-
let
|
|
3124
|
+
let message31 = error;
|
|
3124
3125
|
if (form && name) {
|
|
3125
3126
|
const {
|
|
3126
3127
|
formState: { errors }
|
|
3127
3128
|
} = form;
|
|
3128
3129
|
const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
|
|
3129
|
-
|
|
3130
|
+
message31 = errorObj?.message;
|
|
3130
3131
|
}
|
|
3131
3132
|
const inputStyles = `w-full px-2.5 py-1 rounded-md border! shadow-none transition-all! duration-200! outline-none!
|
|
3132
3133
|
bg-white! dark:bg-zinc-900!
|
|
3133
3134
|
text-gray-900! dark:text-zinc-100!
|
|
3134
3135
|
hover:bg-white! dark:hover:bg-zinc-900!
|
|
3135
|
-
${
|
|
3136
|
+
${message31 ? "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"}
|
|
3136
3137
|
[&.ant-picker-focused]:bg-white dark:[&.ant-picker-focused]:bg-zinc-900
|
|
3137
3138
|
${className}`;
|
|
3138
3139
|
const renderDatePicker = (val, changeHandler, blurHandler, refProps) => {
|
|
@@ -3155,8 +3156,8 @@ var DateInput = forwardRef6(
|
|
|
3155
3156
|
needConfirm: false,
|
|
3156
3157
|
style: {
|
|
3157
3158
|
height: "var(--input-height, 40px)",
|
|
3158
|
-
borderColor: isFocused && !
|
|
3159
|
-
boxShadow: isFocused && !
|
|
3159
|
+
borderColor: isFocused && !message31 ? primaryColor : void 0,
|
|
3160
|
+
boxShadow: isFocused && !message31 ? `${primaryColor}33 0px 0px 0px 2px` : void 0
|
|
3160
3161
|
},
|
|
3161
3162
|
classNames: { popup: { root: "z-50" } },
|
|
3162
3163
|
suffixIcon: /* @__PURE__ */ jsx24(
|
|
@@ -3186,7 +3187,7 @@ var DateInput = forwardRef6(
|
|
|
3186
3187
|
{
|
|
3187
3188
|
className: "block text-xs font-medium transition-colors duration-200",
|
|
3188
3189
|
style: {
|
|
3189
|
-
color:
|
|
3190
|
+
color: message31 ? "#ef4444" : isFocused ? primaryColor : void 0
|
|
3190
3191
|
},
|
|
3191
3192
|
children: [
|
|
3192
3193
|
label,
|
|
@@ -3207,7 +3208,7 @@ var DateInput = forwardRef6(
|
|
|
3207
3208
|
)
|
|
3208
3209
|
}
|
|
3209
3210
|
) : renderDatePicker(value, onChange, onBlur, ref),
|
|
3210
|
-
|
|
3211
|
+
message31 && /* @__PURE__ */ jsx24("p", { className: "text-sm text-red-600 dark:text-red-400", children: message31 })
|
|
3211
3212
|
] });
|
|
3212
3213
|
}
|
|
3213
3214
|
);
|
|
@@ -7770,17 +7771,17 @@ var preWarningFns = [];
|
|
|
7770
7771
|
var preMessage = (fn) => {
|
|
7771
7772
|
preWarningFns.push(fn);
|
|
7772
7773
|
};
|
|
7773
|
-
function warning(valid,
|
|
7774
|
+
function warning(valid, message31) {
|
|
7774
7775
|
if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
|
|
7775
|
-
const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "warning"),
|
|
7776
|
+
const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "warning"), message31);
|
|
7776
7777
|
if (finalMessage) {
|
|
7777
7778
|
console.error(`Warning: ${finalMessage}`);
|
|
7778
7779
|
}
|
|
7779
7780
|
}
|
|
7780
7781
|
}
|
|
7781
|
-
function note(valid,
|
|
7782
|
+
function note(valid, message31) {
|
|
7782
7783
|
if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
|
|
7783
|
-
const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "note"),
|
|
7784
|
+
const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "note"), message31);
|
|
7784
7785
|
if (finalMessage) {
|
|
7785
7786
|
console.warn(`Note: ${finalMessage}`);
|
|
7786
7787
|
}
|
|
@@ -7789,17 +7790,17 @@ function note(valid, message30) {
|
|
|
7789
7790
|
function resetWarned() {
|
|
7790
7791
|
warned = {};
|
|
7791
7792
|
}
|
|
7792
|
-
function call(method, valid,
|
|
7793
|
-
if (!valid && !warned[
|
|
7794
|
-
method(false,
|
|
7795
|
-
warned[
|
|
7793
|
+
function call(method, valid, message31) {
|
|
7794
|
+
if (!valid && !warned[message31]) {
|
|
7795
|
+
method(false, message31);
|
|
7796
|
+
warned[message31] = true;
|
|
7796
7797
|
}
|
|
7797
7798
|
}
|
|
7798
|
-
function warningOnce(valid,
|
|
7799
|
-
call(warning, valid,
|
|
7799
|
+
function warningOnce(valid, message31) {
|
|
7800
|
+
call(warning, valid, message31);
|
|
7800
7801
|
}
|
|
7801
|
-
function noteOnce(valid,
|
|
7802
|
-
call(note, valid,
|
|
7802
|
+
function noteOnce(valid, message31) {
|
|
7803
|
+
call(note, valid, message31);
|
|
7803
7804
|
}
|
|
7804
7805
|
warningOnce.preMessage = preMessage;
|
|
7805
7806
|
warningOnce.resetWarned = resetWarned;
|
|
@@ -7810,8 +7811,8 @@ import React19, { useContext as useContext5, useEffect as useEffect17 } from "re
|
|
|
7810
7811
|
function camelCase(input) {
|
|
7811
7812
|
return input.replace(/-(.)/g, (match, g) => g.toUpperCase());
|
|
7812
7813
|
}
|
|
7813
|
-
function warning2(valid,
|
|
7814
|
-
warningOnce(valid, `[@ant-design/icons] ${
|
|
7814
|
+
function warning2(valid, message31) {
|
|
7815
|
+
warningOnce(valid, `[@ant-design/icons] ${message31}`);
|
|
7815
7816
|
}
|
|
7816
7817
|
function isIconDefinition(target) {
|
|
7817
7818
|
return typeof target === "object" && typeof target.name === "string" && typeof target.theme === "string" && (typeof target.icon === "object" || typeof target.icon === "function");
|
|
@@ -9439,8 +9440,228 @@ function WalletAdjustmentView({
|
|
|
9439
9440
|
}
|
|
9440
9441
|
var WalletAdjustmentView_default = WalletAdjustmentView;
|
|
9441
9442
|
|
|
9443
|
+
// src/components/Views/TransactionViewComponents/ForexTransferView.tsx
|
|
9444
|
+
import {
|
|
9445
|
+
FileText as FileText6,
|
|
9446
|
+
Clock as Clock6,
|
|
9447
|
+
ArrowRight as ArrowRight3,
|
|
9448
|
+
AlertCircle as AlertCircle10,
|
|
9449
|
+
Calendar as Calendar5,
|
|
9450
|
+
User as User4,
|
|
9451
|
+
RefreshCw as RefreshCw4,
|
|
9452
|
+
Percent
|
|
9453
|
+
} from "lucide-react";
|
|
9454
|
+
import { Fragment as Fragment15, jsx as jsx47, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
9455
|
+
function ForexTransferView({
|
|
9456
|
+
data,
|
|
9457
|
+
isLoading
|
|
9458
|
+
}) {
|
|
9459
|
+
const Skeleton = ({ className }) => /* @__PURE__ */ jsx47(
|
|
9460
|
+
"div",
|
|
9461
|
+
{
|
|
9462
|
+
className: `animate-pulse bg-gray-200 dark:bg-zinc-800 rounded ${className}`
|
|
9463
|
+
}
|
|
9464
|
+
);
|
|
9465
|
+
const InfoSection = ({ title, icon: Icon2, children }) => /* @__PURE__ */ jsxs39("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: [
|
|
9466
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2 pb-3 border-b border-gray-50 dark:border-zinc-800/50", children: [
|
|
9467
|
+
/* @__PURE__ */ jsx47("div", { className: "p-1.5 bg-gray-50 dark:bg-zinc-800 rounded-lg text-gray-500 dark:text-zinc-400", children: /* @__PURE__ */ jsx47(Icon2, { size: 18 }) }),
|
|
9468
|
+
/* @__PURE__ */ jsx47("h3", { className: "font-semibold text-gray-900 dark:text-zinc-100", children: title })
|
|
9469
|
+
] }),
|
|
9470
|
+
/* @__PURE__ */ jsx47("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-5", children })
|
|
9471
|
+
] });
|
|
9472
|
+
const DataItem = ({
|
|
9473
|
+
label,
|
|
9474
|
+
value,
|
|
9475
|
+
subValue,
|
|
9476
|
+
className = "",
|
|
9477
|
+
isSkeleton
|
|
9478
|
+
}) => /* @__PURE__ */ jsxs39("div", { className: `space-y-1 ${className}`, children: [
|
|
9479
|
+
/* @__PURE__ */ jsx47("p", { className: "text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-widest", children: label }),
|
|
9480
|
+
/* @__PURE__ */ jsx47("div", { className: "flex flex-col gap-1.5", children: isSkeleton ? /* @__PURE__ */ jsxs39(Fragment15, { children: [
|
|
9481
|
+
/* @__PURE__ */ jsx47(Skeleton, { className: "h-4 w-3/4" }),
|
|
9482
|
+
/* @__PURE__ */ jsx47(Skeleton, { className: "h-3 w-1/2" })
|
|
9483
|
+
] }) : /* @__PURE__ */ jsxs39(Fragment15, { children: [
|
|
9484
|
+
/* @__PURE__ */ jsx47("p", { className: "text-sm font-semibold text-gray-800 dark:text-zinc-200", children: value || "---" }),
|
|
9485
|
+
subValue && /* @__PURE__ */ jsx47("p", { className: "text-[11px] text-gray-400 dark:text-zinc-500 font-medium", children: subValue })
|
|
9486
|
+
] }) })
|
|
9487
|
+
] });
|
|
9488
|
+
if (isLoading) {
|
|
9489
|
+
return /* @__PURE__ */ jsxs39("div", { className: "p-2 space-y-6", children: [
|
|
9490
|
+
/* @__PURE__ */ jsxs39("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: [
|
|
9491
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-5", children: [
|
|
9492
|
+
/* @__PURE__ */ jsx47(Skeleton, { className: "w-14 h-14 rounded-2xl" }),
|
|
9493
|
+
/* @__PURE__ */ jsxs39("div", { className: "space-y-3", children: [
|
|
9494
|
+
/* @__PURE__ */ jsx47(Skeleton, { className: "h-7 w-48" }),
|
|
9495
|
+
/* @__PURE__ */ jsx47(Skeleton, { className: "h-4 w-32" })
|
|
9496
|
+
] })
|
|
9497
|
+
] }),
|
|
9498
|
+
/* @__PURE__ */ jsxs39("div", { className: "text-right space-y-3", children: [
|
|
9499
|
+
/* @__PURE__ */ jsx47(Skeleton, { className: "h-8 w-40 ml-auto" }),
|
|
9500
|
+
/* @__PURE__ */ jsx47(Skeleton, { className: "h-4 w-20 ml-auto" })
|
|
9501
|
+
] })
|
|
9502
|
+
] }),
|
|
9503
|
+
/* @__PURE__ */ jsx47("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ jsxs39(
|
|
9504
|
+
InfoSection,
|
|
9505
|
+
{
|
|
9506
|
+
title: /* @__PURE__ */ jsx47(Skeleton, { className: "h-5 w-32" }),
|
|
9507
|
+
icon: FileText6,
|
|
9508
|
+
children: [
|
|
9509
|
+
/* @__PURE__ */ jsx47(DataItem, { isSkeleton: true, label: "Loading..." }),
|
|
9510
|
+
/* @__PURE__ */ jsx47(DataItem, { isSkeleton: true, label: "Loading..." })
|
|
9511
|
+
]
|
|
9512
|
+
},
|
|
9513
|
+
i
|
|
9514
|
+
)) })
|
|
9515
|
+
] });
|
|
9516
|
+
}
|
|
9517
|
+
if (!data) return null;
|
|
9518
|
+
return /* @__PURE__ */ jsxs39("div", { className: "p-2 space-y-6", children: [
|
|
9519
|
+
/* @__PURE__ */ jsxs39("div", { className: "relative overflow-hidden bg-white dark:bg-zinc-900 rounded-2xl border border-gray-100 dark:border-zinc-800", children: [
|
|
9520
|
+
/* @__PURE__ */ jsx47("div", { className: "absolute top-0 left-0 w-1.5 h-full bg-indigo-500" }),
|
|
9521
|
+
/* @__PURE__ */ jsxs39("div", { className: "p-6 flex flex-wrap items-center justify-between gap-6", children: [
|
|
9522
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-5", children: [
|
|
9523
|
+
/* @__PURE__ */ jsx47("div", { className: "p-4 rounded-2xl bg-indigo-50 text-indigo-600 dark:bg-indigo-500/10 dark:text-indigo-400", children: /* @__PURE__ */ jsx47(RefreshCw4, { size: 28, strokeWidth: 1.5 }) }),
|
|
9524
|
+
/* @__PURE__ */ jsxs39("div", { className: "space-y-1", children: [
|
|
9525
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-3", children: [
|
|
9526
|
+
/* @__PURE__ */ jsx47("h1", { className: "text-2xl font-black tracking-tight text-gray-900 dark:text-zinc-100", children: data.ref }),
|
|
9527
|
+
data.isDeleted && /* @__PURE__ */ jsxs39("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: [
|
|
9528
|
+
/* @__PURE__ */ jsx47(AlertCircle10, { size: 12 }),
|
|
9529
|
+
"REVERSED"
|
|
9530
|
+
] })
|
|
9531
|
+
] }),
|
|
9532
|
+
/* @__PURE__ */ jsx47("p", { className: "text-xs font-bold text-gray-500 dark:text-zinc-400 uppercase tracking-tight truncate max-w-md", children: data.description })
|
|
9533
|
+
] })
|
|
9534
|
+
] }),
|
|
9535
|
+
/* @__PURE__ */ jsxs39("div", { className: "text-right space-y-1", children: [
|
|
9536
|
+
/* @__PURE__ */ jsx47("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") }),
|
|
9537
|
+
/* @__PURE__ */ jsx47("p", { className: "text-xs font-black uppercase tracking-[0.2em] text-indigo-500", children: "Forex Transfer" })
|
|
9538
|
+
] })
|
|
9539
|
+
] })
|
|
9540
|
+
] }),
|
|
9541
|
+
/* @__PURE__ */ jsxs39("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
|
|
9542
|
+
/* @__PURE__ */ jsxs39(InfoSection, { title: "Transfer & Exchange", icon: RefreshCw4, children: [
|
|
9543
|
+
/* @__PURE__ */ jsx47(DataItem, { label: "Transaction Date", value: data.date }),
|
|
9544
|
+
/* @__PURE__ */ jsx47(DataItem, { label: "Reference ID", value: data.ref }),
|
|
9545
|
+
/* @__PURE__ */ jsx47(
|
|
9546
|
+
DataItem,
|
|
9547
|
+
{
|
|
9548
|
+
label: "Exchange Rate",
|
|
9549
|
+
value: data.exchange?.rate ? `1 ${data.exchange.currency} = ${data.exchange.rate} ${data.currency}` : "N/A",
|
|
9550
|
+
className: "col-span-full bg-indigo-50/50 dark:bg-indigo-500/5 p-3 rounded-lg border border-indigo-100 dark:border-indigo-500/20"
|
|
9551
|
+
}
|
|
9552
|
+
),
|
|
9553
|
+
/* @__PURE__ */ jsx47(
|
|
9554
|
+
DataItem,
|
|
9555
|
+
{
|
|
9556
|
+
label: "Original Amount",
|
|
9557
|
+
value: Formats_default.Price(data.amount, data.currency)
|
|
9558
|
+
}
|
|
9559
|
+
),
|
|
9560
|
+
/* @__PURE__ */ jsx47(
|
|
9561
|
+
DataItem,
|
|
9562
|
+
{
|
|
9563
|
+
label: "Exchanged Amount",
|
|
9564
|
+
value: data.exchange ? Formats_default.Price(data.exchange.amount, data.exchange.currency) : "N/A"
|
|
9565
|
+
}
|
|
9566
|
+
)
|
|
9567
|
+
] }),
|
|
9568
|
+
/* @__PURE__ */ jsxs39(InfoSection, { title: "Source & Destination", icon: ArrowRight3, children: [
|
|
9569
|
+
/* @__PURE__ */ jsx47(
|
|
9570
|
+
DataItem,
|
|
9571
|
+
{
|
|
9572
|
+
label: "From Wallet (Source)",
|
|
9573
|
+
value: data.fromWalletData?.name || "N/A",
|
|
9574
|
+
subValue: `Currency: ${data.fromWalletData?.currency || "N/A"}`
|
|
9575
|
+
}
|
|
9576
|
+
),
|
|
9577
|
+
/* @__PURE__ */ jsx47(
|
|
9578
|
+
DataItem,
|
|
9579
|
+
{
|
|
9580
|
+
label: "To Account (Destination)",
|
|
9581
|
+
value: data.accountData?.name || "N/A",
|
|
9582
|
+
subValue: `Currency: ${data.accountData?.currency || "N/A"}`
|
|
9583
|
+
}
|
|
9584
|
+
),
|
|
9585
|
+
/* @__PURE__ */ jsx47(
|
|
9586
|
+
DataItem,
|
|
9587
|
+
{
|
|
9588
|
+
label: "Wallet Account No.",
|
|
9589
|
+
value: data.fromWalletData?.accountNo || "---"
|
|
9590
|
+
}
|
|
9591
|
+
),
|
|
9592
|
+
/* @__PURE__ */ jsx47(
|
|
9593
|
+
DataItem,
|
|
9594
|
+
{
|
|
9595
|
+
label: "Destination Type",
|
|
9596
|
+
value: data.accountData?.type || "---",
|
|
9597
|
+
className: "capitalize"
|
|
9598
|
+
}
|
|
9599
|
+
)
|
|
9600
|
+
] }),
|
|
9601
|
+
/* @__PURE__ */ jsxs39(InfoSection, { title: "Fees & Calculations", icon: Percent, children: [
|
|
9602
|
+
/* @__PURE__ */ jsx47(
|
|
9603
|
+
DataItem,
|
|
9604
|
+
{
|
|
9605
|
+
label: "Fee (%)",
|
|
9606
|
+
value: data.fee ? `${data.fee}%` : "0%"
|
|
9607
|
+
}
|
|
9608
|
+
),
|
|
9609
|
+
/* @__PURE__ */ jsx47(
|
|
9610
|
+
DataItem,
|
|
9611
|
+
{
|
|
9612
|
+
label: "Fee Amount",
|
|
9613
|
+
value: data.feeAmount ? Formats_default.Price(
|
|
9614
|
+
data.feeAmount - (data.exchange?.amount || 0),
|
|
9615
|
+
data.exchange?.currency || data.currency
|
|
9616
|
+
) : Formats_default.Price(0, data.exchange?.currency || data.currency)
|
|
9617
|
+
}
|
|
9618
|
+
),
|
|
9619
|
+
/* @__PURE__ */ jsx47(
|
|
9620
|
+
DataItem,
|
|
9621
|
+
{
|
|
9622
|
+
label: "Total Amount (Inc. Fee)",
|
|
9623
|
+
value: data.feeAmount ? Formats_default.Price(data.feeAmount, data.exchange?.currency || data.currency) : Formats_default.Price(data.amount, data.currency),
|
|
9624
|
+
className: "col-span-full font-bold text-gray-900 dark:text-white bg-gray-50 dark:bg-white/5 p-3 rounded-lg"
|
|
9625
|
+
}
|
|
9626
|
+
)
|
|
9627
|
+
] }),
|
|
9628
|
+
/* @__PURE__ */ jsx47(InfoSection, { title: "Additional Information", icon: Calendar5, children: /* @__PURE__ */ jsx47(
|
|
9629
|
+
DataItem,
|
|
9630
|
+
{
|
|
9631
|
+
label: "Note",
|
|
9632
|
+
value: data.note || "No additional notes provided",
|
|
9633
|
+
className: "col-span-full"
|
|
9634
|
+
}
|
|
9635
|
+
) })
|
|
9636
|
+
] }),
|
|
9637
|
+
/* @__PURE__ */ jsxs39("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: [
|
|
9638
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex flex-wrap items-center gap-8", children: [
|
|
9639
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2.5", children: [
|
|
9640
|
+
/* @__PURE__ */ jsx47(Clock6, { size: 16, className: "text-gray-400 dark:text-zinc-500" }),
|
|
9641
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex flex-col", children: [
|
|
9642
|
+
/* @__PURE__ */ jsx47("span", { className: "text-[9px] font-bold text-gray-400 dark:text-zinc-500 uppercase", children: "Date Created" }),
|
|
9643
|
+
/* @__PURE__ */ jsx47("span", { className: "text-xs font-semibold text-gray-600 dark:text-zinc-300", children: data.createdAt ? new Date(data.createdAt).toLocaleString() : "---" })
|
|
9644
|
+
] })
|
|
9645
|
+
] }),
|
|
9646
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2.5", children: [
|
|
9647
|
+
/* @__PURE__ */ jsx47(User4, { size: 16, className: "text-gray-400 dark:text-zinc-500" }),
|
|
9648
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex flex-col", children: [
|
|
9649
|
+
/* @__PURE__ */ jsx47("span", { className: "text-[9px] font-bold text-gray-400 dark:text-zinc-500 uppercase", children: "Created By" }),
|
|
9650
|
+
/* @__PURE__ */ jsx47("span", { className: "text-xs font-semibold text-gray-600 dark:text-zinc-300", children: data.by?.name || "System" })
|
|
9651
|
+
] })
|
|
9652
|
+
] })
|
|
9653
|
+
] }),
|
|
9654
|
+
/* @__PURE__ */ jsx47("div", { className: "px-4 py-2 bg-gray-100 dark:bg-zinc-800 rounded-lg", children: /* @__PURE__ */ jsxs39("span", { className: "text-[10px] font-mono text-gray-500 dark:text-zinc-400 uppercase tracking-tighter", children: [
|
|
9655
|
+
"Transaction ID: ",
|
|
9656
|
+
/* @__PURE__ */ jsx47("span", { className: "font-bold", children: data._id })
|
|
9657
|
+
] }) })
|
|
9658
|
+
] })
|
|
9659
|
+
] });
|
|
9660
|
+
}
|
|
9661
|
+
var ForexTransferView_default = ForexTransferView;
|
|
9662
|
+
|
|
9442
9663
|
// src/components/Views/Transaction.tsx
|
|
9443
|
-
import { jsx as
|
|
9664
|
+
import { jsx as jsx48, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
9444
9665
|
var Transaction = ({
|
|
9445
9666
|
id,
|
|
9446
9667
|
type,
|
|
@@ -9488,35 +9709,35 @@ var Transaction = ({
|
|
|
9488
9709
|
value: h.ref
|
|
9489
9710
|
}));
|
|
9490
9711
|
}, [data?.history]);
|
|
9491
|
-
return /* @__PURE__ */
|
|
9712
|
+
return /* @__PURE__ */ jsxs40(
|
|
9492
9713
|
Modal,
|
|
9493
9714
|
{
|
|
9494
9715
|
isOpen: true,
|
|
9495
9716
|
onClose: close,
|
|
9496
|
-
title: /* @__PURE__ */
|
|
9497
|
-
/* @__PURE__ */
|
|
9498
|
-
/* @__PURE__ */
|
|
9717
|
+
title: /* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between w-full ", children: [
|
|
9718
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-3", children: [
|
|
9719
|
+
/* @__PURE__ */ jsxs40("span", { className: "capitalize", children: [
|
|
9499
9720
|
type,
|
|
9500
9721
|
" Transaction"
|
|
9501
9722
|
] }),
|
|
9502
|
-
!isLoading && data?.data?.ref && /* @__PURE__ */
|
|
9723
|
+
!isLoading && data?.data?.ref && /* @__PURE__ */ jsx48("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 })
|
|
9503
9724
|
] }),
|
|
9504
|
-
reverseable?.reload && /* @__PURE__ */
|
|
9505
|
-
!isLoading && data?.data && !data.data.isDeleted && /* @__PURE__ */
|
|
9725
|
+
reverseable?.reload && /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-4", children: [
|
|
9726
|
+
!isLoading && data?.data && !data.data.isDeleted && /* @__PURE__ */ jsx48(
|
|
9506
9727
|
Button2,
|
|
9507
9728
|
{
|
|
9508
9729
|
danger: true,
|
|
9509
9730
|
type: "primary",
|
|
9510
9731
|
size: "small",
|
|
9511
|
-
icon: /* @__PURE__ */
|
|
9732
|
+
icon: /* @__PURE__ */ jsx48(RotateCcw, { size: 14 }),
|
|
9512
9733
|
className: "flex items-center gap-1.5 font-bold uppercase text-[10px] px-3 transition-all hover:scale-105",
|
|
9513
9734
|
onClick: () => setShowReverseModal(true),
|
|
9514
9735
|
children: "Reverse Transaction"
|
|
9515
9736
|
}
|
|
9516
9737
|
),
|
|
9517
|
-
historyOptions.length > 1 && /* @__PURE__ */
|
|
9518
|
-
/* @__PURE__ */
|
|
9519
|
-
/* @__PURE__ */
|
|
9738
|
+
historyOptions.length > 1 && /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2", children: [
|
|
9739
|
+
/* @__PURE__ */ jsx48(HistoryIcon, { size: 14, className: "text-gray-400" }),
|
|
9740
|
+
/* @__PURE__ */ jsx48(
|
|
9520
9741
|
Select2,
|
|
9521
9742
|
{
|
|
9522
9743
|
value: data?.data?.ref,
|
|
@@ -9533,27 +9754,28 @@ var Transaction = ({
|
|
|
9533
9754
|
] }),
|
|
9534
9755
|
width: 1100,
|
|
9535
9756
|
children: [
|
|
9536
|
-
!type && /* @__PURE__ */
|
|
9537
|
-
type === "journal" && /* @__PURE__ */
|
|
9538
|
-
type === "payment" && /* @__PURE__ */
|
|
9539
|
-
type === "money transfer" && /* @__PURE__ */
|
|
9540
|
-
type === "expense" && /* @__PURE__ */
|
|
9541
|
-
type === "adjustment" && /* @__PURE__ */
|
|
9542
|
-
/* @__PURE__ */
|
|
9757
|
+
!type && /* @__PURE__ */ jsx48("div", { children: "No transaction type" }),
|
|
9758
|
+
type === "journal" && /* @__PURE__ */ jsx48(JournalView_default, { data: data?.data, isLoading }),
|
|
9759
|
+
type === "payment" && /* @__PURE__ */ jsx48(PaymentView_default, { data: data?.data, isLoading }),
|
|
9760
|
+
type === "money transfer" && /* @__PURE__ */ jsx48(MoneyTransfer_default, { data: data?.data, isLoading }),
|
|
9761
|
+
type === "expense" && /* @__PURE__ */ jsx48(ExpenseView_default, { data: data?.data, isLoading }),
|
|
9762
|
+
type === "adjustment" && /* @__PURE__ */ jsx48(WalletAdjustmentView_default, { data: data?.data, isLoading }),
|
|
9763
|
+
type === "forex transfer" && /* @__PURE__ */ jsx48(ForexTransferView_default, { data: data?.data, isLoading }),
|
|
9764
|
+
/* @__PURE__ */ jsx48(
|
|
9543
9765
|
ConfirmModal,
|
|
9544
9766
|
{
|
|
9545
9767
|
isOpen: showReverseModal,
|
|
9546
9768
|
isLoading: isActionLoading,
|
|
9547
9769
|
onClose: () => setShowReverseModal(false),
|
|
9548
9770
|
title: "Reverse Transaction",
|
|
9549
|
-
description: /* @__PURE__ */
|
|
9550
|
-
/* @__PURE__ */
|
|
9771
|
+
description: /* @__PURE__ */ jsxs40("div", { className: "space-y-3", children: [
|
|
9772
|
+
/* @__PURE__ */ jsxs40("p", { children: [
|
|
9551
9773
|
"Are you sure you want to reverse",
|
|
9552
9774
|
" ",
|
|
9553
|
-
/* @__PURE__ */
|
|
9775
|
+
/* @__PURE__ */ jsx48("span", { className: "font-bold text-red-600 underline", children: data?.data?.ref }),
|
|
9554
9776
|
"?"
|
|
9555
9777
|
] }),
|
|
9556
|
-
/* @__PURE__ */
|
|
9778
|
+
/* @__PURE__ */ jsx48("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."' })
|
|
9557
9779
|
] }),
|
|
9558
9780
|
confirmationWord: "reverse",
|
|
9559
9781
|
onSubmit: onReverse,
|
|
@@ -9677,7 +9899,7 @@ var useAuth = () => {
|
|
|
9677
9899
|
var useAuth_default = useAuth;
|
|
9678
9900
|
|
|
9679
9901
|
// src/components/Guard.tsx
|
|
9680
|
-
import { jsx as
|
|
9902
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
9681
9903
|
var Guard = () => {
|
|
9682
9904
|
const { get } = useApis_default();
|
|
9683
9905
|
const location = useLocation3();
|
|
@@ -9701,18 +9923,18 @@ var Guard = () => {
|
|
|
9701
9923
|
fetchProfile();
|
|
9702
9924
|
}, [location.pathname]);
|
|
9703
9925
|
if (!isFetched) {
|
|
9704
|
-
return /* @__PURE__ */
|
|
9926
|
+
return /* @__PURE__ */ jsx49("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ jsx49(LoadingSpin, { size: "lg" }) });
|
|
9705
9927
|
}
|
|
9706
|
-
return /* @__PURE__ */
|
|
9928
|
+
return /* @__PURE__ */ jsx49(Outlet, {});
|
|
9707
9929
|
};
|
|
9708
9930
|
var ProtectedRoute = () => {
|
|
9709
9931
|
const { isLoggedIn } = useAuth();
|
|
9710
9932
|
const location = useLocation3();
|
|
9711
|
-
return isLoggedIn ? /* @__PURE__ */
|
|
9933
|
+
return isLoggedIn ? /* @__PURE__ */ jsx49(Outlet, {}) : /* @__PURE__ */ jsx49(Navigate, { to: "/login", state: { from: location }, replace: true });
|
|
9712
9934
|
};
|
|
9713
9935
|
var UnProtectedRoute = () => {
|
|
9714
9936
|
const { isLoggedIn, user } = useAuth();
|
|
9715
|
-
return !isLoggedIn ? /* @__PURE__ */
|
|
9937
|
+
return !isLoggedIn ? /* @__PURE__ */ jsx49(Outlet, {}) : /* @__PURE__ */ jsx49(Navigate, { to: user?.homePath || "/", replace: true });
|
|
9716
9938
|
};
|
|
9717
9939
|
var AdminProtectedRoute = () => {
|
|
9718
9940
|
const { role } = useAuth();
|
|
@@ -9721,7 +9943,7 @@ var AdminProtectedRoute = () => {
|
|
|
9721
9943
|
message4.error("Only admin can access this page");
|
|
9722
9944
|
}
|
|
9723
9945
|
}, [role]);
|
|
9724
|
-
return role && ["admin"].includes(role) ? /* @__PURE__ */
|
|
9946
|
+
return role && ["admin"].includes(role) ? /* @__PURE__ */ jsx49(Outlet, {}) : /* @__PURE__ */ jsx49(Navigate, { to: "/", replace: true });
|
|
9725
9947
|
};
|
|
9726
9948
|
|
|
9727
9949
|
// src/components/accounts/Accounts.tsx
|
|
@@ -9729,7 +9951,7 @@ import { useNavigate as useNavigate4, useParams } from "react-router-dom";
|
|
|
9729
9951
|
import { Cable, EllipsisVertical, FilePenLine, Trash2 as Trash22 } from "lucide-react";
|
|
9730
9952
|
import { useState as useState27 } from "react";
|
|
9731
9953
|
import { message as message5 } from "antd";
|
|
9732
|
-
import { Fragment as
|
|
9954
|
+
import { Fragment as Fragment16, jsx as jsx50, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
9733
9955
|
function Accounts({ v, url }) {
|
|
9734
9956
|
const { enums } = useWarqadConfig();
|
|
9735
9957
|
const { branchId } = useParams();
|
|
@@ -9750,17 +9972,17 @@ function Accounts({ v, url }) {
|
|
|
9750
9972
|
const items = (data2) => [
|
|
9751
9973
|
{
|
|
9752
9974
|
label: `Edit ${type}`,
|
|
9753
|
-
icon: /* @__PURE__ */
|
|
9975
|
+
icon: /* @__PURE__ */ jsx50(FilePenLine, { size: 16 }),
|
|
9754
9976
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
9755
9977
|
},
|
|
9756
9978
|
{
|
|
9757
9979
|
label: `Delete ${type}`,
|
|
9758
|
-
icon: /* @__PURE__ */
|
|
9980
|
+
icon: /* @__PURE__ */ jsx50(Trash22, { className: "text-red-500", size: 16 }),
|
|
9759
9981
|
onClick: () => setDeleteAccount(data2)
|
|
9760
9982
|
},
|
|
9761
9983
|
isEmployee && !data2?.user && {
|
|
9762
9984
|
label: `Link User`,
|
|
9763
|
-
icon: /* @__PURE__ */
|
|
9985
|
+
icon: /* @__PURE__ */ jsx50(Cable, { size: 16 }),
|
|
9764
9986
|
onClick: () => navigate(`link-user?id=${data2?._id}`)
|
|
9765
9987
|
}
|
|
9766
9988
|
].filter(Boolean);
|
|
@@ -9770,7 +9992,7 @@ function Accounts({ v, url }) {
|
|
|
9770
9992
|
header: "Name",
|
|
9771
9993
|
cell: ({ row }) => {
|
|
9772
9994
|
const account = row.original;
|
|
9773
|
-
return /* @__PURE__ */
|
|
9995
|
+
return /* @__PURE__ */ jsx50(
|
|
9774
9996
|
"span",
|
|
9775
9997
|
{
|
|
9776
9998
|
onClick: () => navigate(`statements/${account?._id}`),
|
|
@@ -9785,7 +10007,7 @@ function Accounts({ v, url }) {
|
|
|
9785
10007
|
header: "Sex",
|
|
9786
10008
|
cell: ({ row }) => {
|
|
9787
10009
|
const account = row.original;
|
|
9788
|
-
return /* @__PURE__ */
|
|
10010
|
+
return /* @__PURE__ */ jsx50("span", { children: account?.sex || "N/A" });
|
|
9789
10011
|
}
|
|
9790
10012
|
},
|
|
9791
10013
|
{
|
|
@@ -9793,7 +10015,7 @@ function Accounts({ v, url }) {
|
|
|
9793
10015
|
header: "Email",
|
|
9794
10016
|
cell: ({ row }) => {
|
|
9795
10017
|
const account = row.original;
|
|
9796
|
-
return /* @__PURE__ */
|
|
10018
|
+
return /* @__PURE__ */ jsx50("span", { children: account?.email || "N/A" });
|
|
9797
10019
|
}
|
|
9798
10020
|
},
|
|
9799
10021
|
{
|
|
@@ -9801,7 +10023,7 @@ function Accounts({ v, url }) {
|
|
|
9801
10023
|
header: "Phone",
|
|
9802
10024
|
cell: ({ row }) => {
|
|
9803
10025
|
const account = row.original;
|
|
9804
|
-
return /* @__PURE__ */
|
|
10026
|
+
return /* @__PURE__ */ jsx50("span", { children: account?.phoneNumber || "N/A" });
|
|
9805
10027
|
}
|
|
9806
10028
|
},
|
|
9807
10029
|
isEmployee && {
|
|
@@ -9809,7 +10031,7 @@ function Accounts({ v, url }) {
|
|
|
9809
10031
|
header: "User",
|
|
9810
10032
|
cell: ({ row }) => {
|
|
9811
10033
|
const account = row.original;
|
|
9812
|
-
return /* @__PURE__ */
|
|
10034
|
+
return /* @__PURE__ */ jsx50(Badge, { variant: account?.user ? "success" : "danger", size: "sm", children: account?.user ? "Linked" : "Not Linked" });
|
|
9813
10035
|
}
|
|
9814
10036
|
},
|
|
9815
10037
|
{
|
|
@@ -9817,13 +10039,13 @@ function Accounts({ v, url }) {
|
|
|
9817
10039
|
header: "Actions",
|
|
9818
10040
|
cell: ({ row }) => {
|
|
9819
10041
|
const data2 = row.original;
|
|
9820
|
-
return /* @__PURE__ */
|
|
10042
|
+
return /* @__PURE__ */ jsx50(
|
|
9821
10043
|
Dropdown,
|
|
9822
10044
|
{
|
|
9823
10045
|
className: "cursor-pointer w-[150px]",
|
|
9824
10046
|
items: items(data2),
|
|
9825
10047
|
triggerMode: "hover",
|
|
9826
|
-
children: /* @__PURE__ */
|
|
10048
|
+
children: /* @__PURE__ */ jsx50(EllipsisVertical, {})
|
|
9827
10049
|
}
|
|
9828
10050
|
);
|
|
9829
10051
|
}
|
|
@@ -9841,9 +10063,9 @@ function Accounts({ v, url }) {
|
|
|
9841
10063
|
return error;
|
|
9842
10064
|
}
|
|
9843
10065
|
};
|
|
9844
|
-
return /* @__PURE__ */
|
|
9845
|
-
/* @__PURE__ */
|
|
9846
|
-
/* @__PURE__ */
|
|
10066
|
+
return /* @__PURE__ */ jsxs41(Fragment16, { children: [
|
|
10067
|
+
/* @__PURE__ */ jsx50(Modal2, {}),
|
|
10068
|
+
/* @__PURE__ */ jsx50(
|
|
9847
10069
|
ConfirmModal,
|
|
9848
10070
|
{
|
|
9849
10071
|
isOpen: !!deleteAccount,
|
|
@@ -9856,7 +10078,7 @@ function Accounts({ v, url }) {
|
|
|
9856
10078
|
children: null
|
|
9857
10079
|
}
|
|
9858
10080
|
),
|
|
9859
|
-
/* @__PURE__ */
|
|
10081
|
+
/* @__PURE__ */ jsx50(
|
|
9860
10082
|
TransactionViewComponent,
|
|
9861
10083
|
{
|
|
9862
10084
|
columns,
|
|
@@ -9917,7 +10139,7 @@ import { useEffect as useEffect21 } from "react";
|
|
|
9917
10139
|
|
|
9918
10140
|
// src/hooks/useAccountBalance.tsx
|
|
9919
10141
|
import { useEffect as useEffect20, useState as useState28 } from "react";
|
|
9920
|
-
import { jsx as
|
|
10142
|
+
import { jsx as jsx51, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
9921
10143
|
var useAccountbalance = ({
|
|
9922
10144
|
url,
|
|
9923
10145
|
showBalance,
|
|
@@ -9951,15 +10173,15 @@ var useAccountbalance = ({
|
|
|
9951
10173
|
return null;
|
|
9952
10174
|
}
|
|
9953
10175
|
if (isLoading) {
|
|
9954
|
-
return /* @__PURE__ */
|
|
10176
|
+
return /* @__PURE__ */ jsx51("h2", { className: "text-gray-500", children: "Getting Balance..." });
|
|
9955
10177
|
}
|
|
9956
10178
|
if (error) {
|
|
9957
|
-
return /* @__PURE__ */
|
|
10179
|
+
return /* @__PURE__ */ jsxs42("h2", { className: "text-red-500", children: [
|
|
9958
10180
|
"Error: ",
|
|
9959
10181
|
error
|
|
9960
10182
|
] });
|
|
9961
10183
|
}
|
|
9962
|
-
return /* @__PURE__ */
|
|
10184
|
+
return /* @__PURE__ */ jsxs42(
|
|
9963
10185
|
"h2",
|
|
9964
10186
|
{
|
|
9965
10187
|
className: `${balance.startsWith("-") ? "text-red-500" : "text-green-500"}`,
|
|
@@ -9976,7 +10198,7 @@ var useAccountBalance_default = useAccountbalance;
|
|
|
9976
10198
|
|
|
9977
10199
|
// src/components/accounts/Feilds/Account.tsx
|
|
9978
10200
|
import { useParams as useParams3 } from "react-router-dom";
|
|
9979
|
-
import { jsx as
|
|
10201
|
+
import { jsx as jsx52, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
9980
10202
|
function Account({
|
|
9981
10203
|
name,
|
|
9982
10204
|
label,
|
|
@@ -9998,8 +10220,8 @@ function Account({
|
|
|
9998
10220
|
showBalance,
|
|
9999
10221
|
accountId
|
|
10000
10222
|
});
|
|
10001
|
-
return /* @__PURE__ */
|
|
10002
|
-
/* @__PURE__ */
|
|
10223
|
+
return /* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-2", children: [
|
|
10224
|
+
/* @__PURE__ */ jsx52(
|
|
10003
10225
|
Fields_default.SearchApi,
|
|
10004
10226
|
{
|
|
10005
10227
|
name,
|
|
@@ -10017,13 +10239,13 @@ function Account({
|
|
|
10017
10239
|
obj
|
|
10018
10240
|
}
|
|
10019
10241
|
),
|
|
10020
|
-
/* @__PURE__ */
|
|
10242
|
+
/* @__PURE__ */ jsx52(BalanceView, {})
|
|
10021
10243
|
] });
|
|
10022
10244
|
}
|
|
10023
10245
|
var Account_default = Account;
|
|
10024
10246
|
|
|
10025
10247
|
// src/components/accounts/Feilds/Customers.tsx
|
|
10026
|
-
import { jsx as
|
|
10248
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
10027
10249
|
function Customer({
|
|
10028
10250
|
name = "customer",
|
|
10029
10251
|
label = "Customer",
|
|
@@ -10037,7 +10259,7 @@ function Customer({
|
|
|
10037
10259
|
v,
|
|
10038
10260
|
obj
|
|
10039
10261
|
}) {
|
|
10040
|
-
return /* @__PURE__ */
|
|
10262
|
+
return /* @__PURE__ */ jsx53(
|
|
10041
10263
|
Account_default,
|
|
10042
10264
|
{
|
|
10043
10265
|
name,
|
|
@@ -10057,7 +10279,7 @@ function Customer({
|
|
|
10057
10279
|
var Customers_default = Customer;
|
|
10058
10280
|
|
|
10059
10281
|
// src/components/accounts/Feilds/Employee.tsx
|
|
10060
|
-
import { jsx as
|
|
10282
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
10061
10283
|
function Employee({
|
|
10062
10284
|
name = "employee",
|
|
10063
10285
|
label = "Employee",
|
|
@@ -10071,7 +10293,7 @@ function Employee({
|
|
|
10071
10293
|
obj,
|
|
10072
10294
|
v
|
|
10073
10295
|
}) {
|
|
10074
|
-
return /* @__PURE__ */
|
|
10296
|
+
return /* @__PURE__ */ jsx54(
|
|
10075
10297
|
Account_default,
|
|
10076
10298
|
{
|
|
10077
10299
|
name,
|
|
@@ -10091,7 +10313,7 @@ function Employee({
|
|
|
10091
10313
|
var Employee_default = Employee;
|
|
10092
10314
|
|
|
10093
10315
|
// src/components/accounts/Feilds/Branches.tsx
|
|
10094
|
-
import { jsx as
|
|
10316
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
10095
10317
|
function Branches({
|
|
10096
10318
|
name = "branch",
|
|
10097
10319
|
label = "Branch",
|
|
@@ -10104,7 +10326,7 @@ function Branches({
|
|
|
10104
10326
|
v,
|
|
10105
10327
|
disabled
|
|
10106
10328
|
}) {
|
|
10107
|
-
return /* @__PURE__ */
|
|
10329
|
+
return /* @__PURE__ */ jsx55(
|
|
10108
10330
|
Account_default,
|
|
10109
10331
|
{
|
|
10110
10332
|
name,
|
|
@@ -10133,7 +10355,7 @@ var Feilds_default = AccountFields;
|
|
|
10133
10355
|
|
|
10134
10356
|
// src/components/accounts/AccountForm.tsx
|
|
10135
10357
|
import { useParams as useParams4 } from "react-router-dom";
|
|
10136
|
-
import { jsx as
|
|
10358
|
+
import { jsx as jsx56, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
10137
10359
|
function AccountForm() {
|
|
10138
10360
|
const { enums } = useWarqadConfig();
|
|
10139
10361
|
const { branchId } = useParams4();
|
|
@@ -10198,24 +10420,24 @@ function AccountForm() {
|
|
|
10198
10420
|
fetches();
|
|
10199
10421
|
}
|
|
10200
10422
|
}, [id]);
|
|
10201
|
-
return /* @__PURE__ */
|
|
10423
|
+
return /* @__PURE__ */ jsxs44(
|
|
10202
10424
|
Card,
|
|
10203
10425
|
{
|
|
10204
10426
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
10205
10427
|
isLoading: isLoadingGet,
|
|
10206
10428
|
loadingText: "Processing...",
|
|
10207
10429
|
children: [
|
|
10208
|
-
/* @__PURE__ */
|
|
10209
|
-
/* @__PURE__ */
|
|
10210
|
-
/* @__PURE__ */
|
|
10430
|
+
/* @__PURE__ */ jsxs44(Card.Header, { children: [
|
|
10431
|
+
/* @__PURE__ */ jsx56(Card.Title, { children: `${isEdit ? "Edit" : "Add"} ${type}` }),
|
|
10432
|
+
/* @__PURE__ */ jsx56(Card.Description, { children: isEdit ? `Update the details for this ${type}` : `Create a new ${type} and add it to your list` })
|
|
10211
10433
|
] }),
|
|
10212
|
-
/* @__PURE__ */
|
|
10434
|
+
/* @__PURE__ */ jsx56(Card.Content, { children: /* @__PURE__ */ jsxs44(
|
|
10213
10435
|
"form",
|
|
10214
10436
|
{
|
|
10215
10437
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
10216
10438
|
children: [
|
|
10217
|
-
/* @__PURE__ */
|
|
10218
|
-
/* @__PURE__ */
|
|
10439
|
+
/* @__PURE__ */ jsxs44("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
10440
|
+
/* @__PURE__ */ jsx56(
|
|
10219
10441
|
Fields_default.Input,
|
|
10220
10442
|
{
|
|
10221
10443
|
label: "Name",
|
|
@@ -10226,7 +10448,7 @@ function AccountForm() {
|
|
|
10226
10448
|
required: true
|
|
10227
10449
|
}
|
|
10228
10450
|
),
|
|
10229
|
-
/* @__PURE__ */
|
|
10451
|
+
/* @__PURE__ */ jsx56(
|
|
10230
10452
|
Fields_default.Select,
|
|
10231
10453
|
{
|
|
10232
10454
|
label: "Sex",
|
|
@@ -10235,7 +10457,7 @@ function AccountForm() {
|
|
|
10235
10457
|
enumName: "sex"
|
|
10236
10458
|
}
|
|
10237
10459
|
),
|
|
10238
|
-
/* @__PURE__ */
|
|
10460
|
+
/* @__PURE__ */ jsx56(
|
|
10239
10461
|
Fields_default.Input,
|
|
10240
10462
|
{
|
|
10241
10463
|
label: "Email",
|
|
@@ -10245,7 +10467,7 @@ function AccountForm() {
|
|
|
10245
10467
|
placeholder: "e.g maoo@exapmle.com"
|
|
10246
10468
|
}
|
|
10247
10469
|
),
|
|
10248
|
-
/* @__PURE__ */
|
|
10470
|
+
/* @__PURE__ */ jsx56(
|
|
10249
10471
|
Fields_default.PhoneInput,
|
|
10250
10472
|
{
|
|
10251
10473
|
label: "Phone Number",
|
|
@@ -10254,7 +10476,7 @@ function AccountForm() {
|
|
|
10254
10476
|
placeholder: "Enter phone number"
|
|
10255
10477
|
}
|
|
10256
10478
|
),
|
|
10257
|
-
!branchId && /* @__PURE__ */
|
|
10479
|
+
!branchId && /* @__PURE__ */ jsx56(
|
|
10258
10480
|
Feilds_default.Branches,
|
|
10259
10481
|
{
|
|
10260
10482
|
label: "Branch",
|
|
@@ -10264,7 +10486,7 @@ function AccountForm() {
|
|
|
10264
10486
|
api: "/branches/get?noStore=true"
|
|
10265
10487
|
}
|
|
10266
10488
|
),
|
|
10267
|
-
/* @__PURE__ */
|
|
10489
|
+
/* @__PURE__ */ jsx56(
|
|
10268
10490
|
Fields_default.Select,
|
|
10269
10491
|
{
|
|
10270
10492
|
label: "Currency",
|
|
@@ -10274,7 +10496,7 @@ function AccountForm() {
|
|
|
10274
10496
|
}
|
|
10275
10497
|
)
|
|
10276
10498
|
] }),
|
|
10277
|
-
/* @__PURE__ */
|
|
10499
|
+
/* @__PURE__ */ jsx56("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx56(
|
|
10278
10500
|
Button,
|
|
10279
10501
|
{
|
|
10280
10502
|
isLoading,
|
|
@@ -10333,7 +10555,7 @@ import { useForm as useForm3 } from "react-hook-form";
|
|
|
10333
10555
|
import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
|
|
10334
10556
|
import { message as message7 } from "antd";
|
|
10335
10557
|
import { useEffect as useEffect22 } from "react";
|
|
10336
|
-
import { jsx as
|
|
10558
|
+
import { jsx as jsx57, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
10337
10559
|
function LinkUser({ type: initialType = "employee" }) {
|
|
10338
10560
|
const { getQuery, navigate, getParams } = useApp_default();
|
|
10339
10561
|
const id = getQuery("id");
|
|
@@ -10389,26 +10611,26 @@ function LinkUser({ type: initialType = "employee" }) {
|
|
|
10389
10611
|
navigate(-1);
|
|
10390
10612
|
}
|
|
10391
10613
|
}, [id]);
|
|
10392
|
-
return /* @__PURE__ */
|
|
10614
|
+
return /* @__PURE__ */ jsxs45(
|
|
10393
10615
|
Card,
|
|
10394
10616
|
{
|
|
10395
10617
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
10396
10618
|
isLoading: isLoadingGet,
|
|
10397
10619
|
loadingText: "Processing...",
|
|
10398
10620
|
children: [
|
|
10399
|
-
/* @__PURE__ */
|
|
10400
|
-
/* @__PURE__ */
|
|
10401
|
-
/* @__PURE__ */
|
|
10621
|
+
/* @__PURE__ */ jsxs45(Card.Header, { children: [
|
|
10622
|
+
/* @__PURE__ */ jsx57(Card.Title, { children: `Link User ` }),
|
|
10623
|
+
/* @__PURE__ */ jsx57(Card.Description, { children: "Link User Employee and add it to your list" })
|
|
10402
10624
|
] }),
|
|
10403
|
-
/* @__PURE__ */
|
|
10625
|
+
/* @__PURE__ */ jsx57(Card.Content, { children: /* @__PURE__ */ jsxs45(
|
|
10404
10626
|
"form",
|
|
10405
10627
|
{
|
|
10406
10628
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
10407
10629
|
className: "space-y-4",
|
|
10408
10630
|
children: [
|
|
10409
|
-
/* @__PURE__ */
|
|
10631
|
+
/* @__PURE__ */ jsxs45("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
10410
10632
|
" ",
|
|
10411
|
-
/* @__PURE__ */
|
|
10633
|
+
/* @__PURE__ */ jsx57(
|
|
10412
10634
|
Fields_default.Input,
|
|
10413
10635
|
{
|
|
10414
10636
|
label: "Name",
|
|
@@ -10419,7 +10641,7 @@ function LinkUser({ type: initialType = "employee" }) {
|
|
|
10419
10641
|
disabled: true
|
|
10420
10642
|
}
|
|
10421
10643
|
),
|
|
10422
|
-
/* @__PURE__ */
|
|
10644
|
+
/* @__PURE__ */ jsx57(
|
|
10423
10645
|
Fields_default.Input,
|
|
10424
10646
|
{
|
|
10425
10647
|
label: "Email",
|
|
@@ -10430,7 +10652,7 @@ function LinkUser({ type: initialType = "employee" }) {
|
|
|
10430
10652
|
required: true
|
|
10431
10653
|
}
|
|
10432
10654
|
),
|
|
10433
|
-
/* @__PURE__ */
|
|
10655
|
+
/* @__PURE__ */ jsx57(
|
|
10434
10656
|
Fields_default.Select,
|
|
10435
10657
|
{
|
|
10436
10658
|
label: "Role",
|
|
@@ -10441,7 +10663,7 @@ function LinkUser({ type: initialType = "employee" }) {
|
|
|
10441
10663
|
}
|
|
10442
10664
|
)
|
|
10443
10665
|
] }),
|
|
10444
|
-
/* @__PURE__ */
|
|
10666
|
+
/* @__PURE__ */ jsx57("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx57(
|
|
10445
10667
|
Button,
|
|
10446
10668
|
{
|
|
10447
10669
|
isLoading,
|
|
@@ -10470,7 +10692,7 @@ import { useForm as useForm4 } from "react-hook-form";
|
|
|
10470
10692
|
import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
|
|
10471
10693
|
import { message as message8, Statistic } from "antd";
|
|
10472
10694
|
import { useState as useState29, useEffect as useEffect23 } from "react";
|
|
10473
|
-
import { jsx as
|
|
10695
|
+
import { jsx as jsx58, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
10474
10696
|
var { Countdown } = Statistic;
|
|
10475
10697
|
function VerifyEmailForm({
|
|
10476
10698
|
data,
|
|
@@ -10538,9 +10760,9 @@ function VerifyEmailForm({
|
|
|
10538
10760
|
message8.error(error?.message || "Something went wrong");
|
|
10539
10761
|
}
|
|
10540
10762
|
};
|
|
10541
|
-
return /* @__PURE__ */
|
|
10542
|
-
/* @__PURE__ */
|
|
10543
|
-
oldEmail && /* @__PURE__ */
|
|
10763
|
+
return /* @__PURE__ */ jsxs46("form", { onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)), children: [
|
|
10764
|
+
/* @__PURE__ */ jsxs46("div", { className: "space-y-2", children: [
|
|
10765
|
+
oldEmail && /* @__PURE__ */ jsx58("div", { className: "border-b-2 pb-2", children: /* @__PURE__ */ jsx58(
|
|
10544
10766
|
Fields_default.Input,
|
|
10545
10767
|
{
|
|
10546
10768
|
label: "Current Email",
|
|
@@ -10550,7 +10772,7 @@ function VerifyEmailForm({
|
|
|
10550
10772
|
disabled: true
|
|
10551
10773
|
}
|
|
10552
10774
|
) }),
|
|
10553
|
-
/* @__PURE__ */
|
|
10775
|
+
/* @__PURE__ */ jsx58(
|
|
10554
10776
|
Fields_default.Input,
|
|
10555
10777
|
{
|
|
10556
10778
|
label: "New Email",
|
|
@@ -10561,7 +10783,7 @@ function VerifyEmailForm({
|
|
|
10561
10783
|
disabled: true
|
|
10562
10784
|
}
|
|
10563
10785
|
),
|
|
10564
|
-
/* @__PURE__ */
|
|
10786
|
+
/* @__PURE__ */ jsx58(
|
|
10565
10787
|
Fields_default.Input,
|
|
10566
10788
|
{
|
|
10567
10789
|
label: "Token",
|
|
@@ -10572,19 +10794,19 @@ function VerifyEmailForm({
|
|
|
10572
10794
|
}
|
|
10573
10795
|
)
|
|
10574
10796
|
] }),
|
|
10575
|
-
/* @__PURE__ */
|
|
10576
|
-
/* @__PURE__ */
|
|
10797
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2 mt-2", children: [
|
|
10798
|
+
/* @__PURE__ */ jsxs46("h1", { className: "text-sm text-gray-600 dark:text-gray-400", children: [
|
|
10577
10799
|
"Didn't receive a verification token or expired?",
|
|
10578
10800
|
" "
|
|
10579
10801
|
] }),
|
|
10580
|
-
hasPassed || !threeMinutesLater ? /* @__PURE__ */
|
|
10802
|
+
hasPassed || !threeMinutesLater ? /* @__PURE__ */ jsx58(
|
|
10581
10803
|
"span",
|
|
10582
10804
|
{
|
|
10583
10805
|
onClick: resend,
|
|
10584
10806
|
className: "text-blue-600 cursor-pointer underline text-sm",
|
|
10585
10807
|
children: "Resend"
|
|
10586
10808
|
}
|
|
10587
|
-
) : /* @__PURE__ */
|
|
10809
|
+
) : /* @__PURE__ */ jsx58("span", { className: "text-blue-600 cursor-pointer underline text-sm", children: /* @__PURE__ */ jsx58(
|
|
10588
10810
|
Countdown,
|
|
10589
10811
|
{
|
|
10590
10812
|
styles: { content: { fontSize: 14, color: "#3b82f6" } },
|
|
@@ -10594,7 +10816,7 @@ function VerifyEmailForm({
|
|
|
10594
10816
|
threeMinutesLater
|
|
10595
10817
|
) })
|
|
10596
10818
|
] }),
|
|
10597
|
-
/* @__PURE__ */
|
|
10819
|
+
/* @__PURE__ */ jsx58("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx58(
|
|
10598
10820
|
Button,
|
|
10599
10821
|
{
|
|
10600
10822
|
isLoading,
|
|
@@ -10612,7 +10834,7 @@ var VerifyEmailForm_default = VerifyEmailForm;
|
|
|
10612
10834
|
import { useForm as useForm5 } from "react-hook-form";
|
|
10613
10835
|
import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
|
|
10614
10836
|
import { message as message9 } from "antd";
|
|
10615
|
-
import { jsx as
|
|
10837
|
+
import { jsx as jsx59, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
10616
10838
|
function UpdateEmailForm({
|
|
10617
10839
|
data,
|
|
10618
10840
|
close,
|
|
@@ -10645,9 +10867,9 @@ function UpdateEmailForm({
|
|
|
10645
10867
|
message9.error(error?.message || "Something went wrong");
|
|
10646
10868
|
}
|
|
10647
10869
|
};
|
|
10648
|
-
return /* @__PURE__ */
|
|
10649
|
-
/* @__PURE__ */
|
|
10650
|
-
/* @__PURE__ */
|
|
10870
|
+
return /* @__PURE__ */ jsxs47("form", { onSubmit: handleSubmit(onSubmit), children: [
|
|
10871
|
+
/* @__PURE__ */ jsxs47("div", { className: "space-y-4", children: [
|
|
10872
|
+
/* @__PURE__ */ jsx59(
|
|
10651
10873
|
Fields_default.Input,
|
|
10652
10874
|
{
|
|
10653
10875
|
label: "Current Email",
|
|
@@ -10656,7 +10878,7 @@ function UpdateEmailForm({
|
|
|
10656
10878
|
disabled: true
|
|
10657
10879
|
}
|
|
10658
10880
|
),
|
|
10659
|
-
/* @__PURE__ */
|
|
10881
|
+
/* @__PURE__ */ jsx59(
|
|
10660
10882
|
Fields_default.Input,
|
|
10661
10883
|
{
|
|
10662
10884
|
label: "New Email Address",
|
|
@@ -10667,10 +10889,10 @@ function UpdateEmailForm({
|
|
|
10667
10889
|
required: true
|
|
10668
10890
|
}
|
|
10669
10891
|
),
|
|
10670
|
-
/* @__PURE__ */
|
|
10892
|
+
/* @__PURE__ */ jsx59("div", { className: "bg-blue-50 dark:bg-blue-900/10 border-l-4 border-blue-400 p-3 rounded", children: /* @__PURE__ */ jsx59("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." }) })
|
|
10671
10893
|
] }),
|
|
10672
|
-
/* @__PURE__ */
|
|
10673
|
-
/* @__PURE__ */
|
|
10894
|
+
/* @__PURE__ */ jsxs47("footer", { className: "flex justify-end mt-6 gap-3", children: [
|
|
10895
|
+
/* @__PURE__ */ jsx59(
|
|
10674
10896
|
Button,
|
|
10675
10897
|
{
|
|
10676
10898
|
type: "button",
|
|
@@ -10680,7 +10902,7 @@ function UpdateEmailForm({
|
|
|
10680
10902
|
children: "Cancel"
|
|
10681
10903
|
}
|
|
10682
10904
|
),
|
|
10683
|
-
/* @__PURE__ */
|
|
10905
|
+
/* @__PURE__ */ jsx59(
|
|
10684
10906
|
Button,
|
|
10685
10907
|
{
|
|
10686
10908
|
isLoading,
|
|
@@ -10699,7 +10921,7 @@ var UpdateEmailForm_default = UpdateEmailForm;
|
|
|
10699
10921
|
import { useForm as useForm6 } from "react-hook-form";
|
|
10700
10922
|
import { message as message10, Statistic as Statistic2 } from "antd";
|
|
10701
10923
|
import { useState as useState30, useEffect as useEffect24 } from "react";
|
|
10702
|
-
import { jsx as
|
|
10924
|
+
import { jsx as jsx60, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
10703
10925
|
var { Countdown: Countdown2 } = Statistic2;
|
|
10704
10926
|
function ResetPasswordForm({
|
|
10705
10927
|
data,
|
|
@@ -10754,9 +10976,9 @@ function ResetPasswordForm({
|
|
|
10754
10976
|
message10.error(error?.message || "Something went wrong");
|
|
10755
10977
|
}
|
|
10756
10978
|
};
|
|
10757
|
-
return /* @__PURE__ */
|
|
10758
|
-
/* @__PURE__ */
|
|
10759
|
-
/* @__PURE__ */
|
|
10979
|
+
return /* @__PURE__ */ jsxs48("form", { onSubmit: handleSubmit(onSubmit), children: [
|
|
10980
|
+
/* @__PURE__ */ jsxs48("div", { className: "space-y-4", children: [
|
|
10981
|
+
/* @__PURE__ */ jsx60("div", { className: "border-b-2 pb-4 dark:border-zinc-800", children: /* @__PURE__ */ jsx60(
|
|
10760
10982
|
Fields_default.Input,
|
|
10761
10983
|
{
|
|
10762
10984
|
label: "Target Email",
|
|
@@ -10765,10 +10987,10 @@ function ResetPasswordForm({
|
|
|
10765
10987
|
disabled: true
|
|
10766
10988
|
}
|
|
10767
10989
|
) }),
|
|
10768
|
-
/* @__PURE__ */
|
|
10769
|
-
!hasPassed && threeMinutesLater && /* @__PURE__ */
|
|
10770
|
-
/* @__PURE__ */
|
|
10771
|
-
/* @__PURE__ */
|
|
10990
|
+
/* @__PURE__ */ jsx60("div", { className: "bg-orange-50 dark:bg-orange-900/10 border-l-4 border-orange-400 p-4 rounded-xl", children: /* @__PURE__ */ jsx60("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." }) }),
|
|
10991
|
+
!hasPassed && threeMinutesLater && /* @__PURE__ */ jsxs48("div", { className: "flex items-center gap-2 mt-2 bg-blue-50 dark:bg-blue-900/10 p-2 rounded-lg", children: [
|
|
10992
|
+
/* @__PURE__ */ jsx60("p", { className: "text-xs text-blue-600 dark:text-blue-400 font-medium", children: "You can request another link in:" }),
|
|
10993
|
+
/* @__PURE__ */ jsx60("span", { className: "text-blue-600 font-bold text-xs", children: /* @__PURE__ */ jsx60(
|
|
10772
10994
|
Countdown2,
|
|
10773
10995
|
{
|
|
10774
10996
|
styles: { content: { fontSize: 12, color: "#3b82f6" } },
|
|
@@ -10779,8 +11001,8 @@ function ResetPasswordForm({
|
|
|
10779
11001
|
) })
|
|
10780
11002
|
] })
|
|
10781
11003
|
] }),
|
|
10782
|
-
/* @__PURE__ */
|
|
10783
|
-
/* @__PURE__ */
|
|
11004
|
+
/* @__PURE__ */ jsxs48("footer", { className: "flex justify-end mt-8 gap-3", children: [
|
|
11005
|
+
/* @__PURE__ */ jsx60(
|
|
10784
11006
|
Button,
|
|
10785
11007
|
{
|
|
10786
11008
|
type: "button",
|
|
@@ -10790,7 +11012,7 @@ function ResetPasswordForm({
|
|
|
10790
11012
|
children: "Cancel"
|
|
10791
11013
|
}
|
|
10792
11014
|
),
|
|
10793
|
-
/* @__PURE__ */
|
|
11015
|
+
/* @__PURE__ */ jsx60(
|
|
10794
11016
|
Button,
|
|
10795
11017
|
{
|
|
10796
11018
|
isLoading,
|
|
@@ -10808,11 +11030,11 @@ var ResetPasswordForm_default = ResetPasswordForm;
|
|
|
10808
11030
|
// src/components/users/Activate.tsx
|
|
10809
11031
|
import { message as message11, Switch } from "antd";
|
|
10810
11032
|
import { useState as useState31 } from "react";
|
|
10811
|
-
import { Fragment as
|
|
11033
|
+
import { Fragment as Fragment17, jsx as jsx61 } from "react/jsx-runtime";
|
|
10812
11034
|
var ActivateUser = ({ data }) => {
|
|
10813
11035
|
const [checked, setChecked] = useState31(data?.isActive);
|
|
10814
11036
|
const { put, isLoading } = useApis_default();
|
|
10815
|
-
return /* @__PURE__ */
|
|
11037
|
+
return /* @__PURE__ */ jsx61(Fragment17, { children: /* @__PURE__ */ jsx61(
|
|
10816
11038
|
Switch,
|
|
10817
11039
|
{
|
|
10818
11040
|
onChange: async (e) => {
|
|
@@ -10840,7 +11062,7 @@ var Activate_default = ActivateUser;
|
|
|
10840
11062
|
|
|
10841
11063
|
// src/components/users/users.tsx
|
|
10842
11064
|
import { useNavigate as useNavigate6 } from "react-router-dom";
|
|
10843
|
-
import { Fragment as
|
|
11065
|
+
import { Fragment as Fragment18, jsx as jsx62, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
10844
11066
|
function Users() {
|
|
10845
11067
|
const navigate = useNavigate6();
|
|
10846
11068
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -10852,11 +11074,11 @@ function Users() {
|
|
|
10852
11074
|
const items = (data2) => [
|
|
10853
11075
|
{
|
|
10854
11076
|
label: `Reset Password`,
|
|
10855
|
-
icon: /* @__PURE__ */
|
|
11077
|
+
icon: /* @__PURE__ */ jsx62(Key, { size: 16 }),
|
|
10856
11078
|
onClick: () => openState({
|
|
10857
11079
|
title: "Request Password Reset",
|
|
10858
11080
|
type: "form",
|
|
10859
|
-
content: /* @__PURE__ */
|
|
11081
|
+
content: /* @__PURE__ */ jsx62(
|
|
10860
11082
|
ResetPasswordForm_default,
|
|
10861
11083
|
{
|
|
10862
11084
|
data: data2,
|
|
@@ -10869,11 +11091,11 @@ function Users() {
|
|
|
10869
11091
|
},
|
|
10870
11092
|
{
|
|
10871
11093
|
label: `Update Email`,
|
|
10872
|
-
icon: /* @__PURE__ */
|
|
11094
|
+
icon: /* @__PURE__ */ jsx62(Mail2, { size: 16 }),
|
|
10873
11095
|
onClick: () => openState({
|
|
10874
11096
|
title: "Update Email Address",
|
|
10875
11097
|
type: "form",
|
|
10876
|
-
content: /* @__PURE__ */
|
|
11098
|
+
content: /* @__PURE__ */ jsx62(
|
|
10877
11099
|
UpdateEmailForm_default,
|
|
10878
11100
|
{
|
|
10879
11101
|
data: data2,
|
|
@@ -10886,11 +11108,11 @@ function Users() {
|
|
|
10886
11108
|
},
|
|
10887
11109
|
data2?.emailVerification && {
|
|
10888
11110
|
label: `Verify Email`,
|
|
10889
|
-
icon: /* @__PURE__ */
|
|
11111
|
+
icon: /* @__PURE__ */ jsx62(ShieldCheck, {}),
|
|
10890
11112
|
onClick: () => openState({
|
|
10891
11113
|
title: "Verify Email",
|
|
10892
11114
|
type: "form",
|
|
10893
|
-
content: /* @__PURE__ */
|
|
11115
|
+
content: /* @__PURE__ */ jsx62(
|
|
10894
11116
|
VerifyEmailForm_default,
|
|
10895
11117
|
{
|
|
10896
11118
|
data: data2,
|
|
@@ -10911,16 +11133,16 @@ function Users() {
|
|
|
10911
11133
|
const data2 = row.original;
|
|
10912
11134
|
const emailVerification = data2?.emailVerification;
|
|
10913
11135
|
const newEmail = emailVerification?.email !== data2?.email ? emailVerification?.email : null;
|
|
10914
|
-
return /* @__PURE__ */
|
|
10915
|
-
/* @__PURE__ */
|
|
11136
|
+
return /* @__PURE__ */ jsxs49("div", { className: "space-y-1", children: [
|
|
11137
|
+
/* @__PURE__ */ jsxs49("section", { className: "flex items-center gap-2", children: [
|
|
10916
11138
|
" ",
|
|
10917
|
-
/* @__PURE__ */
|
|
10918
|
-
data2?.isEmailVerified && /* @__PURE__ */
|
|
10919
|
-
!data2?.isEmailVerified && /* @__PURE__ */
|
|
11139
|
+
/* @__PURE__ */ jsx62("p", { children: data2?.email }),
|
|
11140
|
+
data2?.isEmailVerified && /* @__PURE__ */ jsx62(Badge, { variant: "success", size: "sm", children: "Verified" }),
|
|
11141
|
+
!data2?.isEmailVerified && /* @__PURE__ */ jsx62(Badge, { variant: "warning", size: "sm", children: "Not Verified" })
|
|
10920
11142
|
] }),
|
|
10921
|
-
newEmail && /* @__PURE__ */
|
|
10922
|
-
/* @__PURE__ */
|
|
10923
|
-
/* @__PURE__ */
|
|
11143
|
+
newEmail && /* @__PURE__ */ jsxs49("section", { className: "flex items-center gap-2", children: [
|
|
11144
|
+
/* @__PURE__ */ jsx62(Info, { size: 16, className: "text-orange-600" }),
|
|
11145
|
+
/* @__PURE__ */ jsx62("p", { children: newEmail })
|
|
10924
11146
|
] })
|
|
10925
11147
|
] });
|
|
10926
11148
|
}
|
|
@@ -10930,7 +11152,7 @@ function Users() {
|
|
|
10930
11152
|
header: "Role",
|
|
10931
11153
|
cell: ({ row }) => {
|
|
10932
11154
|
const data2 = row.original;
|
|
10933
|
-
return /* @__PURE__ */
|
|
11155
|
+
return /* @__PURE__ */ jsx62(
|
|
10934
11156
|
Badge,
|
|
10935
11157
|
{
|
|
10936
11158
|
variant: data2?.role === "admin" ? "primary" : "warning",
|
|
@@ -10945,7 +11167,7 @@ function Users() {
|
|
|
10945
11167
|
header: "Employee Name",
|
|
10946
11168
|
cell: ({ row }) => {
|
|
10947
11169
|
const account = row.original?.account;
|
|
10948
|
-
return /* @__PURE__ */
|
|
11170
|
+
return /* @__PURE__ */ jsx62("span", { children: account?.name || "N/A" });
|
|
10949
11171
|
}
|
|
10950
11172
|
},
|
|
10951
11173
|
{
|
|
@@ -10953,7 +11175,7 @@ function Users() {
|
|
|
10953
11175
|
header: "Status",
|
|
10954
11176
|
cell: ({ row }) => {
|
|
10955
11177
|
const data2 = row.original;
|
|
10956
|
-
return /* @__PURE__ */
|
|
11178
|
+
return /* @__PURE__ */ jsx62(Activate_default, { data: data2 });
|
|
10957
11179
|
}
|
|
10958
11180
|
},
|
|
10959
11181
|
{
|
|
@@ -10961,13 +11183,13 @@ function Users() {
|
|
|
10961
11183
|
header: "Actions",
|
|
10962
11184
|
cell: ({ row }) => {
|
|
10963
11185
|
const data2 = row.original;
|
|
10964
|
-
return /* @__PURE__ */
|
|
11186
|
+
return /* @__PURE__ */ jsx62(
|
|
10965
11187
|
Dropdown,
|
|
10966
11188
|
{
|
|
10967
11189
|
className: "w-fit! cursor-pointer",
|
|
10968
11190
|
items: items(data2),
|
|
10969
11191
|
triggerMode: "hover",
|
|
10970
|
-
children: /* @__PURE__ */
|
|
11192
|
+
children: /* @__PURE__ */ jsx62(EllipsisVertical2, {})
|
|
10971
11193
|
}
|
|
10972
11194
|
);
|
|
10973
11195
|
}
|
|
@@ -10976,9 +11198,9 @@ function Users() {
|
|
|
10976
11198
|
[items]
|
|
10977
11199
|
);
|
|
10978
11200
|
const users = data?.data || [];
|
|
10979
|
-
return /* @__PURE__ */
|
|
10980
|
-
/* @__PURE__ */
|
|
10981
|
-
/* @__PURE__ */
|
|
11201
|
+
return /* @__PURE__ */ jsxs49(Fragment18, { children: [
|
|
11202
|
+
/* @__PURE__ */ jsx62(Modal2, {}),
|
|
11203
|
+
/* @__PURE__ */ jsx62(
|
|
10982
11204
|
TransactionViewComponent,
|
|
10983
11205
|
{
|
|
10984
11206
|
columns,
|
|
@@ -10999,7 +11221,7 @@ var users_default = Users;
|
|
|
10999
11221
|
import { useForm as useForm7 } from "react-hook-form";
|
|
11000
11222
|
import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
|
|
11001
11223
|
import { message as message12 } from "antd";
|
|
11002
|
-
import { jsx as
|
|
11224
|
+
import { jsx as jsx63, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
11003
11225
|
function UserForm() {
|
|
11004
11226
|
const { navigate } = useApp_default();
|
|
11005
11227
|
const { post, isLoading } = useApis_default();
|
|
@@ -11024,14 +11246,14 @@ function UserForm() {
|
|
|
11024
11246
|
message12.error(error?.message || "Something went wrong");
|
|
11025
11247
|
}
|
|
11026
11248
|
};
|
|
11027
|
-
return /* @__PURE__ */
|
|
11028
|
-
/* @__PURE__ */
|
|
11029
|
-
/* @__PURE__ */
|
|
11030
|
-
/* @__PURE__ */
|
|
11249
|
+
return /* @__PURE__ */ jsxs50(Card, { className: "max-w-xl mx-auto mt-10 relative", children: [
|
|
11250
|
+
/* @__PURE__ */ jsxs50(Card.Header, { children: [
|
|
11251
|
+
/* @__PURE__ */ jsx63(Card.Title, { children: "Add User" }),
|
|
11252
|
+
/* @__PURE__ */ jsx63(Card.Description, { children: "Create a new user by providing their email and phone number." })
|
|
11031
11253
|
] }),
|
|
11032
|
-
/* @__PURE__ */
|
|
11033
|
-
/* @__PURE__ */
|
|
11034
|
-
/* @__PURE__ */
|
|
11254
|
+
/* @__PURE__ */ jsx63(Card.Content, { children: /* @__PURE__ */ jsxs50("form", { onSubmit: handleSubmit(onSubmit), children: [
|
|
11255
|
+
/* @__PURE__ */ jsxs50("div", { className: "space-y-4", children: [
|
|
11256
|
+
/* @__PURE__ */ jsx63(
|
|
11035
11257
|
Fields_default.Input,
|
|
11036
11258
|
{
|
|
11037
11259
|
label: "Email",
|
|
@@ -11042,7 +11264,7 @@ function UserForm() {
|
|
|
11042
11264
|
required: true
|
|
11043
11265
|
}
|
|
11044
11266
|
),
|
|
11045
|
-
/* @__PURE__ */
|
|
11267
|
+
/* @__PURE__ */ jsx63(
|
|
11046
11268
|
Fields_default.PhoneInput,
|
|
11047
11269
|
{
|
|
11048
11270
|
label: "Phone Number",
|
|
@@ -11051,7 +11273,7 @@ function UserForm() {
|
|
|
11051
11273
|
placeholder: "Enter phone number"
|
|
11052
11274
|
}
|
|
11053
11275
|
),
|
|
11054
|
-
/* @__PURE__ */
|
|
11276
|
+
/* @__PURE__ */ jsx63(
|
|
11055
11277
|
Fields_default.Select,
|
|
11056
11278
|
{
|
|
11057
11279
|
label: "Role",
|
|
@@ -11062,7 +11284,7 @@ function UserForm() {
|
|
|
11062
11284
|
}
|
|
11063
11285
|
)
|
|
11064
11286
|
] }),
|
|
11065
|
-
/* @__PURE__ */
|
|
11287
|
+
/* @__PURE__ */ jsx63("footer", { className: "flex justify-end mt-6", children: /* @__PURE__ */ jsx63(
|
|
11066
11288
|
Button,
|
|
11067
11289
|
{
|
|
11068
11290
|
isLoading,
|
|
@@ -11080,12 +11302,12 @@ var UserForm_default = UserForm;
|
|
|
11080
11302
|
// src/components/users/ResetPasswordPage.tsx
|
|
11081
11303
|
import { useEffect as useEffect25, useState as useState32 } from "react";
|
|
11082
11304
|
import { useSearchParams as useSearchParams2, useNavigate as useNavigate7 } from "react-router-dom";
|
|
11083
|
-
import { Lock as Lock2, ShieldCheck as ShieldCheck2, ArrowRight as
|
|
11305
|
+
import { Lock as Lock2, ShieldCheck as ShieldCheck2, ArrowRight as ArrowRight4, Terminal as Terminal2 } from "lucide-react";
|
|
11084
11306
|
import { useForm as useForm8 } from "react-hook-form";
|
|
11085
11307
|
import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
|
|
11086
11308
|
import * as z4 from "zod";
|
|
11087
11309
|
import { message as message13, Spin } from "antd";
|
|
11088
|
-
import { Fragment as
|
|
11310
|
+
import { Fragment as Fragment19, jsx as jsx64, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
11089
11311
|
var resetPageSchema = z4.object({
|
|
11090
11312
|
password: z4.string().min(6, "Password must be at least 6 characters"),
|
|
11091
11313
|
confirmPassword: z4.string().min(6, "Password must be at least 6 characters")
|
|
@@ -11151,14 +11373,14 @@ function ResetPasswordPage() {
|
|
|
11151
11373
|
}
|
|
11152
11374
|
};
|
|
11153
11375
|
if (verifying) {
|
|
11154
|
-
return /* @__PURE__ */
|
|
11155
|
-
/* @__PURE__ */
|
|
11156
|
-
/* @__PURE__ */
|
|
11376
|
+
return /* @__PURE__ */ jsx64("div", { className: "h-screen w-full flex items-center justify-center bg-slate-50 dark:bg-[#0A0B10]", children: /* @__PURE__ */ jsxs51("div", { className: "text-center space-y-4", children: [
|
|
11377
|
+
/* @__PURE__ */ jsx64(Spin, { size: "large" }),
|
|
11378
|
+
/* @__PURE__ */ jsx64("p", { className: "text-slate-500 animate-pulse", children: "Verifying reset link..." })
|
|
11157
11379
|
] }) });
|
|
11158
11380
|
}
|
|
11159
|
-
return /* @__PURE__ */
|
|
11160
|
-
/* @__PURE__ */
|
|
11161
|
-
/* @__PURE__ */
|
|
11381
|
+
return /* @__PURE__ */ jsxs51("div", { className: "flex h-screen w-full overflow-hidden bg-white dark:bg-[#0A0B10]", children: [
|
|
11382
|
+
/* @__PURE__ */ jsxs51("div", { className: "hidden lg:flex lg:w-1/2 relative overflow-hidden bg-slate-900 border-r border-slate-800", children: [
|
|
11383
|
+
/* @__PURE__ */ jsx64(
|
|
11162
11384
|
"div",
|
|
11163
11385
|
{
|
|
11164
11386
|
className: "absolute inset-0 z-0 opacity-40 bg-cover bg-center",
|
|
@@ -11167,35 +11389,35 @@ function ResetPasswordPage() {
|
|
|
11167
11389
|
}
|
|
11168
11390
|
}
|
|
11169
11391
|
),
|
|
11170
|
-
/* @__PURE__ */
|
|
11171
|
-
/* @__PURE__ */
|
|
11172
|
-
/* @__PURE__ */
|
|
11173
|
-
/* @__PURE__ */
|
|
11174
|
-
/* @__PURE__ */
|
|
11392
|
+
/* @__PURE__ */ jsx64("div", { className: "absolute inset-0 bg-linear-to-tr from-[#0A0B10] via-transparent to-indigo-500/10 z-10" }),
|
|
11393
|
+
/* @__PURE__ */ jsxs51("div", { className: "relative z-20 p-12 flex flex-col justify-between w-full h-full", children: [
|
|
11394
|
+
/* @__PURE__ */ jsxs51("div", { className: "flex items-center gap-3", children: [
|
|
11395
|
+
/* @__PURE__ */ jsx64("div", { className: "h-10 w-10 bg-indigo-600 rounded-lg flex items-center justify-center shadow-indigo-500/20 shadow-xl", children: /* @__PURE__ */ jsx64(Terminal2, { className: "text-white w-6 h-6" }) }),
|
|
11396
|
+
/* @__PURE__ */ jsx64("span", { className: "text-2xl font-bold text-white tracking-widest uppercase", children: "Warqad UI" })
|
|
11175
11397
|
] }),
|
|
11176
|
-
/* @__PURE__ */
|
|
11177
|
-
/* @__PURE__ */
|
|
11398
|
+
/* @__PURE__ */ jsxs51("div", { className: "max-w-md", children: [
|
|
11399
|
+
/* @__PURE__ */ jsxs51("h1", { className: "text-5xl font-extrabold text-white mb-6 leading-tight", children: [
|
|
11178
11400
|
"Secure ",
|
|
11179
|
-
/* @__PURE__ */
|
|
11401
|
+
/* @__PURE__ */ jsx64("span", { className: "text-indigo-400", children: "Access" }),
|
|
11180
11402
|
" ",
|
|
11181
|
-
/* @__PURE__ */
|
|
11403
|
+
/* @__PURE__ */ jsx64("br", {}),
|
|
11182
11404
|
" ",
|
|
11183
11405
|
"Simplified."
|
|
11184
11406
|
] }),
|
|
11185
|
-
/* @__PURE__ */
|
|
11407
|
+
/* @__PURE__ */ jsx64("p", { className: "text-slate-400 text-lg leading-relaxed", children: "Reset your credentials securely and regain access to your dashboard in minutes." })
|
|
11186
11408
|
] }),
|
|
11187
|
-
/* @__PURE__ */
|
|
11409
|
+
/* @__PURE__ */ jsx64("div", { className: "text-slate-500 text-sm italic", children: "Trusted by developers worldwide." })
|
|
11188
11410
|
] })
|
|
11189
11411
|
] }),
|
|
11190
|
-
/* @__PURE__ */
|
|
11191
|
-
/* @__PURE__ */
|
|
11192
|
-
/* @__PURE__ */
|
|
11193
|
-
/* @__PURE__ */
|
|
11194
|
-
/* @__PURE__ */
|
|
11195
|
-
/* @__PURE__ */
|
|
11196
|
-
/* @__PURE__ */
|
|
11412
|
+
/* @__PURE__ */ jsxs51("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: [
|
|
11413
|
+
/* @__PURE__ */ jsx64("div", { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx64(ThemeToggle, {}) }),
|
|
11414
|
+
/* @__PURE__ */ jsx64("div", { className: "max-w-md w-full mx-auto", children: !isVerified || error ? /* @__PURE__ */ jsxs51("div", { className: "text-center space-y-6", children: [
|
|
11415
|
+
/* @__PURE__ */ jsx64("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__ */ jsx64(ShieldCheck2, { className: "text-red-600 dark:text-red-400 w-8 h-8" }) }),
|
|
11416
|
+
/* @__PURE__ */ jsxs51("div", { children: [
|
|
11417
|
+
/* @__PURE__ */ jsx64("h2", { className: "text-3xl font-bold text-slate-900 dark:text-white mb-2", children: "Link Invalid" }),
|
|
11418
|
+
/* @__PURE__ */ jsx64("p", { className: "text-slate-500 dark:text-slate-400", children: error || "The reset link is invalid or has already been used." })
|
|
11197
11419
|
] }),
|
|
11198
|
-
/* @__PURE__ */
|
|
11420
|
+
/* @__PURE__ */ jsx64(
|
|
11199
11421
|
Button,
|
|
11200
11422
|
{
|
|
11201
11423
|
onClick: () => navigate("/login"),
|
|
@@ -11203,22 +11425,22 @@ function ResetPasswordPage() {
|
|
|
11203
11425
|
children: "Back to Login"
|
|
11204
11426
|
}
|
|
11205
11427
|
)
|
|
11206
|
-
] }) : /* @__PURE__ */
|
|
11207
|
-
/* @__PURE__ */
|
|
11208
|
-
/* @__PURE__ */
|
|
11209
|
-
/* @__PURE__ */
|
|
11428
|
+
] }) : /* @__PURE__ */ jsxs51(Fragment19, { children: [
|
|
11429
|
+
/* @__PURE__ */ jsxs51("div", { className: "mb-10", children: [
|
|
11430
|
+
/* @__PURE__ */ jsx64("h2", { className: "text-3xl font-bold text-slate-900 dark:text-white mb-3 tracking-tight", children: "Reset Password" }),
|
|
11431
|
+
/* @__PURE__ */ jsxs51("p", { className: "text-slate-500 dark:text-slate-400", children: [
|
|
11210
11432
|
"Set a new, strong password for",
|
|
11211
11433
|
" ",
|
|
11212
|
-
/* @__PURE__ */
|
|
11434
|
+
/* @__PURE__ */ jsx64("span", { className: "text-indigo-600 font-medium", children: email })
|
|
11213
11435
|
] })
|
|
11214
11436
|
] }),
|
|
11215
|
-
/* @__PURE__ */
|
|
11437
|
+
/* @__PURE__ */ jsxs51(
|
|
11216
11438
|
"form",
|
|
11217
11439
|
{
|
|
11218
11440
|
onSubmit: methods.handleSubmit(onSubmit),
|
|
11219
11441
|
className: "space-y-6",
|
|
11220
11442
|
children: [
|
|
11221
|
-
/* @__PURE__ */
|
|
11443
|
+
/* @__PURE__ */ jsx64(
|
|
11222
11444
|
Fields_default.Input,
|
|
11223
11445
|
{
|
|
11224
11446
|
form: methods,
|
|
@@ -11227,11 +11449,11 @@ function ResetPasswordPage() {
|
|
|
11227
11449
|
type: "password",
|
|
11228
11450
|
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
11229
11451
|
required: true,
|
|
11230
|
-
icon: /* @__PURE__ */
|
|
11452
|
+
icon: /* @__PURE__ */ jsx64(Lock2, { size: 18, className: "text-slate-400" }),
|
|
11231
11453
|
className: "bg-slate-50 dark:bg-slate-900/50 h-12"
|
|
11232
11454
|
}
|
|
11233
11455
|
),
|
|
11234
|
-
/* @__PURE__ */
|
|
11456
|
+
/* @__PURE__ */ jsx64(
|
|
11235
11457
|
Fields_default.Input,
|
|
11236
11458
|
{
|
|
11237
11459
|
form: methods,
|
|
@@ -11240,11 +11462,11 @@ function ResetPasswordPage() {
|
|
|
11240
11462
|
type: "password",
|
|
11241
11463
|
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
11242
11464
|
required: true,
|
|
11243
|
-
icon: /* @__PURE__ */
|
|
11465
|
+
icon: /* @__PURE__ */ jsx64(ShieldCheck2, { size: 18, className: "text-slate-400" }),
|
|
11244
11466
|
className: "bg-slate-50 dark:bg-slate-900/50 h-12"
|
|
11245
11467
|
}
|
|
11246
11468
|
),
|
|
11247
|
-
/* @__PURE__ */
|
|
11469
|
+
/* @__PURE__ */ jsxs51(
|
|
11248
11470
|
Button,
|
|
11249
11471
|
{
|
|
11250
11472
|
type: "submit",
|
|
@@ -11252,7 +11474,7 @@ function ResetPasswordPage() {
|
|
|
11252
11474
|
className: "w-full h-12 bg-indigo-600 hover:bg-indigo-500 text-white font-semibold flex items-center justify-center gap-2",
|
|
11253
11475
|
children: [
|
|
11254
11476
|
"Update Password",
|
|
11255
|
-
!isLoading && /* @__PURE__ */
|
|
11477
|
+
!isLoading && /* @__PURE__ */ jsx64(ArrowRight4, { size: 18 })
|
|
11256
11478
|
]
|
|
11257
11479
|
}
|
|
11258
11480
|
)
|
|
@@ -11266,10 +11488,10 @@ function ResetPasswordPage() {
|
|
|
11266
11488
|
var ResetPasswordPage_default = ResetPasswordPage;
|
|
11267
11489
|
|
|
11268
11490
|
// src/components/users/UserProfile.tsx
|
|
11269
|
-
import { LogOut, User as
|
|
11491
|
+
import { LogOut, User as User5 } from "lucide-react";
|
|
11270
11492
|
import { useNavigate as useNavigate8 } from "react-router-dom";
|
|
11271
11493
|
import { message as message14 } from "antd";
|
|
11272
|
-
import { jsx as
|
|
11494
|
+
import { jsx as jsx65, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
11273
11495
|
var UserProfile = ({
|
|
11274
11496
|
items,
|
|
11275
11497
|
name,
|
|
@@ -11302,21 +11524,21 @@ var UserProfile = ({
|
|
|
11302
11524
|
const defaultItems = [
|
|
11303
11525
|
{
|
|
11304
11526
|
label: "My Profile",
|
|
11305
|
-
icon: /* @__PURE__ */
|
|
11527
|
+
icon: /* @__PURE__ */ jsx65(User5, { size: 18 }),
|
|
11306
11528
|
onClick: () => navigate("profile"),
|
|
11307
11529
|
className: "min-w-[150px]"
|
|
11308
11530
|
},
|
|
11309
11531
|
{
|
|
11310
11532
|
label: "Logout",
|
|
11311
|
-
icon: /* @__PURE__ */
|
|
11533
|
+
icon: /* @__PURE__ */ jsx65(LogOut, { size: 18 }),
|
|
11312
11534
|
onClick: logout,
|
|
11313
11535
|
className: "text-red-500 hover:bg-red-50 dark:hover:bg-red-950/20"
|
|
11314
11536
|
}
|
|
11315
11537
|
];
|
|
11316
|
-
return /* @__PURE__ */
|
|
11317
|
-
showThemeToggle && /* @__PURE__ */
|
|
11318
|
-
showThemeToggle && /* @__PURE__ */
|
|
11319
|
-
/* @__PURE__ */
|
|
11538
|
+
return /* @__PURE__ */ jsxs52("div", { className: "flex items-center gap-3", children: [
|
|
11539
|
+
showThemeToggle && /* @__PURE__ */ jsx65(ThemeToggle, {}),
|
|
11540
|
+
showThemeToggle && /* @__PURE__ */ jsx65("div", { className: "w-px h-6 mx-2 bg-gray-200 dark:bg-gray-800" }),
|
|
11541
|
+
/* @__PURE__ */ jsx65(
|
|
11320
11542
|
ProfileDropdown,
|
|
11321
11543
|
{
|
|
11322
11544
|
name: name || account?.name || "User",
|
|
@@ -11334,12 +11556,12 @@ var UserProfile_default = UserProfile;
|
|
|
11334
11556
|
// src/components/users/ProfilePage.tsx
|
|
11335
11557
|
import { useNavigate as useNavigate9 } from "react-router-dom";
|
|
11336
11558
|
import { ArrowLeft as ArrowLeft3 } from "lucide-react";
|
|
11337
|
-
import { jsx as
|
|
11559
|
+
import { jsx as jsx66, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
11338
11560
|
var ProfilePage = () => {
|
|
11339
11561
|
const navigate = useNavigate9();
|
|
11340
11562
|
const { user, account } = useAuth();
|
|
11341
11563
|
if (!user) {
|
|
11342
|
-
return /* @__PURE__ */
|
|
11564
|
+
return /* @__PURE__ */ jsx66("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ jsx66("h1", { children: "Please login to view your profile" }) });
|
|
11343
11565
|
}
|
|
11344
11566
|
const extraInfo = [
|
|
11345
11567
|
{
|
|
@@ -11358,19 +11580,19 @@ var ProfilePage = () => {
|
|
|
11358
11580
|
copiable: false
|
|
11359
11581
|
}
|
|
11360
11582
|
];
|
|
11361
|
-
return /* @__PURE__ */
|
|
11362
|
-
/* @__PURE__ */
|
|
11583
|
+
return /* @__PURE__ */ jsxs53("div", { className: "p-4 sm:p-8 space-y-6", children: [
|
|
11584
|
+
/* @__PURE__ */ jsx66("div", { className: "max-w-5xl mx-auto", children: /* @__PURE__ */ jsx66(
|
|
11363
11585
|
Button,
|
|
11364
11586
|
{
|
|
11365
11587
|
variant: "outline",
|
|
11366
11588
|
size: "sm",
|
|
11367
11589
|
onClick: () => navigate(-1),
|
|
11368
|
-
icon: /* @__PURE__ */
|
|
11590
|
+
icon: /* @__PURE__ */ jsx66(ArrowLeft3, { size: 16 }),
|
|
11369
11591
|
className: "rounded-full font-bold px-5",
|
|
11370
11592
|
children: "Back"
|
|
11371
11593
|
}
|
|
11372
11594
|
) }),
|
|
11373
|
-
/* @__PURE__ */
|
|
11595
|
+
/* @__PURE__ */ jsx66(
|
|
11374
11596
|
ProfileView,
|
|
11375
11597
|
{
|
|
11376
11598
|
name: account?.name || "User Account",
|
|
@@ -11390,7 +11612,7 @@ import { useNavigate as useNavigate10, useParams as useParams6 } from "react-rou
|
|
|
11390
11612
|
import { EllipsisVertical as EllipsisVertical3, FilePenLine as FilePenLine2, Trash2 as Trash23 } from "lucide-react";
|
|
11391
11613
|
import { useState as useState33 } from "react";
|
|
11392
11614
|
import { message as message15 } from "antd";
|
|
11393
|
-
import { Fragment as
|
|
11615
|
+
import { Fragment as Fragment20, jsx as jsx67, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
11394
11616
|
function Wallets({ v, url }) {
|
|
11395
11617
|
const { branchId } = useParams6();
|
|
11396
11618
|
const [deleteWallet, setDeleteWallet] = useState33(null);
|
|
@@ -11405,12 +11627,12 @@ function Wallets({ v, url }) {
|
|
|
11405
11627
|
const items = (data2) => [
|
|
11406
11628
|
{
|
|
11407
11629
|
label: `Edit Wallet`,
|
|
11408
|
-
icon: /* @__PURE__ */
|
|
11630
|
+
icon: /* @__PURE__ */ jsx67(FilePenLine2, { size: 16 }),
|
|
11409
11631
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
11410
11632
|
},
|
|
11411
11633
|
{
|
|
11412
11634
|
label: `Delete Wallet`,
|
|
11413
|
-
icon: /* @__PURE__ */
|
|
11635
|
+
icon: /* @__PURE__ */ jsx67(Trash23, { className: "text-red-500", size: 16 }),
|
|
11414
11636
|
onClick: () => setDeleteWallet(data2)
|
|
11415
11637
|
}
|
|
11416
11638
|
].filter(Boolean);
|
|
@@ -11420,7 +11642,7 @@ function Wallets({ v, url }) {
|
|
|
11420
11642
|
header: "Name",
|
|
11421
11643
|
cell: ({ row }) => {
|
|
11422
11644
|
const wallet = row.original;
|
|
11423
|
-
return /* @__PURE__ */
|
|
11645
|
+
return /* @__PURE__ */ jsx67(
|
|
11424
11646
|
"span",
|
|
11425
11647
|
{
|
|
11426
11648
|
onClick: () => navigate(`statements/${wallet?._id}`),
|
|
@@ -11435,7 +11657,7 @@ function Wallets({ v, url }) {
|
|
|
11435
11657
|
header: "Type",
|
|
11436
11658
|
cell: ({ row }) => {
|
|
11437
11659
|
const wallet = row.original;
|
|
11438
|
-
return /* @__PURE__ */
|
|
11660
|
+
return /* @__PURE__ */ jsx67("span", { className: "capitalize", children: wallet?.type });
|
|
11439
11661
|
}
|
|
11440
11662
|
},
|
|
11441
11663
|
{
|
|
@@ -11443,7 +11665,7 @@ function Wallets({ v, url }) {
|
|
|
11443
11665
|
header: "Currency",
|
|
11444
11666
|
cell: ({ row }) => {
|
|
11445
11667
|
const wallet = row.original;
|
|
11446
|
-
return /* @__PURE__ */
|
|
11668
|
+
return /* @__PURE__ */ jsx67("span", { children: wallet?.currency });
|
|
11447
11669
|
}
|
|
11448
11670
|
},
|
|
11449
11671
|
{
|
|
@@ -11451,7 +11673,7 @@ function Wallets({ v, url }) {
|
|
|
11451
11673
|
header: "Account No",
|
|
11452
11674
|
cell: ({ row }) => {
|
|
11453
11675
|
const wallet = row.original;
|
|
11454
|
-
return /* @__PURE__ */
|
|
11676
|
+
return /* @__PURE__ */ jsx67("span", { children: wallet?.accountNo || "N/A" });
|
|
11455
11677
|
}
|
|
11456
11678
|
},
|
|
11457
11679
|
{
|
|
@@ -11459,13 +11681,13 @@ function Wallets({ v, url }) {
|
|
|
11459
11681
|
header: "Actions",
|
|
11460
11682
|
cell: ({ row }) => {
|
|
11461
11683
|
const data2 = row.original;
|
|
11462
|
-
return /* @__PURE__ */
|
|
11684
|
+
return /* @__PURE__ */ jsx67(
|
|
11463
11685
|
Dropdown,
|
|
11464
11686
|
{
|
|
11465
11687
|
className: "cursor-pointer w-[150px]",
|
|
11466
11688
|
items: items(data2),
|
|
11467
11689
|
triggerMode: "hover",
|
|
11468
|
-
children: /* @__PURE__ */
|
|
11690
|
+
children: /* @__PURE__ */ jsx67(EllipsisVertical3, {})
|
|
11469
11691
|
}
|
|
11470
11692
|
);
|
|
11471
11693
|
}
|
|
@@ -11483,9 +11705,9 @@ function Wallets({ v, url }) {
|
|
|
11483
11705
|
return error;
|
|
11484
11706
|
}
|
|
11485
11707
|
};
|
|
11486
|
-
return /* @__PURE__ */
|
|
11487
|
-
/* @__PURE__ */
|
|
11488
|
-
/* @__PURE__ */
|
|
11708
|
+
return /* @__PURE__ */ jsxs54(Fragment20, { children: [
|
|
11709
|
+
/* @__PURE__ */ jsx67(Modal2, {}),
|
|
11710
|
+
/* @__PURE__ */ jsx67(
|
|
11489
11711
|
ConfirmModal,
|
|
11490
11712
|
{
|
|
11491
11713
|
isOpen: !!deleteWallet,
|
|
@@ -11498,7 +11720,7 @@ function Wallets({ v, url }) {
|
|
|
11498
11720
|
children: null
|
|
11499
11721
|
}
|
|
11500
11722
|
),
|
|
11501
|
-
/* @__PURE__ */
|
|
11723
|
+
/* @__PURE__ */ jsx67(
|
|
11502
11724
|
TransactionViewComponent,
|
|
11503
11725
|
{
|
|
11504
11726
|
columns,
|
|
@@ -11532,7 +11754,7 @@ import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
|
|
|
11532
11754
|
import { message as message16 } from "antd";
|
|
11533
11755
|
import { useEffect as useEffect26 } from "react";
|
|
11534
11756
|
import { useParams as useParams7 } from "react-router-dom";
|
|
11535
|
-
import { jsx as
|
|
11757
|
+
import { jsx as jsx68, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
11536
11758
|
function WalletForm() {
|
|
11537
11759
|
const { enums } = useWarqadConfig();
|
|
11538
11760
|
const { branchId } = useParams7();
|
|
@@ -11594,24 +11816,24 @@ function WalletForm() {
|
|
|
11594
11816
|
fetches();
|
|
11595
11817
|
}
|
|
11596
11818
|
}, [id]);
|
|
11597
|
-
return /* @__PURE__ */
|
|
11819
|
+
return /* @__PURE__ */ jsxs55(
|
|
11598
11820
|
Card,
|
|
11599
11821
|
{
|
|
11600
11822
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
11601
11823
|
isLoading: isLoadingGet,
|
|
11602
11824
|
loadingText: "Processing...",
|
|
11603
11825
|
children: [
|
|
11604
|
-
/* @__PURE__ */
|
|
11605
|
-
/* @__PURE__ */
|
|
11606
|
-
/* @__PURE__ */
|
|
11826
|
+
/* @__PURE__ */ jsxs55(Card.Header, { children: [
|
|
11827
|
+
/* @__PURE__ */ jsx68(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Wallet` }),
|
|
11828
|
+
/* @__PURE__ */ jsx68(Card.Description, { children: isEdit ? `Update the details for this wallet` : `Create a new wallet and add it to your list` })
|
|
11607
11829
|
] }),
|
|
11608
|
-
/* @__PURE__ */
|
|
11830
|
+
/* @__PURE__ */ jsx68(Card.Content, { children: /* @__PURE__ */ jsxs55(
|
|
11609
11831
|
"form",
|
|
11610
11832
|
{
|
|
11611
11833
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
11612
11834
|
children: [
|
|
11613
|
-
/* @__PURE__ */
|
|
11614
|
-
/* @__PURE__ */
|
|
11835
|
+
/* @__PURE__ */ jsxs55("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
11836
|
+
/* @__PURE__ */ jsx68(
|
|
11615
11837
|
Fields_default.Input,
|
|
11616
11838
|
{
|
|
11617
11839
|
label: "Name",
|
|
@@ -11622,7 +11844,7 @@ function WalletForm() {
|
|
|
11622
11844
|
required: true
|
|
11623
11845
|
}
|
|
11624
11846
|
),
|
|
11625
|
-
/* @__PURE__ */
|
|
11847
|
+
/* @__PURE__ */ jsx68(
|
|
11626
11848
|
Fields_default.Select,
|
|
11627
11849
|
{
|
|
11628
11850
|
label: "Wallet Type",
|
|
@@ -11632,7 +11854,7 @@ function WalletForm() {
|
|
|
11632
11854
|
enumName: "walletTypes"
|
|
11633
11855
|
}
|
|
11634
11856
|
),
|
|
11635
|
-
/* @__PURE__ */
|
|
11857
|
+
/* @__PURE__ */ jsx68(
|
|
11636
11858
|
Fields_default.Select,
|
|
11637
11859
|
{
|
|
11638
11860
|
label: "Currency",
|
|
@@ -11642,7 +11864,7 @@ function WalletForm() {
|
|
|
11642
11864
|
enumName: "currencies"
|
|
11643
11865
|
}
|
|
11644
11866
|
),
|
|
11645
|
-
/* @__PURE__ */
|
|
11867
|
+
/* @__PURE__ */ jsx68(
|
|
11646
11868
|
Fields_default.Input,
|
|
11647
11869
|
{
|
|
11648
11870
|
label: "Account Number",
|
|
@@ -11652,7 +11874,7 @@ function WalletForm() {
|
|
|
11652
11874
|
placeholder: "Enter account number (optional)"
|
|
11653
11875
|
}
|
|
11654
11876
|
),
|
|
11655
|
-
!branchId && /* @__PURE__ */
|
|
11877
|
+
!branchId && /* @__PURE__ */ jsx68(
|
|
11656
11878
|
Feilds_default.Branches,
|
|
11657
11879
|
{
|
|
11658
11880
|
label: "Branch",
|
|
@@ -11663,7 +11885,7 @@ function WalletForm() {
|
|
|
11663
11885
|
}
|
|
11664
11886
|
)
|
|
11665
11887
|
] }),
|
|
11666
|
-
/* @__PURE__ */
|
|
11888
|
+
/* @__PURE__ */ jsx68("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx68(
|
|
11667
11889
|
Button,
|
|
11668
11890
|
{
|
|
11669
11891
|
isLoading,
|
|
@@ -11685,8 +11907,8 @@ var WalletForm_default = WalletForm;
|
|
|
11685
11907
|
|
|
11686
11908
|
// src/components/wallets/Feilds/Wallet.tsx
|
|
11687
11909
|
import { useParams as useParams8 } from "react-router-dom";
|
|
11688
|
-
import { jsx as
|
|
11689
|
-
function
|
|
11910
|
+
import { jsx as jsx69, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
11911
|
+
function Wallet6({
|
|
11690
11912
|
name,
|
|
11691
11913
|
label,
|
|
11692
11914
|
placeholder,
|
|
@@ -11707,8 +11929,8 @@ function Wallet5({
|
|
|
11707
11929
|
showBalance,
|
|
11708
11930
|
accountId: walletId
|
|
11709
11931
|
});
|
|
11710
|
-
return /* @__PURE__ */
|
|
11711
|
-
/* @__PURE__ */
|
|
11932
|
+
return /* @__PURE__ */ jsxs56("div", { className: "flex flex-col gap-2", children: [
|
|
11933
|
+
/* @__PURE__ */ jsx69(
|
|
11712
11934
|
Fields_default.SearchApi,
|
|
11713
11935
|
{
|
|
11714
11936
|
name,
|
|
@@ -11726,10 +11948,10 @@ function Wallet5({
|
|
|
11726
11948
|
obj
|
|
11727
11949
|
}
|
|
11728
11950
|
),
|
|
11729
|
-
/* @__PURE__ */
|
|
11951
|
+
/* @__PURE__ */ jsx69(BalanceView, {})
|
|
11730
11952
|
] });
|
|
11731
11953
|
}
|
|
11732
|
-
var Wallet_default =
|
|
11954
|
+
var Wallet_default = Wallet6;
|
|
11733
11955
|
|
|
11734
11956
|
// src/components/wallets/Feilds/index.tsx
|
|
11735
11957
|
var WalletField = {
|
|
@@ -11742,7 +11964,7 @@ import { useNavigate as useNavigate11 } from "react-router-dom";
|
|
|
11742
11964
|
import { EllipsisVertical as EllipsisVertical4, FilePenLine as FilePenLine3, Trash2 as Trash24 } from "lucide-react";
|
|
11743
11965
|
import { useState as useState34 } from "react";
|
|
11744
11966
|
import { message as message17 } from "antd";
|
|
11745
|
-
import { Fragment as
|
|
11967
|
+
import { Fragment as Fragment21, jsx as jsx70, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
11746
11968
|
function Brands({ v, url }) {
|
|
11747
11969
|
const [deleteBrand, setDeleteBrand] = useState34(null);
|
|
11748
11970
|
const { isLoading, remove } = useApis_default();
|
|
@@ -11756,12 +11978,12 @@ function Brands({ v, url }) {
|
|
|
11756
11978
|
const items = (data2) => [
|
|
11757
11979
|
{
|
|
11758
11980
|
label: `Edit Brand`,
|
|
11759
|
-
icon: /* @__PURE__ */
|
|
11981
|
+
icon: /* @__PURE__ */ jsx70(FilePenLine3, { size: 16 }),
|
|
11760
11982
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
11761
11983
|
},
|
|
11762
11984
|
{
|
|
11763
11985
|
label: `Delete Brand`,
|
|
11764
|
-
icon: /* @__PURE__ */
|
|
11986
|
+
icon: /* @__PURE__ */ jsx70(Trash24, { className: "text-red-500", size: 16 }),
|
|
11765
11987
|
onClick: () => setDeleteBrand(data2)
|
|
11766
11988
|
}
|
|
11767
11989
|
].filter(Boolean);
|
|
@@ -11771,7 +11993,7 @@ function Brands({ v, url }) {
|
|
|
11771
11993
|
header: "Name",
|
|
11772
11994
|
cell: ({ row }) => {
|
|
11773
11995
|
const brand = row.original;
|
|
11774
|
-
return /* @__PURE__ */
|
|
11996
|
+
return /* @__PURE__ */ jsx70("span", { children: brand?.name });
|
|
11775
11997
|
}
|
|
11776
11998
|
},
|
|
11777
11999
|
{
|
|
@@ -11779,13 +12001,13 @@ function Brands({ v, url }) {
|
|
|
11779
12001
|
header: "Actions",
|
|
11780
12002
|
cell: ({ row }) => {
|
|
11781
12003
|
const data2 = row.original;
|
|
11782
|
-
return /* @__PURE__ */
|
|
12004
|
+
return /* @__PURE__ */ jsx70(
|
|
11783
12005
|
Dropdown,
|
|
11784
12006
|
{
|
|
11785
12007
|
className: "cursor-pointer w-[150px]",
|
|
11786
12008
|
items: items(data2),
|
|
11787
12009
|
triggerMode: "hover",
|
|
11788
|
-
children: /* @__PURE__ */
|
|
12010
|
+
children: /* @__PURE__ */ jsx70(EllipsisVertical4, {})
|
|
11789
12011
|
}
|
|
11790
12012
|
);
|
|
11791
12013
|
}
|
|
@@ -11803,9 +12025,9 @@ function Brands({ v, url }) {
|
|
|
11803
12025
|
return error;
|
|
11804
12026
|
}
|
|
11805
12027
|
};
|
|
11806
|
-
return /* @__PURE__ */
|
|
11807
|
-
/* @__PURE__ */
|
|
11808
|
-
/* @__PURE__ */
|
|
12028
|
+
return /* @__PURE__ */ jsxs57(Fragment21, { children: [
|
|
12029
|
+
/* @__PURE__ */ jsx70(Modal2, {}),
|
|
12030
|
+
/* @__PURE__ */ jsx70(
|
|
11809
12031
|
ConfirmModal,
|
|
11810
12032
|
{
|
|
11811
12033
|
isOpen: !!deleteBrand,
|
|
@@ -11818,7 +12040,7 @@ function Brands({ v, url }) {
|
|
|
11818
12040
|
children: null
|
|
11819
12041
|
}
|
|
11820
12042
|
),
|
|
11821
|
-
/* @__PURE__ */
|
|
12043
|
+
/* @__PURE__ */ jsx70(
|
|
11822
12044
|
TransactionViewComponent,
|
|
11823
12045
|
{
|
|
11824
12046
|
columns,
|
|
@@ -11847,7 +12069,7 @@ import { useForm as useForm10 } from "react-hook-form";
|
|
|
11847
12069
|
import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
|
|
11848
12070
|
import { message as message18 } from "antd";
|
|
11849
12071
|
import { useEffect as useEffect27 } from "react";
|
|
11850
|
-
import { jsx as
|
|
12072
|
+
import { jsx as jsx71, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
11851
12073
|
function BrandForm() {
|
|
11852
12074
|
const { getQuery, navigate } = useApp_default();
|
|
11853
12075
|
const id = getQuery("id");
|
|
@@ -11897,23 +12119,23 @@ function BrandForm() {
|
|
|
11897
12119
|
fetches();
|
|
11898
12120
|
}
|
|
11899
12121
|
}, [id]);
|
|
11900
|
-
return /* @__PURE__ */
|
|
12122
|
+
return /* @__PURE__ */ jsxs58(
|
|
11901
12123
|
Card,
|
|
11902
12124
|
{
|
|
11903
12125
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
11904
12126
|
isLoading: isLoadingGet,
|
|
11905
12127
|
loadingText: "Processing...",
|
|
11906
12128
|
children: [
|
|
11907
|
-
/* @__PURE__ */
|
|
11908
|
-
/* @__PURE__ */
|
|
11909
|
-
/* @__PURE__ */
|
|
12129
|
+
/* @__PURE__ */ jsxs58(Card.Header, { children: [
|
|
12130
|
+
/* @__PURE__ */ jsx71(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Brand` }),
|
|
12131
|
+
/* @__PURE__ */ jsx71(Card.Description, { children: isEdit ? `Update the details for this brand` : `Create a new brand and add it to your list` })
|
|
11910
12132
|
] }),
|
|
11911
|
-
/* @__PURE__ */
|
|
12133
|
+
/* @__PURE__ */ jsx71(Card.Content, { children: /* @__PURE__ */ jsxs58(
|
|
11912
12134
|
"form",
|
|
11913
12135
|
{
|
|
11914
12136
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
11915
12137
|
children: [
|
|
11916
|
-
/* @__PURE__ */
|
|
12138
|
+
/* @__PURE__ */ jsx71("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: /* @__PURE__ */ jsx71(
|
|
11917
12139
|
Fields_default.Input,
|
|
11918
12140
|
{
|
|
11919
12141
|
label: "Name",
|
|
@@ -11924,7 +12146,7 @@ function BrandForm() {
|
|
|
11924
12146
|
required: true
|
|
11925
12147
|
}
|
|
11926
12148
|
) }),
|
|
11927
|
-
/* @__PURE__ */
|
|
12149
|
+
/* @__PURE__ */ jsx71("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx71(
|
|
11928
12150
|
Button,
|
|
11929
12151
|
{
|
|
11930
12152
|
isLoading,
|
|
@@ -11946,7 +12168,7 @@ var BrandForm_default = BrandForm;
|
|
|
11946
12168
|
|
|
11947
12169
|
// src/components/brands/Feilds/Brand.tsx
|
|
11948
12170
|
import { useParams as useParams10 } from "react-router-dom";
|
|
11949
|
-
import { jsx as
|
|
12171
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
11950
12172
|
function Brand({
|
|
11951
12173
|
name,
|
|
11952
12174
|
label,
|
|
@@ -11959,7 +12181,7 @@ function Brand({
|
|
|
11959
12181
|
disabled
|
|
11960
12182
|
}) {
|
|
11961
12183
|
const { branchId } = useParams10();
|
|
11962
|
-
return /* @__PURE__ */
|
|
12184
|
+
return /* @__PURE__ */ jsx72("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsx72(
|
|
11963
12185
|
Fields_default.SearchApi,
|
|
11964
12186
|
{
|
|
11965
12187
|
name,
|
|
@@ -11990,7 +12212,7 @@ import { useNavigate as useNavigate12 } from "react-router-dom";
|
|
|
11990
12212
|
import { EllipsisVertical as EllipsisVertical5, FilePenLine as FilePenLine4, Trash2 as Trash25 } from "lucide-react";
|
|
11991
12213
|
import { useState as useState35 } from "react";
|
|
11992
12214
|
import { message as message19 } from "antd";
|
|
11993
|
-
import { Fragment as
|
|
12215
|
+
import { Fragment as Fragment22, jsx as jsx73, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
11994
12216
|
function Categories({ v, url }) {
|
|
11995
12217
|
const [deleteCategory, setDeleteCategory] = useState35(null);
|
|
11996
12218
|
const { isLoading, remove } = useApis_default();
|
|
@@ -12004,12 +12226,12 @@ function Categories({ v, url }) {
|
|
|
12004
12226
|
const items = (data2) => [
|
|
12005
12227
|
{
|
|
12006
12228
|
label: `Edit Category`,
|
|
12007
|
-
icon: /* @__PURE__ */
|
|
12229
|
+
icon: /* @__PURE__ */ jsx73(FilePenLine4, { size: 16 }),
|
|
12008
12230
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
12009
12231
|
},
|
|
12010
12232
|
{
|
|
12011
12233
|
label: `Delete Category`,
|
|
12012
|
-
icon: /* @__PURE__ */
|
|
12234
|
+
icon: /* @__PURE__ */ jsx73(Trash25, { className: "text-red-500", size: 16 }),
|
|
12013
12235
|
onClick: () => setDeleteCategory(data2)
|
|
12014
12236
|
}
|
|
12015
12237
|
].filter(Boolean);
|
|
@@ -12019,7 +12241,7 @@ function Categories({ v, url }) {
|
|
|
12019
12241
|
header: "Name",
|
|
12020
12242
|
cell: ({ row }) => {
|
|
12021
12243
|
const category = row.original;
|
|
12022
|
-
return /* @__PURE__ */
|
|
12244
|
+
return /* @__PURE__ */ jsx73("span", { children: category?.name });
|
|
12023
12245
|
}
|
|
12024
12246
|
},
|
|
12025
12247
|
{
|
|
@@ -12027,13 +12249,13 @@ function Categories({ v, url }) {
|
|
|
12027
12249
|
header: "Actions",
|
|
12028
12250
|
cell: ({ row }) => {
|
|
12029
12251
|
const data2 = row.original;
|
|
12030
|
-
return /* @__PURE__ */
|
|
12252
|
+
return /* @__PURE__ */ jsx73(
|
|
12031
12253
|
Dropdown,
|
|
12032
12254
|
{
|
|
12033
12255
|
className: "cursor-pointer w-[150px]",
|
|
12034
12256
|
items: items(data2),
|
|
12035
12257
|
triggerMode: "hover",
|
|
12036
|
-
children: /* @__PURE__ */
|
|
12258
|
+
children: /* @__PURE__ */ jsx73(EllipsisVertical5, {})
|
|
12037
12259
|
}
|
|
12038
12260
|
);
|
|
12039
12261
|
}
|
|
@@ -12051,9 +12273,9 @@ function Categories({ v, url }) {
|
|
|
12051
12273
|
return error;
|
|
12052
12274
|
}
|
|
12053
12275
|
};
|
|
12054
|
-
return /* @__PURE__ */
|
|
12055
|
-
/* @__PURE__ */
|
|
12056
|
-
/* @__PURE__ */
|
|
12276
|
+
return /* @__PURE__ */ jsxs59(Fragment22, { children: [
|
|
12277
|
+
/* @__PURE__ */ jsx73(Modal2, {}),
|
|
12278
|
+
/* @__PURE__ */ jsx73(
|
|
12057
12279
|
ConfirmModal,
|
|
12058
12280
|
{
|
|
12059
12281
|
isOpen: !!deleteCategory,
|
|
@@ -12066,7 +12288,7 @@ function Categories({ v, url }) {
|
|
|
12066
12288
|
children: null
|
|
12067
12289
|
}
|
|
12068
12290
|
),
|
|
12069
|
-
/* @__PURE__ */
|
|
12291
|
+
/* @__PURE__ */ jsx73(
|
|
12070
12292
|
TransactionViewComponent,
|
|
12071
12293
|
{
|
|
12072
12294
|
columns,
|
|
@@ -12095,7 +12317,7 @@ import { useForm as useForm11 } from "react-hook-form";
|
|
|
12095
12317
|
import { zodResolver as zodResolver10 } from "@hookform/resolvers/zod";
|
|
12096
12318
|
import { message as message20 } from "antd";
|
|
12097
12319
|
import { useEffect as useEffect28 } from "react";
|
|
12098
|
-
import { jsx as
|
|
12320
|
+
import { jsx as jsx74, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
12099
12321
|
function CategoryForm() {
|
|
12100
12322
|
const { getQuery, navigate } = useApp_default();
|
|
12101
12323
|
const id = getQuery("id");
|
|
@@ -12145,23 +12367,23 @@ function CategoryForm() {
|
|
|
12145
12367
|
fetches();
|
|
12146
12368
|
}
|
|
12147
12369
|
}, [id]);
|
|
12148
|
-
return /* @__PURE__ */
|
|
12370
|
+
return /* @__PURE__ */ jsxs60(
|
|
12149
12371
|
Card,
|
|
12150
12372
|
{
|
|
12151
12373
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
12152
12374
|
isLoading: isLoadingGet,
|
|
12153
12375
|
loadingText: "Processing...",
|
|
12154
12376
|
children: [
|
|
12155
|
-
/* @__PURE__ */
|
|
12156
|
-
/* @__PURE__ */
|
|
12157
|
-
/* @__PURE__ */
|
|
12377
|
+
/* @__PURE__ */ jsxs60(Card.Header, { children: [
|
|
12378
|
+
/* @__PURE__ */ jsx74(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Category` }),
|
|
12379
|
+
/* @__PURE__ */ jsx74(Card.Description, { children: isEdit ? `Update the details for this category` : `Create a new category and add it to your list` })
|
|
12158
12380
|
] }),
|
|
12159
|
-
/* @__PURE__ */
|
|
12381
|
+
/* @__PURE__ */ jsx74(Card.Content, { children: /* @__PURE__ */ jsxs60(
|
|
12160
12382
|
"form",
|
|
12161
12383
|
{
|
|
12162
12384
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
12163
12385
|
children: [
|
|
12164
|
-
/* @__PURE__ */
|
|
12386
|
+
/* @__PURE__ */ jsx74("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: /* @__PURE__ */ jsx74(
|
|
12165
12387
|
Fields_default.Input,
|
|
12166
12388
|
{
|
|
12167
12389
|
label: "Name",
|
|
@@ -12172,7 +12394,7 @@ function CategoryForm() {
|
|
|
12172
12394
|
required: true
|
|
12173
12395
|
}
|
|
12174
12396
|
) }),
|
|
12175
|
-
/* @__PURE__ */
|
|
12397
|
+
/* @__PURE__ */ jsx74("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx74(
|
|
12176
12398
|
Button,
|
|
12177
12399
|
{
|
|
12178
12400
|
isLoading,
|
|
@@ -12194,7 +12416,7 @@ var CategoryForm_default = CategoryForm;
|
|
|
12194
12416
|
|
|
12195
12417
|
// src/components/categories/Feilds/Category.tsx
|
|
12196
12418
|
import { useParams as useParams12 } from "react-router-dom";
|
|
12197
|
-
import { jsx as
|
|
12419
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
12198
12420
|
function Category({
|
|
12199
12421
|
name,
|
|
12200
12422
|
label,
|
|
@@ -12207,7 +12429,7 @@ function Category({
|
|
|
12207
12429
|
disabled
|
|
12208
12430
|
}) {
|
|
12209
12431
|
const { branchId } = useParams12();
|
|
12210
|
-
return /* @__PURE__ */
|
|
12432
|
+
return /* @__PURE__ */ jsx75("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsx75(
|
|
12211
12433
|
Fields_default.SearchApi,
|
|
12212
12434
|
{
|
|
12213
12435
|
name,
|
|
@@ -12238,7 +12460,7 @@ import { useNavigate as useNavigate13 } from "react-router-dom";
|
|
|
12238
12460
|
import { EllipsisVertical as EllipsisVertical6, FilePenLine as FilePenLine5, Trash2 as Trash26 } from "lucide-react";
|
|
12239
12461
|
import { useState as useState36 } from "react";
|
|
12240
12462
|
import { message as message21 } from "antd";
|
|
12241
|
-
import { Fragment as
|
|
12463
|
+
import { Fragment as Fragment23, jsx as jsx76, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
12242
12464
|
function Products({ v, url }) {
|
|
12243
12465
|
const [deleteProduct, setDeleteProduct] = useState36(null);
|
|
12244
12466
|
const { isLoading, remove } = useApis_default();
|
|
@@ -12252,12 +12474,12 @@ function Products({ v, url }) {
|
|
|
12252
12474
|
const items = (data2) => [
|
|
12253
12475
|
{
|
|
12254
12476
|
label: `Edit Product`,
|
|
12255
|
-
icon: /* @__PURE__ */
|
|
12477
|
+
icon: /* @__PURE__ */ jsx76(FilePenLine5, { size: 16 }),
|
|
12256
12478
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
12257
12479
|
},
|
|
12258
12480
|
{
|
|
12259
12481
|
label: `Delete Product`,
|
|
12260
|
-
icon: /* @__PURE__ */
|
|
12482
|
+
icon: /* @__PURE__ */ jsx76(Trash26, { className: "text-red-500", size: 16 }),
|
|
12261
12483
|
onClick: () => setDeleteProduct(data2)
|
|
12262
12484
|
}
|
|
12263
12485
|
].filter(Boolean);
|
|
@@ -12267,7 +12489,7 @@ function Products({ v, url }) {
|
|
|
12267
12489
|
header: "Name",
|
|
12268
12490
|
cell: ({ row }) => {
|
|
12269
12491
|
const product = row.original;
|
|
12270
|
-
return /* @__PURE__ */
|
|
12492
|
+
return /* @__PURE__ */ jsx76("span", { children: product?.name });
|
|
12271
12493
|
}
|
|
12272
12494
|
},
|
|
12273
12495
|
{
|
|
@@ -12275,7 +12497,7 @@ function Products({ v, url }) {
|
|
|
12275
12497
|
header: "Category",
|
|
12276
12498
|
cell: ({ row }) => {
|
|
12277
12499
|
const product = row.original;
|
|
12278
|
-
return /* @__PURE__ */
|
|
12500
|
+
return /* @__PURE__ */ jsx76("span", { children: product?.categoryData?.name || "N/A" });
|
|
12279
12501
|
}
|
|
12280
12502
|
},
|
|
12281
12503
|
{
|
|
@@ -12283,7 +12505,7 @@ function Products({ v, url }) {
|
|
|
12283
12505
|
header: "Brand",
|
|
12284
12506
|
cell: ({ row }) => {
|
|
12285
12507
|
const product = row.original;
|
|
12286
|
-
return /* @__PURE__ */
|
|
12508
|
+
return /* @__PURE__ */ jsx76("span", { children: product?.brandData?.name || "N/A" });
|
|
12287
12509
|
}
|
|
12288
12510
|
},
|
|
12289
12511
|
{
|
|
@@ -12291,7 +12513,7 @@ function Products({ v, url }) {
|
|
|
12291
12513
|
header: "Cost",
|
|
12292
12514
|
cell: ({ row }) => {
|
|
12293
12515
|
const product = row.original;
|
|
12294
|
-
return /* @__PURE__ */
|
|
12516
|
+
return /* @__PURE__ */ jsxs61("span", { children: [
|
|
12295
12517
|
" ",
|
|
12296
12518
|
product?.cost?.toLocaleString()
|
|
12297
12519
|
] });
|
|
@@ -12302,13 +12524,13 @@ function Products({ v, url }) {
|
|
|
12302
12524
|
header: "Actions",
|
|
12303
12525
|
cell: ({ row }) => {
|
|
12304
12526
|
const data2 = row.original;
|
|
12305
|
-
return /* @__PURE__ */
|
|
12527
|
+
return /* @__PURE__ */ jsx76(
|
|
12306
12528
|
Dropdown,
|
|
12307
12529
|
{
|
|
12308
12530
|
className: "cursor-pointer w-[150px]",
|
|
12309
12531
|
items: items(data2),
|
|
12310
12532
|
triggerMode: "hover",
|
|
12311
|
-
children: /* @__PURE__ */
|
|
12533
|
+
children: /* @__PURE__ */ jsx76(EllipsisVertical6, {})
|
|
12312
12534
|
}
|
|
12313
12535
|
);
|
|
12314
12536
|
}
|
|
@@ -12326,9 +12548,9 @@ function Products({ v, url }) {
|
|
|
12326
12548
|
return error;
|
|
12327
12549
|
}
|
|
12328
12550
|
};
|
|
12329
|
-
return /* @__PURE__ */
|
|
12330
|
-
/* @__PURE__ */
|
|
12331
|
-
/* @__PURE__ */
|
|
12551
|
+
return /* @__PURE__ */ jsxs61(Fragment23, { children: [
|
|
12552
|
+
/* @__PURE__ */ jsx76(Modal2, {}),
|
|
12553
|
+
/* @__PURE__ */ jsx76(
|
|
12332
12554
|
ConfirmModal,
|
|
12333
12555
|
{
|
|
12334
12556
|
isOpen: !!deleteProduct,
|
|
@@ -12341,7 +12563,7 @@ function Products({ v, url }) {
|
|
|
12341
12563
|
children: null
|
|
12342
12564
|
}
|
|
12343
12565
|
),
|
|
12344
|
-
/* @__PURE__ */
|
|
12566
|
+
/* @__PURE__ */ jsx76(
|
|
12345
12567
|
TransactionViewComponent,
|
|
12346
12568
|
{
|
|
12347
12569
|
columns,
|
|
@@ -12373,7 +12595,7 @@ import { useForm as useForm12 } from "react-hook-form";
|
|
|
12373
12595
|
import { zodResolver as zodResolver11 } from "@hookform/resolvers/zod";
|
|
12374
12596
|
import { message as message22 } from "antd";
|
|
12375
12597
|
import { useEffect as useEffect29 } from "react";
|
|
12376
|
-
import { jsx as
|
|
12598
|
+
import { jsx as jsx77, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
12377
12599
|
function ProductForm() {
|
|
12378
12600
|
const { getQuery, navigate } = useApp_default();
|
|
12379
12601
|
const id = getQuery("id");
|
|
@@ -12426,24 +12648,24 @@ function ProductForm() {
|
|
|
12426
12648
|
fetches();
|
|
12427
12649
|
}
|
|
12428
12650
|
}, [id]);
|
|
12429
|
-
return /* @__PURE__ */
|
|
12651
|
+
return /* @__PURE__ */ jsxs62(
|
|
12430
12652
|
Card,
|
|
12431
12653
|
{
|
|
12432
12654
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
12433
12655
|
isLoading: isLoadingGet,
|
|
12434
12656
|
loadingText: "Processing...",
|
|
12435
12657
|
children: [
|
|
12436
|
-
/* @__PURE__ */
|
|
12437
|
-
/* @__PURE__ */
|
|
12438
|
-
/* @__PURE__ */
|
|
12658
|
+
/* @__PURE__ */ jsxs62(Card.Header, { children: [
|
|
12659
|
+
/* @__PURE__ */ jsx77(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Product` }),
|
|
12660
|
+
/* @__PURE__ */ jsx77(Card.Description, { children: isEdit ? `Update the details for this product` : `Create a new product and add it to your list` })
|
|
12439
12661
|
] }),
|
|
12440
|
-
/* @__PURE__ */
|
|
12662
|
+
/* @__PURE__ */ jsx77(Card.Content, { children: /* @__PURE__ */ jsxs62(
|
|
12441
12663
|
"form",
|
|
12442
12664
|
{
|
|
12443
12665
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
12444
12666
|
children: [
|
|
12445
|
-
/* @__PURE__ */
|
|
12446
|
-
/* @__PURE__ */
|
|
12667
|
+
/* @__PURE__ */ jsxs62("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
12668
|
+
/* @__PURE__ */ jsx77(
|
|
12447
12669
|
Fields_default.Input,
|
|
12448
12670
|
{
|
|
12449
12671
|
label: "Name",
|
|
@@ -12454,7 +12676,7 @@ function ProductForm() {
|
|
|
12454
12676
|
required: true
|
|
12455
12677
|
}
|
|
12456
12678
|
),
|
|
12457
|
-
/* @__PURE__ */
|
|
12679
|
+
/* @__PURE__ */ jsx77(
|
|
12458
12680
|
Fields_default.Input,
|
|
12459
12681
|
{
|
|
12460
12682
|
label: "Cost",
|
|
@@ -12465,7 +12687,7 @@ function ProductForm() {
|
|
|
12465
12687
|
required: true
|
|
12466
12688
|
}
|
|
12467
12689
|
),
|
|
12468
|
-
/* @__PURE__ */
|
|
12690
|
+
/* @__PURE__ */ jsx77(
|
|
12469
12691
|
Feilds_default4.Category,
|
|
12470
12692
|
{
|
|
12471
12693
|
label: "Category",
|
|
@@ -12474,7 +12696,7 @@ function ProductForm() {
|
|
|
12474
12696
|
api: "/categories/get"
|
|
12475
12697
|
}
|
|
12476
12698
|
),
|
|
12477
|
-
/* @__PURE__ */
|
|
12699
|
+
/* @__PURE__ */ jsx77(
|
|
12478
12700
|
Feilds_default3.Brand,
|
|
12479
12701
|
{
|
|
12480
12702
|
label: "Brand",
|
|
@@ -12484,7 +12706,7 @@ function ProductForm() {
|
|
|
12484
12706
|
}
|
|
12485
12707
|
)
|
|
12486
12708
|
] }),
|
|
12487
|
-
/* @__PURE__ */
|
|
12709
|
+
/* @__PURE__ */ jsx77("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx77(
|
|
12488
12710
|
Button,
|
|
12489
12711
|
{
|
|
12490
12712
|
isLoading,
|
|
@@ -12506,7 +12728,7 @@ var ProductForm_default = ProductForm;
|
|
|
12506
12728
|
|
|
12507
12729
|
// src/components/products/Feilds/Product.tsx
|
|
12508
12730
|
import { useParams as useParams14 } from "react-router-dom";
|
|
12509
|
-
import { jsx as
|
|
12731
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
12510
12732
|
function Product({
|
|
12511
12733
|
name,
|
|
12512
12734
|
label,
|
|
@@ -12521,7 +12743,7 @@ function Product({
|
|
|
12521
12743
|
obj
|
|
12522
12744
|
}) {
|
|
12523
12745
|
const { branchId } = useParams14();
|
|
12524
|
-
return /* @__PURE__ */
|
|
12746
|
+
return /* @__PURE__ */ jsx78("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsx78(
|
|
12525
12747
|
Fields_default.SearchApi,
|
|
12526
12748
|
{
|
|
12527
12749
|
name,
|
|
@@ -12554,7 +12776,7 @@ import { useNavigate as useNavigate14 } from "react-router-dom";
|
|
|
12554
12776
|
import { EllipsisVertical as EllipsisVertical7, FilePenLine as FilePenLine6, Trash2 as Trash27 } from "lucide-react";
|
|
12555
12777
|
import { useState as useState37 } from "react";
|
|
12556
12778
|
import { message as message23 } from "antd";
|
|
12557
|
-
import { Fragment as
|
|
12779
|
+
import { Fragment as Fragment24, jsx as jsx79, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
12558
12780
|
function Packs({ v, url }) {
|
|
12559
12781
|
const [deletePack, setDeletePack] = useState37(null);
|
|
12560
12782
|
const { isLoading, remove } = useApis_default();
|
|
@@ -12568,12 +12790,12 @@ function Packs({ v, url }) {
|
|
|
12568
12790
|
const items = (data2) => [
|
|
12569
12791
|
{
|
|
12570
12792
|
label: `Edit Pack`,
|
|
12571
|
-
icon: /* @__PURE__ */
|
|
12793
|
+
icon: /* @__PURE__ */ jsx79(FilePenLine6, { size: 16 }),
|
|
12572
12794
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
12573
12795
|
},
|
|
12574
12796
|
{
|
|
12575
12797
|
label: `Delete Pack`,
|
|
12576
|
-
icon: /* @__PURE__ */
|
|
12798
|
+
icon: /* @__PURE__ */ jsx79(Trash27, { className: "text-red-500", size: 16 }),
|
|
12577
12799
|
onClick: () => setDeletePack(data2)
|
|
12578
12800
|
}
|
|
12579
12801
|
].filter(Boolean);
|
|
@@ -12583,7 +12805,7 @@ function Packs({ v, url }) {
|
|
|
12583
12805
|
header: "Name",
|
|
12584
12806
|
cell: ({ row }) => {
|
|
12585
12807
|
const pack = row.original;
|
|
12586
|
-
return /* @__PURE__ */
|
|
12808
|
+
return /* @__PURE__ */ jsx79("span", { children: pack?.name });
|
|
12587
12809
|
}
|
|
12588
12810
|
},
|
|
12589
12811
|
{
|
|
@@ -12591,7 +12813,7 @@ function Packs({ v, url }) {
|
|
|
12591
12813
|
header: "Type",
|
|
12592
12814
|
cell: ({ row }) => {
|
|
12593
12815
|
const pack = row.original;
|
|
12594
|
-
return /* @__PURE__ */
|
|
12816
|
+
return /* @__PURE__ */ jsx79("span", { className: "capitalize", children: pack?.type });
|
|
12595
12817
|
}
|
|
12596
12818
|
},
|
|
12597
12819
|
{
|
|
@@ -12599,7 +12821,7 @@ function Packs({ v, url }) {
|
|
|
12599
12821
|
header: "Products Count",
|
|
12600
12822
|
cell: ({ row }) => {
|
|
12601
12823
|
const pack = row.original;
|
|
12602
|
-
return /* @__PURE__ */
|
|
12824
|
+
return /* @__PURE__ */ jsxs63("span", { children: [
|
|
12603
12825
|
pack?.products?.length || 0,
|
|
12604
12826
|
" Products"
|
|
12605
12827
|
] });
|
|
@@ -12610,13 +12832,13 @@ function Packs({ v, url }) {
|
|
|
12610
12832
|
header: "Actions",
|
|
12611
12833
|
cell: ({ row }) => {
|
|
12612
12834
|
const data2 = row.original;
|
|
12613
|
-
return /* @__PURE__ */
|
|
12835
|
+
return /* @__PURE__ */ jsx79(
|
|
12614
12836
|
Dropdown,
|
|
12615
12837
|
{
|
|
12616
12838
|
className: "cursor-pointer w-[150px]",
|
|
12617
12839
|
items: items(data2),
|
|
12618
12840
|
triggerMode: "hover",
|
|
12619
|
-
children: /* @__PURE__ */
|
|
12841
|
+
children: /* @__PURE__ */ jsx79(EllipsisVertical7, {})
|
|
12620
12842
|
}
|
|
12621
12843
|
);
|
|
12622
12844
|
}
|
|
@@ -12634,9 +12856,9 @@ function Packs({ v, url }) {
|
|
|
12634
12856
|
return error;
|
|
12635
12857
|
}
|
|
12636
12858
|
};
|
|
12637
|
-
return /* @__PURE__ */
|
|
12638
|
-
/* @__PURE__ */
|
|
12639
|
-
/* @__PURE__ */
|
|
12859
|
+
return /* @__PURE__ */ jsxs63(Fragment24, { children: [
|
|
12860
|
+
/* @__PURE__ */ jsx79(Modal2, {}),
|
|
12861
|
+
/* @__PURE__ */ jsx79(
|
|
12640
12862
|
ConfirmModal,
|
|
12641
12863
|
{
|
|
12642
12864
|
isOpen: !!deletePack,
|
|
@@ -12649,7 +12871,7 @@ function Packs({ v, url }) {
|
|
|
12649
12871
|
children: null
|
|
12650
12872
|
}
|
|
12651
12873
|
),
|
|
12652
|
-
/* @__PURE__ */
|
|
12874
|
+
/* @__PURE__ */ jsx79(
|
|
12653
12875
|
TransactionViewComponent,
|
|
12654
12876
|
{
|
|
12655
12877
|
columns,
|
|
@@ -12693,7 +12915,7 @@ import { zodResolver as zodResolver12 } from "@hookform/resolvers/zod";
|
|
|
12693
12915
|
import { message as message24 } from "antd";
|
|
12694
12916
|
import { useEffect as useEffect30 } from "react";
|
|
12695
12917
|
import { Plus as Plus3, Trash2 as Trash28 } from "lucide-react";
|
|
12696
|
-
import { jsx as
|
|
12918
|
+
import { jsx as jsx80, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
12697
12919
|
function PackForm() {
|
|
12698
12920
|
const { getQuery, navigate } = useApp_default();
|
|
12699
12921
|
const id = getQuery("id");
|
|
@@ -12785,24 +13007,24 @@ function PackForm() {
|
|
|
12785
13007
|
setValue("tempCost", currentProduct.cost || 0);
|
|
12786
13008
|
}
|
|
12787
13009
|
}, [currentProduct]);
|
|
12788
|
-
return /* @__PURE__ */
|
|
13010
|
+
return /* @__PURE__ */ jsxs64(
|
|
12789
13011
|
Card,
|
|
12790
13012
|
{
|
|
12791
13013
|
className: "max-w-5xl mx-auto mt-10 relative",
|
|
12792
13014
|
isLoading: isLoadingGet,
|
|
12793
13015
|
loadingText: "Processing...",
|
|
12794
13016
|
children: [
|
|
12795
|
-
/* @__PURE__ */
|
|
12796
|
-
/* @__PURE__ */
|
|
12797
|
-
/* @__PURE__ */
|
|
13017
|
+
/* @__PURE__ */ jsxs64(Card.Header, { children: [
|
|
13018
|
+
/* @__PURE__ */ jsx80(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Pack` }),
|
|
13019
|
+
/* @__PURE__ */ jsx80(Card.Description, { children: isEdit ? `Update the details for this product pack` : `Create a new product pack and define its components` })
|
|
12798
13020
|
] }),
|
|
12799
|
-
/* @__PURE__ */
|
|
13021
|
+
/* @__PURE__ */ jsx80(Card.Content, { children: /* @__PURE__ */ jsxs64(
|
|
12800
13022
|
"form",
|
|
12801
13023
|
{
|
|
12802
13024
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
12803
13025
|
children: [
|
|
12804
|
-
/* @__PURE__ */
|
|
12805
|
-
/* @__PURE__ */
|
|
13026
|
+
/* @__PURE__ */ jsxs64("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4 mb-8", children: [
|
|
13027
|
+
/* @__PURE__ */ jsx80(
|
|
12806
13028
|
Fields_default.Input,
|
|
12807
13029
|
{
|
|
12808
13030
|
label: "Pack Name",
|
|
@@ -12813,7 +13035,7 @@ function PackForm() {
|
|
|
12813
13035
|
required: true
|
|
12814
13036
|
}
|
|
12815
13037
|
),
|
|
12816
|
-
/* @__PURE__ */
|
|
13038
|
+
/* @__PURE__ */ jsx80(
|
|
12817
13039
|
Fields_default.Select,
|
|
12818
13040
|
{
|
|
12819
13041
|
label: "Pack Type",
|
|
@@ -12824,10 +13046,10 @@ function PackForm() {
|
|
|
12824
13046
|
}
|
|
12825
13047
|
)
|
|
12826
13048
|
] }),
|
|
12827
|
-
/* @__PURE__ */
|
|
12828
|
-
/* @__PURE__ */
|
|
12829
|
-
/* @__PURE__ */
|
|
12830
|
-
/* @__PURE__ */
|
|
13049
|
+
/* @__PURE__ */ jsxs64("div", { className: "border rounded-lg p-4 bg-gray-50/50 dark:bg-gray-800/20", children: [
|
|
13050
|
+
/* @__PURE__ */ jsx80("h3", { className: "text-lg font-semibold mb-4", children: "Products in Pack" }),
|
|
13051
|
+
/* @__PURE__ */ jsx80("div", { className: "mb-6 bg-white dark:bg-gray-900 p-4 rounded-lg border shadow-sm", children: /* @__PURE__ */ jsxs64("div", { className: "grid grid-cols-12 gap-3 items-end", children: [
|
|
13052
|
+
/* @__PURE__ */ jsx80("div", { className: "col-span-12 sm:col-span-5", children: /* @__PURE__ */ jsx80(
|
|
12831
13053
|
Feilds_default5.Product,
|
|
12832
13054
|
{
|
|
12833
13055
|
label: "Find Product",
|
|
@@ -12837,7 +13059,7 @@ function PackForm() {
|
|
|
12837
13059
|
obj: "tempData"
|
|
12838
13060
|
}
|
|
12839
13061
|
) }),
|
|
12840
|
-
/* @__PURE__ */
|
|
13062
|
+
/* @__PURE__ */ jsx80("div", { className: "col-span-4 sm:col-span-2", children: /* @__PURE__ */ jsx80(
|
|
12841
13063
|
Fields_default.Input,
|
|
12842
13064
|
{
|
|
12843
13065
|
label: "Qty",
|
|
@@ -12847,7 +13069,7 @@ function PackForm() {
|
|
|
12847
13069
|
placeholder: "1"
|
|
12848
13070
|
}
|
|
12849
13071
|
) }),
|
|
12850
|
-
/* @__PURE__ */
|
|
13072
|
+
/* @__PURE__ */ jsx80("div", { className: "col-span-5 sm:col-span-3", children: /* @__PURE__ */ jsx80(
|
|
12851
13073
|
Fields_default.Input,
|
|
12852
13074
|
{
|
|
12853
13075
|
label: "Cost",
|
|
@@ -12857,39 +13079,39 @@ function PackForm() {
|
|
|
12857
13079
|
placeholder: "0.00"
|
|
12858
13080
|
}
|
|
12859
13081
|
) }),
|
|
12860
|
-
/* @__PURE__ */
|
|
13082
|
+
/* @__PURE__ */ jsx80("div", { className: "col-span-3 sm:col-span-2", children: /* @__PURE__ */ jsx80(
|
|
12861
13083
|
Button,
|
|
12862
13084
|
{
|
|
12863
13085
|
type: "button",
|
|
12864
13086
|
onClick: onAddProduct,
|
|
12865
13087
|
className: "w-full h-[40px]",
|
|
12866
|
-
icon: /* @__PURE__ */
|
|
13088
|
+
icon: /* @__PURE__ */ jsx80(Plus3, { size: 16 }),
|
|
12867
13089
|
children: "Add"
|
|
12868
13090
|
}
|
|
12869
13091
|
) })
|
|
12870
13092
|
] }) }),
|
|
12871
|
-
/* @__PURE__ */
|
|
12872
|
-
/* @__PURE__ */
|
|
12873
|
-
/* @__PURE__ */
|
|
12874
|
-
/* @__PURE__ */
|
|
12875
|
-
/* @__PURE__ */
|
|
12876
|
-
/* @__PURE__ */
|
|
12877
|
-
/* @__PURE__ */
|
|
13093
|
+
/* @__PURE__ */ jsx80("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs64("table", { className: "w-full text-left border-collapse", children: [
|
|
13094
|
+
/* @__PURE__ */ jsx80("thead", { className: "bg-gray-100 dark:bg-gray-800/50", children: /* @__PURE__ */ jsxs64("tr", { children: [
|
|
13095
|
+
/* @__PURE__ */ jsx80("th", { className: "px-3 py-2 text-xs font-bold uppercase text-gray-500", children: "Product" }),
|
|
13096
|
+
/* @__PURE__ */ jsx80("th", { className: "px-3 py-2 text-xs font-bold uppercase text-gray-500 w-24", children: "Qty" }),
|
|
13097
|
+
/* @__PURE__ */ jsx80("th", { className: "px-3 py-2 text-xs font-bold uppercase text-gray-500 w-32", children: "Cost" }),
|
|
13098
|
+
/* @__PURE__ */ jsx80("th", { className: "px-3 py-2 text-xs font-bold uppercase text-gray-500 w-32", children: "Line Total" }),
|
|
13099
|
+
/* @__PURE__ */ jsx80("th", { className: "px-3 py-2 text-xs font-bold uppercase text-gray-500 w-16 text-center", children: "Action" })
|
|
12878
13100
|
] }) }),
|
|
12879
|
-
/* @__PURE__ */
|
|
12880
|
-
fields.map((field, index) => /* @__PURE__ */
|
|
13101
|
+
/* @__PURE__ */ jsxs64("tbody", { className: "divide-y divide-gray-100 dark:divide-gray-800 bg-white dark:bg-gray-900", children: [
|
|
13102
|
+
fields.map((field, index) => /* @__PURE__ */ jsxs64(
|
|
12881
13103
|
"tr",
|
|
12882
13104
|
{
|
|
12883
13105
|
className: "hover:bg-gray-50/50 dark:hover:bg-gray-800/50 transition-colors",
|
|
12884
13106
|
children: [
|
|
12885
|
-
/* @__PURE__ */
|
|
12886
|
-
/* @__PURE__ */
|
|
12887
|
-
field.productData?.sku && /* @__PURE__ */
|
|
13107
|
+
/* @__PURE__ */ jsxs64("td", { className: "px-3 py-2", children: [
|
|
13108
|
+
/* @__PURE__ */ jsx80("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: field.productData?.name || "Product" }),
|
|
13109
|
+
field.productData?.sku && /* @__PURE__ */ jsxs64("p", { className: "text-[10px] text-gray-500", children: [
|
|
12888
13110
|
"SKU: ",
|
|
12889
13111
|
field.productData?.sku
|
|
12890
13112
|
] })
|
|
12891
13113
|
] }),
|
|
12892
|
-
/* @__PURE__ */
|
|
13114
|
+
/* @__PURE__ */ jsx80("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx80(
|
|
12893
13115
|
Fields_default.Input,
|
|
12894
13116
|
{
|
|
12895
13117
|
form: methods,
|
|
@@ -12900,7 +13122,7 @@ function PackForm() {
|
|
|
12900
13122
|
className: "h-8 py-1!"
|
|
12901
13123
|
}
|
|
12902
13124
|
) }),
|
|
12903
|
-
/* @__PURE__ */
|
|
13125
|
+
/* @__PURE__ */ jsx80("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx80(
|
|
12904
13126
|
Fields_default.Input,
|
|
12905
13127
|
{
|
|
12906
13128
|
form: methods,
|
|
@@ -12911,8 +13133,8 @@ function PackForm() {
|
|
|
12911
13133
|
className: "h-8 py-1!"
|
|
12912
13134
|
}
|
|
12913
13135
|
) }),
|
|
12914
|
-
/* @__PURE__ */
|
|
12915
|
-
/* @__PURE__ */
|
|
13136
|
+
/* @__PURE__ */ jsx80("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx80("span", { className: "text-sm font-semibold", children: ((Number(watch(`products.${index}.quantity`)) || 0) * (Number(watch(`products.${index}.cost`)) || 0)).toLocaleString() }) }),
|
|
13137
|
+
/* @__PURE__ */ jsx80("td", { className: "px-3 py-2 text-center", children: /* @__PURE__ */ jsx80(
|
|
12916
13138
|
Button,
|
|
12917
13139
|
{
|
|
12918
13140
|
type: "button",
|
|
@@ -12920,42 +13142,42 @@ function PackForm() {
|
|
|
12920
13142
|
size: "sm",
|
|
12921
13143
|
className: "text-red-500 hover:text-red-700 hover:bg-red-50 p-1 h-8 w-8",
|
|
12922
13144
|
onClick: () => remove(index),
|
|
12923
|
-
children: /* @__PURE__ */
|
|
13145
|
+
children: /* @__PURE__ */ jsx80(Trash28, { size: 16 })
|
|
12924
13146
|
}
|
|
12925
13147
|
) })
|
|
12926
13148
|
]
|
|
12927
13149
|
},
|
|
12928
13150
|
field.id
|
|
12929
13151
|
)),
|
|
12930
|
-
fields.length === 0 && /* @__PURE__ */
|
|
13152
|
+
fields.length === 0 && /* @__PURE__ */ jsx80("tr", { children: /* @__PURE__ */ jsx80("td", { colSpan: 5, className: "text-center py-10", children: /* @__PURE__ */ jsx80("p", { className: "text-sm text-gray-500", children: "No products added yet. Use the search above to add products." }) }) })
|
|
12931
13153
|
] })
|
|
12932
13154
|
] }) }),
|
|
12933
|
-
/* @__PURE__ */
|
|
12934
|
-
/* @__PURE__ */
|
|
12935
|
-
/* @__PURE__ */
|
|
12936
|
-
/* @__PURE__ */
|
|
13155
|
+
/* @__PURE__ */ jsxs64("div", { className: "mt-6 pt-6 border-t grid grid-cols-1 sm:grid-cols-3 gap-3", children: [
|
|
13156
|
+
/* @__PURE__ */ jsxs64("div", { className: "bg-white dark:bg-gray-900 p-3 rounded-lg border shadow-sm", children: [
|
|
13157
|
+
/* @__PURE__ */ jsx80("p", { className: "text-[10px] text-gray-500 uppercase font-bold mb-0.5", children: "Total Lines" }),
|
|
13158
|
+
/* @__PURE__ */ jsx80("p", { className: "text-lg font-bold text-blue-600", children: watch("products")?.length || 0 })
|
|
12937
13159
|
] }),
|
|
12938
|
-
/* @__PURE__ */
|
|
12939
|
-
/* @__PURE__ */
|
|
12940
|
-
/* @__PURE__ */
|
|
13160
|
+
/* @__PURE__ */ jsxs64("div", { className: "bg-white dark:bg-gray-900 p-3 rounded-lg border shadow-sm", children: [
|
|
13161
|
+
/* @__PURE__ */ jsx80("p", { className: "text-[10px] text-gray-500 uppercase font-bold mb-0.5", children: "Total Quantity" }),
|
|
13162
|
+
/* @__PURE__ */ jsx80("p", { className: "text-lg font-bold text-indigo-600", children: watch("products")?.reduce(
|
|
12941
13163
|
(acc, curr) => acc + (Number(curr.quantity) || 0),
|
|
12942
13164
|
0
|
|
12943
13165
|
) })
|
|
12944
13166
|
] }),
|
|
12945
|
-
/* @__PURE__ */
|
|
12946
|
-
/* @__PURE__ */
|
|
12947
|
-
/* @__PURE__ */
|
|
13167
|
+
/* @__PURE__ */ jsxs64("div", { className: "bg-white dark:bg-gray-900 p-3 rounded-lg border shadow-sm", children: [
|
|
13168
|
+
/* @__PURE__ */ jsx80("p", { className: "text-[10px] text-gray-500 uppercase font-bold mb-0.5", children: "Total Cost" }),
|
|
13169
|
+
/* @__PURE__ */ jsxs64("p", { className: "text-lg font-bold text-emerald-600", children: [
|
|
12948
13170
|
watch("products")?.reduce(
|
|
12949
13171
|
(acc, curr) => acc + (Number(curr.quantity) || 0) * (Number(curr.cost) || 0),
|
|
12950
13172
|
0
|
|
12951
13173
|
).toLocaleString(),
|
|
12952
13174
|
" ",
|
|
12953
|
-
/* @__PURE__ */
|
|
13175
|
+
/* @__PURE__ */ jsx80("span", { className: "text-[10px] font-normal text-gray-400", children: "USD" })
|
|
12954
13176
|
] })
|
|
12955
13177
|
] })
|
|
12956
13178
|
] })
|
|
12957
13179
|
] }),
|
|
12958
|
-
/* @__PURE__ */
|
|
13180
|
+
/* @__PURE__ */ jsx80("footer", { className: "flex justify-end mt-8", children: /* @__PURE__ */ jsx80(
|
|
12959
13181
|
Button,
|
|
12960
13182
|
{
|
|
12961
13183
|
isLoading,
|
|
@@ -12976,7 +13198,7 @@ function PackForm() {
|
|
|
12976
13198
|
var PackForm_default = PackForm;
|
|
12977
13199
|
|
|
12978
13200
|
// src/components/packs/Feilds/Pack.tsx
|
|
12979
|
-
import { jsx as
|
|
13201
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
12980
13202
|
function Pack({
|
|
12981
13203
|
name,
|
|
12982
13204
|
label,
|
|
@@ -12988,7 +13210,7 @@ function Pack({
|
|
|
12988
13210
|
required,
|
|
12989
13211
|
disabled
|
|
12990
13212
|
}) {
|
|
12991
|
-
return /* @__PURE__ */
|
|
13213
|
+
return /* @__PURE__ */ jsx81(
|
|
12992
13214
|
Fields_default.SearchApi,
|
|
12993
13215
|
{
|
|
12994
13216
|
label,
|
|
@@ -13014,7 +13236,7 @@ import { EllipsisVertical as EllipsisVertical8, Eye as Eye2, FilePenLine as File
|
|
|
13014
13236
|
|
|
13015
13237
|
// src/hooks/useTransactionView.tsx
|
|
13016
13238
|
import { useState as useState39 } from "react";
|
|
13017
|
-
import { jsx as
|
|
13239
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
13018
13240
|
var useTransactionView = () => {
|
|
13019
13241
|
const [open, setOpen] = useState39(false);
|
|
13020
13242
|
const [id, setId] = useState39("");
|
|
@@ -13040,7 +13262,7 @@ var useTransactionView = () => {
|
|
|
13040
13262
|
};
|
|
13041
13263
|
const TransactionView = () => {
|
|
13042
13264
|
if (!open) return null;
|
|
13043
|
-
return /* @__PURE__ */
|
|
13265
|
+
return /* @__PURE__ */ jsx82(
|
|
13044
13266
|
Views_default.Transaction,
|
|
13045
13267
|
{
|
|
13046
13268
|
close: closeTransaction,
|
|
@@ -13063,7 +13285,7 @@ var useTransactionView = () => {
|
|
|
13063
13285
|
var useTransactionView_default = useTransactionView;
|
|
13064
13286
|
|
|
13065
13287
|
// src/components/journals/Journals.tsx
|
|
13066
|
-
import { Fragment as
|
|
13288
|
+
import { Fragment as Fragment25, jsx as jsx83, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
13067
13289
|
function Journals({
|
|
13068
13290
|
url,
|
|
13069
13291
|
journalType
|
|
@@ -13079,7 +13301,7 @@ function Journals({
|
|
|
13079
13301
|
const items = (data2) => [
|
|
13080
13302
|
{
|
|
13081
13303
|
label: `View Journal`,
|
|
13082
|
-
icon: /* @__PURE__ */
|
|
13304
|
+
icon: /* @__PURE__ */ jsx83(Eye2, { size: 16 }),
|
|
13083
13305
|
className: "min-w-[200px]",
|
|
13084
13306
|
onClick: () => openTransaction({
|
|
13085
13307
|
id: data2?._id,
|
|
@@ -13088,12 +13310,12 @@ function Journals({
|
|
|
13088
13310
|
},
|
|
13089
13311
|
{
|
|
13090
13312
|
label: `Edit Journal`,
|
|
13091
|
-
icon: /* @__PURE__ */
|
|
13313
|
+
icon: /* @__PURE__ */ jsx83(FilePenLine7, { size: 16 }),
|
|
13092
13314
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
13093
13315
|
},
|
|
13094
13316
|
{
|
|
13095
13317
|
label: `Delete Journal`,
|
|
13096
|
-
icon: /* @__PURE__ */
|
|
13318
|
+
icon: /* @__PURE__ */ jsx83(Trash29, { className: "text-red-500", size: 16 }),
|
|
13097
13319
|
onClick: () => {
|
|
13098
13320
|
openTransaction({
|
|
13099
13321
|
id: data2?._id,
|
|
@@ -13109,9 +13331,9 @@ function Journals({
|
|
|
13109
13331
|
header: "Date",
|
|
13110
13332
|
cell: ({ row }) => {
|
|
13111
13333
|
const journal = row.original;
|
|
13112
|
-
return /* @__PURE__ */
|
|
13113
|
-
/* @__PURE__ */
|
|
13114
|
-
/* @__PURE__ */
|
|
13334
|
+
return /* @__PURE__ */ jsxs65("div", { className: "flex flex-col", children: [
|
|
13335
|
+
/* @__PURE__ */ jsx83("span", { children: journal?.date }),
|
|
13336
|
+
/* @__PURE__ */ jsx83(
|
|
13115
13337
|
"span",
|
|
13116
13338
|
{
|
|
13117
13339
|
onClick: () => openTransaction({
|
|
@@ -13130,7 +13352,7 @@ function Journals({
|
|
|
13130
13352
|
header: "Account",
|
|
13131
13353
|
cell: ({ row }) => {
|
|
13132
13354
|
const journal = row.original;
|
|
13133
|
-
return /* @__PURE__ */
|
|
13355
|
+
return /* @__PURE__ */ jsx83("span", { children: journal?.accountData?.name || "N/A" });
|
|
13134
13356
|
}
|
|
13135
13357
|
},
|
|
13136
13358
|
{
|
|
@@ -13138,9 +13360,9 @@ function Journals({
|
|
|
13138
13360
|
header: "Description",
|
|
13139
13361
|
cell: ({ row }) => {
|
|
13140
13362
|
const journal = row.original;
|
|
13141
|
-
return /* @__PURE__ */
|
|
13142
|
-
/* @__PURE__ */
|
|
13143
|
-
journal?.note && /* @__PURE__ */
|
|
13363
|
+
return /* @__PURE__ */ jsxs65("div", { className: "flex flex-col", children: [
|
|
13364
|
+
/* @__PURE__ */ jsx83("span", { className: "capitalize", children: journal?.description }),
|
|
13365
|
+
journal?.note && /* @__PURE__ */ jsxs65("span", { className: "text-xs text-gray-400 italic", children: [
|
|
13144
13366
|
"Note: ",
|
|
13145
13367
|
journal?.note
|
|
13146
13368
|
] })
|
|
@@ -13152,13 +13374,13 @@ function Journals({
|
|
|
13152
13374
|
header: "Amount",
|
|
13153
13375
|
cell: ({ row }) => {
|
|
13154
13376
|
const journal = row.original;
|
|
13155
|
-
return /* @__PURE__ */
|
|
13156
|
-
/* @__PURE__ */
|
|
13157
|
-
journal?.feeAmount > 0 && /* @__PURE__ */
|
|
13377
|
+
return /* @__PURE__ */ jsxs65("div", { className: "flex flex-col", children: [
|
|
13378
|
+
/* @__PURE__ */ jsx83("span", { children: Formats_default.Price(journal?.amount, journal?.currency) }),
|
|
13379
|
+
journal?.feeAmount > 0 && /* @__PURE__ */ jsxs65("span", { className: "text-xs text-green-600", children: [
|
|
13158
13380
|
"with fee: ",
|
|
13159
13381
|
Formats_default.Price(journal?.feeAmount, journal?.currency)
|
|
13160
13382
|
] }),
|
|
13161
|
-
journal?.exchange?.rate && /* @__PURE__ */
|
|
13383
|
+
journal?.exchange?.rate && /* @__PURE__ */ jsxs65("span", { className: "text-xs text-green-600", children: [
|
|
13162
13384
|
"Exchanged:",
|
|
13163
13385
|
" ",
|
|
13164
13386
|
Formats_default.Price(
|
|
@@ -13174,7 +13396,7 @@ function Journals({
|
|
|
13174
13396
|
header: "Type",
|
|
13175
13397
|
cell: ({ row }) => {
|
|
13176
13398
|
const journal = row.original;
|
|
13177
|
-
return /* @__PURE__ */
|
|
13399
|
+
return /* @__PURE__ */ jsx83("span", { className: "capitalize", children: journal?.journal });
|
|
13178
13400
|
}
|
|
13179
13401
|
},
|
|
13180
13402
|
{
|
|
@@ -13182,9 +13404,9 @@ function Journals({
|
|
|
13182
13404
|
header: "Via",
|
|
13183
13405
|
cell: ({ row }) => {
|
|
13184
13406
|
const journal = row.original;
|
|
13185
|
-
return /* @__PURE__ */
|
|
13186
|
-
/* @__PURE__ */
|
|
13187
|
-
journal?.journalVia === "via account" && /* @__PURE__ */
|
|
13407
|
+
return /* @__PURE__ */ jsxs65("div", { className: "", children: [
|
|
13408
|
+
/* @__PURE__ */ jsx83("p", { className: "capitalize", children: journal?.journalVia }),
|
|
13409
|
+
journal?.journalVia === "via account" && /* @__PURE__ */ jsx83("p", { className: "capitalize text-xs text-gray-600", children: journal?.viaAccountData?.name })
|
|
13188
13410
|
] });
|
|
13189
13411
|
}
|
|
13190
13412
|
},
|
|
@@ -13193,7 +13415,7 @@ function Journals({
|
|
|
13193
13415
|
header: "Action",
|
|
13194
13416
|
cell: ({ row }) => {
|
|
13195
13417
|
const journal = row.original;
|
|
13196
|
-
return /* @__PURE__ */
|
|
13418
|
+
return /* @__PURE__ */ jsx83("span", { className: "capitalize", children: journal?.action });
|
|
13197
13419
|
}
|
|
13198
13420
|
},
|
|
13199
13421
|
{
|
|
@@ -13201,23 +13423,23 @@ function Journals({
|
|
|
13201
13423
|
header: "Actions",
|
|
13202
13424
|
cell: ({ row }) => {
|
|
13203
13425
|
const data2 = row.original;
|
|
13204
|
-
return /* @__PURE__ */
|
|
13426
|
+
return /* @__PURE__ */ jsx83(
|
|
13205
13427
|
Dropdown,
|
|
13206
13428
|
{
|
|
13207
13429
|
className: "cursor-pointer ",
|
|
13208
13430
|
items: items(data2),
|
|
13209
13431
|
triggerMode: "hover",
|
|
13210
|
-
children: /* @__PURE__ */
|
|
13432
|
+
children: /* @__PURE__ */ jsx83(EllipsisVertical8, {})
|
|
13211
13433
|
}
|
|
13212
13434
|
);
|
|
13213
13435
|
}
|
|
13214
13436
|
}
|
|
13215
13437
|
];
|
|
13216
13438
|
const journals = data?.data || [];
|
|
13217
|
-
return /* @__PURE__ */
|
|
13218
|
-
/* @__PURE__ */
|
|
13219
|
-
/* @__PURE__ */
|
|
13220
|
-
/* @__PURE__ */
|
|
13439
|
+
return /* @__PURE__ */ jsxs65(Fragment25, { children: [
|
|
13440
|
+
/* @__PURE__ */ jsx83(Modal2, {}),
|
|
13441
|
+
/* @__PURE__ */ jsx83(TransactionView, {}),
|
|
13442
|
+
/* @__PURE__ */ jsx83(
|
|
13221
13443
|
TransactionViewComponent,
|
|
13222
13444
|
{
|
|
13223
13445
|
columns,
|
|
@@ -13292,7 +13514,7 @@ function exchangedAmount({
|
|
|
13292
13514
|
result = amount;
|
|
13293
13515
|
} else if (accountCurrency === "USD") {
|
|
13294
13516
|
result = amount / exchangeRate;
|
|
13295
|
-
} else if (accountCurrency === "
|
|
13517
|
+
} else if (accountCurrency === "RMB") {
|
|
13296
13518
|
result = transactionCurrency === "USD" ? amount * exchangeRate : amount / exchangeRate;
|
|
13297
13519
|
} else if (accountCurrency === "KES") {
|
|
13298
13520
|
result = transactionCurrency === "TZS" ? amount / exchangeRate : amount * exchangeRate;
|
|
@@ -13309,7 +13531,7 @@ var Forex = {
|
|
|
13309
13531
|
var forex_default = Forex;
|
|
13310
13532
|
|
|
13311
13533
|
// src/components/journals/JournalForm.tsx
|
|
13312
|
-
import { Fragment as
|
|
13534
|
+
import { Fragment as Fragment26, jsx as jsx84, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
13313
13535
|
function JournalForm({
|
|
13314
13536
|
isFee = true,
|
|
13315
13537
|
accountType = "all"
|
|
@@ -13413,25 +13635,25 @@ function JournalForm({
|
|
|
13413
13635
|
fetches();
|
|
13414
13636
|
}
|
|
13415
13637
|
}, [id]);
|
|
13416
|
-
return /* @__PURE__ */
|
|
13638
|
+
return /* @__PURE__ */ jsxs66(
|
|
13417
13639
|
Card,
|
|
13418
13640
|
{
|
|
13419
13641
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
13420
13642
|
isLoading: isLoadingGet,
|
|
13421
13643
|
loadingText: "Processing...",
|
|
13422
13644
|
children: [
|
|
13423
|
-
/* @__PURE__ */
|
|
13424
|
-
/* @__PURE__ */
|
|
13425
|
-
/* @__PURE__ */
|
|
13645
|
+
/* @__PURE__ */ jsxs66(Card.Header, { children: [
|
|
13646
|
+
/* @__PURE__ */ jsx84(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Journal` }),
|
|
13647
|
+
/* @__PURE__ */ jsx84(Card.Description, { children: isEdit ? `Update the details for this journal entry` : `Create a new journal entry` })
|
|
13426
13648
|
] }),
|
|
13427
|
-
/* @__PURE__ */
|
|
13649
|
+
/* @__PURE__ */ jsx84(Card.Content, { children: /* @__PURE__ */ jsxs66(
|
|
13428
13650
|
"form",
|
|
13429
13651
|
{
|
|
13430
13652
|
className: "space-y-4",
|
|
13431
13653
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
13432
13654
|
children: [
|
|
13433
|
-
/* @__PURE__ */
|
|
13434
|
-
/* @__PURE__ */
|
|
13655
|
+
/* @__PURE__ */ jsxs66("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
13656
|
+
/* @__PURE__ */ jsx84(
|
|
13435
13657
|
Fields_default.Input,
|
|
13436
13658
|
{
|
|
13437
13659
|
label: "Description",
|
|
@@ -13441,7 +13663,7 @@ function JournalForm({
|
|
|
13441
13663
|
required: true
|
|
13442
13664
|
}
|
|
13443
13665
|
),
|
|
13444
|
-
/* @__PURE__ */
|
|
13666
|
+
/* @__PURE__ */ jsx84(
|
|
13445
13667
|
Fields_default.Select,
|
|
13446
13668
|
{
|
|
13447
13669
|
label: "Journal Via",
|
|
@@ -13452,8 +13674,8 @@ function JournalForm({
|
|
|
13452
13674
|
}
|
|
13453
13675
|
)
|
|
13454
13676
|
] }),
|
|
13455
|
-
/* @__PURE__ */
|
|
13456
|
-
/* @__PURE__ */
|
|
13677
|
+
/* @__PURE__ */ jsxs66("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
13678
|
+
/* @__PURE__ */ jsx84(
|
|
13457
13679
|
Fields_default.DateInput,
|
|
13458
13680
|
{
|
|
13459
13681
|
label: "Date",
|
|
@@ -13462,7 +13684,7 @@ function JournalForm({
|
|
|
13462
13684
|
required: true
|
|
13463
13685
|
}
|
|
13464
13686
|
),
|
|
13465
|
-
journalVia === "via account" && /* @__PURE__ */
|
|
13687
|
+
journalVia === "via account" && /* @__PURE__ */ jsx84(
|
|
13466
13688
|
Feilds_default.Account,
|
|
13467
13689
|
{
|
|
13468
13690
|
label: "Via Account",
|
|
@@ -13476,7 +13698,7 @@ function JournalForm({
|
|
|
13476
13698
|
showBalance: true
|
|
13477
13699
|
}
|
|
13478
13700
|
),
|
|
13479
|
-
/* @__PURE__ */
|
|
13701
|
+
/* @__PURE__ */ jsx84(
|
|
13480
13702
|
Fields_default.Input,
|
|
13481
13703
|
{
|
|
13482
13704
|
label: "Amount",
|
|
@@ -13487,7 +13709,7 @@ function JournalForm({
|
|
|
13487
13709
|
required: true
|
|
13488
13710
|
}
|
|
13489
13711
|
),
|
|
13490
|
-
/* @__PURE__ */
|
|
13712
|
+
/* @__PURE__ */ jsx84(
|
|
13491
13713
|
Feilds_default.Account,
|
|
13492
13714
|
{
|
|
13493
13715
|
label: accountType === "all" ? "Account" : accountType,
|
|
@@ -13501,7 +13723,7 @@ function JournalForm({
|
|
|
13501
13723
|
obj: "accountObject"
|
|
13502
13724
|
}
|
|
13503
13725
|
),
|
|
13504
|
-
journalVia !== "via account" && /* @__PURE__ */
|
|
13726
|
+
journalVia !== "via account" && /* @__PURE__ */ jsx84(
|
|
13505
13727
|
Fields_default.Select,
|
|
13506
13728
|
{
|
|
13507
13729
|
label: "Action",
|
|
@@ -13511,8 +13733,8 @@ function JournalForm({
|
|
|
13511
13733
|
required: true
|
|
13512
13734
|
}
|
|
13513
13735
|
),
|
|
13514
|
-
isRate && /* @__PURE__ */
|
|
13515
|
-
/* @__PURE__ */
|
|
13736
|
+
isRate && /* @__PURE__ */ jsxs66(Fragment26, { children: [
|
|
13737
|
+
/* @__PURE__ */ jsx84(
|
|
13516
13738
|
Fields_default.Input,
|
|
13517
13739
|
{
|
|
13518
13740
|
label: "Rate",
|
|
@@ -13522,7 +13744,7 @@ function JournalForm({
|
|
|
13522
13744
|
required: true
|
|
13523
13745
|
}
|
|
13524
13746
|
),
|
|
13525
|
-
/* @__PURE__ */
|
|
13747
|
+
/* @__PURE__ */ jsx84(
|
|
13526
13748
|
Fields_default.Input,
|
|
13527
13749
|
{
|
|
13528
13750
|
label: "Exchanged Amount",
|
|
@@ -13534,8 +13756,8 @@ function JournalForm({
|
|
|
13534
13756
|
),
|
|
13535
13757
|
" "
|
|
13536
13758
|
] }),
|
|
13537
|
-
isFee && /* @__PURE__ */
|
|
13538
|
-
/* @__PURE__ */
|
|
13759
|
+
isFee && /* @__PURE__ */ jsxs66(Fragment26, { children: [
|
|
13760
|
+
/* @__PURE__ */ jsx84(
|
|
13539
13761
|
Fields_default.Input,
|
|
13540
13762
|
{
|
|
13541
13763
|
label: "Fee",
|
|
@@ -13545,7 +13767,7 @@ function JournalForm({
|
|
|
13545
13767
|
required: true
|
|
13546
13768
|
}
|
|
13547
13769
|
),
|
|
13548
|
-
/* @__PURE__ */
|
|
13770
|
+
/* @__PURE__ */ jsx84(
|
|
13549
13771
|
Fields_default.Input,
|
|
13550
13772
|
{
|
|
13551
13773
|
label: "Amount After Fee",
|
|
@@ -13557,7 +13779,7 @@ function JournalForm({
|
|
|
13557
13779
|
)
|
|
13558
13780
|
] })
|
|
13559
13781
|
] }),
|
|
13560
|
-
/* @__PURE__ */
|
|
13782
|
+
/* @__PURE__ */ jsx84(
|
|
13561
13783
|
Fields_default.Textarea,
|
|
13562
13784
|
{
|
|
13563
13785
|
label: "Note",
|
|
@@ -13566,7 +13788,7 @@ function JournalForm({
|
|
|
13566
13788
|
placeholder: "Add any additional notes here..."
|
|
13567
13789
|
}
|
|
13568
13790
|
),
|
|
13569
|
-
/* @__PURE__ */
|
|
13791
|
+
/* @__PURE__ */ jsx84("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx84(
|
|
13570
13792
|
Button,
|
|
13571
13793
|
{
|
|
13572
13794
|
isLoading,
|
|
@@ -13589,7 +13811,7 @@ var JournalForm_default = JournalForm;
|
|
|
13589
13811
|
// src/components/payment/Payments.tsx
|
|
13590
13812
|
import { useNavigate as useNavigate16, useParams as useParams18 } from "react-router-dom";
|
|
13591
13813
|
import { EllipsisVertical as EllipsisVertical9, Eye as Eye3, FilePenLine as FilePenLine8, Trash2 as Trash210 } from "lucide-react";
|
|
13592
|
-
import { Fragment as
|
|
13814
|
+
import { Fragment as Fragment27, jsx as jsx85, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
13593
13815
|
function Payments({
|
|
13594
13816
|
url,
|
|
13595
13817
|
paymentType
|
|
@@ -13605,17 +13827,17 @@ function Payments({
|
|
|
13605
13827
|
const items = (data2) => [
|
|
13606
13828
|
{
|
|
13607
13829
|
label: `View Payment`,
|
|
13608
|
-
icon: /* @__PURE__ */
|
|
13830
|
+
icon: /* @__PURE__ */ jsx85(Eye3, { size: 16 }),
|
|
13609
13831
|
onClick: () => openTransaction({ id: data2?._id, type: "payment" })
|
|
13610
13832
|
},
|
|
13611
13833
|
{
|
|
13612
13834
|
label: `Edit Payment`,
|
|
13613
|
-
icon: /* @__PURE__ */
|
|
13835
|
+
icon: /* @__PURE__ */ jsx85(FilePenLine8, { size: 16 }),
|
|
13614
13836
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
13615
13837
|
},
|
|
13616
13838
|
{
|
|
13617
13839
|
label: `Delete Payment`,
|
|
13618
|
-
icon: /* @__PURE__ */
|
|
13840
|
+
icon: /* @__PURE__ */ jsx85(Trash210, { className: "text-red-500", size: 16 }),
|
|
13619
13841
|
onClick: () => {
|
|
13620
13842
|
openTransaction({
|
|
13621
13843
|
id: data2?._id,
|
|
@@ -13631,9 +13853,9 @@ function Payments({
|
|
|
13631
13853
|
header: "Date",
|
|
13632
13854
|
cell: ({ row }) => {
|
|
13633
13855
|
const payment = row.original;
|
|
13634
|
-
return /* @__PURE__ */
|
|
13635
|
-
/* @__PURE__ */
|
|
13636
|
-
/* @__PURE__ */
|
|
13856
|
+
return /* @__PURE__ */ jsxs67("div", { className: "flex flex-col", children: [
|
|
13857
|
+
/* @__PURE__ */ jsx85("span", { children: payment?.date }),
|
|
13858
|
+
/* @__PURE__ */ jsx85(
|
|
13637
13859
|
"span",
|
|
13638
13860
|
{
|
|
13639
13861
|
onClick: () => openTransaction({ id: payment?._id, type: "payment" }),
|
|
@@ -13649,7 +13871,7 @@ function Payments({
|
|
|
13649
13871
|
header: "Account",
|
|
13650
13872
|
cell: ({ row }) => {
|
|
13651
13873
|
const payment = row.original;
|
|
13652
|
-
return /* @__PURE__ */
|
|
13874
|
+
return /* @__PURE__ */ jsx85("span", { children: payment?.accountData?.name || "N/A" });
|
|
13653
13875
|
}
|
|
13654
13876
|
},
|
|
13655
13877
|
{
|
|
@@ -13658,7 +13880,7 @@ function Payments({
|
|
|
13658
13880
|
cell: ({ row }) => {
|
|
13659
13881
|
const payment = row.original;
|
|
13660
13882
|
const walletData = payment?.fromWalletData || payment?.toWalletData;
|
|
13661
|
-
return /* @__PURE__ */
|
|
13883
|
+
return /* @__PURE__ */ jsx85("span", { children: walletData?.name || "N/A" });
|
|
13662
13884
|
}
|
|
13663
13885
|
},
|
|
13664
13886
|
{
|
|
@@ -13666,13 +13888,13 @@ function Payments({
|
|
|
13666
13888
|
header: "Amount",
|
|
13667
13889
|
cell: ({ row }) => {
|
|
13668
13890
|
const payment = row.original;
|
|
13669
|
-
return /* @__PURE__ */
|
|
13670
|
-
/* @__PURE__ */
|
|
13671
|
-
payment?.feeAmount > 0 && /* @__PURE__ */
|
|
13891
|
+
return /* @__PURE__ */ jsxs67("div", { className: "flex flex-col", children: [
|
|
13892
|
+
/* @__PURE__ */ jsx85("span", { children: Formats_default.Price(payment?.amount, payment?.currency) }),
|
|
13893
|
+
payment?.feeAmount > 0 && /* @__PURE__ */ jsxs67("span", { className: "text-xs text-green-600", children: [
|
|
13672
13894
|
"fee: ",
|
|
13673
13895
|
Formats_default.Price(payment?.feeAmount, payment?.currency)
|
|
13674
13896
|
] }),
|
|
13675
|
-
payment?.exchange?.rate && /* @__PURE__ */
|
|
13897
|
+
payment?.exchange?.rate && /* @__PURE__ */ jsxs67("span", { className: "text-xs text-green-600", children: [
|
|
13676
13898
|
"Rate: ",
|
|
13677
13899
|
payment?.exchange?.rate,
|
|
13678
13900
|
" (",
|
|
@@ -13690,7 +13912,7 @@ function Payments({
|
|
|
13690
13912
|
header: "Action",
|
|
13691
13913
|
cell: ({ row }) => {
|
|
13692
13914
|
const payment = row.original;
|
|
13693
|
-
return /* @__PURE__ */
|
|
13915
|
+
return /* @__PURE__ */ jsx85(
|
|
13694
13916
|
"span",
|
|
13695
13917
|
{
|
|
13696
13918
|
className: `capitalize ${payment?.action === "debit" ? "text-red-600" : "text-green-600"}`,
|
|
@@ -13704,23 +13926,23 @@ function Payments({
|
|
|
13704
13926
|
header: "Actions",
|
|
13705
13927
|
cell: ({ row }) => {
|
|
13706
13928
|
const data2 = row.original;
|
|
13707
|
-
return /* @__PURE__ */
|
|
13929
|
+
return /* @__PURE__ */ jsx85(
|
|
13708
13930
|
Dropdown,
|
|
13709
13931
|
{
|
|
13710
13932
|
className: "cursor-pointer w-[150px]",
|
|
13711
13933
|
items: items(data2),
|
|
13712
13934
|
triggerMode: "hover",
|
|
13713
|
-
children: /* @__PURE__ */
|
|
13935
|
+
children: /* @__PURE__ */ jsx85(EllipsisVertical9, {})
|
|
13714
13936
|
}
|
|
13715
13937
|
);
|
|
13716
13938
|
}
|
|
13717
13939
|
}
|
|
13718
13940
|
];
|
|
13719
13941
|
const payments = data?.data || [];
|
|
13720
|
-
return /* @__PURE__ */
|
|
13721
|
-
/* @__PURE__ */
|
|
13722
|
-
/* @__PURE__ */
|
|
13723
|
-
/* @__PURE__ */
|
|
13942
|
+
return /* @__PURE__ */ jsxs67(Fragment27, { children: [
|
|
13943
|
+
/* @__PURE__ */ jsx85(TransactionView, {}),
|
|
13944
|
+
/* @__PURE__ */ jsx85(Modal2, {}),
|
|
13945
|
+
/* @__PURE__ */ jsx85(
|
|
13724
13946
|
TransactionViewComponent,
|
|
13725
13947
|
{
|
|
13726
13948
|
columns,
|
|
@@ -13765,7 +13987,7 @@ var paymentSchema = z12.object({
|
|
|
13765
13987
|
});
|
|
13766
13988
|
|
|
13767
13989
|
// src/components/payment/PaymentForm.tsx
|
|
13768
|
-
import { Fragment as
|
|
13990
|
+
import { Fragment as Fragment28, jsx as jsx86, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
13769
13991
|
function PaymentForm({
|
|
13770
13992
|
accountType = "all"
|
|
13771
13993
|
}) {
|
|
@@ -13854,24 +14076,24 @@ function PaymentForm({
|
|
|
13854
14076
|
fetches();
|
|
13855
14077
|
}
|
|
13856
14078
|
}, [id]);
|
|
13857
|
-
return /* @__PURE__ */
|
|
14079
|
+
return /* @__PURE__ */ jsxs68(
|
|
13858
14080
|
Card,
|
|
13859
14081
|
{
|
|
13860
14082
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
13861
14083
|
isLoading: isLoadingGet,
|
|
13862
14084
|
loadingText: "Processing...",
|
|
13863
14085
|
children: [
|
|
13864
|
-
/* @__PURE__ */
|
|
13865
|
-
/* @__PURE__ */
|
|
13866
|
-
/* @__PURE__ */
|
|
14086
|
+
/* @__PURE__ */ jsxs68(Card.Header, { children: [
|
|
14087
|
+
/* @__PURE__ */ jsx86(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Payment` }),
|
|
14088
|
+
/* @__PURE__ */ jsx86(Card.Description, { children: isEdit ? `Update the details for this payment entry` : `Create a new payment and link it to an account and wallet` })
|
|
13867
14089
|
] }),
|
|
13868
|
-
/* @__PURE__ */
|
|
14090
|
+
/* @__PURE__ */ jsx86(Card.Content, { children: /* @__PURE__ */ jsxs68(
|
|
13869
14091
|
"form",
|
|
13870
14092
|
{
|
|
13871
14093
|
className: "space-y-4",
|
|
13872
14094
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
13873
14095
|
children: [
|
|
13874
|
-
/* @__PURE__ */
|
|
14096
|
+
/* @__PURE__ */ jsx86(
|
|
13875
14097
|
Fields_default.Input,
|
|
13876
14098
|
{
|
|
13877
14099
|
label: "Description",
|
|
@@ -13882,8 +14104,8 @@ function PaymentForm({
|
|
|
13882
14104
|
required: true
|
|
13883
14105
|
}
|
|
13884
14106
|
),
|
|
13885
|
-
/* @__PURE__ */
|
|
13886
|
-
/* @__PURE__ */
|
|
14107
|
+
/* @__PURE__ */ jsxs68("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
14108
|
+
/* @__PURE__ */ jsx86(
|
|
13887
14109
|
Fields_default.DateInput,
|
|
13888
14110
|
{
|
|
13889
14111
|
label: "Date",
|
|
@@ -13892,7 +14114,7 @@ function PaymentForm({
|
|
|
13892
14114
|
required: true
|
|
13893
14115
|
}
|
|
13894
14116
|
),
|
|
13895
|
-
/* @__PURE__ */
|
|
14117
|
+
/* @__PURE__ */ jsx86(
|
|
13896
14118
|
Feilds_default.Account,
|
|
13897
14119
|
{
|
|
13898
14120
|
label: accountType === "all" ? "Account" : accountType,
|
|
@@ -13906,8 +14128,8 @@ function PaymentForm({
|
|
|
13906
14128
|
}
|
|
13907
14129
|
)
|
|
13908
14130
|
] }),
|
|
13909
|
-
/* @__PURE__ */
|
|
13910
|
-
/* @__PURE__ */
|
|
14131
|
+
/* @__PURE__ */ jsxs68("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
14132
|
+
/* @__PURE__ */ jsx86(
|
|
13911
14133
|
Feilds_default2.Wallet,
|
|
13912
14134
|
{
|
|
13913
14135
|
label: "Wallet",
|
|
@@ -13919,7 +14141,7 @@ function PaymentForm({
|
|
|
13919
14141
|
obj: "walletObject"
|
|
13920
14142
|
}
|
|
13921
14143
|
),
|
|
13922
|
-
/* @__PURE__ */
|
|
14144
|
+
/* @__PURE__ */ jsx86(
|
|
13923
14145
|
Fields_default.Input,
|
|
13924
14146
|
{
|
|
13925
14147
|
label: "Amount",
|
|
@@ -13931,8 +14153,8 @@ function PaymentForm({
|
|
|
13931
14153
|
}
|
|
13932
14154
|
),
|
|
13933
14155
|
" ",
|
|
13934
|
-
isRate && /* @__PURE__ */
|
|
13935
|
-
/* @__PURE__ */
|
|
14156
|
+
isRate && /* @__PURE__ */ jsxs68(Fragment28, { children: [
|
|
14157
|
+
/* @__PURE__ */ jsx86(
|
|
13936
14158
|
Fields_default.Input,
|
|
13937
14159
|
{
|
|
13938
14160
|
label: `Rate (1 ${walletObj?.currency} = ? ${accountObj?.currency})`,
|
|
@@ -13942,7 +14164,7 @@ function PaymentForm({
|
|
|
13942
14164
|
required: true
|
|
13943
14165
|
}
|
|
13944
14166
|
),
|
|
13945
|
-
/* @__PURE__ */
|
|
14167
|
+
/* @__PURE__ */ jsx86(
|
|
13946
14168
|
Fields_default.Input,
|
|
13947
14169
|
{
|
|
13948
14170
|
label: "Exchanged Amount",
|
|
@@ -13953,7 +14175,7 @@ function PaymentForm({
|
|
|
13953
14175
|
}
|
|
13954
14176
|
)
|
|
13955
14177
|
] }),
|
|
13956
|
-
/* @__PURE__ */
|
|
14178
|
+
/* @__PURE__ */ jsx86(
|
|
13957
14179
|
Fields_default.Select,
|
|
13958
14180
|
{
|
|
13959
14181
|
label: "Action",
|
|
@@ -13963,9 +14185,9 @@ function PaymentForm({
|
|
|
13963
14185
|
required: true
|
|
13964
14186
|
}
|
|
13965
14187
|
),
|
|
13966
|
-
/* @__PURE__ */
|
|
14188
|
+
/* @__PURE__ */ jsx86(Fields_default.Input, { label: "Fee", type: "number", name: "fee", form: methods })
|
|
13967
14189
|
] }),
|
|
13968
|
-
/* @__PURE__ */
|
|
14190
|
+
/* @__PURE__ */ jsx86(
|
|
13969
14191
|
Fields_default.Textarea,
|
|
13970
14192
|
{
|
|
13971
14193
|
label: "Note",
|
|
@@ -13974,7 +14196,7 @@ function PaymentForm({
|
|
|
13974
14196
|
placeholder: "Add any additional notes here..."
|
|
13975
14197
|
}
|
|
13976
14198
|
),
|
|
13977
|
-
/* @__PURE__ */
|
|
14199
|
+
/* @__PURE__ */ jsx86("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx86(
|
|
13978
14200
|
Button,
|
|
13979
14201
|
{
|
|
13980
14202
|
isLoading,
|
|
@@ -13997,7 +14219,7 @@ var PaymentForm_default = PaymentForm;
|
|
|
13997
14219
|
// src/components/moneyTransfer/MoneyTransfers.tsx
|
|
13998
14220
|
import { useNavigate as useNavigate17, useParams as useParams20 } from "react-router-dom";
|
|
13999
14221
|
import { EllipsisVertical as EllipsisVertical10, FilePenLine as FilePenLine9, Trash2 as Trash211 } from "lucide-react";
|
|
14000
|
-
import { Fragment as
|
|
14222
|
+
import { Fragment as Fragment29, jsx as jsx87, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
14001
14223
|
function MoneyTransfers({ url }) {
|
|
14002
14224
|
const { branchId } = useParams20();
|
|
14003
14225
|
const navigate = useNavigate17();
|
|
@@ -14010,17 +14232,17 @@ function MoneyTransfers({ url }) {
|
|
|
14010
14232
|
const items = (data2) => [
|
|
14011
14233
|
{
|
|
14012
14234
|
label: `View Transfer`,
|
|
14013
|
-
icon: /* @__PURE__ */
|
|
14235
|
+
icon: /* @__PURE__ */ jsx87(FilePenLine9, { size: 16 }),
|
|
14014
14236
|
onClick: () => openTransaction({ id: data2?._id, type: "money transfer" })
|
|
14015
14237
|
},
|
|
14016
14238
|
{
|
|
14017
14239
|
label: `Edit Transfer`,
|
|
14018
|
-
icon: /* @__PURE__ */
|
|
14240
|
+
icon: /* @__PURE__ */ jsx87(FilePenLine9, { size: 16 }),
|
|
14019
14241
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
14020
14242
|
},
|
|
14021
14243
|
{
|
|
14022
14244
|
label: `Reverse Transfer`,
|
|
14023
|
-
icon: /* @__PURE__ */
|
|
14245
|
+
icon: /* @__PURE__ */ jsx87(Trash211, { className: "text-red-500", size: 16 }),
|
|
14024
14246
|
onClick: () => {
|
|
14025
14247
|
openTransaction({
|
|
14026
14248
|
id: data2?._id,
|
|
@@ -14036,9 +14258,9 @@ function MoneyTransfers({ url }) {
|
|
|
14036
14258
|
header: "Date",
|
|
14037
14259
|
cell: ({ row }) => {
|
|
14038
14260
|
const transfer = row.original;
|
|
14039
|
-
return /* @__PURE__ */
|
|
14040
|
-
/* @__PURE__ */
|
|
14041
|
-
/* @__PURE__ */
|
|
14261
|
+
return /* @__PURE__ */ jsxs69("div", { className: "flex flex-col", children: [
|
|
14262
|
+
/* @__PURE__ */ jsx87("span", { children: transfer?.date }),
|
|
14263
|
+
/* @__PURE__ */ jsx87(
|
|
14042
14264
|
"span",
|
|
14043
14265
|
{
|
|
14044
14266
|
onClick: () => openTransaction({ id: transfer?._id, type: "money transfer" }),
|
|
@@ -14054,7 +14276,7 @@ function MoneyTransfers({ url }) {
|
|
|
14054
14276
|
header: "From Wallet",
|
|
14055
14277
|
cell: ({ row }) => {
|
|
14056
14278
|
const transfer = row.original;
|
|
14057
|
-
return /* @__PURE__ */
|
|
14279
|
+
return /* @__PURE__ */ jsx87("span", { children: transfer?.fromWalletData?.name || "N/A" });
|
|
14058
14280
|
}
|
|
14059
14281
|
},
|
|
14060
14282
|
{
|
|
@@ -14062,7 +14284,7 @@ function MoneyTransfers({ url }) {
|
|
|
14062
14284
|
header: "To Wallet",
|
|
14063
14285
|
cell: ({ row }) => {
|
|
14064
14286
|
const transfer = row.original;
|
|
14065
|
-
return /* @__PURE__ */
|
|
14287
|
+
return /* @__PURE__ */ jsx87("span", { children: transfer?.toWalletData?.name || "N/A" });
|
|
14066
14288
|
}
|
|
14067
14289
|
},
|
|
14068
14290
|
{
|
|
@@ -14070,13 +14292,13 @@ function MoneyTransfers({ url }) {
|
|
|
14070
14292
|
header: "Amount",
|
|
14071
14293
|
cell: ({ row }) => {
|
|
14072
14294
|
const transfer = row.original;
|
|
14073
|
-
return /* @__PURE__ */
|
|
14074
|
-
/* @__PURE__ */
|
|
14075
|
-
transfer?.fee > 0 && /* @__PURE__ */
|
|
14295
|
+
return /* @__PURE__ */ jsxs69("div", { className: "flex flex-col", children: [
|
|
14296
|
+
/* @__PURE__ */ jsx87("span", { children: Formats_default.Price(transfer?.amount, transfer?.currency) }),
|
|
14297
|
+
transfer?.fee > 0 && /* @__PURE__ */ jsxs69("span", { className: "text-xs text-orange-600", children: [
|
|
14076
14298
|
"Fee: ",
|
|
14077
14299
|
Formats_default.Price(transfer?.fee, transfer?.currency)
|
|
14078
14300
|
] }),
|
|
14079
|
-
transfer?.exchange?.rate && /* @__PURE__ */
|
|
14301
|
+
transfer?.exchange?.rate && /* @__PURE__ */ jsxs69("span", { className: "text-xs text-green-600", children: [
|
|
14080
14302
|
"Rate: ",
|
|
14081
14303
|
transfer?.exchange?.rate,
|
|
14082
14304
|
" (",
|
|
@@ -14094,23 +14316,23 @@ function MoneyTransfers({ url }) {
|
|
|
14094
14316
|
header: "Actions",
|
|
14095
14317
|
cell: ({ row }) => {
|
|
14096
14318
|
const data2 = row.original;
|
|
14097
|
-
return /* @__PURE__ */
|
|
14319
|
+
return /* @__PURE__ */ jsx87(
|
|
14098
14320
|
Dropdown,
|
|
14099
14321
|
{
|
|
14100
14322
|
className: "cursor-pointer w-[150px]",
|
|
14101
14323
|
items: items(data2),
|
|
14102
14324
|
triggerMode: "hover",
|
|
14103
|
-
children: /* @__PURE__ */
|
|
14325
|
+
children: /* @__PURE__ */ jsx87(EllipsisVertical10, {})
|
|
14104
14326
|
}
|
|
14105
14327
|
);
|
|
14106
14328
|
}
|
|
14107
14329
|
}
|
|
14108
14330
|
];
|
|
14109
14331
|
const transfers = data?.data || [];
|
|
14110
|
-
return /* @__PURE__ */
|
|
14111
|
-
/* @__PURE__ */
|
|
14112
|
-
/* @__PURE__ */
|
|
14113
|
-
/* @__PURE__ */
|
|
14332
|
+
return /* @__PURE__ */ jsxs69(Fragment29, { children: [
|
|
14333
|
+
/* @__PURE__ */ jsx87(Modal2, {}),
|
|
14334
|
+
/* @__PURE__ */ jsx87(TransactionView, {}),
|
|
14335
|
+
/* @__PURE__ */ jsx87(
|
|
14114
14336
|
TransactionViewComponent,
|
|
14115
14337
|
{
|
|
14116
14338
|
columns,
|
|
@@ -14153,7 +14375,7 @@ var moneyTransferSchema = z13.object({
|
|
|
14153
14375
|
});
|
|
14154
14376
|
|
|
14155
14377
|
// src/components/moneyTransfer/MoneyTransferForm.tsx
|
|
14156
|
-
import { jsx as
|
|
14378
|
+
import { jsx as jsx88, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
14157
14379
|
function MoneyTransferForm() {
|
|
14158
14380
|
const { branchId } = useParams21();
|
|
14159
14381
|
const { getQuery, navigate } = useApp_default();
|
|
@@ -14233,26 +14455,26 @@ function MoneyTransferForm() {
|
|
|
14233
14455
|
fetches();
|
|
14234
14456
|
}
|
|
14235
14457
|
}, [id]);
|
|
14236
|
-
return /* @__PURE__ */
|
|
14458
|
+
return /* @__PURE__ */ jsxs70(
|
|
14237
14459
|
Card,
|
|
14238
14460
|
{
|
|
14239
14461
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
14240
14462
|
isLoading: isLoadingGet,
|
|
14241
14463
|
loadingText: "Processing...",
|
|
14242
14464
|
children: [
|
|
14243
|
-
/* @__PURE__ */
|
|
14244
|
-
/* @__PURE__ */
|
|
14245
|
-
/* @__PURE__ */
|
|
14465
|
+
/* @__PURE__ */ jsxs70(Card.Header, { children: [
|
|
14466
|
+
/* @__PURE__ */ jsx88(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Money Transfer` }),
|
|
14467
|
+
/* @__PURE__ */ jsx88(Card.Description, { children: isEdit ? `Update the details for this money transfer` : `Move funds between two wallets` })
|
|
14246
14468
|
] }),
|
|
14247
|
-
/* @__PURE__ */
|
|
14469
|
+
/* @__PURE__ */ jsx88(Card.Content, { children: /* @__PURE__ */ jsxs70(
|
|
14248
14470
|
"form",
|
|
14249
14471
|
{
|
|
14250
14472
|
className: "space-y-4",
|
|
14251
14473
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
14252
14474
|
children: [
|
|
14253
14475
|
" ",
|
|
14254
|
-
/* @__PURE__ */
|
|
14255
|
-
/* @__PURE__ */
|
|
14476
|
+
/* @__PURE__ */ jsxs70("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
14477
|
+
/* @__PURE__ */ jsx88(
|
|
14256
14478
|
Feilds_default2.Wallet,
|
|
14257
14479
|
{
|
|
14258
14480
|
label: "Source Wallet (From)",
|
|
@@ -14265,7 +14487,7 @@ function MoneyTransferForm() {
|
|
|
14265
14487
|
filter: [toWallet]
|
|
14266
14488
|
}
|
|
14267
14489
|
),
|
|
14268
|
-
/* @__PURE__ */
|
|
14490
|
+
/* @__PURE__ */ jsx88(
|
|
14269
14491
|
Feilds_default2.Wallet,
|
|
14270
14492
|
{
|
|
14271
14493
|
label: "Destination Wallet (To)",
|
|
@@ -14279,8 +14501,8 @@ function MoneyTransferForm() {
|
|
|
14279
14501
|
}
|
|
14280
14502
|
)
|
|
14281
14503
|
] }),
|
|
14282
|
-
/* @__PURE__ */
|
|
14283
|
-
/* @__PURE__ */
|
|
14504
|
+
/* @__PURE__ */ jsxs70("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-4", children: [
|
|
14505
|
+
/* @__PURE__ */ jsx88(
|
|
14284
14506
|
Fields_default.DateInput,
|
|
14285
14507
|
{
|
|
14286
14508
|
label: "Date",
|
|
@@ -14289,7 +14511,7 @@ function MoneyTransferForm() {
|
|
|
14289
14511
|
required: true
|
|
14290
14512
|
}
|
|
14291
14513
|
),
|
|
14292
|
-
/* @__PURE__ */
|
|
14514
|
+
/* @__PURE__ */ jsx88(
|
|
14293
14515
|
Fields_default.Input,
|
|
14294
14516
|
{
|
|
14295
14517
|
label: "Amount",
|
|
@@ -14300,7 +14522,7 @@ function MoneyTransferForm() {
|
|
|
14300
14522
|
required: true
|
|
14301
14523
|
}
|
|
14302
14524
|
),
|
|
14303
|
-
/* @__PURE__ */
|
|
14525
|
+
/* @__PURE__ */ jsx88(
|
|
14304
14526
|
Fields_default.Input,
|
|
14305
14527
|
{
|
|
14306
14528
|
label: "Fee (Optional)",
|
|
@@ -14311,8 +14533,8 @@ function MoneyTransferForm() {
|
|
|
14311
14533
|
}
|
|
14312
14534
|
)
|
|
14313
14535
|
] }),
|
|
14314
|
-
isRate && /* @__PURE__ */
|
|
14315
|
-
/* @__PURE__ */
|
|
14536
|
+
isRate && /* @__PURE__ */ jsxs70("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
14537
|
+
/* @__PURE__ */ jsx88(
|
|
14316
14538
|
Fields_default.Input,
|
|
14317
14539
|
{
|
|
14318
14540
|
label: `Rate (1 ${fromWalletObj?.currency} = ? ${toWalletObj?.currency})`,
|
|
@@ -14322,7 +14544,7 @@ function MoneyTransferForm() {
|
|
|
14322
14544
|
required: true
|
|
14323
14545
|
}
|
|
14324
14546
|
),
|
|
14325
|
-
/* @__PURE__ */
|
|
14547
|
+
/* @__PURE__ */ jsx88(
|
|
14326
14548
|
Fields_default.Input,
|
|
14327
14549
|
{
|
|
14328
14550
|
label: "Exchanged Amount",
|
|
@@ -14333,7 +14555,7 @@ function MoneyTransferForm() {
|
|
|
14333
14555
|
}
|
|
14334
14556
|
)
|
|
14335
14557
|
] }),
|
|
14336
|
-
/* @__PURE__ */
|
|
14558
|
+
/* @__PURE__ */ jsx88(
|
|
14337
14559
|
Fields_default.Textarea,
|
|
14338
14560
|
{
|
|
14339
14561
|
label: "Note",
|
|
@@ -14342,7 +14564,7 @@ function MoneyTransferForm() {
|
|
|
14342
14564
|
placeholder: "Add any additional notes here..."
|
|
14343
14565
|
}
|
|
14344
14566
|
),
|
|
14345
|
-
/* @__PURE__ */
|
|
14567
|
+
/* @__PURE__ */ jsx88("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx88(
|
|
14346
14568
|
Button,
|
|
14347
14569
|
{
|
|
14348
14570
|
isLoading,
|
|
@@ -14365,7 +14587,7 @@ var MoneyTransferForm_default = MoneyTransferForm;
|
|
|
14365
14587
|
// src/components/expense/Expenses.tsx
|
|
14366
14588
|
import { useNavigate as useNavigate18, useParams as useParams22 } from "react-router-dom";
|
|
14367
14589
|
import { EllipsisVertical as EllipsisVertical11, FilePenLine as FilePenLine10, Trash2 as Trash212 } from "lucide-react";
|
|
14368
|
-
import { Fragment as
|
|
14590
|
+
import { Fragment as Fragment30, jsx as jsx89, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
14369
14591
|
function Expenses({ url }) {
|
|
14370
14592
|
const { branchId } = useParams22();
|
|
14371
14593
|
const navigate = useNavigate18();
|
|
@@ -14378,17 +14600,17 @@ function Expenses({ url }) {
|
|
|
14378
14600
|
const items = (data2) => [
|
|
14379
14601
|
{
|
|
14380
14602
|
label: `View Expense`,
|
|
14381
|
-
icon: /* @__PURE__ */
|
|
14603
|
+
icon: /* @__PURE__ */ jsx89(FilePenLine10, { size: 16 }),
|
|
14382
14604
|
onClick: () => openTransaction({ id: data2?._id, type: "expense" })
|
|
14383
14605
|
},
|
|
14384
14606
|
{
|
|
14385
14607
|
label: `Edit Expense`,
|
|
14386
|
-
icon: /* @__PURE__ */
|
|
14608
|
+
icon: /* @__PURE__ */ jsx89(FilePenLine10, { size: 16 }),
|
|
14387
14609
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
14388
14610
|
},
|
|
14389
14611
|
{
|
|
14390
14612
|
label: `Delete Expense`,
|
|
14391
|
-
icon: /* @__PURE__ */
|
|
14613
|
+
icon: /* @__PURE__ */ jsx89(Trash212, { className: "text-red-500", size: 16 }),
|
|
14392
14614
|
onClick: () => {
|
|
14393
14615
|
openTransaction({
|
|
14394
14616
|
id: data2?._id,
|
|
@@ -14404,9 +14626,9 @@ function Expenses({ url }) {
|
|
|
14404
14626
|
header: "Date",
|
|
14405
14627
|
cell: ({ row }) => {
|
|
14406
14628
|
const expense = row.original;
|
|
14407
|
-
return /* @__PURE__ */
|
|
14408
|
-
/* @__PURE__ */
|
|
14409
|
-
/* @__PURE__ */
|
|
14629
|
+
return /* @__PURE__ */ jsxs71("div", { className: "flex flex-col", children: [
|
|
14630
|
+
/* @__PURE__ */ jsx89("span", { children: expense?.date }),
|
|
14631
|
+
/* @__PURE__ */ jsx89(
|
|
14410
14632
|
"span",
|
|
14411
14633
|
{
|
|
14412
14634
|
onClick: () => openTransaction({ id: expense?._id, type: "expense" }),
|
|
@@ -14422,9 +14644,9 @@ function Expenses({ url }) {
|
|
|
14422
14644
|
header: "Description",
|
|
14423
14645
|
cell: ({ row }) => {
|
|
14424
14646
|
const expense = row.original;
|
|
14425
|
-
return /* @__PURE__ */
|
|
14426
|
-
/* @__PURE__ */
|
|
14427
|
-
expense?.note && /* @__PURE__ */
|
|
14647
|
+
return /* @__PURE__ */ jsxs71("div", { className: "flex flex-col", children: [
|
|
14648
|
+
/* @__PURE__ */ jsx89("span", { className: "capitalize", children: expense?.description }),
|
|
14649
|
+
expense?.note && /* @__PURE__ */ jsx89("span", { className: "text-xs text-gray-500 italic max-w-xs truncate", children: expense?.note })
|
|
14428
14650
|
] });
|
|
14429
14651
|
}
|
|
14430
14652
|
},
|
|
@@ -14434,7 +14656,7 @@ function Expenses({ url }) {
|
|
|
14434
14656
|
cell: ({ row }) => {
|
|
14435
14657
|
const expense = row.original;
|
|
14436
14658
|
const walletData = expense?.fromWalletData || expense?.toWalletData;
|
|
14437
|
-
return /* @__PURE__ */
|
|
14659
|
+
return /* @__PURE__ */ jsx89("span", { children: walletData?.name || "N/A" });
|
|
14438
14660
|
}
|
|
14439
14661
|
},
|
|
14440
14662
|
{
|
|
@@ -14442,7 +14664,7 @@ function Expenses({ url }) {
|
|
|
14442
14664
|
header: "Amount",
|
|
14443
14665
|
cell: ({ row }) => {
|
|
14444
14666
|
const expense = row.original;
|
|
14445
|
-
return /* @__PURE__ */
|
|
14667
|
+
return /* @__PURE__ */ jsx89("span", { className: "font-medium text-red-600", children: Formats_default.Price(expense?.amount, expense?.currency) });
|
|
14446
14668
|
}
|
|
14447
14669
|
},
|
|
14448
14670
|
{
|
|
@@ -14450,23 +14672,23 @@ function Expenses({ url }) {
|
|
|
14450
14672
|
header: "Actions",
|
|
14451
14673
|
cell: ({ row }) => {
|
|
14452
14674
|
const data2 = row.original;
|
|
14453
|
-
return /* @__PURE__ */
|
|
14675
|
+
return /* @__PURE__ */ jsx89(
|
|
14454
14676
|
Dropdown,
|
|
14455
14677
|
{
|
|
14456
14678
|
className: "cursor-pointer w-[150px]",
|
|
14457
14679
|
items: items(data2),
|
|
14458
14680
|
triggerMode: "hover",
|
|
14459
|
-
children: /* @__PURE__ */
|
|
14681
|
+
children: /* @__PURE__ */ jsx89(EllipsisVertical11, {})
|
|
14460
14682
|
}
|
|
14461
14683
|
);
|
|
14462
14684
|
}
|
|
14463
14685
|
}
|
|
14464
14686
|
];
|
|
14465
14687
|
const expenses = data?.data || [];
|
|
14466
|
-
return /* @__PURE__ */
|
|
14467
|
-
/* @__PURE__ */
|
|
14468
|
-
/* @__PURE__ */
|
|
14469
|
-
/* @__PURE__ */
|
|
14688
|
+
return /* @__PURE__ */ jsxs71(Fragment30, { children: [
|
|
14689
|
+
/* @__PURE__ */ jsx89(TransactionView, {}),
|
|
14690
|
+
/* @__PURE__ */ jsx89(Modal2, {}),
|
|
14691
|
+
/* @__PURE__ */ jsx89(
|
|
14470
14692
|
TransactionViewComponent,
|
|
14471
14693
|
{
|
|
14472
14694
|
columns,
|
|
@@ -14505,7 +14727,7 @@ var expenseSchema = z14.object({
|
|
|
14505
14727
|
});
|
|
14506
14728
|
|
|
14507
14729
|
// src/components/expense/ExpenseForm.tsx
|
|
14508
|
-
import { jsx as
|
|
14730
|
+
import { jsx as jsx90, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
14509
14731
|
function ExpenseForm() {
|
|
14510
14732
|
const { branchId } = useParams23();
|
|
14511
14733
|
const { getQuery, navigate } = useApp_default();
|
|
@@ -14563,25 +14785,25 @@ function ExpenseForm() {
|
|
|
14563
14785
|
fetches();
|
|
14564
14786
|
}
|
|
14565
14787
|
}, [id]);
|
|
14566
|
-
return /* @__PURE__ */
|
|
14788
|
+
return /* @__PURE__ */ jsxs72(
|
|
14567
14789
|
Card,
|
|
14568
14790
|
{
|
|
14569
14791
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
14570
14792
|
isLoading: isLoadingGet,
|
|
14571
14793
|
loadingText: "Processing...",
|
|
14572
14794
|
children: [
|
|
14573
|
-
/* @__PURE__ */
|
|
14574
|
-
/* @__PURE__ */
|
|
14575
|
-
/* @__PURE__ */
|
|
14795
|
+
/* @__PURE__ */ jsxs72(Card.Header, { children: [
|
|
14796
|
+
/* @__PURE__ */ jsx90(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Expense` }),
|
|
14797
|
+
/* @__PURE__ */ jsx90(Card.Description, { children: isEdit ? `Update the details for this expense entry` : `Record a new business expense` })
|
|
14576
14798
|
] }),
|
|
14577
|
-
/* @__PURE__ */
|
|
14799
|
+
/* @__PURE__ */ jsx90(Card.Content, { children: /* @__PURE__ */ jsxs72(
|
|
14578
14800
|
"form",
|
|
14579
14801
|
{
|
|
14580
14802
|
className: "space-y-4",
|
|
14581
14803
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
14582
14804
|
children: [
|
|
14583
|
-
/* @__PURE__ */
|
|
14584
|
-
/* @__PURE__ */
|
|
14805
|
+
/* @__PURE__ */ jsxs72("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
14806
|
+
/* @__PURE__ */ jsx90(
|
|
14585
14807
|
Fields_default.Input,
|
|
14586
14808
|
{
|
|
14587
14809
|
label: "Description",
|
|
@@ -14591,7 +14813,7 @@ function ExpenseForm() {
|
|
|
14591
14813
|
required: true
|
|
14592
14814
|
}
|
|
14593
14815
|
),
|
|
14594
|
-
/* @__PURE__ */
|
|
14816
|
+
/* @__PURE__ */ jsx90(
|
|
14595
14817
|
Feilds_default2.Wallet,
|
|
14596
14818
|
{
|
|
14597
14819
|
label: "Wallet",
|
|
@@ -14604,8 +14826,8 @@ function ExpenseForm() {
|
|
|
14604
14826
|
}
|
|
14605
14827
|
)
|
|
14606
14828
|
] }),
|
|
14607
|
-
/* @__PURE__ */
|
|
14608
|
-
/* @__PURE__ */
|
|
14829
|
+
/* @__PURE__ */ jsxs72("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
14830
|
+
/* @__PURE__ */ jsx90(
|
|
14609
14831
|
Fields_default.DateInput,
|
|
14610
14832
|
{
|
|
14611
14833
|
label: "Date",
|
|
@@ -14614,7 +14836,7 @@ function ExpenseForm() {
|
|
|
14614
14836
|
required: true
|
|
14615
14837
|
}
|
|
14616
14838
|
),
|
|
14617
|
-
/* @__PURE__ */
|
|
14839
|
+
/* @__PURE__ */ jsx90(
|
|
14618
14840
|
Fields_default.Input,
|
|
14619
14841
|
{
|
|
14620
14842
|
label: "Amount",
|
|
@@ -14626,7 +14848,7 @@ function ExpenseForm() {
|
|
|
14626
14848
|
}
|
|
14627
14849
|
)
|
|
14628
14850
|
] }),
|
|
14629
|
-
/* @__PURE__ */
|
|
14851
|
+
/* @__PURE__ */ jsx90(
|
|
14630
14852
|
Fields_default.Textarea,
|
|
14631
14853
|
{
|
|
14632
14854
|
label: "Note",
|
|
@@ -14635,7 +14857,7 @@ function ExpenseForm() {
|
|
|
14635
14857
|
placeholder: "Add any additional details..."
|
|
14636
14858
|
}
|
|
14637
14859
|
),
|
|
14638
|
-
/* @__PURE__ */
|
|
14860
|
+
/* @__PURE__ */ jsx90("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx90(
|
|
14639
14861
|
Button,
|
|
14640
14862
|
{
|
|
14641
14863
|
isLoading,
|
|
@@ -14656,28 +14878,28 @@ function ExpenseForm() {
|
|
|
14656
14878
|
var ExpenseForm_default = ExpenseForm;
|
|
14657
14879
|
|
|
14658
14880
|
// src/components/ErrorPage/ErrorPage.tsx
|
|
14659
|
-
import { jsx as
|
|
14881
|
+
import { jsx as jsx91, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
14660
14882
|
var ErrorPageBase = ({
|
|
14661
14883
|
title,
|
|
14662
|
-
message:
|
|
14884
|
+
message: message31,
|
|
14663
14885
|
statusCode,
|
|
14664
14886
|
action,
|
|
14665
14887
|
className = ""
|
|
14666
14888
|
}) => {
|
|
14667
|
-
return /* @__PURE__ */
|
|
14889
|
+
return /* @__PURE__ */ jsx91(
|
|
14668
14890
|
"div",
|
|
14669
14891
|
{
|
|
14670
14892
|
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}`,
|
|
14671
|
-
children: /* @__PURE__ */
|
|
14672
|
-
statusCode && /* @__PURE__ */
|
|
14673
|
-
/* @__PURE__ */
|
|
14674
|
-
statusCode && /* @__PURE__ */
|
|
14893
|
+
children: /* @__PURE__ */ jsxs73("div", { className: "relative flex flex-col items-center justify-center w-full max-w-2xl text-center", children: [
|
|
14894
|
+
statusCode && /* @__PURE__ */ jsx91("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__ */ jsx91("span", { className: "text-[12rem] sm:text-[16rem] md:text-[20rem] font-bold leading-none tracking-tighter", children: statusCode }) }),
|
|
14895
|
+
/* @__PURE__ */ jsxs73("div", { className: "relative z-10 space-y-6", children: [
|
|
14896
|
+
statusCode && /* @__PURE__ */ jsxs73("h2", { className: "text-xl md:text-2xl font-semibold text-zinc-500 dark:text-zinc-400", children: [
|
|
14675
14897
|
"Error ",
|
|
14676
14898
|
statusCode
|
|
14677
14899
|
] }),
|
|
14678
|
-
title && /* @__PURE__ */
|
|
14679
|
-
|
|
14680
|
-
action && /* @__PURE__ */
|
|
14900
|
+
title && /* @__PURE__ */ jsx91("h1", { className: "text-4xl md:text-5xl font-extrabold tracking-tight drop-shadow-sm", children: title }),
|
|
14901
|
+
message31 && /* @__PURE__ */ jsx91("p", { className: "text-lg md:text-xl text-zinc-600 dark:text-zinc-400 max-w-md mx-auto", children: message31 }),
|
|
14902
|
+
action && /* @__PURE__ */ jsx91("div", { className: "pt-8", children: /* @__PURE__ */ jsx91(
|
|
14681
14903
|
"button",
|
|
14682
14904
|
{
|
|
14683
14905
|
onClick: action.onClick,
|
|
@@ -14693,9 +14915,9 @@ var ErrorPageBase = ({
|
|
|
14693
14915
|
};
|
|
14694
14916
|
|
|
14695
14917
|
// src/components/ErrorPage/ErrorPage.500.tsx
|
|
14696
|
-
import { jsx as
|
|
14918
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
14697
14919
|
var ErrorPage500 = (props) => {
|
|
14698
|
-
return /* @__PURE__ */
|
|
14920
|
+
return /* @__PURE__ */ jsx92(
|
|
14699
14921
|
ErrorPageBase,
|
|
14700
14922
|
{
|
|
14701
14923
|
statusCode: 500,
|
|
@@ -14708,9 +14930,9 @@ var ErrorPage500 = (props) => {
|
|
|
14708
14930
|
};
|
|
14709
14931
|
|
|
14710
14932
|
// src/components/ErrorPage/ErrorPage.404.tsx
|
|
14711
|
-
import { jsx as
|
|
14933
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
14712
14934
|
var ErrorPage404 = (props) => {
|
|
14713
|
-
return /* @__PURE__ */
|
|
14935
|
+
return /* @__PURE__ */ jsx93(
|
|
14714
14936
|
ErrorPageBase,
|
|
14715
14937
|
{
|
|
14716
14938
|
statusCode: 404,
|
|
@@ -14723,9 +14945,9 @@ var ErrorPage404 = (props) => {
|
|
|
14723
14945
|
};
|
|
14724
14946
|
|
|
14725
14947
|
// src/components/ErrorPage/ErrorPage.401.tsx
|
|
14726
|
-
import { jsx as
|
|
14948
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
14727
14949
|
var ErrorPage401 = (props) => {
|
|
14728
|
-
return /* @__PURE__ */
|
|
14950
|
+
return /* @__PURE__ */ jsx94(
|
|
14729
14951
|
ErrorPageBase,
|
|
14730
14952
|
{
|
|
14731
14953
|
statusCode: 401,
|
|
@@ -14738,9 +14960,9 @@ var ErrorPage401 = (props) => {
|
|
|
14738
14960
|
};
|
|
14739
14961
|
|
|
14740
14962
|
// src/components/ErrorPage/ErrorPage.400.tsx
|
|
14741
|
-
import { jsx as
|
|
14963
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
14742
14964
|
var ErrorPage400 = (props) => {
|
|
14743
|
-
return /* @__PURE__ */
|
|
14965
|
+
return /* @__PURE__ */ jsx95(
|
|
14744
14966
|
ErrorPageBase,
|
|
14745
14967
|
{
|
|
14746
14968
|
statusCode: 400,
|
|
@@ -14761,7 +14983,7 @@ var ErrorPage = Object.assign(ErrorPageBase, {
|
|
|
14761
14983
|
});
|
|
14762
14984
|
|
|
14763
14985
|
// src/components/accounts/Report.tsx
|
|
14764
|
-
import { Fragment as
|
|
14986
|
+
import { Fragment as Fragment31, jsx as jsx96, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
14765
14987
|
var AccountReport = () => {
|
|
14766
14988
|
const { apiConfig } = useWarqadConfig();
|
|
14767
14989
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
@@ -14780,9 +15002,9 @@ var AccountReport = () => {
|
|
|
14780
15002
|
header: "Date",
|
|
14781
15003
|
key: "date",
|
|
14782
15004
|
className: "text-xs whitespace-nowrap",
|
|
14783
|
-
render: (row) => /* @__PURE__ */
|
|
14784
|
-
/* @__PURE__ */
|
|
14785
|
-
/* @__PURE__ */
|
|
15005
|
+
render: (row) => /* @__PURE__ */ jsxs74("div", { className: "", children: [
|
|
15006
|
+
/* @__PURE__ */ jsx96("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
|
|
15007
|
+
/* @__PURE__ */ jsx96(
|
|
14786
15008
|
"span",
|
|
14787
15009
|
{
|
|
14788
15010
|
onClick: () => {
|
|
@@ -14801,7 +15023,7 @@ var AccountReport = () => {
|
|
|
14801
15023
|
header: "Description",
|
|
14802
15024
|
key: "description",
|
|
14803
15025
|
className: "text-xs w-full break-words",
|
|
14804
|
-
render: (row) => /* @__PURE__ */
|
|
15026
|
+
render: (row) => /* @__PURE__ */ jsx96("span", { className: "font-bold text-black dark:text-white print:text-black", children: row.description })
|
|
14805
15027
|
},
|
|
14806
15028
|
{
|
|
14807
15029
|
header: "Credit",
|
|
@@ -14810,16 +15032,16 @@ var AccountReport = () => {
|
|
|
14810
15032
|
render: (row) => {
|
|
14811
15033
|
const Amount = row.calculatedAmount;
|
|
14812
15034
|
const fee = 0;
|
|
14813
|
-
return /* @__PURE__ */
|
|
14814
|
-
/* @__PURE__ */
|
|
14815
|
-
fee > 0 && /* @__PURE__ */
|
|
15035
|
+
return /* @__PURE__ */ jsx96("div", { className: "", children: Amount > 0 ? /* @__PURE__ */ jsxs74(Fragment31, { children: [
|
|
15036
|
+
/* @__PURE__ */ jsx96("p", { className: "font-bold text-green-500 dark:text-green-500 print:text-green-500", children: Formats_default.Amount(Amount) }),
|
|
15037
|
+
fee > 0 && /* @__PURE__ */ jsxs74("span", { className: "text-[8px]", children: [
|
|
14816
15038
|
"fee:(",
|
|
14817
15039
|
fee,
|
|
14818
15040
|
")"
|
|
14819
15041
|
] })
|
|
14820
15042
|
] }) : "" });
|
|
14821
15043
|
},
|
|
14822
|
-
renderFooter: (data2) => /* @__PURE__ */
|
|
15044
|
+
renderFooter: (data2) => /* @__PURE__ */ jsx96("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
|
|
14823
15045
|
data2.reduce(
|
|
14824
15046
|
(acc, row) => acc + (row.calculatedAmount > 0 ? row.calculatedAmount : 0),
|
|
14825
15047
|
0
|
|
@@ -14833,16 +15055,16 @@ var AccountReport = () => {
|
|
|
14833
15055
|
render: (row) => {
|
|
14834
15056
|
const Amount = row.calculatedAmount;
|
|
14835
15057
|
const fee = 0;
|
|
14836
|
-
return /* @__PURE__ */
|
|
14837
|
-
/* @__PURE__ */
|
|
14838
|
-
fee > 0 && /* @__PURE__ */
|
|
15058
|
+
return /* @__PURE__ */ jsx96("div", { className: "", children: Amount < 0 ? /* @__PURE__ */ jsxs74(Fragment31, { children: [
|
|
15059
|
+
/* @__PURE__ */ jsx96("p", { className: "font-bold text-red-500 dark:text-red-500 print:text-red-500", children: Formats_default.Amount(Amount) }),
|
|
15060
|
+
fee > 0 && /* @__PURE__ */ jsxs74("span", { className: "text-[8px]", children: [
|
|
14839
15061
|
"Fee:(",
|
|
14840
15062
|
fee,
|
|
14841
15063
|
")"
|
|
14842
15064
|
] })
|
|
14843
15065
|
] }) : "" });
|
|
14844
15066
|
},
|
|
14845
|
-
renderFooter: (data2) => /* @__PURE__ */
|
|
15067
|
+
renderFooter: (data2) => /* @__PURE__ */ jsx96("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
|
|
14846
15068
|
data2.reduce(
|
|
14847
15069
|
(acc, row) => acc + (row.calculatedAmount < 0 ? row.calculatedAmount : 0),
|
|
14848
15070
|
0
|
|
@@ -14853,8 +15075,8 @@ var AccountReport = () => {
|
|
|
14853
15075
|
header: "Balance",
|
|
14854
15076
|
key: "runningBalance",
|
|
14855
15077
|
className: "text-xs whitespace-nowrap text-right",
|
|
14856
|
-
render: (row) => /* @__PURE__ */
|
|
14857
|
-
renderFooter: (data2) => /* @__PURE__ */
|
|
15078
|
+
render: (row) => /* @__PURE__ */ jsx96("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Price(row.runningBalance, currency) }),
|
|
15079
|
+
renderFooter: (data2) => /* @__PURE__ */ jsx96("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
|
|
14858
15080
|
data2.reduce((acc, row) => acc + row.calculatedAmount, 0),
|
|
14859
15081
|
currency
|
|
14860
15082
|
) })
|
|
@@ -14873,9 +15095,9 @@ var AccountReport = () => {
|
|
|
14873
15095
|
{ label: "Account Type", value: data?.data?.type },
|
|
14874
15096
|
{ label: "Currency", value: data?.data?.currency }
|
|
14875
15097
|
];
|
|
14876
|
-
return /* @__PURE__ */
|
|
14877
|
-
/* @__PURE__ */
|
|
14878
|
-
/* @__PURE__ */
|
|
15098
|
+
return /* @__PURE__ */ jsxs74(Fragment31, { children: [
|
|
15099
|
+
/* @__PURE__ */ jsx96(TransactionView, {}),
|
|
15100
|
+
/* @__PURE__ */ jsx96(
|
|
14879
15101
|
A4DataView,
|
|
14880
15102
|
{
|
|
14881
15103
|
columns,
|
|
@@ -14892,7 +15114,7 @@ var AccountReport = () => {
|
|
|
14892
15114
|
var Report_default = AccountReport;
|
|
14893
15115
|
|
|
14894
15116
|
// src/components/wallets/Report.tsx
|
|
14895
|
-
import { Fragment as
|
|
15117
|
+
import { Fragment as Fragment32, jsx as jsx97, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
14896
15118
|
var WalletReport = () => {
|
|
14897
15119
|
const { apiConfig } = useWarqadConfig();
|
|
14898
15120
|
const { getParams } = useApp_default();
|
|
@@ -14910,9 +15132,9 @@ var WalletReport = () => {
|
|
|
14910
15132
|
header: "Date",
|
|
14911
15133
|
key: "date",
|
|
14912
15134
|
className: "text-xs whitespace-nowrap",
|
|
14913
|
-
render: (row) => /* @__PURE__ */
|
|
14914
|
-
/* @__PURE__ */
|
|
14915
|
-
/* @__PURE__ */
|
|
15135
|
+
render: (row) => /* @__PURE__ */ jsxs75("div", { className: "", children: [
|
|
15136
|
+
/* @__PURE__ */ jsx97("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
|
|
15137
|
+
/* @__PURE__ */ jsx97(
|
|
14916
15138
|
"span",
|
|
14917
15139
|
{
|
|
14918
15140
|
onClick: () => {
|
|
@@ -14931,7 +15153,7 @@ var WalletReport = () => {
|
|
|
14931
15153
|
header: "Description",
|
|
14932
15154
|
key: "description",
|
|
14933
15155
|
className: "text-xs w-full break-words",
|
|
14934
|
-
render: (row) => /* @__PURE__ */
|
|
15156
|
+
render: (row) => /* @__PURE__ */ jsx97("span", { className: "font-bold text-black dark:text-white print:text-black", children: row.description })
|
|
14935
15157
|
},
|
|
14936
15158
|
{
|
|
14937
15159
|
header: "Credit",
|
|
@@ -14940,9 +15162,9 @@ var WalletReport = () => {
|
|
|
14940
15162
|
render: (row) => {
|
|
14941
15163
|
const Amount = row.calculatedAmount;
|
|
14942
15164
|
const fee = 0;
|
|
14943
|
-
return /* @__PURE__ */
|
|
14944
|
-
/* @__PURE__ */
|
|
14945
|
-
fee > 0 && /* @__PURE__ */
|
|
15165
|
+
return /* @__PURE__ */ jsx97("div", { className: "", children: Amount > 0 ? /* @__PURE__ */ jsxs75(Fragment32, { children: [
|
|
15166
|
+
/* @__PURE__ */ jsx97("p", { className: "font-bold text-green-500 dark:text-green-500 print:text-green-500", children: Formats_default.Amount(Amount) }),
|
|
15167
|
+
fee > 0 && /* @__PURE__ */ jsxs75("span", { className: "text-[8px]", children: [
|
|
14946
15168
|
"fee:(",
|
|
14947
15169
|
fee,
|
|
14948
15170
|
")"
|
|
@@ -14950,7 +15172,7 @@ var WalletReport = () => {
|
|
|
14950
15172
|
] }) : "" });
|
|
14951
15173
|
},
|
|
14952
15174
|
renderFooter: (data2) => {
|
|
14953
|
-
return /* @__PURE__ */
|
|
15175
|
+
return /* @__PURE__ */ jsx97("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
|
|
14954
15176
|
data2.reduce(
|
|
14955
15177
|
(acc, row) => acc + (row.calculatedAmount > 0 ? row.calculatedAmount : 0),
|
|
14956
15178
|
0
|
|
@@ -14966,16 +15188,16 @@ var WalletReport = () => {
|
|
|
14966
15188
|
render: (row) => {
|
|
14967
15189
|
const Amount = row.calculatedAmount;
|
|
14968
15190
|
const fee = 0;
|
|
14969
|
-
return /* @__PURE__ */
|
|
14970
|
-
/* @__PURE__ */
|
|
14971
|
-
fee > 0 && /* @__PURE__ */
|
|
15191
|
+
return /* @__PURE__ */ jsx97("div", { className: "", children: Amount < 0 ? /* @__PURE__ */ jsxs75(Fragment32, { children: [
|
|
15192
|
+
/* @__PURE__ */ jsx97("p", { className: "font-bold text-red-500 dark:text-red-500 print:text-red-500", children: Formats_default.Amount(Amount) }),
|
|
15193
|
+
fee > 0 && /* @__PURE__ */ jsxs75("span", { className: "text-[8px]", children: [
|
|
14972
15194
|
"Fee:(",
|
|
14973
15195
|
fee,
|
|
14974
15196
|
")"
|
|
14975
15197
|
] })
|
|
14976
15198
|
] }) : "" });
|
|
14977
15199
|
},
|
|
14978
|
-
renderFooter: (data2) => /* @__PURE__ */
|
|
15200
|
+
renderFooter: (data2) => /* @__PURE__ */ jsx97("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
|
|
14979
15201
|
data2.reduce(
|
|
14980
15202
|
(acc, row) => acc + (row.calculatedAmount < 0 ? row.calculatedAmount : 0),
|
|
14981
15203
|
0
|
|
@@ -14986,8 +15208,8 @@ var WalletReport = () => {
|
|
|
14986
15208
|
header: "Balance",
|
|
14987
15209
|
key: "runningBalance",
|
|
14988
15210
|
className: "text-xs whitespace-nowrap text-right",
|
|
14989
|
-
render: (row) => /* @__PURE__ */
|
|
14990
|
-
renderFooter: (data2) => /* @__PURE__ */
|
|
15211
|
+
render: (row) => /* @__PURE__ */ jsx97("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Price(row.runningBalance, currency) }),
|
|
15212
|
+
renderFooter: (data2) => /* @__PURE__ */ jsx97("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
|
|
14991
15213
|
data2.reduce((acc, row) => acc + row.calculatedAmount, 0),
|
|
14992
15214
|
currency
|
|
14993
15215
|
) })
|
|
@@ -15006,10 +15228,10 @@ var WalletReport = () => {
|
|
|
15006
15228
|
{ label: "Wallet Account No", value: data?.data?.accountNo || "N/A" },
|
|
15007
15229
|
{ label: "Currency", value: data?.data?.currency }
|
|
15008
15230
|
];
|
|
15009
|
-
return /* @__PURE__ */
|
|
15010
|
-
/* @__PURE__ */
|
|
15011
|
-
/* @__PURE__ */
|
|
15012
|
-
A4DataView,
|
|
15231
|
+
return /* @__PURE__ */ jsxs75(Fragment32, { children: [
|
|
15232
|
+
/* @__PURE__ */ jsx97(TransactionView, {}),
|
|
15233
|
+
/* @__PURE__ */ jsx97(
|
|
15234
|
+
A4DataView,
|
|
15013
15235
|
{
|
|
15014
15236
|
columns,
|
|
15015
15237
|
data: datas || [],
|
|
@@ -15027,7 +15249,7 @@ var Report_default2 = WalletReport;
|
|
|
15027
15249
|
// src/components/accounts/Statements.tsx
|
|
15028
15250
|
import { useNavigate as useNavigate19, useSearchParams as useSearchParams3 } from "react-router-dom";
|
|
15029
15251
|
import { useMemo as useMemo14, useState as useState44, useEffect as useEffect35 } from "react";
|
|
15030
|
-
import { Fragment as
|
|
15252
|
+
import { Fragment as Fragment33, jsx as jsx98, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
15031
15253
|
var options = [
|
|
15032
15254
|
{ label: "All", value: "all" },
|
|
15033
15255
|
{ label: "Debit", value: "debit" },
|
|
@@ -15092,7 +15314,7 @@ var AccountStatements = () => {
|
|
|
15092
15314
|
header: "Name",
|
|
15093
15315
|
key: "name",
|
|
15094
15316
|
className: "text-xs whitespace-nowrap ",
|
|
15095
|
-
render: (row) => /* @__PURE__ */
|
|
15317
|
+
render: (row) => /* @__PURE__ */ jsx98("div", { className: "", children: /* @__PURE__ */ jsx98(
|
|
15096
15318
|
"p",
|
|
15097
15319
|
{
|
|
15098
15320
|
onClick: () => navigate(`${row._id}`),
|
|
@@ -15108,9 +15330,9 @@ var AccountStatements = () => {
|
|
|
15108
15330
|
render: (row) => {
|
|
15109
15331
|
const Amount = row.balance;
|
|
15110
15332
|
const fee = 0;
|
|
15111
|
-
return /* @__PURE__ */
|
|
15112
|
-
/* @__PURE__ */
|
|
15113
|
-
fee > 0 && /* @__PURE__ */
|
|
15333
|
+
return /* @__PURE__ */ jsx98("div", { className: "", children: Amount > 0 ? /* @__PURE__ */ jsxs76(Fragment33, { children: [
|
|
15334
|
+
/* @__PURE__ */ jsx98("p", { className: "font-bold text-green-500 dark:text-green-500 print:text-green-500", children: Formats_default.Amount(Amount) }),
|
|
15335
|
+
fee > 0 && /* @__PURE__ */ jsxs76("span", { className: "text-[8px]", children: [
|
|
15114
15336
|
"fee:(",
|
|
15115
15337
|
fee,
|
|
15116
15338
|
")"
|
|
@@ -15118,7 +15340,7 @@ var AccountStatements = () => {
|
|
|
15118
15340
|
] }) : "" });
|
|
15119
15341
|
},
|
|
15120
15342
|
renderFooter: (data2) => {
|
|
15121
|
-
return /* @__PURE__ */
|
|
15343
|
+
return /* @__PURE__ */ jsx98("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
|
|
15122
15344
|
data2.reduce(
|
|
15123
15345
|
(acc, row) => acc + (row.balance > 0 ? row.balance : 0),
|
|
15124
15346
|
0
|
|
@@ -15134,16 +15356,16 @@ var AccountStatements = () => {
|
|
|
15134
15356
|
render: (row) => {
|
|
15135
15357
|
const Amount = row.balance;
|
|
15136
15358
|
const fee = 0;
|
|
15137
|
-
return /* @__PURE__ */
|
|
15138
|
-
/* @__PURE__ */
|
|
15139
|
-
fee > 0 && /* @__PURE__ */
|
|
15359
|
+
return /* @__PURE__ */ jsx98("div", { className: "", children: Amount < 0 ? /* @__PURE__ */ jsxs76(Fragment33, { children: [
|
|
15360
|
+
/* @__PURE__ */ jsx98("p", { className: "font-bold text-red-500 dark:text-red-500 print:text-red-500", children: Formats_default.Amount(Amount) }),
|
|
15361
|
+
fee > 0 && /* @__PURE__ */ jsxs76("span", { className: "text-[8px]", children: [
|
|
15140
15362
|
"Fee:(",
|
|
15141
15363
|
fee,
|
|
15142
15364
|
")"
|
|
15143
15365
|
] })
|
|
15144
15366
|
] }) : "" });
|
|
15145
15367
|
},
|
|
15146
|
-
renderFooter: (data2) => /* @__PURE__ */
|
|
15368
|
+
renderFooter: (data2) => /* @__PURE__ */ jsx98("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
|
|
15147
15369
|
data2.reduce(
|
|
15148
15370
|
(acc, row) => acc + (row.balance < 0 ? row.balance : 0),
|
|
15149
15371
|
0
|
|
@@ -15154,8 +15376,8 @@ var AccountStatements = () => {
|
|
|
15154
15376
|
header: "Balance",
|
|
15155
15377
|
key: "runningBalance",
|
|
15156
15378
|
className: "text-xs whitespace-nowrap text-right",
|
|
15157
|
-
render: (row) => /* @__PURE__ */
|
|
15158
|
-
renderFooter: (data2) => /* @__PURE__ */
|
|
15379
|
+
render: (row) => /* @__PURE__ */ jsx98("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)) }),
|
|
15380
|
+
renderFooter: (data2) => /* @__PURE__ */ jsx98("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
|
|
15159
15381
|
data2.reduce((acc, row) => acc + row.balance, 0),
|
|
15160
15382
|
currency || (currencyFilter === "all" ? void 0 : currencyFilter)
|
|
15161
15383
|
) })
|
|
@@ -15180,9 +15402,9 @@ var AccountStatements = () => {
|
|
|
15180
15402
|
if (filter === "credit")
|
|
15181
15403
|
return result.filter((item) => item.runningBalance > 0);
|
|
15182
15404
|
}, [filter, currencyFilter, data]);
|
|
15183
|
-
return /* @__PURE__ */
|
|
15184
|
-
/* @__PURE__ */
|
|
15185
|
-
/* @__PURE__ */
|
|
15405
|
+
return /* @__PURE__ */ jsxs76(Fragment33, { children: [
|
|
15406
|
+
/* @__PURE__ */ jsx98(TransactionView, {}),
|
|
15407
|
+
/* @__PURE__ */ jsx98(
|
|
15186
15408
|
A4DataView,
|
|
15187
15409
|
{
|
|
15188
15410
|
columns,
|
|
@@ -15191,8 +15413,8 @@ var AccountStatements = () => {
|
|
|
15191
15413
|
title: `Account Statement`,
|
|
15192
15414
|
subtitle: `All Outstanding Balances`,
|
|
15193
15415
|
fixed: false,
|
|
15194
|
-
headers: /* @__PURE__ */
|
|
15195
|
-
/* @__PURE__ */
|
|
15416
|
+
headers: /* @__PURE__ */ jsxs76("div", { className: "flex gap-2", children: [
|
|
15417
|
+
/* @__PURE__ */ jsx98(
|
|
15196
15418
|
Fields_default.Select,
|
|
15197
15419
|
{
|
|
15198
15420
|
options,
|
|
@@ -15201,7 +15423,7 @@ var AccountStatements = () => {
|
|
|
15201
15423
|
className: "min-w-[150px] print:hidden"
|
|
15202
15424
|
}
|
|
15203
15425
|
),
|
|
15204
|
-
/* @__PURE__ */
|
|
15426
|
+
/* @__PURE__ */ jsx98(
|
|
15205
15427
|
Fields_default.Select,
|
|
15206
15428
|
{
|
|
15207
15429
|
options: [
|
|
@@ -15226,7 +15448,7 @@ var Statements_default = AccountStatements;
|
|
|
15226
15448
|
// src/components/wallets/Statements.tsx
|
|
15227
15449
|
import { useNavigate as useNavigate20, useSearchParams as useSearchParams4 } from "react-router-dom";
|
|
15228
15450
|
import { useMemo as useMemo15, useState as useState45, useEffect as useEffect36 } from "react";
|
|
15229
|
-
import { Fragment as
|
|
15451
|
+
import { Fragment as Fragment34, jsx as jsx99, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
15230
15452
|
var options2 = [
|
|
15231
15453
|
{ label: "All", value: "all" },
|
|
15232
15454
|
{ label: "Debit", value: "debit" },
|
|
@@ -15289,7 +15511,7 @@ var WalletStatements = () => {
|
|
|
15289
15511
|
header: "Name",
|
|
15290
15512
|
key: "name",
|
|
15291
15513
|
className: "text-xs whitespace-nowrap",
|
|
15292
|
-
render: (row) => /* @__PURE__ */
|
|
15514
|
+
render: (row) => /* @__PURE__ */ jsx99("div", { className: "", children: /* @__PURE__ */ jsx99(
|
|
15293
15515
|
"p",
|
|
15294
15516
|
{
|
|
15295
15517
|
onClick: () => navigate(`${row._id}`),
|
|
@@ -15305,9 +15527,9 @@ var WalletStatements = () => {
|
|
|
15305
15527
|
render: (row) => {
|
|
15306
15528
|
const Amount = row.balance;
|
|
15307
15529
|
const fee = 0;
|
|
15308
|
-
return /* @__PURE__ */
|
|
15309
|
-
/* @__PURE__ */
|
|
15310
|
-
fee > 0 && /* @__PURE__ */
|
|
15530
|
+
return /* @__PURE__ */ jsx99("div", { className: "", children: Amount > 0 ? /* @__PURE__ */ jsxs77(Fragment34, { children: [
|
|
15531
|
+
/* @__PURE__ */ jsx99("p", { className: "font-bold text-green-500 dark:text-green-500 print:text-green-500", children: Formats_default.Amount(Amount) }),
|
|
15532
|
+
fee > 0 && /* @__PURE__ */ jsxs77("span", { className: "text-[8px]", children: [
|
|
15311
15533
|
"fee:(",
|
|
15312
15534
|
fee,
|
|
15313
15535
|
")"
|
|
@@ -15315,7 +15537,7 @@ var WalletStatements = () => {
|
|
|
15315
15537
|
] }) : "" });
|
|
15316
15538
|
},
|
|
15317
15539
|
renderFooter: (data2) => {
|
|
15318
|
-
return /* @__PURE__ */
|
|
15540
|
+
return /* @__PURE__ */ jsx99("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
|
|
15319
15541
|
data2.reduce(
|
|
15320
15542
|
(acc, row) => acc + (row.balance > 0 ? row.balance : 0),
|
|
15321
15543
|
0
|
|
@@ -15331,16 +15553,16 @@ var WalletStatements = () => {
|
|
|
15331
15553
|
render: (row) => {
|
|
15332
15554
|
const Amount = row.balance;
|
|
15333
15555
|
const fee = 0;
|
|
15334
|
-
return /* @__PURE__ */
|
|
15335
|
-
/* @__PURE__ */
|
|
15336
|
-
fee > 0 && /* @__PURE__ */
|
|
15556
|
+
return /* @__PURE__ */ jsx99("div", { className: "", children: Amount < 0 ? /* @__PURE__ */ jsxs77(Fragment34, { children: [
|
|
15557
|
+
/* @__PURE__ */ jsx99("p", { className: "font-bold text-red-500 dark:text-red-500 print:text-red-500", children: Formats_default.Amount(Amount) }),
|
|
15558
|
+
fee > 0 && /* @__PURE__ */ jsxs77("span", { className: "text-[8px]", children: [
|
|
15337
15559
|
"Fee:(",
|
|
15338
15560
|
fee,
|
|
15339
15561
|
")"
|
|
15340
15562
|
] })
|
|
15341
15563
|
] }) : "" });
|
|
15342
15564
|
},
|
|
15343
|
-
renderFooter: (data2) => /* @__PURE__ */
|
|
15565
|
+
renderFooter: (data2) => /* @__PURE__ */ jsx99("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
|
|
15344
15566
|
data2.reduce(
|
|
15345
15567
|
(acc, row) => acc + (row.balance < 0 ? row.balance : 0),
|
|
15346
15568
|
0
|
|
@@ -15351,8 +15573,8 @@ var WalletStatements = () => {
|
|
|
15351
15573
|
header: "Balance",
|
|
15352
15574
|
key: "runningBalance",
|
|
15353
15575
|
className: "text-xs whitespace-nowrap text-right",
|
|
15354
|
-
render: (row) => /* @__PURE__ */
|
|
15355
|
-
renderFooter: (data2) => /* @__PURE__ */
|
|
15576
|
+
render: (row) => /* @__PURE__ */ jsx99("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)) }),
|
|
15577
|
+
renderFooter: (data2) => /* @__PURE__ */ jsx99("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
|
|
15356
15578
|
data2.reduce((acc, row) => acc + row.balance, 0),
|
|
15357
15579
|
currency || (currencyFilter === "all" ? void 0 : currencyFilter)
|
|
15358
15580
|
) })
|
|
@@ -15378,9 +15600,9 @@ var WalletStatements = () => {
|
|
|
15378
15600
|
if (filter === "credit")
|
|
15379
15601
|
return result.filter((item) => item.runningBalance > 0);
|
|
15380
15602
|
}, [filter, currencyFilter, data]);
|
|
15381
|
-
return /* @__PURE__ */
|
|
15382
|
-
/* @__PURE__ */
|
|
15383
|
-
/* @__PURE__ */
|
|
15603
|
+
return /* @__PURE__ */ jsxs77(Fragment34, { children: [
|
|
15604
|
+
/* @__PURE__ */ jsx99(TransactionView, {}),
|
|
15605
|
+
/* @__PURE__ */ jsx99(
|
|
15384
15606
|
A4DataView,
|
|
15385
15607
|
{
|
|
15386
15608
|
columns,
|
|
@@ -15389,8 +15611,8 @@ var WalletStatements = () => {
|
|
|
15389
15611
|
title: `Wallet Statement`,
|
|
15390
15612
|
subtitle: `All Outstanding Balances`,
|
|
15391
15613
|
fixed: false,
|
|
15392
|
-
headers: /* @__PURE__ */
|
|
15393
|
-
/* @__PURE__ */
|
|
15614
|
+
headers: /* @__PURE__ */ jsxs77("div", { className: "flex gap-2", children: [
|
|
15615
|
+
/* @__PURE__ */ jsx99(
|
|
15394
15616
|
Fields_default.Select,
|
|
15395
15617
|
{
|
|
15396
15618
|
options: options2,
|
|
@@ -15399,7 +15621,7 @@ var WalletStatements = () => {
|
|
|
15399
15621
|
className: "min-w-[150px] print:hidden"
|
|
15400
15622
|
}
|
|
15401
15623
|
),
|
|
15402
|
-
/* @__PURE__ */
|
|
15624
|
+
/* @__PURE__ */ jsx99(
|
|
15403
15625
|
Fields_default.Select,
|
|
15404
15626
|
{
|
|
15405
15627
|
options: [
|
|
@@ -15424,7 +15646,7 @@ var Statements_default2 = WalletStatements;
|
|
|
15424
15646
|
// src/components/walletAdjustment/WalletAdjustments.tsx
|
|
15425
15647
|
import { useNavigate as useNavigate21, useParams as useParams24 } from "react-router-dom";
|
|
15426
15648
|
import { EllipsisVertical as EllipsisVertical12, FilePenLine as FilePenLine11, Trash2 as Trash213 } from "lucide-react";
|
|
15427
|
-
import { Fragment as
|
|
15649
|
+
import { Fragment as Fragment35, jsx as jsx100, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
15428
15650
|
function WalletAdjustments({ url }) {
|
|
15429
15651
|
const { branchId } = useParams24();
|
|
15430
15652
|
const navigate = useNavigate21();
|
|
@@ -15437,17 +15659,17 @@ function WalletAdjustments({ url }) {
|
|
|
15437
15659
|
const items = (data2) => [
|
|
15438
15660
|
{
|
|
15439
15661
|
label: `View Adjustment`,
|
|
15440
|
-
icon: /* @__PURE__ */
|
|
15662
|
+
icon: /* @__PURE__ */ jsx100(FilePenLine11, { size: 16 }),
|
|
15441
15663
|
onClick: () => openTransaction({ id: data2?._id, type: "adjustment" })
|
|
15442
15664
|
},
|
|
15443
15665
|
{
|
|
15444
15666
|
label: `Edit Adjustment`,
|
|
15445
|
-
icon: /* @__PURE__ */
|
|
15667
|
+
icon: /* @__PURE__ */ jsx100(FilePenLine11, { size: 16 }),
|
|
15446
15668
|
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
15447
15669
|
},
|
|
15448
15670
|
{
|
|
15449
15671
|
label: `Reverse Adjustment`,
|
|
15450
|
-
icon: /* @__PURE__ */
|
|
15672
|
+
icon: /* @__PURE__ */ jsx100(Trash213, { className: "text-red-500", size: 16 }),
|
|
15451
15673
|
onClick: () => {
|
|
15452
15674
|
openTransaction({
|
|
15453
15675
|
id: data2?._id,
|
|
@@ -15463,9 +15685,9 @@ function WalletAdjustments({ url }) {
|
|
|
15463
15685
|
header: "Date",
|
|
15464
15686
|
cell: ({ row }) => {
|
|
15465
15687
|
const adjustment = row.original;
|
|
15466
|
-
return /* @__PURE__ */
|
|
15467
|
-
/* @__PURE__ */
|
|
15468
|
-
/* @__PURE__ */
|
|
15688
|
+
return /* @__PURE__ */ jsxs78("div", { className: "flex flex-col", children: [
|
|
15689
|
+
/* @__PURE__ */ jsx100("span", { children: adjustment?.date }),
|
|
15690
|
+
/* @__PURE__ */ jsx100(
|
|
15469
15691
|
"span",
|
|
15470
15692
|
{
|
|
15471
15693
|
onClick: () => openTransaction({
|
|
@@ -15485,7 +15707,7 @@ function WalletAdjustments({ url }) {
|
|
|
15485
15707
|
cell: ({ row }) => {
|
|
15486
15708
|
const adjustment = row.original;
|
|
15487
15709
|
const walletData = adjustment?.toWalletData || adjustment?.fromWalletData;
|
|
15488
|
-
return /* @__PURE__ */
|
|
15710
|
+
return /* @__PURE__ */ jsx100("span", { children: walletData?.name || "N/A" });
|
|
15489
15711
|
}
|
|
15490
15712
|
},
|
|
15491
15713
|
{
|
|
@@ -15493,7 +15715,7 @@ function WalletAdjustments({ url }) {
|
|
|
15493
15715
|
header: "Action",
|
|
15494
15716
|
cell: ({ row }) => {
|
|
15495
15717
|
const action = row.original.action;
|
|
15496
|
-
return /* @__PURE__ */
|
|
15718
|
+
return /* @__PURE__ */ jsx100(
|
|
15497
15719
|
"span",
|
|
15498
15720
|
{
|
|
15499
15721
|
className: action === "credit" ? "text-green-600 font-medium" : "text-red-600 font-medium",
|
|
@@ -15512,7 +15734,7 @@ function WalletAdjustments({ url }) {
|
|
|
15512
15734
|
header: "Amount",
|
|
15513
15735
|
cell: ({ row }) => {
|
|
15514
15736
|
const adjustment = row.original;
|
|
15515
|
-
return /* @__PURE__ */
|
|
15737
|
+
return /* @__PURE__ */ jsx100("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx100("span", { children: Formats_default.Price(adjustment?.amount, adjustment?.currency) }) });
|
|
15516
15738
|
}
|
|
15517
15739
|
},
|
|
15518
15740
|
{
|
|
@@ -15520,23 +15742,23 @@ function WalletAdjustments({ url }) {
|
|
|
15520
15742
|
header: "Actions",
|
|
15521
15743
|
cell: ({ row }) => {
|
|
15522
15744
|
const data2 = row.original;
|
|
15523
|
-
return /* @__PURE__ */
|
|
15745
|
+
return /* @__PURE__ */ jsx100(
|
|
15524
15746
|
Dropdown,
|
|
15525
15747
|
{
|
|
15526
15748
|
className: "cursor-pointer w-[150px]",
|
|
15527
15749
|
items: items(data2),
|
|
15528
15750
|
triggerMode: "hover",
|
|
15529
|
-
children: /* @__PURE__ */
|
|
15751
|
+
children: /* @__PURE__ */ jsx100(EllipsisVertical12, {})
|
|
15530
15752
|
}
|
|
15531
15753
|
);
|
|
15532
15754
|
}
|
|
15533
15755
|
}
|
|
15534
15756
|
];
|
|
15535
15757
|
const adjustments = data?.data || [];
|
|
15536
|
-
return /* @__PURE__ */
|
|
15537
|
-
/* @__PURE__ */
|
|
15538
|
-
/* @__PURE__ */
|
|
15539
|
-
/* @__PURE__ */
|
|
15758
|
+
return /* @__PURE__ */ jsxs78(Fragment35, { children: [
|
|
15759
|
+
/* @__PURE__ */ jsx100(Modal2, {}),
|
|
15760
|
+
/* @__PURE__ */ jsx100(TransactionView, {}),
|
|
15761
|
+
/* @__PURE__ */ jsx100(
|
|
15540
15762
|
TransactionViewComponent,
|
|
15541
15763
|
{
|
|
15542
15764
|
columns,
|
|
@@ -15576,7 +15798,7 @@ var walletAdjustmentSchema = z15.object({
|
|
|
15576
15798
|
});
|
|
15577
15799
|
|
|
15578
15800
|
// src/components/walletAdjustment/WalletAdjustmentForm.tsx
|
|
15579
|
-
import { jsx as
|
|
15801
|
+
import { jsx as jsx101, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
15580
15802
|
function WalletAdjustmentForm() {
|
|
15581
15803
|
const { branchId } = useParams25();
|
|
15582
15804
|
const { getQuery, navigate } = useApp_default();
|
|
@@ -15636,25 +15858,25 @@ function WalletAdjustmentForm() {
|
|
|
15636
15858
|
fetches();
|
|
15637
15859
|
}
|
|
15638
15860
|
}, [id]);
|
|
15639
|
-
return /* @__PURE__ */
|
|
15861
|
+
return /* @__PURE__ */ jsxs79(
|
|
15640
15862
|
Card,
|
|
15641
15863
|
{
|
|
15642
15864
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
15643
15865
|
isLoading: isLoadingGet,
|
|
15644
15866
|
loadingText: "Processing...",
|
|
15645
15867
|
children: [
|
|
15646
|
-
/* @__PURE__ */
|
|
15647
|
-
/* @__PURE__ */
|
|
15648
|
-
/* @__PURE__ */
|
|
15868
|
+
/* @__PURE__ */ jsxs79(Card.Header, { children: [
|
|
15869
|
+
/* @__PURE__ */ jsx101(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Wallet Adjustment` }),
|
|
15870
|
+
/* @__PURE__ */ jsx101(Card.Description, { children: isEdit ? `Update the details for this wallet adjustment` : `Adjust the balance of a specific wallet` })
|
|
15649
15871
|
] }),
|
|
15650
|
-
/* @__PURE__ */
|
|
15872
|
+
/* @__PURE__ */ jsx101(Card.Content, { children: /* @__PURE__ */ jsxs79(
|
|
15651
15873
|
"form",
|
|
15652
15874
|
{
|
|
15653
15875
|
className: "space-y-4",
|
|
15654
15876
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
15655
15877
|
children: [
|
|
15656
|
-
/* @__PURE__ */
|
|
15657
|
-
/* @__PURE__ */
|
|
15878
|
+
/* @__PURE__ */ jsxs79("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
15879
|
+
/* @__PURE__ */ jsx101(
|
|
15658
15880
|
Feilds_default2.Wallet,
|
|
15659
15881
|
{
|
|
15660
15882
|
label: "Wallet",
|
|
@@ -15666,7 +15888,7 @@ function WalletAdjustmentForm() {
|
|
|
15666
15888
|
obj: "walletObject"
|
|
15667
15889
|
}
|
|
15668
15890
|
),
|
|
15669
|
-
/* @__PURE__ */
|
|
15891
|
+
/* @__PURE__ */ jsx101(
|
|
15670
15892
|
Fields_default.DateInput,
|
|
15671
15893
|
{
|
|
15672
15894
|
label: "Date",
|
|
@@ -15676,7 +15898,7 @@ function WalletAdjustmentForm() {
|
|
|
15676
15898
|
}
|
|
15677
15899
|
)
|
|
15678
15900
|
] }),
|
|
15679
|
-
/* @__PURE__ */
|
|
15901
|
+
/* @__PURE__ */ jsx101(
|
|
15680
15902
|
Fields_default.Input,
|
|
15681
15903
|
{
|
|
15682
15904
|
label: "Description",
|
|
@@ -15686,8 +15908,8 @@ function WalletAdjustmentForm() {
|
|
|
15686
15908
|
required: true
|
|
15687
15909
|
}
|
|
15688
15910
|
),
|
|
15689
|
-
/* @__PURE__ */
|
|
15690
|
-
/* @__PURE__ */
|
|
15911
|
+
/* @__PURE__ */ jsxs79("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
15912
|
+
/* @__PURE__ */ jsx101(
|
|
15691
15913
|
Fields_default.Select,
|
|
15692
15914
|
{
|
|
15693
15915
|
label: "Action",
|
|
@@ -15700,7 +15922,7 @@ function WalletAdjustmentForm() {
|
|
|
15700
15922
|
]
|
|
15701
15923
|
}
|
|
15702
15924
|
),
|
|
15703
|
-
/* @__PURE__ */
|
|
15925
|
+
/* @__PURE__ */ jsx101(
|
|
15704
15926
|
Fields_default.Input,
|
|
15705
15927
|
{
|
|
15706
15928
|
label: "Amount",
|
|
@@ -15712,7 +15934,7 @@ function WalletAdjustmentForm() {
|
|
|
15712
15934
|
}
|
|
15713
15935
|
)
|
|
15714
15936
|
] }),
|
|
15715
|
-
/* @__PURE__ */
|
|
15937
|
+
/* @__PURE__ */ jsx101(
|
|
15716
15938
|
Fields_default.Textarea,
|
|
15717
15939
|
{
|
|
15718
15940
|
label: "Note",
|
|
@@ -15721,7 +15943,7 @@ function WalletAdjustmentForm() {
|
|
|
15721
15943
|
placeholder: "Add any additional notes here..."
|
|
15722
15944
|
}
|
|
15723
15945
|
),
|
|
15724
|
-
/* @__PURE__ */
|
|
15946
|
+
/* @__PURE__ */ jsx101("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx101(
|
|
15725
15947
|
Button,
|
|
15726
15948
|
{
|
|
15727
15949
|
isLoading,
|
|
@@ -15740,6 +15962,420 @@ function WalletAdjustmentForm() {
|
|
|
15740
15962
|
);
|
|
15741
15963
|
}
|
|
15742
15964
|
var WalletAdjustmentForm_default = WalletAdjustmentForm;
|
|
15965
|
+
|
|
15966
|
+
// src/components/forexTransfer/ForexTransfers.tsx
|
|
15967
|
+
import { useNavigate as useNavigate22, useParams as useParams26 } from "react-router-dom";
|
|
15968
|
+
import { EllipsisVertical as EllipsisVertical13, FilePenLine as FilePenLine12, Trash2 as Trash214 } from "lucide-react";
|
|
15969
|
+
import { Fragment as Fragment36, jsx as jsx102, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
15970
|
+
function ForexTransfers({ url }) {
|
|
15971
|
+
const { branchId } = useParams26();
|
|
15972
|
+
const navigate = useNavigate22();
|
|
15973
|
+
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
15974
|
+
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
15975
|
+
url: url || `/transactions/get?type=forex transfer${branchId ? `&fromBranch=${branchId}` : ""}`,
|
|
15976
|
+
dateFilter: true
|
|
15977
|
+
});
|
|
15978
|
+
const { Modal: Modal2 } = useModal();
|
|
15979
|
+
const items = (data2) => [
|
|
15980
|
+
{
|
|
15981
|
+
label: `View Transfer`,
|
|
15982
|
+
icon: /* @__PURE__ */ jsx102(FilePenLine12, { size: 16 }),
|
|
15983
|
+
onClick: () => openTransaction({ id: data2?._id, type: "forex transfer" })
|
|
15984
|
+
},
|
|
15985
|
+
{
|
|
15986
|
+
label: `Edit Transfer`,
|
|
15987
|
+
icon: /* @__PURE__ */ jsx102(FilePenLine12, { size: 16 }),
|
|
15988
|
+
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
15989
|
+
},
|
|
15990
|
+
{
|
|
15991
|
+
label: `Reverse Transfer`,
|
|
15992
|
+
icon: /* @__PURE__ */ jsx102(Trash214, { className: "text-red-500", size: 16 }),
|
|
15993
|
+
onClick: () => {
|
|
15994
|
+
openTransaction({
|
|
15995
|
+
id: data2?._id,
|
|
15996
|
+
type: "forex transfer",
|
|
15997
|
+
reverseable: { reload }
|
|
15998
|
+
});
|
|
15999
|
+
}
|
|
16000
|
+
}
|
|
16001
|
+
].filter(Boolean);
|
|
16002
|
+
const columns = [
|
|
16003
|
+
{
|
|
16004
|
+
accessorKey: "date",
|
|
16005
|
+
header: "Date",
|
|
16006
|
+
cell: ({ row }) => {
|
|
16007
|
+
const transfer = row.original;
|
|
16008
|
+
return /* @__PURE__ */ jsxs80("div", { className: "flex flex-col", children: [
|
|
16009
|
+
/* @__PURE__ */ jsx102("span", { children: transfer?.date }),
|
|
16010
|
+
/* @__PURE__ */ jsx102(
|
|
16011
|
+
"span",
|
|
16012
|
+
{
|
|
16013
|
+
onClick: () => openTransaction({ id: transfer?._id, type: "forex transfer" }),
|
|
16014
|
+
className: "text-xs text-blue-600 italic cursor-pointer hover:underline",
|
|
16015
|
+
children: transfer.ref
|
|
16016
|
+
}
|
|
16017
|
+
)
|
|
16018
|
+
] });
|
|
16019
|
+
}
|
|
16020
|
+
},
|
|
16021
|
+
{
|
|
16022
|
+
accessorKey: "account",
|
|
16023
|
+
header: "Account",
|
|
16024
|
+
cell: ({ row }) => {
|
|
16025
|
+
const transfer = row.original;
|
|
16026
|
+
return /* @__PURE__ */ jsx102("span", { children: transfer?.accountData?.name || "N/A" });
|
|
16027
|
+
}
|
|
16028
|
+
},
|
|
16029
|
+
{
|
|
16030
|
+
accessorKey: "wallet",
|
|
16031
|
+
header: "Wallet",
|
|
16032
|
+
cell: ({ row }) => {
|
|
16033
|
+
const transfer = row.original;
|
|
16034
|
+
return /* @__PURE__ */ jsx102("span", { children: transfer?.walletData?.name || "N/A" });
|
|
16035
|
+
}
|
|
16036
|
+
},
|
|
16037
|
+
{
|
|
16038
|
+
accessorKey: "amount",
|
|
16039
|
+
header: "Amount",
|
|
16040
|
+
cell: ({ row }) => {
|
|
16041
|
+
const transfer = row.original;
|
|
16042
|
+
return /* @__PURE__ */ jsxs80("div", { className: "flex flex-col", children: [
|
|
16043
|
+
/* @__PURE__ */ jsxs80(
|
|
16044
|
+
"span",
|
|
16045
|
+
{
|
|
16046
|
+
className: transfer?.action === "debit" ? "text-red-600" : "text-green-600",
|
|
16047
|
+
children: [
|
|
16048
|
+
transfer?.action === "debit" ? "-" : "+",
|
|
16049
|
+
" ",
|
|
16050
|
+
Formats_default.Price(transfer?.amount, transfer?.currency)
|
|
16051
|
+
]
|
|
16052
|
+
}
|
|
16053
|
+
),
|
|
16054
|
+
transfer?.exchange?.rate && /* @__PURE__ */ jsxs80("span", { className: "text-xs text-indigo-600", children: [
|
|
16055
|
+
"EX: ",
|
|
16056
|
+
transfer?.exchange?.rate,
|
|
16057
|
+
" (",
|
|
16058
|
+
Formats_default.Price(
|
|
16059
|
+
transfer?.exchange?.amount,
|
|
16060
|
+
transfer?.exchange?.currency
|
|
16061
|
+
),
|
|
16062
|
+
")"
|
|
16063
|
+
] }),
|
|
16064
|
+
transfer?.fee > 0 && /* @__PURE__ */ jsxs80("span", { className: "text-xs text-orange-600", children: [
|
|
16065
|
+
"Fee:",
|
|
16066
|
+
" ",
|
|
16067
|
+
Formats_default.Price(
|
|
16068
|
+
transfer?.fee,
|
|
16069
|
+
transfer?.exchange?.currency || transfer?.currency
|
|
16070
|
+
)
|
|
16071
|
+
] })
|
|
16072
|
+
] });
|
|
16073
|
+
}
|
|
16074
|
+
},
|
|
16075
|
+
{
|
|
16076
|
+
accessorKey: "actions",
|
|
16077
|
+
header: "Actions",
|
|
16078
|
+
cell: ({ row }) => {
|
|
16079
|
+
const data2 = row.original;
|
|
16080
|
+
return /* @__PURE__ */ jsx102(
|
|
16081
|
+
Dropdown,
|
|
16082
|
+
{
|
|
16083
|
+
className: "cursor-pointer w-[150px]",
|
|
16084
|
+
items: items(data2),
|
|
16085
|
+
triggerMode: "hover",
|
|
16086
|
+
children: /* @__PURE__ */ jsx102(EllipsisVertical13, {})
|
|
16087
|
+
}
|
|
16088
|
+
);
|
|
16089
|
+
}
|
|
16090
|
+
}
|
|
16091
|
+
];
|
|
16092
|
+
const transfers = data?.data || [];
|
|
16093
|
+
return /* @__PURE__ */ jsxs80(Fragment36, { children: [
|
|
16094
|
+
/* @__PURE__ */ jsx102(Modal2, {}),
|
|
16095
|
+
/* @__PURE__ */ jsx102(TransactionView, {}),
|
|
16096
|
+
/* @__PURE__ */ jsx102(
|
|
16097
|
+
TransactionViewComponent,
|
|
16098
|
+
{
|
|
16099
|
+
columns,
|
|
16100
|
+
data: transfers,
|
|
16101
|
+
title: "Forex Transfers",
|
|
16102
|
+
description: "Manage transfers between accounts and wallets",
|
|
16103
|
+
index: true,
|
|
16104
|
+
createTitle: "Add Forex Transfer",
|
|
16105
|
+
onCreate: () => {
|
|
16106
|
+
navigate("create");
|
|
16107
|
+
}
|
|
16108
|
+
}
|
|
16109
|
+
)
|
|
16110
|
+
] });
|
|
16111
|
+
}
|
|
16112
|
+
var ForexTransfers_default = ForexTransfers;
|
|
16113
|
+
|
|
16114
|
+
// src/components/forexTransfer/ForexTransferForm.tsx
|
|
16115
|
+
import { useEffect as useEffect38, useMemo as useMemo16, useState as useState47 } from "react";
|
|
16116
|
+
import { useParams as useParams27 } from "react-router-dom";
|
|
16117
|
+
import { useForm as useForm19 } from "react-hook-form";
|
|
16118
|
+
import { zodResolver as zodResolver18 } from "@hookform/resolvers/zod";
|
|
16119
|
+
import { message as message30 } from "antd";
|
|
16120
|
+
|
|
16121
|
+
// src/components/forexTransfer/schema.ts
|
|
16122
|
+
import { z as z16 } from "zod";
|
|
16123
|
+
var forexTransferSchema = z16.object({
|
|
16124
|
+
account: z16.string(),
|
|
16125
|
+
wallet: z16.string(),
|
|
16126
|
+
amount: z16.number().gt(0, "Amount must be greater than 0"),
|
|
16127
|
+
date: zodFields.date,
|
|
16128
|
+
description: z16.string(),
|
|
16129
|
+
note: z16.string().optional(),
|
|
16130
|
+
fee: z16.coerce.number().optional(),
|
|
16131
|
+
branch: z16.string().optional(),
|
|
16132
|
+
// Objects for frontend helpers
|
|
16133
|
+
accountObject: z16.any().optional(),
|
|
16134
|
+
walletObject: z16.any().optional(),
|
|
16135
|
+
// Exchange rate
|
|
16136
|
+
rate: z16.coerce.number().gte(0).optional()
|
|
16137
|
+
});
|
|
16138
|
+
|
|
16139
|
+
// src/components/forexTransfer/ForexTransferForm.tsx
|
|
16140
|
+
import { Fragment as Fragment37, jsx as jsx103, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
16141
|
+
function ForexTransferForm() {
|
|
16142
|
+
const { branchId } = useParams27();
|
|
16143
|
+
const { getQuery, navigate } = useApp_default();
|
|
16144
|
+
const id = getQuery("id");
|
|
16145
|
+
const isEdit = !!id;
|
|
16146
|
+
const [ref, setRef] = useState47("");
|
|
16147
|
+
const { post, isLoading } = useApis_default();
|
|
16148
|
+
const { isLoading: isLoadingGet, get } = useApis_default();
|
|
16149
|
+
const methods = useForm19({
|
|
16150
|
+
resolver: zodResolver18(forexTransferSchema),
|
|
16151
|
+
defaultValues: {
|
|
16152
|
+
date: (/* @__PURE__ */ new Date()).toLocaleDateString("en-GB"),
|
|
16153
|
+
amount: 0,
|
|
16154
|
+
fee: 0,
|
|
16155
|
+
account: "",
|
|
16156
|
+
wallet: "",
|
|
16157
|
+
description: "Forex Transfer"
|
|
16158
|
+
}
|
|
16159
|
+
});
|
|
16160
|
+
const { handleSubmit, watch, reset } = methods;
|
|
16161
|
+
const accountObj = watch("accountObject");
|
|
16162
|
+
const walletObj = watch("walletObject");
|
|
16163
|
+
const amount = watch("amount") || 0;
|
|
16164
|
+
const fee = watch("fee") || 0;
|
|
16165
|
+
const rate = watch("rate");
|
|
16166
|
+
const isRate = accountObj?.currency && walletObj?.currency && accountObj?.currency !== walletObj?.currency;
|
|
16167
|
+
const isCurrencies = accountObj?.currency && walletObj?.currency;
|
|
16168
|
+
const onSubmit = async (data) => {
|
|
16169
|
+
try {
|
|
16170
|
+
const payload = {
|
|
16171
|
+
...data,
|
|
16172
|
+
type: "forex transfer",
|
|
16173
|
+
branch: branchId ?? void 0
|
|
16174
|
+
};
|
|
16175
|
+
await post({
|
|
16176
|
+
url: `/transactions/add${isEdit ? `?ref=${ref}` : ""}`,
|
|
16177
|
+
body: payload
|
|
16178
|
+
});
|
|
16179
|
+
message30.success(`Forex transfer saved successfully`);
|
|
16180
|
+
navigate(-1);
|
|
16181
|
+
} catch (error) {
|
|
16182
|
+
message30.error(error?.message || "Something went wrong");
|
|
16183
|
+
}
|
|
16184
|
+
};
|
|
16185
|
+
const fetches = async () => {
|
|
16186
|
+
try {
|
|
16187
|
+
const res = await get({
|
|
16188
|
+
url: `/transactions/get?id=${id}${branchId ? `&fromBranch=${branchId}` : ""}`
|
|
16189
|
+
});
|
|
16190
|
+
const data = res.data;
|
|
16191
|
+
reset({
|
|
16192
|
+
...data,
|
|
16193
|
+
rate: data?.exchange?.rate,
|
|
16194
|
+
wallet: data?.toWallet || data?.fromWallet
|
|
16195
|
+
});
|
|
16196
|
+
setRef(data?.ref);
|
|
16197
|
+
} catch (error) {
|
|
16198
|
+
message30.error(error?.message || "Something went wrong");
|
|
16199
|
+
navigate(-1);
|
|
16200
|
+
}
|
|
16201
|
+
};
|
|
16202
|
+
const exchangedAmount2 = useMemo16(() => {
|
|
16203
|
+
if (isRate) {
|
|
16204
|
+
const am = forex_default.exchangedAmount({
|
|
16205
|
+
accountCurrency: accountObj?.currency,
|
|
16206
|
+
amount,
|
|
16207
|
+
exchangeRate: rate ?? 1,
|
|
16208
|
+
transactionCurrency: walletObj?.currency
|
|
16209
|
+
});
|
|
16210
|
+
return Formats_default.Price(am, accountObj?.currency ?? "N/A");
|
|
16211
|
+
}
|
|
16212
|
+
}, [amount, accountObj?.currency, walletObj?.currency, rate, isRate]);
|
|
16213
|
+
const totalAmount = useMemo16(() => {
|
|
16214
|
+
if (isCurrencies) {
|
|
16215
|
+
const am = forex_default.exchangedAmount({
|
|
16216
|
+
accountCurrency: accountObj?.currency,
|
|
16217
|
+
amount,
|
|
16218
|
+
exchangeRate: rate ?? 1,
|
|
16219
|
+
transactionCurrency: walletObj?.currency
|
|
16220
|
+
});
|
|
16221
|
+
return am + fee / 100 * am;
|
|
16222
|
+
} else {
|
|
16223
|
+
return 0;
|
|
16224
|
+
}
|
|
16225
|
+
}, [exchangedAmount2, fee]);
|
|
16226
|
+
useEffect38(() => {
|
|
16227
|
+
if (isEdit) {
|
|
16228
|
+
fetches();
|
|
16229
|
+
}
|
|
16230
|
+
}, [id]);
|
|
16231
|
+
return /* @__PURE__ */ jsxs81(
|
|
16232
|
+
Card,
|
|
16233
|
+
{
|
|
16234
|
+
className: "max-w-4xl mx-auto mt-10 relative",
|
|
16235
|
+
isLoading: isLoadingGet,
|
|
16236
|
+
loadingText: "Processing...",
|
|
16237
|
+
children: [
|
|
16238
|
+
/* @__PURE__ */ jsxs81(Card.Header, { children: [
|
|
16239
|
+
/* @__PURE__ */ jsx103(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Forex Transfer` }),
|
|
16240
|
+
/* @__PURE__ */ jsx103(Card.Description, { children: isEdit ? `Update the details for this forex transfer` : `Move funds between an account and a wallet` })
|
|
16241
|
+
] }),
|
|
16242
|
+
/* @__PURE__ */ jsx103(Card.Content, { children: /* @__PURE__ */ jsxs81(
|
|
16243
|
+
"form",
|
|
16244
|
+
{
|
|
16245
|
+
className: "space-y-4",
|
|
16246
|
+
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
16247
|
+
children: [
|
|
16248
|
+
/* @__PURE__ */ jsxs81("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
16249
|
+
/* @__PURE__ */ jsx103(
|
|
16250
|
+
Fields_default.Input,
|
|
16251
|
+
{
|
|
16252
|
+
label: "Description",
|
|
16253
|
+
form: methods,
|
|
16254
|
+
name: "description",
|
|
16255
|
+
placeholder: "Enter description...",
|
|
16256
|
+
required: true
|
|
16257
|
+
}
|
|
16258
|
+
),
|
|
16259
|
+
" ",
|
|
16260
|
+
/* @__PURE__ */ jsx103(
|
|
16261
|
+
Fields_default.DateInput,
|
|
16262
|
+
{
|
|
16263
|
+
label: "Date",
|
|
16264
|
+
form: methods,
|
|
16265
|
+
name: "date",
|
|
16266
|
+
required: true
|
|
16267
|
+
}
|
|
16268
|
+
),
|
|
16269
|
+
/* @__PURE__ */ jsx103(
|
|
16270
|
+
Feilds_default.Account,
|
|
16271
|
+
{
|
|
16272
|
+
label: "Account",
|
|
16273
|
+
form: methods,
|
|
16274
|
+
name: "account",
|
|
16275
|
+
api: "/accounts/get/all",
|
|
16276
|
+
placeholder: "Select account...",
|
|
16277
|
+
required: true,
|
|
16278
|
+
obj: "accountObject",
|
|
16279
|
+
showBalance: true
|
|
16280
|
+
}
|
|
16281
|
+
),
|
|
16282
|
+
/* @__PURE__ */ jsx103(
|
|
16283
|
+
Feilds_default2.Wallet,
|
|
16284
|
+
{
|
|
16285
|
+
label: "Wallet",
|
|
16286
|
+
form: methods,
|
|
16287
|
+
name: "wallet",
|
|
16288
|
+
placeholder: "Select wallet...",
|
|
16289
|
+
required: true,
|
|
16290
|
+
showBalance: true,
|
|
16291
|
+
obj: "walletObject"
|
|
16292
|
+
}
|
|
16293
|
+
),
|
|
16294
|
+
/* @__PURE__ */ jsx103(
|
|
16295
|
+
Fields_default.Input,
|
|
16296
|
+
{
|
|
16297
|
+
label: "Amount",
|
|
16298
|
+
form: methods,
|
|
16299
|
+
name: "amount",
|
|
16300
|
+
type: "number",
|
|
16301
|
+
placeholder: "0.00",
|
|
16302
|
+
required: true
|
|
16303
|
+
}
|
|
16304
|
+
),
|
|
16305
|
+
isRate && /* @__PURE__ */ jsxs81(Fragment37, { children: [
|
|
16306
|
+
/* @__PURE__ */ jsx103(
|
|
16307
|
+
Fields_default.Input,
|
|
16308
|
+
{
|
|
16309
|
+
label: `Rate (1 ${walletObj?.currency} = ? ${accountObj?.currency})`,
|
|
16310
|
+
type: "number",
|
|
16311
|
+
name: "rate",
|
|
16312
|
+
form: methods,
|
|
16313
|
+
required: true
|
|
16314
|
+
}
|
|
16315
|
+
),
|
|
16316
|
+
/* @__PURE__ */ jsx103(
|
|
16317
|
+
Fields_default.Input,
|
|
16318
|
+
{
|
|
16319
|
+
label: "Exchanged Amount",
|
|
16320
|
+
type: "text",
|
|
16321
|
+
readOnly: true,
|
|
16322
|
+
disabled: true,
|
|
16323
|
+
value: exchangedAmount2
|
|
16324
|
+
}
|
|
16325
|
+
)
|
|
16326
|
+
] }),
|
|
16327
|
+
/* @__PURE__ */ jsx103(
|
|
16328
|
+
Fields_default.Input,
|
|
16329
|
+
{
|
|
16330
|
+
label: "Fee (Optional)",
|
|
16331
|
+
form: methods,
|
|
16332
|
+
name: "fee",
|
|
16333
|
+
type: "number",
|
|
16334
|
+
placeholder: "0.00"
|
|
16335
|
+
}
|
|
16336
|
+
),
|
|
16337
|
+
fee > 0 && /* @__PURE__ */ jsx103(
|
|
16338
|
+
Fields_default.Input,
|
|
16339
|
+
{
|
|
16340
|
+
label: "Amount After Fee",
|
|
16341
|
+
type: "text",
|
|
16342
|
+
readOnly: true,
|
|
16343
|
+
disabled: true,
|
|
16344
|
+
value: Formats_default.Price(
|
|
16345
|
+
totalAmount,
|
|
16346
|
+
accountObj?.currency || "N/A"
|
|
16347
|
+
)
|
|
16348
|
+
}
|
|
16349
|
+
)
|
|
16350
|
+
] }),
|
|
16351
|
+
/* @__PURE__ */ jsx103(
|
|
16352
|
+
Fields_default.Textarea,
|
|
16353
|
+
{
|
|
16354
|
+
label: "Note",
|
|
16355
|
+
form: methods,
|
|
16356
|
+
name: "note",
|
|
16357
|
+
placeholder: "Add any additional notes here..."
|
|
16358
|
+
}
|
|
16359
|
+
),
|
|
16360
|
+
/* @__PURE__ */ jsx103("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx103(
|
|
16361
|
+
Button,
|
|
16362
|
+
{
|
|
16363
|
+
isLoading,
|
|
16364
|
+
disabled: isLoading,
|
|
16365
|
+
type: "submit",
|
|
16366
|
+
className: "min-w-[100px]",
|
|
16367
|
+
variant: !isEdit ? "primary" : "warning",
|
|
16368
|
+
children: isEdit ? "Update" : "Add"
|
|
16369
|
+
}
|
|
16370
|
+
) })
|
|
16371
|
+
]
|
|
16372
|
+
}
|
|
16373
|
+
) })
|
|
16374
|
+
]
|
|
16375
|
+
}
|
|
16376
|
+
);
|
|
16377
|
+
}
|
|
16378
|
+
var ForexTransferForm_default = ForexTransferForm;
|
|
15743
16379
|
export {
|
|
15744
16380
|
Feilds_default as AccountFields,
|
|
15745
16381
|
AccountForm_default as AccountForm,
|
|
@@ -15775,6 +16411,8 @@ export {
|
|
|
15775
16411
|
ExpenseForm_default as ExpenseForm,
|
|
15776
16412
|
Expenses_default as Expenses,
|
|
15777
16413
|
Fields_default as Fields,
|
|
16414
|
+
ForexTransferForm_default as ForexTransferForm,
|
|
16415
|
+
ForexTransfers_default as ForexTransfers,
|
|
15778
16416
|
Guard,
|
|
15779
16417
|
InfoGrid,
|
|
15780
16418
|
Input,
|
|
@@ -15841,6 +16479,7 @@ export {
|
|
|
15841
16479
|
createUserSchema,
|
|
15842
16480
|
createWalletSchema,
|
|
15843
16481
|
expenseSchema,
|
|
16482
|
+
forexTransferSchema,
|
|
15844
16483
|
generatePdf,
|
|
15845
16484
|
journalSchema,
|
|
15846
16485
|
linkUserSchema,
|