warqadui 0.0.276 → 0.0.278

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.mjs CHANGED
@@ -48462,7 +48462,8 @@ function ExpenseForm2() {
48462
48462
  amount: 0,
48463
48463
  description: "",
48464
48464
  wallet: "",
48465
- rate: void 0
48465
+ rate: void 0,
48466
+ branch: branchId || void 0
48466
48467
  }
48467
48468
  });
48468
48469
  const { handleSubmit, reset, watch } = methods;
@@ -48646,6 +48647,148 @@ var Expenses32 = {
48646
48647
  };
48647
48648
  var expense_default = Expenses32;
48648
48649
 
48650
+ // src/components/Transactions/3/reports/Expenses3Reports.tsx
48651
+ import { useParams as useParams106 } from "react-router-dom";
48652
+ import { useMemo as useMemo52, useState as useState113 } from "react";
48653
+ import { DatePicker as DatePicker9 } from "antd";
48654
+ import dayjs11 from "dayjs";
48655
+ import { Fragment as Fragment133, jsx as jsx265, jsxs as jsxs234 } from "react/jsx-runtime";
48656
+ var Expenses3Reports = () => {
48657
+ const { branchId } = useParams106();
48658
+ const [startDate, setStartDate] = useState113(null);
48659
+ const [endDate, setEndDate] = useState113(null);
48660
+ const { A4DataView, data } = useA4DataView_default({
48661
+ url: `/transactions/get?type=expense-3${branchId ? `&branch=${branchId}` : ""}`,
48662
+ v: 1
48663
+ // No prefix
48664
+ });
48665
+ const { TransactionView, openTransaction } = useTransactionView_default();
48666
+ const { defaultCurrency } = useWarqadConfig()?.currencies;
48667
+ const columns = [
48668
+ {
48669
+ header: "Date",
48670
+ key: "date",
48671
+ className: "text-xs whitespace-nowrap",
48672
+ render: (row) => /* @__PURE__ */ jsxs234("div", { className: "", children: [
48673
+ /* @__PURE__ */ jsx265("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
48674
+ /* @__PURE__ */ jsx265(
48675
+ "span",
48676
+ {
48677
+ onClick: () => {
48678
+ openTransaction({
48679
+ id: row?._id,
48680
+ type: row?.type
48681
+ });
48682
+ },
48683
+ className: "text-green-400 font-bold text-[8px] hover:underline cursor-pointer print:hidden",
48684
+ children: row?.ref
48685
+ }
48686
+ )
48687
+ ] })
48688
+ },
48689
+ {
48690
+ header: "Description",
48691
+ key: "description",
48692
+ className: "text-xs whitespace-nowrap ",
48693
+ render: (row) => {
48694
+ return /* @__PURE__ */ jsxs234("div", { className: "", children: [
48695
+ /* @__PURE__ */ jsx265("span", { className: "font-bold capitalize text-black dark:text-white print:text-black", children: row.description }),
48696
+ row.note && /* @__PURE__ */ jsx265("span", { className: "font-bold capitalize text-black dark:text-white print:text-black", children: row.note })
48697
+ ] });
48698
+ }
48699
+ },
48700
+ {
48701
+ header: "Amount",
48702
+ key: "changedAmountString",
48703
+ className: "text-xs whitespace-nowrap text-right",
48704
+ render: (row) => /* @__PURE__ */ jsx265("span", { className: "font-bold text-black dark:text-white print:text-black", children: row.changedAmountString }),
48705
+ renderFooter: (data2) => {
48706
+ return /* @__PURE__ */ jsx265("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
48707
+ Math.abs(data2.reduce((acc, row) => acc + row.changedAmount, 0)),
48708
+ defaultCurrency
48709
+ ) });
48710
+ }
48711
+ }
48712
+ ];
48713
+ const datas = useMemo52(() => {
48714
+ let runningBalance = 0;
48715
+ let filteredData = data?.data || [];
48716
+ const mapped = filteredData.map((item) => {
48717
+ const changedAmount = item?.exchange?.amount ? item?.exchange?.amount : item.amount;
48718
+ runningBalance += changedAmount;
48719
+ return {
48720
+ ...item,
48721
+ changedAmountString: Formats_default.Amount(changedAmount, false),
48722
+ changedAmount,
48723
+ runningBalance
48724
+ };
48725
+ });
48726
+ let filtered = mapped;
48727
+ if (startDate) {
48728
+ const startOfDay = startDate.startOf("day");
48729
+ filtered = filtered.filter((tx) => {
48730
+ const rawDate = tx.dateObj || tx.date;
48731
+ if (!rawDate) return false;
48732
+ const txDate = dayjs11(rawDate);
48733
+ return txDate.isAfter(startOfDay) || txDate.isSame(startOfDay);
48734
+ });
48735
+ }
48736
+ if (endDate) {
48737
+ const endOfDay = endDate.endOf("day");
48738
+ filtered = filtered.filter((tx) => {
48739
+ const rawDate = tx.dateObj || tx.date;
48740
+ if (!rawDate) return false;
48741
+ const txDate = dayjs11(rawDate);
48742
+ return txDate.isBefore(endOfDay) || txDate.isSame(endOfDay);
48743
+ });
48744
+ }
48745
+ return filtered;
48746
+ }, [data, startDate, endDate]);
48747
+ return /* @__PURE__ */ jsxs234(Fragment133, { children: [
48748
+ /* @__PURE__ */ jsx265(TransactionView, {}),
48749
+ /* @__PURE__ */ jsx265(
48750
+ A4DataView,
48751
+ {
48752
+ columns,
48753
+ data: datas,
48754
+ index: true,
48755
+ title: `Expenses Report`,
48756
+ subtitle: `All Expenses`,
48757
+ fixed: false,
48758
+ headers: /* @__PURE__ */ jsxs234("div", { className: "flex gap-2 items-center print:hidden flex-wrap", children: [
48759
+ /* @__PURE__ */ jsx265(
48760
+ DatePicker9,
48761
+ {
48762
+ placeholder: "Start Date",
48763
+ onChange: (date) => setStartDate(date),
48764
+ value: startDate,
48765
+ format: "DD/MM/YYYY",
48766
+ className: "min-w-[140px] max-w-[160px]"
48767
+ }
48768
+ ),
48769
+ /* @__PURE__ */ jsx265(
48770
+ DatePicker9,
48771
+ {
48772
+ placeholder: "End Date",
48773
+ onChange: (date) => setEndDate(date),
48774
+ value: endDate,
48775
+ format: "DD/MM/YYYY",
48776
+ className: "min-w-[140px] max-w-[160px]"
48777
+ }
48778
+ )
48779
+ ] })
48780
+ }
48781
+ )
48782
+ ] });
48783
+ };
48784
+ var Expenses3Reports_default = Expenses3Reports;
48785
+
48786
+ // src/components/Transactions/3/reports/index.tsx
48787
+ var Reports3 = {
48788
+ expenses: Expenses3Reports_default
48789
+ };
48790
+ var reports_default = Reports3;
48791
+
48649
48792
  // src/components/Transactions/3/index.ts
