warqadui 0.0.273 → 0.0.276
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 +20 -4
- package/dist/index.d.ts +20 -4
- package/dist/index.js +715 -364
- package/dist/index.mjs +861 -511
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -98,7 +98,8 @@ var Enums = {
|
|
|
98
98
|
"invoice-manager",
|
|
99
99
|
"payment-3",
|
|
100
100
|
"journal-3",
|
|
101
|
-
"forex-2"
|
|
101
|
+
"forex-2",
|
|
102
|
+
"expense-3"
|
|
102
103
|
],
|
|
103
104
|
stockTypes: ["pack", "product"],
|
|
104
105
|
saleStockTypes: ["pack", "product"],
|
|
@@ -1597,13 +1598,13 @@ var Input = forwardRef(
|
|
|
1597
1598
|
}
|
|
1598
1599
|
}
|
|
1599
1600
|
}, [props.value, name, form]);
|
|
1600
|
-
let
|
|
1601
|
+
let message91 = error;
|
|
1601
1602
|
if (form && name) {
|
|
1602
1603
|
const {
|
|
1603
1604
|
formState: { errors }
|
|
1604
1605
|
} = form;
|
|
1605
1606
|
const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
|
|
1606
|
-
|
|
1607
|
+
message91 = errorObj?.message;
|
|
1607
1608
|
}
|
|
1608
1609
|
const watchedValue = form?.watch(name);
|
|
1609
1610
|
useEffect8(() => {
|
|
@@ -1672,7 +1673,7 @@ var Input = forwardRef(
|
|
|
1672
1673
|
}
|
|
1673
1674
|
)
|
|
1674
1675
|
] }),
|
|
1675
|
-
|
|
1676
|
+
message91 && /* @__PURE__ */ jsx16("p", { className: "text-sm text-red-600 dark:text-red-400", children: message91 })
|
|
1676
1677
|
]
|
|
1677
1678
|
}
|
|
1678
1679
|
);
|
|
@@ -2022,7 +2023,7 @@ var PhoneInput = forwardRef2(
|
|
|
2022
2023
|
const [isFocused, setIsFocused] = useState12(false);
|
|
2023
2024
|
const { theme } = useWarqadConfig();
|
|
2024
2025
|
const primaryColor = theme?.primaryColor;
|
|
2025
|
-
let
|
|
2026
|
+
let message91 = error;
|
|
2026
2027
|
if (form && name) {
|
|
2027
2028
|
const {
|
|
2028
2029
|
formState: { errors }
|
|
@@ -2032,7 +2033,7 @@ var PhoneInput = forwardRef2(
|
|
|
2032
2033
|
for (const part of nameParts) {
|
|
2033
2034
|
currentError = currentError?.[part];
|
|
2034
2035
|
}
|
|
2035
|
-
|
|
2036
|
+
message91 = currentError?.message || message91;
|
|
2036
2037
|
}
|
|
2037
2038
|
const renderInput = (onChangeHandler, currentValue) => /* @__PURE__ */ jsxs15("div", { className: `space-y-2 group relative ${containerClassName}`, children: [
|
|
2038
2039
|
/* @__PURE__ */ jsxs15(
|
|
@@ -2083,7 +2084,7 @@ var PhoneInput = forwardRef2(
|
|
|
2083
2084
|
}
|
|
2084
2085
|
)
|
|
2085
2086
|
] }),
|
|
2086
|
-
|
|
2087
|
+
message91 && /* @__PURE__ */ jsx20("p", { className: "text-sm text-red-600 dark:text-red-400", children: message91 })
|
|
2087
2088
|
] });
|
|
2088
2089
|
if (form && name) {
|
|
2089
2090
|
return /* @__PURE__ */ jsx20(
|
|
@@ -2144,7 +2145,7 @@ var Select = forwardRef3((props, ref2) => {
|
|
|
2144
2145
|
if (targetEnum) {
|
|
2145
2146
|
return targetEnum.map((val) => ({
|
|
2146
2147
|
value: val,
|
|
2147
|
-
label: String(val).charAt(0).toUpperCase() + String(val).slice(1)
|
|
2148
|
+
label: `${String(val).charAt(0).toUpperCase() + String(val).slice(1)} ${enumName === "actionTypes" ? val === "credit" ? "(+)" : "(-)" : ""}`
|
|
2148
2149
|
}));
|
|
2149
2150
|
}
|
|
2150
2151
|
return [];
|
|
@@ -2272,7 +2273,7 @@ var SelectRoot = ({
|
|
|
2272
2273
|
setSearchQuery("");
|
|
2273
2274
|
}
|
|
2274
2275
|
}, [isOpen]);
|
|
2275
|
-
let
|
|
2276
|
+
let message91 = error;
|
|
2276
2277
|
if (form && name) {
|
|
2277
2278
|
const {
|
|
2278
2279
|
formState: { errors }
|
|
@@ -2282,7 +2283,7 @@ var SelectRoot = ({
|
|
|
2282
2283
|
for (const part of nameParts) {
|
|
2283
2284
|
currentError = currentError?.[part];
|
|
2284
2285
|
}
|
|
2285
|
-
|
|
2286
|
+
message91 = currentError?.message || message91;
|
|
2286
2287
|
}
|
|
2287
2288
|
const allOptions = initialOptions?.length ? initialOptions : registeredOptions;
|
|
2288
2289
|
const filteredOptions = useMemo4(() => {
|
|
@@ -2352,7 +2353,7 @@ var SelectRoot = ({
|
|
|
2352
2353
|
String(opt.value) || index
|
|
2353
2354
|
)) })
|
|
2354
2355
|
] }),
|
|
2355
|
-
|
|
2356
|
+
message91 && /* @__PURE__ */ jsx21("p", { className: "text-sm text-red-600 dark:text-red-400", children: message91 })
|
|
2356
2357
|
]
|
|
2357
2358
|
}
|
|
2358
2359
|
) });
|
|
@@ -2619,13 +2620,13 @@ var Textarea = forwardRef4(
|
|
|
2619
2620
|
const [isFocused, setIsFocused] = useState14(false);
|
|
2620
2621
|
const { theme } = useWarqadConfig();
|
|
2621
2622
|
const primaryColor = theme?.primaryColor;
|
|
2622
|
-
let
|
|
2623
|
+
let message91 = error;
|
|
2623
2624
|
if (form && name) {
|
|
2624
2625
|
const {
|
|
2625
2626
|
formState: { errors }
|
|
2626
2627
|
} = form;
|
|
2627
2628
|
const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
|
|
2628
|
-
|
|
2629
|
+
message91 = errorObj?.message;
|
|
2629
2630
|
}
|
|
2630
2631
|
const renderInput = (inputProps, ref3) => /* @__PURE__ */ jsxs17("div", { className: `space-y-2 group w-full! relative ${containerClassName}`, children: [
|
|
2631
2632
|
/* @__PURE__ */ jsxs17(
|
|
@@ -2663,7 +2664,7 @@ var Textarea = forwardRef4(
|
|
|
2663
2664
|
}
|
|
2664
2665
|
}
|
|
2665
2666
|
) }),
|
|
2666
|
-
|
|
2667
|
+
message91 && /* @__PURE__ */ jsx22("p", { className: "text-sm text-red-600 dark:text-red-400", children: message91 })
|
|
2667
2668
|
] });
|
|
2668
2669
|
useEffect10(() => {
|
|
2669
2670
|
if (form && name && props.value !== void 0 && props.value !== null && props.value !== "") {
|
|
@@ -3013,7 +3014,7 @@ var SearchApiRoot = ({
|
|
|
3013
3014
|
const filteredOptions = options10.filter(
|
|
3014
3015
|
(option) => !filter.includes(getOptionValue(option))
|
|
3015
3016
|
);
|
|
3016
|
-
let
|
|
3017
|
+
let message91 = error || errorMessage;
|
|
3017
3018
|
if (form && name) {
|
|
3018
3019
|
const {
|
|
3019
3020
|
formState: { errors }
|
|
@@ -3023,7 +3024,7 @@ var SearchApiRoot = ({
|
|
|
3023
3024
|
for (const part of nameParts) {
|
|
3024
3025
|
currentError = currentError?.[part];
|
|
3025
3026
|
}
|
|
3026
|
-
|
|
3027
|
+
message91 = currentError?.message || message91;
|
|
3027
3028
|
}
|
|
3028
3029
|
const valueCtx = {
|
|
3029
3030
|
isOpen,
|
|
@@ -3057,7 +3058,7 @@ var SearchApiRoot = ({
|
|
|
3057
3058
|
form,
|
|
3058
3059
|
name,
|
|
3059
3060
|
obj,
|
|
3060
|
-
error:
|
|
3061
|
+
error: message91,
|
|
3061
3062
|
onSelect,
|
|
3062
3063
|
onClear
|
|
3063
3064
|
};
|
|
@@ -3422,7 +3423,7 @@ var DateInput = forwardRef6(
|
|
|
3422
3423
|
value,
|
|
3423
3424
|
...props
|
|
3424
3425
|
}, ref2) => {
|
|
3425
|
-
let
|
|
3426
|
+
let message91 = error;
|
|
3426
3427
|
const { theme } = useWarqadConfig();
|
|
3427
3428
|
const primaryColor = theme?.primaryColor;
|
|
3428
3429
|
const [isFocused, setIsFocused] = useState16(false);
|
|
@@ -3431,13 +3432,13 @@ var DateInput = forwardRef6(
|
|
|
3431
3432
|
formState: { errors }
|
|
3432
3433
|
} = form;
|
|
3433
3434
|
const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
|
|
3434
|
-
|
|
3435
|
+
message91 = errorObj?.message;
|
|
3435
3436
|
}
|
|
3436
3437
|
const inputStyles = `w-full px-2.5 py-1 rounded-md border! shadow-none transition-all! duration-200! outline-none!
|
|
3437
3438
|
bg-white! dark:bg-gray-900/80!
|
|
3438
3439
|
text-gray-900! dark:text-zinc-100!
|
|
3439
3440
|
hover:bg-white! dark:hover:bg-zinc-900!
|
|
3440
|
-
${
|
|
3441
|
+
${message91 ? "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"}
|
|
3441
3442
|
[&.ant-picker-focused]:bg-white dark:[&.ant-picker-focused]:bg-zinc-900
|
|
3442
3443
|
${className}`;
|
|
3443
3444
|
const renderDatePicker = (val, onChangeHandler, onBlur2, refProps) => {
|
|
@@ -3470,8 +3471,8 @@ var DateInput = forwardRef6(
|
|
|
3470
3471
|
needConfirm: false,
|
|
3471
3472
|
style: {
|
|
3472
3473
|
height: "var(--input-height, 40px)",
|
|
3473
|
-
borderColor: isFocused && !
|
|
3474
|
-
boxShadow: isFocused && !
|
|
3474
|
+
borderColor: isFocused && !message91 ? primaryColor : void 0,
|
|
3475
|
+
boxShadow: isFocused && !message91 ? `${primaryColor}33 0px 0px 0px 2px` : void 0
|
|
3475
3476
|
},
|
|
3476
3477
|
classNames: { popup: { root: "z-50" } },
|
|
3477
3478
|
suffixIcon: /* @__PURE__ */ jsx24(Calendar, { className: "h-5 w-5 text-gray-400 group-focus-within:text-primary" }),
|
|
@@ -3486,7 +3487,7 @@ var DateInput = forwardRef6(
|
|
|
3486
3487
|
{
|
|
3487
3488
|
className: "block text-xs font-medium text-gray-700 dark:text-gray-300 transition-colors duration-200",
|
|
3488
3489
|
style: {
|
|
3489
|
-
color:
|
|
3490
|
+
color: message91 ? "#ef4444" : isFocused ? primaryColor : void 0
|
|
3490
3491
|
},
|
|
3491
3492
|
children: [
|
|
3492
3493
|
label,
|
|
@@ -3504,7 +3505,7 @@ var DateInput = forwardRef6(
|
|
|
3504
3505
|
}) => renderDatePicker(value2, onC, onBlur2, fieldRef)
|
|
3505
3506
|
}
|
|
3506
3507
|
) : renderDatePicker(value, onChange, onBlur, ref2),
|
|
3507
|
-
|
|
3508
|
+
message91 && /* @__PURE__ */ jsx24("p", { className: "text-sm text-red-600 dark:text-red-400", children: message91 })
|
|
3508
3509
|
] });
|
|
3509
3510
|
}
|
|
3510
3511
|
);
|
|
@@ -3535,7 +3536,7 @@ var MonthInput = forwardRef7(
|
|
|
3535
3536
|
value,
|
|
3536
3537
|
...props
|
|
3537
3538
|
}, ref2) => {
|
|
3538
|
-
let
|
|
3539
|
+
let message91 = error;
|
|
3539
3540
|
const { theme } = useWarqadConfig();
|
|
3540
3541
|
const primaryColor = theme?.primaryColor;
|
|
3541
3542
|
const [isFocused, setIsFocused] = useState17(false);
|
|
@@ -3544,13 +3545,13 @@ var MonthInput = forwardRef7(
|
|
|
3544
3545
|
formState: { errors }
|
|
3545
3546
|
} = form;
|
|
3546
3547
|
const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
|
|
3547
|
-
|
|
3548
|
+
message91 = errorObj?.message;
|
|
3548
3549
|
}
|
|
3549
3550
|
const inputStyles = `w-full px-2.5 py-1 rounded-md border! shadow-none transition-all! duration-200! outline-none!
|
|
3550
3551
|
bg-white! dark:bg-gray-900/80!
|
|
3551
3552
|
text-gray-900! dark:text-zinc-100!
|
|
3552
3553
|
hover:bg-white! dark:hover:bg-zinc-900!
|
|
3553
|
-
${
|
|
3554
|
+
${message91 ? "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"}
|
|
3554
3555
|
[&.ant-picker-focused]:bg-white dark:[&.ant-picker-focused]:bg-zinc-900
|
|
3555
3556
|
${className}`;
|
|
3556
3557
|
const renderDatePicker = (val, onChangeHandler, onBlur2, refProps) => {
|
|
@@ -3584,8 +3585,8 @@ var MonthInput = forwardRef7(
|
|
|
3584
3585
|
needConfirm: false,
|
|
3585
3586
|
style: {
|
|
3586
3587
|
height: "var(--input-height, 40px)",
|
|
3587
|
-
borderColor: isFocused && !
|
|
3588
|
-
boxShadow: isFocused && !
|
|
3588
|
+
borderColor: isFocused && !message91 ? primaryColor : void 0,
|
|
3589
|
+
boxShadow: isFocused && !message91 ? `${primaryColor}33 0px 0px 0px 2px` : void 0
|
|
3589
3590
|
},
|
|
3590
3591
|
classNames: { popup: { root: "z-50" } },
|
|
3591
3592
|
suffixIcon: /* @__PURE__ */ jsx25(Calendar2, { className: "h-5 w-5 text-gray-400 group-focus-within:text-primary" }),
|
|
@@ -3600,7 +3601,7 @@ var MonthInput = forwardRef7(
|
|
|
3600
3601
|
{
|
|
3601
3602
|
className: "block text-xs font-medium text-gray-700 dark:text-gray-300 transition-colors duration-200",
|
|
3602
3603
|
style: {
|
|
3603
|
-
color:
|
|
3604
|
+
color: message91 ? "#ef4444" : isFocused ? primaryColor : void 0
|
|
3604
3605
|
},
|
|
3605
3606
|
children: [
|
|
3606
3607
|
label,
|
|
@@ -3618,7 +3619,7 @@ var MonthInput = forwardRef7(
|
|
|
3618
3619
|
}) => renderDatePicker(value2, onC, onBlur2, fieldRef)
|
|
3619
3620
|
}
|
|
3620
3621
|
) : renderDatePicker(value, onChange, onBlur, ref2),
|
|
3621
|
-
|
|
3622
|
+
message91 && /* @__PURE__ */ jsx25("p", { className: "text-sm text-red-600 dark:text-red-400", children: message91 })
|
|
3622
3623
|
] });
|
|
3623
3624
|
}
|
|
3624
3625
|
);
|
|
@@ -9142,17 +9143,17 @@ var preWarningFns = [];
|
|
|
9142
9143
|
var preMessage = (fn) => {
|
|
9143
9144
|
preWarningFns.push(fn);
|
|
9144
9145
|
};
|
|
9145
|
-
function warning(valid,
|
|
9146
|
+
function warning(valid, message91) {
|
|
9146
9147
|
if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
|
|
9147
|
-
const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "warning"),
|
|
9148
|
+
const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "warning"), message91);
|
|
9148
9149
|
if (finalMessage) {
|
|
9149
9150
|
console.error(`Warning: ${finalMessage}`);
|
|
9150
9151
|
}
|
|
9151
9152
|
}
|
|
9152
9153
|
}
|
|
9153
|
-
function note(valid,
|
|
9154
|
+
function note(valid, message91) {
|
|
9154
9155
|
if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
|
|
9155
|
-
const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "note"),
|
|
9156
|
+
const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "note"), message91);
|
|
9156
9157
|
if (finalMessage) {
|
|
9157
9158
|
console.warn(`Note: ${finalMessage}`);
|
|
9158
9159
|
}
|
|
@@ -9161,17 +9162,17 @@ function note(valid, message90) {
|
|
|
9161
9162
|
function resetWarned() {
|
|
9162
9163
|
warned = {};
|
|
9163
9164
|
}
|
|
9164
|
-
function call(method, valid,
|
|
9165
|
-
if (!valid && !warned[
|
|
9166
|
-
method(false,
|
|
9167
|
-
warned[
|
|
9165
|
+
function call(method, valid, message91) {
|
|
9166
|
+
if (!valid && !warned[message91]) {
|
|
9167
|
+
method(false, message91);
|
|
9168
|
+
warned[message91] = true;
|
|
9168
9169
|
}
|
|
9169
9170
|
}
|
|
9170
|
-
function warningOnce(valid,
|
|
9171
|
-
call(warning, valid,
|
|
9171
|
+
function warningOnce(valid, message91) {
|
|
9172
|
+
call(warning, valid, message91);
|
|
9172
9173
|
}
|
|
9173
|
-
function noteOnce(valid,
|
|
9174
|
-
call(note, valid,
|
|
9174
|
+
function noteOnce(valid, message91) {
|
|
9175
|
+
call(note, valid, message91);
|
|
9175
9176
|
}
|
|
9176
9177
|
warningOnce.preMessage = preMessage;
|
|
9177
9178
|
warningOnce.resetWarned = resetWarned;
|
|
@@ -9182,8 +9183,8 @@ import React20, { useContext as useContext5, useEffect as useEffect18 } from "re
|
|
|
9182
9183
|
function camelCase(input) {
|
|
9183
9184
|
return input.replace(/-(.)/g, (match, g) => g.toUpperCase());
|
|
9184
9185
|
}
|
|
9185
|
-
function warning2(valid,
|
|
9186
|
-
warningOnce(valid, `[@ant-design/icons] ${
|
|
9186
|
+
function warning2(valid, message91) {
|
|
9187
|
+
warningOnce(valid, `[@ant-design/icons] ${message91}`);
|
|
9187
9188
|
}
|
|
9188
9189
|
function isIconDefinition(target) {
|
|
9189
9190
|
return typeof target === "object" && typeof target.name === "string" && typeof target.theme === "string" && (typeof target.icon === "object" || typeof target.icon === "function");
|
|
@@ -15317,7 +15318,7 @@ var Transaction = ({
|
|
|
15317
15318
|
["journal", "journal-3"].includes(type) && /* @__PURE__ */ jsx74(JournalView_default, { data: data?.data, isLoading }),
|
|
15318
15319
|
["payment", "payment-3"].includes(type) && /* @__PURE__ */ jsx74(PaymentView_default, { data: data?.data, isLoading }),
|
|
15319
15320
|
type === "money transfer" && /* @__PURE__ */ jsx74(MoneyTransfer_default, { data: data?.data, isLoading }),
|
|
15320
|
-
|
|
15321
|
+
["expense", "expense-3"].includes(type) && /* @__PURE__ */ jsx74(ExpenseView_default, { data: data?.data, isLoading }),
|
|
15321
15322
|
type === "adjustment" && /* @__PURE__ */ jsx74(WalletAdjustmentView_default, { data: data?.data, isLoading }),
|
|
15322
15323
|
type === "forex transfer" && /* @__PURE__ */ jsx74(ForexTransferView_default, { data: data?.data, isLoading }),
|
|
15323
15324
|
type === "forex dubai to china" && /* @__PURE__ */ jsx74(ForexDubaiToChinaView_default, { data: data?.data, isLoading }),
|
|
@@ -15475,7 +15476,7 @@ var Guard = () => {
|
|
|
15475
15476
|
const fetchProfile = async () => {
|
|
15476
15477
|
try {
|
|
15477
15478
|
const res = await get({
|
|
15478
|
-
url: "/
|
|
15479
|
+
url: "/users/me",
|
|
15479
15480
|
v: 1
|
|
15480
15481
|
});
|
|
15481
15482
|
login(res?.data);
|
|
@@ -15563,7 +15564,7 @@ function Accounts({ v, url }) {
|
|
|
15563
15564
|
"span",
|
|
15564
15565
|
{
|
|
15565
15566
|
onClick: () => navigate(`statements/${account?._id}`),
|
|
15566
|
-
className: "cursor-pointer hover:underline text-blue-600",
|
|
15567
|
+
className: "cursor-pointer hover:underline text-blue-600 capitalize",
|
|
15567
15568
|
children: account?.name
|
|
15568
15569
|
}
|
|
15569
15570
|
);
|
|
@@ -23068,7 +23069,7 @@ var ForexExpensesReport_default = ForexExpensesReport;
|
|
|
23068
23069
|
import { jsx as jsx131, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
23069
23070
|
var ErrorPageBase = ({
|
|
23070
23071
|
title,
|
|
23071
|
-
message:
|
|
23072
|
+
message: message91,
|
|
23072
23073
|
statusCode,
|
|
23073
23074
|
action,
|
|
23074
23075
|
className = ""
|
|
@@ -23085,7 +23086,7 @@ var ErrorPageBase = ({
|
|
|
23085
23086
|
statusCode
|
|
23086
23087
|
] }),
|
|
23087
23088
|
title && /* @__PURE__ */ jsx131("h1", { className: "text-4xl md:text-5xl font-extrabold tracking-tight drop-shadow-sm", children: title }),
|
|
23088
|
-
|
|
23089
|
+
message91 && /* @__PURE__ */ jsx131("p", { className: "text-lg md:text-xl text-zinc-600 dark:text-zinc-400 max-w-md mx-auto", children: message91 }),
|
|
23089
23090
|
action && /* @__PURE__ */ jsx131("div", { className: "pt-8", children: /* @__PURE__ */ jsx131(
|
|
23090
23091
|
"button",
|
|
23091
23092
|
{
|
|
@@ -23714,7 +23715,7 @@ var AccountStatements = () => {
|
|
|
23714
23715
|
var Statements_default = AccountStatements;
|
|
23715
23716
|
|
|
23716
23717
|
// src/components/accounts/balances.tsx
|
|
23717
|
-
import { useNavigate as useNavigate22, useSearchParams as useSearchParams5 } from "react-router-dom";
|
|
23718
|
+
import { useNavigate as useNavigate22, useParams as useParams28, useSearchParams as useSearchParams5 } from "react-router-dom";
|
|
23718
23719
|
import { useMemo as useMemo22, useState as useState53, useEffect as useEffect46 } from "react";
|
|
23719
23720
|
import { Fragment as Fragment59, jsx as jsx139, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
23720
23721
|
var options2 = [
|
|
@@ -23724,6 +23725,7 @@ var options2 = [
|
|
|
23724
23725
|
];
|
|
23725
23726
|
var AccountBalances = () => {
|
|
23726
23727
|
const navigate = useNavigate22();
|
|
23728
|
+
const { branchId } = useParams28();
|
|
23727
23729
|
const [searchParams, setSearchParams] = useSearchParams5();
|
|
23728
23730
|
const { apiConfig, enums, currencies } = useWarqadConfig();
|
|
23729
23731
|
const defaultCurrency = currencies.stock || "all";
|
|
@@ -23768,14 +23770,14 @@ var AccountBalances = () => {
|
|
|
23768
23770
|
}
|
|
23769
23771
|
}, [urlCurrency, defaultCurrency]);
|
|
23770
23772
|
const { A4DataView, data } = useA4DataView_default({
|
|
23771
|
-
url: `${apiConfig.accountStatementApi}${type !== "all" ? `?type=${type}` : ""}`,
|
|
23773
|
+
url: `${apiConfig.accountStatementApi}${type !== "all" ? `?type=${type}` : ""}${branchId ? `&branch=${branchId}` : ""}`,
|
|
23772
23774
|
v: 1,
|
|
23773
23775
|
// No prefix
|
|
23774
23776
|
params: {
|
|
23775
23777
|
currency: currencyFilter === "all" ? "" : currencyFilter
|
|
23776
23778
|
}
|
|
23777
23779
|
});
|
|
23778
|
-
const { TransactionView
|
|
23780
|
+
const { TransactionView } = useTransactionView_default();
|
|
23779
23781
|
const currency = data?.data?.currency;
|
|
23780
23782
|
const columns = [
|
|
23781
23783
|
{
|
|
@@ -24193,11 +24195,11 @@ var WalletStatements = () => {
|
|
|
24193
24195
|
var Statements_default2 = WalletStatements;
|
|
24194
24196
|
|
|
24195
24197
|
// src/components/walletAdjustment/WalletAdjustments.tsx
|
|
24196
|
-
import { useNavigate as useNavigate24, useParams as
|
|
24198
|
+
import { useNavigate as useNavigate24, useParams as useParams29 } from "react-router-dom";
|
|
24197
24199
|
import { EllipsisVertical as EllipsisVertical15, FilePenLine as FilePenLine14, Trash2 as Trash218 } from "lucide-react";
|
|
24198
24200
|
import { Fragment as Fragment61, jsx as jsx141, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
24199
24201
|
function WalletAdjustments({ url }) {
|
|
24200
|
-
const { branchId } =
|
|
24202
|
+
const { branchId } = useParams29();
|
|
24201
24203
|
const navigate = useNavigate24();
|
|
24202
24204
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
24203
24205
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -24327,7 +24329,7 @@ var WalletAdjustments_default = WalletAdjustments;
|
|
|
24327
24329
|
|
|
24328
24330
|
// src/components/walletAdjustment/WalletAdjustmentForm.tsx
|
|
24329
24331
|
import { useEffect as useEffect48, useState as useState55 } from "react";
|
|
24330
|
-
import { useParams as
|
|
24332
|
+
import { useParams as useParams30 } from "react-router-dom";
|
|
24331
24333
|
import { useForm as useForm24 } from "react-hook-form";
|
|
24332
24334
|
import { zodResolver as zodResolver23 } from "@hookform/resolvers/zod";
|
|
24333
24335
|
import { message as message39 } from "antd";
|
|
@@ -24349,7 +24351,7 @@ var walletAdjustmentSchema = z18.object({
|
|
|
24349
24351
|
// src/components/walletAdjustment/WalletAdjustmentForm.tsx
|
|
24350
24352
|
import { jsx as jsx142, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
24351
24353
|
function WalletAdjustmentForm() {
|
|
24352
|
-
const { branchId } =
|
|
24354
|
+
const { branchId } = useParams30();
|
|
24353
24355
|
const { getQuery, navigate } = useApp_default();
|
|
24354
24356
|
const id = getQuery("id");
|
|
24355
24357
|
const isEdit = !!id;
|
|
@@ -24513,11 +24515,11 @@ function WalletAdjustmentForm() {
|
|
|
24513
24515
|
var WalletAdjustmentForm_default = WalletAdjustmentForm;
|
|
24514
24516
|
|
|
24515
24517
|
// src/components/forexTransfer/ForexTransfers.tsx
|
|
24516
|
-
import { useNavigate as useNavigate25, useParams as
|
|
24518
|
+
import { useNavigate as useNavigate25, useParams as useParams31 } from "react-router-dom";
|
|
24517
24519
|
import { EllipsisVertical as EllipsisVertical16, FilePenLine as FilePenLine15, Trash2 as Trash219 } from "lucide-react";
|
|
24518
24520
|
import { Fragment as Fragment62, jsx as jsx143, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
24519
24521
|
function ForexTransfers({ url }) {
|
|
24520
|
-
const { branchId } =
|
|
24522
|
+
const { branchId } = useParams31();
|
|
24521
24523
|
const navigate = useNavigate25();
|
|
24522
24524
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
24523
24525
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -24662,7 +24664,7 @@ var ForexTransfers_default = ForexTransfers;
|
|
|
24662
24664
|
|
|
24663
24665
|
// src/components/forexTransfer/ForexTransferForm.tsx
|
|
24664
24666
|
import { useEffect as useEffect49, useMemo as useMemo24, useState as useState56 } from "react";
|
|
24665
|
-
import { useParams as
|
|
24667
|
+
import { useParams as useParams32 } from "react-router-dom";
|
|
24666
24668
|
import { useForm as useForm25 } from "react-hook-form";
|
|
24667
24669
|
import { zodResolver as zodResolver24 } from "@hookform/resolvers/zod";
|
|
24668
24670
|
import { message as message40 } from "antd";
|
|
@@ -24688,7 +24690,7 @@ var forexTransferSchema = z19.object({
|
|
|
24688
24690
|
// src/components/forexTransfer/ForexTransferForm.tsx
|
|
24689
24691
|
import { Fragment as Fragment63, jsx as jsx144, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
24690
24692
|
function ForexTransferForm() {
|
|
24691
|
-
const { branchId } =
|
|
24693
|
+
const { branchId } = useParams32();
|
|
24692
24694
|
const { getQuery, navigate } = useApp_default();
|
|
24693
24695
|
const id = getQuery("id");
|
|
24694
24696
|
const isEdit = !!id;
|
|
@@ -24927,14 +24929,14 @@ function ForexTransferForm() {
|
|
|
24927
24929
|
var ForexTransferForm_default = ForexTransferForm;
|
|
24928
24930
|
|
|
24929
24931
|
// src/components/stocks/clothend/adjustment/ClothendStockAdjustment.tsx
|
|
24930
|
-
import { useNavigate as useNavigate26, useParams as
|
|
24932
|
+
import { useNavigate as useNavigate26, useParams as useParams33 } from "react-router-dom";
|
|
24931
24933
|
import { EllipsisVertical as EllipsisVertical17, Eye as Eye5, FilePenLine as FilePenLine16, Trash2 as Trash220 } from "lucide-react";
|
|
24932
24934
|
import { Fragment as Fragment64, jsx as jsx145, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
24933
24935
|
function ClothendStockAdjustment({
|
|
24934
24936
|
url,
|
|
24935
24937
|
type = "product"
|
|
24936
24938
|
}) {
|
|
24937
|
-
const { branchId } =
|
|
24939
|
+
const { branchId } = useParams33();
|
|
24938
24940
|
const navigate = useNavigate26();
|
|
24939
24941
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
24940
24942
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -25717,7 +25719,7 @@ function getStorageType(type, branch) {
|
|
|
25717
25719
|
var pos_default = PosStockAdjustment;
|
|
25718
25720
|
|
|
25719
25721
|
// src/components/stocks/clothend/sale/SaleStockAdjustment.tsx
|
|
25720
|
-
import { useNavigate as useNavigate27, useParams as
|
|
25722
|
+
import { useNavigate as useNavigate27, useParams as useParams34 } from "react-router-dom";
|
|
25721
25723
|
import {
|
|
25722
25724
|
EllipsisVertical as EllipsisVertical18,
|
|
25723
25725
|
Eye as Eye6,
|
|
@@ -25730,7 +25732,7 @@ function SaleStockAdjustment({
|
|
|
25730
25732
|
url,
|
|
25731
25733
|
type = "product"
|
|
25732
25734
|
}) {
|
|
25733
|
-
const { branchId } =
|
|
25735
|
+
const { branchId } = useParams34();
|
|
25734
25736
|
const navigate = useNavigate27();
|
|
25735
25737
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
25736
25738
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -25896,13 +25898,13 @@ import { useEffect as useEffect54, useLayoutEffect as useLayoutEffect4, useState
|
|
|
25896
25898
|
|
|
25897
25899
|
// src/components/stocks/clothend/sale/header.tsx
|
|
25898
25900
|
import { useFormContext as useFormContext2 } from "react-hook-form";
|
|
25899
|
-
import { useParams as
|
|
25901
|
+
import { useParams as useParams35 } from "react-router-dom";
|
|
25900
25902
|
import { useEffect as useEffect52 } from "react";
|
|
25901
25903
|
import { jsx as jsx150, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
25902
25904
|
function SaleHeader({ stockType }) {
|
|
25903
25905
|
const form = useFormContext2();
|
|
25904
25906
|
const { branches } = useAuth_default();
|
|
25905
|
-
const { branchId } =
|
|
25907
|
+
const { branchId } = useParams35();
|
|
25906
25908
|
const sale = form.watch("sale");
|
|
25907
25909
|
const { currencies } = useWarqadConfig();
|
|
25908
25910
|
const branchCurrency = (branches || []).find(
|
|
@@ -26394,12 +26396,12 @@ var schema_default3 = AdjustmentStockSchema2;
|
|
|
26394
26396
|
|
|
26395
26397
|
// src/components/stocks/clothend/sale/pos.tsx
|
|
26396
26398
|
import { ArrowLeft as ArrowLeft6 } from "lucide-react";
|
|
26397
|
-
import { useParams as
|
|
26399
|
+
import { useParams as useParams36 } from "react-router-dom";
|
|
26398
26400
|
import { Fragment as Fragment69, jsx as jsx152, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
26399
26401
|
var SaleStockForm = ({ type }) => {
|
|
26400
26402
|
const { getQuery, navigate } = useApp_default();
|
|
26401
26403
|
const stockType = type;
|
|
26402
|
-
const { branchId } =
|
|
26404
|
+
const { branchId } = useParams36();
|
|
26403
26405
|
const saleId = getQuery("id");
|
|
26404
26406
|
const { branches } = useAuth_default();
|
|
26405
26407
|
const { currencies } = useWarqadConfig();
|
|
@@ -26663,14 +26665,14 @@ function getStorageType2(type, branch) {
|
|
|
26663
26665
|
var pos_default2 = SaleStockForm;
|
|
26664
26666
|
|
|
26665
26667
|
// src/components/stocks/clothend/transfer/ClothendStockTransfer.tsx
|
|
26666
|
-
import { useNavigate as useNavigate28, useParams as
|
|
26668
|
+
import { useNavigate as useNavigate28, useParams as useParams37 } from "react-router-dom";
|
|
26667
26669
|
import { EllipsisVertical as EllipsisVertical19, Eye as Eye7, FilePenLine as FilePenLine18, Trash2 as Trash222 } from "lucide-react";
|
|
26668
26670
|
import { Fragment as Fragment70, jsx as jsx153, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
26669
26671
|
function ClothendStockTransfer({
|
|
26670
26672
|
url,
|
|
26671
26673
|
type = "product"
|
|
26672
26674
|
}) {
|
|
26673
|
-
const { branchId } =
|
|
26675
|
+
const { branchId } = useParams37();
|
|
26674
26676
|
const navigate = useNavigate28();
|
|
26675
26677
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
26676
26678
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -26798,12 +26800,12 @@ import { useEffect as useEffect57, useLayoutEffect as useLayoutEffect5, useState
|
|
|
26798
26800
|
|
|
26799
26801
|
// src/components/stocks/clothend/transfer/header.tsx
|
|
26800
26802
|
import { useFormContext as useFormContext3 } from "react-hook-form";
|
|
26801
|
-
import { useParams as
|
|
26803
|
+
import { useParams as useParams38 } from "react-router-dom";
|
|
26802
26804
|
import { useEffect as useEffect55, useMemo as useMemo25 } from "react";
|
|
26803
26805
|
import { jsx as jsx154, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
26804
26806
|
function TransferHeader({ stockType }) {
|
|
26805
26807
|
const form = useFormContext3();
|
|
26806
|
-
const { branchId } =
|
|
26808
|
+
const { branchId } = useParams38();
|
|
26807
26809
|
const transfer = form.watch("transfer");
|
|
26808
26810
|
const fromBranch = form.watch("fromBranch");
|
|
26809
26811
|
const filter = useMemo25(() => {
|
|
@@ -27215,11 +27217,11 @@ var schema_default4 = AdjustmentStockSchema3;
|
|
|
27215
27217
|
|
|
27216
27218
|
// src/components/stocks/clothend/transfer/pos.tsx
|
|
27217
27219
|
import { ArrowLeft as ArrowLeft7 } from "lucide-react";
|
|
27218
|
-
import { useParams as
|
|
27220
|
+
import { useParams as useParams39 } from "react-router-dom";
|
|
27219
27221
|
import { Fragment as Fragment72, jsx as jsx156, jsxs as jsxs131 } from "react/jsx-runtime";
|
|
27220
27222
|
var PosStockTransfer = ({ type }) => {
|
|
27221
27223
|
const { getQuery, navigate } = useApp_default();
|
|
27222
|
-
const { branchId } =
|
|
27224
|
+
const { branchId } = useParams39();
|
|
27223
27225
|
const transferId = getQuery("id");
|
|
27224
27226
|
const { currencies } = useWarqadConfig();
|
|
27225
27227
|
const currency = currencies?.stock;
|
|
@@ -27451,11 +27453,11 @@ function getStorageType3(type, branch) {
|
|
|
27451
27453
|
var pos_default3 = PosStockTransfer;
|
|
27452
27454
|
|
|
27453
27455
|
// src/components/forexDubaiToChina/ForexDubaiToChina.tsx
|
|
27454
|
-
import { useNavigate as useNavigate29, useParams as
|
|
27456
|
+
import { useNavigate as useNavigate29, useParams as useParams40 } from "react-router-dom";
|
|
27455
27457
|
import { EllipsisVertical as EllipsisVertical20, Eye as Eye8, FilePenLine as FilePenLine19, Trash2 as Trash223 } from "lucide-react";
|
|
27456
27458
|
import { Fragment as Fragment73, jsx as jsx157, jsxs as jsxs132 } from "react/jsx-runtime";
|
|
27457
27459
|
function ForexDubaiToChina() {
|
|
27458
|
-
const { branchId } =
|
|
27460
|
+
const { branchId } = useParams40();
|
|
27459
27461
|
const navigate = useNavigate29();
|
|
27460
27462
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
27461
27463
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -27638,10 +27640,10 @@ import { useForm as useForm29 } from "react-hook-form";
|
|
|
27638
27640
|
import { zodResolver as zodResolver28 } from "@hookform/resolvers/zod";
|
|
27639
27641
|
import { message as message44 } from "antd";
|
|
27640
27642
|
import { useEffect as useEffect58, useState as useState60, useMemo as useMemo26 } from "react";
|
|
27641
|
-
import { useParams as
|
|
27643
|
+
import { useParams as useParams41 } from "react-router-dom";
|
|
27642
27644
|
import { jsx as jsx158, jsxs as jsxs133 } from "react/jsx-runtime";
|
|
27643
27645
|
function ForexDubaiToChinaForm() {
|
|
27644
|
-
const { branchId } =
|
|
27646
|
+
const { branchId } = useParams41();
|
|
27645
27647
|
const { getQuery, navigate } = useApp_default();
|
|
27646
27648
|
const id = getQuery("id");
|
|
27647
27649
|
const isEdit = !!id;
|
|
@@ -27956,7 +27958,7 @@ var forex2TransactionSchema = z24.object({
|
|
|
27956
27958
|
var schema_default5 = forex2TransactionSchema;
|
|
27957
27959
|
|
|
27958
27960
|
// src/components/accounts/forex-2/Forex2FormTransaction.tsx
|
|
27959
|
-
import { useParams as
|
|
27961
|
+
import { useParams as useParams42 } from "react-router-dom";
|
|
27960
27962
|
import { useEffect as useEffect59, useMemo as useMemo27, useState as useState61 } from "react";
|
|
27961
27963
|
import { Divider, message as message45 } from "antd";
|
|
27962
27964
|
import { Fragment as Fragment74, jsx as jsx159, jsxs as jsxs134 } from "react/jsx-runtime";
|
|
@@ -27968,7 +27970,7 @@ function Forex2FormTransaction({
|
|
|
27968
27970
|
action: defaultAction
|
|
27969
27971
|
}) {
|
|
27970
27972
|
const [accountInfo, setAccountInfo] = useState61(accountData);
|
|
27971
|
-
const { branchId } =
|
|
27973
|
+
const { branchId } = useParams42();
|
|
27972
27974
|
const [ref2, setRef] = useState61("");
|
|
27973
27975
|
const [showReverseModal, setShowReverseModal] = useState61(false);
|
|
27974
27976
|
const { post, isLoading } = useApis_default();
|
|
@@ -28848,7 +28850,7 @@ var ForexAccountStatements = () => {
|
|
|
28848
28850
|
var ForexAccountStatements_default = ForexAccountStatements;
|
|
28849
28851
|
|
|
28850
28852
|
// src/components/reports/StockLevel.tsx
|
|
28851
|
-
import { useParams as
|
|
28853
|
+
import { useParams as useParams44 } from "react-router-dom";
|
|
28852
28854
|
import { Fragment as Fragment77, jsx as jsx162, jsxs as jsxs137 } from "react/jsx-runtime";
|
|
28853
28855
|
var options5 = [
|
|
28854
28856
|
{ label: "Product", value: "product" },
|
|
@@ -28860,7 +28862,7 @@ var StockLevel = ({
|
|
|
28860
28862
|
}) => {
|
|
28861
28863
|
const { apiConfig, currencies } = useWarqadConfig();
|
|
28862
28864
|
const { stock } = currencies;
|
|
28863
|
-
const { branchId } =
|
|
28865
|
+
const { branchId } = useParams44();
|
|
28864
28866
|
const { branches } = useAuth_default();
|
|
28865
28867
|
const { TransactionView } = useTransactionView_default();
|
|
28866
28868
|
const { getQuery, setQuery } = useApp_default();
|
|
@@ -29001,7 +29003,7 @@ var StockLevel = ({
|
|
|
29001
29003
|
var StockLevel_default = StockLevel;
|
|
29002
29004
|
|
|
29003
29005
|
// src/components/reports/profitAndReport.tsx
|
|
29004
|
-
import { useParams as
|
|
29006
|
+
import { useParams as useParams45 } from "react-router-dom";
|
|
29005
29007
|
import { z as z25 } from "zod";
|
|
29006
29008
|
import { useForm as useForm31 } from "react-hook-form";
|
|
29007
29009
|
import { zodResolver as zodResolver30 } from "@hookform/resolvers/zod";
|
|
@@ -29009,7 +29011,7 @@ import { useState as useState64 } from "react";
|
|
|
29009
29011
|
import { Fragment as Fragment78, jsx as jsx163, jsxs as jsxs138 } from "react/jsx-runtime";
|
|
29010
29012
|
var ProfitAndLossReport = () => {
|
|
29011
29013
|
const { apiConfig } = useWarqadConfig();
|
|
29012
|
-
const { branchId } =
|
|
29014
|
+
const { branchId } = useParams45();
|
|
29013
29015
|
const { branches } = useAuth_default();
|
|
29014
29016
|
const { currencies } = useWarqadConfig();
|
|
29015
29017
|
const { stock: currency } = currencies;
|
|
@@ -29233,7 +29235,7 @@ import {
|
|
|
29233
29235
|
Legend,
|
|
29234
29236
|
ResponsiveContainer
|
|
29235
29237
|
} from "recharts";
|
|
29236
|
-
import { useParams as
|
|
29238
|
+
import { useParams as useParams46 } from "react-router-dom";
|
|
29237
29239
|
import { jsx as jsx164, jsxs as jsxs139 } from "react/jsx-runtime";
|
|
29238
29240
|
var { Title, Text } = Typography;
|
|
29239
29241
|
function DateSalesReport({
|
|
@@ -29242,7 +29244,7 @@ function DateSalesReport({
|
|
|
29242
29244
|
}) {
|
|
29243
29245
|
const { data, get, isLoading } = useApis_default();
|
|
29244
29246
|
const { currencies } = useWarqadConfig();
|
|
29245
|
-
const { branchId } =
|
|
29247
|
+
const { branchId } = useParams46();
|
|
29246
29248
|
const { branches } = useAuth_default();
|
|
29247
29249
|
const branch = (branches || []).find((b) => b._id === branchId);
|
|
29248
29250
|
const branchCurrency = branch?.currency || "KES";
|
|
@@ -29671,11 +29673,11 @@ function MessageView({ data, isLoading }) {
|
|
|
29671
29673
|
var MessageView_default = MessageView;
|
|
29672
29674
|
|
|
29673
29675
|
// src/components/messages/Messages.tsx
|
|
29674
|
-
import { useParams as
|
|
29676
|
+
import { useParams as useParams47 } from "react-router-dom";
|
|
29675
29677
|
import { Fragment as Fragment80, jsx as jsx166, jsxs as jsxs141 } from "react/jsx-runtime";
|
|
29676
29678
|
function Messages() {
|
|
29677
29679
|
const { application, store } = useWarqadConfig();
|
|
29678
|
-
const { branchId } =
|
|
29680
|
+
const { branchId } = useParams47();
|
|
29679
29681
|
const socket = useWarqadSocket();
|
|
29680
29682
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
29681
29683
|
url: `/messages/get${branchId ? `?branch=${branchId}` : ""}`,
|
|
@@ -30097,7 +30099,7 @@ var FloorSection = ({
|
|
|
30097
30099
|
var FloorSection_default = FloorSection;
|
|
30098
30100
|
|
|
30099
30101
|
// src/components/realestate/floors/Floors.tsx
|
|
30100
|
-
import { useParams as
|
|
30102
|
+
import { useParams as useParams48 } from "react-router-dom";
|
|
30101
30103
|
|
|
30102
30104
|
// src/components/realestate/floors/FloorFilter.tsx
|
|
30103
30105
|
import { jsx as jsx173, jsxs as jsxs148 } from "react/jsx-runtime";
|
|
@@ -30381,7 +30383,7 @@ function FloorsContainer({ type = "rent" }) {
|
|
|
30381
30383
|
const [statusFilter, setStatusFilter] = useState65("all");
|
|
30382
30384
|
const [selectedFloorId, setSelectedFloorId] = useState65("all");
|
|
30383
30385
|
const { get, data, isLoading } = useApis_default();
|
|
30384
|
-
const { branchId } =
|
|
30386
|
+
const { branchId } = useParams48();
|
|
30385
30387
|
const rawFloors = data?.data || [];
|
|
30386
30388
|
const floorsData = useMemo31(() => {
|
|
30387
30389
|
return rawFloors.map((floor) => ({
|
|
@@ -30563,7 +30565,7 @@ var Floors = FloorsContainer;
|
|
|
30563
30565
|
var Floors_default = Floors;
|
|
30564
30566
|
|
|
30565
30567
|
// src/components/realestate/units/UnitField.tsx
|
|
30566
|
-
import { useParams as
|
|
30568
|
+
import { useParams as useParams49 } from "react-router-dom";
|
|
30567
30569
|
import { jsx as jsx176 } from "react/jsx-runtime";
|
|
30568
30570
|
function UnitField({
|
|
30569
30571
|
name,
|
|
@@ -30577,7 +30579,7 @@ function UnitField({
|
|
|
30577
30579
|
disabled,
|
|
30578
30580
|
obj
|
|
30579
30581
|
}) {
|
|
30580
|
-
const { branchId } =
|
|
30582
|
+
const { branchId } = useParams49();
|
|
30581
30583
|
const separator = api.includes("?") ? "&" : "?";
|
|
30582
30584
|
let apiUrl = api;
|
|
30583
30585
|
if (branchId) {
|
|
@@ -30611,14 +30613,14 @@ var Units = {
|
|
|
30611
30613
|
var units_default = Units;
|
|
30612
30614
|
|
|
30613
30615
|
// src/components/realestate/lease/journal/LeaseJornal.tsx
|
|
30614
|
-
import { useNavigate as useNavigate31, useParams as
|
|
30616
|
+
import { useNavigate as useNavigate31, useParams as useParams50 } from "react-router-dom";
|
|
30615
30617
|
import { EllipsisVertical as EllipsisVertical22, Eye as Eye10, FilePenLine as FilePenLine20, Trash2 as Trash224 } from "lucide-react";
|
|
30616
30618
|
import { Fragment as Fragment82, jsx as jsx177, jsxs as jsxs151 } from "react/jsx-runtime";
|
|
30617
30619
|
function LeaseJournals({
|
|
30618
30620
|
url,
|
|
30619
30621
|
leaseType
|
|
30620
30622
|
}) {
|
|
30621
|
-
const { branchId } =
|
|
30623
|
+
const { branchId } = useParams50();
|
|
30622
30624
|
const navigate = useNavigate31();
|
|
30623
30625
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
30624
30626
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -30795,7 +30797,7 @@ var leaseJournalSchema = z26.object({
|
|
|
30795
30797
|
import { useForm as useForm32 } from "react-hook-form";
|
|
30796
30798
|
import { zodResolver as zodResolver31 } from "@hookform/resolvers/zod";
|
|
30797
30799
|
import { useEffect as useEffect65, useState as useState66 } from "react";
|
|
30798
|
-
import { useParams as
|
|
30800
|
+
import { useParams as useParams51 } from "react-router-dom";
|
|
30799
30801
|
import { message as message47 } from "antd";
|
|
30800
30802
|
import { jsx as jsx178, jsxs as jsxs152 } from "react/jsx-runtime";
|
|
30801
30803
|
function LeaseJornalFrom({ leaseType }) {
|
|
@@ -30808,7 +30810,7 @@ function LeaseJornalFrom({ leaseType }) {
|
|
|
30808
30810
|
}
|
|
30809
30811
|
});
|
|
30810
30812
|
const [ref2, setRef] = useState66("");
|
|
30811
|
-
const { branchId } =
|
|
30813
|
+
const { branchId } = useParams51();
|
|
30812
30814
|
const { getQuery, navigate } = useApp_default();
|
|
30813
30815
|
const id = getQuery("id");
|
|
30814
30816
|
const isEdit = !!id;
|
|
@@ -31007,12 +31009,12 @@ import { zodResolver as zodResolver32 } from "@hookform/resolvers/zod";
|
|
|
31007
31009
|
import { useForm as useForm33 } from "react-hook-form";
|
|
31008
31010
|
import moment9 from "moment";
|
|
31009
31011
|
import { message as message48 } from "antd";
|
|
31010
|
-
import { useParams as
|
|
31012
|
+
import { useParams as useParams52 } from "react-router-dom";
|
|
31011
31013
|
import { useEffect as useEffect66 } from "react";
|
|
31012
31014
|
import { jsx as jsx179, jsxs as jsxs153 } from "react/jsx-runtime";
|
|
31013
31015
|
function LeaseForm({ leaseType }) {
|
|
31014
31016
|
const { getQuery, navigate } = useApp_default();
|
|
31015
|
-
const { branchId } =
|
|
31017
|
+
const { branchId } = useParams52();
|
|
31016
31018
|
const id = getQuery("id");
|
|
31017
31019
|
const isEdit = !!id;
|
|
31018
31020
|
const { isLoading: getLoading, get } = useApis_default();
|
|
@@ -31147,14 +31149,14 @@ function LeaseForm({ leaseType }) {
|
|
|
31147
31149
|
var LeaseForm_default = LeaseForm;
|
|
31148
31150
|
|
|
31149
31151
|
// src/components/realestate/lease/payment/LeasePayment.tsx
|
|
31150
|
-
import { useNavigate as useNavigate32, useParams as
|
|
31152
|
+
import { useNavigate as useNavigate32, useParams as useParams53 } from "react-router-dom";
|
|
31151
31153
|
import { EllipsisVertical as EllipsisVertical23, Eye as Eye11, FilePenLine as FilePenLine21, Trash2 as Trash225 } from "lucide-react";
|
|
31152
31154
|
import { Fragment as Fragment83, jsx as jsx180, jsxs as jsxs154 } from "react/jsx-runtime";
|
|
31153
31155
|
function LeasePayment({
|
|
31154
31156
|
url,
|
|
31155
31157
|
leaseType
|
|
31156
31158
|
}) {
|
|
31157
|
-
const { branchId } =
|
|
31159
|
+
const { branchId } = useParams53();
|
|
31158
31160
|
const navigate = useNavigate32();
|
|
31159
31161
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
31160
31162
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -31331,7 +31333,7 @@ var leaseJournalSchema2 = z28.object({
|
|
|
31331
31333
|
import { useForm as useForm34 } from "react-hook-form";
|
|
31332
31334
|
import { zodResolver as zodResolver33 } from "@hookform/resolvers/zod";
|
|
31333
31335
|
import { useEffect as useEffect67, useState as useState67 } from "react";
|
|
31334
|
-
import { useParams as
|
|
31336
|
+
import { useParams as useParams54 } from "react-router-dom";
|
|
31335
31337
|
import { message as message49 } from "antd";
|
|
31336
31338
|
import { jsx as jsx181, jsxs as jsxs155 } from "react/jsx-runtime";
|
|
31337
31339
|
function LeasePaymentForm({ leaseType }) {
|
|
@@ -31344,7 +31346,7 @@ function LeasePaymentForm({ leaseType }) {
|
|
|
31344
31346
|
}
|
|
31345
31347
|
});
|
|
31346
31348
|
const [ref2, setRef] = useState67("");
|
|
31347
|
-
const { branchId } =
|
|
31349
|
+
const { branchId } = useParams54();
|
|
31348
31350
|
const { getQuery, navigate } = useApp_default();
|
|
31349
31351
|
const id = getQuery("id");
|
|
31350
31352
|
const { apiConfig } = useWarqadConfig();
|
|
@@ -31522,14 +31524,14 @@ function LeasePaymentForm({ leaseType }) {
|
|
|
31522
31524
|
var LeasePaymentForm_default = LeasePaymentForm;
|
|
31523
31525
|
|
|
31524
31526
|
// src/components/realestate/lease/invoice/LeaseInvoice.tsx
|
|
31525
|
-
import { useNavigate as useNavigate33, useParams as
|
|
31527
|
+
import { useNavigate as useNavigate33, useParams as useParams55 } from "react-router-dom";
|
|
31526
31528
|
import { EllipsisVertical as EllipsisVertical24, Eye as Eye12, FilePenLine as FilePenLine22, Trash2 as Trash226 } from "lucide-react";
|
|
31527
31529
|
import { Fragment as Fragment84, jsx as jsx182, jsxs as jsxs156 } from "react/jsx-runtime";
|
|
31528
31530
|
function LeaseInvoice({
|
|
31529
31531
|
url,
|
|
31530
31532
|
leaseType
|
|
31531
31533
|
}) {
|
|
31532
|
-
const { branchId } =
|
|
31534
|
+
const { branchId } = useParams55();
|
|
31533
31535
|
const navigate = useNavigate33();
|
|
31534
31536
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
31535
31537
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -31691,7 +31693,7 @@ var LeaseInvoice_default = LeaseInvoice;
|
|
|
31691
31693
|
import { useForm as useForm35 } from "react-hook-form";
|
|
31692
31694
|
import { zodResolver as zodResolver34 } from "@hookform/resolvers/zod";
|
|
31693
31695
|
import { useEffect as useEffect68, useState as useState68 } from "react";
|
|
31694
|
-
import { useParams as
|
|
31696
|
+
import { useParams as useParams57 } from "react-router-dom";
|
|
31695
31697
|
import { message as message50 } from "antd";
|
|
31696
31698
|
|
|
31697
31699
|
// src/components/realestate/lease/invoice/schema.ts
|
|
@@ -31710,7 +31712,7 @@ var leaseInvoiceSchema = z29.object({
|
|
|
31710
31712
|
});
|
|
31711
31713
|
|
|
31712
31714
|
// src/components/realestate/lease/LeaseField.tsx
|
|
31713
|
-
import { useParams as
|
|
31715
|
+
import { useParams as useParams56 } from "react-router-dom";
|
|
31714
31716
|
import { jsx as jsx183 } from "react/jsx-runtime";
|
|
31715
31717
|
function LeaseField({
|
|
31716
31718
|
name,
|
|
@@ -31724,7 +31726,7 @@ function LeaseField({
|
|
|
31724
31726
|
disabled,
|
|
31725
31727
|
obj
|
|
31726
31728
|
}) {
|
|
31727
|
-
const { branchId } =
|
|
31729
|
+
const { branchId } = useParams56();
|
|
31728
31730
|
const separator = api.includes("?") ? "&" : "?";
|
|
31729
31731
|
let apiUrl = api;
|
|
31730
31732
|
if (branchId) {
|
|
@@ -31772,7 +31774,7 @@ function LeaseInvoiceForm({ leaseType }) {
|
|
|
31772
31774
|
}
|
|
31773
31775
|
});
|
|
31774
31776
|
const [ref2, setRef] = useState68("");
|
|
31775
|
-
const { branchId } =
|
|
31777
|
+
const { branchId } = useParams57();
|
|
31776
31778
|
const { getQuery, navigate } = useApp_default();
|
|
31777
31779
|
const id = getQuery("id");
|
|
31778
31780
|
const isEdit = !!id;
|
|
@@ -31963,7 +31965,7 @@ function LeaseInvoiceForm({ leaseType }) {
|
|
|
31963
31965
|
var LeaseInvoiceForm_default = LeaseInvoiceForm;
|
|
31964
31966
|
|
|
31965
31967
|
// src/components/realestate/lease/Leases.tsx
|
|
31966
|
-
import { useNavigate as useNavigate34, useParams as
|
|
31968
|
+
import { useNavigate as useNavigate34, useParams as useParams58 } from "react-router-dom";
|
|
31967
31969
|
import { EllipsisVertical as EllipsisVertical25, Eye as Eye13, FilePenLine as FilePenLine23, Trash2 as Trash227 } from "lucide-react";
|
|
31968
31970
|
|
|
31969
31971
|
// src/components/realestate/lease/view/useLeaseView.tsx
|
|
@@ -32331,7 +32333,7 @@ function Leases({
|
|
|
32331
32333
|
url,
|
|
32332
32334
|
leaseType
|
|
32333
32335
|
}) {
|
|
32334
|
-
const { branchId } =
|
|
32336
|
+
const { branchId } = useParams58();
|
|
32335
32337
|
const navigate = useNavigate34();
|
|
32336
32338
|
const { LeaseView, openLease } = useLeaseView_default();
|
|
32337
32339
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -32465,14 +32467,14 @@ function Leases({
|
|
|
32465
32467
|
var Leases_default = Leases;
|
|
32466
32468
|
|
|
32467
32469
|
// src/components/realestate/lease/EndLeases.tsx
|
|
32468
|
-
import { useNavigate as useNavigate35, useParams as
|
|
32470
|
+
import { useNavigate as useNavigate35, useParams as useParams59 } from "react-router-dom";
|
|
32469
32471
|
import { EllipsisVertical as EllipsisVertical26, Eye as Eye14 } from "lucide-react";
|
|
32470
32472
|
import { Fragment as Fragment87, jsx as jsx188, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
32471
32473
|
function EndLeases({
|
|
32472
32474
|
url,
|
|
32473
32475
|
leaseType
|
|
32474
32476
|
}) {
|
|
32475
|
-
const { branchId } =
|
|
32477
|
+
const { branchId } = useParams59();
|
|
32476
32478
|
const navigate = useNavigate35();
|
|
32477
32479
|
const { LeaseView, openLease } = useLeaseView_default();
|
|
32478
32480
|
const { data, TransactionViewComponent } = useTransaction_default({
|
|
@@ -32785,11 +32787,11 @@ function ViewLease({ data }) {
|
|
|
32785
32787
|
var EndLeaseForm_default = EndLeaseForm;
|
|
32786
32788
|
|
|
32787
32789
|
// src/components/realestate/lease/paybill/Paybill.tsx
|
|
32788
|
-
import { useNavigate as useNavigate36, useParams as
|
|
32790
|
+
import { useNavigate as useNavigate36, useParams as useParams60 } from "react-router-dom";
|
|
32789
32791
|
import { EllipsisVertical as EllipsisVertical27, Eye as Eye15, FilePenLine as FilePenLine24, Trash2 as Trash228 } from "lucide-react";
|
|
32790
32792
|
import { Fragment as Fragment88, jsx as jsx190, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
32791
32793
|
function Paybill2() {
|
|
32792
|
-
const { branchId } =
|
|
32794
|
+
const { branchId } = useParams60();
|
|
32793
32795
|
const navigate = useNavigate36();
|
|
32794
32796
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
32795
32797
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -33123,14 +33125,14 @@ function PaybillForm() {
|
|
|
33123
33125
|
var PaybillForm_default = PaybillForm;
|
|
33124
33126
|
|
|
33125
33127
|
// src/components/realestate/lease/invoices/LeaseInvoices.tsx
|
|
33126
|
-
import { useNavigate as useNavigate37, useParams as
|
|
33128
|
+
import { useNavigate as useNavigate37, useParams as useParams61 } from "react-router-dom";
|
|
33127
33129
|
import { EllipsisVertical as EllipsisVertical28, Eye as Eye16, FilePenLine as FilePenLine25, Trash2 as Trash229 } from "lucide-react";
|
|
33128
33130
|
import { Fragment as Fragment89, jsx as jsx192, jsxs as jsxs164 } from "react/jsx-runtime";
|
|
33129
33131
|
function LeaseInvoices({
|
|
33130
33132
|
url,
|
|
33131
33133
|
leaseType
|
|
33132
33134
|
}) {
|
|
33133
|
-
const { branchId } =
|
|
33135
|
+
const { branchId } = useParams61();
|
|
33134
33136
|
const navigate = useNavigate37();
|
|
33135
33137
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
33136
33138
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -33291,7 +33293,7 @@ var LeaseInvoices_default = LeaseInvoices;
|
|
|
33291
33293
|
import { useForm as useForm38 } from "react-hook-form";
|
|
33292
33294
|
import { zodResolver as zodResolver37 } from "@hookform/resolvers/zod";
|
|
33293
33295
|
import { useEffect as useEffect72, useState as useState73 } from "react";
|
|
33294
|
-
import { useParams as
|
|
33296
|
+
import { useParams as useParams63 } from "react-router-dom";
|
|
33295
33297
|
import { message as message54 } from "antd";
|
|
33296
33298
|
|
|
33297
33299
|
// src/components/realestate/lease/invoices/schema.ts
|
|
@@ -33314,7 +33316,7 @@ var leaseInvoiceSchema2 = z31.object({
|
|
|
33314
33316
|
|
|
33315
33317
|
// src/components/realestate/lease/invoices/LeaseSaleTable.tsx
|
|
33316
33318
|
import { useEffect as useEffect71 } from "react";
|
|
33317
|
-
import { useParams as
|
|
33319
|
+
import { useParams as useParams62 } from "react-router-dom";
|
|
33318
33320
|
import { Fragment as Fragment90, jsx as jsx193 } from "react/jsx-runtime";
|
|
33319
33321
|
function LeaseSaleTable({
|
|
33320
33322
|
data,
|
|
@@ -33325,7 +33327,7 @@ function LeaseSaleTable({
|
|
|
33325
33327
|
leaseType,
|
|
33326
33328
|
account
|
|
33327
33329
|
}) {
|
|
33328
|
-
const { branchId } =
|
|
33330
|
+
const { branchId } = useParams62();
|
|
33329
33331
|
const { watch, setValue } = methods;
|
|
33330
33332
|
const lineId = watch("lineId");
|
|
33331
33333
|
const lineObj = watch("lineObj");
|
|
@@ -33514,7 +33516,7 @@ function LeaseInvoicesForm({ leaseType }) {
|
|
|
33514
33516
|
}
|
|
33515
33517
|
});
|
|
33516
33518
|
const [ref2, setRef] = useState73("");
|
|
33517
|
-
const { branchId } =
|
|
33519
|
+
const { branchId } = useParams63();
|
|
33518
33520
|
const { getQuery, navigate } = useApp_default();
|
|
33519
33521
|
const id = getQuery("id");
|
|
33520
33522
|
const isEdit = !!id;
|
|
@@ -33721,11 +33723,11 @@ var Lease = {
|
|
|
33721
33723
|
var lease_default = Lease;
|
|
33722
33724
|
|
|
33723
33725
|
// src/components/Transactions/currency/expenseAccount/ExpenseAccount.tsx
|
|
33724
|
-
import { useNavigate as useNavigate38, useParams as
|
|
33726
|
+
import { useNavigate as useNavigate38, useParams as useParams64 } from "react-router-dom";
|
|
33725
33727
|
import { EllipsisVertical as EllipsisVertical29, FilePenLine as FilePenLine26, Trash2 as Trash230 } from "lucide-react";
|
|
33726
33728
|
import { Fragment as Fragment91, jsx as jsx195, jsxs as jsxs166 } from "react/jsx-runtime";
|
|
33727
33729
|
function ExpenseAccount({ url }) {
|
|
33728
|
-
const { branchId } =
|
|
33730
|
+
const { branchId } = useParams64();
|
|
33729
33731
|
const navigate = useNavigate38();
|
|
33730
33732
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
33731
33733
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -33852,7 +33854,7 @@ var ExpenseAccount_default = ExpenseAccount;
|
|
|
33852
33854
|
|
|
33853
33855
|
// src/components/Transactions/currency/expenseAccount/ExpenseAccountForm.tsx
|
|
33854
33856
|
import { useEffect as useEffect73, useState as useState74 } from "react";
|
|
33855
|
-
import { useParams as
|
|
33857
|
+
import { useParams as useParams65 } from "react-router-dom";
|
|
33856
33858
|
import { useForm as useForm39 } from "react-hook-form";
|
|
33857
33859
|
import { zodResolver as zodResolver38 } from "@hookform/resolvers/zod";
|
|
33858
33860
|
import { message as message55 } from "antd";
|
|
@@ -33877,7 +33879,7 @@ var expenseSchema3 = z32.object({
|
|
|
33877
33879
|
// src/components/Transactions/currency/expenseAccount/ExpenseAccountForm.tsx
|
|
33878
33880
|
import { jsx as jsx196, jsxs as jsxs167 } from "react/jsx-runtime";
|
|
33879
33881
|
function ExpenseAccountForm() {
|
|
33880
|
-
const { branchId } =
|
|
33882
|
+
const { branchId } = useParams65();
|
|
33881
33883
|
const { getQuery, navigate } = useApp_default();
|
|
33882
33884
|
const id = getQuery("id");
|
|
33883
33885
|
const isEdit = !!id;
|
|
@@ -34117,10 +34119,10 @@ import { useForm as useForm40 } from "react-hook-form";
|
|
|
34117
34119
|
import { zodResolver as zodResolver39 } from "@hookform/resolvers/zod";
|
|
34118
34120
|
import { message as message56 } from "antd";
|
|
34119
34121
|
import { useEffect as useEffect74, useState as useState75 } from "react";
|
|
34120
|
-
import { useParams as
|
|
34122
|
+
import { useParams as useParams66 } from "react-router-dom";
|
|
34121
34123
|
import { jsx as jsx197, jsxs as jsxs168 } from "react/jsx-runtime";
|
|
34122
34124
|
function JournalForm2({ accountType = "all" }) {
|
|
34123
|
-
const { branchId } =
|
|
34125
|
+
const { branchId } = useParams66();
|
|
34124
34126
|
const { apiConfig } = useWarqadConfig();
|
|
34125
34127
|
const { getQuery, navigate } = useApp_default();
|
|
34126
34128
|
const id = getQuery("id");
|
|
@@ -34338,14 +34340,14 @@ function JournalForm2({ accountType = "all" }) {
|
|
|
34338
34340
|
var JournalForm_default2 = JournalForm2;
|
|
34339
34341
|
|
|
34340
34342
|
// src/components/Transactions/currency/journals/Journals.tsx
|
|
34341
|
-
import { useNavigate as useNavigate39, useParams as
|
|
34343
|
+
import { useNavigate as useNavigate39, useParams as useParams67 } from "react-router-dom";
|
|
34342
34344
|
import { EllipsisVertical as EllipsisVertical30, Eye as Eye17, FilePenLine as FilePenLine27, Trash2 as Trash231 } from "lucide-react";
|
|
34343
34345
|
import { Fragment as Fragment92, jsx as jsx198, jsxs as jsxs169 } from "react/jsx-runtime";
|
|
34344
34346
|
function Journals2({
|
|
34345
34347
|
url,
|
|
34346
34348
|
journalType
|
|
34347
34349
|
}) {
|
|
34348
|
-
const { branchId } =
|
|
34350
|
+
const { branchId } = useParams67();
|
|
34349
34351
|
const navigate = useNavigate39();
|
|
34350
34352
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
34351
34353
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -34489,7 +34491,7 @@ var Journals_default2 = Journals2;
|
|
|
34489
34491
|
|
|
34490
34492
|
// src/components/Transactions/currency/payment/PaymentForm.tsx
|
|
34491
34493
|
import { useEffect as useEffect75, useState as useState76 } from "react";
|
|
34492
|
-
import { useParams as
|
|
34494
|
+
import { useParams as useParams68 } from "react-router-dom";
|
|
34493
34495
|
import { useForm as useForm41 } from "react-hook-form";
|
|
34494
34496
|
import { zodResolver as zodResolver40 } from "@hookform/resolvers/zod";
|
|
34495
34497
|
import { message as message57 } from "antd";
|
|
@@ -34518,7 +34520,7 @@ import { jsx as jsx199, jsxs as jsxs170 } from "react/jsx-runtime";
|
|
|
34518
34520
|
function PaymentForm2({
|
|
34519
34521
|
accountType = "all"
|
|
34520
34522
|
}) {
|
|
34521
|
-
const { branchId } =
|
|
34523
|
+
const { branchId } = useParams68();
|
|
34522
34524
|
const { getQuery, navigate } = useApp_default();
|
|
34523
34525
|
const id = getQuery("id");
|
|
34524
34526
|
const isEdit = !!id;
|
|
@@ -34733,7 +34735,7 @@ function PaymentForm2({
|
|
|
34733
34735
|
var PaymentForm_default2 = PaymentForm2;
|
|
34734
34736
|
|
|
34735
34737
|
// src/components/Transactions/currency/payment/Payments.tsx
|
|
34736
|
-
import { useNavigate as useNavigate40, useParams as
|
|
34738
|
+
import { useNavigate as useNavigate40, useParams as useParams69 } from "react-router-dom";
|
|
34737
34739
|
import {
|
|
34738
34740
|
EllipsisVertical as EllipsisVertical31,
|
|
34739
34741
|
Eye as Eye18,
|
|
@@ -34746,7 +34748,7 @@ function Payments2({
|
|
|
34746
34748
|
url,
|
|
34747
34749
|
paymentType
|
|
34748
34750
|
}) {
|
|
34749
|
-
const { branchId } =
|
|
34751
|
+
const { branchId } = useParams69();
|
|
34750
34752
|
const navigate = useNavigate40();
|
|
34751
34753
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
34752
34754
|
const { openPos, PosPrinter } = usePosPrinter_default();
|
|
@@ -34899,14 +34901,14 @@ var CurrencyTransactions = {
|
|
|
34899
34901
|
var currency_default = CurrencyTransactions;
|
|
34900
34902
|
|
|
34901
34903
|
// src/components/accounts/RealestateAccountReport.tsx
|
|
34902
|
-
import { useNavigate as useNavigate41, useParams as
|
|
34904
|
+
import { useNavigate as useNavigate41, useParams as useParams70, useSearchParams as useSearchParams9 } from "react-router-dom";
|
|
34903
34905
|
import { useMemo as useMemo34, useState as useState77, useEffect as useEffect76 } from "react";
|
|
34904
34906
|
import { Fragment as Fragment94, jsx as jsx201, jsxs as jsxs172 } from "react/jsx-runtime";
|
|
34905
34907
|
var RealestateAccountReport = ({ modifUrl }) => {
|
|
34906
34908
|
const { apiConfig } = useWarqadConfig();
|
|
34907
34909
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
34908
34910
|
const { getParams } = useApp_default();
|
|
34909
|
-
const { branchId } =
|
|
34911
|
+
const { branchId } = useParams70();
|
|
34910
34912
|
const currencies = Enums_default.currencies.map((currency2) => {
|
|
34911
34913
|
return {
|
|
34912
34914
|
label: currency2,
|
|
@@ -35079,7 +35081,7 @@ var RealestateAccountReport = ({ modifUrl }) => {
|
|
|
35079
35081
|
var RealestateAccountReport_default = RealestateAccountReport;
|
|
35080
35082
|
|
|
35081
35083
|
// src/components/accounts/RealEastateAccounts.tsx
|
|
35082
|
-
import { useNavigate as useNavigate42, useParams as
|
|
35084
|
+
import { useNavigate as useNavigate42, useParams as useParams71 } from "react-router-dom";
|
|
35083
35085
|
import { EllipsisVertical as EllipsisVertical32, FilePenLine as FilePenLine29, Trash2 as Trash233 } from "lucide-react";
|
|
35084
35086
|
import { useState as useState78 } from "react";
|
|
35085
35087
|
import { message as message58 } from "antd";
|
|
@@ -35089,7 +35091,7 @@ function RealEastateAccounts({
|
|
|
35089
35091
|
url,
|
|
35090
35092
|
type = "account"
|
|
35091
35093
|
}) {
|
|
35092
|
-
const { branchId } =
|
|
35094
|
+
const { branchId } = useParams71();
|
|
35093
35095
|
const navigate = useNavigate42();
|
|
35094
35096
|
const profile = type === "all" ? "account" : type;
|
|
35095
35097
|
const [deleteAccount, setDeleteAccount] = useState78(null);
|
|
@@ -35209,7 +35211,7 @@ function RealEastateAccounts({
|
|
|
35209
35211
|
var RealEastateAccounts_default = RealEastateAccounts;
|
|
35210
35212
|
|
|
35211
35213
|
// src/components/accounts/RealEastateStatements.tsx
|
|
35212
|
-
import { useNavigate as useNavigate43, useParams as
|
|
35214
|
+
import { useNavigate as useNavigate43, useParams as useParams73, useSearchParams as useSearchParams10 } from "react-router-dom";
|
|
35213
35215
|
import { useMemo as useMemo35, useState as useState79, useEffect as useEffect78 } from "react";
|
|
35214
35216
|
|
|
35215
35217
|
// src/components/accounts/profileAccount/ProfileAccountForm.tsx
|
|
@@ -35217,7 +35219,7 @@ import { useForm as useForm42 } from "react-hook-form";
|
|
|
35217
35219
|
import { zodResolver as zodResolver41 } from "@hookform/resolvers/zod";
|
|
35218
35220
|
import { message as message59 } from "antd";
|
|
35219
35221
|
import { useEffect as useEffect77 } from "react";
|
|
35220
|
-
import { useParams as
|
|
35222
|
+
import { useParams as useParams72 } from "react-router-dom";
|
|
35221
35223
|
import { countries as countries2 } from "countries-list";
|
|
35222
35224
|
import z35 from "zod";
|
|
35223
35225
|
import { jsx as jsx203, jsxs as jsxs174 } from "react/jsx-runtime";
|
|
@@ -35239,7 +35241,7 @@ function ProfileAccountForm({
|
|
|
35239
35241
|
showCurrency = true,
|
|
35240
35242
|
showDocument = false
|
|
35241
35243
|
}) {
|
|
35242
|
-
const { branchId } =
|
|
35244
|
+
const { branchId } = useParams72();
|
|
35243
35245
|
const { getQuery, navigate } = useApp_default();
|
|
35244
35246
|
const { role } = useAuth_default();
|
|
35245
35247
|
let profileOptions = profileAccountTypes.map((item) => ({
|
|
@@ -35531,7 +35533,7 @@ var RealEastateStatements = () => {
|
|
|
35531
35533
|
const [searchParams, setSearchParams] = useSearchParams10();
|
|
35532
35534
|
const { apiConfig } = useWarqadConfig();
|
|
35533
35535
|
const { role } = useAuth_default();
|
|
35534
|
-
const { branchId } =
|
|
35536
|
+
const { branchId } = useParams73();
|
|
35535
35537
|
const type = "all";
|
|
35536
35538
|
const urlFilter = searchParams.get("filter");
|
|
35537
35539
|
const initialFilter = ["all", "debit", "credit"].includes(urlFilter) ? urlFilter : "all";
|
|
@@ -35742,7 +35744,7 @@ var RealEastateStatements = () => {
|
|
|
35742
35744
|
var RealEastateStatements_default = RealEastateStatements;
|
|
35743
35745
|
|
|
35744
35746
|
// src/components/accounts/LeaseAccountReport.tsx
|
|
35745
|
-
import { useNavigate as useNavigate44, useParams as
|
|
35747
|
+
import { useNavigate as useNavigate44, useParams as useParams74, useSearchParams as useSearchParams11 } from "react-router-dom";
|
|
35746
35748
|
import { useMemo as useMemo36, useState as useState80, useEffect as useEffect79 } from "react";
|
|
35747
35749
|
import { Fragment as Fragment97, jsx as jsx205, jsxs as jsxs176 } from "react/jsx-runtime";
|
|
35748
35750
|
var LeaseAccountReport = ({
|
|
@@ -35763,7 +35765,7 @@ var LeaseAccountReport = ({
|
|
|
35763
35765
|
const [searchParams, setSearchParams] = useSearchParams11();
|
|
35764
35766
|
const urlCurrency = searchParams.get("currency")?.toUpperCase();
|
|
35765
35767
|
const initialCurrency = urlCurrency && Enums_default.currencies.includes(urlCurrency) ? urlCurrency : defaultCurrency;
|
|
35766
|
-
const { branchId } =
|
|
35768
|
+
const { branchId } = useParams74();
|
|
35767
35769
|
const [currencyFilter, setCurrencyFilter] = useState80(initialCurrency);
|
|
35768
35770
|
const handleCurrencyChange = (value) => {
|
|
35769
35771
|
setCurrencyFilter(value);
|
|
@@ -35923,7 +35925,7 @@ var LeaseAccountReport = ({
|
|
|
35923
35925
|
var LeaseAccountReport_default = LeaseAccountReport;
|
|
35924
35926
|
|
|
35925
35927
|
// src/components/accounts/LeaseAccountStatements.tsx
|
|
35926
|
-
import { useNavigate as useNavigate45, useParams as
|
|
35928
|
+
import { useNavigate as useNavigate45, useParams as useParams75, useSearchParams as useSearchParams12 } from "react-router-dom";
|
|
35927
35929
|
import { useMemo as useMemo37, useState as useState81, useEffect as useEffect80 } from "react";
|
|
35928
35930
|
import { Fragment as Fragment98, jsx as jsx206, jsxs as jsxs177 } from "react/jsx-runtime";
|
|
35929
35931
|
var options7 = [
|
|
@@ -35938,7 +35940,7 @@ var LeaseAccountStatements = ({
|
|
|
35938
35940
|
const navigate = useNavigate45();
|
|
35939
35941
|
const [searchParams, setSearchParams] = useSearchParams12();
|
|
35940
35942
|
const { apiConfig } = useWarqadConfig();
|
|
35941
|
-
const { branchId } =
|
|
35943
|
+
const { branchId } = useParams75();
|
|
35942
35944
|
const type = "all";
|
|
35943
35945
|
const urlFilter = searchParams.get("filter");
|
|
35944
35946
|
const initialFilter = ["all", "debit", "credit"].includes(urlFilter) ? urlFilter : "all";
|
|
@@ -36146,7 +36148,7 @@ var LeaseAccountStatements = ({
|
|
|
36146
36148
|
var LeaseAccountStatements_default = LeaseAccountStatements;
|
|
36147
36149
|
|
|
36148
36150
|
// src/components/accounts/ExpenseAccountStatement.tsx
|
|
36149
|
-
import { useNavigate as useNavigate46, useParams as
|
|
36151
|
+
import { useNavigate as useNavigate46, useParams as useParams76, useSearchParams as useSearchParams13 } from "react-router-dom";
|
|
36150
36152
|
import { useMemo as useMemo38, useState as useState82, useEffect as useEffect81 } from "react";
|
|
36151
36153
|
import { Fragment as Fragment99, jsx as jsx207, jsxs as jsxs178 } from "react/jsx-runtime";
|
|
36152
36154
|
var ExpenseAccountStatement = ({ type }) => {
|
|
@@ -36156,7 +36158,7 @@ var ExpenseAccountStatement = ({ type }) => {
|
|
|
36156
36158
|
const urlCurrency = searchParams.get("currency")?.toUpperCase();
|
|
36157
36159
|
const initialCurrency = urlCurrency && Enums_default.currencies.includes(urlCurrency) ? urlCurrency : "USD";
|
|
36158
36160
|
const [currencyFilter, setCurrencyFilter] = useState82(initialCurrency);
|
|
36159
|
-
const { branchId } =
|
|
36161
|
+
const { branchId } = useParams76();
|
|
36160
36162
|
const handleCurrencyChange = (value) => {
|
|
36161
36163
|
setCurrencyFilter(value);
|
|
36162
36164
|
setSearchParams((prev) => {
|
|
@@ -36256,7 +36258,7 @@ var ExpenseAccountStatement = ({ type }) => {
|
|
|
36256
36258
|
var ExpenseAccountStatement_default = ExpenseAccountStatement;
|
|
36257
36259
|
|
|
36258
36260
|
// src/components/accounts/ExpenseAccountReport.tsx
|
|
36259
|
-
import { useNavigate as useNavigate47, useParams as
|
|
36261
|
+
import { useNavigate as useNavigate47, useParams as useParams77, useSearchParams as useSearchParams14 } from "react-router-dom";
|
|
36260
36262
|
import { useMemo as useMemo39, useState as useState83, useEffect as useEffect82 } from "react";
|
|
36261
36263
|
import { Fragment as Fragment100, jsx as jsx208, jsxs as jsxs179 } from "react/jsx-runtime";
|
|
36262
36264
|
var ExpenseAccountReport = ({ modifUrl }) => {
|
|
@@ -36274,7 +36276,7 @@ var ExpenseAccountReport = ({ modifUrl }) => {
|
|
|
36274
36276
|
const urlCurrency = searchParams.get("currency")?.toUpperCase();
|
|
36275
36277
|
const initialCurrency = urlCurrency && Enums_default.currencies.includes(urlCurrency) ? urlCurrency : "KES";
|
|
36276
36278
|
const [currencyFilter, setCurrencyFilter] = useState83(initialCurrency);
|
|
36277
|
-
const { branchId } =
|
|
36279
|
+
const { branchId } = useParams77();
|
|
36278
36280
|
const handleCurrencyChange = (value) => {
|
|
36279
36281
|
setCurrencyFilter(value);
|
|
36280
36282
|
setSearchParams((prev) => {
|
|
@@ -36385,12 +36387,12 @@ var ExpenseAccountReport = ({ modifUrl }) => {
|
|
|
36385
36387
|
var ExpenseAccountReport_default = ExpenseAccountReport;
|
|
36386
36388
|
|
|
36387
36389
|
// src/components/reports/ExpenseAReport.tsx
|
|
36388
|
-
import { useParams as
|
|
36390
|
+
import { useParams as useParams78, useSearchParams as useSearchParams15 } from "react-router-dom";
|
|
36389
36391
|
import { useMemo as useMemo40, useState as useState84, useEffect as useEffect83 } from "react";
|
|
36390
36392
|
import { Fragment as Fragment101, jsx as jsx209, jsxs as jsxs180 } from "react/jsx-runtime";
|
|
36391
36393
|
var ExpenseAReport = () => {
|
|
36392
36394
|
const [searchParams, setSearchParams] = useSearchParams15();
|
|
36393
|
-
const { branchId } =
|
|
36395
|
+
const { branchId } = useParams78();
|
|
36394
36396
|
const urlCurrency = searchParams.get("currency")?.toUpperCase();
|
|
36395
36397
|
const initialCurrency = urlCurrency && Enums_default.currencies.includes(urlCurrency) ? urlCurrency : "USD";
|
|
36396
36398
|
const [currencyFilter, setCurrencyFilter] = useState84(initialCurrency);
|
|
@@ -36543,7 +36545,7 @@ var ExpenseAReport_default = ExpenseAReport;
|
|
|
36543
36545
|
|
|
36544
36546
|
// src/components/posts/PostForm.tsx
|
|
36545
36547
|
import { useEffect as useEffect84, useCallback as useCallback6, useRef as useRef12 } from "react";
|
|
36546
|
-
import { useParams as
|
|
36548
|
+
import { useParams as useParams79, useBlocker } from "react-router-dom";
|
|
36547
36549
|
import { useForm as useForm43 } from "react-hook-form";
|
|
36548
36550
|
import { zodResolver as zodResolver42 } from "@hookform/resolvers/zod";
|
|
36549
36551
|
import { ArrowLeft as ArrowLeft8 } from "lucide-react";
|
|
@@ -36916,7 +36918,7 @@ function HotelSpecifications({ form }) {
|
|
|
36916
36918
|
// src/components/posts/PostForm.tsx
|
|
36917
36919
|
import { jsx as jsx214, jsxs as jsxs185 } from "react/jsx-runtime";
|
|
36918
36920
|
function PostForm({ afterPostUrl }) {
|
|
36919
|
-
const { branchId, postType } =
|
|
36921
|
+
const { branchId, postType } = useParams79();
|
|
36920
36922
|
const { getQuery, navigate } = useApp_default();
|
|
36921
36923
|
const id = getQuery("id");
|
|
36922
36924
|
const isEdit = !!id;
|
|
@@ -37321,7 +37323,7 @@ function PostForm({ afterPostUrl }) {
|
|
|
37321
37323
|
var PostForm_default = PostForm;
|
|
37322
37324
|
|
|
37323
37325
|
// src/components/posts/PostsList.tsx
|
|
37324
|
-
import { useNavigate as useNavigate48, useParams as
|
|
37326
|
+
import { useNavigate as useNavigate48, useParams as useParams80 } from "react-router-dom";
|
|
37325
37327
|
import {
|
|
37326
37328
|
EllipsisVertical as EllipsisVertical33,
|
|
37327
37329
|
Eye as Eye19,
|
|
@@ -37803,7 +37805,7 @@ var usePostView_default = usePostView;
|
|
|
37803
37805
|
// src/components/posts/PostsList.tsx
|
|
37804
37806
|
import { Fragment as Fragment103, jsx as jsx217, jsxs as jsxs187 } from "react/jsx-runtime";
|
|
37805
37807
|
function PostsList({ url }) {
|
|
37806
|
-
const { branchId, postType } =
|
|
37808
|
+
const { branchId, postType } = useParams80();
|
|
37807
37809
|
const navigate = useNavigate48();
|
|
37808
37810
|
const { PostView: PostView2, openPost } = usePostView_default();
|
|
37809
37811
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -37936,7 +37938,7 @@ var PostsList_default = PostsList;
|
|
|
37936
37938
|
|
|
37937
37939
|
// src/components/posts/PostMediaForm.tsx
|
|
37938
37940
|
import { useState as useState88, useEffect as useEffect86, useCallback as useCallback7, useRef as useRef13 } from "react";
|
|
37939
|
-
import { useParams as
|
|
37941
|
+
import { useParams as useParams81, useNavigate as useNavigate49 } from "react-router-dom";
|
|
37940
37942
|
import {
|
|
37941
37943
|
ArrowLeft as ArrowLeft9,
|
|
37942
37944
|
Image as ImageIcon4,
|
|
@@ -37947,7 +37949,7 @@ import {
|
|
|
37947
37949
|
import { message as message62 } from "antd";
|
|
37948
37950
|
import { jsx as jsx218, jsxs as jsxs188 } from "react/jsx-runtime";
|
|
37949
37951
|
function PostMediaForm() {
|
|
37950
|
-
const { branchId, postType } =
|
|
37952
|
+
const { branchId, postType } = useParams81();
|
|
37951
37953
|
const { getQuery } = useApp_default();
|
|
37952
37954
|
const navigate = useNavigate49();
|
|
37953
37955
|
const id = getQuery("id");
|
|
@@ -38461,13 +38463,13 @@ var Posts = {
|
|
|
38461
38463
|
var posts_default = Posts;
|
|
38462
38464
|
|
|
38463
38465
|
// src/components/accounts/profileAccount/ProfileAccount.tsx
|
|
38464
|
-
import { useNavigate as useNavigate50, useParams as
|
|
38466
|
+
import { useNavigate as useNavigate50, useParams as useParams82 } from "react-router-dom";
|
|
38465
38467
|
import { EllipsisVertical as EllipsisVertical34, FilePenLine as FilePenLine31, Trash2 as Trash238 } from "lucide-react";
|
|
38466
38468
|
import { useState as useState89, useMemo as useMemo41 } from "react";
|
|
38467
38469
|
import { message as message63 } from "antd";
|
|
38468
38470
|
import { Fragment as Fragment104, jsx as jsx219, jsxs as jsxs189 } from "react/jsx-runtime";
|
|
38469
38471
|
function ProfileAccountList({ v, url }) {
|
|
38470
|
-
const { branchId } =
|
|
38472
|
+
const { branchId } = useParams82();
|
|
38471
38473
|
const navigate = useNavigate50();
|
|
38472
38474
|
const { role } = useAuth_default();
|
|
38473
38475
|
const isStaff = role === "staff";
|
|
@@ -38647,7 +38649,7 @@ var ProfileAccount = {
|
|
|
38647
38649
|
var profileAccount_default = ProfileAccount;
|
|
38648
38650
|
|
|
38649
38651
|
// src/components/accounts/LeaseRentOverviews.tsx
|
|
38650
|
-
import { useNavigate as useNavigate51, useParams as
|
|
38652
|
+
import { useNavigate as useNavigate51, useParams as useParams83, useSearchParams as useSearchParams16 } from "react-router-dom";
|
|
38651
38653
|
import { useMemo as useMemo42, useState as useState90, useEffect as useEffect87 } from "react";
|
|
38652
38654
|
import { DatePicker as DatePicker5 } from "antd";
|
|
38653
38655
|
import dayjs5 from "dayjs";
|
|
@@ -38663,7 +38665,7 @@ var LeaseRentOverviews = () => {
|
|
|
38663
38665
|
const navigate = useNavigate51();
|
|
38664
38666
|
const [searchParams, setSearchParams] = useSearchParams16();
|
|
38665
38667
|
const { apiConfig } = useWarqadConfig();
|
|
38666
|
-
const { branchId } =
|
|
38668
|
+
const { branchId } = useParams83();
|
|
38667
38669
|
const type = "all";
|
|
38668
38670
|
const urlFilter = searchParams.get("filter");
|
|
38669
38671
|
const initialFilter = ["all", "debit", "credit"].includes(urlFilter) ? urlFilter : "all";
|
|
@@ -38877,7 +38879,7 @@ var LeaseRentOverviews_default = LeaseRentOverviews;
|
|
|
38877
38879
|
import { useState as useState91, useMemo as useMemo43, useEffect as useEffect88 } from "react";
|
|
38878
38880
|
import dayjs6 from "dayjs";
|
|
38879
38881
|
import { Eye as Eye20, EyeOff as EyeOff2, FileText as FileText22, RefreshCw as RefreshCw8 } from "lucide-react";
|
|
38880
|
-
import { useNavigate as useNavigate52, useParams as
|
|
38882
|
+
import { useNavigate as useNavigate52, useParams as useParams84 } from "react-router-dom";
|
|
38881
38883
|
import { DatePicker as DatePicker6 } from "antd";
|
|
38882
38884
|
import { jsx as jsx221, jsxs as jsxs191 } from "react/jsx-runtime";
|
|
38883
38885
|
var LeaseRentOverViewCard = ({
|
|
@@ -38888,7 +38890,7 @@ var LeaseRentOverViewCard = ({
|
|
|
38888
38890
|
className = ""
|
|
38889
38891
|
}) => {
|
|
38890
38892
|
const navigate = useNavigate52();
|
|
38891
|
-
const { branchId } =
|
|
38893
|
+
const { branchId } = useParams84();
|
|
38892
38894
|
const { apiConfig } = useWarqadConfig();
|
|
38893
38895
|
const { data: fetchedData, isLoading: fetchLoading, get } = useApis_default();
|
|
38894
38896
|
const [showAmount, setShowAmount] = useState91(false);
|
|
@@ -39897,7 +39899,7 @@ var Tickets = {
|
|
|
39897
39899
|
var tickets_default = Tickets;
|
|
39898
39900
|
|
|
39899
39901
|
// src/components/stocks/clothend/sale2/List.tsx
|
|
39900
|
-
import { useNavigate as useNavigate53, useParams as
|
|
39902
|
+
import { useNavigate as useNavigate53, useParams as useParams85 } from "react-router-dom";
|
|
39901
39903
|
import {
|
|
39902
39904
|
EllipsisVertical as EllipsisVertical36,
|
|
39903
39905
|
Eye as Eye22,
|
|
@@ -39907,7 +39909,7 @@ import {
|
|
|
39907
39909
|
} from "lucide-react";
|
|
39908
39910
|
import { Fragment as Fragment109, jsx as jsx226, jsxs as jsxs195 } from "react/jsx-runtime";
|
|
39909
39911
|
function Sale2List({ url, type = "product" }) {
|
|
39910
|
-
const { branchId } =
|
|
39912
|
+
const { branchId } = useParams85();
|
|
39911
39913
|
const navigate = useNavigate53();
|
|
39912
39914
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
39913
39915
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -40092,12 +40094,12 @@ import { useEffect as useEffect93, useLayoutEffect as useLayoutEffect6, useState
|
|
|
40092
40094
|
|
|
40093
40095
|
// src/components/stocks/clothend/sale2/header.tsx
|
|
40094
40096
|
import { useFormContext as useFormContext4 } from "react-hook-form";
|
|
40095
|
-
import { useParams as
|
|
40097
|
+
import { useParams as useParams86 } from "react-router-dom";
|
|
40096
40098
|
import { useEffect as useEffect91 } from "react";
|
|
40097
40099
|
import { jsx as jsx227, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
40098
40100
|
function SaleHeader2({ stockType }) {
|
|
40099
40101
|
const form = useFormContext4();
|
|
40100
|
-
const { branchId } =
|
|
40102
|
+
const { branchId } = useParams86();
|
|
40101
40103
|
useEffect91(() => {
|
|
40102
40104
|
if (branchId) {
|
|
40103
40105
|
form.setValue("branch", branchId);
|
|
@@ -40550,7 +40552,7 @@ var schema_default6 = AdjustmentStockSchema4;
|
|
|
40550
40552
|
|
|
40551
40553
|
// src/components/stocks/clothend/sale2/pos.tsx
|
|
40552
40554
|
import { ArrowLeft as ArrowLeft10 } from "lucide-react";
|
|
40553
|
-
import { useParams as
|
|
40555
|
+
import { useParams as useParams87 } from "react-router-dom";
|
|
40554
40556
|
|
|
40555
40557
|
// src/components/stocks/clothend/sale2/Submit.tsx
|
|
40556
40558
|
import { useFormContext as useFormContext5 } from "react-hook-form";
|
|
@@ -40770,7 +40772,7 @@ import { Fragment as Fragment111, jsx as jsx230, jsxs as jsxs199 } from "react/j
|
|
|
40770
40772
|
var Sale2Form = ({ type }) => {
|
|
40771
40773
|
const { getQuery, navigate } = useApp_default();
|
|
40772
40774
|
const stockType = type;
|
|
40773
|
-
const { branchId } =
|
|
40775
|
+
const { branchId } = useParams87();
|
|
40774
40776
|
const saleId = getQuery("id");
|
|
40775
40777
|
const { branches } = useAuth_default();
|
|
40776
40778
|
const { currencies } = useWarqadConfig();
|
|
@@ -41671,7 +41673,7 @@ function ProductForm2({
|
|
|
41671
41673
|
try {
|
|
41672
41674
|
if (isEdit) {
|
|
41673
41675
|
await put({
|
|
41674
|
-
url: `${updateUrl || "/inventory/items/update
|
|
41676
|
+
url: `${updateUrl || "/inventory/items/update"}/${id}`,
|
|
41675
41677
|
v: v || 3,
|
|
41676
41678
|
body: {
|
|
41677
41679
|
...data,
|
|
@@ -43018,7 +43020,7 @@ var dgl_default = Dgl;
|
|
|
43018
43020
|
|
|
43019
43021
|
// src/components/InAndOut/Form.tsx
|
|
43020
43022
|
import { useEffect as useEffect99, useState as useState101 } from "react";
|
|
43021
|
-
import { useParams as
|
|
43023
|
+
import { useParams as useParams88 } from "react-router-dom";
|
|
43022
43024
|
import { useForm as useForm49 } from "react-hook-form";
|
|
43023
43025
|
import { zodResolver as zodResolver48 } from "@hookform/resolvers/zod";
|
|
43024
43026
|
import { message as message75 } from "antd";
|
|
@@ -43044,7 +43046,7 @@ function InAndOutForm({
|
|
|
43044
43046
|
const isEdit = id;
|
|
43045
43047
|
const [ref2, setRef] = useState101("");
|
|
43046
43048
|
const [showReverseModal, setShowReverseModal] = useState101(false);
|
|
43047
|
-
const { branchId } =
|
|
43049
|
+
const { branchId } = useParams88();
|
|
43048
43050
|
const { post, isLoading } = useApis_default();
|
|
43049
43051
|
const { put, isLoading: isLoadingReverse } = useApis_default();
|
|
43050
43052
|
const { get, isLoading: isLoadingGet } = useApis_default();
|
|
@@ -43247,13 +43249,13 @@ var Form_default5 = InAndOutForm;
|
|
|
43247
43249
|
import { useState as useState102, useMemo as useMemo44 } from "react";
|
|
43248
43250
|
import { DatePicker as DatePicker7 } from "antd";
|
|
43249
43251
|
import dayjs7 from "dayjs";
|
|
43250
|
-
import { useParams as
|
|
43252
|
+
import { useParams as useParams89 } from "react-router-dom";
|
|
43251
43253
|
import { Fragment as Fragment116, jsx as jsx241, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
43252
43254
|
var InAndOutReport = () => {
|
|
43253
43255
|
const [startDate, setStartDate] = useState102(dayjs7());
|
|
43254
43256
|
const [endDate, setEndDate] = useState102(dayjs7());
|
|
43255
43257
|
const [action, setAction] = useState102("all");
|
|
43256
|
-
const { branchId } =
|
|
43258
|
+
const { branchId } = useParams89();
|
|
43257
43259
|
const [currency, setCurrency] = useState102("all");
|
|
43258
43260
|
const { openState, Modal: Modal2, close } = useModal_default();
|
|
43259
43261
|
const { A4DataView, data, reload } = useA4DataView_default({
|
|
@@ -43659,7 +43661,7 @@ var ProfileTransactionReport = ({
|
|
|
43659
43661
|
var ProfileTransaction_default = ProfileTransactionReport;
|
|
43660
43662
|
|
|
43661
43663
|
// src/components/Transactions/invoiceManager/InvoiceManager.tsx
|
|
43662
|
-
import { useNavigate as useNavigate58, useParams as
|
|
43664
|
+
import { useNavigate as useNavigate58, useParams as useParams93 } from "react-router-dom";
|
|
43663
43665
|
import { EllipsisVertical as EllipsisVertical41, FilePenLine as FilePenLine37, Trash2 as Trash247 } from "lucide-react";
|
|
43664
43666
|
import { useState as useState105 } from "react";
|
|
43665
43667
|
import { message as message79 } from "antd";
|
|
@@ -43720,14 +43722,14 @@ import { useForm as useForm50 } from "react-hook-form";
|
|
|
43720
43722
|
import { zodResolver as zodResolver49 } from "@hookform/resolvers/zod";
|
|
43721
43723
|
import { message as message76 } from "antd";
|
|
43722
43724
|
import { useEffect as useEffect101 } from "react";
|
|
43723
|
-
import { useParams as
|
|
43725
|
+
import { useParams as useParams90 } from "react-router-dom";
|
|
43724
43726
|
import { jsx as jsx243, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
43725
43727
|
function AccountForm2({
|
|
43726
43728
|
onReload,
|
|
43727
43729
|
close,
|
|
43728
43730
|
id
|
|
43729
43731
|
}) {
|
|
43730
|
-
const { branchId } =
|
|
43732
|
+
const { branchId } = useParams90();
|
|
43731
43733
|
const { currencies } = useWarqadConfig();
|
|
43732
43734
|
const { stock } = currencies;
|
|
43733
43735
|
const isEdit = !!id;
|
|
@@ -43865,7 +43867,7 @@ var AccountForm_default2 = AccountForm2;
|
|
|
43865
43867
|
import { useEffect as useEffect102, useState as useState104 } from "react";
|
|
43866
43868
|
import { useForm as useForm51, useFieldArray as useFieldArray3 } from "react-hook-form";
|
|
43867
43869
|
import { zodResolver as zodResolver50 } from "@hookform/resolvers/zod";
|
|
43868
|
-
import { useParams as
|
|
43870
|
+
import { useParams as useParams91 } from "react-router-dom";
|
|
43869
43871
|
import { message as message77 } from "antd";
|
|
43870
43872
|
import { Trash2 as Trash246, Plus as Plus5 } from "lucide-react";
|
|
43871
43873
|
import dayjs8 from "dayjs";
|
|
@@ -43876,7 +43878,7 @@ function InvoiceForm({
|
|
|
43876
43878
|
accountData,
|
|
43877
43879
|
id
|
|
43878
43880
|
}) {
|
|
43879
|
-
const { branchId } =
|
|
43881
|
+
const { branchId } = useParams91();
|
|
43880
43882
|
const [ref2, setRef] = useState104(void 0);
|
|
43881
43883
|
const { post, isLoading } = useApis_default();
|
|
43882
43884
|
const { get, isLoading: getLoading } = useApis_default();
|
|
@@ -44202,7 +44204,7 @@ var InvoiceForm_default = InvoiceForm;
|
|
|
44202
44204
|
import React41 from "react";
|
|
44203
44205
|
import { useForm as useForm52 } from "react-hook-form";
|
|
44204
44206
|
import { zodResolver as zodResolver51 } from "@hookform/resolvers/zod";
|
|
44205
|
-
import { useParams as
|
|
44207
|
+
import { useParams as useParams92 } from "react-router-dom";
|
|
44206
44208
|
import { message as message78 } from "antd";
|
|
44207
44209
|
import dayjs9 from "dayjs";
|
|
44208
44210
|
import { jsx as jsx245, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
@@ -44213,7 +44215,7 @@ function JournalForm3({
|
|
|
44213
44215
|
action = "debit",
|
|
44214
44216
|
id
|
|
44215
44217
|
}) {
|
|
44216
|
-
const { branchId } =
|
|
44218
|
+
const { branchId } = useParams92();
|
|
44217
44219
|
const { currencies } = useWarqadConfig();
|
|
44218
44220
|
const { stock: defaultCurrency } = currencies;
|
|
44219
44221
|
const [ref2, setRef] = React41.useState(void 0);
|
|
@@ -44434,7 +44436,7 @@ var journalForm_default = JournalForm3;
|
|
|
44434
44436
|
// src/components/Transactions/invoiceManager/InvoiceManager.tsx
|
|
44435
44437
|
import { Fragment as Fragment118, jsx as jsx246, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
44436
44438
|
function InvoiceManager({ v, url }) {
|
|
44437
|
-
const { branchId } =
|
|
44439
|
+
const { branchId } = useParams93();
|
|
44438
44440
|
const { apiConfig } = useWarqadConfig();
|
|
44439
44441
|
const { width } = useMediaSize();
|
|
44440
44442
|
const isLargeScreen = width > 768;
|
|
@@ -45059,7 +45061,7 @@ var ForexCurrencyAccountReport = () => {
|
|
|
45059
45061
|
var ForexCurrencyAccountReport_default = ForexCurrencyAccountReport;
|
|
45060
45062
|
|
|
45061
45063
|
// src/components/Transactions/3/payments/Payments.tsx
|
|
45062
|
-
import { useNavigate as useNavigate59, useParams as
|
|
45064
|
+
import { useNavigate as useNavigate59, useParams as useParams94 } from "react-router-dom";
|
|
45063
45065
|
import {
|
|
45064
45066
|
EllipsisVertical as EllipsisVertical42,
|
|
45065
45067
|
Eye as Eye23,
|
|
@@ -45069,7 +45071,7 @@ import {
|
|
|
45069
45071
|
} from "lucide-react";
|
|
45070
45072
|
import { Fragment as Fragment121, jsx as jsx249, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
45071
45073
|
function Payments3({ url }) {
|
|
45072
|
-
const { branchId } =
|
|
45074
|
+
const { branchId } = useParams94();
|
|
45073
45075
|
const navigate = useNavigate59();
|
|
45074
45076
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
45075
45077
|
const { openPos, PosPrinter } = usePosPrinter_default();
|
|
@@ -45228,7 +45230,7 @@ var Payments_default3 = Payments3;
|
|
|
45228
45230
|
|
|
45229
45231
|
// src/components/Transactions/3/payments/PaymentForm.tsx
|
|
45230
45232
|
import { useEffect as useEffect105, useMemo as useMemo47, useState as useState108 } from "react";
|
|
45231
|
-
import { useParams as
|
|
45233
|
+
import { useParams as useParams95 } from "react-router-dom";
|
|
45232
45234
|
import { useForm as useForm53 } from "react-hook-form";
|
|
45233
45235
|
import { zodResolver as zodResolver52 } from "@hookform/resolvers/zod";
|
|
45234
45236
|
import { message as message80 } from "antd";
|
|
@@ -45258,7 +45260,7 @@ import { Fragment as Fragment122, jsx as jsx250, jsxs as jsxs219 } from "react/j
|
|
|
45258
45260
|
function PaymentForm3({
|
|
45259
45261
|
accountType = "all"
|
|
45260
45262
|
}) {
|
|
45261
|
-
const { branchId } =
|
|
45263
|
+
const { branchId } = useParams95();
|
|
45262
45264
|
const { currencies } = useWarqadConfig();
|
|
45263
45265
|
const { defaultCurrency } = currencies;
|
|
45264
45266
|
const { getQuery, navigate } = useApp_default();
|
|
@@ -45519,11 +45521,11 @@ function PaymentForm3({
|
|
|
45519
45521
|
var PaymentForm_default3 = PaymentForm3;
|
|
45520
45522
|
|
|
45521
45523
|
// src/components/Transactions/3/journals/Journals.tsx
|
|
45522
|
-
import { useNavigate as useNavigate60, useParams as
|
|
45524
|
+
import { useNavigate as useNavigate60, useParams as useParams96 } from "react-router-dom";
|
|
45523
45525
|
import { EllipsisVertical as EllipsisVertical43, Eye as Eye24, FilePenLine as FilePenLine39, Trash2 as Trash249 } from "lucide-react";
|
|
45524
45526
|
import { Fragment as Fragment123, jsx as jsx251, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
45525
45527
|
function Journals3({ url }) {
|
|
45526
|
-
const { branchId } =
|
|
45528
|
+
const { branchId } = useParams96();
|
|
45527
45529
|
const navigate = useNavigate60();
|
|
45528
45530
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
45529
45531
|
const { PosPrinter } = usePosPrinter_default();
|
|
@@ -45662,7 +45664,7 @@ var Journals_default3 = Journals3;
|
|
|
45662
45664
|
|
|
45663
45665
|
// src/components/Transactions/3/journals/JournalsForm.tsx
|
|
45664
45666
|
import { useEffect as useEffect106, useMemo as useMemo48, useState as useState109 } from "react";
|
|
45665
|
-
import { useParams as
|
|
45667
|
+
import { useParams as useParams97 } from "react-router-dom";
|
|
45666
45668
|
import { useForm as useForm54 } from "react-hook-form";
|
|
45667
45669
|
import { zodResolver as zodResolver53 } from "@hookform/resolvers/zod";
|
|
45668
45670
|
import { message as message81 } from "antd";
|
|
@@ -45688,7 +45690,7 @@ import { Fragment as Fragment124, jsx as jsx252, jsxs as jsxs221 } from "react/j
|
|
|
45688
45690
|
function JournalForm4({
|
|
45689
45691
|
accountType = "all"
|
|
45690
45692
|
}) {
|
|
45691
|
-
const { branchId } =
|
|
45693
|
+
const { branchId } = useParams97();
|
|
45692
45694
|
const { currencies } = useWarqadConfig();
|
|
45693
45695
|
const { defaultCurrency } = currencies;
|
|
45694
45696
|
const { getQuery, navigate } = useApp_default();
|
|
@@ -45898,7 +45900,7 @@ function JournalForm4({
|
|
|
45898
45900
|
var JournalsForm_default = JournalForm4;
|
|
45899
45901
|
|
|
45900
45902
|
// src/components/Transactions/3/sale2/List.tsx
|
|
45901
|
-
import { useNavigate as useNavigate61, useParams as
|
|
45903
|
+
import { useNavigate as useNavigate61, useParams as useParams98 } from "react-router-dom";
|
|
45902
45904
|
import {
|
|
45903
45905
|
EllipsisVertical as EllipsisVertical44,
|
|
45904
45906
|
Eye as Eye25,
|
|
@@ -45907,7 +45909,7 @@ import {
|
|
|
45907
45909
|
} from "lucide-react";
|
|
45908
45910
|
import { Fragment as Fragment125, jsx as jsx253, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
45909
45911
|
function Sale2List2({ url, type = "product" }) {
|
|
45910
|
-
const { branchId } =
|
|
45912
|
+
const { branchId } = useParams98();
|
|
45911
45913
|
const navigate = useNavigate61();
|
|
45912
45914
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
45913
45915
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -46071,12 +46073,12 @@ import { useEffect as useEffect109, useLayoutEffect as useLayoutEffect7, useStat
|
|
|
46071
46073
|
|
|
46072
46074
|
// src/components/Transactions/3/sale2/header.tsx
|
|
46073
46075
|
import { useFormContext as useFormContext7 } from "react-hook-form";
|
|
46074
|
-
import { useParams as
|
|
46076
|
+
import { useParams as useParams99 } from "react-router-dom";
|
|
46075
46077
|
import { useEffect as useEffect107 } from "react";
|
|
46076
46078
|
import { jsx as jsx254, jsxs as jsxs223 } from "react/jsx-runtime";
|
|
46077
46079
|
function SaleHeader3({ stockType }) {
|
|
46078
46080
|
const form = useFormContext7();
|
|
46079
|
-
const { branchId } =
|
|
46081
|
+
const { branchId } = useParams99();
|
|
46080
46082
|
useEffect107(() => {
|
|
46081
46083
|
if (branchId) {
|
|
46082
46084
|
form.setValue("branch", branchId);
|
|
@@ -46541,7 +46543,7 @@ var schema_default7 = AdjustmentStockSchema5;
|
|
|
46541
46543
|
|
|
46542
46544
|
// src/components/Transactions/3/sale2/pos.tsx
|
|
46543
46545
|
import { ArrowLeft as ArrowLeft11 } from "lucide-react";
|
|
46544
|
-
import { useParams as
|
|
46546
|
+
import { useParams as useParams100 } from "react-router-dom";
|
|
46545
46547
|
|
|
46546
46548
|
// src/components/Transactions/3/sale2/Submit.tsx
|
|
46547
46549
|
import { useFormContext as useFormContext8 } from "react-hook-form";
|
|
@@ -46781,7 +46783,7 @@ var Sale2Form2 = ({
|
|
|
46781
46783
|
}) => {
|
|
46782
46784
|
const { getQuery, navigate } = useApp_default();
|
|
46783
46785
|
const stockType = type;
|
|
46784
|
-
const { branchId } =
|
|
46786
|
+
const { branchId } = useParams100();
|
|
46785
46787
|
const saleId = getQuery("id");
|
|
46786
46788
|
const { currencies } = useWarqadConfig();
|
|
46787
46789
|
const { defaultCurrency } = currencies;
|
|
@@ -47102,7 +47104,7 @@ var Sale22 = {
|
|
|
47102
47104
|
var sale2_default2 = Sale22;
|
|
47103
47105
|
|
|
47104
47106
|
// src/components/Transactions/3/purchase3/List.tsx
|
|
47105
|
-
import { useNavigate as useNavigate62, useParams as
|
|
47107
|
+
import { useNavigate as useNavigate62, useParams as useParams101 } from "react-router-dom";
|
|
47106
47108
|
import {
|
|
47107
47109
|
EllipsisVertical as EllipsisVertical45,
|
|
47108
47110
|
Eye as Eye26,
|
|
@@ -47114,7 +47116,7 @@ function purchase3List({
|
|
|
47114
47116
|
url,
|
|
47115
47117
|
type = "product"
|
|
47116
47118
|
}) {
|
|
47117
|
-
const { branchId } =
|
|
47119
|
+
const { branchId } = useParams101();
|
|
47118
47120
|
const navigate = useNavigate62();
|
|
47119
47121
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
47120
47122
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
@@ -47278,12 +47280,12 @@ import { useEffect as useEffect112, useLayoutEffect as useLayoutEffect8, useStat
|
|
|
47278
47280
|
|
|
47279
47281
|
// src/components/Transactions/3/purchase3/header.tsx
|
|
47280
47282
|
import { useFormContext as useFormContext10 } from "react-hook-form";
|
|
47281
|
-
import { useParams as
|
|
47283
|
+
import { useParams as useParams102 } from "react-router-dom";
|
|
47282
47284
|
import { useEffect as useEffect110 } from "react";
|
|
47283
47285
|
import { jsx as jsx259, jsxs as jsxs228 } from "react/jsx-runtime";
|
|
47284
47286
|
function SaleHeader4({ stockType }) {
|
|
47285
47287
|
const form = useFormContext10();
|
|
47286
|
-
const { branchId } =
|
|
47288
|
+
const { branchId } = useParams102();
|
|
47287
47289
|
useEffect110(() => {
|
|
47288
47290
|
if (branchId) {
|
|
47289
47291
|
form.setValue("branch", branchId);
|
|
@@ -47743,7 +47745,7 @@ var schema_default8 = AdjustmentStockSchema6;
|
|
|
47743
47745
|
|
|
47744
47746
|
// src/components/Transactions/3/purchase3/pos.tsx
|
|
47745
47747
|
import { ArrowLeft as ArrowLeft12 } from "lucide-react";
|
|
47746
|
-
import { useParams as
|
|
47748
|
+
import { useParams as useParams103 } from "react-router-dom";
|
|
47747
47749
|
|
|
47748
47750
|
// src/components/Transactions/3/purchase3/Submit.tsx
|
|
47749
47751
|
import { useFormContext as useFormContext11 } from "react-hook-form";
|
|
@@ -47980,7 +47982,7 @@ import { Fragment as Fragment130, jsx as jsx262, jsxs as jsxs231 } from "react/j
|
|
|
47980
47982
|
var Purchase3Form = ({ type }) => {
|
|
47981
47983
|
const { getQuery, navigate } = useApp_default();
|
|
47982
47984
|
const stockType = type;
|
|
47983
|
-
const { branchId } =
|
|
47985
|
+
const { branchId } = useParams103();
|
|
47984
47986
|
const purchaseId = getQuery("id");
|
|
47985
47987
|
const { currencies } = useWarqadConfig();
|
|
47986
47988
|
const { defaultCurrency } = currencies;
|
|
@@ -48299,6 +48301,351 @@ var purchase3 = {
|
|
|
48299
48301
|
};
|
|
48300
48302
|
var purchase3_default = purchase3;
|
|
48301
48303
|
|
|
48304
|
+
// src/components/Transactions/3/expense/Expenses.tsx
|
|
48305
|
+
import { useNavigate as useNavigate63, useParams as useParams104 } from "react-router-dom";
|
|
48306
|
+
import { EllipsisVertical as EllipsisVertical46, FilePenLine as FilePenLine42, Trash2 as Trash252 } from "lucide-react";
|
|
48307
|
+
import { Fragment as Fragment131, jsx as jsx263, jsxs as jsxs232 } from "react/jsx-runtime";
|
|
48308
|
+
function Expenses3({ url }) {
|
|
48309
|
+
const { branchId } = useParams104();
|
|
48310
|
+
const navigate = useNavigate63();
|
|
48311
|
+
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
48312
|
+
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
48313
|
+
url: url || `/transactions/get?type=expense-3${branchId ? `&fromBranch=${branchId}` : ""}`,
|
|
48314
|
+
dateFilter: true
|
|
48315
|
+
});
|
|
48316
|
+
const { Modal: Modal2 } = useModal();
|
|
48317
|
+
const items = (data2) => [
|
|
48318
|
+
{
|
|
48319
|
+
label: `View Expense`,
|
|
48320
|
+
icon: /* @__PURE__ */ jsx263(FilePenLine42, { size: 16 }),
|
|
48321
|
+
onClick: () => openTransaction({ id: data2?._id, type: "expense-3" })
|
|
48322
|
+
},
|
|
48323
|
+
{
|
|
48324
|
+
label: `Edit Expense`,
|
|
48325
|
+
icon: /* @__PURE__ */ jsx263(FilePenLine42, { size: 16 }),
|
|
48326
|
+
onClick: () => navigate(`update?id=${data2?._id}`)
|
|
48327
|
+
},
|
|
48328
|
+
{
|
|
48329
|
+
label: `Delete Expense`,
|
|
48330
|
+
icon: /* @__PURE__ */ jsx263(Trash252, { className: "text-red-500", size: 16 }),
|
|
48331
|
+
onClick: () => {
|
|
48332
|
+
openTransaction({
|
|
48333
|
+
id: data2?._id,
|
|
48334
|
+
type: "expense",
|
|
48335
|
+
reverseable: { reload }
|
|
48336
|
+
});
|
|
48337
|
+
}
|
|
48338
|
+
}
|
|
48339
|
+
].filter(Boolean);
|
|
48340
|
+
const columns = [
|
|
48341
|
+
{
|
|
48342
|
+
accessorKey: "date",
|
|
48343
|
+
header: "Date",
|
|
48344
|
+
cell: ({ row }) => {
|
|
48345
|
+
const expense = row.original;
|
|
48346
|
+
return /* @__PURE__ */ jsxs232("div", { className: "flex flex-col", children: [
|
|
48347
|
+
/* @__PURE__ */ jsx263("span", { children: expense?.date }),
|
|
48348
|
+
/* @__PURE__ */ jsx263(
|
|
48349
|
+
"span",
|
|
48350
|
+
{
|
|
48351
|
+
onClick: () => openTransaction({ id: expense?._id, type: "expense-3" }),
|
|
48352
|
+
className: "text-xs text-blue-600 italic cursor-pointer hover:underline",
|
|
48353
|
+
children: expense.ref
|
|
48354
|
+
}
|
|
48355
|
+
)
|
|
48356
|
+
] });
|
|
48357
|
+
}
|
|
48358
|
+
},
|
|
48359
|
+
{
|
|
48360
|
+
accessorKey: "description",
|
|
48361
|
+
header: "Description",
|
|
48362
|
+
cell: ({ row }) => {
|
|
48363
|
+
const expense = row.original;
|
|
48364
|
+
return /* @__PURE__ */ jsxs232("div", { className: "flex flex-col", children: [
|
|
48365
|
+
/* @__PURE__ */ jsx263("span", { className: "capitalize", children: expense?.description }),
|
|
48366
|
+
expense?.note && /* @__PURE__ */ jsx263("span", { className: "text-xs text-gray-500 italic max-w-xs truncate", children: expense?.note })
|
|
48367
|
+
] });
|
|
48368
|
+
}
|
|
48369
|
+
},
|
|
48370
|
+
{
|
|
48371
|
+
accessorKey: "wallet",
|
|
48372
|
+
header: "Wallet",
|
|
48373
|
+
cell: ({ row }) => {
|
|
48374
|
+
const expense = row.original;
|
|
48375
|
+
const walletData = expense?.fromWalletData || expense?.toWalletData;
|
|
48376
|
+
return /* @__PURE__ */ jsx263("span", { children: walletData?.name || "N/A" });
|
|
48377
|
+
}
|
|
48378
|
+
},
|
|
48379
|
+
{
|
|
48380
|
+
accessorKey: "amount",
|
|
48381
|
+
header: "Amount",
|
|
48382
|
+
cell: ({ row }) => {
|
|
48383
|
+
const expense = row.original;
|
|
48384
|
+
return /* @__PURE__ */ jsx263("div", { className: "", children: /* @__PURE__ */ jsx263("p", { className: "font-medium text-red-600", children: Formats_default.Price(expense?.amount, expense?.currency) }) });
|
|
48385
|
+
}
|
|
48386
|
+
},
|
|
48387
|
+
{
|
|
48388
|
+
accessorKey: "actions",
|
|
48389
|
+
header: "Actions",
|
|
48390
|
+
cell: ({ row }) => {
|
|
48391
|
+
const data2 = row.original;
|
|
48392
|
+
return /* @__PURE__ */ jsx263(
|
|
48393
|
+
Dropdown,
|
|
48394
|
+
{
|
|
48395
|
+
className: "cursor-pointer w-[150px]",
|
|
48396
|
+
items: items(data2),
|
|
48397
|
+
triggerMode: "hover",
|
|
48398
|
+
children: /* @__PURE__ */ jsx263(EllipsisVertical46, {})
|
|
48399
|
+
}
|
|
48400
|
+
);
|
|
48401
|
+
}
|
|
48402
|
+
}
|
|
48403
|
+
];
|
|
48404
|
+
const expenses = data?.data || [];
|
|
48405
|
+
return /* @__PURE__ */ jsxs232(Fragment131, { children: [
|
|
48406
|
+
/* @__PURE__ */ jsx263(TransactionView, {}),
|
|
48407
|
+
/* @__PURE__ */ jsx263(Modal2, {}),
|
|
48408
|
+
/* @__PURE__ */ jsx263(
|
|
48409
|
+
TransactionViewComponent,
|
|
48410
|
+
{
|
|
48411
|
+
columns,
|
|
48412
|
+
data: expenses,
|
|
48413
|
+
title: "Expenses",
|
|
48414
|
+
description: "Track and manage business expenses",
|
|
48415
|
+
index: true,
|
|
48416
|
+
createTitle: "Add Expense",
|
|
48417
|
+
onCreate: () => {
|
|
48418
|
+
navigate("create");
|
|
48419
|
+
}
|
|
48420
|
+
}
|
|
48421
|
+
)
|
|
48422
|
+
] });
|
|
48423
|
+
}
|
|
48424
|
+
var Expenses_default2 = Expenses3;
|
|
48425
|
+
|
|
48426
|
+
// src/components/Transactions/3/expense/ExpenseForm.tsx
|
|
48427
|
+
import { useEffect as useEffect113, useMemo as useMemo51, useState as useState112 } from "react";
|
|
48428
|
+
import { useParams as useParams105 } from "react-router-dom";
|
|
48429
|
+
import { useForm as useForm57 } from "react-hook-form";
|
|
48430
|
+
import { zodResolver as zodResolver56 } from "@hookform/resolvers/zod";
|
|
48431
|
+
import { message as message84 } from "antd";
|
|
48432
|
+
|
|
48433
|
+
// src/components/Transactions/3/expense/schema.ts
|
|
48434
|
+
import { z as z48 } from "zod";
|
|
48435
|
+
var expenseSchema4 = z48.object({
|
|
48436
|
+
description: z48.string().min(1, "Description is required"),
|
|
48437
|
+
date: zodFields.date,
|
|
48438
|
+
amount: z48.number().gt(0, "Amount must be greater than 0"),
|
|
48439
|
+
branch: z48.string().optional(),
|
|
48440
|
+
wallet: z48.string().min(1, "Wallet is required"),
|
|
48441
|
+
note: z48.string().optional(),
|
|
48442
|
+
// Objects for frontend helpers
|
|
48443
|
+
walletObject: z48.any().optional(),
|
|
48444
|
+
rate: z48.number().optional()
|
|
48445
|
+
});
|
|
48446
|
+
|
|
48447
|
+
// src/components/Transactions/3/expense/ExpenseForm.tsx
|
|
48448
|
+
import { Fragment as Fragment132, jsx as jsx264, jsxs as jsxs233 } from "react/jsx-runtime";
|
|
48449
|
+
function ExpenseForm2() {
|
|
48450
|
+
const { branchId } = useParams105();
|
|
48451
|
+
const { getQuery, navigate } = useApp_default();
|
|
48452
|
+
const id = getQuery("id");
|
|
48453
|
+
const isEdit = !!id;
|
|
48454
|
+
const [ref2, setRef] = useState112("");
|
|
48455
|
+
const { post, isLoading } = useApis_default();
|
|
48456
|
+
const { isLoading: isLoadingGet, get } = useApis_default();
|
|
48457
|
+
const { defaultCurrency } = useWarqadConfig().currencies;
|
|
48458
|
+
const methods = useForm57({
|
|
48459
|
+
resolver: zodResolver56(expenseSchema4),
|
|
48460
|
+
defaultValues: {
|
|
48461
|
+
date: (/* @__PURE__ */ new Date()).toLocaleDateString("en-GB"),
|
|
48462
|
+
amount: 0,
|
|
48463
|
+
description: "",
|
|
48464
|
+
wallet: "",
|
|
48465
|
+
rate: void 0
|
|
48466
|
+
}
|
|
48467
|
+
});
|
|
48468
|
+
const { handleSubmit, reset, watch } = methods;
|
|
48469
|
+
const walletObj = watch("walletObject");
|
|
48470
|
+
const currency = walletObj?.currency;
|
|
48471
|
+
const isRate = currency && currency !== defaultCurrency;
|
|
48472
|
+
const amount = watch("amount");
|
|
48473
|
+
const rate = watch("rate");
|
|
48474
|
+
const exchangedAmount2 = useMemo51(() => {
|
|
48475
|
+
if (isRate) {
|
|
48476
|
+
const am = forex_default.exchangedAmount({
|
|
48477
|
+
accountCurrency: defaultCurrency,
|
|
48478
|
+
amount,
|
|
48479
|
+
exchangeRate: rate ?? 1,
|
|
48480
|
+
transactionCurrency: currency
|
|
48481
|
+
});
|
|
48482
|
+
return Formats_default.Price(am, defaultCurrency ?? "N/A", false);
|
|
48483
|
+
}
|
|
48484
|
+
}, [amount, currency, rate, isRate]);
|
|
48485
|
+
const onSubmit = async (data) => {
|
|
48486
|
+
try {
|
|
48487
|
+
const payload = {
|
|
48488
|
+
...data,
|
|
48489
|
+
type: "expense-3",
|
|
48490
|
+
defaultCurrency,
|
|
48491
|
+
branch: branchId ?? void 0,
|
|
48492
|
+
rate: data?.rate ?? 1
|
|
48493
|
+
};
|
|
48494
|
+
await post({
|
|
48495
|
+
url: `/transactions/add${isEdit ? `?ref=${ref2}` : ""}`,
|
|
48496
|
+
body: payload
|
|
48497
|
+
});
|
|
48498
|
+
message84.success(`Expense saved successfully`);
|
|
48499
|
+
navigate(-1);
|
|
48500
|
+
} catch (error) {
|
|
48501
|
+
message84.error(error?.message || "Something went wrong");
|
|
48502
|
+
}
|
|
48503
|
+
};
|
|
48504
|
+
const fetches = async () => {
|
|
48505
|
+
try {
|
|
48506
|
+
const res = await get({
|
|
48507
|
+
url: `/transactions/get?id=${id}${branchId ? `&fromBranch=${branchId}` : ""}`
|
|
48508
|
+
});
|
|
48509
|
+
const data = res.data;
|
|
48510
|
+
reset({
|
|
48511
|
+
...data,
|
|
48512
|
+
wallet: data?.fromWallet || data?.toWallet,
|
|
48513
|
+
// Expenses are usually withdrawals (fromWallet)
|
|
48514
|
+
rate: data?.exchange?.rate
|
|
48515
|
+
});
|
|
48516
|
+
setRef(data?.ref);
|
|
48517
|
+
} catch (error) {
|
|
48518
|
+
message84.error(error?.message || "Something went wrong");
|
|
48519
|
+
navigate(-1);
|
|
48520
|
+
}
|
|
48521
|
+
};
|
|
48522
|
+
useEffect113(() => {
|
|
48523
|
+
if (isEdit) {
|
|
48524
|
+
fetches();
|
|
48525
|
+
}
|
|
48526
|
+
}, [id]);
|
|
48527
|
+
return /* @__PURE__ */ jsxs233(
|
|
48528
|
+
Card,
|
|
48529
|
+
{
|
|
48530
|
+
className: "max-w-4xl mx-auto mt-10 relative",
|
|
48531
|
+
isLoading: isLoadingGet,
|
|
48532
|
+
loadingText: "Processing...",
|
|
48533
|
+
children: [
|
|
48534
|
+
/* @__PURE__ */ jsxs233(Card.Header, { children: [
|
|
48535
|
+
/* @__PURE__ */ jsx264(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Expense` }),
|
|
48536
|
+
/* @__PURE__ */ jsx264(Card.Description, { children: isEdit ? `Update the details for this expense entry` : `Record a new business expense` })
|
|
48537
|
+
] }),
|
|
48538
|
+
/* @__PURE__ */ jsx264(Card.Content, { children: /* @__PURE__ */ jsxs233(
|
|
48539
|
+
"form",
|
|
48540
|
+
{
|
|
48541
|
+
className: "space-y-4",
|
|
48542
|
+
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
48543
|
+
children: [
|
|
48544
|
+
/* @__PURE__ */ jsxs233("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
48545
|
+
/* @__PURE__ */ jsx264(
|
|
48546
|
+
Fields_default.Input,
|
|
48547
|
+
{
|
|
48548
|
+
label: "Description",
|
|
48549
|
+
form: methods,
|
|
48550
|
+
name: "description",
|
|
48551
|
+
placeholder: "What was this expense for?",
|
|
48552
|
+
required: true
|
|
48553
|
+
}
|
|
48554
|
+
),
|
|
48555
|
+
/* @__PURE__ */ jsx264(
|
|
48556
|
+
Feilds_default2.Wallet,
|
|
48557
|
+
{
|
|
48558
|
+
label: "Wallet",
|
|
48559
|
+
form: methods,
|
|
48560
|
+
name: "wallet",
|
|
48561
|
+
placeholder: "Source of funds...",
|
|
48562
|
+
required: true,
|
|
48563
|
+
showBalance: true,
|
|
48564
|
+
obj: "walletObject"
|
|
48565
|
+
}
|
|
48566
|
+
)
|
|
48567
|
+
] }),
|
|
48568
|
+
/* @__PURE__ */ jsxs233("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
48569
|
+
/* @__PURE__ */ jsx264(
|
|
48570
|
+
Fields_default.DateInput,
|
|
48571
|
+
{
|
|
48572
|
+
label: "Date",
|
|
48573
|
+
form: methods,
|
|
48574
|
+
name: "date",
|
|
48575
|
+
required: true
|
|
48576
|
+
}
|
|
48577
|
+
),
|
|
48578
|
+
/* @__PURE__ */ jsx264(
|
|
48579
|
+
Fields_default.Input,
|
|
48580
|
+
{
|
|
48581
|
+
label: "Amount",
|
|
48582
|
+
form: methods,
|
|
48583
|
+
name: "amount",
|
|
48584
|
+
type: "number",
|
|
48585
|
+
placeholder: "0.00",
|
|
48586
|
+
required: true
|
|
48587
|
+
}
|
|
48588
|
+
),
|
|
48589
|
+
isRate && /* @__PURE__ */ jsxs233(Fragment132, { children: [
|
|
48590
|
+
/* @__PURE__ */ jsx264(
|
|
48591
|
+
Fields_default.Input,
|
|
48592
|
+
{
|
|
48593
|
+
label: "Rate",
|
|
48594
|
+
form: methods,
|
|
48595
|
+
name: "rate",
|
|
48596
|
+
type: "number",
|
|
48597
|
+
placeholder: "Rate",
|
|
48598
|
+
required: true
|
|
48599
|
+
}
|
|
48600
|
+
),
|
|
48601
|
+
/* @__PURE__ */ jsx264(
|
|
48602
|
+
Fields_default.Input,
|
|
48603
|
+
{
|
|
48604
|
+
label: "Exchanged Amount",
|
|
48605
|
+
type: "text",
|
|
48606
|
+
readOnly: true,
|
|
48607
|
+
disabled: true,
|
|
48608
|
+
value: exchangedAmount2
|
|
48609
|
+
}
|
|
48610
|
+
)
|
|
48611
|
+
] })
|
|
48612
|
+
] }),
|
|
48613
|
+
/* @__PURE__ */ jsx264(
|
|
48614
|
+
Fields_default.Textarea,
|
|
48615
|
+
{
|
|
48616
|
+
label: "Note",
|
|
48617
|
+
form: methods,
|
|
48618
|
+
name: "note",
|
|
48619
|
+
placeholder: "Add any additional details..."
|
|
48620
|
+
}
|
|
48621
|
+
),
|
|
48622
|
+
/* @__PURE__ */ jsx264("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx264(
|
|
48623
|
+
Button,
|
|
48624
|
+
{
|
|
48625
|
+
isLoading,
|
|
48626
|
+
disabled: isLoading,
|
|
48627
|
+
type: "submit",
|
|
48628
|
+
className: "min-w-[100px]",
|
|
48629
|
+
variant: !isEdit ? "primary" : "warning",
|
|
48630
|
+
children: isEdit ? "Update" : "Add"
|
|
48631
|
+
}
|
|
48632
|
+
) })
|
|
48633
|
+
]
|
|
48634
|
+
}
|
|
48635
|
+
) })
|
|
48636
|
+
]
|
|
48637
|
+
}
|
|
48638
|
+
);
|
|
48639
|
+
}
|
|
48640
|
+
var ExpenseForm_default2 = ExpenseForm2;
|
|
48641
|
+
|
|
48642
|
+
// src/components/Transactions/3/expense/index.tsx
|
|
48643
|
+
var Expenses32 = {
|
|
48644
|
+
List: Expenses_default2,
|
|
48645
|
+
Form: ExpenseForm_default2
|
|
48646
|
+
};
|
|
48647
|
+
var expense_default = Expenses32;
|
|
48648
|
+
|
|
48302
48649
|
// src/components/Transactions/3/index.ts
|
|
48303
48650
|
var Transaction3 = {
|
|
48304
48651
|
Payments: Payments_default3,
|
|
@@ -48308,26 +48655,28 @@ var Transaction3 = {
|
|
|
48308
48655
|
Sale2: sale2_default2.List,
|
|
48309
48656
|
Sale2Form: sale2_default2.Form,
|
|
48310
48657
|
Purchase3: purchase3_default.List,
|
|
48311
|
-
Purchase3Form: purchase3_default.Form
|
|
48658
|
+
Purchase3Form: purchase3_default.Form,
|
|
48659
|
+
Expenses: expense_default.List,
|
|
48660
|
+
ExpenseForm: expense_default.Form
|
|
48312
48661
|
};
|
|
48313
48662
|
var __default = Transaction3;
|
|
48314
48663
|
|
|
48315
48664
|
// src/components/reports/ItemReport.tsx
|
|
48316
|
-
import { useParams as
|
|
48317
|
-
import { z as
|
|
48318
|
-
import { useForm as
|
|
48319
|
-
import { zodResolver as
|
|
48320
|
-
import { useState as
|
|
48321
|
-
import { message as
|
|
48322
|
-
import { Fragment as
|
|
48665
|
+
import { useParams as useParams106 } from "react-router-dom";
|
|
48666
|
+
import { z as z49 } from "zod";
|
|
48667
|
+
import { useForm as useForm58 } from "react-hook-form";
|
|
48668
|
+
import { zodResolver as zodResolver57 } from "@hookform/resolvers/zod";
|
|
48669
|
+
import { useState as useState113 } from "react";
|
|
48670
|
+
import { message as message85 } from "antd";
|
|
48671
|
+
import { Fragment as Fragment133, jsx as jsx265, jsxs as jsxs234 } from "react/jsx-runtime";
|
|
48323
48672
|
var ItemReport = ({
|
|
48324
48673
|
value = false,
|
|
48325
48674
|
type
|
|
48326
48675
|
}) => {
|
|
48327
48676
|
const { apiConfig } = useWarqadConfig();
|
|
48328
|
-
const { branchId } =
|
|
48677
|
+
const { branchId } = useParams106();
|
|
48329
48678
|
const { branches } = useAuth_default();
|
|
48330
|
-
const [params, setParams] =
|
|
48679
|
+
const [params, setParams] = useState113({
|
|
48331
48680
|
id: "",
|
|
48332
48681
|
branch: "all"
|
|
48333
48682
|
});
|
|
@@ -48352,9 +48701,9 @@ var ItemReport = ({
|
|
|
48352
48701
|
header: "Date",
|
|
48353
48702
|
key: "date",
|
|
48354
48703
|
className: "text-xs whitespace-nowrap",
|
|
48355
|
-
render: (row) => /* @__PURE__ */
|
|
48356
|
-
/* @__PURE__ */
|
|
48357
|
-
/* @__PURE__ */
|
|
48704
|
+
render: (row) => /* @__PURE__ */ jsxs234("div", { className: "", children: [
|
|
48705
|
+
/* @__PURE__ */ jsx265("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
|
|
48706
|
+
/* @__PURE__ */ jsx265(
|
|
48358
48707
|
"span",
|
|
48359
48708
|
{
|
|
48360
48709
|
onClick: () => {
|
|
@@ -48373,7 +48722,7 @@ var ItemReport = ({
|
|
|
48373
48722
|
header: "Description",
|
|
48374
48723
|
key: "description",
|
|
48375
48724
|
className: "text-xs whitespace-nowrap",
|
|
48376
|
-
render: (row) => /* @__PURE__ */
|
|
48725
|
+
render: (row) => /* @__PURE__ */ jsx265("div", { className: "", children: /* @__PURE__ */ jsx265("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.description }) })
|
|
48377
48726
|
},
|
|
48378
48727
|
{
|
|
48379
48728
|
header: "Quantity",
|
|
@@ -48381,7 +48730,7 @@ var ItemReport = ({
|
|
|
48381
48730
|
className: "text-xs whitespace-nowrap",
|
|
48382
48731
|
render: (row) => {
|
|
48383
48732
|
const Qty = row.quantity;
|
|
48384
|
-
return /* @__PURE__ */
|
|
48733
|
+
return /* @__PURE__ */ jsxs234(
|
|
48385
48734
|
"div",
|
|
48386
48735
|
{
|
|
48387
48736
|
className: `font-bold ${row.line === "add" ? "text-green-500" : row.line === "sub" ? "text-red-500" : "text-black"}`,
|
|
@@ -48398,7 +48747,7 @@ var ItemReport = ({
|
|
|
48398
48747
|
header: "Balance",
|
|
48399
48748
|
key: "runningBalance",
|
|
48400
48749
|
className: "text-xs whitespace-nowrap",
|
|
48401
|
-
render: (row) => /* @__PURE__ */
|
|
48750
|
+
render: (row) => /* @__PURE__ */ jsx265("div", { className: "", children: /* @__PURE__ */ jsx265("p", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.XQty(row.runningBalance) }) })
|
|
48402
48751
|
}
|
|
48403
48752
|
];
|
|
48404
48753
|
let runningBalance = 0;
|
|
@@ -48410,10 +48759,10 @@ var ItemReport = ({
|
|
|
48410
48759
|
};
|
|
48411
48760
|
});
|
|
48412
48761
|
const itemName = datas[0]?.name;
|
|
48413
|
-
return /* @__PURE__ */
|
|
48414
|
-
/* @__PURE__ */
|
|
48415
|
-
/* @__PURE__ */
|
|
48416
|
-
/* @__PURE__ */
|
|
48762
|
+
return /* @__PURE__ */ jsxs234(Fragment133, { children: [
|
|
48763
|
+
/* @__PURE__ */ jsx265(Modal2, {}),
|
|
48764
|
+
/* @__PURE__ */ jsx265(TransactionView, {}),
|
|
48765
|
+
/* @__PURE__ */ jsx265(
|
|
48417
48766
|
A4DataView,
|
|
48418
48767
|
{
|
|
48419
48768
|
columns,
|
|
@@ -48424,14 +48773,14 @@ var ItemReport = ({
|
|
|
48424
48773
|
tableTitle: `${type} Movement Report`,
|
|
48425
48774
|
fixed: false,
|
|
48426
48775
|
error: !id ? "Please select an item" : void 0,
|
|
48427
|
-
headers: /* @__PURE__ */
|
|
48776
|
+
headers: /* @__PURE__ */ jsx265(
|
|
48428
48777
|
Button,
|
|
48429
48778
|
{
|
|
48430
48779
|
type: "button",
|
|
48431
48780
|
size: "sm",
|
|
48432
48781
|
onClick: () => openState({
|
|
48433
48782
|
title: "Item Transactions",
|
|
48434
|
-
content: /* @__PURE__ */
|
|
48783
|
+
content: /* @__PURE__ */ jsx265(
|
|
48435
48784
|
ItemReportHeader2,
|
|
48436
48785
|
{
|
|
48437
48786
|
type,
|
|
@@ -48449,18 +48798,18 @@ var ItemReport = ({
|
|
|
48449
48798
|
)
|
|
48450
48799
|
] });
|
|
48451
48800
|
};
|
|
48452
|
-
var schema3 =
|
|
48453
|
-
pack:
|
|
48454
|
-
product:
|
|
48455
|
-
branch:
|
|
48801
|
+
var schema3 = z49.object({
|
|
48802
|
+
pack: z49.string().optional(),
|
|
48803
|
+
product: z49.string().optional(),
|
|
48804
|
+
branch: z49.string()
|
|
48456
48805
|
});
|
|
48457
48806
|
function ItemReportHeader2({
|
|
48458
48807
|
type,
|
|
48459
48808
|
close,
|
|
48460
48809
|
addToParams
|
|
48461
48810
|
}) {
|
|
48462
|
-
const methods =
|
|
48463
|
-
resolver:
|
|
48811
|
+
const methods = useForm58({
|
|
48812
|
+
resolver: zodResolver57(schema3),
|
|
48464
48813
|
defaultValues: {
|
|
48465
48814
|
pack: "",
|
|
48466
48815
|
product: "",
|
|
@@ -48474,14 +48823,14 @@ function ItemReportHeader2({
|
|
|
48474
48823
|
label: b.name,
|
|
48475
48824
|
value: b._id
|
|
48476
48825
|
}));
|
|
48477
|
-
return /* @__PURE__ */
|
|
48826
|
+
return /* @__PURE__ */ jsxs234(
|
|
48478
48827
|
"form",
|
|
48479
48828
|
{
|
|
48480
48829
|
className: "space-y-3",
|
|
48481
48830
|
onSubmit: handleSubmit((data) => {
|
|
48482
48831
|
const id = type === "pack" ? data.pack : data.product;
|
|
48483
48832
|
if (!id) {
|
|
48484
|
-
|
|
48833
|
+
message85.error("Please select an item");
|
|
48485
48834
|
methods.setFocus(type);
|
|
48486
48835
|
return;
|
|
48487
48836
|
}
|
|
@@ -48492,8 +48841,8 @@ function ItemReportHeader2({
|
|
|
48492
48841
|
close();
|
|
48493
48842
|
}),
|
|
48494
48843
|
children: [
|
|
48495
|
-
/* @__PURE__ */
|
|
48496
|
-
/* @__PURE__ */
|
|
48844
|
+
/* @__PURE__ */ jsxs234("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-2", children: [
|
|
48845
|
+
/* @__PURE__ */ jsx265(
|
|
48497
48846
|
Select,
|
|
48498
48847
|
{
|
|
48499
48848
|
options: [{ label: "All Branches", value: "all" }, ...branchOptions],
|
|
@@ -48501,7 +48850,7 @@ function ItemReportHeader2({
|
|
|
48501
48850
|
name: "branch"
|
|
48502
48851
|
}
|
|
48503
48852
|
),
|
|
48504
|
-
type === "pack" ? /* @__PURE__ */
|
|
48853
|
+
type === "pack" ? /* @__PURE__ */ jsx265(
|
|
48505
48854
|
Pack_default.Pack,
|
|
48506
48855
|
{
|
|
48507
48856
|
api: "/packs/get",
|
|
@@ -48509,7 +48858,7 @@ function ItemReportHeader2({
|
|
|
48509
48858
|
form: methods,
|
|
48510
48859
|
name: "pack"
|
|
48511
48860
|
}
|
|
48512
|
-
) : /* @__PURE__ */
|
|
48861
|
+
) : /* @__PURE__ */ jsx265(
|
|
48513
48862
|
Feilds_default5.Product,
|
|
48514
48863
|
{
|
|
48515
48864
|
label: "",
|
|
@@ -48520,7 +48869,7 @@ function ItemReportHeader2({
|
|
|
48520
48869
|
}
|
|
48521
48870
|
)
|
|
48522
48871
|
] }),
|
|
48523
|
-
/* @__PURE__ */
|
|
48872
|
+
/* @__PURE__ */ jsx265("div", { className: "flex gap-2 justify-end", children: /* @__PURE__ */ jsx265(Button, { type: "submit", children: "Filter" }) })
|
|
48524
48873
|
]
|
|
48525
48874
|
}
|
|
48526
48875
|
);
|
|
@@ -48528,19 +48877,19 @@ function ItemReportHeader2({
|
|
|
48528
48877
|
var ItemReport_default = ItemReport;
|
|
48529
48878
|
|
|
48530
48879
|
// src/components/accounts/LeaseCollection.tsx
|
|
48531
|
-
import { useNavigate as
|
|
48532
|
-
import { useMemo as
|
|
48533
|
-
import { Fragment as
|
|
48880
|
+
import { useNavigate as useNavigate64, useParams as useParams107, useSearchParams as useSearchParams19 } from "react-router-dom";
|
|
48881
|
+
import { useMemo as useMemo52, useState as useState114, useEffect as useEffect114 } from "react";
|
|
48882
|
+
import { Fragment as Fragment134, jsx as jsx266, jsxs as jsxs235 } from "react/jsx-runtime";
|
|
48534
48883
|
var LeaseCollection = ({
|
|
48535
48884
|
leaseType,
|
|
48536
48885
|
defaultCurrency = "KES"
|
|
48537
48886
|
}) => {
|
|
48538
|
-
const navigate =
|
|
48887
|
+
const navigate = useNavigate64();
|
|
48539
48888
|
const [searchParams] = useSearchParams19();
|
|
48540
48889
|
const { apiConfig } = useWarqadConfig();
|
|
48541
|
-
const { branchId } =
|
|
48890
|
+
const { branchId } = useParams107();
|
|
48542
48891
|
const { branches } = useAuth_default();
|
|
48543
|
-
const currentBranch =
|
|
48892
|
+
const currentBranch = useMemo52(
|
|
48544
48893
|
() => branches?.find((b) => b?._id === branchId),
|
|
48545
48894
|
[branches, branchId]
|
|
48546
48895
|
);
|
|
@@ -48548,16 +48897,16 @@ var LeaseCollection = ({
|
|
|
48548
48897
|
const initialFilter = ["all", "debit", "credit"].includes(urlFilter) ? urlFilter : "all";
|
|
48549
48898
|
const urlCurrency = searchParams.get("currency")?.toUpperCase();
|
|
48550
48899
|
const initialCurrency = urlCurrency && Enums_default.currencies.includes(urlCurrency) ? urlCurrency : defaultCurrency;
|
|
48551
|
-
const [filter, setFilter] =
|
|
48900
|
+
const [filter, setFilter] = useState114(
|
|
48552
48901
|
initialFilter
|
|
48553
48902
|
);
|
|
48554
|
-
const [currencyFilter, setCurrencyFilter] =
|
|
48555
|
-
|
|
48903
|
+
const [currencyFilter, setCurrencyFilter] = useState114(initialCurrency);
|
|
48904
|
+
useEffect114(() => {
|
|
48556
48905
|
if (urlFilter && ["all", "debit", "credit"].includes(urlFilter)) {
|
|
48557
48906
|
setFilter(urlFilter);
|
|
48558
48907
|
}
|
|
48559
48908
|
}, [urlFilter]);
|
|
48560
|
-
|
|
48909
|
+
useEffect114(() => {
|
|
48561
48910
|
if (urlCurrency && Enums_default.currencies.includes(urlCurrency)) {
|
|
48562
48911
|
setCurrencyFilter(urlCurrency);
|
|
48563
48912
|
} else {
|
|
@@ -48576,9 +48925,9 @@ var LeaseCollection = ({
|
|
|
48576
48925
|
key: "name",
|
|
48577
48926
|
className: "text-xs whitespace-nowrap ",
|
|
48578
48927
|
searchKeys: ["name", "phoneNumber", "unitNames"],
|
|
48579
|
-
render: (row) => /* @__PURE__ */
|
|
48580
|
-
/* @__PURE__ */
|
|
48581
|
-
row.unitNames && /* @__PURE__ */
|
|
48928
|
+
render: (row) => /* @__PURE__ */ jsxs235("div", { className: "space-y-1", children: [
|
|
48929
|
+
/* @__PURE__ */ jsx266("p", { className: "font-bold dark:text-white print:text-black uppercase", children: row.name }),
|
|
48930
|
+
row.unitNames && /* @__PURE__ */ jsxs235("p", { className: "text-[9px]! capitalize", children: [
|
|
48582
48931
|
"(",
|
|
48583
48932
|
row.unitNames,
|
|
48584
48933
|
")"
|
|
@@ -48590,7 +48939,7 @@ var LeaseCollection = ({
|
|
|
48590
48939
|
key: "phoneNumber",
|
|
48591
48940
|
maxWidth: 70,
|
|
48592
48941
|
render: (row) => {
|
|
48593
|
-
return /* @__PURE__ */
|
|
48942
|
+
return /* @__PURE__ */ jsx266("p", { children: row?.phoneNumber || "N/A" });
|
|
48594
48943
|
}
|
|
48595
48944
|
},
|
|
48596
48945
|
// </span>
|
|
@@ -48600,11 +48949,11 @@ var LeaseCollection = ({
|
|
|
48600
48949
|
className: "text-xs whitespace-nowrap text-right",
|
|
48601
48950
|
render: (row) => {
|
|
48602
48951
|
const Amount = row.totalCollectionString;
|
|
48603
|
-
return /* @__PURE__ */
|
|
48952
|
+
return /* @__PURE__ */ jsx266("div", { className: "", children: /* @__PURE__ */ jsx266("p", { className: "font-bold ", children: Amount }) });
|
|
48604
48953
|
},
|
|
48605
48954
|
renderFooter: (data2) => {
|
|
48606
48955
|
if (currencyFilter === "all") return;
|
|
48607
|
-
return /* @__PURE__ */
|
|
48956
|
+
return /* @__PURE__ */ jsx266("span", { className: " font-bold", children: Formats_default.Price(
|
|
48608
48957
|
data2.reduce((acc, row) => acc + row.totalCollection, 0),
|
|
48609
48958
|
defaultCurrency,
|
|
48610
48959
|
false
|
|
@@ -48612,7 +48961,7 @@ var LeaseCollection = ({
|
|
|
48612
48961
|
}
|
|
48613
48962
|
}
|
|
48614
48963
|
];
|
|
48615
|
-
const datas =
|
|
48964
|
+
const datas = useMemo52(() => {
|
|
48616
48965
|
let runningBalance = 0;
|
|
48617
48966
|
let filteredData = data?.data || [];
|
|
48618
48967
|
const result = filteredData.map((item) => {
|
|
@@ -48625,9 +48974,9 @@ var LeaseCollection = ({
|
|
|
48625
48974
|
});
|
|
48626
48975
|
return result;
|
|
48627
48976
|
}, [filter, currencyFilter, data]);
|
|
48628
|
-
return /* @__PURE__ */
|
|
48629
|
-
/* @__PURE__ */
|
|
48630
|
-
/* @__PURE__ */
|
|
48977
|
+
return /* @__PURE__ */ jsxs235(Fragment134, { children: [
|
|
48978
|
+
/* @__PURE__ */ jsx266(TransactionView, {}),
|
|
48979
|
+
/* @__PURE__ */ jsx266(
|
|
48631
48980
|
A4DataView,
|
|
48632
48981
|
{
|
|
48633
48982
|
columns,
|
|
@@ -48637,7 +48986,7 @@ var LeaseCollection = ({
|
|
|
48637
48986
|
subtitle: `All Collections`,
|
|
48638
48987
|
fixed: false,
|
|
48639
48988
|
startPage: 1e9,
|
|
48640
|
-
headers: /* @__PURE__ */
|
|
48989
|
+
headers: /* @__PURE__ */ jsx266("div", { className: "flex gap-2" })
|
|
48641
48990
|
}
|
|
48642
48991
|
)
|
|
48643
48992
|
] });
|
|
@@ -48645,61 +48994,61 @@ var LeaseCollection = ({
|
|
|
48645
48994
|
var LeaseCollection_default = LeaseCollection;
|
|
48646
48995
|
|
|
48647
48996
|
// src/components/Transactions/cargoIM/CargoIM.tsx
|
|
48648
|
-
import { useNavigate as
|
|
48649
|
-
import { EllipsisVertical as
|
|
48650
|
-
import { useState as
|
|
48651
|
-
import { message as
|
|
48997
|
+
import { useNavigate as useNavigate65, useParams as useParams111 } from "react-router-dom";
|
|
48998
|
+
import { EllipsisVertical as EllipsisVertical47, FilePenLine as FilePenLine43, Trash2 as Trash254 } from "lucide-react";
|
|
48999
|
+
import { useState as useState116 } from "react";
|
|
49000
|
+
import { message as message89 } from "antd";
|
|
48652
49001
|
|
|
48653
49002
|
// src/components/Transactions/cargoIM/schema.ts
|
|
48654
|
-
import { z as
|
|
48655
|
-
var InvoiceSchema2 =
|
|
48656
|
-
name:
|
|
48657
|
-
quantity:
|
|
48658
|
-
amount:
|
|
49003
|
+
import { z as z50 } from "zod";
|
|
49004
|
+
var InvoiceSchema2 = z50.object({
|
|
49005
|
+
name: z50.string().min(1, { message: "Item name is required" }),
|
|
49006
|
+
quantity: z50.number().gt(0, { message: "Quantity must be greater than 0" }),
|
|
49007
|
+
amount: z50.number().gt(0, { message: "Price must be greater than 0" })
|
|
48659
49008
|
});
|
|
48660
|
-
var createInvoiceManagerValidation2 =
|
|
48661
|
-
invoices:
|
|
48662
|
-
date:
|
|
48663
|
-
currency:
|
|
48664
|
-
branch:
|
|
49009
|
+
var createInvoiceManagerValidation2 = z50.object({
|
|
49010
|
+
invoices: z50.array(InvoiceSchema2),
|
|
49011
|
+
date: z50.string(),
|
|
49012
|
+
currency: z50.string(),
|
|
49013
|
+
branch: z50.string().optional()
|
|
48665
49014
|
});
|
|
48666
|
-
var createAccountSchema3 =
|
|
48667
|
-
name:
|
|
48668
|
-
phoneNumber:
|
|
48669
|
-
branch:
|
|
48670
|
-
currency:
|
|
49015
|
+
var createAccountSchema3 = z50.object({
|
|
49016
|
+
name: z50.string().min(2, { message: "Name must be at least 2 characters" }),
|
|
49017
|
+
phoneNumber: z50.string().optional(),
|
|
49018
|
+
branch: z50.string().optional(),
|
|
49019
|
+
currency: z50.string().optional()
|
|
48671
49020
|
});
|
|
48672
|
-
var journalSchema5 =
|
|
49021
|
+
var journalSchema5 = z50.object({
|
|
48673
49022
|
date: zodFields.date,
|
|
48674
|
-
amount:
|
|
48675
|
-
currency:
|
|
48676
|
-
description:
|
|
48677
|
-
branch:
|
|
48678
|
-
action:
|
|
48679
|
-
note:
|
|
49023
|
+
amount: z50.number().gt(0, "Amount must be greater than 0"),
|
|
49024
|
+
currency: z50.string(),
|
|
49025
|
+
description: z50.string(),
|
|
49026
|
+
branch: z50.string().optional(),
|
|
49027
|
+
action: z50.enum(Enums_default.actionTypes).optional(),
|
|
49028
|
+
note: z50.string().optional()
|
|
48680
49029
|
});
|
|
48681
49030
|
|
|
48682
49031
|
// src/components/Transactions/cargoIM/AccountForm.tsx
|
|
48683
|
-
import { useForm as
|
|
48684
|
-
import { zodResolver as
|
|
48685
|
-
import { message as
|
|
48686
|
-
import { useEffect as
|
|
48687
|
-
import { useParams as
|
|
48688
|
-
import { jsx as
|
|
49032
|
+
import { useForm as useForm59 } from "react-hook-form";
|
|
49033
|
+
import { zodResolver as zodResolver58 } from "@hookform/resolvers/zod";
|
|
49034
|
+
import { message as message86 } from "antd";
|
|
49035
|
+
import { useEffect as useEffect115 } from "react";
|
|
49036
|
+
import { useParams as useParams108 } from "react-router-dom";
|
|
49037
|
+
import { jsx as jsx267, jsxs as jsxs236 } from "react/jsx-runtime";
|
|
48689
49038
|
function AccountForm3({
|
|
48690
49039
|
onReload,
|
|
48691
49040
|
close,
|
|
48692
49041
|
id
|
|
48693
49042
|
}) {
|
|
48694
|
-
const { branchId } =
|
|
49043
|
+
const { branchId } = useParams108();
|
|
48695
49044
|
const { currencies } = useWarqadConfig();
|
|
48696
49045
|
const { stock } = currencies;
|
|
48697
49046
|
const isEdit = !!id;
|
|
48698
49047
|
const type = "supplier";
|
|
48699
49048
|
const { post, put, isLoading } = useApis_default();
|
|
48700
49049
|
const { isLoading: isLoadingGet, get } = useApis_default();
|
|
48701
|
-
const methods =
|
|
48702
|
-
resolver:
|
|
49050
|
+
const methods = useForm59({
|
|
49051
|
+
resolver: zodResolver58(createAccountSchema3),
|
|
48703
49052
|
defaultValues: {
|
|
48704
49053
|
name: "",
|
|
48705
49054
|
phoneNumber: "",
|
|
@@ -48729,7 +49078,7 @@ function AccountForm3({
|
|
|
48729
49078
|
body: payload
|
|
48730
49079
|
});
|
|
48731
49080
|
}
|
|
48732
|
-
|
|
49081
|
+
message86.success(`${type} ${isEdit ? "updated" : "created"} successfully`);
|
|
48733
49082
|
if (onReload) {
|
|
48734
49083
|
onReload();
|
|
48735
49084
|
}
|
|
@@ -48737,7 +49086,7 @@ function AccountForm3({
|
|
|
48737
49086
|
close();
|
|
48738
49087
|
}
|
|
48739
49088
|
} catch (error) {
|
|
48740
|
-
|
|
49089
|
+
message86.error(error?.message || "Something went wrong");
|
|
48741
49090
|
}
|
|
48742
49091
|
};
|
|
48743
49092
|
const fetches = async () => {
|
|
@@ -48748,33 +49097,33 @@ function AccountForm3({
|
|
|
48748
49097
|
const data = res.data;
|
|
48749
49098
|
methods.reset(data);
|
|
48750
49099
|
} catch (error) {
|
|
48751
|
-
|
|
49100
|
+
message86.error(error?.message || "Something went wrong");
|
|
48752
49101
|
close?.();
|
|
48753
49102
|
}
|
|
48754
49103
|
};
|
|
48755
|
-
|
|
49104
|
+
useEffect115(() => {
|
|
48756
49105
|
if (isEdit) {
|
|
48757
49106
|
fetches();
|
|
48758
49107
|
}
|
|
48759
49108
|
}, [id]);
|
|
48760
|
-
return /* @__PURE__ */
|
|
49109
|
+
return /* @__PURE__ */ jsxs236(
|
|
48761
49110
|
Card,
|
|
48762
49111
|
{
|
|
48763
49112
|
className: "max-w-4xl mx-auto mt-10 relative",
|
|
48764
49113
|
isLoading: isLoadingGet,
|
|
48765
49114
|
loadingText: "Processing...",
|
|
48766
49115
|
children: [
|
|
48767
|
-
/* @__PURE__ */
|
|
48768
|
-
/* @__PURE__ */
|
|
48769
|
-
/* @__PURE__ */
|
|
49116
|
+
/* @__PURE__ */ jsxs236(Card.Header, { children: [
|
|
49117
|
+
/* @__PURE__ */ jsx267(Card.Title, { children: `${isEdit ? "Edit" : "Add"} ${type}` }),
|
|
49118
|
+
/* @__PURE__ */ jsx267(Card.Description, { children: isEdit ? `Update the details for this ${type}` : `Create a new ${type} and add it to your list` })
|
|
48770
49119
|
] }),
|
|
48771
|
-
/* @__PURE__ */
|
|
49120
|
+
/* @__PURE__ */ jsx267(Card.Content, { children: /* @__PURE__ */ jsxs236(
|
|
48772
49121
|
"form",
|
|
48773
49122
|
{
|
|
48774
49123
|
onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
|
|
48775
49124
|
children: [
|
|
48776
|
-
/* @__PURE__ */
|
|
48777
|
-
/* @__PURE__ */
|
|
49125
|
+
/* @__PURE__ */ jsxs236("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
49126
|
+
/* @__PURE__ */ jsx267(
|
|
48778
49127
|
Fields_default.Input,
|
|
48779
49128
|
{
|
|
48780
49129
|
label: "Name",
|
|
@@ -48785,7 +49134,7 @@ function AccountForm3({
|
|
|
48785
49134
|
required: true
|
|
48786
49135
|
}
|
|
48787
49136
|
),
|
|
48788
|
-
/* @__PURE__ */
|
|
49137
|
+
/* @__PURE__ */ jsx267(
|
|
48789
49138
|
Fields_default.PhoneInput,
|
|
48790
49139
|
{
|
|
48791
49140
|
label: "Phone Number",
|
|
@@ -48794,7 +49143,7 @@ function AccountForm3({
|
|
|
48794
49143
|
placeholder: "Enter phone number"
|
|
48795
49144
|
}
|
|
48796
49145
|
),
|
|
48797
|
-
/* @__PURE__ */
|
|
49146
|
+
/* @__PURE__ */ jsx267(
|
|
48798
49147
|
Fields_default.Select,
|
|
48799
49148
|
{
|
|
48800
49149
|
label: "Currency",
|
|
@@ -48805,7 +49154,7 @@ function AccountForm3({
|
|
|
48805
49154
|
}
|
|
48806
49155
|
)
|
|
48807
49156
|
] }),
|
|
48808
|
-
/* @__PURE__ */
|
|
49157
|
+
/* @__PURE__ */ jsx267("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx267(
|
|
48809
49158
|
Button,
|
|
48810
49159
|
{
|
|
48811
49160
|
isLoading,
|
|
@@ -48826,33 +49175,33 @@ function AccountForm3({
|
|
|
48826
49175
|
var AccountForm_default3 = AccountForm3;
|
|
48827
49176
|
|
|
48828
49177
|
// src/components/Transactions/cargoIM/InvoiceForm.tsx
|
|
48829
|
-
import { useEffect as
|
|
48830
|
-
import { useForm as
|
|
48831
|
-
import { zodResolver as
|
|
48832
|
-
import { useParams as
|
|
48833
|
-
import { message as
|
|
48834
|
-
import { Trash2 as
|
|
49178
|
+
import { useEffect as useEffect116, useState as useState115 } from "react";
|
|
49179
|
+
import { useForm as useForm60, useFieldArray as useFieldArray4 } from "react-hook-form";
|
|
49180
|
+
import { zodResolver as zodResolver59 } from "@hookform/resolvers/zod";
|
|
49181
|
+
import { useParams as useParams109 } from "react-router-dom";
|
|
49182
|
+
import { message as message87 } from "antd";
|
|
49183
|
+
import { Trash2 as Trash253, Plus as Plus6 } from "lucide-react";
|
|
48835
49184
|
import dayjs11 from "dayjs";
|
|
48836
|
-
import { jsx as
|
|
49185
|
+
import { jsx as jsx268, jsxs as jsxs237 } from "react/jsx-runtime";
|
|
48837
49186
|
function InvoiceForm2({
|
|
48838
49187
|
onReload,
|
|
48839
49188
|
close,
|
|
48840
49189
|
accountData,
|
|
48841
49190
|
id
|
|
48842
49191
|
}) {
|
|
48843
|
-
const { branchId } =
|
|
48844
|
-
const [ref2, setRef] =
|
|
49192
|
+
const { branchId } = useParams109();
|
|
49193
|
+
const [ref2, setRef] = useState115(void 0);
|
|
48845
49194
|
const { post, isLoading } = useApis_default();
|
|
48846
49195
|
const { get, isLoading: getLoading } = useApis_default();
|
|
48847
49196
|
const { put, isLoading: isLoadingReverse } = useApis_default();
|
|
48848
49197
|
const isEdit = !!id;
|
|
48849
49198
|
const { currencies } = useWarqadConfig();
|
|
48850
49199
|
const { stock: defaultCurrency } = currencies;
|
|
48851
|
-
const [itemName, setItemName] =
|
|
48852
|
-
const [itemQuantity, setItemQuantity] =
|
|
48853
|
-
const [itemPrice, setItemPrice] =
|
|
48854
|
-
const methods =
|
|
48855
|
-
resolver:
|
|
49200
|
+
const [itemName, setItemName] = useState115("");
|
|
49201
|
+
const [itemQuantity, setItemQuantity] = useState115("");
|
|
49202
|
+
const [itemPrice, setItemPrice] = useState115("");
|
|
49203
|
+
const methods = useForm60({
|
|
49204
|
+
resolver: zodResolver59(createInvoiceManagerValidation2),
|
|
48856
49205
|
defaultValues: {
|
|
48857
49206
|
invoices: [],
|
|
48858
49207
|
date: dayjs11().format("DD/MM/YYYY"),
|
|
@@ -48876,27 +49225,27 @@ function InvoiceForm2({
|
|
|
48876
49225
|
});
|
|
48877
49226
|
setRef(data?.ref);
|
|
48878
49227
|
} catch (error) {
|
|
48879
|
-
|
|
49228
|
+
message87.error(error?.message || "Something went wrong");
|
|
48880
49229
|
}
|
|
48881
49230
|
};
|
|
48882
|
-
|
|
49231
|
+
useEffect116(() => {
|
|
48883
49232
|
if (isEdit) {
|
|
48884
49233
|
fetches();
|
|
48885
49234
|
}
|
|
48886
49235
|
}, [isEdit]);
|
|
48887
49236
|
const handleAddItem = () => {
|
|
48888
49237
|
if (!itemName.trim()) {
|
|
48889
|
-
|
|
49238
|
+
message87.error("Item name is required");
|
|
48890
49239
|
return;
|
|
48891
49240
|
}
|
|
48892
49241
|
const qty = Number(itemQuantity);
|
|
48893
49242
|
const price = Number(itemPrice);
|
|
48894
49243
|
if (isNaN(qty) || qty <= 0) {
|
|
48895
|
-
|
|
49244
|
+
message87.error("Quantity must be greater than 0");
|
|
48896
49245
|
return;
|
|
48897
49246
|
}
|
|
48898
49247
|
if (isNaN(price) || price <= 0) {
|
|
48899
|
-
|
|
49248
|
+
message87.error("Price must be greater than 0");
|
|
48900
49249
|
return;
|
|
48901
49250
|
}
|
|
48902
49251
|
append({
|
|
@@ -48910,7 +49259,7 @@ function InvoiceForm2({
|
|
|
48910
49259
|
};
|
|
48911
49260
|
const onSubmit = async (data) => {
|
|
48912
49261
|
if (data.invoices.length === 0) {
|
|
48913
|
-
|
|
49262
|
+
message87.error("Please add at least one item to the invoice");
|
|
48914
49263
|
return;
|
|
48915
49264
|
}
|
|
48916
49265
|
try {
|
|
@@ -48923,13 +49272,13 @@ function InvoiceForm2({
|
|
|
48923
49272
|
url: `/transactions/add${isEdit ? `?ref=${ref2}` : ""}`,
|
|
48924
49273
|
body: payload
|
|
48925
49274
|
});
|
|
48926
|
-
|
|
49275
|
+
message87.success(
|
|
48927
49276
|
isEdit ? "Invoice updated successfully" : "Invoice created successfully"
|
|
48928
49277
|
);
|
|
48929
49278
|
if (onReload) onReload();
|
|
48930
49279
|
if (close) close();
|
|
48931
49280
|
} catch (error) {
|
|
48932
|
-
|
|
49281
|
+
message87.error(error?.message || "Something went wrong");
|
|
48933
49282
|
}
|
|
48934
49283
|
};
|
|
48935
49284
|
const onReverse = async () => {
|
|
@@ -48938,11 +49287,11 @@ function InvoiceForm2({
|
|
|
48938
49287
|
await put({
|
|
48939
49288
|
url: `/transactions/reverse/${id}`
|
|
48940
49289
|
});
|
|
48941
|
-
|
|
49290
|
+
message87.success("Transaction reversed successfully");
|
|
48942
49291
|
if (onReload) onReload();
|
|
48943
49292
|
if (close) close();
|
|
48944
49293
|
} catch (error) {
|
|
48945
|
-
|
|
49294
|
+
message87.error(error?.message || "Something went wrong");
|
|
48946
49295
|
}
|
|
48947
49296
|
};
|
|
48948
49297
|
const handleKeyDown = (e) => {
|
|
@@ -48954,25 +49303,25 @@ function InvoiceForm2({
|
|
|
48954
49303
|
e.preventDefault();
|
|
48955
49304
|
}
|
|
48956
49305
|
};
|
|
48957
|
-
return /* @__PURE__ */
|
|
49306
|
+
return /* @__PURE__ */ jsx268(
|
|
48958
49307
|
Card,
|
|
48959
49308
|
{
|
|
48960
49309
|
isLoading: getLoading,
|
|
48961
49310
|
className: "max-w-4xl mx-auto relative border-0 shadow-none p-0 bg-transparent dark:bg-transparent",
|
|
48962
|
-
children: /* @__PURE__ */
|
|
48963
|
-
/* @__PURE__ */
|
|
48964
|
-
/* @__PURE__ */
|
|
49311
|
+
children: /* @__PURE__ */ jsxs237(Card.Content, { children: [
|
|
49312
|
+
/* @__PURE__ */ jsx268("input", { type: "hidden", ...register("currency") }),
|
|
49313
|
+
/* @__PURE__ */ jsxs237(
|
|
48965
49314
|
"form",
|
|
48966
49315
|
{
|
|
48967
49316
|
onSubmit: handleSubmit(onSubmit),
|
|
48968
49317
|
onKeyDown: handleKeyDown,
|
|
48969
49318
|
className: "space-y-6",
|
|
48970
49319
|
children: [
|
|
48971
|
-
/* @__PURE__ */
|
|
48972
|
-
/* @__PURE__ */
|
|
48973
|
-
/* @__PURE__ */
|
|
48974
|
-
/* @__PURE__ */
|
|
48975
|
-
/* @__PURE__ */
|
|
49320
|
+
/* @__PURE__ */ jsxs237("div", { className: "bg-gray-50 dark:bg-zinc-800/20 p-5 rounded-2xl border border-gray-200 dark:border-zinc-800/60", children: [
|
|
49321
|
+
/* @__PURE__ */ jsx268("h4", { className: "text-xs font-bold text-gray-400 uppercase mb-3 tracking-wider", children: "Add Invoice Item" }),
|
|
49322
|
+
/* @__PURE__ */ jsxs237("div", { className: "flex flex-col md:flex-row gap-4 items-end", children: [
|
|
49323
|
+
/* @__PURE__ */ jsxs237("div", { className: "grid grid-cols-1 sm:grid-cols-2 w-full gap-2", children: [
|
|
49324
|
+
/* @__PURE__ */ jsx268(
|
|
48976
49325
|
Fields_default.Input,
|
|
48977
49326
|
{
|
|
48978
49327
|
label: "Container No",
|
|
@@ -48981,7 +49330,7 @@ function InvoiceForm2({
|
|
|
48981
49330
|
onChange: (val) => setItemName(val)
|
|
48982
49331
|
}
|
|
48983
49332
|
),
|
|
48984
|
-
/* @__PURE__ */
|
|
49333
|
+
/* @__PURE__ */ jsx268(
|
|
48985
49334
|
Fields_default.Input,
|
|
48986
49335
|
{
|
|
48987
49336
|
label: "Cbm",
|
|
@@ -48991,7 +49340,7 @@ function InvoiceForm2({
|
|
|
48991
49340
|
onChange: (val) => setItemQuantity(val)
|
|
48992
49341
|
}
|
|
48993
49342
|
),
|
|
48994
|
-
/* @__PURE__ */
|
|
49343
|
+
/* @__PURE__ */ jsx268(
|
|
48995
49344
|
Fields_default.Input,
|
|
48996
49345
|
{
|
|
48997
49346
|
label: "Price (KES)",
|
|
@@ -49002,7 +49351,7 @@ function InvoiceForm2({
|
|
|
49002
49351
|
}
|
|
49003
49352
|
)
|
|
49004
49353
|
] }),
|
|
49005
|
-
/* @__PURE__ */
|
|
49354
|
+
/* @__PURE__ */ jsxs237(
|
|
49006
49355
|
Button,
|
|
49007
49356
|
{
|
|
49008
49357
|
type: "button",
|
|
@@ -49010,23 +49359,23 @@ function InvoiceForm2({
|
|
|
49010
49359
|
className: "w-full md:w-auto h-10 flex items-center justify-center gap-2 px-4 whitespace-nowrap",
|
|
49011
49360
|
variant: "outline",
|
|
49012
49361
|
children: [
|
|
49013
|
-
/* @__PURE__ */
|
|
49362
|
+
/* @__PURE__ */ jsx268(Plus6, { size: 16 }),
|
|
49014
49363
|
" Add Item"
|
|
49015
49364
|
]
|
|
49016
49365
|
}
|
|
49017
49366
|
)
|
|
49018
49367
|
] })
|
|
49019
49368
|
] }),
|
|
49020
|
-
/* @__PURE__ */
|
|
49021
|
-
/* @__PURE__ */
|
|
49022
|
-
/* @__PURE__ */
|
|
49023
|
-
/* @__PURE__ */
|
|
49024
|
-
/* @__PURE__ */
|
|
49025
|
-
/* @__PURE__ */
|
|
49026
|
-
/* @__PURE__ */
|
|
49027
|
-
/* @__PURE__ */
|
|
49369
|
+
/* @__PURE__ */ jsxs237("div", { children: [
|
|
49370
|
+
/* @__PURE__ */ jsx268("h4", { className: "text-xs font-bold text-gray-400 uppercase mb-3 tracking-wider", children: "Invoice Items List" }),
|
|
49371
|
+
/* @__PURE__ */ jsx268("div", { className: "border border-gray-200 dark:border-zinc-800 rounded-2xl overflow-hidden bg-white dark:bg-gray-900/80", children: /* @__PURE__ */ jsx268("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs237("table", { className: "w-full text-left border-collapse", children: [
|
|
49372
|
+
/* @__PURE__ */ jsx268("thead", { className: "bg-gray-50 dark:bg-zinc-800/40 border-b border-gray-200 dark:border-zinc-800", children: /* @__PURE__ */ jsxs237("tr", { children: [
|
|
49373
|
+
/* @__PURE__ */ jsx268("th", { className: "px-2 sm:px-4 py-1.5 text-[10px] sm:text-xs font-bold uppercase tracking-wider text-gray-500 dark:text-gray-400 w-8 sm:w-12 text-center", children: "#" }),
|
|
49374
|
+
/* @__PURE__ */ jsx268("th", { className: "px-2 sm:px-4 py-1.5 text-[10px] sm:text-xs font-bold uppercase tracking-wider text-gray-500 dark:text-gray-400", children: "Container No" }),
|
|
49375
|
+
/* @__PURE__ */ jsx268("th", { className: "px-2 sm:px-4 py-1.5 text-[10px] sm:text-xs font-bold uppercase tracking-wider text-gray-500 dark:text-gray-400 text-right", children: "total" }),
|
|
49376
|
+
/* @__PURE__ */ jsx268("th", { className: "px-2 sm:px-4 py-1.5 text-[10px] sm:text-xs font-bold uppercase tracking-wider text-gray-500 dark:text-gray-400 text-right w-8 sm:w-12" })
|
|
49028
49377
|
] }) }),
|
|
49029
|
-
/* @__PURE__ */
|
|
49378
|
+
/* @__PURE__ */ jsx268("tbody", { className: "divide-y divide-gray-100 dark:divide-zinc-800", children: fields.length === 0 ? /* @__PURE__ */ jsx268("tr", { children: /* @__PURE__ */ jsx268(
|
|
49030
49379
|
"td",
|
|
49031
49380
|
{
|
|
49032
49381
|
colSpan: 4,
|
|
@@ -49035,30 +49384,30 @@ function InvoiceForm2({
|
|
|
49035
49384
|
}
|
|
49036
49385
|
) }) : fields.map((item, index) => {
|
|
49037
49386
|
const total = item.quantity * item.amount;
|
|
49038
|
-
return /* @__PURE__ */
|
|
49387
|
+
return /* @__PURE__ */ jsxs237(
|
|
49039
49388
|
"tr",
|
|
49040
49389
|
{
|
|
49041
49390
|
className: "hover:bg-gray-50/50 dark:hover:bg-zinc-800/10 transition-colors",
|
|
49042
49391
|
children: [
|
|
49043
|
-
/* @__PURE__ */
|
|
49044
|
-
/* @__PURE__ */
|
|
49045
|
-
/* @__PURE__ */
|
|
49046
|
-
/* @__PURE__ */
|
|
49392
|
+
/* @__PURE__ */ jsx268("td", { className: "px-2 sm:px-4 py-1 text-xs sm:text-sm text-gray-400 dark:text-zinc-500 font-semibold text-center", children: index + 1 }),
|
|
49393
|
+
/* @__PURE__ */ jsxs237("td", { className: "px-2 sm:px-4 py-1", children: [
|
|
49394
|
+
/* @__PURE__ */ jsx268("div", { className: "font-bold text-gray-900 dark:text-white text-xs sm:text-sm", children: item.name }),
|
|
49395
|
+
/* @__PURE__ */ jsxs237("div", { className: "text-[10px] sm:text-xs text-gray-400 dark:text-zinc-500 mt-0.5", children: [
|
|
49047
49396
|
item.quantity,
|
|
49048
49397
|
" Cbm @",
|
|
49049
49398
|
" ",
|
|
49050
49399
|
Formats_default.Price(item.amount, "KES")
|
|
49051
49400
|
] })
|
|
49052
49401
|
] }),
|
|
49053
|
-
/* @__PURE__ */
|
|
49054
|
-
/* @__PURE__ */
|
|
49402
|
+
/* @__PURE__ */ jsx268("td", { className: "px-2 sm:px-4 py-1 text-xs sm:text-sm text-right font-semibold text-gray-900 dark:text-white whitespace-nowrap", children: Formats_default.Price(total, "KES") }),
|
|
49403
|
+
/* @__PURE__ */ jsx268("td", { className: "px-2 sm:px-4 py-1 text-xs sm:text-sm text-right", children: /* @__PURE__ */ jsx268(
|
|
49055
49404
|
"button",
|
|
49056
49405
|
{
|
|
49057
49406
|
type: "button",
|
|
49058
49407
|
onClick: () => remove(index),
|
|
49059
49408
|
className: "text-gray-400 hover:text-red-500 transition-colors p-1",
|
|
49060
|
-
children: /* @__PURE__ */
|
|
49061
|
-
|
|
49409
|
+
children: /* @__PURE__ */ jsx268(
|
|
49410
|
+
Trash253,
|
|
49062
49411
|
{
|
|
49063
49412
|
size: 13,
|
|
49064
49413
|
className: "sm:w-3.5 sm:h-3.5 w-3 h-3"
|
|
@@ -49071,8 +49420,8 @@ function InvoiceForm2({
|
|
|
49071
49420
|
item.id
|
|
49072
49421
|
);
|
|
49073
49422
|
}) }),
|
|
49074
|
-
fields.length > 0 && /* @__PURE__ */
|
|
49075
|
-
/* @__PURE__ */
|
|
49423
|
+
fields.length > 0 && /* @__PURE__ */ jsx268("tfoot", { className: "bg-gray-50/50 dark:bg-zinc-800/10 border-t border-gray-200 dark:border-zinc-800", children: /* @__PURE__ */ jsxs237("tr", { children: [
|
|
49424
|
+
/* @__PURE__ */ jsx268(
|
|
49076
49425
|
"td",
|
|
49077
49426
|
{
|
|
49078
49427
|
colSpan: 2,
|
|
@@ -49080,20 +49429,20 @@ function InvoiceForm2({
|
|
|
49080
49429
|
children: "Total"
|
|
49081
49430
|
}
|
|
49082
49431
|
),
|
|
49083
|
-
/* @__PURE__ */
|
|
49432
|
+
/* @__PURE__ */ jsx268("td", { className: "px-2 sm:px-4 py-1.5 text-xs sm:text-sm font-bold text-right text-gray-900 dark:text-white whitespace-nowrap", children: Formats_default.Price(
|
|
49084
49433
|
fields.reduce(
|
|
49085
49434
|
(sum, item) => sum + item.quantity * item.amount,
|
|
49086
49435
|
0
|
|
49087
49436
|
),
|
|
49088
49437
|
"KES"
|
|
49089
49438
|
) }),
|
|
49090
|
-
/* @__PURE__ */
|
|
49439
|
+
/* @__PURE__ */ jsx268("td", {})
|
|
49091
49440
|
] }) })
|
|
49092
49441
|
] }) }) })
|
|
49093
49442
|
] }),
|
|
49094
|
-
/* @__PURE__ */
|
|
49095
|
-
/* @__PURE__ */
|
|
49096
|
-
/* @__PURE__ */
|
|
49443
|
+
/* @__PURE__ */ jsxs237("div", { className: "border-t border-gray-200 dark:border-zinc-800 pt-6", children: [
|
|
49444
|
+
/* @__PURE__ */ jsxs237("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
49445
|
+
/* @__PURE__ */ jsx268(
|
|
49097
49446
|
Fields_default.DateInput,
|
|
49098
49447
|
{
|
|
49099
49448
|
label: "Date",
|
|
@@ -49102,20 +49451,20 @@ function InvoiceForm2({
|
|
|
49102
49451
|
required: true
|
|
49103
49452
|
}
|
|
49104
49453
|
),
|
|
49105
|
-
/* @__PURE__ */
|
|
49454
|
+
/* @__PURE__ */ jsx268(Fields_default.Input, { label: "Currency", value: "KES", disabled: true })
|
|
49106
49455
|
] }),
|
|
49107
|
-
/* @__PURE__ */
|
|
49108
|
-
/* @__PURE__ */
|
|
49456
|
+
/* @__PURE__ */ jsxs237("div", { className: "flex justify-between items-center mt-6", children: [
|
|
49457
|
+
/* @__PURE__ */ jsx268("div", { children: isEdit && /* @__PURE__ */ jsx268(
|
|
49109
49458
|
ConfirmModal,
|
|
49110
49459
|
{
|
|
49111
49460
|
title: "Reverse Transaction",
|
|
49112
|
-
description: /* @__PURE__ */
|
|
49113
|
-
/* @__PURE__ */
|
|
49114
|
-
/* @__PURE__ */
|
|
49461
|
+
description: /* @__PURE__ */ jsxs237("div", { className: "space-y-3 text-left", children: [
|
|
49462
|
+
/* @__PURE__ */ jsx268("p", { children: "Are you sure you want to reverse this transaction?" }),
|
|
49463
|
+
/* @__PURE__ */ jsx268("p", { className: "text-xs text-gray-500 bg-gray-50 dark:bg-zinc-800/50 p-3 rounded-lg border border-gray-100 dark:border-zinc-850 italic", children: '"This action will invalidate the transaction and adjust all linked account balances. This process cannot be undone."' })
|
|
49115
49464
|
] }),
|
|
49116
49465
|
confirmationWord: "delete",
|
|
49117
49466
|
onSubmit: onReverse,
|
|
49118
|
-
children: /* @__PURE__ */
|
|
49467
|
+
children: /* @__PURE__ */ jsx268(
|
|
49119
49468
|
Button,
|
|
49120
49469
|
{
|
|
49121
49470
|
type: "button",
|
|
@@ -49128,8 +49477,8 @@ function InvoiceForm2({
|
|
|
49128
49477
|
)
|
|
49129
49478
|
}
|
|
49130
49479
|
) }),
|
|
49131
|
-
/* @__PURE__ */
|
|
49132
|
-
close && /* @__PURE__ */
|
|
49480
|
+
/* @__PURE__ */ jsxs237("div", { className: "flex justify-end gap-3", children: [
|
|
49481
|
+
close && /* @__PURE__ */ jsx268(
|
|
49133
49482
|
Button,
|
|
49134
49483
|
{
|
|
49135
49484
|
type: "button",
|
|
@@ -49139,7 +49488,7 @@ function InvoiceForm2({
|
|
|
49139
49488
|
children: "Cancel"
|
|
49140
49489
|
}
|
|
49141
49490
|
),
|
|
49142
|
-
/* @__PURE__ */
|
|
49491
|
+
/* @__PURE__ */ jsx268(
|
|
49143
49492
|
Button,
|
|
49144
49493
|
{
|
|
49145
49494
|
isLoading,
|
|
@@ -49163,13 +49512,13 @@ function InvoiceForm2({
|
|
|
49163
49512
|
var InvoiceForm_default2 = InvoiceForm2;
|
|
49164
49513
|
|
|
49165
49514
|
// src/components/Transactions/cargoIM/journalForm.tsx
|
|
49166
|
-
import
|
|
49167
|
-
import { useForm as
|
|
49168
|
-
import { zodResolver as
|
|
49169
|
-
import { useParams as
|
|
49170
|
-
import { message as
|
|
49515
|
+
import React46 from "react";
|
|
49516
|
+
import { useForm as useForm61 } from "react-hook-form";
|
|
49517
|
+
import { zodResolver as zodResolver60 } from "@hookform/resolvers/zod";
|
|
49518
|
+
import { useParams as useParams110 } from "react-router-dom";
|
|
49519
|
+
import { message as message88 } from "antd";
|
|
49171
49520
|
import dayjs12 from "dayjs";
|
|
49172
|
-
import { jsx as
|
|
49521
|
+
import { jsx as jsx269, jsxs as jsxs238 } from "react/jsx-runtime";
|
|
49173
49522
|
function JournalForm5({
|
|
49174
49523
|
onReload,
|
|
49175
49524
|
close,
|
|
@@ -49177,16 +49526,16 @@ function JournalForm5({
|
|
|
49177
49526
|
action = "debit",
|
|
49178
49527
|
id
|
|
49179
49528
|
}) {
|
|
49180
|
-
const { branchId } =
|
|
49529
|
+
const { branchId } = useParams110();
|
|
49181
49530
|
const { currencies } = useWarqadConfig();
|
|
49182
49531
|
const { stock: defaultCurrency } = currencies;
|
|
49183
|
-
const [ref2, setRef] =
|
|
49532
|
+
const [ref2, setRef] = React46.useState(void 0);
|
|
49184
49533
|
const { post, isLoading } = useApis_default();
|
|
49185
49534
|
const { get, isLoading: getLoading } = useApis_default();
|
|
49186
49535
|
const { put, isLoading: isLoadingReverse } = useApis_default();
|
|
49187
49536
|
const isEdit = !!id;
|
|
49188
|
-
const methods =
|
|
49189
|
-
resolver:
|
|
49537
|
+
const methods = useForm61({
|
|
49538
|
+
resolver: zodResolver60(journalSchema5),
|
|
49190
49539
|
defaultValues: {
|
|
49191
49540
|
date: dayjs12().format("DD/MM/YYYY"),
|
|
49192
49541
|
currency: defaultCurrency,
|
|
@@ -49208,10 +49557,10 @@ function JournalForm5({
|
|
|
49208
49557
|
});
|
|
49209
49558
|
setRef(data?.ref);
|
|
49210
49559
|
} catch (error) {
|
|
49211
|
-
|
|
49560
|
+
message88.error(error?.message || "Something went wrong");
|
|
49212
49561
|
}
|
|
49213
49562
|
};
|
|
49214
|
-
|
|
49563
|
+
React46.useEffect(() => {
|
|
49215
49564
|
if (isEdit) {
|
|
49216
49565
|
fetches();
|
|
49217
49566
|
}
|
|
@@ -49229,13 +49578,13 @@ function JournalForm5({
|
|
|
49229
49578
|
url: `/transactions/add${isEdit ? `?ref=${ref2}` : ""}`,
|
|
49230
49579
|
body: payload
|
|
49231
49580
|
});
|
|
49232
|
-
|
|
49581
|
+
message88.success(
|
|
49233
49582
|
isEdit ? "Journal updated successfully" : "Journal saved successfully"
|
|
49234
49583
|
);
|
|
49235
49584
|
if (onReload) onReload();
|
|
49236
49585
|
if (close) close();
|
|
49237
49586
|
} catch (error) {
|
|
49238
|
-
|
|
49587
|
+
message88.error(error?.message || "Something went wrong");
|
|
49239
49588
|
}
|
|
49240
49589
|
};
|
|
49241
49590
|
const onReverse = async () => {
|
|
@@ -49244,11 +49593,11 @@ function JournalForm5({
|
|
|
49244
49593
|
await put({
|
|
49245
49594
|
url: `/transactions/reverse/${id}`
|
|
49246
49595
|
});
|
|
49247
|
-
|
|
49596
|
+
message88.success("Transaction reversed successfully");
|
|
49248
49597
|
if (onReload) onReload();
|
|
49249
49598
|
if (close) close();
|
|
49250
49599
|
} catch (error) {
|
|
49251
|
-
|
|
49600
|
+
message88.error(error?.message || "Something went wrong");
|
|
49252
49601
|
}
|
|
49253
49602
|
};
|
|
49254
49603
|
const handleKeyDown = (e) => {
|
|
@@ -49260,19 +49609,19 @@ function JournalForm5({
|
|
|
49260
49609
|
e.preventDefault();
|
|
49261
49610
|
}
|
|
49262
49611
|
};
|
|
49263
|
-
return /* @__PURE__ */
|
|
49612
|
+
return /* @__PURE__ */ jsx269(
|
|
49264
49613
|
Card,
|
|
49265
49614
|
{
|
|
49266
49615
|
isLoading: getLoading,
|
|
49267
49616
|
className: "max-w-2xl mx-auto relative border-0 shadow-none p-0 bg-transparent dark:bg-transparent",
|
|
49268
|
-
children: /* @__PURE__ */
|
|
49617
|
+
children: /* @__PURE__ */ jsx269(Card.Content, { children: /* @__PURE__ */ jsxs238(
|
|
49269
49618
|
"form",
|
|
49270
49619
|
{
|
|
49271
49620
|
onSubmit: handleSubmit(onSubmit),
|
|
49272
49621
|
onKeyDown: handleKeyDown,
|
|
49273
49622
|
className: "space-y-4",
|
|
49274
49623
|
children: [
|
|
49275
|
-
/* @__PURE__ */
|
|
49624
|
+
/* @__PURE__ */ jsx269(
|
|
49276
49625
|
Fields_default.Input,
|
|
49277
49626
|
{
|
|
49278
49627
|
label: "Description",
|
|
@@ -49283,8 +49632,8 @@ function JournalForm5({
|
|
|
49283
49632
|
placeholder: "Enter description"
|
|
49284
49633
|
}
|
|
49285
49634
|
),
|
|
49286
|
-
/* @__PURE__ */
|
|
49287
|
-
/* @__PURE__ */
|
|
49635
|
+
/* @__PURE__ */ jsxs238("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
49636
|
+
/* @__PURE__ */ jsx269(
|
|
49288
49637
|
Fields_default.DateInput,
|
|
49289
49638
|
{
|
|
49290
49639
|
label: "Date",
|
|
@@ -49293,7 +49642,7 @@ function JournalForm5({
|
|
|
49293
49642
|
required: true
|
|
49294
49643
|
}
|
|
49295
49644
|
),
|
|
49296
|
-
/* @__PURE__ */
|
|
49645
|
+
/* @__PURE__ */ jsx269(
|
|
49297
49646
|
Fields_default.Input,
|
|
49298
49647
|
{
|
|
49299
49648
|
label: "Currency",
|
|
@@ -49303,8 +49652,8 @@ function JournalForm5({
|
|
|
49303
49652
|
}
|
|
49304
49653
|
)
|
|
49305
49654
|
] }),
|
|
49306
|
-
/* @__PURE__ */
|
|
49307
|
-
/* @__PURE__ */
|
|
49655
|
+
/* @__PURE__ */ jsxs238("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
49656
|
+
/* @__PURE__ */ jsx269(
|
|
49308
49657
|
Fields_default.Input,
|
|
49309
49658
|
{
|
|
49310
49659
|
label: "Amount",
|
|
@@ -49315,7 +49664,7 @@ function JournalForm5({
|
|
|
49315
49664
|
placeholder: "0.00"
|
|
49316
49665
|
}
|
|
49317
49666
|
),
|
|
49318
|
-
/* @__PURE__ */
|
|
49667
|
+
/* @__PURE__ */ jsx269(
|
|
49319
49668
|
Fields_default.Select,
|
|
49320
49669
|
{
|
|
49321
49670
|
label: "Action",
|
|
@@ -49329,7 +49678,7 @@ function JournalForm5({
|
|
|
49329
49678
|
}
|
|
49330
49679
|
)
|
|
49331
49680
|
] }),
|
|
49332
|
-
/* @__PURE__ */
|
|
49681
|
+
/* @__PURE__ */ jsx269(
|
|
49333
49682
|
Fields_default.Textarea,
|
|
49334
49683
|
{
|
|
49335
49684
|
label: "Note",
|
|
@@ -49339,18 +49688,18 @@ function JournalForm5({
|
|
|
49339
49688
|
rows: 3
|
|
49340
49689
|
}
|
|
49341
49690
|
),
|
|
49342
|
-
/* @__PURE__ */
|
|
49343
|
-
/* @__PURE__ */
|
|
49691
|
+
/* @__PURE__ */ jsxs238("div", { className: "flex justify-between items-center pt-4 border-t border-gray-100 dark:border-zinc-800", children: [
|
|
49692
|
+
/* @__PURE__ */ jsx269("div", { children: isEdit && /* @__PURE__ */ jsx269(
|
|
49344
49693
|
ConfirmModal,
|
|
49345
49694
|
{
|
|
49346
49695
|
title: "Reverse Transaction",
|
|
49347
|
-
description: /* @__PURE__ */
|
|
49348
|
-
/* @__PURE__ */
|
|
49349
|
-
/* @__PURE__ */
|
|
49696
|
+
description: /* @__PURE__ */ jsxs238("div", { className: "space-y-3 text-left", children: [
|
|
49697
|
+
/* @__PURE__ */ jsx269("p", { children: "Are you sure you want to reverse this transaction?" }),
|
|
49698
|
+
/* @__PURE__ */ jsx269("p", { className: "text-xs text-gray-500 bg-gray-50 dark:bg-zinc-800/50 p-3 rounded-lg border border-gray-100 dark:border-zinc-850 italic", children: '"This action will invalidate the transaction and adjust all linked account balances. This process cannot be undone."' })
|
|
49350
49699
|
] }),
|
|
49351
49700
|
confirmationWord: "delete",
|
|
49352
49701
|
onSubmit: onReverse,
|
|
49353
|
-
children: /* @__PURE__ */
|
|
49702
|
+
children: /* @__PURE__ */ jsx269(
|
|
49354
49703
|
Button,
|
|
49355
49704
|
{
|
|
49356
49705
|
type: "button",
|
|
@@ -49363,8 +49712,8 @@ function JournalForm5({
|
|
|
49363
49712
|
)
|
|
49364
49713
|
}
|
|
49365
49714
|
) }),
|
|
49366
|
-
/* @__PURE__ */
|
|
49367
|
-
close && /* @__PURE__ */
|
|
49715
|
+
/* @__PURE__ */ jsxs238("div", { className: "flex justify-end gap-3", children: [
|
|
49716
|
+
close && /* @__PURE__ */ jsx269(
|
|
49368
49717
|
Button,
|
|
49369
49718
|
{
|
|
49370
49719
|
type: "button",
|
|
@@ -49374,7 +49723,7 @@ function JournalForm5({
|
|
|
49374
49723
|
children: "Cancel"
|
|
49375
49724
|
}
|
|
49376
49725
|
),
|
|
49377
|
-
/* @__PURE__ */
|
|
49726
|
+
/* @__PURE__ */ jsx269(
|
|
49378
49727
|
Button,
|
|
49379
49728
|
{
|
|
49380
49729
|
isLoading,
|
|
@@ -49396,15 +49745,15 @@ function JournalForm5({
|
|
|
49396
49745
|
var journalForm_default2 = JournalForm5;
|
|
49397
49746
|
|
|
49398
49747
|
// src/components/Transactions/cargoIM/CargoIM.tsx
|
|
49399
|
-
import { Fragment as
|
|
49748
|
+
import { Fragment as Fragment135, jsx as jsx270, jsxs as jsxs239 } from "react/jsx-runtime";
|
|
49400
49749
|
function CargoIM({ v, url }) {
|
|
49401
|
-
const { branchId } =
|
|
49750
|
+
const { branchId } = useParams111();
|
|
49402
49751
|
const { apiConfig } = useWarqadConfig();
|
|
49403
49752
|
const { width } = useMediaSize();
|
|
49404
49753
|
const isLargeScreen = width > 768;
|
|
49405
|
-
const navigate =
|
|
49754
|
+
const navigate = useNavigate65();
|
|
49406
49755
|
const type = "supplier";
|
|
49407
|
-
const [deleteAccount, setDeleteAccount] =
|
|
49756
|
+
const [deleteAccount, setDeleteAccount] = useState116(null);
|
|
49408
49757
|
const { isLoading: isActionLoading, remove } = useApis_default();
|
|
49409
49758
|
const { data, TransactionViewComponent, reload, isLoading } = useTransaction_default({
|
|
49410
49759
|
url: url || `${apiConfig.accountStatementApi}?type=supplier${branchId ? `&branch=${branchId}` : ""}`,
|
|
@@ -49415,17 +49764,17 @@ function CargoIM({ v, url }) {
|
|
|
49415
49764
|
const items = (data2) => [
|
|
49416
49765
|
{
|
|
49417
49766
|
label: `Edit ${type}`,
|
|
49418
|
-
icon: /* @__PURE__ */
|
|
49767
|
+
icon: /* @__PURE__ */ jsx270(FilePenLine43, { size: 16 }),
|
|
49419
49768
|
onClick: () => openState({
|
|
49420
49769
|
type: "Account",
|
|
49421
|
-
content: /* @__PURE__ */
|
|
49770
|
+
content: /* @__PURE__ */ jsx270(AccountForm_default3, { onReload: reload, close, id: data2?._id }),
|
|
49422
49771
|
title: "Account Form",
|
|
49423
49772
|
width: 800
|
|
49424
49773
|
})
|
|
49425
49774
|
},
|
|
49426
49775
|
{
|
|
49427
49776
|
label: `Delete ${type}`,
|
|
49428
|
-
icon: /* @__PURE__ */
|
|
49777
|
+
icon: /* @__PURE__ */ jsx270(Trash254, { className: "text-red-500", size: 16 }),
|
|
49429
49778
|
onClick: () => setDeleteAccount(data2)
|
|
49430
49779
|
}
|
|
49431
49780
|
].filter(Boolean);
|
|
@@ -49436,7 +49785,7 @@ function CargoIM({ v, url }) {
|
|
|
49436
49785
|
className: "w-full",
|
|
49437
49786
|
cell: ({ row }) => {
|
|
49438
49787
|
const account = row.original;
|
|
49439
|
-
return /* @__PURE__ */
|
|
49788
|
+
return /* @__PURE__ */ jsx270(
|
|
49440
49789
|
"span",
|
|
49441
49790
|
{
|
|
49442
49791
|
onClick: () => navigate(`${account?._id}`),
|
|
@@ -49465,8 +49814,8 @@ function CargoIM({ v, url }) {
|
|
|
49465
49814
|
className: "w-px whitespace-nowrap",
|
|
49466
49815
|
cell: ({ row }) => {
|
|
49467
49816
|
const data2 = row.original;
|
|
49468
|
-
return /* @__PURE__ */
|
|
49469
|
-
/* @__PURE__ */
|
|
49817
|
+
return /* @__PURE__ */ jsxs239("div", { className: "flex gap-4 items-center", children: [
|
|
49818
|
+
/* @__PURE__ */ jsx270(
|
|
49470
49819
|
"button",
|
|
49471
49820
|
{
|
|
49472
49821
|
className: "cursor-pointer px-2 py-1 text-white rounded-lg text-xs bg-blue-500",
|
|
@@ -49474,7 +49823,7 @@ function CargoIM({ v, url }) {
|
|
|
49474
49823
|
openState({
|
|
49475
49824
|
type: "credit",
|
|
49476
49825
|
closeOnOverlayClick: false,
|
|
49477
|
-
content: /* @__PURE__ */
|
|
49826
|
+
content: /* @__PURE__ */ jsx270(
|
|
49478
49827
|
InvoiceForm_default2,
|
|
49479
49828
|
{
|
|
49480
49829
|
onReload: reload,
|
|
@@ -49489,7 +49838,7 @@ function CargoIM({ v, url }) {
|
|
|
49489
49838
|
children: "Inv"
|
|
49490
49839
|
}
|
|
49491
49840
|
),
|
|
49492
|
-
/* @__PURE__ */
|
|
49841
|
+
/* @__PURE__ */ jsx270(
|
|
49493
49842
|
"button",
|
|
49494
49843
|
{
|
|
49495
49844
|
className: "cursor-pointer px-2 py-1 text-white rounded-lg text-xs bg-red-500",
|
|
@@ -49497,7 +49846,7 @@ function CargoIM({ v, url }) {
|
|
|
49497
49846
|
openState({
|
|
49498
49847
|
type: "debit",
|
|
49499
49848
|
closeOnOverlayClick: false,
|
|
49500
|
-
content: /* @__PURE__ */
|
|
49849
|
+
content: /* @__PURE__ */ jsx270(
|
|
49501
49850
|
journalForm_default2,
|
|
49502
49851
|
{
|
|
49503
49852
|
onReload: reload,
|
|
@@ -49513,14 +49862,14 @@ function CargoIM({ v, url }) {
|
|
|
49513
49862
|
children: "Pay"
|
|
49514
49863
|
}
|
|
49515
49864
|
),
|
|
49516
|
-
/* @__PURE__ */
|
|
49865
|
+
/* @__PURE__ */ jsx270(
|
|
49517
49866
|
Dropdown,
|
|
49518
49867
|
{
|
|
49519
49868
|
className: "cursor-pointer",
|
|
49520
49869
|
width: "w-[150px]",
|
|
49521
49870
|
items: items(data2),
|
|
49522
49871
|
triggerMode: "hover",
|
|
49523
|
-
children: /* @__PURE__ */
|
|
49872
|
+
children: /* @__PURE__ */ jsx270(EllipsisVertical47, {})
|
|
49524
49873
|
}
|
|
49525
49874
|
)
|
|
49526
49875
|
] });
|
|
@@ -49536,17 +49885,17 @@ function CargoIM({ v, url }) {
|
|
|
49536
49885
|
const onDelete = async (id) => {
|
|
49537
49886
|
try {
|
|
49538
49887
|
await remove({ url: `/accounts/delete/${id}` });
|
|
49539
|
-
|
|
49888
|
+
message89.success("Account deleted successfully");
|
|
49540
49889
|
reload();
|
|
49541
49890
|
setDeleteAccount(null);
|
|
49542
49891
|
} catch (error) {
|
|
49543
|
-
|
|
49892
|
+
message89.error(error.message || "Something went wrong");
|
|
49544
49893
|
return error;
|
|
49545
49894
|
}
|
|
49546
49895
|
};
|
|
49547
|
-
return /* @__PURE__ */
|
|
49548
|
-
/* @__PURE__ */
|
|
49549
|
-
/* @__PURE__ */
|
|
49896
|
+
return /* @__PURE__ */ jsxs239(Fragment135, { children: [
|
|
49897
|
+
/* @__PURE__ */ jsx270(Modal2, {}),
|
|
49898
|
+
/* @__PURE__ */ jsx270(
|
|
49550
49899
|
ConfirmModal,
|
|
49551
49900
|
{
|
|
49552
49901
|
isOpen: !!deleteAccount,
|
|
@@ -49559,7 +49908,7 @@ function CargoIM({ v, url }) {
|
|
|
49559
49908
|
children: null
|
|
49560
49909
|
}
|
|
49561
49910
|
),
|
|
49562
|
-
/* @__PURE__ */
|
|
49911
|
+
/* @__PURE__ */ jsx270("div", { className: !isLargeScreen ? "origin-top" : "", children: /* @__PURE__ */ jsx270(
|
|
49563
49912
|
TransactionViewComponent,
|
|
49564
49913
|
{
|
|
49565
49914
|
columns,
|
|
@@ -49570,7 +49919,7 @@ function CargoIM({ v, url }) {
|
|
|
49570
49919
|
onCreate: () => {
|
|
49571
49920
|
openState({
|
|
49572
49921
|
type: "account",
|
|
49573
|
-
content: /* @__PURE__ */
|
|
49922
|
+
content: /* @__PURE__ */ jsx270(AccountForm_default3, { onReload: reload, close }),
|
|
49574
49923
|
title: "Account Form",
|
|
49575
49924
|
width: 800
|
|
49576
49925
|
});
|
|
@@ -49583,8 +49932,8 @@ var CargoIM_default = CargoIM;
|
|
|
49583
49932
|
|
|
49584
49933
|
// src/components/Transactions/cargoIM/cargoIMReport.tsx
|
|
49585
49934
|
import { useSearchParams as useSearchParams20 } from "react-router-dom";
|
|
49586
|
-
import { useMemo as
|
|
49587
|
-
import { Fragment as
|
|
49935
|
+
import { useMemo as useMemo53, useState as useState117, useEffect as useEffect117 } from "react";
|
|
49936
|
+
import { Fragment as Fragment136, jsx as jsx271, jsxs as jsxs240 } from "react/jsx-runtime";
|
|
49588
49937
|
var CargoIMReport = () => {
|
|
49589
49938
|
const { apiConfig, currencies: warqadCurrencies } = useWarqadConfig();
|
|
49590
49939
|
const { TransactionView, openTransaction } = useTransactionView_default();
|
|
@@ -49600,7 +49949,7 @@ var CargoIMReport = () => {
|
|
|
49600
49949
|
const [searchParams, setSearchParams] = useSearchParams20();
|
|
49601
49950
|
const urlCurrency = searchParams.get("currency")?.toUpperCase();
|
|
49602
49951
|
const initialCurrency = urlCurrency && currencyAllowed.includes(urlCurrency) ? urlCurrency : stock;
|
|
49603
|
-
const [currencyFilter, setCurrencyFilter] =
|
|
49952
|
+
const [currencyFilter, setCurrencyFilter] = useState117(initialCurrency);
|
|
49604
49953
|
const handleCurrencyChange = (value) => {
|
|
49605
49954
|
setCurrencyFilter(value);
|
|
49606
49955
|
setSearchParams((prev) => {
|
|
@@ -49608,7 +49957,7 @@ var CargoIMReport = () => {
|
|
|
49608
49957
|
return prev;
|
|
49609
49958
|
});
|
|
49610
49959
|
};
|
|
49611
|
-
|
|
49960
|
+
useEffect117(() => {
|
|
49612
49961
|
if (urlCurrency && currencyAllowed.includes(urlCurrency)) {
|
|
49613
49962
|
setCurrencyFilter(urlCurrency);
|
|
49614
49963
|
}
|
|
@@ -49628,9 +49977,9 @@ var CargoIMReport = () => {
|
|
|
49628
49977
|
header: "Date",
|
|
49629
49978
|
key: "date",
|
|
49630
49979
|
className: "text-xs whitespace-nowrap",
|
|
49631
|
-
render: (row) => /* @__PURE__ */
|
|
49632
|
-
/* @__PURE__ */
|
|
49633
|
-
/* @__PURE__ */
|
|
49980
|
+
render: (row) => /* @__PURE__ */ jsxs240("div", { className: "", children: [
|
|
49981
|
+
/* @__PURE__ */ jsx271("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
|
|
49982
|
+
/* @__PURE__ */ jsx271(
|
|
49634
49983
|
"span",
|
|
49635
49984
|
{
|
|
49636
49985
|
onClick: () => {
|
|
@@ -49649,13 +49998,13 @@ var CargoIMReport = () => {
|
|
|
49649
49998
|
header: "Container No",
|
|
49650
49999
|
key: "description",
|
|
49651
50000
|
className: "text-xs w-full break-words",
|
|
49652
|
-
render: (row) => /* @__PURE__ */
|
|
50001
|
+
render: (row) => /* @__PURE__ */ jsx271("div", { className: "flex flex-col divide-y divide-gray-100 dark:divide-zinc-800/50 print:divide-gray-100", children: (row.lines || []).map((line, idx) => {
|
|
49653
50002
|
const rowId = String(row._id || row.id || row.ref || idx).replace(
|
|
49654
50003
|
/[^a-zA-Z0-9]/g,
|
|
49655
50004
|
""
|
|
49656
50005
|
);
|
|
49657
50006
|
const lineClass = `tx-line-${rowId}-${idx}`;
|
|
49658
|
-
return /* @__PURE__ */
|
|
50007
|
+
return /* @__PURE__ */ jsx271(
|
|
49659
50008
|
"div",
|
|
49660
50009
|
{
|
|
49661
50010
|
className: `${lineClass} min-h-[24px] py-1 flex items-center font-bold capitalize text-black dark:text-white print:text-black whitespace-normal break-words`,
|
|
@@ -49669,13 +50018,13 @@ var CargoIMReport = () => {
|
|
|
49669
50018
|
header: "Cbm",
|
|
49670
50019
|
key: "cbm",
|
|
49671
50020
|
className: "text-xs whitespace-nowrap text-right",
|
|
49672
|
-
render: (row) => /* @__PURE__ */
|
|
50021
|
+
render: (row) => /* @__PURE__ */ jsx271("div", { className: "flex flex-col divide-y divide-gray-100 dark:divide-zinc-800/50 print:divide-gray-100", children: (row.lines || []).map((line, idx) => {
|
|
49673
50022
|
const rowId = String(row._id || row.id || row.ref || idx).replace(
|
|
49674
50023
|
/[^a-zA-Z0-9]/g,
|
|
49675
50024
|
""
|
|
49676
50025
|
);
|
|
49677
50026
|
const lineClass = `tx-line-${rowId}-${idx}`;
|
|
49678
|
-
return /* @__PURE__ */
|
|
50027
|
+
return /* @__PURE__ */ jsx271(
|
|
49679
50028
|
"div",
|
|
49680
50029
|
{
|
|
49681
50030
|
className: `${lineClass} min-h-[24px] py-1 flex items-center justify-end font-bold text-black dark:text-white print:text-black whitespace-nowrap`,
|
|
@@ -49692,20 +50041,20 @@ var CargoIMReport = () => {
|
|
|
49692
50041
|
),
|
|
49693
50042
|
0
|
|
49694
50043
|
);
|
|
49695
|
-
return totalCbm > 0 ? /* @__PURE__ */
|
|
50044
|
+
return totalCbm > 0 ? /* @__PURE__ */ jsx271("span", { className: "font-bold text-black dark:text-white print:text-black", children: totalCbm }) : null;
|
|
49696
50045
|
}
|
|
49697
50046
|
},
|
|
49698
50047
|
{
|
|
49699
50048
|
header: "Price",
|
|
49700
50049
|
key: "price",
|
|
49701
50050
|
className: "text-xs whitespace-nowrap text-right",
|
|
49702
|
-
render: (row) => /* @__PURE__ */
|
|
50051
|
+
render: (row) => /* @__PURE__ */ jsx271("div", { className: "flex flex-col divide-y divide-gray-100 dark:divide-zinc-800/50 print:divide-gray-100", children: (row.lines || []).map((line, idx) => {
|
|
49703
50052
|
const rowId = String(row._id || row.id || row.ref || idx).replace(
|
|
49704
50053
|
/[^a-zA-Z0-9]/g,
|
|
49705
50054
|
""
|
|
49706
50055
|
);
|
|
49707
50056
|
const lineClass = `tx-line-${rowId}-${idx}`;
|
|
49708
|
-
return /* @__PURE__ */
|
|
50057
|
+
return /* @__PURE__ */ jsx271(
|
|
49709
50058
|
"div",
|
|
49710
50059
|
{
|
|
49711
50060
|
className: `${lineClass} min-h-[24px] py-1 flex items-center justify-end font-bold text-black dark:text-white print:text-black whitespace-nowrap`,
|
|
@@ -49719,13 +50068,13 @@ var CargoIMReport = () => {
|
|
|
49719
50068
|
header: "Credit",
|
|
49720
50069
|
key: "credit",
|
|
49721
50070
|
className: "text-xs whitespace-nowrap text-right",
|
|
49722
|
-
render: (row) => /* @__PURE__ */
|
|
50071
|
+
render: (row) => /* @__PURE__ */ jsx271("div", { className: "flex flex-col divide-y divide-gray-100 dark:divide-zinc-800/50 print:divide-gray-100", children: (row.lines || []).map((line, idx) => {
|
|
49723
50072
|
const rowId = String(row._id || row.id || row.ref || idx).replace(
|
|
49724
50073
|
/[^a-zA-Z0-9]/g,
|
|
49725
50074
|
""
|
|
49726
50075
|
);
|
|
49727
50076
|
const lineClass = `tx-line-${rowId}-${idx}`;
|
|
49728
|
-
return /* @__PURE__ */
|
|
50077
|
+
return /* @__PURE__ */ jsx271(
|
|
49729
50078
|
"div",
|
|
49730
50079
|
{
|
|
49731
50080
|
className: `${lineClass} min-h-[24px] py-1 flex items-center justify-end font-bold text-green-500 dark:text-green-500 print:text-green-500 whitespace-nowrap`,
|
|
@@ -49734,7 +50083,7 @@ var CargoIMReport = () => {
|
|
|
49734
50083
|
idx
|
|
49735
50084
|
);
|
|
49736
50085
|
}) }),
|
|
49737
|
-
renderFooter: (data2) => /* @__PURE__ */
|
|
50086
|
+
renderFooter: (data2) => /* @__PURE__ */ jsx271("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
|
|
49738
50087
|
data2.reduce(
|
|
49739
50088
|
(acc, row) => acc + (row.lines || []).reduce(
|
|
49740
50089
|
(lineAcc, line) => lineAcc + (line.type === "credit" ? line.amount : 0),
|
|
@@ -49748,13 +50097,13 @@ var CargoIMReport = () => {
|
|
|
49748
50097
|
header: "Debit",
|
|
49749
50098
|
key: "debit",
|
|
49750
50099
|
className: "text-xs whitespace-nowrap text-right",
|
|
49751
|
-
render: (row) => /* @__PURE__ */
|
|
50100
|
+
render: (row) => /* @__PURE__ */ jsx271("div", { className: "flex flex-col divide-y divide-gray-100 dark:divide-zinc-800/50 print:divide-gray-100", children: (row.lines || []).map((line, idx) => {
|
|
49752
50101
|
const rowId = String(row._id || row.id || row.ref || idx).replace(
|
|
49753
50102
|
/[^a-zA-Z0-9]/g,
|
|
49754
50103
|
""
|
|
49755
50104
|
);
|
|
49756
50105
|
const lineClass = `tx-line-${rowId}-${idx}`;
|
|
49757
|
-
return /* @__PURE__ */
|
|
50106
|
+
return /* @__PURE__ */ jsx271(
|
|
49758
50107
|
"div",
|
|
49759
50108
|
{
|
|
49760
50109
|
className: `${lineClass} min-h-[24px] py-1 flex items-center justify-end font-bold text-red-500 dark:text-red-500 print:text-red-500 whitespace-nowrap`,
|
|
@@ -49763,7 +50112,7 @@ var CargoIMReport = () => {
|
|
|
49763
50112
|
idx
|
|
49764
50113
|
);
|
|
49765
50114
|
}) }),
|
|
49766
|
-
renderFooter: (data2) => /* @__PURE__ */
|
|
50115
|
+
renderFooter: (data2) => /* @__PURE__ */ jsx271("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
|
|
49767
50116
|
data2.reduce(
|
|
49768
50117
|
(acc, row) => acc + (row.lines || []).reduce(
|
|
49769
50118
|
(lineAcc, line) => lineAcc + (line.type === "debit" ? line.amount : 0),
|
|
@@ -49777,14 +50126,14 @@ var CargoIMReport = () => {
|
|
|
49777
50126
|
header: "Balance",
|
|
49778
50127
|
key: "runningBalance",
|
|
49779
50128
|
className: "text-xs whitespace-nowrap text-right",
|
|
49780
|
-
render: (row) => /* @__PURE__ */
|
|
49781
|
-
renderFooter: (data2) => /* @__PURE__ */
|
|
50129
|
+
render: (row) => /* @__PURE__ */ jsx271("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Price(row.runningBalance, currency) }),
|
|
50130
|
+
renderFooter: (data2) => /* @__PURE__ */ jsx271("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
|
|
49782
50131
|
data2.reduce((acc, row) => acc + (row.calculatedAmount || 0), 0),
|
|
49783
50132
|
currency
|
|
49784
50133
|
) })
|
|
49785
50134
|
}
|
|
49786
50135
|
];
|
|
49787
|
-
const datas =
|
|
50136
|
+
const datas = useMemo53(() => {
|
|
49788
50137
|
let runningBalance = 0;
|
|
49789
50138
|
const transactions = data?.data?.transactions;
|
|
49790
50139
|
const res = (transactions || []).map((item) => {
|
|
@@ -49821,10 +50170,10 @@ var CargoIMReport = () => {
|
|
|
49821
50170
|
{ label: "Account Type", value: data?.data?.type },
|
|
49822
50171
|
{ label: "Currency", value: currencyFilter }
|
|
49823
50172
|
];
|
|
49824
|
-
return /* @__PURE__ */
|
|
49825
|
-
/* @__PURE__ */
|
|
49826
|
-
/* @__PURE__ */
|
|
49827
|
-
/* @__PURE__ */
|
|
50173
|
+
return /* @__PURE__ */ jsxs240(Fragment136, { children: [
|
|
50174
|
+
/* @__PURE__ */ jsx271(Modal2, {}),
|
|
50175
|
+
/* @__PURE__ */ jsx271(TransactionView, {}),
|
|
50176
|
+
/* @__PURE__ */ jsx271(
|
|
49828
50177
|
A4DataView,
|
|
49829
50178
|
{
|
|
49830
50179
|
columns,
|
|
@@ -49839,7 +50188,7 @@ var CargoIMReport = () => {
|
|
|
49839
50188
|
openState({
|
|
49840
50189
|
type: "debit",
|
|
49841
50190
|
closeOnOverlayClick: false,
|
|
49842
|
-
content: row.type === "invoice-manager" ? /* @__PURE__ */
|
|
50191
|
+
content: row.type === "invoice-manager" ? /* @__PURE__ */ jsx271(
|
|
49843
50192
|
InvoiceForm_default2,
|
|
49844
50193
|
{
|
|
49845
50194
|
close: closeTransaction,
|
|
@@ -49847,7 +50196,7 @@ var CargoIMReport = () => {
|
|
|
49847
50196
|
onReload: reload,
|
|
49848
50197
|
id: row._id
|
|
49849
50198
|
}
|
|
49850
|
-
) : /* @__PURE__ */
|
|
50199
|
+
) : /* @__PURE__ */ jsx271(
|
|
49851
50200
|
journalForm_default2,
|
|
49852
50201
|
{
|
|
49853
50202
|
close: closeTransaction,
|
|
@@ -49860,7 +50209,7 @@ var CargoIMReport = () => {
|
|
|
49860
50209
|
width: 800
|
|
49861
50210
|
});
|
|
49862
50211
|
},
|
|
49863
|
-
headers: /* @__PURE__ */
|
|
50212
|
+
headers: /* @__PURE__ */ jsx271("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ jsx271(
|
|
49864
50213
|
Fields_default.Select,
|
|
49865
50214
|
{
|
|
49866
50215
|
options: currencies,
|
|
@@ -49876,21 +50225,21 @@ var CargoIMReport = () => {
|
|
|
49876
50225
|
var cargoIMReport_default = CargoIMReport;
|
|
49877
50226
|
|
|
49878
50227
|
// src/components/accounts/forex-2/Forex2Accounts.tsx
|
|
49879
|
-
import { useNavigate as
|
|
50228
|
+
import { useNavigate as useNavigate66, useParams as useParams112 } from "react-router-dom";
|
|
49880
50229
|
import {
|
|
49881
|
-
EllipsisVertical as
|
|
50230
|
+
EllipsisVertical as EllipsisVertical48,
|
|
49882
50231
|
FileChartLine as FileChartLine2,
|
|
49883
|
-
FilePenLine as
|
|
49884
|
-
Trash2 as
|
|
50232
|
+
FilePenLine as FilePenLine44,
|
|
50233
|
+
Trash2 as Trash255
|
|
49885
50234
|
} from "lucide-react";
|
|
49886
|
-
import { useState as
|
|
49887
|
-
import { message as
|
|
49888
|
-
import { Fragment as
|
|
50235
|
+
import { useState as useState118 } from "react";
|
|
50236
|
+
import { message as message90 } from "antd";
|
|
50237
|
+
import { Fragment as Fragment137, jsx as jsx272, jsxs as jsxs241 } from "react/jsx-runtime";
|
|
49889
50238
|
function Forex2Accounts({ v, url }) {
|
|
49890
|
-
const { branchId } =
|
|
49891
|
-
const navigate =
|
|
50239
|
+
const { branchId } = useParams112();
|
|
50240
|
+
const navigate = useNavigate66();
|
|
49892
50241
|
const type = "account";
|
|
49893
|
-
const [deleteAccount, setDeleteAccount] =
|
|
50242
|
+
const [deleteAccount, setDeleteAccount] = useState118(null);
|
|
49894
50243
|
const { isLoading: isActionLoading, remove } = useApis_default();
|
|
49895
50244
|
const { data, TransactionViewComponent, reload, isLoading } = useTransaction_default({
|
|
49896
50245
|
url: url || `/reports/forex-account-report${branchId ? `?branch=${branchId}` : ""}`,
|
|
@@ -49901,22 +50250,22 @@ function Forex2Accounts({ v, url }) {
|
|
|
49901
50250
|
const items = (data2) => [
|
|
49902
50251
|
{
|
|
49903
50252
|
label: `Currency Report`,
|
|
49904
|
-
icon: /* @__PURE__ */
|
|
50253
|
+
icon: /* @__PURE__ */ jsx272(FileChartLine2, { size: 16 }),
|
|
49905
50254
|
onClick: () => navigate(data2?._id)
|
|
49906
50255
|
},
|
|
49907
50256
|
{
|
|
49908
50257
|
label: `Edit ${type}`,
|
|
49909
|
-
icon: /* @__PURE__ */
|
|
50258
|
+
icon: /* @__PURE__ */ jsx272(FilePenLine44, { size: 16 }),
|
|
49910
50259
|
onClick: () => openState({
|
|
49911
50260
|
type: "forex account",
|
|
49912
|
-
content: /* @__PURE__ */
|
|
50261
|
+
content: /* @__PURE__ */ jsx272(ForexAccountForm_default, { close, reloads: reload, id: data2?._id }),
|
|
49913
50262
|
title: "Forex Account Form",
|
|
49914
50263
|
width: 800
|
|
49915
50264
|
})
|
|
49916
50265
|
},
|
|
49917
50266
|
{
|
|
49918
50267
|
label: `Delete ${type}`,
|
|
49919
|
-
icon: /* @__PURE__ */
|
|
50268
|
+
icon: /* @__PURE__ */ jsx272(Trash255, { className: "text-red-500", size: 16 }),
|
|
49920
50269
|
onClick: () => setDeleteAccount(data2)
|
|
49921
50270
|
}
|
|
49922
50271
|
].filter(Boolean);
|
|
@@ -49926,7 +50275,7 @@ function Forex2Accounts({ v, url }) {
|
|
|
49926
50275
|
header: "Name",
|
|
49927
50276
|
cell: ({ row }) => {
|
|
49928
50277
|
const account = row.original;
|
|
49929
|
-
return /* @__PURE__ */
|
|
50278
|
+
return /* @__PURE__ */ jsx272(
|
|
49930
50279
|
"span",
|
|
49931
50280
|
{
|
|
49932
50281
|
onClick: () => navigate(`statements/${account?._id}`),
|
|
@@ -49941,7 +50290,7 @@ function Forex2Accounts({ v, url }) {
|
|
|
49941
50290
|
header: "Phone",
|
|
49942
50291
|
cell: ({ row }) => {
|
|
49943
50292
|
const account = row.original;
|
|
49944
|
-
return /* @__PURE__ */
|
|
50293
|
+
return /* @__PURE__ */ jsx272("span", { children: account?.phoneNumber || "N/A" });
|
|
49945
50294
|
}
|
|
49946
50295
|
},
|
|
49947
50296
|
{
|
|
@@ -49949,14 +50298,14 @@ function Forex2Accounts({ v, url }) {
|
|
|
49949
50298
|
header: "Balances",
|
|
49950
50299
|
cell: ({ row }) => {
|
|
49951
50300
|
const account = row.original;
|
|
49952
|
-
return /* @__PURE__ */
|
|
49953
|
-
([currency, data2]) => /* @__PURE__ */
|
|
50301
|
+
return /* @__PURE__ */ jsx272("div", { className: "flex flex-wrap items-center gap-2", children: Object.entries(account?.transactions || {}).map(
|
|
50302
|
+
([currency, data2]) => /* @__PURE__ */ jsxs241(
|
|
49954
50303
|
"div",
|
|
49955
50304
|
{
|
|
49956
50305
|
className: "flex items-center gap-1.5 px-2 py-0.5 rounded-lg bg-gray-50 dark:bg-gray-800/50 border border-gray-100 dark:border-gray-700",
|
|
49957
50306
|
children: [
|
|
49958
|
-
/* @__PURE__ */
|
|
49959
|
-
/* @__PURE__ */
|
|
50307
|
+
/* @__PURE__ */ jsx272("span", { className: "text-[12px] font-bold text-gray-400 dark:text-gray-500 uppercase tracking-tighter", children: currency }),
|
|
50308
|
+
/* @__PURE__ */ jsx272(
|
|
49960
50309
|
"span",
|
|
49961
50310
|
{
|
|
49962
50311
|
className: `text-[12px] font-bold tabular-nums ${data2.balance < 0 ? "text-red-500" : "text-green-600 dark:text-green-500"}`,
|
|
@@ -49975,8 +50324,8 @@ function Forex2Accounts({ v, url }) {
|
|
|
49975
50324
|
header: "Actions",
|
|
49976
50325
|
cell: ({ row }) => {
|
|
49977
50326
|
const data2 = row.original;
|
|
49978
|
-
return /* @__PURE__ */
|
|
49979
|
-
/* @__PURE__ */
|
|
50327
|
+
return /* @__PURE__ */ jsxs241("div", { className: "flex gap-4 items-center", children: [
|
|
50328
|
+
/* @__PURE__ */ jsx272(
|
|
49980
50329
|
"button",
|
|
49981
50330
|
{
|
|
49982
50331
|
className: "cursor-pointer px-2 py-1 text-white rounded-lg text-xs bg-blue-500",
|
|
@@ -49984,7 +50333,7 @@ function Forex2Accounts({ v, url }) {
|
|
|
49984
50333
|
openState({
|
|
49985
50334
|
type: "credit",
|
|
49986
50335
|
closeOnOverlayClick: false,
|
|
49987
|
-
content: /* @__PURE__ */
|
|
50336
|
+
content: /* @__PURE__ */ jsx272(
|
|
49988
50337
|
Forex2FormTransaction_default,
|
|
49989
50338
|
{
|
|
49990
50339
|
close,
|
|
@@ -50000,7 +50349,7 @@ function Forex2Accounts({ v, url }) {
|
|
|
50000
50349
|
children: "Out"
|
|
50001
50350
|
}
|
|
50002
50351
|
),
|
|
50003
|
-
/* @__PURE__ */
|
|
50352
|
+
/* @__PURE__ */ jsx272(
|
|
50004
50353
|
"button",
|
|
50005
50354
|
{
|
|
50006
50355
|
className: "cursor-pointer px-2 py-1 text-white rounded-lg text-xs bg-red-500",
|
|
@@ -50008,7 +50357,7 @@ function Forex2Accounts({ v, url }) {
|
|
|
50008
50357
|
openState({
|
|
50009
50358
|
type: "debit",
|
|
50010
50359
|
closeOnOverlayClick: false,
|
|
50011
|
-
content: /* @__PURE__ */
|
|
50360
|
+
content: /* @__PURE__ */ jsx272(
|
|
50012
50361
|
Forex2FormTransaction_default,
|
|
50013
50362
|
{
|
|
50014
50363
|
close,
|
|
@@ -50024,13 +50373,13 @@ function Forex2Accounts({ v, url }) {
|
|
|
50024
50373
|
children: "In"
|
|
50025
50374
|
}
|
|
50026
50375
|
),
|
|
50027
|
-
/* @__PURE__ */
|
|
50376
|
+
/* @__PURE__ */ jsx272(
|
|
50028
50377
|
Dropdown,
|
|
50029
50378
|
{
|
|
50030
50379
|
className: "cursor-pointer w-[150px]",
|
|
50031
50380
|
items: items(data2),
|
|
50032
50381
|
triggerMode: "hover",
|
|
50033
|
-
children: /* @__PURE__ */
|
|
50382
|
+
children: /* @__PURE__ */ jsx272(EllipsisVertical48, {})
|
|
50034
50383
|
}
|
|
50035
50384
|
)
|
|
50036
50385
|
] });
|
|
@@ -50041,11 +50390,11 @@ function Forex2Accounts({ v, url }) {
|
|
|
50041
50390
|
const onDelete = async (id) => {
|
|
50042
50391
|
try {
|
|
50043
50392
|
await remove({ url: `/accounts/delete/${id}` });
|
|
50044
|
-
|
|
50393
|
+
message90.success("Account deleted successfully");
|
|
50045
50394
|
reload();
|
|
50046
50395
|
setDeleteAccount(null);
|
|
50047
50396
|
} catch (error) {
|
|
50048
|
-
|
|
50397
|
+
message90.error(error.message || "Something went wrong");
|
|
50049
50398
|
return error;
|
|
50050
50399
|
}
|
|
50051
50400
|
};
|
|
@@ -50069,9 +50418,9 @@ function Forex2Accounts({ v, url }) {
|
|
|
50069
50418
|
};
|
|
50070
50419
|
}).filter((item) => item.debit !== 0 || item.credit !== 0);
|
|
50071
50420
|
console.log(currencies);
|
|
50072
|
-
return /* @__PURE__ */
|
|
50073
|
-
/* @__PURE__ */
|
|
50074
|
-
/* @__PURE__ */
|
|
50421
|
+
return /* @__PURE__ */ jsxs241(Fragment137, { children: [
|
|
50422
|
+
/* @__PURE__ */ jsx272(Modal2, {}),
|
|
50423
|
+
/* @__PURE__ */ jsx272(
|
|
50075
50424
|
ConfirmModal,
|
|
50076
50425
|
{
|
|
50077
50426
|
isOpen: !!deleteAccount,
|
|
@@ -50084,9 +50433,9 @@ function Forex2Accounts({ v, url }) {
|
|
|
50084
50433
|
children: null
|
|
50085
50434
|
}
|
|
50086
50435
|
),
|
|
50087
|
-
/* @__PURE__ */
|
|
50088
|
-
/* @__PURE__ */
|
|
50089
|
-
/* @__PURE__ */
|
|
50436
|
+
/* @__PURE__ */ jsxs241("div", { children: [
|
|
50437
|
+
/* @__PURE__ */ jsx272(ForexAccountSummary_default, { currencies, isLoading }),
|
|
50438
|
+
/* @__PURE__ */ jsx272(
|
|
50090
50439
|
TransactionViewComponent,
|
|
50091
50440
|
{
|
|
50092
50441
|
columns,
|
|
@@ -50098,7 +50447,7 @@ function Forex2Accounts({ v, url }) {
|
|
|
50098
50447
|
onCreate: () => {
|
|
50099
50448
|
openState({
|
|
50100
50449
|
type: "forex account",
|
|
50101
|
-
content: /* @__PURE__ */
|
|
50450
|
+
content: /* @__PURE__ */ jsx272(ForexAccountForm_default, { close, reloads: reload }),
|
|
50102
50451
|
title: "Forex Account Form",
|
|
50103
50452
|
width: 800
|
|
50104
50453
|
});
|
|
@@ -50111,14 +50460,14 @@ function Forex2Accounts({ v, url }) {
|
|
|
50111
50460
|
var Forex2Accounts_default = Forex2Accounts;
|
|
50112
50461
|
|
|
50113
50462
|
// src/components/reports/ProductList.tsx
|
|
50114
|
-
import { useParams as
|
|
50115
|
-
import { Fragment as
|
|
50463
|
+
import { useParams as useParams113 } from "react-router-dom";
|
|
50464
|
+
import { Fragment as Fragment138, jsx as jsx273, jsxs as jsxs242 } from "react/jsx-runtime";
|
|
50116
50465
|
var options9 = [
|
|
50117
50466
|
{ label: "Product", value: "product" },
|
|
50118
50467
|
{ label: "Pack", value: "pack" }
|
|
50119
50468
|
];
|
|
50120
50469
|
var ProductList2 = ({ value = false }) => {
|
|
50121
|
-
const { branchId } =
|
|
50470
|
+
const { branchId } = useParams113();
|
|
50122
50471
|
const { branches } = useAuth_default();
|
|
50123
50472
|
const { TransactionView } = useTransactionView_default();
|
|
50124
50473
|
const { getQuery, setQuery } = useApp_default();
|
|
@@ -50140,7 +50489,7 @@ var ProductList2 = ({ value = false }) => {
|
|
|
50140
50489
|
key: "name",
|
|
50141
50490
|
className: "text-xs whitespace-nowrap",
|
|
50142
50491
|
render: (row) => {
|
|
50143
|
-
return /* @__PURE__ */
|
|
50492
|
+
return /* @__PURE__ */ jsx273("div", { className: "", children: /* @__PURE__ */ jsx273("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.name }) });
|
|
50144
50493
|
}
|
|
50145
50494
|
},
|
|
50146
50495
|
...value ? [
|
|
@@ -50148,14 +50497,14 @@ var ProductList2 = ({ value = false }) => {
|
|
|
50148
50497
|
header: "Cost",
|
|
50149
50498
|
key: "cost",
|
|
50150
50499
|
className: "text-xs whitespace-nowrap text-right",
|
|
50151
|
-
render: (row) => /* @__PURE__ */
|
|
50500
|
+
render: (row) => /* @__PURE__ */ jsx273("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Amount(row.cost, false) })
|
|
50152
50501
|
}
|
|
50153
50502
|
] : []
|
|
50154
50503
|
];
|
|
50155
50504
|
const datas = data?.data || [];
|
|
50156
|
-
return /* @__PURE__ */
|
|
50157
|
-
/* @__PURE__ */
|
|
50158
|
-
/* @__PURE__ */
|
|
50505
|
+
return /* @__PURE__ */ jsxs242(Fragment138, { children: [
|
|
50506
|
+
/* @__PURE__ */ jsx273(TransactionView, {}),
|
|
50507
|
+
/* @__PURE__ */ jsx273(
|
|
50159
50508
|
A4DataView,
|
|
50160
50509
|
{
|
|
50161
50510
|
columns,
|
|
@@ -50166,7 +50515,7 @@ var ProductList2 = ({ value = false }) => {
|
|
|
50166
50515
|
tableTitle: "Stock List",
|
|
50167
50516
|
fixed: false,
|
|
50168
50517
|
startPage: 1e10,
|
|
50169
|
-
headers: /* @__PURE__ */
|
|
50518
|
+
headers: /* @__PURE__ */ jsx273(
|
|
50170
50519
|
Select,
|
|
50171
50520
|
{
|
|
50172
50521
|
options: options9,
|
|
@@ -50277,6 +50626,7 @@ export {
|
|
|
50277
50626
|
posts_default as Posts,
|
|
50278
50627
|
Feilds_default5 as ProductField,
|
|
50279
50628
|
ProductForm_default as ProductForm,
|
|
50629
|
+
ProductImage_default as ProductImage,
|
|
50280
50630
|
ProductList_default as ProductList,
|
|
50281
50631
|
Products_default as Products,
|
|
50282
50632
|
profileAccount_default as ProfileAccount,
|