48650
48793
  var Transaction3 = {
48651
48794
  Payments: Payments_default3,
@@ -48657,26 +48800,27 @@ var Transaction3 = {
48657
48800
  Purchase3: purchase3_default.List,
48658
48801
  Purchase3Form: purchase3_default.Form,
48659
48802
  Expenses: expense_default.List,
48660
- ExpenseForm: expense_default.Form
48803
+ ExpenseForm: expense_default.Form,
48804
+ Reports: reports_default
48661
48805
  };
48662
48806
  var __default = Transaction3;
48663
48807
 
48664
48808
  // src/components/reports/ItemReport.tsx
48665
- import { useParams as useParams106 } from "react-router-dom";
48809
+ import { useParams as useParams107 } from "react-router-dom";
48666
48810
  import { z as z49 } from "zod";
48667
48811
  import { useForm as useForm58 } from "react-hook-form";
48668
48812
  import { zodResolver as zodResolver57 } from "@hookform/resolvers/zod";
48669
- import { useState as useState113 } from "react";
48813
+ import { useState as useState114 } from "react";
48670
48814
  import { message as message85 } from "antd";
48671
- import { Fragment as Fragment133, jsx as jsx265, jsxs as jsxs234 } from "react/jsx-runtime";
48815
+ import { Fragment as Fragment134, jsx as jsx266, jsxs as jsxs235 } from "react/jsx-runtime";
48672
48816
  var ItemReport = ({
48673
48817
  value = false,
48674
48818
  type
48675
48819
  }) => {
48676
48820
  const { apiConfig } = useWarqadConfig();
48677
- const { branchId } = useParams106();
48821
+ const { branchId } = useParams107();
48678
48822
  const { branches } = useAuth_default();
48679
- const [params, setParams] = useState113({
48823
+ const [params, setParams] = useState114({
48680
48824
  id: "",
48681
48825
  branch: "all"
48682
48826
  });
@@ -48701,9 +48845,9 @@ var ItemReport = ({
48701
48845
  header: "Date",
48702
48846
  key: "date",
48703
48847
  className: "text-xs whitespace-nowrap",
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(
48848
+ render: (row) => /* @__PURE__ */ jsxs235("div", { className: "", children: [
48849
+ /* @__PURE__ */ jsx266("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
48850
+ /* @__PURE__ */ jsx266(
48707
48851
  "span",
48708
48852
  {
48709
48853
  onClick: () => {
@@ -48722,7 +48866,7 @@ var ItemReport = ({
48722
48866
  header: "Description",
48723
48867
  key: "description",
48724
48868
  className: "text-xs whitespace-nowrap",
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 }) })
48869
+ render: (row) => /* @__PURE__ */ jsx266("div", { className: "", children: /* @__PURE__ */ jsx266("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.description }) })
48726
48870
  },
48727
48871
  {
48728
48872
  header: "Quantity",
@@ -48730,7 +48874,7 @@ var ItemReport = ({
48730
48874
  className: "text-xs whitespace-nowrap",
48731
48875
  render: (row) => {
48732
48876
  const Qty = row.quantity;
48733
- return /* @__PURE__ */ jsxs234(
48877
+ return /* @__PURE__ */ jsxs235(
48734
48878
  "div",
48735
48879
  {
48736
48880
  className: `font-bold ${row.line === "add" ? "text-green-500" : row.line === "sub" ? "text-red-500" : "text-black"}`,
@@ -48747,7 +48891,7 @@ var ItemReport = ({
48747
48891
  header: "Balance",
48748
48892
  key: "runningBalance",
48749
48893
  className: "text-xs whitespace-nowrap",
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) }) })
48894
+ render: (row) => /* @__PURE__ */ jsx266("div", { className: "", children: /* @__PURE__ */ jsx266("p", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.XQty(row.runningBalance) }) })
48751
48895
  }
48752
48896
  ];
48753
48897
  let runningBalance = 0;
@@ -48759,10 +48903,10 @@ var ItemReport = ({
48759
48903
  };
48760
48904
  });
48761
48905
  const itemName = datas[0]?.name;
48762
- return /* @__PURE__ */ jsxs234(Fragment133, { children: [
48763
- /* @__PURE__ */ jsx265(Modal2, {}),
48764
- /* @__PURE__ */ jsx265(TransactionView, {}),
48765
- /* @__PURE__ */ jsx265(
48906
+ return /* @__PURE__ */ jsxs235(Fragment134, { children: [
48907
+ /* @__PURE__ */ jsx266(Modal2, {}),
48908
+ /* @__PURE__ */ jsx266(TransactionView, {}),
48909
+ /* @__PURE__ */ jsx266(
48766
48910
  A4DataView,
48767
48911
  {
48768
48912
  columns,
@@ -48773,14 +48917,14 @@ var ItemReport = ({
48773
48917
  tableTitle: `${type} Movement Report`,
48774
48918
  fixed: false,
48775
48919
  error: !id ? "Please select an item" : void 0,
48776
- headers: /* @__PURE__ */ jsx265(
48920
+ headers: /* @__PURE__ */ jsx266(
48777
48921
  Button,
48778
48922
  {
48779
48923
  type: "button",
48780
48924
  size: "sm",
48781
48925
  onClick: () => openState({
48782
48926
  title: "Item Transactions",
48783
- content: /* @__PURE__ */ jsx265(
48927
+ content: /* @__PURE__ */ jsx266(
48784
48928
  ItemReportHeader2,
48785
48929
  {
48786
48930
  type,
@@ -48823,7 +48967,7 @@ function ItemReportHeader2({
48823
48967
  label: b.name,
48824
48968
  value: b._id
48825
48969
  }));
48826
- return /* @__PURE__ */ jsxs234(
48970
+ return /* @__PURE__ */ jsxs235(
48827
48971
  "form",
48828
48972
  {
48829
48973
  className: "space-y-3",
@@ -48841,8 +48985,8 @@ function ItemReportHeader2({
48841
48985
  close();
48842
48986
  }),
48843
48987
  children: [
48844
- /* @__PURE__ */ jsxs234("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-2", children: [
48845
- /* @__PURE__ */ jsx265(
48988
+ /* @__PURE__ */ jsxs235("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-2", children: [
48989
+ /* @__PURE__ */ jsx266(
48846
48990
  Select,
48847
48991
  {
48848
48992
  options: [{ label: "All Branches", value: "all" }, ...branchOptions],
@@ -48850,7 +48994,7 @@ function ItemReportHeader2({
48850
48994
  name: "branch"
48851
48995
  }
48852
48996
  ),
48853
- type === "pack" ? /* @__PURE__ */ jsx265(
48997
+ type === "pack" ? /* @__PURE__ */ jsx266(
48854
48998
  Pack_default.Pack,
48855
48999
  {
48856
49000
  api: "/packs/get",
@@ -48858,7 +49002,7 @@ function ItemReportHeader2({
48858
49002
  form: methods,
48859
49003
  name: "pack"
48860
49004
  }
48861
- ) : /* @__PURE__ */ jsx265(
49005
+ ) : /* @__PURE__ */ jsx266(
48862
49006
  Feilds_default5.Product,
48863
49007
  {
48864
49008
  label: "",
@@ -48869,7 +49013,7 @@ function ItemReportHeader2({
48869
49013
  }
48870
49014
  )
48871
49015
  ] }),
48872
- /* @__PURE__ */ jsx265("div", { className: "flex gap-2 justify-end", children: /* @__PURE__ */ jsx265(Button, { type: "submit", children: "Filter" }) })
49016
+ /* @__PURE__ */ jsx266("div", { className: "flex gap-2 justify-end", children: /* @__PURE__ */ jsx266(Button, { type: "submit", children: "Filter" }) })
48873
49017
  ]
48874
49018
  }
48875
49019
  );
@@ -48877,9 +49021,9 @@ function ItemReportHeader2({
48877
49021
  var ItemReport_default = ItemReport;
48878
49022
 
48879
49023
  // src/components/accounts/LeaseCollection.tsx
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";
49024
+ import { useNavigate as useNavigate64, useParams as useParams108, useSearchParams as useSearchParams19 } from "react-router-dom";
49025
+ import { useMemo as useMemo53, useState as useState115, useEffect as useEffect114 } from "react";
49026
+ import { Fragment as Fragment135, jsx as jsx267, jsxs as jsxs236 } from "react/jsx-runtime";
48883
49027
  var LeaseCollection = ({
48884
49028
  leaseType,
48885
49029
  defaultCurrency = "KES"
@@ -48887,9 +49031,9 @@ var LeaseCollection = ({
48887
49031
  const navigate = useNavigate64();
48888
49032
  const [searchParams] = useSearchParams19();
48889
49033
  const { apiConfig } = useWarqadConfig();
48890
- const { branchId } = useParams107();
49034
+ const { branchId } = useParams108();
48891
49035
  const { branches } = useAuth_default();
48892
- const currentBranch = useMemo52(
49036
+ const currentBranch = useMemo53(
48893
49037
  () => branches?.find((b) => b?._id === branchId),
48894
49038
  [branches, branchId]
48895
49039
  );
@@ -48897,10 +49041,10 @@ var LeaseCollection = ({
48897
49041
  const initialFilter = ["all", "debit", "credit"].includes(urlFilter) ? urlFilter : "all";
48898
49042
  const urlCurrency = searchParams.get("currency")?.toUpperCase();
48899
49043
  const initialCurrency = urlCurrency && Enums_default.currencies.includes(urlCurrency) ? urlCurrency : defaultCurrency;
48900
- const [filter, setFilter] = useState114(
49044
+ const [filter, setFilter] = useState115(
48901
49045
  initialFilter
48902
49046
  );
48903
- const [currencyFilter, setCurrencyFilter] = useState114(initialCurrency);
49047
+ const [currencyFilter, setCurrencyFilter] = useState115(initialCurrency);
48904
49048
  useEffect114(() => {
48905
49049
  if (urlFilter && ["all", "debit", "credit"].includes(urlFilter)) {
48906
49050
  setFilter(urlFilter);
@@ -48925,9 +49069,9 @@ var LeaseCollection = ({
48925
49069
  key: "name",
48926
49070
  className: "text-xs whitespace-nowrap ",
48927
49071
  searchKeys: ["name", "phoneNumber", "unitNames"],
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: [
49072
+ render: (row) => /* @__PURE__ */ jsxs236("div", { className: "space-y-1", children: [
49073
+ /* @__PURE__ */ jsx267("p", { className: "font-bold dark:text-white print:text-black uppercase", children: row.name }),
49074
+ row.unitNames && /* @__PURE__ */ jsxs236("p", { className: "text-[9px]! capitalize", children: [
48931
49075
  "(",
48932
49076
  row.unitNames,
48933
49077
  ")"
@@ -48939,7 +49083,7 @@ var LeaseCollection = ({
48939
49083
  key: "phoneNumber",
48940
49084
  maxWidth: 70,
48941
49085
  render: (row) => {
48942
- return /* @__PURE__ */ jsx266("p", { children: row?.phoneNumber || "N/A" });
49086
+ return /* @__PURE__ */ jsx267("p", { children: row?.phoneNumber || "N/A" });
48943
49087
  }
48944
49088
  },
48945
49089
  // </span>
@@ -48949,11 +49093,11 @@ var LeaseCollection = ({
48949
49093
  className: "text-xs whitespace-nowrap text-right",
48950
49094
  render: (row) => {
48951
49095
  const Amount = row.totalCollectionString;
48952
- return /* @__PURE__ */ jsx266("div", { className: "", children: /* @__PURE__ */ jsx266("p", { className: "font-bold ", children: Amount }) });
49096
+ return /* @__PURE__ */ jsx267("div", { className: "", children: /* @__PURE__ */ jsx267("p", { className: "font-bold ", children: Amount }) });
48953
49097
  },
48954
49098
  renderFooter: (data2) => {
48955
49099
  if (currencyFilter === "all") return;
48956
- return /* @__PURE__ */ jsx266("span", { className: " font-bold", children: Formats_default.Price(
49100
+ return /* @__PURE__ */ jsx267("span", { className: " font-bold", children: Formats_default.Price(
48957
49101
  data2.reduce((acc, row) => acc + row.totalCollection, 0),
48958
49102
  defaultCurrency,
48959
49103
  false
@@ -48961,7 +49105,7 @@ var LeaseCollection = ({
48961
49105
  }
48962
49106
  }
48963
49107
  ];
48964
- const datas = useMemo52(() => {
49108
+ const datas = useMemo53(() => {
48965
49109
  let runningBalance = 0;
48966
49110
  let filteredData = data?.data || [];
48967
49111
  const result = filteredData.map((item) => {
@@ -48974,9 +49118,9 @@ var LeaseCollection = ({
48974
49118
  });
48975
49119
  return result;
48976
49120
  }, [filter, currencyFilter, data]);
48977
- return /* @__PURE__ */ jsxs235(Fragment134, { children: [
48978
- /* @__PURE__ */ jsx266(TransactionView, {}),
48979
- /* @__PURE__ */ jsx266(
49121
+ return /* @__PURE__ */ jsxs236(Fragment135, { children: [
49122
+ /* @__PURE__ */ jsx267(TransactionView, {}),
49123
+ /* @__PURE__ */ jsx267(
48980
49124
  A4DataView,
48981
49125
  {
48982
49126
  columns,
@@ -48986,7 +49130,7 @@ var LeaseCollection = ({
48986
49130
  subtitle: `All Collections`,
48987
49131
  fixed: false,
48988
49132
  startPage: 1e9,
48989
- headers: /* @__PURE__ */ jsx266("div", { className: "flex gap-2" })
49133
+ headers: /* @__PURE__ */ jsx267("div", { className: "flex gap-2" })
48990
49134
  }
48991
49135
  )
48992
49136
  ] });
@@ -48994,9 +49138,9 @@ var LeaseCollection = ({
48994
49138
  var LeaseCollection_default = LeaseCollection;
48995
49139
 
48996
49140
  // src/components/Transactions/cargoIM/CargoIM.tsx
48997
- import { useNavigate as useNavigate65, useParams as useParams111 } from "react-router-dom";
49141
+ import { useNavigate as useNavigate65, useParams as useParams112 } from "react-router-dom";
48998
49142
  import { EllipsisVertical as EllipsisVertical47, FilePenLine as FilePenLine43, Trash2 as Trash254 } from "lucide-react";
48999
- import { useState as useState116 } from "react";
49143
+ import { useState as useState117 } from "react";
49000
49144
  import { message as message89 } from "antd";
49001
49145
 
49002
49146
  // src/components/Transactions/cargoIM/schema.ts
@@ -49033,14 +49177,14 @@ import { useForm as useForm59 } from "react-hook-form";
49033
49177
  import { zodResolver as zodResolver58 } from "@hookform/resolvers/zod";
49034
49178
  import { message as message86 } from "antd";
49035
49179
  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";
49180
+ import { useParams as useParams109 } from "react-router-dom";
49181
+ import { jsx as jsx268, jsxs as jsxs237 } from "react/jsx-runtime";
49038
49182
  function AccountForm3({
49039
49183
  onReload,
49040
49184
  close,
49041
49185
  id
49042
49186
  }) {
49043
- const { branchId } = useParams108();
49187
+ const { branchId } = useParams109();
49044
49188
  const { currencies } = useWarqadConfig();
49045
49189
  const { stock } = currencies;
49046
49190
  const isEdit = !!id;
@@ -49106,24 +49250,24 @@ function AccountForm3({
49106
49250
  fetches();
49107
49251
  }
49108
49252
  }, [id]);
49109
- return /* @__PURE__ */ jsxs236(
49253
+ return /* @__PURE__ */ jsxs237(
49110
49254
  Card,
49111
49255
  {
49112
49256
  className: "max-w-4xl mx-auto mt-10 relative",
49113
49257
  isLoading: isLoadingGet,
49114
49258
  loadingText: "Processing...",
49115
49259
  children: [
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` })
49260
+ /* @__PURE__ */ jsxs237(Card.Header, { children: [
49261
+ /* @__PURE__ */ jsx268(Card.Title, { children: `${isEdit ? "Edit" : "Add"} ${type}` }),
49262
+ /* @__PURE__ */ jsx268(Card.Description, { children: isEdit ? `Update the details for this ${type}` : `Create a new ${type} and add it to your list` })
49119
49263
  ] }),
49120
- /* @__PURE__ */ jsx267(Card.Content, { children: /* @__PURE__ */ jsxs236(
49264
+ /* @__PURE__ */ jsx268(Card.Content, { children: /* @__PURE__ */ jsxs237(
49121
49265
  "form",
49122
49266
  {
49123
49267
  onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
49124
49268
  children: [
49125
- /* @__PURE__ */ jsxs236("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
49126
- /* @__PURE__ */ jsx267(
49269
+ /* @__PURE__ */ jsxs237("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
49270
+ /* @__PURE__ */ jsx268(
49127
49271
  Fields_default.Input,
49128
49272
  {
49129
49273
  label: "Name",
@@ -49134,7 +49278,7 @@ function AccountForm3({
49134
49278
  required: true
49135
49279
  }
49136
49280
  ),
49137
- /* @__PURE__ */ jsx267(
49281
+ /* @__PURE__ */ jsx268(
49138
49282
  Fields_default.PhoneInput,
49139
49283
  {
49140
49284
  label: "Phone Number",
@@ -49143,7 +49287,7 @@ function AccountForm3({
49143
49287
  placeholder: "Enter phone number"
49144
49288
  }
49145
49289
  ),
49146
- /* @__PURE__ */ jsx267(
49290
+ /* @__PURE__ */ jsx268(
49147
49291
  Fields_default.Select,
49148
49292
  {
49149
49293
  label: "Currency",
@@ -49154,7 +49298,7 @@ function AccountForm3({
49154
49298
  }
49155
49299
  )
49156
49300
  ] }),
49157
- /* @__PURE__ */ jsx267("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx267(
49301
+ /* @__PURE__ */ jsx268("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx268(
49158
49302
  Button,
49159
49303
  {
49160
49304
  isLoading,
@@ -49175,36 +49319,36 @@ function AccountForm3({
49175
49319
  var AccountForm_default3 = AccountForm3;
49176
49320
 
49177
49321
  // src/components/Transactions/cargoIM/InvoiceForm.tsx
49178
- import { useEffect as useEffect116, useState as useState115 } from "react";
49322
+ import { useEffect as useEffect116, useState as useState116 } from "react";
49179
49323
  import { useForm as useForm60, useFieldArray as useFieldArray4 } from "react-hook-form";
49180
49324
  import { zodResolver as zodResolver59 } from "@hookform/resolvers/zod";
49181
- import { useParams as useParams109 } from "react-router-dom";
49325
+ import { useParams as useParams110 } from "react-router-dom";
49182
49326
  import { message as message87 } from "antd";
49183
49327
  import { Trash2 as Trash253, Plus as Plus6 } from "lucide-react";
49184
- import dayjs11 from "dayjs";
49185
- import { jsx as jsx268, jsxs as jsxs237 } from "react/jsx-runtime";
49328
+ import dayjs12 from "dayjs";
49329
+ import { jsx as jsx269, jsxs as jsxs238 } from "react/jsx-runtime";
49186
49330
  function InvoiceForm2({
49187
49331
  onReload,
49188
49332
  close,
49189
49333
  accountData,
49190
49334
  id
49191
49335
  }) {
49192
- const { branchId } = useParams109();
49193
- const [ref2, setRef] = useState115(void 0);
49336
+ const { branchId } = useParams110();
49337
+ const [ref2, setRef] = useState116(void 0);
49194
49338
  const { post, isLoading } = useApis_default();
49195
49339
  const { get, isLoading: getLoading } = useApis_default();
49196
49340
  const { put, isLoading: isLoadingReverse } = useApis_default();
49197
49341
  const isEdit = !!id;
49198
49342
  const { currencies } = useWarqadConfig();
49199
49343
  const { stock: defaultCurrency } = currencies;
49200
- const [itemName, setItemName] = useState115("");
49201
- const [itemQuantity, setItemQuantity] = useState115("");
49202
- const [itemPrice, setItemPrice] = useState115("");
49344
+ const [itemName, setItemName] = useState116("");
49345
+ const [itemQuantity, setItemQuantity] = useState116("");
49346
+ const [itemPrice, setItemPrice] = useState116("");
49203
49347
  const methods = useForm60({
49204
49348
  resolver: zodResolver59(createInvoiceManagerValidation2),
49205
49349
  defaultValues: {
49206
49350
  invoices: [],
49207
- date: dayjs11().format("DD/MM/YYYY"),
49351
+ date: dayjs12().format("DD/MM/YYYY"),
49208
49352
  currency: defaultCurrency,
49209
49353
  branch: branchId ? branchId : void 0
49210
49354
  }
@@ -49303,25 +49447,25 @@ function InvoiceForm2({
49303
49447
  e.preventDefault();
49304
49448
  }
49305
49449
  };
49306
- return /* @__PURE__ */ jsx268(
49450
+ return /* @__PURE__ */ jsx269(
49307
49451
  Card,
49308
49452
  {
49309
49453
  isLoading: getLoading,
49310
49454
  className: "max-w-4xl mx-auto relative border-0 shadow-none p-0 bg-transparent dark:bg-transparent",
49311
- children: /* @__PURE__ */ jsxs237(Card.Content, { children: [
49312
- /* @__PURE__ */ jsx268("input", { type: "hidden", ...register("currency") }),
49313
- /* @__PURE__ */ jsxs237(
49455
+ children: /* @__PURE__ */ jsxs238(Card.Content, { children: [
49456
+ /* @__PURE__ */ jsx269("input", { type: "hidden", ...register("currency") }),
49457
+ /* @__PURE__ */ jsxs238(
49314
49458
  "form",
49315
49459
  {
49316
49460
  onSubmit: handleSubmit(onSubmit),
49317
49461
  onKeyDown: handleKeyDown,
49318
49462
  className: "space-y-6",
49319
49463
  children: [
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(
49464
+ /* @__PURE__ */ jsxs238("div", { className: "bg-gray-50 dark:bg-zinc-800/20 p-5 rounded-2xl border border-gray-200 dark:border-zinc-800/60", children: [
49465
+ /* @__PURE__ */ jsx269("h4", { className: "text-xs font-bold text-gray-400 uppercase mb-3 tracking-wider", children: "Add Invoice Item" }),
49466
+ /* @__PURE__ */ jsxs238("div", { className: "flex flex-col md:flex-row gap-4 items-end", children: [
49467
+ /* @__PURE__ */ jsxs238("div", { className: "grid grid-cols-1 sm:grid-cols-2 w-full gap-2", children: [
49468
+ /* @__PURE__ */ jsx269(
49325
49469
  Fields_default.Input,
49326
49470
  {
49327
49471
  label: "Container No",
@@ -49330,7 +49474,7 @@ function InvoiceForm2({
49330
49474
  onChange: (val) => setItemName(val)
49331
49475
  }
49332
49476
  ),
49333
- /* @__PURE__ */ jsx268(
49477
+ /* @__PURE__ */ jsx269(
49334
49478
  Fields_default.Input,
49335
49479
  {
49336
49480
  label: "Cbm",
@@ -49340,7 +49484,7 @@ function InvoiceForm2({
49340
49484
  onChange: (val) => setItemQuantity(val)
49341
49485
  }
49342
49486
  ),
49343
- /* @__PURE__ */ jsx268(
49487
+ /* @__PURE__ */ jsx269(
49344
49488
  Fields_default.Input,
49345
49489
  {
49346
49490
  label: "Price (KES)",
@@ -49351,7 +49495,7 @@ function InvoiceForm2({
49351
49495
  }
49352
49496
  )
49353
49497
  ] }),
49354
- /* @__PURE__ */ jsxs237(
49498
+ /* @__PURE__ */ jsxs238(
49355
49499
  Button,
49356
49500
  {
49357
49501
  type: "button",
@@ -49359,23 +49503,23 @@ function InvoiceForm2({
49359
49503
  className: "w-full md:w-auto h-10 flex items-center justify-center gap-2 px-4 whitespace-nowrap",
49360
49504
  variant: "outline",
49361
49505
  children: [
49362
- /* @__PURE__ */ jsx268(Plus6, { size: 16 }),
49506
+ /* @__PURE__ */ jsx269(Plus6, { size: 16 }),
49363
49507
  " Add Item"
49364
49508
  ]
49365
49509
  }
49366
49510
  )
49367
49511
  ] })
49368
49512
  ] }),
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" })
49513
+ /* @__PURE__ */ jsxs238("div", { children: [
49514
+ /* @__PURE__ */ jsx269("h4", { className: "text-xs font-bold text-gray-400 uppercase mb-3 tracking-wider", children: "Invoice Items List" }),
49515
+ /* @__PURE__ */ jsx269("div", { className: "border border-gray-200 dark:border-zinc-800 rounded-2xl overflow-hidden bg-white dark:bg-gray-900/80", children: /* @__PURE__ */ jsx269("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs238("table", { className: "w-full text-left border-collapse", children: [
49516
+ /* @__PURE__ */ jsx269("thead", { className: "bg-gray-50 dark:bg-zinc-800/40 border-b border-gray-200 dark:border-zinc-800", children: /* @__PURE__ */ jsxs238("tr", { children: [
49517
+ /* @__PURE__ */ jsx269("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: "#" }),
49518
+ /* @__PURE__ */ jsx269("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" }),
49519
+ /* @__PURE__ */ jsx269("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" }),
49520
+ /* @__PURE__ */ jsx269("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" })
49377
49521
  ] }) }),
49378
- /* @__PURE__ */ jsx268("tbody", { className: "divide-y divide-gray-100 dark:divide-zinc-800", children: fields.length === 0 ? /* @__PURE__ */ jsx268("tr", { children: /* @__PURE__ */ jsx268(
49522
+ /* @__PURE__ */ jsx269("tbody", { className: "divide-y divide-gray-100 dark:divide-zinc-800", children: fields.length === 0 ? /* @__PURE__ */ jsx269("tr", { children: /* @__PURE__ */ jsx269(
49379
49523
  "td",
49380
49524
  {
49381
49525
  colSpan: 4,
@@ -49384,29 +49528,29 @@ function InvoiceForm2({
49384
49528
  }
49385
49529
  ) }) : fields.map((item, index) => {
49386
49530
  const total = item.quantity * item.amount;
49387
- return /* @__PURE__ */ jsxs237(
49531
+ return /* @__PURE__ */ jsxs238(
49388
49532
  "tr",
49389
49533
  {
49390
49534
  className: "hover:bg-gray-50/50 dark:hover:bg-zinc-800/10 transition-colors",
49391
49535
  children: [
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: [
49536
+ /* @__PURE__ */ jsx269("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 }),
49537
+ /* @__PURE__ */ jsxs238("td", { className: "px-2 sm:px-4 py-1", children: [
49538
+ /* @__PURE__ */ jsx269("div", { className: "font-bold text-gray-900 dark:text-white text-xs sm:text-sm", children: item.name }),
49539
+ /* @__PURE__ */ jsxs238("div", { className: "text-[10px] sm:text-xs text-gray-400 dark:text-zinc-500 mt-0.5", children: [
49396
49540
  item.quantity,
49397
49541
  " Cbm @",
49398
49542
  " ",
49399
49543
  Formats_default.Price(item.amount, "KES")
49400
49544
  ] })
49401
49545
  ] }),
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(
49546
+ /* @__PURE__ */ jsx269("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") }),
49547
+ /* @__PURE__ */ jsx269("td", { className: "px-2 sm:px-4 py-1 text-xs sm:text-sm text-right", children: /* @__PURE__ */ jsx269(
49404
49548
  "button",
49405
49549
  {
49406
49550
  type: "button",
49407
49551
  onClick: () => remove(index),
49408
49552
  className: "text-gray-400 hover:text-red-500 transition-colors p-1",
49409
- children: /* @__PURE__ */ jsx268(
49553
+ children: /* @__PURE__ */ jsx269(
49410
49554
  Trash253,
49411
49555
  {
49412
49556
  size: 13,
@@ -49420,8 +49564,8 @@ function InvoiceForm2({
49420
49564
  item.id
49421
49565
  );
49422
49566
  }) }),
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(
49567
+ fields.length > 0 && /* @__PURE__ */ jsx269("tfoot", { className: "bg-gray-50/50 dark:bg-zinc-800/10 border-t border-gray-200 dark:border-zinc-800", children: /* @__PURE__ */ jsxs238("tr", { children: [
49568
+ /* @__PURE__ */ jsx269(
49425
49569
  "td",
49426
49570
  {
49427
49571
  colSpan: 2,
@@ -49429,20 +49573,20 @@ function InvoiceForm2({
49429
49573
  children: "Total"
49430
49574
  }
49431
49575
  ),
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(
49576
+ /* @__PURE__ */ jsx269("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(
49433
49577
  fields.reduce(
49434
49578
  (sum, item) => sum + item.quantity * item.amount,
49435
49579
  0
49436
49580
  ),
49437
49581
  "KES"
49438
49582
  ) }),
49439
- /* @__PURE__ */ jsx268("td", {})
49583
+ /* @__PURE__ */ jsx269("td", {})
49440
49584
  ] }) })
49441
49585
  ] }) }) })
49442
49586
  ] }),
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(
49587
+ /* @__PURE__ */ jsxs238("div", { className: "border-t border-gray-200 dark:border-zinc-800 pt-6", children: [
49588
+ /* @__PURE__ */ jsxs238("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
49589
+ /* @__PURE__ */ jsx269(
49446
49590
  Fields_default.DateInput,
49447
49591
  {
49448
49592
  label: "Date",
@@ -49451,20 +49595,20 @@ function InvoiceForm2({
49451
49595
  required: true
49452
49596
  }
49453
49597
  ),
49454
- /* @__PURE__ */ jsx268(Fields_default.Input, { label: "Currency", value: "KES", disabled: true })
49598
+ /* @__PURE__ */ jsx269(Fields_default.Input, { label: "Currency", value: "KES", disabled: true })
49455
49599
  ] }),
49456
- /* @__PURE__ */ jsxs237("div", { className: "flex justify-between items-center mt-6", children: [
49457
- /* @__PURE__ */ jsx268("div", { children: isEdit && /* @__PURE__ */ jsx268(
49600
+ /* @__PURE__ */ jsxs238("div", { className: "flex justify-between items-center mt-6", children: [
49601
+ /* @__PURE__ */ jsx269("div", { children: isEdit && /* @__PURE__ */ jsx269(
49458
49602
  ConfirmModal,
49459
49603
  {
49460
49604
  title: "Reverse Transaction",
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."' })
49605
+ description: /* @__PURE__ */ jsxs238("div", { className: "space-y-3 text-left", children: [
49606
+ /* @__PURE__ */ jsx269("p", { children: "Are you sure you want to reverse this transaction?" }),
49607
+ /* @__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."' })
49464
49608
  ] }),
49465
49609
  confirmationWord: "delete",
49466
49610
  onSubmit: onReverse,
49467
- children: /* @__PURE__ */ jsx268(
49611
+ children: /* @__PURE__ */ jsx269(
49468
49612
  Button,
49469
49613
  {
49470
49614
  type: "button",
@@ -49477,8 +49621,8 @@ function InvoiceForm2({
49477
49621
  )
49478
49622
  }
49479
49623
  ) }),
49480
- /* @__PURE__ */ jsxs237("div", { className: "flex justify-end gap-3", children: [
49481
- close && /* @__PURE__ */ jsx268(
49624
+ /* @__PURE__ */ jsxs238("div", { className: "flex justify-end gap-3", children: [
49625
+ close && /* @__PURE__ */ jsx269(
49482
49626
  Button,
49483
49627
  {
49484
49628
  type: "button",
@@ -49488,7 +49632,7 @@ function InvoiceForm2({
49488
49632
  children: "Cancel"
49489
49633
  }
49490
49634
  ),
49491
- /* @__PURE__ */ jsx268(
49635
+ /* @__PURE__ */ jsx269(
49492
49636
  Button,
49493
49637
  {
49494
49638
  isLoading,
@@ -49515,10 +49659,10 @@ var InvoiceForm_default2 = InvoiceForm2;
49515
49659
  import React46 from "react";
49516
49660
  import { useForm as useForm61 } from "react-hook-form";
49517
49661
  import { zodResolver as zodResolver60 } from "@hookform/resolvers/zod";
49518
- import { useParams as useParams110 } from "react-router-dom";
49662
+ import { useParams as useParams111 } from "react-router-dom";
49519
49663
  import { message as message88 } from "antd";
49520
- import dayjs12 from "dayjs";
49521
- import { jsx as jsx269, jsxs as jsxs238 } from "react/jsx-runtime";
49664
+ import dayjs13 from "dayjs";
49665
+ import { jsx as jsx270, jsxs as jsxs239 } from "react/jsx-runtime";
49522
49666
  function JournalForm5({
49523
49667
  onReload,
49524
49668
  close,
@@ -49526,7 +49670,7 @@ function JournalForm5({
49526
49670
  action = "debit",
49527
49671
  id
49528
49672
  }) {
49529
- const { branchId } = useParams110();
49673
+ const { branchId } = useParams111();
49530
49674
  const { currencies } = useWarqadConfig();
49531
49675
  const { stock: defaultCurrency } = currencies;
49532
49676
  const [ref2, setRef] = React46.useState(void 0);
@@ -49537,7 +49681,7 @@ function JournalForm5({
49537
49681
  const methods = useForm61({
49538
49682
  resolver: zodResolver60(journalSchema5),
49539
49683
  defaultValues: {
49540
- date: dayjs12().format("DD/MM/YYYY"),
49684
+ date: dayjs13().format("DD/MM/YYYY"),
49541
49685
  currency: defaultCurrency,
49542
49686
  action,
49543
49687
  description: "Payment ",
@@ -49609,19 +49753,19 @@ function JournalForm5({
49609
49753
  e.preventDefault();
49610
49754
  }
49611
49755
  };
49612
- return /* @__PURE__ */ jsx269(
49756
+ return /* @__PURE__ */ jsx270(
49613
49757
  Card,
49614
49758
  {
49615
49759
  isLoading: getLoading,
49616
49760
  className: "max-w-2xl mx-auto relative border-0 shadow-none p-0 bg-transparent dark:bg-transparent",
49617
- children: /* @__PURE__ */ jsx269(Card.Content, { children: /* @__PURE__ */ jsxs238(
49761
+ children: /* @__PURE__ */ jsx270(Card.Content, { children: /* @__PURE__ */ jsxs239(
49618
49762
  "form",
49619
49763
  {
49620
49764
  onSubmit: handleSubmit(onSubmit),
49621
49765
  onKeyDown: handleKeyDown,
49622
49766
  className: "space-y-4",
49623
49767
  children: [
49624
- /* @__PURE__ */ jsx269(
49768
+ /* @__PURE__ */ jsx270(
49625
49769
  Fields_default.Input,
49626
49770
  {
49627
49771
  label: "Description",
@@ -49632,8 +49776,8 @@ function JournalForm5({
49632
49776
  placeholder: "Enter description"
49633
49777
  }
49634
49778
  ),
49635
- /* @__PURE__ */ jsxs238("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
49636
- /* @__PURE__ */ jsx269(
49779
+ /* @__PURE__ */ jsxs239("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
49780
+ /* @__PURE__ */ jsx270(
49637
49781
  Fields_default.DateInput,
49638
49782
  {
49639
49783
  label: "Date",
@@ -49642,7 +49786,7 @@ function JournalForm5({
49642
49786
  required: true
49643
49787
  }
49644
49788
  ),
49645
- /* @__PURE__ */ jsx269(
49789
+ /* @__PURE__ */ jsx270(
49646
49790
  Fields_default.Input,
49647
49791
  {
49648
49792
  label: "Currency",
@@ -49652,8 +49796,8 @@ function JournalForm5({
49652
49796
  }
49653
49797
  )
49654
49798
  ] }),
49655
- /* @__PURE__ */ jsxs238("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
49656
- /* @__PURE__ */ jsx269(
49799
+ /* @__PURE__ */ jsxs239("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
49800
+ /* @__PURE__ */ jsx270(
49657
49801
  Fields_default.Input,
49658
49802
  {
49659
49803
  label: "Amount",
@@ -49664,7 +49808,7 @@ function JournalForm5({
49664
49808
  placeholder: "0.00"
49665
49809
  }
49666
49810
  ),
49667
- /* @__PURE__ */ jsx269(
49811
+ /* @__PURE__ */ jsx270(
49668
49812
  Fields_default.Select,
49669
49813
  {
49670
49814
  label: "Action",
@@ -49678,7 +49822,7 @@ function JournalForm5({
49678
49822
  }
49679
49823
  )
49680
49824
  ] }),
49681
- /* @__PURE__ */ jsx269(
49825
+ /* @__PURE__ */ jsx270(
49682
49826
  Fields_default.Textarea,
49683
49827
  {
49684
49828
  label: "Note",
@@ -49688,18 +49832,18 @@ function JournalForm5({
49688
49832
  rows: 3
49689
49833
  }
49690
49834
  ),
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(
49835
+ /* @__PURE__ */ jsxs239("div", { className: "flex justify-between items-center pt-4 border-t border-gray-100 dark:border-zinc-800", children: [
49836
+ /* @__PURE__ */ jsx270("div", { children: isEdit && /* @__PURE__ */ jsx270(
49693
49837
  ConfirmModal,
49694
49838
  {
49695
49839
  title: "Reverse Transaction",
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."' })
49840
+ description: /* @__PURE__ */ jsxs239("div", { className: "space-y-3 text-left", children: [
49841
+ /* @__PURE__ */ jsx270("p", { children: "Are you sure you want to reverse this transaction?" }),
49842
+ /* @__PURE__ */ jsx270("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."' })
49699
49843
  ] }),
49700
49844
  confirmationWord: "delete",
49701
49845
  onSubmit: onReverse,
49702
- children: /* @__PURE__ */ jsx269(
49846
+ children: /* @__PURE__ */ jsx270(
49703
49847
  Button,
49704
49848
  {
49705
49849
  type: "button",
@@ -49712,8 +49856,8 @@ function JournalForm5({
49712
49856
  )
49713
49857
  }
49714
49858
  ) }),
49715
- /* @__PURE__ */ jsxs238("div", { className: "flex justify-end gap-3", children: [
49716
- close && /* @__PURE__ */ jsx269(
49859
+ /* @__PURE__ */ jsxs239("div", { className: "flex justify-end gap-3", children: [
49860
+ close && /* @__PURE__ */ jsx270(
49717
49861
  Button,
49718
49862
  {
49719
49863
  type: "button",
@@ -49723,7 +49867,7 @@ function JournalForm5({
49723
49867
  children: "Cancel"
49724
49868
  }
49725
49869
  ),
49726
- /* @__PURE__ */ jsx269(
49870
+ /* @__PURE__ */ jsx270(
49727
49871
  Button,
49728
49872
  {
49729
49873
  isLoading,
@@ -49745,15 +49889,15 @@ function JournalForm5({
49745
49889
  var journalForm_default2 = JournalForm5;
49746
49890
 
49747
49891
  // src/components/Transactions/cargoIM/CargoIM.tsx
49748
- import { Fragment as Fragment135, jsx as jsx270, jsxs as jsxs239 } from "react/jsx-runtime";
49892
+ import { Fragment as Fragment136, jsx as jsx271, jsxs as jsxs240 } from "react/jsx-runtime";
49749
49893
  function CargoIM({ v, url }) {
49750
- const { branchId } = useParams111();
49894
+ const { branchId } = useParams112();
49751
49895
  const { apiConfig } = useWarqadConfig();
49752
49896
  const { width } = useMediaSize();
49753
49897
  const isLargeScreen = width > 768;
49754
49898
  const navigate = useNavigate65();
49755
49899
  const type = "supplier";
49756
- const [deleteAccount, setDeleteAccount] = useState116(null);
49900
+ const [deleteAccount, setDeleteAccount] = useState117(null);
49757
49901
  const { isLoading: isActionLoading, remove } = useApis_default();
49758
49902
  const { data, TransactionViewComponent, reload, isLoading } = useTransaction_default({
49759
49903
  url: url || `${apiConfig.accountStatementApi}?type=supplier${branchId ? `&branch=${branchId}` : ""}`,
@@ -49764,17 +49908,17 @@ function CargoIM({ v, url }) {
49764
49908
  const items = (data2) => [
49765
49909
  {
49766
49910
  label: `Edit ${type}`,
49767
- icon: /* @__PURE__ */ jsx270(FilePenLine43, { size: 16 }),
49911
+ icon: /* @__PURE__ */ jsx271(FilePenLine43, { size: 16 }),
49768
49912
  onClick: () => openState({
49769
49913
  type: "Account",
49770
- content: /* @__PURE__ */ jsx270(AccountForm_default3, { onReload: reload, close, id: data2?._id }),
49914
+ content: /* @__PURE__ */ jsx271(AccountForm_default3, { onReload: reload, close, id: data2?._id }),
49771
49915
  title: "Account Form",
49772
49916
  width: 800
49773
49917
  })
49774
49918
  },
49775
49919
  {
49776
49920
  label: `Delete ${type}`,
49777
- icon: /* @__PURE__ */ jsx270(Trash254, { className: "text-red-500", size: 16 }),
49921
+ icon: /* @__PURE__ */ jsx271(Trash254, { className: "text-red-500", size: 16 }),
49778
49922
  onClick: () => setDeleteAccount(data2)
49779
49923
  }
49780
49924
  ].filter(Boolean);
@@ -49785,7 +49929,7 @@ function CargoIM({ v, url }) {
49785
49929
  className: "w-full",
49786
49930
  cell: ({ row }) => {
49787
49931
  const account = row.original;
49788
- return /* @__PURE__ */ jsx270(
49932
+ return /* @__PURE__ */ jsx271(
49789
49933
  "span",
49790
49934
  {
49791
49935
  onClick: () => navigate(`${account?._id}`),
@@ -49814,8 +49958,8 @@ function CargoIM({ v, url }) {
49814
49958
  className: "w-px whitespace-nowrap",
49815
49959
  cell: ({ row }) => {
49816
49960
  const data2 = row.original;
49817
- return /* @__PURE__ */ jsxs239("div", { className: "flex gap-4 items-center", children: [
49818
- /* @__PURE__ */ jsx270(
49961
+ return /* @__PURE__ */ jsxs240("div", { className: "flex gap-4 items-center", children: [
49962
+ /* @__PURE__ */ jsx271(
49819
49963
  "button",
49820
49964
  {
49821
49965
  className: "cursor-pointer px-2 py-1 text-white rounded-lg text-xs bg-blue-500",
@@ -49823,7 +49967,7 @@ function CargoIM({ v, url }) {
49823
49967
  openState({
49824
49968
  type: "credit",
49825
49969
  closeOnOverlayClick: false,
49826
- content: /* @__PURE__ */ jsx270(
49970
+ content: /* @__PURE__ */ jsx271(
49827
49971
  InvoiceForm_default2,
49828
49972
  {
49829
49973
  onReload: reload,
@@ -49838,7 +49982,7 @@ function CargoIM({ v, url }) {
49838
49982
  children: "Inv"
49839
49983
  }
49840
49984
  ),
49841
- /* @__PURE__ */ jsx270(
49985
+ /* @__PURE__ */ jsx271(
49842
49986
  "button",
49843
49987
  {
49844
49988
  className: "cursor-pointer px-2 py-1 text-white rounded-lg text-xs bg-red-500",
@@ -49846,7 +49990,7 @@ function CargoIM({ v, url }) {
49846
49990
  openState({
49847
49991
  type: "debit",
49848
49992
  closeOnOverlayClick: false,
49849
- content: /* @__PURE__ */ jsx270(
49993
+ content: /* @__PURE__ */ jsx271(
49850
49994
  journalForm_default2,
49851
49995
  {
49852
49996
  onReload: reload,
@@ -49862,14 +50006,14 @@ function CargoIM({ v, url }) {
49862
50006
  children: "Pay"
49863
50007
  }
49864
50008
  ),
49865
- /* @__PURE__ */ jsx270(
50009
+ /* @__PURE__ */ jsx271(
49866
50010
  Dropdown,
49867
50011
  {
49868
50012
  className: "cursor-pointer",
49869
50013
  width: "w-[150px]",
49870
50014
  items: items(data2),
49871
50015
  triggerMode: "hover",
49872
- children: /* @__PURE__ */ jsx270(EllipsisVertical47, {})
50016
+ children: /* @__PURE__ */ jsx271(EllipsisVertical47, {})
49873
50017
  }
49874
50018
  )
49875
50019
  ] });
@@ -49893,9 +50037,9 @@ function CargoIM({ v, url }) {
49893
50037
  return error;
49894
50038
  }
49895
50039
  };
49896
- return /* @__PURE__ */ jsxs239(Fragment135, { children: [
49897
- /* @__PURE__ */ jsx270(Modal2, {}),
49898
- /* @__PURE__ */ jsx270(
50040
+ return /* @__PURE__ */ jsxs240(Fragment136, { children: [
50041
+ /* @__PURE__ */ jsx271(Modal2, {}),
50042
+ /* @__PURE__ */ jsx271(
49899
50043
  ConfirmModal,
49900
50044
  {
49901
50045
  isOpen: !!deleteAccount,
@@ -49908,7 +50052,7 @@ function CargoIM({ v, url }) {
49908
50052
  children: null
49909
50053
  }
49910
50054
  ),
49911
- /* @__PURE__ */ jsx270("div", { className: !isLargeScreen ? "origin-top" : "", children: /* @__PURE__ */ jsx270(
50055
+ /* @__PURE__ */ jsx271("div", { className: !isLargeScreen ? "origin-top" : "", children: /* @__PURE__ */ jsx271(
49912
50056
  TransactionViewComponent,
49913
50057
  {
49914
50058
  columns,
@@ -49919,7 +50063,7 @@ function CargoIM({ v, url }) {
49919
50063
  onCreate: () => {
49920
50064
  openState({
49921
50065
  type: "account",
49922
- content: /* @__PURE__ */ jsx270(AccountForm_default3, { onReload: reload, close }),
50066
+ content: /* @__PURE__ */ jsx271(AccountForm_default3, { onReload: reload, close }),
49923
50067
  title: "Account Form",
49924
50068
  width: 800
49925
50069
  });
@@ -49932,8 +50076,8 @@ var CargoIM_default = CargoIM;
49932
50076
 
49933
50077
  // src/components/Transactions/cargoIM/cargoIMReport.tsx
49934
50078
  import { useSearchParams as useSearchParams20 } from "react-router-dom";
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";
50079
+ import { useMemo as useMemo54, useState as useState118, useEffect as useEffect117 } from "react";
50080
+ import { Fragment as Fragment137, jsx as jsx272, jsxs as jsxs241 } from "react/jsx-runtime";
49937
50081
  var CargoIMReport = () => {
49938
50082
  const { apiConfig, currencies: warqadCurrencies } = useWarqadConfig();
49939
50083
  const { TransactionView, openTransaction } = useTransactionView_default();
@@ -49949,7 +50093,7 @@ var CargoIMReport = () => {
49949
50093
  const [searchParams, setSearchParams] = useSearchParams20();
49950
50094
  const urlCurrency = searchParams.get("currency")?.toUpperCase();
49951
50095
  const initialCurrency = urlCurrency && currencyAllowed.includes(urlCurrency) ? urlCurrency : stock;
49952
- const [currencyFilter, setCurrencyFilter] = useState117(initialCurrency);
50096
+ const [currencyFilter, setCurrencyFilter] = useState118(initialCurrency);
49953
50097
  const handleCurrencyChange = (value) => {
49954
50098
  setCurrencyFilter(value);
49955
50099
  setSearchParams((prev) => {
@@ -49977,9 +50121,9 @@ var CargoIMReport = () => {
49977
50121
  header: "Date",
49978
50122
  key: "date",
49979
50123
  className: "text-xs whitespace-nowrap",
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(
50124
+ render: (row) => /* @__PURE__ */ jsxs241("div", { className: "", children: [
50125
+ /* @__PURE__ */ jsx272("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
50126
+ /* @__PURE__ */ jsx272(
49983
50127
  "span",
49984
50128
  {
49985
50129
  onClick: () => {
@@ -49998,13 +50142,13 @@ var CargoIMReport = () => {
49998
50142
  header: "Container No",
49999
50143
  key: "description",
50000
50144
  className: "text-xs w-full break-words",
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) => {
50145
+ render: (row) => /* @__PURE__ */ jsx272("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) => {
50002
50146
  const rowId = String(row._id || row.id || row.ref || idx).replace(
50003
50147
  /[^a-zA-Z0-9]/g,
50004
50148
  ""
50005
50149
  );
50006
50150
  const lineClass = `tx-line-${rowId}-${idx}`;
50007
- return /* @__PURE__ */ jsx271(
50151
+ return /* @__PURE__ */ jsx272(
50008
50152
  "div",
50009
50153
  {
50010
50154
  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`,
@@ -50018,13 +50162,13 @@ var CargoIMReport = () => {
50018
50162
  header: "Cbm",
50019
50163
  key: "cbm",
50020
50164
  className: "text-xs whitespace-nowrap text-right",
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) => {
50165
+ render: (row) => /* @__PURE__ */ jsx272("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) => {
50022
50166
  const rowId = String(row._id || row.id || row.ref || idx).replace(
50023
50167
  /[^a-zA-Z0-9]/g,
50024
50168
  ""
50025
50169
  );
50026
50170
  const lineClass = `tx-line-${rowId}-${idx}`;
50027
- return /* @__PURE__ */ jsx271(
50171
+ return /* @__PURE__ */ jsx272(
50028
50172
  "div",
50029
50173
  {
50030
50174
  className: `${lineClass} min-h-[24px] py-1 flex items-center justify-end font-bold text-black dark:text-white print:text-black whitespace-nowrap`,
@@ -50041,20 +50185,20 @@ var CargoIMReport = () => {
50041
50185
  ),
50042
50186
  0
50043
50187
  );
50044
- return totalCbm > 0 ? /* @__PURE__ */ jsx271("span", { className: "font-bold text-black dark:text-white print:text-black", children: totalCbm }) : null;
50188
+ return totalCbm > 0 ? /* @__PURE__ */ jsx272("span", { className: "font-bold text-black dark:text-white print:text-black", children: totalCbm }) : null;
50045
50189
  }
50046
50190
  },
50047
50191
  {
50048
50192
  header: "Price",
50049
50193
  key: "price",
50050
50194
  className: "text-xs whitespace-nowrap text-right",
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) => {
50195
+ render: (row) => /* @__PURE__ */ jsx272("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) => {
50052
50196
  const rowId = String(row._id || row.id || row.ref || idx).replace(
50053
50197
  /[^a-zA-Z0-9]/g,
50054
50198
  ""
50055
50199
  );
50056
50200
  const lineClass = `tx-line-${rowId}-${idx}`;
50057
- return /* @__PURE__ */ jsx271(
50201
+ return /* @__PURE__ */ jsx272(
50058
50202
  "div",
50059
50203
  {
50060
50204
  className: `${lineClass} min-h-[24px] py-1 flex items-center justify-end font-bold text-black dark:text-white print:text-black whitespace-nowrap`,
@@ -50068,13 +50212,13 @@ var CargoIMReport = () => {
50068
50212
  header: "Credit",
50069
50213
  key: "credit",
50070
50214
  className: "text-xs whitespace-nowrap text-right",
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) => {
50215
+ render: (row) => /* @__PURE__ */ jsx272("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) => {
50072
50216
  const rowId = String(row._id || row.id || row.ref || idx).replace(
50073
50217
  /[^a-zA-Z0-9]/g,
50074
50218
  ""
50075
50219
  );
50076
50220
  const lineClass = `tx-line-${rowId}-${idx}`;
50077
- return /* @__PURE__ */ jsx271(
50221
+ return /* @__PURE__ */ jsx272(
50078
50222
  "div",
50079
50223
  {
50080
50224
  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`,
@@ -50083,7 +50227,7 @@ var CargoIMReport = () => {
50083
50227
  idx
50084
50228
  );
50085
50229
  }) }),
50086
- renderFooter: (data2) => /* @__PURE__ */ jsx271("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
50230
+ renderFooter: (data2) => /* @__PURE__ */ jsx272("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
50087
50231
  data2.reduce(
50088
50232
  (acc, row) => acc + (row.lines || []).reduce(
50089
50233
  (lineAcc, line) => lineAcc + (line.type === "credit" ? line.amount : 0),
@@ -50097,13 +50241,13 @@ var CargoIMReport = () => {
50097
50241
  header: "Debit",
50098
50242
  key: "debit",
50099
50243
  className: "text-xs whitespace-nowrap text-right",
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) => {
50244
+ render: (row) => /* @__PURE__ */ jsx272("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) => {
50101
50245
  const rowId = String(row._id || row.id || row.ref || idx).replace(
50102
50246
  /[^a-zA-Z0-9]/g,
50103
50247
  ""
50104
50248
  );
50105
50249
  const lineClass = `tx-line-${rowId}-${idx}`;
50106
- return /* @__PURE__ */ jsx271(
50250
+ return /* @__PURE__ */ jsx272(
50107
50251
  "div",
50108
50252
  {
50109
50253
  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`,
@@ -50112,7 +50256,7 @@ var CargoIMReport = () => {
50112
50256
  idx
50113
50257
  );
50114
50258
  }) }),
50115
- renderFooter: (data2) => /* @__PURE__ */ jsx271("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
50259
+ renderFooter: (data2) => /* @__PURE__ */ jsx272("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
50116
50260
  data2.reduce(
50117
50261
  (acc, row) => acc + (row.lines || []).reduce(
50118
50262
  (lineAcc, line) => lineAcc + (line.type === "debit" ? line.amount : 0),
@@ -50126,14 +50270,14 @@ var CargoIMReport = () => {
50126
50270
  header: "Balance",
50127
50271
  key: "runningBalance",
50128
50272
  className: "text-xs whitespace-nowrap text-right",
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(
50273
+ render: (row) => /* @__PURE__ */ jsx272("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Price(row.runningBalance, currency) }),
50274
+ renderFooter: (data2) => /* @__PURE__ */ jsx272("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
50131
50275
  data2.reduce((acc, row) => acc + (row.calculatedAmount || 0), 0),
50132
50276
  currency
50133
50277
  ) })
50134
50278
  }
50135
50279
  ];
50136
- const datas = useMemo53(() => {
50280
+ const datas = useMemo54(() => {
50137
50281
  let runningBalance = 0;
50138
50282
  const transactions = data?.data?.transactions;
50139
50283
  const res = (transactions || []).map((item) => {
@@ -50170,10 +50314,10 @@ var CargoIMReport = () => {
50170
50314
  { label: "Account Type", value: data?.data?.type },
50171
50315
  { label: "Currency", value: currencyFilter }
50172
50316
  ];
50173
- return /* @__PURE__ */ jsxs240(Fragment136, { children: [
50174
- /* @__PURE__ */ jsx271(Modal2, {}),
50175
- /* @__PURE__ */ jsx271(TransactionView, {}),
50176
- /* @__PURE__ */ jsx271(
50317
+ return /* @__PURE__ */ jsxs241(Fragment137, { children: [
50318
+ /* @__PURE__ */ jsx272(Modal2, {}),
50319
+ /* @__PURE__ */ jsx272(TransactionView, {}),
50320
+ /* @__PURE__ */ jsx272(
50177
50321
  A4DataView,
50178
50322
  {
50179
50323
  columns,
@@ -50188,7 +50332,7 @@ var CargoIMReport = () => {
50188
50332
  openState({
50189
50333
  type: "debit",
50190
50334
  closeOnOverlayClick: false,
50191
- content: row.type === "invoice-manager" ? /* @__PURE__ */ jsx271(
50335
+ content: row.type === "invoice-manager" ? /* @__PURE__ */ jsx272(
50192
50336
  InvoiceForm_default2,
50193
50337
  {
50194
50338
  close: closeTransaction,
@@ -50196,7 +50340,7 @@ var CargoIMReport = () => {
50196
50340
  onReload: reload,
50197
50341
  id: row._id
50198
50342
  }
50199
- ) : /* @__PURE__ */ jsx271(
50343
+ ) : /* @__PURE__ */ jsx272(
50200
50344
  journalForm_default2,
50201
50345
  {
50202
50346
  close: closeTransaction,
@@ -50209,7 +50353,7 @@ var CargoIMReport = () => {
50209
50353
  width: 800
50210
50354
  });
50211
50355
  },
50212
- headers: /* @__PURE__ */ jsx271("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ jsx271(
50356
+ headers: /* @__PURE__ */ jsx272("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ jsx272(
50213
50357
  Fields_default.Select,
50214
50358
  {
50215
50359
  options: currencies,
@@ -50225,21 +50369,21 @@ var CargoIMReport = () => {
50225
50369
  var cargoIMReport_default = CargoIMReport;
50226
50370
 
50227
50371
  // src/components/accounts/forex-2/Forex2Accounts.tsx
50228
- import { useNavigate as useNavigate66, useParams as useParams112 } from "react-router-dom";
50372
+ import { useNavigate as useNavigate66, useParams as useParams113 } from "react-router-dom";
50229
50373
  import {
50230
50374
  EllipsisVertical as EllipsisVertical48,
50231
50375
  FileChartLine as FileChartLine2,
50232
50376
  FilePenLine as FilePenLine44,
50233
50377
  Trash2 as Trash255
50234
50378
  } from "lucide-react";
50235
- import { useState as useState118 } from "react";
50379
+ import { useState as useState119 } from "react";
50236
50380
  import { message as message90 } from "antd";
50237
- import { Fragment as Fragment137, jsx as jsx272, jsxs as jsxs241 } from "react/jsx-runtime";
50381
+ import { Fragment as Fragment138, jsx as jsx273, jsxs as jsxs242 } from "react/jsx-runtime";
50238
50382
  function Forex2Accounts({ v, url }) {
50239
- const { branchId } = useParams112();
50383
+ const { branchId } = useParams113();
50240
50384
  const navigate = useNavigate66();
50241
50385
  const type = "account";
50242
- const [deleteAccount, setDeleteAccount] = useState118(null);
50386
+ const [deleteAccount, setDeleteAccount] = useState119(null);
50243
50387
  const { isLoading: isActionLoading, remove } = useApis_default();
50244
50388
  const { data, TransactionViewComponent, reload, isLoading } = useTransaction_default({
50245
50389
  url: url || `/reports/forex-account-report${branchId ? `?branch=${branchId}` : ""}`,
@@ -50250,22 +50394,22 @@ function Forex2Accounts({ v, url }) {
50250
50394
  const items = (data2) => [
50251
50395
  {
50252
50396
  label: `Currency Report`,
50253
- icon: /* @__PURE__ */ jsx272(FileChartLine2, { size: 16 }),
50397
+ icon: /* @__PURE__ */ jsx273(FileChartLine2, { size: 16 }),
50254
50398
  onClick: () => navigate(data2?._id)
50255
50399
  },
50256
50400
  {
50257
50401
  label: `Edit ${type}`,
50258
- icon: /* @__PURE__ */ jsx272(FilePenLine44, { size: 16 }),
50402
+ icon: /* @__PURE__ */ jsx273(FilePenLine44, { size: 16 }),
50259
50403
  onClick: () => openState({
50260
50404
  type: "forex account",
50261
- content: /* @__PURE__ */ jsx272(ForexAccountForm_default, { close, reloads: reload, id: data2?._id }),
50405
+ content: /* @__PURE__ */ jsx273(ForexAccountForm_default, { close, reloads: reload, id: data2?._id }),
50262
50406
  title: "Forex Account Form",
50263
50407
  width: 800
50264
50408
  })
50265
50409
  },
50266
50410
  {
50267
50411
  label: `Delete ${type}`,
50268
- icon: /* @__PURE__ */ jsx272(Trash255, { className: "text-red-500", size: 16 }),
50412
+ icon: /* @__PURE__ */ jsx273(Trash255, { className: "text-red-500", size: 16 }),
50269
50413
  onClick: () => setDeleteAccount(data2)
50270
50414
  }
50271
50415
  ].filter(Boolean);
@@ -50275,7 +50419,7 @@ function Forex2Accounts({ v, url }) {
50275
50419
  header: "Name",
50276
50420
  cell: ({ row }) => {
50277
50421
  const account = row.original;
50278
- return /* @__PURE__ */ jsx272(
50422
+ return /* @__PURE__ */ jsx273(
50279
50423
  "span",
50280
50424
  {
50281
50425
  onClick: () => navigate(`statements/${account?._id}`),
@@ -50290,7 +50434,7 @@ function Forex2Accounts({ v, url }) {
50290
50434
  header: "Phone",
50291
50435
  cell: ({ row }) => {
50292
50436
  const account = row.original;
50293
- return /* @__PURE__ */ jsx272("span", { children: account?.phoneNumber || "N/A" });
50437
+ return /* @__PURE__ */ jsx273("span", { children: account?.phoneNumber || "N/A" });
50294
50438
  }
50295
50439
  },
50296
50440
  {
@@ -50298,14 +50442,14 @@ function Forex2Accounts({ v, url }) {
50298
50442
  header: "Balances",
50299
50443
  cell: ({ row }) => {
50300
50444
  const account = row.original;
50301
- return /* @__PURE__ */ jsx272("div", { className: "flex flex-wrap items-center gap-2", children: Object.entries(account?.transactions || {}).map(
50302
- ([currency, data2]) => /* @__PURE__ */ jsxs241(
50445
+ return /* @__PURE__ */ jsx273("div", { className: "flex flex-wrap items-center gap-2", children: Object.entries(account?.transactions || {}).map(
50446
+ ([currency, data2]) => /* @__PURE__ */ jsxs242(
50303
50447
  "div",
50304
50448
  {
50305
50449
  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",
50306
50450
  children: [
50307
- /* @__PURE__ */ jsx272("span", { className: "text-[12px] font-bold text-gray-400 dark:text-gray-500 uppercase tracking-tighter", children: currency }),
50308
- /* @__PURE__ */ jsx272(
50451
+ /* @__PURE__ */ jsx273("span", { className: "text-[12px] font-bold text-gray-400 dark:text-gray-500 uppercase tracking-tighter", children: currency }),
50452
+ /* @__PURE__ */ jsx273(
50309
50453
  "span",
50310
50454
  {
50311
50455
  className: `text-[12px] font-bold tabular-nums ${data2.balance < 0 ? "text-red-500" : "text-green-600 dark:text-green-500"}`,
@@ -50324,8 +50468,8 @@ function Forex2Accounts({ v, url }) {
50324
50468
  header: "Actions",
50325
50469
  cell: ({ row }) => {
50326
50470
  const data2 = row.original;
50327
- return /* @__PURE__ */ jsxs241("div", { className: "flex gap-4 items-center", children: [
50328
- /* @__PURE__ */ jsx272(
50471
+ return /* @__PURE__ */ jsxs242("div", { className: "flex gap-4 items-center", children: [
50472
+ /* @__PURE__ */ jsx273(
50329
50473
  "button",
50330
50474
  {
50331
50475
  className: "cursor-pointer px-2 py-1 text-white rounded-lg text-xs bg-blue-500",
@@ -50333,7 +50477,7 @@ function Forex2Accounts({ v, url }) {
50333
50477
  openState({
50334
50478
  type: "credit",
50335
50479
  closeOnOverlayClick: false,
50336
- content: /* @__PURE__ */ jsx272(
50480
+ content: /* @__PURE__ */ jsx273(
50337
50481
  Forex2FormTransaction_default,
50338
50482
  {
50339
50483
  close,
@@ -50349,7 +50493,7 @@ function Forex2Accounts({ v, url }) {
50349
50493
  children: "Out"
50350
50494
  }
50351
50495
  ),
50352
- /* @__PURE__ */ jsx272(
50496
+ /* @__PURE__ */ jsx273(
50353
50497
  "button",
50354
50498
  {
50355
50499
  className: "cursor-pointer px-2 py-1 text-white rounded-lg text-xs bg-red-500",
@@ -50357,7 +50501,7 @@ function Forex2Accounts({ v, url }) {
50357
50501
  openState({
50358
50502
  type: "debit",
50359
50503
  closeOnOverlayClick: false,
50360
- content: /* @__PURE__ */ jsx272(
50504
+ content: /* @__PURE__ */ jsx273(
50361
50505
  Forex2FormTransaction_default,
50362
50506
  {
50363
50507
  close,
@@ -50373,13 +50517,13 @@ function Forex2Accounts({ v, url }) {
50373
50517
  children: "In"
50374
50518
  }
50375
50519
  ),
50376
- /* @__PURE__ */ jsx272(
50520
+ /* @__PURE__ */ jsx273(
50377
50521
  Dropdown,
50378
50522
  {
50379
50523
  className: "cursor-pointer w-[150px]",
50380
50524
  items: items(data2),
50381
50525
  triggerMode: "hover",
50382
- children: /* @__PURE__ */ jsx272(EllipsisVertical48, {})
50526
+ children: /* @__PURE__ */ jsx273(EllipsisVertical48, {})
50383
50527
  }
50384
50528
  )
50385
50529
  ] });
@@ -50418,9 +50562,9 @@ function Forex2Accounts({ v, url }) {
50418
50562
  };
50419
50563
  }).filter((item) => item.debit !== 0 || item.credit !== 0);
50420
50564
  console.log(currencies);
50421
- return /* @__PURE__ */ jsxs241(Fragment137, { children: [
50422
- /* @__PURE__ */ jsx272(Modal2, {}),
50423
- /* @__PURE__ */ jsx272(
50565
+ return /* @__PURE__ */ jsxs242(Fragment138, { children: [
50566
+ /* @__PURE__ */ jsx273(Modal2, {}),
50567
+ /* @__PURE__ */ jsx273(
50424
50568
  ConfirmModal,
50425
50569
  {
50426
50570
  isOpen: !!deleteAccount,
@@ -50433,9 +50577,9 @@ function Forex2Accounts({ v, url }) {
50433
50577
  children: null
50434
50578
  }
50435
50579
  ),
50436
- /* @__PURE__ */ jsxs241("div", { children: [
50437
- /* @__PURE__ */ jsx272(ForexAccountSummary_default, { currencies, isLoading }),
50438
- /* @__PURE__ */ jsx272(
50580
+ /* @__PURE__ */ jsxs242("div", { children: [
50581
+ /* @__PURE__ */ jsx273(ForexAccountSummary_default, { currencies, isLoading }),
50582
+ /* @__PURE__ */ jsx273(
50439
50583
  TransactionViewComponent,
50440
50584
  {
50441
50585
  columns,
@@ -50447,7 +50591,7 @@ function Forex2Accounts({ v, url }) {
50447
50591
  onCreate: () => {
50448
50592
  openState({
50449
50593
  type: "forex account",
50450
- content: /* @__PURE__ */ jsx272(ForexAccountForm_default, { close, reloads: reload }),
50594
+ content: /* @__PURE__ */ jsx273(ForexAccountForm_default, { close, reloads: reload }),
50451
50595
  title: "Forex Account Form",
50452
50596
  width: 800
50453
50597
  });
@@ -50460,14 +50604,14 @@ function Forex2Accounts({ v, url }) {
50460
50604
  var Forex2Accounts_default = Forex2Accounts;
50461
50605
 
50462
50606
  // src/components/reports/ProductList.tsx
50463
- import { useParams as useParams113 } from "react-router-dom";
50464
- import { Fragment as Fragment138, jsx as jsx273, jsxs as jsxs242 } from "react/jsx-runtime";
50607
+ import { useParams as useParams114 } from "react-router-dom";
50608
+ import { Fragment as Fragment139, jsx as jsx274, jsxs as jsxs243 } from "react/jsx-runtime";
50465
50609
  var options9 = [
50466
50610
  { label: "Product", value: "product" },
50467
50611
  { label: "Pack", value: "pack" }
50468
50612
  ];
50469
50613
  var ProductList2 = ({ value = false }) => {
50470
- const { branchId } = useParams113();
50614
+ const { branchId } = useParams114();
50471
50615
  const { branches } = useAuth_default();
50472
50616
  const { TransactionView } = useTransactionView_default();
50473
50617
  const { getQuery, setQuery } = useApp_default();
@@ -50489,7 +50633,7 @@ var ProductList2 = ({ value = false }) => {
50489
50633
  key: "name",
50490
50634
  className: "text-xs whitespace-nowrap",
50491
50635
  render: (row) => {
50492
- return /* @__PURE__ */ jsx273("div", { className: "", children: /* @__PURE__ */ jsx273("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.name }) });
50636
+ return /* @__PURE__ */ jsx274("div", { className: "", children: /* @__PURE__ */ jsx274("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.name }) });
50493
50637
  }
50494
50638
  },
50495
50639
  ...value ? [
@@ -50497,14 +50641,14 @@ var ProductList2 = ({ value = false }) => {
50497
50641
  header: "Cost",
50498
50642
  key: "cost",
50499
50643
  className: "text-xs whitespace-nowrap text-right",
50500
- render: (row) => /* @__PURE__ */ jsx273("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Amount(row.cost, false) })
50644
+ render: (row) => /* @__PURE__ */ jsx274("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Amount(row.cost, false) })
50501
50645
  }
50502
50646
  ] : []
50503
50647
  ];
50504
50648
  const datas = data?.data || [];
50505
- return /* @__PURE__ */ jsxs242(Fragment138, { children: [
50506
- /* @__PURE__ */ jsx273(TransactionView, {}),
50507
- /* @__PURE__ */ jsx273(
50649
+ return /* @__PURE__ */ jsxs243(Fragment139, { children: [
50650
+ /* @__PURE__ */ jsx274(TransactionView, {}),
50651
+ /* @__PURE__ */ jsx274(
50508
50652
  A4DataView,
50509
50653
  {
50510
50654
  columns,
@@ -50515,7 +50659,7 @@ var ProductList2 = ({ value = false }) => {
50515
50659
  tableTitle: "Stock List",
50516
50660
  fixed: false,
50517
50661
  startPage: 1e10,
50518
- headers: /* @__PURE__ */ jsx273(
50662
+ headers: /* @__PURE__ */ jsx274(
50519
50663
  Select,
50520
50664
  {
50521
50665
  options: options9,