warqadui 0.0.288 → 0.0.290

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
@@ -133,7 +133,8 @@ var Enums = {
133
133
  expenseAccount: ["branch", "account"],
134
134
  integrationTypes: ["twilio-whatsapp"],
135
135
  postTypes: ["umrah", "hajj", "visa", "hotel"],
136
- postStatus: ["draft", "published", "archived"]
136
+ postStatus: ["draft", "published", "archived"],
137
+ collectionTypes: ["collected", "pending"]
137
138
  };
138
139
  var Enums_default = Enums;
139
140
 
@@ -1017,6 +1018,7 @@ var DashboardLayout = ({
1017
1018
  title = "Dashboard",
1018
1019
  logo,
1019
1020
  userProfile,
1021
+ posIcon,
1020
1022
  fontFamily = 'system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
1021
1023
  // Humanist System Stack
1022
1024
  sidebarFooter
@@ -1214,10 +1216,16 @@ var DashboardLayout = ({
1214
1216
  children: /* @__PURE__ */ jsx7(Menu, { size: 20 })
1215
1217
  }
1216
1218
  ) }),
1217
- /* @__PURE__ */ jsx7("div", { className: "flex items-center gap-2", children: userProfile && /* @__PURE__ */ jsxs5(Fragment2, { children: [
1218
- /* @__PURE__ */ jsx7("div", { className: "w-px h-6 mx-2 bg-gray-200 dark:bg-gray-800" }),
1219
- userProfile
1220
- ] }) })
1219
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
1220
+ posIcon && /* @__PURE__ */ jsxs5(Fragment2, { children: [
1221
+ /* @__PURE__ */ jsx7("div", { className: "w-px h-6 mx-2 bg-gray-200 dark:bg-gray-800" }),
1222
+ posIcon
1223
+ ] }),
1224
+ userProfile && /* @__PURE__ */ jsxs5(Fragment2, { children: [
1225
+ /* @__PURE__ */ jsx7("div", { className: "w-px h-6 mx-2 bg-gray-200 dark:bg-gray-800" }),
1226
+ userProfile
1227
+ ] })
1228
+ ] })
1221
1229
  ] }),
1222
1230
  /* @__PURE__ */ jsxs5("main", { className: "flex-1 overflow-y-auto", children: [
1223
1231
  /* @__PURE__ */ jsx7("div", { className: "sticky top-0 z-20 py-4 px-4 md:px-4 bg-gray-50/95 dark:bg-gray-900/80 backdrop-blur-sm border-b border-gray-200/50 dark:border-white/5 mb-2", children: /* @__PURE__ */ jsx7(Breadcrumbs, {}) }),
@@ -2139,7 +2147,7 @@ var Select = forwardRef3((props, ref2) => {
2139
2147
  enumName,
2140
2148
  ...rest
2141
2149
  } = props;
2142
- const options10 = useMemo4(() => {
2150
+ const options11 = useMemo4(() => {
2143
2151
  if (initialOptions.length > 0) return initialOptions;
2144
2152
  const targetEnum = enumData || (enumName ? enums[enumName] : void 0);
2145
2153
  if (targetEnum) {
@@ -2175,7 +2183,7 @@ var Select = forwardRef3((props, ref2) => {
2175
2183
  SelectRoot,
2176
2184
  {
2177
2185
  ...rest,
2178
- options: options10,
2186
+ options: options11,
2179
2187
  currentValue: formValue,
2180
2188
  onChangeHandler: (val) => {
2181
2189
  formOnChange(val);
@@ -2192,7 +2200,7 @@ var Select = forwardRef3((props, ref2) => {
2192
2200
  SelectRoot,
2193
2201
  {
2194
2202
  ...rest,
2195
- options: options10,
2203
+ options: options11,
2196
2204
  currentValue: value,
2197
2205
  onChangeHandler: onChange || (() => {
2198
2206
  }),
@@ -2378,12 +2386,12 @@ var SelectTrigger = forwardRef3(
2378
2386
  dropdownContentRef,
2379
2387
  containerRef,
2380
2388
  selectedValue,
2381
- options: options10,
2389
+ options: options11,
2382
2390
  fieldInternalProps,
2383
2391
  disabled
2384
2392
  } = useSelectContext();
2385
2393
  const lastFocusTime = useRef3(0);
2386
- const displayOption = options10.find((o) => o.value === selectedValue);
2394
+ const displayOption = options11.find((o) => o.value === selectedValue);
2387
2395
  const displayValue = displayOption ? displayOption.label : selectedValue != null && selectedValue !== "" ? String(selectedValue) : placeholder;
2388
2396
  return /* @__PURE__ */ jsx21("div", { className: "relative", ref: dropdownAnchorRef, children: /* @__PURE__ */ jsx21(
2389
2397
  "div",
@@ -2826,7 +2834,7 @@ var SearchApiRoot = ({
2826
2834
  const [searchTerm, setSearchTerm] = useState15("");
2827
2835
  const { theme } = useWarqadConfig();
2828
2836
  const primaryColor = theme?.primaryColor;
2829
- const [options10, setOptions] = useState15([]);
2837
+ const [options11, setOptions] = useState15([]);
2830
2838
  const [isOpen, setIsOpen] = useState15(false);
2831
2839
  const [isFocused, setIsFocused] = useState15(false);
2832
2840
  const [activeIndex, setActiveIndex] = useState15(-1);
@@ -2878,7 +2886,7 @@ var SearchApiRoot = ({
2878
2886
  return () => clearTimeout(timer);
2879
2887
  }, [searchTerm, api, isOpen]);
2880
2888
  useEffect11(() => {
2881
- if (isOpen && options10.length === 0) {
2889
+ if (isOpen && options11.length === 0) {
2882
2890
  fetchOptions("");
2883
2891
  }
2884
2892
  }, [isOpen]);
@@ -2909,8 +2917,8 @@ var SearchApiRoot = ({
2909
2917
  return option[valueKey];
2910
2918
  };
2911
2919
  useEffect11(() => {
2912
- if (currentValue !== void 0 && currentValue !== null && currentValue !== "" && !selectedObject && options10.length > 0) {
2913
- const found = options10.find((o) => getOptionValue(o) === currentValue);
2920
+ if (currentValue !== void 0 && currentValue !== null && currentValue !== "" && !selectedObject && options11.length > 0) {
2921
+ const found = options11.find((o) => getOptionValue(o) === currentValue);
2914
2922
  if (found) {
2915
2923
  setSelectedObject(found);
2916
2924
  if (form && obj) {
@@ -2921,7 +2929,7 @@ var SearchApiRoot = ({
2921
2929
  }
2922
2930
  }
2923
2931
  }
2924
- }, [currentValue, options10, obj]);
2932
+ }, [currentValue, options11, obj]);
2925
2933
  useEffect11(() => {
2926
2934
  if (prevApiRef.current !== api) {
2927
2935
  prevApiRef.current = api;
@@ -2966,8 +2974,8 @@ var SearchApiRoot = ({
2966
2974
  }, [fieldInternalProps]);
2967
2975
  const getDisplayValue = () => {
2968
2976
  if (selectedObject) return selectedObject[labelKey];
2969
- if (options10.length > 0 && currentValue !== void 0 && currentValue !== null && currentValue !== "") {
2970
- const found = options10.find((o) => getOptionValue(o) === currentValue);
2977
+ if (options11.length > 0 && currentValue !== void 0 && currentValue !== null && currentValue !== "") {
2978
+ const found = options11.find((o) => getOptionValue(o) === currentValue);
2971
2979
  if (found) return found[labelKey];
2972
2980
  }
2973
2981
  if (isLoading || currentValue !== void 0 && currentValue !== null && currentValue !== "" && !hasAttemptedHydration)
@@ -3011,7 +3019,7 @@ var SearchApiRoot = ({
3011
3019
  setSearchTerm("");
3012
3020
  if (onClear) onClear();
3013
3021
  };
3014
- const filteredOptions = options10.filter(
3022
+ const filteredOptions = options11.filter(
3015
3023
  (option) => !filter.includes(getOptionValue(option))
3016
3024
  );
3017
3025
  let message92 = error || errorMessage;
@@ -3176,7 +3184,7 @@ var SearchApiInput = forwardRef5(
3176
3184
  variant,
3177
3185
  activeIndex,
3178
3186
  setActiveIndex,
3179
- options: options10,
3187
+ options: options11,
3180
3188
  handleSelect,
3181
3189
  clearSelection,
3182
3190
  inputRef,
@@ -3208,7 +3216,7 @@ var SearchApiInput = forwardRef5(
3208
3216
  e.preventDefault();
3209
3217
  e.stopPropagation();
3210
3218
  setActiveIndex(
3211
- activeIndex < options10.length - 1 ? activeIndex + 1 : activeIndex
3219
+ activeIndex < options11.length - 1 ? activeIndex + 1 : activeIndex
3212
3220
  );
3213
3221
  break;
3214
3222
  case "ArrowUp":
@@ -3219,8 +3227,8 @@ var SearchApiInput = forwardRef5(
3219
3227
  case "Enter":
3220
3228
  e.preventDefault();
3221
3229
  e.stopPropagation();
3222
- if (activeIndex >= 0 && activeIndex < options10.length)
3223
- handleSelect(options10[activeIndex]);
3230
+ if (activeIndex >= 0 && activeIndex < options11.length)
3231
+ handleSelect(options11[activeIndex]);
3224
3232
  break;
3225
3233
  case "Escape":
3226
3234
  e.preventDefault();
@@ -3296,7 +3304,7 @@ var SearchApiContent = forwardRef5(
3296
3304
  dropdownContentRef,
3297
3305
  isLoading,
3298
3306
  searchTerm,
3299
- options: options10,
3307
+ options: options11,
3300
3308
  error
3301
3309
  } = useSearchApiContext();
3302
3310
  const [dropdownStyle, setDropdownStyle] = useState15({});
@@ -3336,7 +3344,7 @@ var SearchApiContent = forwardRef5(
3336
3344
  ...props,
3337
3345
  children: [
3338
3346
  error && /* @__PURE__ */ jsx23("div", { className: "px-3 py-2 text-sm text-red-600 dark:text-red-400 border-b border-gray-100 dark:border-zinc-800", children: error }),
3339
- isLoading && options10.length === 0 ? /* @__PURE__ */ jsxs18("div", { className: "p-4 text-center text-sm text-gray-500", children: [
3347
+ isLoading && options11.length === 0 ? /* @__PURE__ */ jsxs18("div", { className: "p-4 text-center text-sm text-gray-500", children: [
3340
3348
  /* @__PURE__ */ jsx23(Loader22, { className: "h-5 w-5 animate-spin mx-auto mb-2" }),
3341
3349
  "Loading options..."
3342
3350
  ] }) : children ? /* @__PURE__ */ jsx23("div", { className: "py-1", children }) : /* @__PURE__ */ jsx23("div", { className: "p-4 text-center text-sm text-gray-500", children: searchTerm ? `No results for "${searchTerm}"` : "No options available" })
@@ -7437,13 +7445,13 @@ import moment from "moment";
7437
7445
  import { useReactToPrint as useReactToPrint3 } from "react-to-print";
7438
7446
 
7439
7447
  // src/utils/Formats.tsx
7440
- function Price(price, currency = "USD", round2 = true, options10) {
7448
+ function Price(price, currency = "USD", round2 = true, options11) {
7441
7449
  const num = Number(price);
7442
7450
  const decimalPlaces = round2 ? 0 : Math.min(num.toString().split(".")[1]?.length ?? 0, 2);
7443
7451
  const formatted = new Intl.NumberFormat("en-US", {
7444
7452
  minimumFractionDigits: decimalPlaces,
7445
7453
  maximumFractionDigits: decimalPlaces,
7446
- ...options10
7454
+ ...options11
7447
7455
  }).format(num);
7448
7456
  return `${formatted} ${currency}`;
7449
7457
  }
@@ -7949,7 +7957,7 @@ var useTransaction_default = useTransaction;
7949
7957
  // src/utils/pdf.ts
7950
7958
  import html2canvas from "html2canvas-pro";
7951
7959
  import { jsPDF } from "jspdf";
7952
- var generatePdf = async (elementId, options10 = {}) => {
7960
+ var generatePdf = async (elementId, options11 = {}) => {
7953
7961
  const {
7954
7962
  orientation = "landscape",
7955
7963
  unit = "mm",
@@ -7959,7 +7967,7 @@ var generatePdf = async (elementId, options10 = {}) => {
7959
7967
  windowWidth = 1200,
7960
7968
  scale = 1,
7961
7969
  showPageNumbers = true
7962
- } = options10;
7970
+ } = options11;
7963
7971
  const element = document.getElementById(elementId);
7964
7972
  if (!element) {
7965
7973
  console.error(
@@ -29848,7 +29856,7 @@ var StatusFilter = ({
29848
29856
  value,
29849
29857
  onChange
29850
29858
  }) => {
29851
- const options10 = type === "rent" ? [
29859
+ const options11 = type === "rent" ? [
29852
29860
  { label: "All", value: "all", dotColor: "bg-slate-400" },
29853
29861
  { label: "Vacant", value: "vacant", dotColor: "bg-[#22c55e]" },
29854
29862
  { label: "Occupied", value: "occupied", dotColor: "bg-[#ef4444]" }
@@ -29858,7 +29866,7 @@ var StatusFilter = ({
29858
29866
  { label: "Booked", value: "booked", dotColor: "bg-[#3b82f6]" },
29859
29867
  { label: "Sold", value: "sold", dotColor: "bg-[#ef4444]" }
29860
29868
  ];
29861
- return /* @__PURE__ */ jsx168("div", { className: "flex gap-1 p-1 bg-slate-100 dark:bg-slate-800/80 rounded-lg border border-slate-200/50 dark:border-slate-700/60", children: options10.map((opt) => {
29869
+ return /* @__PURE__ */ jsx168("div", { className: "flex gap-1 p-1 bg-slate-100 dark:bg-slate-800/80 rounded-lg border border-slate-200/50 dark:border-slate-700/60", children: options11.map((opt) => {
29862
29870
  const isActive = value === opt.value;
29863
29871
  return /* @__PURE__ */ jsxs143(
29864
29872
  "button",
@@ -46508,7 +46516,8 @@ var AdjustmentStockSchema5 = z46.object({
46508
46516
  cash: z46.coerce.number(),
46509
46517
  credit: z46.coerce.number(),
46510
46518
  discount: z46.coerce.number(),
46511
- currency: z46.enum(Enums_default.currencies)
46519
+ currency: z46.enum(Enums_default.currencies),
46520
+ collection: z46.enum(Enums_default.collectionTypes)
46512
46521
  });
46513
46522
  var schema_default7 = AdjustmentStockSchema5;
46514
46523
 
@@ -46591,13 +46600,13 @@ var CompleteSaleModal2 = ({
46591
46600
  ] }),
46592
46601
  /* @__PURE__ */ jsxs225("div", { className: "bg-zinc-50 dark:bg-zinc-900/40 p-4 rounded-xl border border-zinc-100 dark:border-zinc-800 space-y-4", children: [
46593
46602
  /* @__PURE__ */ jsxs225("div", { className: "flex items-center justify-between border-b pb-2 dark:border-zinc-800", children: [
46594
- /* @__PURE__ */ jsx256("span", { className: "text-sm font-bold text-gray-800 dark:text-zinc-200", children: "1. Discount & Rate" }),
46603
+ /* @__PURE__ */ jsx256("span", { className: "text-sm font-bold text-gray-800 dark:text-zinc-200", children: "1. Discount, Rate & Collection" }),
46595
46604
  (discount > 0 || isRate) && /* @__PURE__ */ jsx256("span", { className: "text-xs px-2 py-0.5 bg-amber-50 text-amber-600 rounded-full font-medium dark:bg-amber-950/40 dark:text-amber-400", children: discount > 0 ? "Applied" : "Exchange Rate Required" })
46596
46605
  ] }),
46597
46606
  /* @__PURE__ */ jsxs225(
46598
46607
  "div",
46599
46608
  {
46600
- className: isRate ? "grid grid-cols-1 md:grid-cols-2 gap-4" : "grid grid-cols-1 gap-4",
46609
+ className: isRate ? "grid grid-cols-1 md:grid-cols-3 gap-4" : "grid grid-cols-1 md:grid-cols-2 gap-4",
46601
46610
  children: [
46602
46611
  /* @__PURE__ */ jsx256(
46603
46612
  Fields_default.Input,
@@ -46620,6 +46629,17 @@ var CompleteSaleModal2 = ({
46620
46629
  type: "number",
46621
46630
  className: "h-[40px]!"
46622
46631
  }
46632
+ ),
46633
+ /* @__PURE__ */ jsx256(
46634
+ Fields_default.Select,
46635
+ {
46636
+ label: "Collection",
46637
+ name: "collection",
46638
+ form,
46639
+ enumName: "collectionTypes",
46640
+ required: true,
46641
+ className: "h-[40px]!"
46642
+ }
46623
46643
  )
46624
46644
  ]
46625
46645
  }
@@ -46658,7 +46678,7 @@ var CompleteSaleModal2 = ({
46658
46678
  ] }),
46659
46679
  /* @__PURE__ */ jsxs225("div", { className: "bg-zinc-50 dark:bg-zinc-900/40 p-4 rounded-xl border border-zinc-100 dark:border-zinc-800 space-y-4", children: [
46660
46680
  /* @__PURE__ */ jsxs225("div", { className: "flex items-center justify-between border-b pb-2 dark:border-zinc-800", children: [
46661
- /* @__PURE__ */ jsx256("span", { className: "text-sm font-bold text-gray-800 dark:text-zinc-200", children: "2. Credit Payment" }),
46681
+ /* @__PURE__ */ jsx256("span", { className: "text-sm font-bold text-gray-800 dark:text-zinc-200", children: "3. Credit Payment" }),
46662
46682
  credit > 0 && /* @__PURE__ */ jsx256("span", { className: "text-xs px-2 py-0.5 bg-red-50 text-red-600 rounded-full font-medium dark:bg-red-950/40 dark:text-red-400", children: "Active" })
46663
46683
  ] }),
46664
46684
  /* @__PURE__ */ jsxs225("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
@@ -46782,7 +46802,8 @@ var Sale2Form2 = ({
46782
46802
  cash: 0,
46783
46803
  credit: 0,
46784
46804
  discount: 0,
46785
- invoiceNumber: ""
46805
+ invoiceNumber: "",
46806
+ collection: "collected"
46786
46807
  }
46787
46808
  });
46788
46809
  const { handleSubmit, watch, setValue } = methods;
@@ -46859,7 +46880,8 @@ var Sale2Form2 = ({
46859
46880
  cash: cashVal,
46860
46881
  credit: creditVal,
46861
46882
  discount: discountVal,
46862
- invoiceNumber: data.invoiceNumber || void 0
46883
+ invoiceNumber: data.invoiceNumber || void 0,
46884
+ collection: data.collection
46863
46885
  };
46864
46886
  try {
46865
46887
  await post({
@@ -46927,6 +46949,7 @@ var Sale2Form2 = ({
46927
46949
  setValue("discount", datas.discount || 0);
46928
46950
  setValue("invoiceNumber", datas.invoiceNumber || "");
46929
46951
  setValue("currency", datas?.currency);
46952
+ setValue("collection", datas?.collection);
46930
46953
  setTimeout(() => {
46931
46954
  setValue("rate", datas?.rate);
46932
46955
  setValue("wallet", datas?.toWalletData?._id);
@@ -47067,49 +47090,48 @@ function getStorageType5(type, branch) {
47067
47090
  }
47068
47091
  var pos_default5 = Sale2Form2;
47069
47092
 
47070
- // src/components/Transactions/3/sale2/index.ts
47071
- var Sale22 = {
47072
- List: List_default6,
47073
- Form: pos_default5
47074
- };
47075
- var sale2_default2 = Sale22;
47076
-
47077
- // src/components/Transactions/3/purchase3/List.tsx
47093
+ // src/components/Transactions/3/sale2/Collection.tsx
47094
+ import { useMemo as useMemo50 } from "react";
47078
47095
  import { useNavigate as useNavigate62, useParams as useParams101 } from "react-router-dom";
47079
47096
  import {
47097
+ CircleDollarSign,
47098
+ Clock as Clock27,
47080
47099
  EllipsisVertical as EllipsisVertical45,
47081
47100
  Eye as Eye26,
47082
47101
  FilePenLine as FilePenLine41,
47083
- Trash2 as Trash251
47102
+ Trash2 as Trash251,
47103
+ Wallet as Wallet17
47084
47104
  } from "lucide-react";
47085
47105
  import { Fragment as Fragment128, jsx as jsx258, jsxs as jsxs227 } from "react/jsx-runtime";
47086
- function purchase3List({
47106
+ function Collection3({
47087
47107
  url,
47088
47108
  type = "product"
47089
47109
  }) {
47090
47110
  const { branchId } = useParams101();
47091
47111
  const navigate = useNavigate62();
47112
+ const { currencies } = useWarqadConfig();
47113
+ const { defaultCurrency } = currencies;
47092
47114
  const { TransactionView, openTransaction } = useTransactionView_default();
47093
47115
  const { data, TransactionViewComponent, reload } = useTransaction_default({
47094
- url: url || `/transactions/get?type=stock&stock=purchase-3&stockType=${type}${branchId ? `&fromBranch=${branchId}` : ""}`,
47095
- dateFilter: true
47116
+ url: url || `/transactions/get?type=stock&stock=sale-3&stockType=${type}&collection=pending${branchId ? `&fromBranch=${branchId}` : ""}`,
47117
+ dateFilter: false
47096
47118
  });
47097
47119
  const { Modal: Modal2 } = useModal();
47098
47120
  const { PosPrinter } = usePosPrinter_default();
47099
47121
  const items = (data2) => [
47100
47122
  {
47101
- label: `View Stock Purchase`,
47123
+ label: `View Stock Sale`,
47102
47124
  icon: /* @__PURE__ */ jsx258(Eye26, { size: 16 }),
47103
47125
  className: "w-[200px]",
47104
47126
  onClick: () => openTransaction({ id: data2?._id, type: "stock" })
47105
47127
  },
47106
47128
  {
47107
- label: `Edit Stock Purchase`,
47129
+ label: `Edit Stock Sale`,
47108
47130
  icon: /* @__PURE__ */ jsx258(FilePenLine41, { size: 16 }),
47109
47131
  onClick: () => navigate(`update?id=${data2?._id}`)
47110
47132
  },
47111
47133
  {
47112
- label: `Delete Stock Purchase`,
47134
+ label: `Delete Stock Sale`,
47113
47135
  icon: /* @__PURE__ */ jsx258(Trash251, { className: "text-red-500", size: 16 }),
47114
47136
  onClick: () => {
47115
47137
  openTransaction({
@@ -47149,11 +47171,11 @@ function purchase3List({
47149
47171
  }
47150
47172
  },
47151
47173
  {
47152
- accessorKey: "supplier/wallet",
47153
- header: "Supplier/Wallet",
47174
+ accessorKey: "customer/wallet",
47175
+ header: "Customer/Wallet",
47154
47176
  cell: ({ row }) => {
47155
47177
  const stock = row.original;
47156
- const walletName = stock?.fromWalletData?.name;
47178
+ const walletName = stock?.toWalletData?.name;
47157
47179
  const accountName = stock?.accountData?.name || stock?.accountName;
47158
47180
  return /* @__PURE__ */ jsxs227("div", { className: "flex flex-col gap-0.5", children: [
47159
47181
  stock?.cash > 0 && walletName && /* @__PURE__ */ jsxs227("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children: [
@@ -47162,11 +47184,11 @@ function purchase3List({
47162
47184
  /* @__PURE__ */ jsx258("span", { className: "font-semibold text-gray-800 dark:text-zinc-200", children: walletName })
47163
47185
  ] }),
47164
47186
  stock?.credit > 0 && accountName && /* @__PURE__ */ jsxs227("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children: [
47165
- "Supplier:",
47187
+ "Customer:",
47166
47188
  " ",
47167
47189
  /* @__PURE__ */ jsx258("span", { className: "font-semibold text-gray-800 dark:text-zinc-200", children: accountName })
47168
47190
  ] }),
47169
- !(stock?.cash > 0 && walletName) && !(stock?.credit > 0 && accountName) && /* @__PURE__ */ jsx258("span", { children: stock?.purchase === "cash" ? walletName || "Cash Wallet" : accountName || "Supplier" })
47191
+ !(stock?.cash > 0 && walletName) && !(stock?.credit > 0 && accountName) && /* @__PURE__ */ jsx258("span", { children: stock?.sale === "cash" ? walletName || "Cash Wallet" : accountName || "Customer" })
47170
47192
  ] });
47171
47193
  }
47172
47194
  },
@@ -47183,25 +47205,33 @@ function purchase3List({
47183
47205
  header: "Action",
47184
47206
  cell: ({ row }) => {
47185
47207
  const stock = row.original;
47186
- const purchaseType = stock?.cash > 0 && stock?.credit > 0 ? "split" : stock?.purchase;
47208
+ const saleType = stock?.cash > 0 && stock?.credit > 0 ? "split" : stock?.sale;
47187
47209
  return /* @__PURE__ */ jsxs227("div", { className: "flex flex-col", children: [
47188
- /* @__PURE__ */ jsx258("span", { className: `capitalize text-red-600`, children: "Stock Purchased" }),
47189
- /* @__PURE__ */ jsx258("span", { className: "capitalize", children: purchaseType })
47210
+ /* @__PURE__ */ jsx258("span", { className: `capitalize text-red-600`, children: "Stock Sold" }),
47211
+ /* @__PURE__ */ jsx258("span", { className: "capitalize", children: saleType })
47190
47212
  ] });
47191
47213
  }
47192
47214
  },
47193
47215
  {
47194
47216
  accessorKey: "amount",
47195
- header: "Amount",
47217
+ header: "Amount (USD)",
47196
47218
  cell: ({ row }) => {
47197
47219
  const stock = row.original;
47198
- const amount = stock?.amount - (stock?.discount || 0);
47220
+ const isUSD = (stock?.currency || "").toUpperCase() === "USD";
47221
+ const netAmount = (Number(stock?.amount) || 0) - (Number(stock?.discount) || 0);
47222
+ const usdAmount = !isUSD && stock?.exchange?.amount !== void 0 ? Number(stock.exchange.amount) : netAmount;
47199
47223
  return /* @__PURE__ */ jsxs227("div", { className: "flex flex-col", children: [
47200
- /* @__PURE__ */ jsx258("span", { className: "font-semibold", children: Formats_default.Price(amount, stock?.currency, false) }),
47201
- stock?.discount ? /* @__PURE__ */ jsxs227("span", { className: "text-xs text-red-600 ", children: [
47224
+ /* @__PURE__ */ jsx258("span", { className: "font-semibold", children: Formats_default.Price(usdAmount, "USD", false) }),
47225
+ !isUSD && /* @__PURE__ */ jsxs227("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children: [
47226
+ "Original: ",
47227
+ Formats_default.Price(netAmount, stock?.currency, false),
47228
+ stock?.exchange?.rate ? ` @ ${stock.exchange.rate}` : ""
47229
+ ] }),
47230
+ isUSD && stock?.discount > 0 && /* @__PURE__ */ jsxs227("span", { className: "text-xs text-red-600", children: [
47202
47231
  "Original:",
47232
+ " ",
47203
47233
  /* @__PURE__ */ jsx258("del", { children: Formats_default.Price(stock?.amount, stock?.currency, false) })
47204
- ] }) : null
47234
+ ] })
47205
47235
  ] });
47206
47236
  }
47207
47237
  },
@@ -47223,11 +47253,379 @@ function purchase3List({
47223
47253
  }
47224
47254
  ];
47225
47255
  const stocks = data?.data || [];
47256
+ const stats = useMemo50(() => {
47257
+ const totalInvoices = stocks.length;
47258
+ let totalPendingUSD = 0;
47259
+ let totalCashUSD = 0;
47260
+ let totalCreditUSD = 0;
47261
+ stocks.forEach((item) => {
47262
+ const isUSD = (item?.currency || "").toUpperCase() === "USD";
47263
+ const netAmount = (Number(item?.amount) || 0) - (Number(item?.discount) || 0);
47264
+ let itemUsdAmount = netAmount;
47265
+ if (!isUSD && item?.exchange?.amount !== void 0) {
47266
+ itemUsdAmount = Number(item.exchange.amount) || 0;
47267
+ }
47268
+ totalPendingUSD += itemUsdAmount;
47269
+ if (isUSD) {
47270
+ totalCashUSD += Number(item?.cash) || 0;
47271
+ totalCreditUSD += Number(item?.credit) || 0;
47272
+ } else {
47273
+ const cashRatio = netAmount > 0 ? (Number(item?.cash) || 0) / netAmount : 0;
47274
+ const creditRatio = netAmount > 0 ? (Number(item?.credit) || 0) / netAmount : 0;
47275
+ totalCashUSD += itemUsdAmount * cashRatio;
47276
+ totalCreditUSD += itemUsdAmount * creditRatio;
47277
+ }
47278
+ });
47279
+ return {
47280
+ totalInvoices,
47281
+ totalPendingUSD,
47282
+ totalCashUSD,
47283
+ totalCreditUSD
47284
+ };
47285
+ }, [stocks]);
47226
47286
  return /* @__PURE__ */ jsxs227(Fragment128, { children: [
47227
47287
  /* @__PURE__ */ jsx258(TransactionView, {}),
47228
47288
  /* @__PURE__ */ jsx258(Modal2, {}),
47229
47289
  /* @__PURE__ */ jsx258(PosPrinter, {}),
47290
+ /* @__PURE__ */ jsxs227("header", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-6", children: [
47291
+ /* @__PURE__ */ jsxs227("div", { className: "bg-white dark:bg-zinc-900/60 border border-zinc-200/80 dark:border-zinc-800 rounded-2xl p-5 shadow-xs flex items-center justify-between transition-all hover:shadow-md", children: [
47292
+ /* @__PURE__ */ jsxs227("div", { className: "space-y-1", children: [
47293
+ /* @__PURE__ */ jsxs227("div", { className: "flex items-center gap-2", children: [
47294
+ /* @__PURE__ */ jsx258("span", { className: "text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400", children: "Pending Invoices" }),
47295
+ /* @__PURE__ */ jsx258("span", { className: "px-2 py-0.5 text-[10px] font-bold bg-amber-50 text-amber-700 dark:bg-amber-950/60 dark:text-amber-400 border border-amber-200/60 dark:border-amber-900/40 rounded-full", children: "Waiting" })
47296
+ ] }),
47297
+ /* @__PURE__ */ jsx258("h3", { className: "text-3xl font-black text-zinc-900 dark:text-white", children: stats.totalInvoices }),
47298
+ /* @__PURE__ */ jsxs227("p", { className: "text-xs text-zinc-500 dark:text-zinc-400", children: [
47299
+ stats.totalInvoices === 1 ? "1 invoice" : `${stats.totalInvoices} invoices`,
47300
+ " ",
47301
+ "awaiting collection"
47302
+ ] })
47303
+ ] }),
47304
+ /* @__PURE__ */ jsx258("div", { className: "p-3.5 rounded-2xl bg-amber-50 dark:bg-amber-950/40 text-amber-600 dark:text-amber-400 border border-amber-100 dark:border-amber-900/30 shrink-0", children: /* @__PURE__ */ jsx258(Clock27, { size: 24 }) })
47305
+ ] }),
47306
+ /* @__PURE__ */ jsxs227("div", { className: "bg-white dark:bg-zinc-900/60 border border-zinc-200/80 dark:border-zinc-800 rounded-2xl p-5 shadow-xs flex items-center justify-between transition-all hover:shadow-md", children: [
47307
+ /* @__PURE__ */ jsxs227("div", { className: "space-y-1", children: [
47308
+ /* @__PURE__ */ jsxs227("div", { className: "flex items-center gap-2", children: [
47309
+ /* @__PURE__ */ jsx258("span", { className: "text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400", children: "To Be Collected (USD)" }),
47310
+ /* @__PURE__ */ jsx258("span", { className: "px-2 py-0.5 text-[10px] font-bold bg-emerald-50 text-emerald-700 dark:bg-emerald-950/60 dark:text-emerald-400 border border-emerald-200/60 dark:border-emerald-900/40 rounded-full", children: "USD" })
47311
+ ] }),
47312
+ /* @__PURE__ */ jsx258("h3", { className: "text-3xl font-black text-emerald-600 dark:text-emerald-400", children: Formats_default.Price(stats.totalPendingUSD, "USD", false) }),
47313
+ /* @__PURE__ */ jsx258("p", { className: "text-xs text-zinc-500 dark:text-zinc-400", children: "Total sales waiting for collection (USD)" })
47314
+ ] }),
47315
+ /* @__PURE__ */ jsx258("div", { className: "p-3.5 rounded-2xl bg-emerald-50 dark:bg-emerald-950/40 text-emerald-600 dark:text-emerald-400 border border-emerald-100 dark:border-emerald-900/30 shrink-0", children: /* @__PURE__ */ jsx258(CircleDollarSign, { size: 24 }) })
47316
+ ] }),
47317
+ /* @__PURE__ */ jsxs227("div", { className: "bg-white dark:bg-zinc-900/60 border border-zinc-200/80 dark:border-zinc-800 rounded-2xl p-5 shadow-xs flex items-center justify-between transition-all hover:shadow-md", children: [
47318
+ /* @__PURE__ */ jsxs227("div", { className: "space-y-2 w-full pr-3", children: [
47319
+ /* @__PURE__ */ jsx258("span", { className: "text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400", children: "Payment Breakdown (USD)" }),
47320
+ /* @__PURE__ */ jsxs227("div", { className: "flex items-center justify-between text-sm", children: [
47321
+ /* @__PURE__ */ jsxs227("span", { className: "text-zinc-500 dark:text-zinc-400 flex items-center gap-1.5", children: [
47322
+ /* @__PURE__ */ jsx258("span", { className: "h-2 w-2 rounded-full bg-blue-500" }),
47323
+ "Cash:"
47324
+ ] }),
47325
+ /* @__PURE__ */ jsx258("span", { className: "font-bold text-blue-600 dark:text-blue-400", children: Formats_default.Price(stats.totalCashUSD, "USD", false) })
47326
+ ] }),
47327
+ /* @__PURE__ */ jsxs227("div", { className: "flex items-center justify-between text-sm", children: [
47328
+ /* @__PURE__ */ jsxs227("span", { className: "text-zinc-500 dark:text-zinc-400 flex items-center gap-1.5", children: [
47329
+ /* @__PURE__ */ jsx258("span", { className: "h-2 w-2 rounded-full bg-red-500" }),
47330
+ "Credit:"
47331
+ ] }),
47332
+ /* @__PURE__ */ jsx258("span", { className: "font-bold text-red-500 dark:text-red-400", children: Formats_default.Price(stats.totalCreditUSD, "USD", false) })
47333
+ ] })
47334
+ ] }),
47335
+ /* @__PURE__ */ jsx258("div", { className: "p-3.5 rounded-2xl bg-blue-50 dark:bg-blue-950/40 text-blue-600 dark:text-blue-400 border border-blue-100 dark:border-blue-900/30 shrink-0", children: /* @__PURE__ */ jsx258(Wallet17, { size: 24 }) })
47336
+ ] })
47337
+ ] }),
47230
47338
  /* @__PURE__ */ jsx258(
47339
+ TransactionViewComponent,
47340
+ {
47341
+ columns,
47342
+ data: stocks,
47343
+ title: `${type} Sales (Pending Collection)`,
47344
+ description: `Manage ${type} sales waiting for collection`,
47345
+ index: true
47346
+ },
47347
+ type
47348
+ )
47349
+ ] });
47350
+ }
47351
+ var Collection_default = Collection3;
47352
+
47353
+ // src/components/Transactions/3/sale2/CollectionLevel.tsx
47354
+ import { useParams as useParams102 } from "react-router-dom";
47355
+ import { Fragment as Fragment129, jsx as jsx259, jsxs as jsxs228 } from "react/jsx-runtime";
47356
+ var options9 = [
47357
+ { label: "Product", value: "product" },
47358
+ { label: "Pack", value: "pack" }
47359
+ ];
47360
+ var CollectionLevel = ({
47361
+ value = false,
47362
+ showYard = false
47363
+ }) => {
47364
+ const { apiConfig, currencies } = useWarqadConfig();
47365
+ const { stock } = currencies;
47366
+ const { branchId } = useParams102();
47367
+ const { branches } = useAuth_default();
47368
+ const { TransactionView } = useTransactionView_default();
47369
+ const { getQuery, setQuery } = useApp_default();
47370
+ const stockType = getQuery("stockType") || "product";
47371
+ const { A4DataView, data } = useA4DataView_default({
47372
+ url: `${apiConfig.stockLevelReportApi}?stockType=${stockType}&collection=pending${branchId ? `&branch=${branchId}` : ""}`,
47373
+ v: 1,
47374
+ // No prefix
47375
+ params: {}
47376
+ });
47377
+ let branchesData = branches || [];
47378
+ if (branchId) {
47379
+ branchesData = branchesData.filter((b) => b._id === branchId);
47380
+ }
47381
+ const branchNames = branchesData.map((b) => b.name);
47382
+ const currency = stock;
47383
+ const currentBranch = branchesData.find((b) => b._id === branchId);
47384
+ const columns = [
47385
+ {
47386
+ header: "Name",
47387
+ key: "name",
47388
+ className: "text-xs whitespace-nowrap",
47389
+ render: (row) => {
47390
+ const yard = row?.yard || 0;
47391
+ return /* @__PURE__ */ jsx259("div", { className: "", children: /* @__PURE__ */ jsx259("p", { className: "font-bold uppercase text-black dark:text-white print:text-black", children: row.name }) });
47392
+ }
47393
+ },
47394
+ ...!value ? branchNames.map((branchName) => ({
47395
+ header: branchName,
47396
+ key: branchName,
47397
+ className: "text-xs whitespace-nowrap text-right",
47398
+ render: (row) => {
47399
+ const qty = row[branchName];
47400
+ return /* @__PURE__ */ jsx259(
47401
+ "div",
47402
+ {
47403
+ className: qty > 0 ? "text-green-500 font-bold" : qty < 0 ? "text-red-500 font-bold" : "",
47404
+ children: Formats_default.Amount(qty, false)
47405
+ }
47406
+ );
47407
+ }
47408
+ })) : [],
47409
+ {
47410
+ header: "Total Qty",
47411
+ key: "total",
47412
+ className: "text-xs whitespace-nowrap text-right",
47413
+ render: (row) => {
47414
+ const total = row.total;
47415
+ return /* @__PURE__ */ jsx259(
47416
+ "span",
47417
+ {
47418
+ className: total > 0 ? "text-green-500 font-bold" : total < 0 ? "text-red-500 font-bold" : "",
47419
+ children: Formats_default.Amount(total, false)
47420
+ }
47421
+ );
47422
+ },
47423
+ renderFooter: (data2) => {
47424
+ const total = data2.reduce((acc, row) => acc + row.total, 0);
47425
+ return /* @__PURE__ */ jsx259("span", { className: " font-bold", children: Formats_default.Amount(total, false) });
47426
+ }
47427
+ }
47428
+ ];
47429
+ let runningBalance = 0;
47430
+ const datas = (data?.data || []).map((item) => {
47431
+ runningBalance += item.calculatedAmount;
47432
+ return {
47433
+ ...item,
47434
+ runningBalance
47435
+ };
47436
+ });
47437
+ return /* @__PURE__ */ jsxs228(Fragment129, { children: [
47438
+ /* @__PURE__ */ jsx259(TransactionView, {}),
47439
+ /* @__PURE__ */ jsx259(
47440
+ A4DataView,
47441
+ {
47442
+ columns,
47443
+ data: datas || [],
47444
+ index: true,
47445
+ title: `Pending Collections`,
47446
+ subtitle: branchId ? currentBranch?.name : "All Branches",
47447
+ tableTitle: value ? "Current Stock Value" : "Current Stock Level",
47448
+ fixed: false,
47449
+ headers: /* @__PURE__ */ jsx259(
47450
+ Select,
47451
+ {
47452
+ options: options9,
47453
+ value: stockType,
47454
+ className: "w-32! print:hidden",
47455
+ onChange: (e) => {
47456
+ setQuery({ stockType: e });
47457
+ }
47458
+ }
47459
+ )
47460
+ }
47461
+ )
47462
+ ] });
47463
+ };
47464
+ var CollectionLevel_default = CollectionLevel;
47465
+
47466
+ // src/components/Transactions/3/sale2/index.ts
47467
+ var Sale22 = {
47468
+ List: List_default6,
47469
+ Form: pos_default5,
47470
+ Collection: Collection_default,
47471
+ CollectionLevel: CollectionLevel_default
47472
+ };
47473
+ var sale2_default2 = Sale22;
47474
+
47475
+ // src/components/Transactions/3/purchase3/List.tsx
47476
+ import { useNavigate as useNavigate63, useParams as useParams103 } from "react-router-dom";
47477
+ import {
47478
+ EllipsisVertical as EllipsisVertical46,
47479
+ Eye as Eye27,
47480
+ FilePenLine as FilePenLine42,
47481
+ Trash2 as Trash252
47482
+ } from "lucide-react";
47483
+ import { Fragment as Fragment130, jsx as jsx260, jsxs as jsxs229 } from "react/jsx-runtime";
47484
+ function purchase3List({
47485
+ url,
47486
+ type = "product"
47487
+ }) {
47488
+ const { branchId } = useParams103();
47489
+ const navigate = useNavigate63();
47490
+ const { TransactionView, openTransaction } = useTransactionView_default();
47491
+ const { data, TransactionViewComponent, reload } = useTransaction_default({
47492
+ url: url || `/transactions/get?type=stock&stock=purchase-3&stockType=${type}${branchId ? `&fromBranch=${branchId}` : ""}`,
47493
+ dateFilter: true
47494
+ });
47495
+ const { Modal: Modal2 } = useModal();
47496
+ const { PosPrinter } = usePosPrinter_default();
47497
+ const items = (data2) => [
47498
+ {
47499
+ label: `View Stock Purchase`,
47500
+ icon: /* @__PURE__ */ jsx260(Eye27, { size: 16 }),
47501
+ className: "w-[200px]",
47502
+ onClick: () => openTransaction({ id: data2?._id, type: "stock" })
47503
+ },
47504
+ {
47505
+ label: `Edit Stock Purchase`,
47506
+ icon: /* @__PURE__ */ jsx260(FilePenLine42, { size: 16 }),
47507
+ onClick: () => navigate(`update?id=${data2?._id}`)
47508
+ },
47509
+ {
47510
+ label: `Delete Stock Purchase`,
47511
+ icon: /* @__PURE__ */ jsx260(Trash252, { className: "text-red-500", size: 16 }),
47512
+ onClick: () => {
47513
+ openTransaction({
47514
+ id: data2?._id,
47515
+ type: "stock",
47516
+ reverseable: { reload }
47517
+ });
47518
+ }
47519
+ }
47520
+ ].filter(Boolean);
47521
+ const columns = [
47522
+ {
47523
+ accessorKey: "date",
47524
+ header: "Date",
47525
+ cell: ({ row }) => {
47526
+ const stock = row.original;
47527
+ return /* @__PURE__ */ jsxs229("div", { className: "flex flex-col", children: [
47528
+ /* @__PURE__ */ jsx260("span", { children: stock?.date }),
47529
+ /* @__PURE__ */ jsx260(
47530
+ "span",
47531
+ {
47532
+ onClick: () => openTransaction({ id: stock?._id, type: "stock" }),
47533
+ className: "text-xs text-blue-600 italic cursor-pointer hover:underline",
47534
+ children: stock.ref
47535
+ }
47536
+ )
47537
+ ] });
47538
+ }
47539
+ },
47540
+ {
47541
+ accessorKey: "branch",
47542
+ header: "Branch",
47543
+ cell: ({ row }) => {
47544
+ const stock = row.original;
47545
+ const branch = stock?.fromBranchData?.name;
47546
+ return /* @__PURE__ */ jsx260("span", { children: branch });
47547
+ }
47548
+ },
47549
+ {
47550
+ accessorKey: "supplier/wallet",
47551
+ header: "Supplier/Wallet",
47552
+ cell: ({ row }) => {
47553
+ const stock = row.original;
47554
+ const walletName = stock?.fromWalletData?.name;
47555
+ const accountName = stock?.accountData?.name || stock?.accountName;
47556
+ return /* @__PURE__ */ jsxs229("div", { className: "flex flex-col gap-0.5", children: [
47557
+ stock?.cash > 0 && walletName && /* @__PURE__ */ jsxs229("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children: [
47558
+ "Wallet:",
47559
+ " ",
47560
+ /* @__PURE__ */ jsx260("span", { className: "font-semibold text-gray-800 dark:text-zinc-200", children: walletName })
47561
+ ] }),
47562
+ stock?.credit > 0 && accountName && /* @__PURE__ */ jsxs229("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children: [
47563
+ "Supplier:",
47564
+ " ",
47565
+ /* @__PURE__ */ jsx260("span", { className: "font-semibold text-gray-800 dark:text-zinc-200", children: accountName })
47566
+ ] }),
47567
+ !(stock?.cash > 0 && walletName) && !(stock?.credit > 0 && accountName) && /* @__PURE__ */ jsx260("span", { children: stock?.purchase === "cash" ? walletName || "Cash Wallet" : accountName || "Supplier" })
47568
+ ] });
47569
+ }
47570
+ },
47571
+ {
47572
+ accessorKey: "stockType",
47573
+ header: "Stock Type",
47574
+ cell: ({ row }) => {
47575
+ const stock = row.original;
47576
+ return /* @__PURE__ */ jsx260("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx260("span", { children: stock?.stockType }) });
47577
+ }
47578
+ },
47579
+ {
47580
+ accessorKey: "action",
47581
+ header: "Action",
47582
+ cell: ({ row }) => {
47583
+ const stock = row.original;
47584
+ const purchaseType = stock?.cash > 0 && stock?.credit > 0 ? "split" : stock?.purchase;
47585
+ return /* @__PURE__ */ jsxs229("div", { className: "flex flex-col", children: [
47586
+ /* @__PURE__ */ jsx260("span", { className: `capitalize text-red-600`, children: "Stock Purchased" }),
47587
+ /* @__PURE__ */ jsx260("span", { className: "capitalize", children: purchaseType })
47588
+ ] });
47589
+ }
47590
+ },
47591
+ {
47592
+ accessorKey: "amount",
47593
+ header: "Amount",
47594
+ cell: ({ row }) => {
47595
+ const stock = row.original;
47596
+ const amount = stock?.amount - (stock?.discount || 0);
47597
+ return /* @__PURE__ */ jsxs229("div", { className: "flex flex-col", children: [
47598
+ /* @__PURE__ */ jsx260("span", { className: "font-semibold", children: Formats_default.Price(amount, stock?.currency, false) }),
47599
+ stock?.discount ? /* @__PURE__ */ jsxs229("span", { className: "text-xs text-red-600 ", children: [
47600
+ "Original:",
47601
+ /* @__PURE__ */ jsx260("del", { children: Formats_default.Price(stock?.amount, stock?.currency, false) })
47602
+ ] }) : null
47603
+ ] });
47604
+ }
47605
+ },
47606
+ {
47607
+ accessorKey: "actions",
47608
+ header: "Actions",
47609
+ cell: ({ row }) => {
47610
+ const data2 = row.original;
47611
+ return /* @__PURE__ */ jsx260(
47612
+ Dropdown,
47613
+ {
47614
+ className: "cursor-pointer",
47615
+ items: items(data2),
47616
+ triggerMode: "hover",
47617
+ children: /* @__PURE__ */ jsx260(EllipsisVertical46, {})
47618
+ }
47619
+ );
47620
+ }
47621
+ }
47622
+ ];
47623
+ const stocks = data?.data || [];
47624
+ return /* @__PURE__ */ jsxs229(Fragment130, { children: [
47625
+ /* @__PURE__ */ jsx260(TransactionView, {}),
47626
+ /* @__PURE__ */ jsx260(Modal2, {}),
47627
+ /* @__PURE__ */ jsx260(PosPrinter, {}),
47628
+ /* @__PURE__ */ jsx260(
47231
47629
  TransactionViewComponent,
47232
47630
  {
47233
47631
  columns,
@@ -47251,19 +47649,19 @@ import { useEffect as useEffect112, useLayoutEffect as useLayoutEffect8, useStat
47251
47649
 
47252
47650
  // src/components/Transactions/3/purchase3/header.tsx
47253
47651
  import { useFormContext as useFormContext10 } from "react-hook-form";
47254
- import { useParams as useParams102 } from "react-router-dom";
47652
+ import { useParams as useParams104 } from "react-router-dom";
47255
47653
  import { useEffect as useEffect110 } from "react";
47256
- import { jsx as jsx259, jsxs as jsxs228 } from "react/jsx-runtime";
47654
+ import { jsx as jsx261, jsxs as jsxs230 } from "react/jsx-runtime";
47257
47655
  function SaleHeader4({ stockType }) {
47258
47656
  const form = useFormContext10();
47259
- const { branchId } = useParams102();
47657
+ const { branchId } = useParams104();
47260
47658
  useEffect110(() => {
47261
47659
  if (branchId) {
47262
47660
  form.setValue("branch", branchId);
47263
47661
  }
47264
47662
  }, [branchId]);
47265
- return /* @__PURE__ */ jsxs228("section", { className: "grid grid-cols-1 md:grid-cols-4 lg:grid-cols-5 border-b-2 pb-4 pt-2 gap-4", children: [
47266
- /* @__PURE__ */ jsx259(
47663
+ return /* @__PURE__ */ jsxs230("section", { className: "grid grid-cols-1 md:grid-cols-4 lg:grid-cols-5 border-b-2 pb-4 pt-2 gap-4", children: [
47664
+ /* @__PURE__ */ jsx261(
47267
47665
  Fields_default.DateInput,
47268
47666
  {
47269
47667
  label: "Date",
@@ -47273,7 +47671,7 @@ function SaleHeader4({ stockType }) {
47273
47671
  required: true
47274
47672
  }
47275
47673
  ),
47276
- /* @__PURE__ */ jsx259(
47674
+ /* @__PURE__ */ jsx261(
47277
47675
  Feilds_default.Branches,
47278
47676
  {
47279
47677
  name: "branch",
@@ -47284,7 +47682,7 @@ function SaleHeader4({ stockType }) {
47284
47682
  className: "h-[30px]!"
47285
47683
  }
47286
47684
  ),
47287
- /* @__PURE__ */ jsx259(
47685
+ /* @__PURE__ */ jsx261(
47288
47686
  Fields_default.Select,
47289
47687
  {
47290
47688
  label: "Stock Type",
@@ -47299,7 +47697,7 @@ function SaleHeader4({ stockType }) {
47299
47697
  className: "rounded-md! min-w-[100px]! h-[30px]!"
47300
47698
  }
47301
47699
  ),
47302
- /* @__PURE__ */ jsx259(
47700
+ /* @__PURE__ */ jsx261(
47303
47701
  Fields_default.Select,
47304
47702
  {
47305
47703
  label: "Currency",
@@ -47314,7 +47712,7 @@ function SaleHeader4({ stockType }) {
47314
47712
  className: "rounded-md! min-w-[100px]! h-[30px]!"
47315
47713
  }
47316
47714
  ),
47317
- /* @__PURE__ */ jsx259(
47715
+ /* @__PURE__ */ jsx261(
47318
47716
  Fields_default.Input,
47319
47717
  {
47320
47718
  label: "Invoice Number",
@@ -47363,7 +47761,7 @@ var FetchBalance_default6 = useFetchBalance6;
47363
47761
 
47364
47762
  // src/components/Transactions/3/purchase3/table.tsx
47365
47763
  import { useEffect as useEffect111 } from "react";
47366
- import { Fragment as Fragment129, jsx as jsx260, jsxs as jsxs229 } from "react/jsx-runtime";
47764
+ import { Fragment as Fragment131, jsx as jsx262, jsxs as jsxs231 } from "react/jsx-runtime";
47367
47765
  function PurchaseStockTable({
47368
47766
  data,
47369
47767
  methods,
@@ -47454,7 +47852,7 @@ function PurchaseStockTable({
47454
47852
  methods.setValue("lineObj", rowData.lineObj);
47455
47853
  }
47456
47854
  }, [rowData?.lineObj]);
47457
- return /* @__PURE__ */ jsx260("div", { className: "flex items-center gap-2 w-full ", children: /* @__PURE__ */ jsx260(
47855
+ return /* @__PURE__ */ jsx262("div", { className: "flex items-center gap-2 w-full ", children: /* @__PURE__ */ jsx262(
47458
47856
  Fields_default.SearchApi,
47459
47857
  {
47460
47858
  id: "pti-lineId",
@@ -47503,8 +47901,8 @@ function PurchaseStockTable({
47503
47901
  cell: ({ row }) => {
47504
47902
  const lineObj2 = row.original?.lineObj;
47505
47903
  const lineName = lineObj2?.name;
47506
- return /* @__PURE__ */ jsxs229("div", { className: "flex items-center gap-2 w-full ", children: [
47507
- stockType === "product" && /* @__PURE__ */ jsx260("div", { className: "h-[20px] w-[20px] rounded-md overflow-hidden", children: /* @__PURE__ */ jsx260(
47904
+ return /* @__PURE__ */ jsxs231("div", { className: "flex items-center gap-2 w-full ", children: [
47905
+ stockType === "product" && /* @__PURE__ */ jsx262("div", { className: "h-[20px] w-[20px] rounded-md overflow-hidden", children: /* @__PURE__ */ jsx262(
47508
47906
  ProductImage_default,
47509
47907
  {
47510
47908
  src: lineObj2?.imgUrl || lineObj2?.image || null,
@@ -47512,7 +47910,7 @@ function PurchaseStockTable({
47512
47910
  width: 20
47513
47911
  }
47514
47912
  ) }),
47515
- /* @__PURE__ */ jsx260("h1", { children: lineName })
47913
+ /* @__PURE__ */ jsx262("h1", { children: lineName })
47516
47914
  ] });
47517
47915
  }
47518
47916
  },
@@ -47521,7 +47919,7 @@ function PurchaseStockTable({
47521
47919
  header: "Available",
47522
47920
  maxSize: 90,
47523
47921
  meta: {
47524
- field: ({ value, onChange }) => /* @__PURE__ */ jsx260(Fragment129, { children: balanceLoading ? /* @__PURE__ */ jsx260(LoadingSpin, { size: "sm", className: "text-blue-600" }) : /* @__PURE__ */ jsx260(
47922
+ field: ({ value, onChange }) => /* @__PURE__ */ jsx262(Fragment131, { children: balanceLoading ? /* @__PURE__ */ jsx262(LoadingSpin, { size: "sm", className: "text-blue-600" }) : /* @__PURE__ */ jsx262(
47525
47923
  Fields_default.Input,
47526
47924
  {
47527
47925
  id: "pti-lineBalance",
@@ -47539,7 +47937,7 @@ function PurchaseStockTable({
47539
47937
  ) })
47540
47938
  },
47541
47939
  cell: () => {
47542
- return /* @__PURE__ */ jsx260("h2", { children: "-" });
47940
+ return /* @__PURE__ */ jsx262("h2", { children: "-" });
47543
47941
  }
47544
47942
  },
47545
47943
  ...!isRate ? [
@@ -47548,7 +47946,7 @@ function PurchaseStockTable({
47548
47946
  header: "Cost",
47549
47947
  maxSize: 140,
47550
47948
  meta: {
47551
- field: ({ value, onChange }) => /* @__PURE__ */ jsx260(
47949
+ field: ({ value, onChange }) => /* @__PURE__ */ jsx262(
47552
47950
  Fields_default.Input,
47553
47951
  {
47554
47952
  id: "pti-lineCost",
@@ -47566,7 +47964,7 @@ function PurchaseStockTable({
47566
47964
  )
47567
47965
  },
47568
47966
  cell: ({ row }) => {
47569
- return /* @__PURE__ */ jsx260("h2", { children: Formats_default.Amount(row.original?.lineCost || 0) });
47967
+ return /* @__PURE__ */ jsx262("h2", { children: Formats_default.Amount(row.original?.lineCost || 0) });
47570
47968
  }
47571
47969
  }
47572
47970
  ] : [],
@@ -47575,7 +47973,7 @@ function PurchaseStockTable({
47575
47973
  header: "Qty",
47576
47974
  maxSize: 90,
47577
47975
  meta: {
47578
- field: ({ value, onChange }) => /* @__PURE__ */ jsx260(
47976
+ field: ({ value, onChange }) => /* @__PURE__ */ jsx262(
47579
47977
  Fields_default.Input,
47580
47978
  {
47581
47979
  id: "pti-lineQuantity",
@@ -47592,7 +47990,7 @@ function PurchaseStockTable({
47592
47990
  )
47593
47991
  },
47594
47992
  cell: ({ row }) => {
47595
- return /* @__PURE__ */ jsx260("h2", { children: Formats_default.XQty(row.original?.lineQuantity || 0) });
47993
+ return /* @__PURE__ */ jsx262("h2", { children: Formats_default.XQty(row.original?.lineQuantity || 0) });
47596
47994
  }
47597
47995
  },
47598
47996
  {
@@ -47600,7 +47998,7 @@ function PurchaseStockTable({
47600
47998
  header: "Price",
47601
47999
  maxSize: 90,
47602
48000
  meta: {
47603
- field: ({ value, onChange }) => /* @__PURE__ */ jsx260(
48001
+ field: ({ value, onChange }) => /* @__PURE__ */ jsx262(
47604
48002
  Fields_default.Input,
47605
48003
  {
47606
48004
  id: "pti-lineCost",
@@ -47617,7 +48015,7 @@ function PurchaseStockTable({
47617
48015
  )
47618
48016
  },
47619
48017
  cell: ({ row }) => {
47620
- return /* @__PURE__ */ jsx260("h2", { children: Formats_default.XQty(row.original?.lineSell || 0) });
48018
+ return /* @__PURE__ */ jsx262("h2", { children: Formats_default.XQty(row.original?.lineSell || 0) });
47621
48019
  }
47622
48020
  },
47623
48021
  {
@@ -47625,7 +48023,7 @@ function PurchaseStockTable({
47625
48023
  header: "Total",
47626
48024
  maxSize: 150,
47627
48025
  meta: {
47628
- field: ({ value, onChange }) => /* @__PURE__ */ jsx260(
48026
+ field: ({ value, onChange }) => /* @__PURE__ */ jsx262(
47629
48027
  Fields_default.Input,
47630
48028
  {
47631
48029
  id: "pti-lineTotal",
@@ -47643,11 +48041,11 @@ function PurchaseStockTable({
47643
48041
  )
47644
48042
  },
47645
48043
  cell: ({ row }) => {
47646
- return /* @__PURE__ */ jsx260("h2", { children: Formats_default.Amount(row.original?.lineTotal || 0) });
48044
+ return /* @__PURE__ */ jsx262("h2", { children: Formats_default.Amount(row.original?.lineTotal || 0) });
47647
48045
  },
47648
48046
  footer: ({ row }) => {
47649
48047
  const total = data?.reduce((acc, row2) => acc + row2.lineTotal, 0);
47650
- return /* @__PURE__ */ jsx260("h2", { children: Formats_default.Price(total || 0, currency, false) });
48048
+ return /* @__PURE__ */ jsx262("h2", { children: Formats_default.Price(total || 0, currency, false) });
47651
48049
  }
47652
48050
  }
47653
48051
  ];
@@ -47658,7 +48056,7 @@ function PurchaseStockTable({
47658
48056
  methods.setValue("lineBalance", 0);
47659
48057
  }
47660
48058
  }, [lineId, branch]);
47661
- return /* @__PURE__ */ jsx260(Fragment129, { children: /* @__PURE__ */ jsx260(
48059
+ return /* @__PURE__ */ jsx262(Fragment131, { children: /* @__PURE__ */ jsx262(
47662
48060
  PostTable,
47663
48061
  {
47664
48062
  data: data || [],
@@ -47672,7 +48070,7 @@ function PurchaseStockTable({
47672
48070
  isLoading: getLoading,
47673
48071
  defaultExpanded: true,
47674
48072
  hasSubComponent: () => stockType !== "product",
47675
- renderSubComponent: ({ row }) => /* @__PURE__ */ jsx260(PackView_default, { type: stockType, data: row?.lineObj?.products })
48073
+ renderSubComponent: ({ row }) => /* @__PURE__ */ jsx262(PackView_default, { type: stockType, data: row?.lineObj?.products })
47676
48074
  },
47677
48075
  data?.length
47678
48076
  ) });
@@ -47716,12 +48114,12 @@ var schema_default8 = AdjustmentStockSchema6;
47716
48114
 
47717
48115
  // src/components/Transactions/3/purchase3/pos.tsx
47718
48116
  import { ArrowLeft as ArrowLeft12 } from "lucide-react";
47719
- import { useParams as useParams103 } from "react-router-dom";
48117
+ import { useParams as useParams105 } from "react-router-dom";
47720
48118
 
47721
48119
  // src/components/Transactions/3/purchase3/Submit.tsx
47722
48120
  import { useFormContext as useFormContext11 } from "react-hook-form";
47723
- import { useMemo as useMemo50 } from "react";
47724
- import { jsx as jsx261, jsxs as jsxs230 } from "react/jsx-runtime";
48121
+ import { useMemo as useMemo51 } from "react";
48122
+ import { jsx as jsx263, jsxs as jsxs232 } from "react/jsx-runtime";
47725
48123
  var CompletePurchaseModal = ({
47726
48124
  totalAmount,
47727
48125
  onSubmit,
@@ -47770,7 +48168,7 @@ var CompletePurchaseModal = ({
47770
48168
  }
47771
48169
  };
47772
48170
  const isRate = defaultCurrency !== currency;
47773
- const exchangedNet = useMemo50(() => {
48171
+ const exchangedNet = useMemo51(() => {
47774
48172
  const total = forex_default.exchangedAmount({
47775
48173
  accountCurrency: defaultCurrency,
47776
48174
  transactionCurrency: currency,
@@ -47781,27 +48179,27 @@ var CompletePurchaseModal = ({
47781
48179
  return Formats_default.Price(total, defaultCurrency, false);
47782
48180
  }, [netAmount, currency, defaultCurrency, cash, credit, discount]);
47783
48181
  const { isSubmitting } = form.formState;
47784
- return /* @__PURE__ */ jsx261(Card, { isLoading: isSubmitting, children: /* @__PURE__ */ jsxs230("div", { className: "space-y-5", children: [
47785
- /* @__PURE__ */ jsxs230("div", { className: "bg-emerald-50 dark:bg-emerald-950/20 p-5 rounded-xl text-center space-y-1 border border-emerald-100 dark:border-emerald-900/30", children: [
47786
- /* @__PURE__ */ jsx261("span", { className: "text-xs uppercase tracking-wider text-emerald-600 dark:text-emerald-400 font-bold", children: "Net Total Amount" }),
47787
- /* @__PURE__ */ jsx261("h2", { className: "text-3xl font-black text-emerald-700 dark:text-emerald-300", children: Formats_default.Price(netAmount, currency, false) }),
47788
- discount > 0 && /* @__PURE__ */ jsxs230("p", { className: "text-xs text-gray-500 dark:text-zinc-400", children: [
48182
+ return /* @__PURE__ */ jsx263(Card, { isLoading: isSubmitting, children: /* @__PURE__ */ jsxs232("div", { className: "space-y-5", children: [
48183
+ /* @__PURE__ */ jsxs232("div", { className: "bg-emerald-50 dark:bg-emerald-950/20 p-5 rounded-xl text-center space-y-1 border border-emerald-100 dark:border-emerald-900/30", children: [
48184
+ /* @__PURE__ */ jsx263("span", { className: "text-xs uppercase tracking-wider text-emerald-600 dark:text-emerald-400 font-bold", children: "Net Total Amount" }),
48185
+ /* @__PURE__ */ jsx263("h2", { className: "text-3xl font-black text-emerald-700 dark:text-emerald-300", children: Formats_default.Price(netAmount, currency, false) }),
48186
+ discount > 0 && /* @__PURE__ */ jsxs232("p", { className: "text-xs text-gray-500 dark:text-zinc-400", children: [
47789
48187
  "Original:",
47790
48188
  " ",
47791
- /* @__PURE__ */ jsx261("span", { className: "line-through", children: Formats_default.Price(totalAmount, currency, false) })
48189
+ /* @__PURE__ */ jsx263("span", { className: "line-through", children: Formats_default.Price(totalAmount, currency, false) })
47792
48190
  ] })
47793
48191
  ] }),
47794
- /* @__PURE__ */ jsxs230("div", { className: "bg-zinc-50 dark:bg-zinc-900/40 p-4 rounded-xl border border-zinc-100 dark:border-zinc-800 space-y-4", children: [
47795
- /* @__PURE__ */ jsxs230("div", { className: "flex items-center justify-between border-b pb-2 dark:border-zinc-800", children: [
47796
- /* @__PURE__ */ jsx261("span", { className: "text-sm font-bold text-gray-800 dark:text-zinc-200", children: "1. Discount & Rate" }),
47797
- (discount > 0 || isRate) && /* @__PURE__ */ jsx261("span", { className: "text-xs px-2 py-0.5 bg-amber-50 text-amber-600 rounded-full font-medium dark:bg-amber-950/40 dark:text-amber-400", children: discount > 0 ? "Applied" : "Exchange Rate Required" })
48192
+ /* @__PURE__ */ jsxs232("div", { className: "bg-zinc-50 dark:bg-zinc-900/40 p-4 rounded-xl border border-zinc-100 dark:border-zinc-800 space-y-4", children: [
48193
+ /* @__PURE__ */ jsxs232("div", { className: "flex items-center justify-between border-b pb-2 dark:border-zinc-800", children: [
48194
+ /* @__PURE__ */ jsx263("span", { className: "text-sm font-bold text-gray-800 dark:text-zinc-200", children: "1. Discount & Rate" }),
48195
+ (discount > 0 || isRate) && /* @__PURE__ */ jsx263("span", { className: "text-xs px-2 py-0.5 bg-amber-50 text-amber-600 rounded-full font-medium dark:bg-amber-950/40 dark:text-amber-400", children: discount > 0 ? "Applied" : "Exchange Rate Required" })
47798
48196
  ] }),
47799
- /* @__PURE__ */ jsxs230(
48197
+ /* @__PURE__ */ jsxs232(
47800
48198
  "div",
47801
48199
  {
47802
48200
  className: isRate ? "grid grid-cols-1 md:grid-cols-2 gap-4" : "grid grid-cols-1 gap-4",
47803
48201
  children: [
47804
- /* @__PURE__ */ jsx261(
48202
+ /* @__PURE__ */ jsx263(
47805
48203
  Fields_default.Input,
47806
48204
  {
47807
48205
  label: "Discount Amount",
@@ -47812,7 +48210,7 @@ var CompletePurchaseModal = ({
47812
48210
  className: "h-[40px]!"
47813
48211
  }
47814
48212
  ),
47815
- isRate && /* @__PURE__ */ jsx261(
48213
+ isRate && /* @__PURE__ */ jsx263(
47816
48214
  Fields_default.Input,
47817
48215
  {
47818
48216
  label: "Rate",
@@ -47827,13 +48225,13 @@ var CompletePurchaseModal = ({
47827
48225
  }
47828
48226
  )
47829
48227
  ] }),
47830
- /* @__PURE__ */ jsxs230("div", { className: "bg-zinc-50 dark:bg-zinc-900/40 p-4 rounded-xl border border-zinc-100 dark:border-zinc-800 space-y-4", children: [
47831
- /* @__PURE__ */ jsxs230("div", { className: "flex items-center justify-between border-b pb-2 dark:border-zinc-800", children: [
47832
- /* @__PURE__ */ jsx261("span", { className: "text-sm font-bold text-gray-800 dark:text-zinc-200", children: "2. Cash Payment" }),
47833
- cash > 0 && /* @__PURE__ */ jsx261("span", { className: "text-xs px-2 py-0.5 bg-blue-50 text-blue-600 rounded-full font-medium dark:bg-blue-950/40 dark:text-blue-400", children: "Active" })
48228
+ /* @__PURE__ */ jsxs232("div", { className: "bg-zinc-50 dark:bg-zinc-900/40 p-4 rounded-xl border border-zinc-100 dark:border-zinc-800 space-y-4", children: [
48229
+ /* @__PURE__ */ jsxs232("div", { className: "flex items-center justify-between border-b pb-2 dark:border-zinc-800", children: [
48230
+ /* @__PURE__ */ jsx263("span", { className: "text-sm font-bold text-gray-800 dark:text-zinc-200", children: "2. Cash Payment" }),
48231
+ cash > 0 && /* @__PURE__ */ jsx263("span", { className: "text-xs px-2 py-0.5 bg-blue-50 text-blue-600 rounded-full font-medium dark:bg-blue-950/40 dark:text-blue-400", children: "Active" })
47834
48232
  ] }),
47835
- /* @__PURE__ */ jsxs230("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
47836
- /* @__PURE__ */ jsx261(
48233
+ /* @__PURE__ */ jsxs232("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
48234
+ /* @__PURE__ */ jsx263(
47837
48235
  Fields_default.Input,
47838
48236
  {
47839
48237
  label: "Cash Amount",
@@ -47844,7 +48242,7 @@ var CompletePurchaseModal = ({
47844
48242
  className: "h-[40px]!"
47845
48243
  }
47846
48244
  ),
47847
- /* @__PURE__ */ jsx261(
48245
+ /* @__PURE__ */ jsx263(
47848
48246
  Feilds_default2.Wallet,
47849
48247
  {
47850
48248
  name: "wallet",
@@ -47858,13 +48256,13 @@ var CompletePurchaseModal = ({
47858
48256
  )
47859
48257
  ] })
47860
48258
  ] }),
47861
- /* @__PURE__ */ jsxs230("div", { className: "bg-zinc-50 dark:bg-zinc-900/40 p-4 rounded-xl border border-zinc-100 dark:border-zinc-800 space-y-4", children: [
47862
- /* @__PURE__ */ jsxs230("div", { className: "flex items-center justify-between border-b pb-2 dark:border-zinc-800", children: [
47863
- /* @__PURE__ */ jsx261("span", { className: "text-sm font-bold text-gray-800 dark:text-zinc-200", children: "2. Credit Payment" }),
47864
- credit > 0 && /* @__PURE__ */ jsx261("span", { className: "text-xs px-2 py-0.5 bg-red-50 text-red-600 rounded-full font-medium dark:bg-red-950/40 dark:text-red-400", children: "Active" })
48259
+ /* @__PURE__ */ jsxs232("div", { className: "bg-zinc-50 dark:bg-zinc-900/40 p-4 rounded-xl border border-zinc-100 dark:border-zinc-800 space-y-4", children: [
48260
+ /* @__PURE__ */ jsxs232("div", { className: "flex items-center justify-between border-b pb-2 dark:border-zinc-800", children: [
48261
+ /* @__PURE__ */ jsx263("span", { className: "text-sm font-bold text-gray-800 dark:text-zinc-200", children: "2. Credit Payment" }),
48262
+ credit > 0 && /* @__PURE__ */ jsx263("span", { className: "text-xs px-2 py-0.5 bg-red-50 text-red-600 rounded-full font-medium dark:bg-red-950/40 dark:text-red-400", children: "Active" })
47865
48263
  ] }),
47866
- /* @__PURE__ */ jsxs230("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
47867
- /* @__PURE__ */ jsx261(
48264
+ /* @__PURE__ */ jsxs232("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
48265
+ /* @__PURE__ */ jsx263(
47868
48266
  Fields_default.Input,
47869
48267
  {
47870
48268
  label: "Credit Amount",
@@ -47875,7 +48273,7 @@ var CompletePurchaseModal = ({
47875
48273
  className: "h-[40px]!"
47876
48274
  }
47877
48275
  ),
47878
- /* @__PURE__ */ jsx261(
48276
+ /* @__PURE__ */ jsx263(
47879
48277
  Feilds_default.Customer,
47880
48278
  {
47881
48279
  name: "supplier",
@@ -47889,37 +48287,37 @@ var CompletePurchaseModal = ({
47889
48287
  )
47890
48288
  ] })
47891
48289
  ] }),
47892
- /* @__PURE__ */ jsxs230("div", { className: "pt-2 space-y-2.5", children: [
47893
- /* @__PURE__ */ jsxs230("div", { className: "flex justify-between items-center text-sm px-2", children: [
47894
- /* @__PURE__ */ jsx261("span", { className: "text-gray-500 dark:text-zinc-400", children: "Total Before Discount:" }),
47895
- /* @__PURE__ */ jsx261("span", { className: "font-semibold text-gray-900 dark:text-white", children: Formats_default.Price(totalAmount, currency, false) })
48290
+ /* @__PURE__ */ jsxs232("div", { className: "pt-2 space-y-2.5", children: [
48291
+ /* @__PURE__ */ jsxs232("div", { className: "flex justify-between items-center text-sm px-2", children: [
48292
+ /* @__PURE__ */ jsx263("span", { className: "text-gray-500 dark:text-zinc-400", children: "Total Before Discount:" }),
48293
+ /* @__PURE__ */ jsx263("span", { className: "font-semibold text-gray-900 dark:text-white", children: Formats_default.Price(totalAmount, currency, false) })
47896
48294
  ] }),
47897
- discount > 0 && /* @__PURE__ */ jsxs230("div", { className: "flex justify-between items-center text-sm px-2 text-amber-600 dark:text-amber-400", children: [
47898
- /* @__PURE__ */ jsx261("span", { children: "Discount Applied:" }),
47899
- /* @__PURE__ */ jsxs230("span", { children: [
48295
+ discount > 0 && /* @__PURE__ */ jsxs232("div", { className: "flex justify-between items-center text-sm px-2 text-amber-600 dark:text-amber-400", children: [
48296
+ /* @__PURE__ */ jsx263("span", { children: "Discount Applied:" }),
48297
+ /* @__PURE__ */ jsxs232("span", { children: [
47900
48298
  "-",
47901
48299
  Formats_default.Price(discount, currency, false)
47902
48300
  ] })
47903
48301
  ] }),
47904
- /* @__PURE__ */ jsxs230("div", { className: "flex justify-between items-center text-sm px-2 text-blue-600 dark:text-blue-400", children: [
47905
- /* @__PURE__ */ jsx261("span", { children: "Cash Paid:" }),
47906
- /* @__PURE__ */ jsx261("span", { children: Formats_default.Price(cash, currency, false) })
48302
+ /* @__PURE__ */ jsxs232("div", { className: "flex justify-between items-center text-sm px-2 text-blue-600 dark:text-blue-400", children: [
48303
+ /* @__PURE__ */ jsx263("span", { children: "Cash Paid:" }),
48304
+ /* @__PURE__ */ jsx263("span", { children: Formats_default.Price(cash, currency, false) })
47907
48305
  ] }),
47908
- /* @__PURE__ */ jsxs230("div", { className: "flex justify-between items-center text-sm px-2 text-red-500 dark:text-red-400", children: [
47909
- /* @__PURE__ */ jsx261("span", { children: "Credit Amount:" }),
47910
- /* @__PURE__ */ jsx261("span", { children: Formats_default.Price(credit, currency, false) })
48306
+ /* @__PURE__ */ jsxs232("div", { className: "flex justify-between items-center text-sm px-2 text-red-500 dark:text-red-400", children: [
48307
+ /* @__PURE__ */ jsx263("span", { children: "Credit Amount:" }),
48308
+ /* @__PURE__ */ jsx263("span", { children: Formats_default.Price(credit, currency, false) })
47911
48309
  ] }),
47912
- /* @__PURE__ */ jsxs230("div", { className: "flex justify-between items-center text-base font-bold bg-zinc-100 dark:bg-zinc-800/80 p-3 rounded-lg text-gray-900 dark:text-white mt-1", children: [
47913
- /* @__PURE__ */ jsx261("span", { children: "Net Total:" }),
47914
- /* @__PURE__ */ jsx261("span", { children: Formats_default.Price(netAmount, currency, false) })
48310
+ /* @__PURE__ */ jsxs232("div", { className: "flex justify-between items-center text-base font-bold bg-zinc-100 dark:bg-zinc-800/80 p-3 rounded-lg text-gray-900 dark:text-white mt-1", children: [
48311
+ /* @__PURE__ */ jsx263("span", { children: "Net Total:" }),
48312
+ /* @__PURE__ */ jsx263("span", { children: Formats_default.Price(netAmount, currency, false) })
47915
48313
  ] }),
47916
- isRate && /* @__PURE__ */ jsxs230("div", { className: "flex justify-between items-center text-base font-bold bg-zinc-100 dark:bg-zinc-800/80 p-3 rounded-lg text-gray-900 dark:text-white mt-1", children: [
47917
- /* @__PURE__ */ jsx261("span", { children: "Exchanged Net Total:" }),
47918
- /* @__PURE__ */ jsx261("span", { children: exchangedNet })
48314
+ isRate && /* @__PURE__ */ jsxs232("div", { className: "flex justify-between items-center text-base font-bold bg-zinc-100 dark:bg-zinc-800/80 p-3 rounded-lg text-gray-900 dark:text-white mt-1", children: [
48315
+ /* @__PURE__ */ jsx263("span", { children: "Exchanged Net Total:" }),
48316
+ /* @__PURE__ */ jsx263("span", { children: exchangedNet })
47919
48317
  ] })
47920
48318
  ] }),
47921
- /* @__PURE__ */ jsxs230("div", { className: "flex justify-end gap-3 pt-3 border-t dark:border-zinc-800", children: [
47922
- /* @__PURE__ */ jsx261(
48319
+ /* @__PURE__ */ jsxs232("div", { className: "flex justify-end gap-3 pt-3 border-t dark:border-zinc-800", children: [
48320
+ /* @__PURE__ */ jsx263(
47923
48321
  Button,
47924
48322
  {
47925
48323
  onClick: closeModal,
@@ -47931,7 +48329,7 @@ var CompletePurchaseModal = ({
47931
48329
  children: "Cancel"
47932
48330
  }
47933
48331
  ),
47934
- /* @__PURE__ */ jsx261(
48332
+ /* @__PURE__ */ jsx263(
47935
48333
  Button,
47936
48334
  {
47937
48335
  onClick: onSubmit,
@@ -47949,11 +48347,11 @@ var CompletePurchaseModal = ({
47949
48347
  var Submit_default3 = CompletePurchaseModal;
47950
48348
 
47951
48349
  // src/components/Transactions/3/purchase3/pos.tsx
47952
- import { Fragment as Fragment130, jsx as jsx262, jsxs as jsxs231 } from "react/jsx-runtime";
48350
+ import { Fragment as Fragment132, jsx as jsx264, jsxs as jsxs233 } from "react/jsx-runtime";
47953
48351
  var Purchase3Form = ({ type }) => {
47954
48352
  const { getQuery, navigate } = useApp_default();
47955
48353
  const stockType = type;
47956
- const { branchId } = useParams103();
48354
+ const { branchId } = useParams105();
47957
48355
  const purchaseId = getQuery("id");
47958
48356
  const { currencies } = useWarqadConfig();
47959
48357
  const { defaultCurrency } = currencies;
@@ -48095,7 +48493,7 @@ var Purchase3Form = ({ type }) => {
48095
48493
  type: "complete_purchase2",
48096
48494
  title: "Complete purchase",
48097
48495
  width: 650,
48098
- content: /* @__PURE__ */ jsx262(
48496
+ content: /* @__PURE__ */ jsx264(
48099
48497
  Submit_default3,
48100
48498
  {
48101
48499
  totalAmount,
@@ -48160,25 +48558,25 @@ var Purchase3Form = ({ type }) => {
48160
48558
  fetchData();
48161
48559
  }
48162
48560
  }, [purchaseId]);
48163
- return /* @__PURE__ */ jsxs231(FormProvider6, { ...methods, children: [
48164
- /* @__PURE__ */ jsx262(Modal2, {}),
48165
- /* @__PURE__ */ jsx262("div", { className: "space-y-6 ", children: /* @__PURE__ */ jsx262("div", { className: "grid grid-cols-1 gap-6", children: /* @__PURE__ */ jsxs231(Card, { children: [
48166
- /* @__PURE__ */ jsxs231(Card.Header, { children: [
48167
- /* @__PURE__ */ jsxs231("div", { className: "flex justify-between gap-2 items-center", children: [
48168
- /* @__PURE__ */ jsxs231("section", { children: [
48169
- /* @__PURE__ */ jsxs231(Card.Title, { children: [
48561
+ return /* @__PURE__ */ jsxs233(FormProvider6, { ...methods, children: [
48562
+ /* @__PURE__ */ jsx264(Modal2, {}),
48563
+ /* @__PURE__ */ jsx264("div", { className: "space-y-6 ", children: /* @__PURE__ */ jsx264("div", { className: "grid grid-cols-1 gap-6", children: /* @__PURE__ */ jsxs233(Card, { children: [
48564
+ /* @__PURE__ */ jsxs233(Card.Header, { children: [
48565
+ /* @__PURE__ */ jsxs233("div", { className: "flex justify-between gap-2 items-center", children: [
48566
+ /* @__PURE__ */ jsxs233("section", { children: [
48567
+ /* @__PURE__ */ jsxs233(Card.Title, { children: [
48170
48568
  stockType,
48171
48569
  " Stock purchase Table"
48172
48570
  ] }),
48173
- /* @__PURE__ */ jsx262(Card.Description, { children: !purchaseId ? "Add items to the table and process the purchase" : "Edit items in the table and update the purchase" })
48571
+ /* @__PURE__ */ jsx264(Card.Description, { children: !purchaseId ? "Add items to the table and process the purchase" : "Edit items in the table and update the purchase" })
48174
48572
  ] }),
48175
- /* @__PURE__ */ jsx262(
48573
+ /* @__PURE__ */ jsx264(
48176
48574
  Button,
48177
48575
  {
48178
48576
  onClick: () => {
48179
48577
  navigate(-1);
48180
48578
  },
48181
- icon: /* @__PURE__ */ jsx262(ArrowLeft12, {}),
48579
+ icon: /* @__PURE__ */ jsx264(ArrowLeft12, {}),
48182
48580
  size: "sm",
48183
48581
  type: "button",
48184
48582
  variant: "warning",
@@ -48187,9 +48585,9 @@ var Purchase3Form = ({ type }) => {
48187
48585
  }
48188
48586
  )
48189
48587
  ] }),
48190
- /* @__PURE__ */ jsx262(header_default6, { stockType })
48588
+ /* @__PURE__ */ jsx264(header_default6, { stockType })
48191
48589
  ] }),
48192
- /* @__PURE__ */ jsx262(Card.Content, { className: "space-y-6", children: /* @__PURE__ */ jsx262(
48590
+ /* @__PURE__ */ jsx264(Card.Content, { className: "space-y-6", children: /* @__PURE__ */ jsx264(
48193
48591
  table_default6,
48194
48592
  {
48195
48593
  data: postData,
@@ -48200,8 +48598,8 @@ var Purchase3Form = ({ type }) => {
48200
48598
  adjustmentId: purchaseId
48201
48599
  }
48202
48600
  ) }),
48203
- /* @__PURE__ */ jsx262(Card.Footer, { className: "flex justify-end space-y-2", children: /* @__PURE__ */ jsxs231("div", { className: "flex items-center gap-3", children: [
48204
- !purchaseId ? /* @__PURE__ */ jsx262(Fragment130, { children: storage.has(getStorageType6(stockType)) && postData?.length > 0 && /* @__PURE__ */ jsx262(
48601
+ /* @__PURE__ */ jsx264(Card.Footer, { className: "flex justify-end space-y-2", children: /* @__PURE__ */ jsxs233("div", { className: "flex items-center gap-3", children: [
48602
+ !purchaseId ? /* @__PURE__ */ jsx264(Fragment132, { children: storage.has(getStorageType6(stockType)) && postData?.length > 0 && /* @__PURE__ */ jsx264(
48205
48603
  Popconfirm7,
48206
48604
  {
48207
48605
  title: "Are you sure you want to clear the draft?",
@@ -48210,7 +48608,7 @@ var Purchase3Form = ({ type }) => {
48210
48608
  storage.remove(getStorageType6(stockType));
48211
48609
  setPostData([]);
48212
48610
  },
48213
- children: /* @__PURE__ */ jsx262(
48611
+ children: /* @__PURE__ */ jsx264(
48214
48612
  Button,
48215
48613
  {
48216
48614
  size: "md",
@@ -48221,7 +48619,7 @@ var Purchase3Form = ({ type }) => {
48221
48619
  }
48222
48620
  )
48223
48621
  }
48224
- ) }) : /* @__PURE__ */ jsx262(
48622
+ ) }) : /* @__PURE__ */ jsx264(
48225
48623
  Button,
48226
48624
  {
48227
48625
  onClick: () => {
@@ -48235,7 +48633,7 @@ var Purchase3Form = ({ type }) => {
48235
48633
  children: "Cancel"
48236
48634
  }
48237
48635
  ),
48238
- /* @__PURE__ */ jsx262(
48636
+ /* @__PURE__ */ jsx264(
48239
48637
  Button,
48240
48638
  {
48241
48639
  onClick: handleSubmit(onMainFormSubmit, (e) => {
@@ -48273,12 +48671,12 @@ var purchase3 = {
48273
48671
  var purchase3_default = purchase3;
48274
48672
 
48275
48673
  // src/components/Transactions/3/expense/Expenses.tsx
48276
- import { useNavigate as useNavigate63, useParams as useParams104 } from "react-router-dom";
48277
- import { EllipsisVertical as EllipsisVertical46, FilePenLine as FilePenLine42, Trash2 as Trash252 } from "lucide-react";
48278
- import { Fragment as Fragment131, jsx as jsx263, jsxs as jsxs232 } from "react/jsx-runtime";
48674
+ import { useNavigate as useNavigate64, useParams as useParams106 } from "react-router-dom";
48675
+ import { EllipsisVertical as EllipsisVertical47, FilePenLine as FilePenLine43, Trash2 as Trash253 } from "lucide-react";
48676
+ import { Fragment as Fragment133, jsx as jsx265, jsxs as jsxs234 } from "react/jsx-runtime";
48279
48677
  function Expenses3({ url }) {
48280
- const { branchId } = useParams104();
48281
- const navigate = useNavigate63();
48678
+ const { branchId } = useParams106();
48679
+ const navigate = useNavigate64();
48282
48680
  const { TransactionView, openTransaction } = useTransactionView_default();
48283
48681
  const { data, TransactionViewComponent, reload } = useTransaction_default({
48284
48682
  url: url || `/transactions/get?type=expense-3${branchId ? `&branch=${branchId}` : ""}`,
@@ -48288,17 +48686,17 @@ function Expenses3({ url }) {
48288
48686
  const items = (data2) => [
48289
48687
  {
48290
48688
  label: `View Expense`,
48291
- icon: /* @__PURE__ */ jsx263(FilePenLine42, { size: 16 }),
48689
+ icon: /* @__PURE__ */ jsx265(FilePenLine43, { size: 16 }),
48292
48690
  onClick: () => openTransaction({ id: data2?._id, type: "expense-3" })
48293
48691
  },
48294
48692
  {
48295
48693
  label: `Edit Expense`,
48296
- icon: /* @__PURE__ */ jsx263(FilePenLine42, { size: 16 }),
48694
+ icon: /* @__PURE__ */ jsx265(FilePenLine43, { size: 16 }),
48297
48695
  onClick: () => navigate(`update?id=${data2?._id}`)
48298
48696
  },
48299
48697
  {
48300
48698
  label: `Delete Expense`,
48301
- icon: /* @__PURE__ */ jsx263(Trash252, { className: "text-red-500", size: 16 }),
48699
+ icon: /* @__PURE__ */ jsx265(Trash253, { className: "text-red-500", size: 16 }),
48302
48700
  onClick: () => {
48303
48701
  openTransaction({
48304
48702
  id: data2?._id,
@@ -48314,9 +48712,9 @@ function Expenses3({ url }) {
48314
48712
  header: "Date",
48315
48713
  cell: ({ row }) => {
48316
48714
  const expense = row.original;
48317
- return /* @__PURE__ */ jsxs232("div", { className: "flex flex-col", children: [
48318
- /* @__PURE__ */ jsx263("span", { children: expense?.date }),
48319
- /* @__PURE__ */ jsx263(
48715
+ return /* @__PURE__ */ jsxs234("div", { className: "flex flex-col", children: [
48716
+ /* @__PURE__ */ jsx265("span", { children: expense?.date }),
48717
+ /* @__PURE__ */ jsx265(
48320
48718
  "span",
48321
48719
  {
48322
48720
  onClick: () => openTransaction({ id: expense?._id, type: "expense-3" }),
@@ -48332,9 +48730,9 @@ function Expenses3({ url }) {
48332
48730
  header: "Description",
48333
48731
  cell: ({ row }) => {
48334
48732
  const expense = row.original;
48335
- return /* @__PURE__ */ jsxs232("div", { className: "flex flex-col", children: [
48336
- /* @__PURE__ */ jsx263("span", { className: "capitalize", children: expense?.description }),
48337
- expense?.note && /* @__PURE__ */ jsx263("span", { className: "text-xs text-gray-500 italic max-w-xs truncate", children: expense?.note })
48733
+ return /* @__PURE__ */ jsxs234("div", { className: "flex flex-col", children: [
48734
+ /* @__PURE__ */ jsx265("span", { className: "capitalize", children: expense?.description }),
48735
+ expense?.note && /* @__PURE__ */ jsx265("span", { className: "text-xs text-gray-500 italic max-w-xs truncate", children: expense?.note })
48338
48736
  ] });
48339
48737
  }
48340
48738
  },
@@ -48344,7 +48742,7 @@ function Expenses3({ url }) {
48344
48742
  cell: ({ row }) => {
48345
48743
  const expense = row.original;
48346
48744
  const walletData = expense?.fromWalletData || expense?.toWalletData;
48347
- return /* @__PURE__ */ jsx263("span", { children: walletData?.name || "N/A" });
48745
+ return /* @__PURE__ */ jsx265("span", { children: walletData?.name || "N/A" });
48348
48746
  }
48349
48747
  },
48350
48748
  {
@@ -48352,7 +48750,7 @@ function Expenses3({ url }) {
48352
48750
  header: "Amount",
48353
48751
  cell: ({ row }) => {
48354
48752
  const expense = row.original;
48355
- return /* @__PURE__ */ jsx263("div", { className: "", children: /* @__PURE__ */ jsx263("p", { className: "font-medium text-red-600", children: Formats_default.Price(expense?.amount, expense?.currency) }) });
48753
+ return /* @__PURE__ */ jsx265("div", { className: "", children: /* @__PURE__ */ jsx265("p", { className: "font-medium text-red-600", children: Formats_default.Price(expense?.amount, expense?.currency) }) });
48356
48754
  }
48357
48755
  },
48358
48756
  {
@@ -48360,23 +48758,23 @@ function Expenses3({ url }) {
48360
48758
  header: "Actions",
48361
48759
  cell: ({ row }) => {
48362
48760
  const data2 = row.original;
48363
- return /* @__PURE__ */ jsx263(
48761
+ return /* @__PURE__ */ jsx265(
48364
48762
  Dropdown,
48365
48763
  {
48366
48764
  className: "cursor-pointer w-[150px]",
48367
48765
  items: items(data2),
48368
48766
  triggerMode: "hover",
48369
- children: /* @__PURE__ */ jsx263(EllipsisVertical46, {})
48767
+ children: /* @__PURE__ */ jsx265(EllipsisVertical47, {})
48370
48768
  }
48371
48769
  );
48372
48770
  }
48373
48771
  }
48374
48772
  ];
48375
48773
  const expenses = data?.data || [];
48376
- return /* @__PURE__ */ jsxs232(Fragment131, { children: [
48377
- /* @__PURE__ */ jsx263(TransactionView, {}),
48378
- /* @__PURE__ */ jsx263(Modal2, {}),
48379
- /* @__PURE__ */ jsx263(
48774
+ return /* @__PURE__ */ jsxs234(Fragment133, { children: [
48775
+ /* @__PURE__ */ jsx265(TransactionView, {}),
48776
+ /* @__PURE__ */ jsx265(Modal2, {}),
48777
+ /* @__PURE__ */ jsx265(
48380
48778
  TransactionViewComponent,
48381
48779
  {
48382
48780
  columns,
@@ -48395,8 +48793,8 @@ function Expenses3({ url }) {
48395
48793
  var Expenses_default2 = Expenses3;
48396
48794
 
48397
48795
  // src/components/Transactions/3/expense/ExpenseForm.tsx
48398
- import { useEffect as useEffect113, useMemo as useMemo51, useState as useState112 } from "react";
48399
- import { useParams as useParams105 } from "react-router-dom";
48796
+ import { useEffect as useEffect113, useMemo as useMemo52, useState as useState112 } from "react";
48797
+ import { useParams as useParams107 } from "react-router-dom";
48400
48798
  import { useForm as useForm57 } from "react-hook-form";
48401
48799
  import { zodResolver as zodResolver56 } from "@hookform/resolvers/zod";
48402
48800
  import { message as message84 } from "antd";
@@ -48416,9 +48814,9 @@ var expenseSchema4 = z48.object({
48416
48814
  });
48417
48815
 
48418
48816
  // src/components/Transactions/3/expense/ExpenseForm.tsx
48419
- import { Fragment as Fragment132, jsx as jsx264, jsxs as jsxs233 } from "react/jsx-runtime";
48817
+ import { Fragment as Fragment134, jsx as jsx266, jsxs as jsxs235 } from "react/jsx-runtime";
48420
48818
  function ExpenseForm2() {
48421
- const { branchId } = useParams105();
48819
+ const { branchId } = useParams107();
48422
48820
  const { getQuery, navigate } = useApp_default();
48423
48821
  const id = getQuery("id");
48424
48822
  const isEdit = !!id;
@@ -48443,7 +48841,7 @@ function ExpenseForm2() {
48443
48841
  const isRate = currency && currency !== defaultCurrency;
48444
48842
  const amount = watch("amount");
48445
48843
  const rate = watch("rate");
48446
- const exchangedAmount2 = useMemo51(() => {
48844
+ const exchangedAmount2 = useMemo52(() => {
48447
48845
  if (isRate) {
48448
48846
  const am = forex_default.exchangedAmount({
48449
48847
  accountCurrency: defaultCurrency,
@@ -48496,25 +48894,25 @@ function ExpenseForm2() {
48496
48894
  fetches();
48497
48895
  }
48498
48896
  }, [id]);
48499
- return /* @__PURE__ */ jsxs233(
48897
+ return /* @__PURE__ */ jsxs235(
48500
48898
  Card,
48501
48899
  {
48502
48900
  className: "max-w-4xl mx-auto mt-10 relative",
48503
48901
  isLoading: isLoadingGet,
48504
48902
  loadingText: "Processing...",
48505
48903
  children: [
48506
- /* @__PURE__ */ jsxs233(Card.Header, { children: [
48507
- /* @__PURE__ */ jsx264(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Expense` }),
48508
- /* @__PURE__ */ jsx264(Card.Description, { children: isEdit ? `Update the details for this expense entry` : `Record a new business expense` })
48904
+ /* @__PURE__ */ jsxs235(Card.Header, { children: [
48905
+ /* @__PURE__ */ jsx266(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Expense` }),
48906
+ /* @__PURE__ */ jsx266(Card.Description, { children: isEdit ? `Update the details for this expense entry` : `Record a new business expense` })
48509
48907
  ] }),
48510
- /* @__PURE__ */ jsx264(Card.Content, { children: /* @__PURE__ */ jsxs233(
48908
+ /* @__PURE__ */ jsx266(Card.Content, { children: /* @__PURE__ */ jsxs235(
48511
48909
  "form",
48512
48910
  {
48513
48911
  className: "space-y-4",
48514
48912
  onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
48515
48913
  children: [
48516
- /* @__PURE__ */ jsxs233("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
48517
- /* @__PURE__ */ jsx264(
48914
+ /* @__PURE__ */ jsxs235("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
48915
+ /* @__PURE__ */ jsx266(
48518
48916
  Fields_default.Input,
48519
48917
  {
48520
48918
  label: "Description",
@@ -48524,7 +48922,7 @@ function ExpenseForm2() {
48524
48922
  required: true
48525
48923
  }
48526
48924
  ),
48527
- /* @__PURE__ */ jsx264(
48925
+ /* @__PURE__ */ jsx266(
48528
48926
  Feilds_default2.Wallet,
48529
48927
  {
48530
48928
  label: "Wallet",
@@ -48537,8 +48935,8 @@ function ExpenseForm2() {
48537
48935
  }
48538
48936
  )
48539
48937
  ] }),
48540
- /* @__PURE__ */ jsxs233("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
48541
- /* @__PURE__ */ jsx264(
48938
+ /* @__PURE__ */ jsxs235("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
48939
+ /* @__PURE__ */ jsx266(
48542
48940
  Fields_default.DateInput,
48543
48941
  {
48544
48942
  label: "Date",
@@ -48547,7 +48945,7 @@ function ExpenseForm2() {
48547
48945
  required: true
48548
48946
  }
48549
48947
  ),
48550
- /* @__PURE__ */ jsx264(
48948
+ /* @__PURE__ */ jsx266(
48551
48949
  Fields_default.Input,
48552
48950
  {
48553
48951
  label: "Amount",
@@ -48558,8 +48956,8 @@ function ExpenseForm2() {
48558
48956
  required: true
48559
48957
  }
48560
48958
  ),
48561
- isRate && /* @__PURE__ */ jsxs233(Fragment132, { children: [
48562
- /* @__PURE__ */ jsx264(
48959
+ isRate && /* @__PURE__ */ jsxs235(Fragment134, { children: [
48960
+ /* @__PURE__ */ jsx266(
48563
48961
  Fields_default.Input,
48564
48962
  {
48565
48963
  label: "Rate",
@@ -48570,7 +48968,7 @@ function ExpenseForm2() {
48570
48968
  required: true
48571
48969
  }
48572
48970
  ),
48573
- /* @__PURE__ */ jsx264(
48971
+ /* @__PURE__ */ jsx266(
48574
48972
  Fields_default.Input,
48575
48973
  {
48576
48974
  label: "Exchanged Amount",
@@ -48582,7 +48980,7 @@ function ExpenseForm2() {
48582
48980
  )
48583
48981
  ] })
48584
48982
  ] }),
48585
- /* @__PURE__ */ jsx264(
48983
+ /* @__PURE__ */ jsx266(
48586
48984
  Fields_default.Textarea,
48587
48985
  {
48588
48986
  label: "Note",
@@ -48591,7 +48989,7 @@ function ExpenseForm2() {
48591
48989
  placeholder: "Add any additional details..."
48592
48990
  }
48593
48991
  ),
48594
- /* @__PURE__ */ jsx264("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx264(
48992
+ /* @__PURE__ */ jsx266("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx266(
48595
48993
  Button,
48596
48994
  {
48597
48995
  isLoading,
@@ -48619,13 +49017,13 @@ var Expenses32 = {
48619
49017
  var expense_default = Expenses32;
48620
49018
 
48621
49019
  // src/components/Transactions/3/reports/Expenses3Reports.tsx
48622
- import { useParams as useParams106 } from "react-router-dom";
48623
- import { useMemo as useMemo52, useState as useState113 } from "react";
49020
+ import { useParams as useParams108 } from "react-router-dom";
49021
+ import { useMemo as useMemo53, useState as useState113 } from "react";
48624
49022
  import { DatePicker as DatePicker9 } from "antd";
48625
49023
  import dayjs11 from "dayjs";
48626
- import { Fragment as Fragment133, jsx as jsx265, jsxs as jsxs234 } from "react/jsx-runtime";
49024
+ import { Fragment as Fragment135, jsx as jsx267, jsxs as jsxs236 } from "react/jsx-runtime";
48627
49025
  var Expenses3Reports = () => {
48628
- const { branchId } = useParams106();
49026
+ const { branchId } = useParams108();
48629
49027
  const [startDate, setStartDate] = useState113(null);
48630
49028
  const [endDate, setEndDate] = useState113(null);
48631
49029
  const { A4DataView, data } = useA4DataView_default({
@@ -48640,9 +49038,9 @@ var Expenses3Reports = () => {
48640
49038
  header: "Date",
48641
49039
  key: "date",
48642
49040
  className: "text-xs whitespace-nowrap",
48643
- render: (row) => /* @__PURE__ */ jsxs234("div", { className: "", children: [
48644
- /* @__PURE__ */ jsx265("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
48645
- /* @__PURE__ */ jsx265(
49041
+ render: (row) => /* @__PURE__ */ jsxs236("div", { className: "", children: [
49042
+ /* @__PURE__ */ jsx267("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
49043
+ /* @__PURE__ */ jsx267(
48646
49044
  "span",
48647
49045
  {
48648
49046
  onClick: () => {
@@ -48662,9 +49060,9 @@ var Expenses3Reports = () => {
48662
49060
  key: "description",
48663
49061
  className: "text-xs whitespace-nowrap ",
48664
49062
  render: (row) => {
48665
- return /* @__PURE__ */ jsxs234("div", { className: "", children: [
48666
- /* @__PURE__ */ jsx265("p", { className: "font-bold capitalize text-black dark:text-white print:text-black", children: row.description }),
48667
- row.note && /* @__PURE__ */ jsx265("p", { className: "font-medium italic text-[8px] capitalize text-gray-500 dark:text-white ", children: row.note })
49063
+ return /* @__PURE__ */ jsxs236("div", { className: "", children: [
49064
+ /* @__PURE__ */ jsx267("p", { className: "font-bold capitalize text-black dark:text-white print:text-black", children: row.description }),
49065
+ row.note && /* @__PURE__ */ jsx267("p", { className: "font-medium italic text-[8px] capitalize text-gray-500 dark:text-white ", children: row.note })
48668
49066
  ] });
48669
49067
  }
48670
49068
  },
@@ -48672,16 +49070,16 @@ var Expenses3Reports = () => {
48672
49070
  header: "Amount",
48673
49071
  key: "changedAmountString",
48674
49072
  className: "text-xs whitespace-nowrap text-right",
48675
- render: (row) => /* @__PURE__ */ jsx265("span", { className: "font-bold text-black dark:text-white print:text-black", children: row.changedAmountString }),
49073
+ render: (row) => /* @__PURE__ */ jsx267("span", { className: "font-bold text-black dark:text-white print:text-black", children: row.changedAmountString }),
48676
49074
  renderFooter: (data2) => {
48677
- return /* @__PURE__ */ jsx265("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
49075
+ return /* @__PURE__ */ jsx267("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
48678
49076
  Math.abs(data2.reduce((acc, row) => acc + row.changedAmount, 0)),
48679
49077
  defaultCurrency
48680
49078
  ) });
48681
49079
  }
48682
49080
  }
48683
49081
  ];
48684
- const datas = useMemo52(() => {
49082
+ const datas = useMemo53(() => {
48685
49083
  let runningBalance = 0;
48686
49084
  let filteredData = data?.data || [];
48687
49085
  const mapped = filteredData.map((item) => {
@@ -48715,9 +49113,9 @@ var Expenses3Reports = () => {
48715
49113
  }
48716
49114
  return filtered;
48717
49115
  }, [data, startDate, endDate]);
48718
- return /* @__PURE__ */ jsxs234(Fragment133, { children: [
48719
- /* @__PURE__ */ jsx265(TransactionView, {}),
48720
- /* @__PURE__ */ jsx265(
49116
+ return /* @__PURE__ */ jsxs236(Fragment135, { children: [
49117
+ /* @__PURE__ */ jsx267(TransactionView, {}),
49118
+ /* @__PURE__ */ jsx267(
48721
49119
  A4DataView,
48722
49120
  {
48723
49121
  columns,
@@ -48726,8 +49124,8 @@ var Expenses3Reports = () => {
48726
49124
  title: `Expenses Report`,
48727
49125
  subtitle: `All Expenses`,
48728
49126
  fixed: false,
48729
- headers: /* @__PURE__ */ jsxs234("div", { className: "flex gap-2 items-center print:hidden flex-wrap", children: [
48730
- /* @__PURE__ */ jsx265(
49127
+ headers: /* @__PURE__ */ jsxs236("div", { className: "flex gap-2 items-center print:hidden flex-wrap", children: [
49128
+ /* @__PURE__ */ jsx267(
48731
49129
  DatePicker9,
48732
49130
  {
48733
49131
  placeholder: "Start Date",
@@ -48737,7 +49135,7 @@ var Expenses3Reports = () => {
48737
49135
  className: "min-w-[140px] max-w-[160px]"
48738
49136
  }
48739
49137
  ),
48740
- /* @__PURE__ */ jsx265(
49138
+ /* @__PURE__ */ jsx267(
48741
49139
  DatePicker9,
48742
49140
  {
48743
49141
  placeholder: "End Date",
@@ -48755,13 +49153,13 @@ var Expenses3Reports = () => {
48755
49153
  var Expenses3Reports_default = Expenses3Reports;
48756
49154
 
48757
49155
  // src/components/Transactions/3/reports/ExpensesJournal3.tsx
48758
- import { useParams as useParams107 } from "react-router-dom";
48759
- import { useMemo as useMemo53, useState as useState114 } from "react";
49156
+ import { useParams as useParams109 } from "react-router-dom";
49157
+ import { useMemo as useMemo54, useState as useState114 } from "react";
48760
49158
  import { DatePicker as DatePicker10 } from "antd";
48761
49159
  import dayjs12 from "dayjs";
48762
- import { Fragment as Fragment134, jsx as jsx266, jsxs as jsxs235 } from "react/jsx-runtime";
49160
+ import { Fragment as Fragment136, jsx as jsx268, jsxs as jsxs237 } from "react/jsx-runtime";
48763
49161
  var Expenses3Reports2 = () => {
48764
- const { branchId } = useParams107();
49162
+ const { branchId } = useParams109();
48765
49163
  const [startDate, setStartDate] = useState114(null);
48766
49164
  const [endDate, setEndDate] = useState114(null);
48767
49165
  const { A4DataView, data } = useA4DataView_default({
@@ -48776,9 +49174,9 @@ var Expenses3Reports2 = () => {
48776
49174
  header: "Date",
48777
49175
  key: "date",
48778
49176
  className: "text-xs whitespace-nowrap",
48779
- render: (row) => /* @__PURE__ */ jsxs235("div", { className: "", children: [
48780
- /* @__PURE__ */ jsx266("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
48781
- /* @__PURE__ */ jsx266(
49177
+ render: (row) => /* @__PURE__ */ jsxs237("div", { className: "", children: [
49178
+ /* @__PURE__ */ jsx268("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
49179
+ /* @__PURE__ */ jsx268(
48782
49180
  "span",
48783
49181
  {
48784
49182
  onClick: () => {
@@ -48798,9 +49196,9 @@ var Expenses3Reports2 = () => {
48798
49196
  key: "description",
48799
49197
  className: "text-xs whitespace-nowrap ",
48800
49198
  render: (row) => {
48801
- return /* @__PURE__ */ jsxs235("div", { className: "", children: [
48802
- /* @__PURE__ */ jsx266("p", { className: "font-bold capitalize text-black dark:text-white print:text-black", children: row.description }),
48803
- row.note && /* @__PURE__ */ jsx266("p", { className: "font-medium italic text-[8px] capitalize text-gray-500 dark:text-white ", children: row.note })
49199
+ return /* @__PURE__ */ jsxs237("div", { className: "", children: [
49200
+ /* @__PURE__ */ jsx268("p", { className: "font-bold capitalize text-black dark:text-white print:text-black", children: row.description }),
49201
+ row.note && /* @__PURE__ */ jsx268("p", { className: "font-medium italic text-[8px] capitalize text-gray-500 dark:text-white ", children: row.note })
48804
49202
  ] });
48805
49203
  }
48806
49204
  },
@@ -48808,16 +49206,16 @@ var Expenses3Reports2 = () => {
48808
49206
  header: "Amount",
48809
49207
  key: "changedAmountString",
48810
49208
  className: "text-xs whitespace-nowrap text-right",
48811
- render: (row) => /* @__PURE__ */ jsx266("span", { className: "font-bold text-black dark:text-white print:text-black", children: row.changedAmountString }),
49209
+ render: (row) => /* @__PURE__ */ jsx268("span", { className: "font-bold text-black dark:text-white print:text-black", children: row.changedAmountString }),
48812
49210
  renderFooter: (data2) => {
48813
- return /* @__PURE__ */ jsx266("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
49211
+ return /* @__PURE__ */ jsx268("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
48814
49212
  Math.abs(data2.reduce((acc, row) => acc + row.changedAmount, 0)),
48815
49213
  defaultCurrency
48816
49214
  ) });
48817
49215
  }
48818
49216
  }
48819
49217
  ];
48820
- const datas = useMemo53(() => {
49218
+ const datas = useMemo54(() => {
48821
49219
  let runningBalance = 0;
48822
49220
  let filteredData = data?.data || [];
48823
49221
  const mapped = filteredData.map((item) => {
@@ -48851,9 +49249,9 @@ var Expenses3Reports2 = () => {
48851
49249
  }
48852
49250
  return filtered;
48853
49251
  }, [data, startDate, endDate]);
48854
- return /* @__PURE__ */ jsxs235(Fragment134, { children: [
48855
- /* @__PURE__ */ jsx266(TransactionView, {}),
48856
- /* @__PURE__ */ jsx266(
49252
+ return /* @__PURE__ */ jsxs237(Fragment136, { children: [
49253
+ /* @__PURE__ */ jsx268(TransactionView, {}),
49254
+ /* @__PURE__ */ jsx268(
48857
49255
  A4DataView,
48858
49256
  {
48859
49257
  columns,
@@ -48862,8 +49260,8 @@ var Expenses3Reports2 = () => {
48862
49260
  title: `Expenses Journal Report`,
48863
49261
  subtitle: `All Expenses`,
48864
49262
  fixed: false,
48865
- headers: /* @__PURE__ */ jsxs235("div", { className: "flex gap-2 items-center print:hidden flex-wrap", children: [
48866
- /* @__PURE__ */ jsx266(
49263
+ headers: /* @__PURE__ */ jsxs237("div", { className: "flex gap-2 items-center print:hidden flex-wrap", children: [
49264
+ /* @__PURE__ */ jsx268(
48867
49265
  DatePicker10,
48868
49266
  {
48869
49267
  placeholder: "Start Date",
@@ -48873,7 +49271,7 @@ var Expenses3Reports2 = () => {
48873
49271
  className: "min-w-[140px] max-w-[160px]"
48874
49272
  }
48875
49273
  ),
48876
- /* @__PURE__ */ jsx266(
49274
+ /* @__PURE__ */ jsx268(
48877
49275
  DatePicker10,
48878
49276
  {
48879
49277
  placeholder: "End Date",
@@ -48898,12 +49296,12 @@ var Reports3 = {
48898
49296
  var reports_default = Reports3;
48899
49297
 
48900
49298
  // src/components/Transactions/3/expenseJournal/ExpensesJournal.tsx
48901
- import { useNavigate as useNavigate64, useParams as useParams108 } from "react-router-dom";
48902
- import { EllipsisVertical as EllipsisVertical47, FilePenLine as FilePenLine43, Trash2 as Trash253 } from "lucide-react";
48903
- import { Fragment as Fragment135, jsx as jsx267, jsxs as jsxs236 } from "react/jsx-runtime";
49299
+ import { useNavigate as useNavigate65, useParams as useParams110 } from "react-router-dom";
49300
+ import { EllipsisVertical as EllipsisVertical48, FilePenLine as FilePenLine44, Trash2 as Trash254 } from "lucide-react";
49301
+ import { Fragment as Fragment137, jsx as jsx269, jsxs as jsxs238 } from "react/jsx-runtime";
48904
49302
  function ExpensesJournal3({ url }) {
48905
- const { branchId } = useParams108();
48906
- const navigate = useNavigate64();
49303
+ const { branchId } = useParams110();
49304
+ const navigate = useNavigate65();
48907
49305
  const { TransactionView, openTransaction } = useTransactionView_default();
48908
49306
  const { data, TransactionViewComponent, reload } = useTransaction_default({
48909
49307
  url: url || `/transactions/get?type=expense-journal-3${branchId ? `&branch=${branchId}` : ""}`,
@@ -48913,17 +49311,17 @@ function ExpensesJournal3({ url }) {
48913
49311
  const items = (data2) => [
48914
49312
  {
48915
49313
  label: `View Expense`,
48916
- icon: /* @__PURE__ */ jsx267(FilePenLine43, { size: 16 }),
49314
+ icon: /* @__PURE__ */ jsx269(FilePenLine44, { size: 16 }),
48917
49315
  onClick: () => openTransaction({ id: data2?._id, type: "expense-3" })
48918
49316
  },
48919
49317
  {
48920
49318
  label: `Edit Expense`,
48921
- icon: /* @__PURE__ */ jsx267(FilePenLine43, { size: 16 }),
49319
+ icon: /* @__PURE__ */ jsx269(FilePenLine44, { size: 16 }),
48922
49320
  onClick: () => navigate(`update?id=${data2?._id}`)
48923
49321
  },
48924
49322
  {
48925
49323
  label: `Delete Expense`,
48926
- icon: /* @__PURE__ */ jsx267(Trash253, { className: "text-red-500", size: 16 }),
49324
+ icon: /* @__PURE__ */ jsx269(Trash254, { className: "text-red-500", size: 16 }),
48927
49325
  onClick: () => {
48928
49326
  openTransaction({
48929
49327
  id: data2?._id,
@@ -48939,9 +49337,9 @@ function ExpensesJournal3({ url }) {
48939
49337
  header: "Date",
48940
49338
  cell: ({ row }) => {
48941
49339
  const expense = row.original;
48942
- return /* @__PURE__ */ jsxs236("div", { className: "flex flex-col", children: [
48943
- /* @__PURE__ */ jsx267("span", { children: expense?.date }),
48944
- /* @__PURE__ */ jsx267(
49340
+ return /* @__PURE__ */ jsxs238("div", { className: "flex flex-col", children: [
49341
+ /* @__PURE__ */ jsx269("span", { children: expense?.date }),
49342
+ /* @__PURE__ */ jsx269(
48945
49343
  "span",
48946
49344
  {
48947
49345
  onClick: () => openTransaction({ id: expense?._id, type: "expense-3" }),
@@ -48957,9 +49355,9 @@ function ExpensesJournal3({ url }) {
48957
49355
  header: "Description",
48958
49356
  cell: ({ row }) => {
48959
49357
  const expense = row.original;
48960
- return /* @__PURE__ */ jsxs236("div", { className: "flex flex-col", children: [
48961
- /* @__PURE__ */ jsx267("span", { className: "capitalize", children: expense?.description }),
48962
- expense?.note && /* @__PURE__ */ jsx267("span", { className: "text-xs text-gray-500 italic max-w-xs truncate", children: expense?.note })
49358
+ return /* @__PURE__ */ jsxs238("div", { className: "flex flex-col", children: [
49359
+ /* @__PURE__ */ jsx269("span", { className: "capitalize", children: expense?.description }),
49360
+ expense?.note && /* @__PURE__ */ jsx269("span", { className: "text-xs text-gray-500 italic max-w-xs truncate", children: expense?.note })
48963
49361
  ] });
48964
49362
  }
48965
49363
  },
@@ -48968,9 +49366,9 @@ function ExpensesJournal3({ url }) {
48968
49366
  header: "Amount",
48969
49367
  cell: ({ row }) => {
48970
49368
  const expense = row.original;
48971
- return /* @__PURE__ */ jsxs236("div", { className: "", children: [
48972
- /* @__PURE__ */ jsx267("p", { className: "font-medium text-red-600", children: Formats_default.Price(expense?.amount, expense?.currency) }),
48973
- expense?.exchange?.rate && expense?.exchange?.rate > 0 && /* @__PURE__ */ jsxs236("p", { className: "text-xs text-gray-500 italic", children: [
49369
+ return /* @__PURE__ */ jsxs238("div", { className: "", children: [
49370
+ /* @__PURE__ */ jsx269("p", { className: "font-medium text-red-600", children: Formats_default.Price(expense?.amount, expense?.currency) }),
49371
+ expense?.exchange?.rate && expense?.exchange?.rate > 0 && /* @__PURE__ */ jsxs238("p", { className: "text-xs text-gray-500 italic", children: [
48974
49372
  "rate ",
48975
49373
  expense?.exchange?.rate,
48976
49374
  " ,",
@@ -48988,23 +49386,23 @@ function ExpensesJournal3({ url }) {
48988
49386
  header: "Actions",
48989
49387
  cell: ({ row }) => {
48990
49388
  const data2 = row.original;
48991
- return /* @__PURE__ */ jsx267(
49389
+ return /* @__PURE__ */ jsx269(
48992
49390
  Dropdown,
48993
49391
  {
48994
49392
  className: "cursor-pointer w-[150px]",
48995
49393
  items: items(data2),
48996
49394
  triggerMode: "hover",
48997
- children: /* @__PURE__ */ jsx267(EllipsisVertical47, {})
49395
+ children: /* @__PURE__ */ jsx269(EllipsisVertical48, {})
48998
49396
  }
48999
49397
  );
49000
49398
  }
49001
49399
  }
49002
49400
  ];
49003
49401
  const expenses = data?.data || [];
49004
- return /* @__PURE__ */ jsxs236(Fragment135, { children: [
49005
- /* @__PURE__ */ jsx267(TransactionView, {}),
49006
- /* @__PURE__ */ jsx267(Modal2, {}),
49007
- /* @__PURE__ */ jsx267(
49402
+ return /* @__PURE__ */ jsxs238(Fragment137, { children: [
49403
+ /* @__PURE__ */ jsx269(TransactionView, {}),
49404
+ /* @__PURE__ */ jsx269(Modal2, {}),
49405
+ /* @__PURE__ */ jsx269(
49008
49406
  TransactionViewComponent,
49009
49407
  {
49010
49408
  columns,
@@ -49023,8 +49421,8 @@ function ExpensesJournal3({ url }) {
49023
49421
  var ExpensesJournal_default = ExpensesJournal3;
49024
49422
 
49025
49423
  // src/components/Transactions/3/expenseJournal/ExpensesJournal3Form.tsx
49026
- import { useEffect as useEffect114, useMemo as useMemo54, useState as useState115 } from "react";
49027
- import { useParams as useParams109 } from "react-router-dom";
49424
+ import { useEffect as useEffect114, useMemo as useMemo55, useState as useState115 } from "react";
49425
+ import { useParams as useParams111 } from "react-router-dom";
49028
49426
  import { useForm as useForm58 } from "react-hook-form";
49029
49427
  import { zodResolver as zodResolver57 } from "@hookform/resolvers/zod";
49030
49428
  import { message as message85 } from "antd";
@@ -49042,9 +49440,9 @@ var expenseSchema5 = z49.object({
49042
49440
  });
49043
49441
 
49044
49442
  // src/components/Transactions/3/expenseJournal/ExpensesJournal3Form.tsx
49045
- import { Fragment as Fragment136, jsx as jsx268, jsxs as jsxs237 } from "react/jsx-runtime";
49443
+ import { Fragment as Fragment138, jsx as jsx270, jsxs as jsxs239 } from "react/jsx-runtime";
49046
49444
  function ExpensesJournal3Form() {
49047
- const { branchId } = useParams109();
49445
+ const { branchId } = useParams111();
49048
49446
  const { getQuery, navigate } = useApp_default();
49049
49447
  const id = getQuery("id");
49050
49448
  const isEdit = !!id;
@@ -49067,7 +49465,7 @@ function ExpensesJournal3Form() {
49067
49465
  const isRate = currency && currency !== defaultCurrency;
49068
49466
  const amount = watch("amount");
49069
49467
  const rate = watch("rate");
49070
- const exchangedAmount2 = useMemo54(() => {
49468
+ const exchangedAmount2 = useMemo55(() => {
49071
49469
  if (isRate) {
49072
49470
  const am = forex_default.exchangedAmount({
49073
49471
  accountCurrency: defaultCurrency,
@@ -49118,25 +49516,25 @@ function ExpensesJournal3Form() {
49118
49516
  fetches();
49119
49517
  }
49120
49518
  }, [id]);
49121
- return /* @__PURE__ */ jsxs237(
49519
+ return /* @__PURE__ */ jsxs239(
49122
49520
  Card,
49123
49521
  {
49124
49522
  className: "max-w-4xl mx-auto mt-10 relative",
49125
49523
  isLoading: isLoadingGet,
49126
49524
  loadingText: "Processing...",
49127
49525
  children: [
49128
- /* @__PURE__ */ jsxs237(Card.Header, { children: [
49129
- /* @__PURE__ */ jsx268(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Expense` }),
49130
- /* @__PURE__ */ jsx268(Card.Description, { children: isEdit ? `Update the details for this expense entry` : `Record a new business expense` })
49526
+ /* @__PURE__ */ jsxs239(Card.Header, { children: [
49527
+ /* @__PURE__ */ jsx270(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Expense` }),
49528
+ /* @__PURE__ */ jsx270(Card.Description, { children: isEdit ? `Update the details for this expense entry` : `Record a new business expense` })
49131
49529
  ] }),
49132
- /* @__PURE__ */ jsx268(Card.Content, { children: /* @__PURE__ */ jsxs237(
49530
+ /* @__PURE__ */ jsx270(Card.Content, { children: /* @__PURE__ */ jsxs239(
49133
49531
  "form",
49134
49532
  {
49135
49533
  className: "space-y-4",
49136
49534
  onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
49137
49535
  children: [
49138
- /* @__PURE__ */ jsxs237("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
49139
- /* @__PURE__ */ jsx268(
49536
+ /* @__PURE__ */ jsxs239("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
49537
+ /* @__PURE__ */ jsx270(
49140
49538
  Fields_default.Input,
49141
49539
  {
49142
49540
  label: "Description",
@@ -49146,7 +49544,7 @@ function ExpensesJournal3Form() {
49146
49544
  required: true
49147
49545
  }
49148
49546
  ),
49149
- /* @__PURE__ */ jsx268(
49547
+ /* @__PURE__ */ jsx270(
49150
49548
  Fields_default.Select,
49151
49549
  {
49152
49550
  label: "Currency",
@@ -49157,8 +49555,8 @@ function ExpensesJournal3Form() {
49157
49555
  }
49158
49556
  )
49159
49557
  ] }),
49160
- /* @__PURE__ */ jsxs237("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
49161
- /* @__PURE__ */ jsx268(
49558
+ /* @__PURE__ */ jsxs239("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
49559
+ /* @__PURE__ */ jsx270(
49162
49560
  Fields_default.DateInput,
49163
49561
  {
49164
49562
  label: "Date",
@@ -49167,7 +49565,7 @@ function ExpensesJournal3Form() {
49167
49565
  required: true
49168
49566
  }
49169
49567
  ),
49170
- /* @__PURE__ */ jsx268(
49568
+ /* @__PURE__ */ jsx270(
49171
49569
  Fields_default.Input,
49172
49570
  {
49173
49571
  label: "Amount",
@@ -49178,8 +49576,8 @@ function ExpensesJournal3Form() {
49178
49576
  required: true
49179
49577
  }
49180
49578
  ),
49181
- isRate && /* @__PURE__ */ jsxs237(Fragment136, { children: [
49182
- /* @__PURE__ */ jsx268(
49579
+ isRate && /* @__PURE__ */ jsxs239(Fragment138, { children: [
49580
+ /* @__PURE__ */ jsx270(
49183
49581
  Fields_default.Input,
49184
49582
  {
49185
49583
  label: "Rate",
@@ -49190,7 +49588,7 @@ function ExpensesJournal3Form() {
49190
49588
  required: true
49191
49589
  }
49192
49590
  ),
49193
- /* @__PURE__ */ jsx268(
49591
+ /* @__PURE__ */ jsx270(
49194
49592
  Fields_default.Input,
49195
49593
  {
49196
49594
  label: "Exchanged Amount",
@@ -49202,7 +49600,7 @@ function ExpensesJournal3Form() {
49202
49600
  )
49203
49601
  ] })
49204
49602
  ] }),
49205
- /* @__PURE__ */ jsx268(
49603
+ /* @__PURE__ */ jsx270(
49206
49604
  Fields_default.Textarea,
49207
49605
  {
49208
49606
  label: "Note",
@@ -49211,7 +49609,7 @@ function ExpensesJournal3Form() {
49211
49609
  placeholder: "Add any additional details..."
49212
49610
  }
49213
49611
  ),
49214
- /* @__PURE__ */ jsx268("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx268(
49612
+ /* @__PURE__ */ jsx270("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx270(
49215
49613
  Button,
49216
49614
  {
49217
49615
  isLoading,
@@ -49246,29 +49644,31 @@ var Transaction3 = {
49246
49644
  JournalsForm: JournalsForm_default,
49247
49645
  Sale2: sale2_default2.List,
49248
49646
  Sale2Form: sale2_default2.Form,
49647
+ Collection: sale2_default2.Collection,
49249
49648
  Purchase3: purchase3_default.List,
49250
49649
  Purchase3Form: purchase3_default.Form,
49251
49650
  Expenses: expense_default.List,
49252
49651
  ExpenseForm: expense_default.Form,
49253
49652
  Reports: reports_default,
49254
- ExpensesJournal3: expenseJournal_default
49653
+ ExpensesJournal3: expenseJournal_default,
49654
+ CollectionLevel: sale2_default2.CollectionLevel
49255
49655
  };
49256
49656
  var __default = Transaction3;
49257
49657
 
49258
49658
  // src/components/reports/ItemReport.tsx
49259
- import { useParams as useParams110 } from "react-router-dom";
49659
+ import { useParams as useParams112 } from "react-router-dom";
49260
49660
  import { z as z50 } from "zod";
49261
49661
  import { useForm as useForm59 } from "react-hook-form";
49262
49662
  import { zodResolver as zodResolver58 } from "@hookform/resolvers/zod";
49263
49663
  import { useState as useState116 } from "react";
49264
49664
  import { message as message86 } from "antd";
49265
- import { Fragment as Fragment137, jsx as jsx269, jsxs as jsxs238 } from "react/jsx-runtime";
49665
+ import { Fragment as Fragment139, jsx as jsx271, jsxs as jsxs240 } from "react/jsx-runtime";
49266
49666
  var ItemReport = ({
49267
49667
  value = false,
49268
49668
  type
49269
49669
  }) => {
49270
49670
  const { apiConfig } = useWarqadConfig();
49271
- const { branchId } = useParams110();
49671
+ const { branchId } = useParams112();
49272
49672
  const { branches } = useAuth_default();
49273
49673
  const [params, setParams] = useState116({
49274
49674
  id: "",
@@ -49295,9 +49695,9 @@ var ItemReport = ({
49295
49695
  header: "Date",
49296
49696
  key: "date",
49297
49697
  className: "text-xs whitespace-nowrap",
49298
- render: (row) => /* @__PURE__ */ jsxs238("div", { className: "", children: [
49299
- /* @__PURE__ */ jsx269("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
49300
- /* @__PURE__ */ jsx269(
49698
+ render: (row) => /* @__PURE__ */ jsxs240("div", { className: "", children: [
49699
+ /* @__PURE__ */ jsx271("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
49700
+ /* @__PURE__ */ jsx271(
49301
49701
  "span",
49302
49702
  {
49303
49703
  onClick: () => {
@@ -49316,7 +49716,7 @@ var ItemReport = ({
49316
49716
  header: "Description",
49317
49717
  key: "description",
49318
49718
  className: "text-xs whitespace-nowrap",
49319
- render: (row) => /* @__PURE__ */ jsx269("div", { className: "", children: /* @__PURE__ */ jsx269("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.description }) })
49719
+ render: (row) => /* @__PURE__ */ jsx271("div", { className: "", children: /* @__PURE__ */ jsx271("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.description }) })
49320
49720
  },
49321
49721
  {
49322
49722
  header: "Quantity",
@@ -49324,7 +49724,7 @@ var ItemReport = ({
49324
49724
  className: "text-xs whitespace-nowrap",
49325
49725
  render: (row) => {
49326
49726
  const Qty = row.quantity;
49327
- return /* @__PURE__ */ jsxs238(
49727
+ return /* @__PURE__ */ jsxs240(
49328
49728
  "div",
49329
49729
  {
49330
49730
  className: `font-bold ${row.line === "add" ? "text-green-500" : row.line === "sub" ? "text-red-500" : "text-black"}`,
@@ -49341,7 +49741,7 @@ var ItemReport = ({
49341
49741
  header: "Balance",
49342
49742
  key: "runningBalance",
49343
49743
  className: "text-xs whitespace-nowrap",
49344
- render: (row) => /* @__PURE__ */ jsx269("div", { className: "", children: /* @__PURE__ */ jsx269("p", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.XQty(row.runningBalance) }) })
49744
+ render: (row) => /* @__PURE__ */ jsx271("div", { className: "", children: /* @__PURE__ */ jsx271("p", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.XQty(row.runningBalance) }) })
49345
49745
  }
49346
49746
  ];
49347
49747
  let runningBalance = 0;
@@ -49353,10 +49753,10 @@ var ItemReport = ({
49353
49753
  };
49354
49754
  });
49355
49755
  const itemName = datas[0]?.name;
49356
- return /* @__PURE__ */ jsxs238(Fragment137, { children: [
49357
- /* @__PURE__ */ jsx269(Modal2, {}),
49358
- /* @__PURE__ */ jsx269(TransactionView, {}),
49359
- /* @__PURE__ */ jsx269(
49756
+ return /* @__PURE__ */ jsxs240(Fragment139, { children: [
49757
+ /* @__PURE__ */ jsx271(Modal2, {}),
49758
+ /* @__PURE__ */ jsx271(TransactionView, {}),
49759
+ /* @__PURE__ */ jsx271(
49360
49760
  A4DataView,
49361
49761
  {
49362
49762
  columns,
@@ -49367,14 +49767,14 @@ var ItemReport = ({
49367
49767
  tableTitle: `${type} Movement Report`,
49368
49768
  fixed: false,
49369
49769
  error: !id ? "Please select an item" : void 0,
49370
- headers: /* @__PURE__ */ jsx269(
49770
+ headers: /* @__PURE__ */ jsx271(
49371
49771
  Button,
49372
49772
  {
49373
49773
  type: "button",
49374
49774
  size: "sm",
49375
49775
  onClick: () => openState({
49376
49776
  title: "Item Transactions",
49377
- content: /* @__PURE__ */ jsx269(
49777
+ content: /* @__PURE__ */ jsx271(
49378
49778
  ItemReportHeader2,
49379
49779
  {
49380
49780
  type,
@@ -49417,7 +49817,7 @@ function ItemReportHeader2({
49417
49817
  label: b.name,
49418
49818
  value: b._id
49419
49819
  }));
49420
- return /* @__PURE__ */ jsxs238(
49820
+ return /* @__PURE__ */ jsxs240(
49421
49821
  "form",
49422
49822
  {
49423
49823
  className: "space-y-3",
@@ -49435,8 +49835,8 @@ function ItemReportHeader2({
49435
49835
  close();
49436
49836
  }),
49437
49837
  children: [
49438
- /* @__PURE__ */ jsxs238("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-2", children: [
49439
- /* @__PURE__ */ jsx269(
49838
+ /* @__PURE__ */ jsxs240("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-2", children: [
49839
+ /* @__PURE__ */ jsx271(
49440
49840
  Select,
49441
49841
  {
49442
49842
  options: [{ label: "All Branches", value: "all" }, ...branchOptions],
@@ -49444,7 +49844,7 @@ function ItemReportHeader2({
49444
49844
  name: "branch"
49445
49845
  }
49446
49846
  ),
49447
- type === "pack" ? /* @__PURE__ */ jsx269(
49847
+ type === "pack" ? /* @__PURE__ */ jsx271(
49448
49848
  Pack_default.Pack,
49449
49849
  {
49450
49850
  api: "/packs/get",
@@ -49452,7 +49852,7 @@ function ItemReportHeader2({
49452
49852
  form: methods,
49453
49853
  name: "pack"
49454
49854
  }
49455
- ) : /* @__PURE__ */ jsx269(
49855
+ ) : /* @__PURE__ */ jsx271(
49456
49856
  Feilds_default5.Product,
49457
49857
  {
49458
49858
  label: "",
@@ -49463,7 +49863,7 @@ function ItemReportHeader2({
49463
49863
  }
49464
49864
  )
49465
49865
  ] }),
49466
- /* @__PURE__ */ jsx269("div", { className: "flex gap-2 justify-end", children: /* @__PURE__ */ jsx269(Button, { type: "submit", children: "Filter" }) })
49866
+ /* @__PURE__ */ jsx271("div", { className: "flex gap-2 justify-end", children: /* @__PURE__ */ jsx271(Button, { type: "submit", children: "Filter" }) })
49467
49867
  ]
49468
49868
  }
49469
49869
  );
@@ -49471,19 +49871,19 @@ function ItemReportHeader2({
49471
49871
  var ItemReport_default = ItemReport;
49472
49872
 
49473
49873
  // src/components/accounts/LeaseCollection.tsx
49474
- import { useNavigate as useNavigate65, useParams as useParams111, useSearchParams as useSearchParams19 } from "react-router-dom";
49475
- import { useMemo as useMemo55, useState as useState117, useEffect as useEffect115 } from "react";
49476
- import { Fragment as Fragment138, jsx as jsx270, jsxs as jsxs239 } from "react/jsx-runtime";
49874
+ import { useNavigate as useNavigate66, useParams as useParams113, useSearchParams as useSearchParams19 } from "react-router-dom";
49875
+ import { useMemo as useMemo56, useState as useState117, useEffect as useEffect115 } from "react";
49876
+ import { Fragment as Fragment140, jsx as jsx272, jsxs as jsxs241 } from "react/jsx-runtime";
49477
49877
  var LeaseCollection = ({
49478
49878
  leaseType,
49479
49879
  defaultCurrency = "KES"
49480
49880
  }) => {
49481
- const navigate = useNavigate65();
49881
+ const navigate = useNavigate66();
49482
49882
  const [searchParams] = useSearchParams19();
49483
49883
  const { apiConfig } = useWarqadConfig();
49484
- const { branchId } = useParams111();
49884
+ const { branchId } = useParams113();
49485
49885
  const { branches } = useAuth_default();
49486
- const currentBranch = useMemo55(
49886
+ const currentBranch = useMemo56(
49487
49887
  () => branches?.find((b) => b?._id === branchId),
49488
49888
  [branches, branchId]
49489
49889
  );
@@ -49519,9 +49919,9 @@ var LeaseCollection = ({
49519
49919
  key: "name",
49520
49920
  className: "text-xs whitespace-nowrap ",
49521
49921
  searchKeys: ["name", "phoneNumber", "unitNames"],
49522
- render: (row) => /* @__PURE__ */ jsxs239("div", { className: "space-y-1", children: [
49523
- /* @__PURE__ */ jsx270("p", { className: "font-bold dark:text-white print:text-black uppercase", children: row.name }),
49524
- row.unitNames && /* @__PURE__ */ jsxs239("p", { className: "text-[9px]! capitalize", children: [
49922
+ render: (row) => /* @__PURE__ */ jsxs241("div", { className: "space-y-1", children: [
49923
+ /* @__PURE__ */ jsx272("p", { className: "font-bold dark:text-white print:text-black uppercase", children: row.name }),
49924
+ row.unitNames && /* @__PURE__ */ jsxs241("p", { className: "text-[9px]! capitalize", children: [
49525
49925
  "(",
49526
49926
  row.unitNames,
49527
49927
  ")"
@@ -49533,7 +49933,7 @@ var LeaseCollection = ({
49533
49933
  key: "phoneNumber",
49534
49934
  maxWidth: 70,
49535
49935
  render: (row) => {
49536
- return /* @__PURE__ */ jsx270("p", { children: row?.phoneNumber || "N/A" });
49936
+ return /* @__PURE__ */ jsx272("p", { children: row?.phoneNumber || "N/A" });
49537
49937
  }
49538
49938
  },
49539
49939
  // </span>
@@ -49543,11 +49943,11 @@ var LeaseCollection = ({
49543
49943
  className: "text-xs whitespace-nowrap text-right",
49544
49944
  render: (row) => {
49545
49945
  const Amount = row.totalCollectionString;
49546
- return /* @__PURE__ */ jsx270("div", { className: "", children: /* @__PURE__ */ jsx270("p", { className: "font-bold ", children: Amount }) });
49946
+ return /* @__PURE__ */ jsx272("div", { className: "", children: /* @__PURE__ */ jsx272("p", { className: "font-bold ", children: Amount }) });
49547
49947
  },
49548
49948
  renderFooter: (data2) => {
49549
49949
  if (currencyFilter === "all") return;
49550
- return /* @__PURE__ */ jsx270("span", { className: " font-bold", children: Formats_default.Price(
49950
+ return /* @__PURE__ */ jsx272("span", { className: " font-bold", children: Formats_default.Price(
49551
49951
  data2.reduce((acc, row) => acc + row.totalCollection, 0),
49552
49952
  defaultCurrency,
49553
49953
  false
@@ -49555,7 +49955,7 @@ var LeaseCollection = ({
49555
49955
  }
49556
49956
  }
49557
49957
  ];
49558
- const datas = useMemo55(() => {
49958
+ const datas = useMemo56(() => {
49559
49959
  let runningBalance = 0;
49560
49960
  let filteredData = data?.data || [];
49561
49961
  const result = filteredData.map((item) => {
@@ -49568,9 +49968,9 @@ var LeaseCollection = ({
49568
49968
  });
49569
49969
  return result;
49570
49970
  }, [filter, currencyFilter, data]);
49571
- return /* @__PURE__ */ jsxs239(Fragment138, { children: [
49572
- /* @__PURE__ */ jsx270(TransactionView, {}),
49573
- /* @__PURE__ */ jsx270(
49971
+ return /* @__PURE__ */ jsxs241(Fragment140, { children: [
49972
+ /* @__PURE__ */ jsx272(TransactionView, {}),
49973
+ /* @__PURE__ */ jsx272(
49574
49974
  A4DataView,
49575
49975
  {
49576
49976
  columns,
@@ -49580,7 +49980,7 @@ var LeaseCollection = ({
49580
49980
  subtitle: `All Collections`,
49581
49981
  fixed: false,
49582
49982
  startPage: 1e9,
49583
- headers: /* @__PURE__ */ jsx270("div", { className: "flex gap-2" })
49983
+ headers: /* @__PURE__ */ jsx272("div", { className: "flex gap-2" })
49584
49984
  }
49585
49985
  )
49586
49986
  ] });
@@ -49588,8 +49988,8 @@ var LeaseCollection = ({
49588
49988
  var LeaseCollection_default = LeaseCollection;
49589
49989
 
49590
49990
  // src/components/Transactions/cargoIM/CargoIM.tsx
49591
- import { useNavigate as useNavigate66, useParams as useParams115 } from "react-router-dom";
49592
- import { EllipsisVertical as EllipsisVertical48, FilePenLine as FilePenLine44, Trash2 as Trash255 } from "lucide-react";
49991
+ import { useNavigate as useNavigate67, useParams as useParams117 } from "react-router-dom";
49992
+ import { EllipsisVertical as EllipsisVertical49, FilePenLine as FilePenLine45, Trash2 as Trash256 } from "lucide-react";
49593
49993
  import { useState as useState119 } from "react";
49594
49994
  import { message as message90 } from "antd";
49595
49995
 
@@ -49627,14 +50027,14 @@ import { useForm as useForm60 } from "react-hook-form";
49627
50027
  import { zodResolver as zodResolver59 } from "@hookform/resolvers/zod";
49628
50028
  import { message as message87 } from "antd";
49629
50029
  import { useEffect as useEffect116 } from "react";
49630
- import { useParams as useParams112 } from "react-router-dom";
49631
- import { jsx as jsx271, jsxs as jsxs240 } from "react/jsx-runtime";
50030
+ import { useParams as useParams114 } from "react-router-dom";
50031
+ import { jsx as jsx273, jsxs as jsxs242 } from "react/jsx-runtime";
49632
50032
  function AccountForm3({
49633
50033
  onReload,
49634
50034
  close,
49635
50035
  id
49636
50036
  }) {
49637
- const { branchId } = useParams112();
50037
+ const { branchId } = useParams114();
49638
50038
  const { currencies } = useWarqadConfig();
49639
50039
  const { stock } = currencies;
49640
50040
  const isEdit = !!id;
@@ -49700,24 +50100,24 @@ function AccountForm3({
49700
50100
  fetches();
49701
50101
  }
49702
50102
  }, [id]);
49703
- return /* @__PURE__ */ jsxs240(
50103
+ return /* @__PURE__ */ jsxs242(
49704
50104
  Card,
49705
50105
  {
49706
50106
  className: "max-w-4xl mx-auto mt-10 relative",
49707
50107
  isLoading: isLoadingGet,
49708
50108
  loadingText: "Processing...",
49709
50109
  children: [
49710
- /* @__PURE__ */ jsxs240(Card.Header, { children: [
49711
- /* @__PURE__ */ jsx271(Card.Title, { children: `${isEdit ? "Edit" : "Add"} ${type}` }),
49712
- /* @__PURE__ */ jsx271(Card.Description, { children: isEdit ? `Update the details for this ${type}` : `Create a new ${type} and add it to your list` })
50110
+ /* @__PURE__ */ jsxs242(Card.Header, { children: [
50111
+ /* @__PURE__ */ jsx273(Card.Title, { children: `${isEdit ? "Edit" : "Add"} ${type}` }),
50112
+ /* @__PURE__ */ jsx273(Card.Description, { children: isEdit ? `Update the details for this ${type}` : `Create a new ${type} and add it to your list` })
49713
50113
  ] }),
49714
- /* @__PURE__ */ jsx271(Card.Content, { children: /* @__PURE__ */ jsxs240(
50114
+ /* @__PURE__ */ jsx273(Card.Content, { children: /* @__PURE__ */ jsxs242(
49715
50115
  "form",
49716
50116
  {
49717
50117
  onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
49718
50118
  children: [
49719
- /* @__PURE__ */ jsxs240("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
49720
- /* @__PURE__ */ jsx271(
50119
+ /* @__PURE__ */ jsxs242("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
50120
+ /* @__PURE__ */ jsx273(
49721
50121
  Fields_default.Input,
49722
50122
  {
49723
50123
  label: "Name",
@@ -49728,7 +50128,7 @@ function AccountForm3({
49728
50128
  required: true
49729
50129
  }
49730
50130
  ),
49731
- /* @__PURE__ */ jsx271(
50131
+ /* @__PURE__ */ jsx273(
49732
50132
  Fields_default.PhoneInput,
49733
50133
  {
49734
50134
  label: "Phone Number",
@@ -49737,7 +50137,7 @@ function AccountForm3({
49737
50137
  placeholder: "Enter phone number"
49738
50138
  }
49739
50139
  ),
49740
- /* @__PURE__ */ jsx271(
50140
+ /* @__PURE__ */ jsx273(
49741
50141
  Fields_default.Select,
49742
50142
  {
49743
50143
  label: "Currency",
@@ -49748,7 +50148,7 @@ function AccountForm3({
49748
50148
  }
49749
50149
  )
49750
50150
  ] }),
49751
- /* @__PURE__ */ jsx271("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx271(
50151
+ /* @__PURE__ */ jsx273("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx273(
49752
50152
  Button,
49753
50153
  {
49754
50154
  isLoading,
@@ -49772,18 +50172,18 @@ var AccountForm_default3 = AccountForm3;
49772
50172
  import { useEffect as useEffect117, useState as useState118 } from "react";
49773
50173
  import { useForm as useForm61, useFieldArray as useFieldArray4 } from "react-hook-form";
49774
50174
  import { zodResolver as zodResolver60 } from "@hookform/resolvers/zod";
49775
- import { useParams as useParams113 } from "react-router-dom";
50175
+ import { useParams as useParams115 } from "react-router-dom";
49776
50176
  import { message as message88 } from "antd";
49777
- import { Trash2 as Trash254, Plus as Plus6 } from "lucide-react";
50177
+ import { Trash2 as Trash255, Plus as Plus6 } from "lucide-react";
49778
50178
  import dayjs13 from "dayjs";
49779
- import { jsx as jsx272, jsxs as jsxs241 } from "react/jsx-runtime";
50179
+ import { jsx as jsx274, jsxs as jsxs243 } from "react/jsx-runtime";
49780
50180
  function InvoiceForm2({
49781
50181
  onReload,
49782
50182
  close,
49783
50183
  accountData,
49784
50184
  id
49785
50185
  }) {
49786
- const { branchId } = useParams113();
50186
+ const { branchId } = useParams115();
49787
50187
  const [ref2, setRef] = useState118(void 0);
49788
50188
  const { post, isLoading } = useApis_default();
49789
50189
  const { get, isLoading: getLoading } = useApis_default();
@@ -49897,25 +50297,25 @@ function InvoiceForm2({
49897
50297
  e.preventDefault();
49898
50298
  }
49899
50299
  };
49900
- return /* @__PURE__ */ jsx272(
50300
+ return /* @__PURE__ */ jsx274(
49901
50301
  Card,
49902
50302
  {
49903
50303
  isLoading: getLoading,
49904
50304
  className: "max-w-4xl mx-auto relative border-0 shadow-none p-0 bg-transparent dark:bg-transparent",
49905
- children: /* @__PURE__ */ jsxs241(Card.Content, { children: [
49906
- /* @__PURE__ */ jsx272("input", { type: "hidden", ...register("currency") }),
49907
- /* @__PURE__ */ jsxs241(
50305
+ children: /* @__PURE__ */ jsxs243(Card.Content, { children: [
50306
+ /* @__PURE__ */ jsx274("input", { type: "hidden", ...register("currency") }),
50307
+ /* @__PURE__ */ jsxs243(
49908
50308
  "form",
49909
50309
  {
49910
50310
  onSubmit: handleSubmit(onSubmit),
49911
50311
  onKeyDown: handleKeyDown,
49912
50312
  className: "space-y-6",
49913
50313
  children: [
49914
- /* @__PURE__ */ jsxs241("div", { className: "bg-gray-50 dark:bg-zinc-800/20 p-5 rounded-2xl border border-gray-200 dark:border-zinc-800/60", children: [
49915
- /* @__PURE__ */ jsx272("h4", { className: "text-xs font-bold text-gray-400 uppercase mb-3 tracking-wider", children: "Add Invoice Item" }),
49916
- /* @__PURE__ */ jsxs241("div", { className: "flex flex-col md:flex-row gap-4 items-end", children: [
49917
- /* @__PURE__ */ jsxs241("div", { className: "grid grid-cols-1 sm:grid-cols-2 w-full gap-2", children: [
49918
- /* @__PURE__ */ jsx272(
50314
+ /* @__PURE__ */ jsxs243("div", { className: "bg-gray-50 dark:bg-zinc-800/20 p-5 rounded-2xl border border-gray-200 dark:border-zinc-800/60", children: [
50315
+ /* @__PURE__ */ jsx274("h4", { className: "text-xs font-bold text-gray-400 uppercase mb-3 tracking-wider", children: "Add Invoice Item" }),
50316
+ /* @__PURE__ */ jsxs243("div", { className: "flex flex-col md:flex-row gap-4 items-end", children: [
50317
+ /* @__PURE__ */ jsxs243("div", { className: "grid grid-cols-1 sm:grid-cols-2 w-full gap-2", children: [
50318
+ /* @__PURE__ */ jsx274(
49919
50319
  Fields_default.Input,
49920
50320
  {
49921
50321
  label: "Container No",
@@ -49924,7 +50324,7 @@ function InvoiceForm2({
49924
50324
  onChange: (val) => setItemName(val)
49925
50325
  }
49926
50326
  ),
49927
- /* @__PURE__ */ jsx272(
50327
+ /* @__PURE__ */ jsx274(
49928
50328
  Fields_default.Input,
49929
50329
  {
49930
50330
  label: "Cbm",
@@ -49934,7 +50334,7 @@ function InvoiceForm2({
49934
50334
  onChange: (val) => setItemQuantity(val)
49935
50335
  }
49936
50336
  ),
49937
- /* @__PURE__ */ jsx272(
50337
+ /* @__PURE__ */ jsx274(
49938
50338
  Fields_default.Input,
49939
50339
  {
49940
50340
  label: "Price (KES)",
@@ -49945,7 +50345,7 @@ function InvoiceForm2({
49945
50345
  }
49946
50346
  )
49947
50347
  ] }),
49948
- /* @__PURE__ */ jsxs241(
50348
+ /* @__PURE__ */ jsxs243(
49949
50349
  Button,
49950
50350
  {
49951
50351
  type: "button",
@@ -49953,23 +50353,23 @@ function InvoiceForm2({
49953
50353
  className: "w-full md:w-auto h-10 flex items-center justify-center gap-2 px-4 whitespace-nowrap",
49954
50354
  variant: "outline",
49955
50355
  children: [
49956
- /* @__PURE__ */ jsx272(Plus6, { size: 16 }),
50356
+ /* @__PURE__ */ jsx274(Plus6, { size: 16 }),
49957
50357
  " Add Item"
49958
50358
  ]
49959
50359
  }
49960
50360
  )
49961
50361
  ] })
49962
50362
  ] }),
49963
- /* @__PURE__ */ jsxs241("div", { children: [
49964
- /* @__PURE__ */ jsx272("h4", { className: "text-xs font-bold text-gray-400 uppercase mb-3 tracking-wider", children: "Invoice Items List" }),
49965
- /* @__PURE__ */ jsx272("div", { className: "border border-gray-200 dark:border-zinc-800 rounded-2xl overflow-hidden bg-white dark:bg-gray-900/80", children: /* @__PURE__ */ jsx272("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs241("table", { className: "w-full text-left border-collapse", children: [
49966
- /* @__PURE__ */ jsx272("thead", { className: "bg-gray-50 dark:bg-zinc-800/40 border-b border-gray-200 dark:border-zinc-800", children: /* @__PURE__ */ jsxs241("tr", { children: [
49967
- /* @__PURE__ */ jsx272("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: "#" }),
49968
- /* @__PURE__ */ jsx272("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" }),
49969
- /* @__PURE__ */ jsx272("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" }),
49970
- /* @__PURE__ */ jsx272("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" })
50363
+ /* @__PURE__ */ jsxs243("div", { children: [
50364
+ /* @__PURE__ */ jsx274("h4", { className: "text-xs font-bold text-gray-400 uppercase mb-3 tracking-wider", children: "Invoice Items List" }),
50365
+ /* @__PURE__ */ jsx274("div", { className: "border border-gray-200 dark:border-zinc-800 rounded-2xl overflow-hidden bg-white dark:bg-gray-900/80", children: /* @__PURE__ */ jsx274("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs243("table", { className: "w-full text-left border-collapse", children: [
50366
+ /* @__PURE__ */ jsx274("thead", { className: "bg-gray-50 dark:bg-zinc-800/40 border-b border-gray-200 dark:border-zinc-800", children: /* @__PURE__ */ jsxs243("tr", { children: [
50367
+ /* @__PURE__ */ jsx274("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: "#" }),
50368
+ /* @__PURE__ */ jsx274("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" }),
50369
+ /* @__PURE__ */ jsx274("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" }),
50370
+ /* @__PURE__ */ jsx274("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" })
49971
50371
  ] }) }),
49972
- /* @__PURE__ */ jsx272("tbody", { className: "divide-y divide-gray-100 dark:divide-zinc-800", children: fields.length === 0 ? /* @__PURE__ */ jsx272("tr", { children: /* @__PURE__ */ jsx272(
50372
+ /* @__PURE__ */ jsx274("tbody", { className: "divide-y divide-gray-100 dark:divide-zinc-800", children: fields.length === 0 ? /* @__PURE__ */ jsx274("tr", { children: /* @__PURE__ */ jsx274(
49973
50373
  "td",
49974
50374
  {
49975
50375
  colSpan: 4,
@@ -49978,30 +50378,30 @@ function InvoiceForm2({
49978
50378
  }
49979
50379
  ) }) : fields.map((item, index) => {
49980
50380
  const total = item.quantity * item.amount;
49981
- return /* @__PURE__ */ jsxs241(
50381
+ return /* @__PURE__ */ jsxs243(
49982
50382
  "tr",
49983
50383
  {
49984
50384
  className: "hover:bg-gray-50/50 dark:hover:bg-zinc-800/10 transition-colors",
49985
50385
  children: [
49986
- /* @__PURE__ */ jsx272("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 }),
49987
- /* @__PURE__ */ jsxs241("td", { className: "px-2 sm:px-4 py-1", children: [
49988
- /* @__PURE__ */ jsx272("div", { className: "font-bold text-gray-900 dark:text-white text-xs sm:text-sm", children: item.name }),
49989
- /* @__PURE__ */ jsxs241("div", { className: "text-[10px] sm:text-xs text-gray-400 dark:text-zinc-500 mt-0.5", children: [
50386
+ /* @__PURE__ */ jsx274("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 }),
50387
+ /* @__PURE__ */ jsxs243("td", { className: "px-2 sm:px-4 py-1", children: [
50388
+ /* @__PURE__ */ jsx274("div", { className: "font-bold text-gray-900 dark:text-white text-xs sm:text-sm", children: item.name }),
50389
+ /* @__PURE__ */ jsxs243("div", { className: "text-[10px] sm:text-xs text-gray-400 dark:text-zinc-500 mt-0.5", children: [
49990
50390
  item.quantity,
49991
50391
  " Cbm @",
49992
50392
  " ",
49993
50393
  Formats_default.Price(item.amount, "KES")
49994
50394
  ] })
49995
50395
  ] }),
49996
- /* @__PURE__ */ jsx272("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") }),
49997
- /* @__PURE__ */ jsx272("td", { className: "px-2 sm:px-4 py-1 text-xs sm:text-sm text-right", children: /* @__PURE__ */ jsx272(
50396
+ /* @__PURE__ */ jsx274("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") }),
50397
+ /* @__PURE__ */ jsx274("td", { className: "px-2 sm:px-4 py-1 text-xs sm:text-sm text-right", children: /* @__PURE__ */ jsx274(
49998
50398
  "button",
49999
50399
  {
50000
50400
  type: "button",
50001
50401
  onClick: () => remove(index),
50002
50402
  className: "text-gray-400 hover:text-red-500 transition-colors p-1",
50003
- children: /* @__PURE__ */ jsx272(
50004
- Trash254,
50403
+ children: /* @__PURE__ */ jsx274(
50404
+ Trash255,
50005
50405
  {
50006
50406
  size: 13,
50007
50407
  className: "sm:w-3.5 sm:h-3.5 w-3 h-3"
@@ -50014,8 +50414,8 @@ function InvoiceForm2({
50014
50414
  item.id
50015
50415
  );
50016
50416
  }) }),
50017
- fields.length > 0 && /* @__PURE__ */ jsx272("tfoot", { className: "bg-gray-50/50 dark:bg-zinc-800/10 border-t border-gray-200 dark:border-zinc-800", children: /* @__PURE__ */ jsxs241("tr", { children: [
50018
- /* @__PURE__ */ jsx272(
50417
+ fields.length > 0 && /* @__PURE__ */ jsx274("tfoot", { className: "bg-gray-50/50 dark:bg-zinc-800/10 border-t border-gray-200 dark:border-zinc-800", children: /* @__PURE__ */ jsxs243("tr", { children: [
50418
+ /* @__PURE__ */ jsx274(
50019
50419
  "td",
50020
50420
  {
50021
50421
  colSpan: 2,
@@ -50023,20 +50423,20 @@ function InvoiceForm2({
50023
50423
  children: "Total"
50024
50424
  }
50025
50425
  ),
50026
- /* @__PURE__ */ jsx272("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(
50426
+ /* @__PURE__ */ jsx274("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(
50027
50427
  fields.reduce(
50028
50428
  (sum, item) => sum + item.quantity * item.amount,
50029
50429
  0
50030
50430
  ),
50031
50431
  "KES"
50032
50432
  ) }),
50033
- /* @__PURE__ */ jsx272("td", {})
50433
+ /* @__PURE__ */ jsx274("td", {})
50034
50434
  ] }) })
50035
50435
  ] }) }) })
50036
50436
  ] }),
50037
- /* @__PURE__ */ jsxs241("div", { className: "border-t border-gray-200 dark:border-zinc-800 pt-6", children: [
50038
- /* @__PURE__ */ jsxs241("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
50039
- /* @__PURE__ */ jsx272(
50437
+ /* @__PURE__ */ jsxs243("div", { className: "border-t border-gray-200 dark:border-zinc-800 pt-6", children: [
50438
+ /* @__PURE__ */ jsxs243("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
50439
+ /* @__PURE__ */ jsx274(
50040
50440
  Fields_default.DateInput,
50041
50441
  {
50042
50442
  label: "Date",
@@ -50045,20 +50445,20 @@ function InvoiceForm2({
50045
50445
  required: true
50046
50446
  }
50047
50447
  ),
50048
- /* @__PURE__ */ jsx272(Fields_default.Input, { label: "Currency", value: "KES", disabled: true })
50448
+ /* @__PURE__ */ jsx274(Fields_default.Input, { label: "Currency", value: "KES", disabled: true })
50049
50449
  ] }),
50050
- /* @__PURE__ */ jsxs241("div", { className: "flex justify-between items-center mt-6", children: [
50051
- /* @__PURE__ */ jsx272("div", { children: isEdit && /* @__PURE__ */ jsx272(
50450
+ /* @__PURE__ */ jsxs243("div", { className: "flex justify-between items-center mt-6", children: [
50451
+ /* @__PURE__ */ jsx274("div", { children: isEdit && /* @__PURE__ */ jsx274(
50052
50452
  ConfirmModal,
50053
50453
  {
50054
50454
  title: "Reverse Transaction",
50055
- description: /* @__PURE__ */ jsxs241("div", { className: "space-y-3 text-left", children: [
50056
- /* @__PURE__ */ jsx272("p", { children: "Are you sure you want to reverse this transaction?" }),
50057
- /* @__PURE__ */ jsx272("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."' })
50455
+ description: /* @__PURE__ */ jsxs243("div", { className: "space-y-3 text-left", children: [
50456
+ /* @__PURE__ */ jsx274("p", { children: "Are you sure you want to reverse this transaction?" }),
50457
+ /* @__PURE__ */ jsx274("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."' })
50058
50458
  ] }),
50059
50459
  confirmationWord: "delete",
50060
50460
  onSubmit: onReverse,
50061
- children: /* @__PURE__ */ jsx272(
50461
+ children: /* @__PURE__ */ jsx274(
50062
50462
  Button,
50063
50463
  {
50064
50464
  type: "button",
@@ -50071,8 +50471,8 @@ function InvoiceForm2({
50071
50471
  )
50072
50472
  }
50073
50473
  ) }),
50074
- /* @__PURE__ */ jsxs241("div", { className: "flex justify-end gap-3", children: [
50075
- close && /* @__PURE__ */ jsx272(
50474
+ /* @__PURE__ */ jsxs243("div", { className: "flex justify-end gap-3", children: [
50475
+ close && /* @__PURE__ */ jsx274(
50076
50476
  Button,
50077
50477
  {
50078
50478
  type: "button",
@@ -50082,7 +50482,7 @@ function InvoiceForm2({
50082
50482
  children: "Cancel"
50083
50483
  }
50084
50484
  ),
50085
- /* @__PURE__ */ jsx272(
50485
+ /* @__PURE__ */ jsx274(
50086
50486
  Button,
50087
50487
  {
50088
50488
  isLoading,
@@ -50109,10 +50509,10 @@ var InvoiceForm_default2 = InvoiceForm2;
50109
50509
  import React47 from "react";
50110
50510
  import { useForm as useForm62 } from "react-hook-form";
50111
50511
  import { zodResolver as zodResolver61 } from "@hookform/resolvers/zod";
50112
- import { useParams as useParams114 } from "react-router-dom";
50512
+ import { useParams as useParams116 } from "react-router-dom";
50113
50513
  import { message as message89 } from "antd";
50114
50514
  import dayjs14 from "dayjs";
50115
- import { jsx as jsx273, jsxs as jsxs242 } from "react/jsx-runtime";
50515
+ import { jsx as jsx275, jsxs as jsxs244 } from "react/jsx-runtime";
50116
50516
  function JournalForm5({
50117
50517
  onReload,
50118
50518
  close,
@@ -50120,7 +50520,7 @@ function JournalForm5({
50120
50520
  action = "debit",
50121
50521
  id
50122
50522
  }) {
50123
- const { branchId } = useParams114();
50523
+ const { branchId } = useParams116();
50124
50524
  const { currencies } = useWarqadConfig();
50125
50525
  const { stock: defaultCurrency } = currencies;
50126
50526
  const [ref2, setRef] = React47.useState(void 0);
@@ -50203,19 +50603,19 @@ function JournalForm5({
50203
50603
  e.preventDefault();
50204
50604
  }
50205
50605
  };
50206
- return /* @__PURE__ */ jsx273(
50606
+ return /* @__PURE__ */ jsx275(
50207
50607
  Card,
50208
50608
  {
50209
50609
  isLoading: getLoading,
50210
50610
  className: "max-w-2xl mx-auto relative border-0 shadow-none p-0 bg-transparent dark:bg-transparent",
50211
- children: /* @__PURE__ */ jsx273(Card.Content, { children: /* @__PURE__ */ jsxs242(
50611
+ children: /* @__PURE__ */ jsx275(Card.Content, { children: /* @__PURE__ */ jsxs244(
50212
50612
  "form",
50213
50613
  {
50214
50614
  onSubmit: handleSubmit(onSubmit),
50215
50615
  onKeyDown: handleKeyDown,
50216
50616
  className: "space-y-4",
50217
50617
  children: [
50218
- /* @__PURE__ */ jsx273(
50618
+ /* @__PURE__ */ jsx275(
50219
50619
  Fields_default.Input,
50220
50620
  {
50221
50621
  label: "Description",
@@ -50226,8 +50626,8 @@ function JournalForm5({
50226
50626
  placeholder: "Enter description"
50227
50627
  }
50228
50628
  ),
50229
- /* @__PURE__ */ jsxs242("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
50230
- /* @__PURE__ */ jsx273(
50629
+ /* @__PURE__ */ jsxs244("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
50630
+ /* @__PURE__ */ jsx275(
50231
50631
  Fields_default.DateInput,
50232
50632
  {
50233
50633
  label: "Date",
@@ -50236,7 +50636,7 @@ function JournalForm5({
50236
50636
  required: true
50237
50637
  }
50238
50638
  ),
50239
- /* @__PURE__ */ jsx273(
50639
+ /* @__PURE__ */ jsx275(
50240
50640
  Fields_default.Input,
50241
50641
  {
50242
50642
  label: "Currency",
@@ -50246,8 +50646,8 @@ function JournalForm5({
50246
50646
  }
50247
50647
  )
50248
50648
  ] }),
50249
- /* @__PURE__ */ jsxs242("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
50250
- /* @__PURE__ */ jsx273(
50649
+ /* @__PURE__ */ jsxs244("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
50650
+ /* @__PURE__ */ jsx275(
50251
50651
  Fields_default.Input,
50252
50652
  {
50253
50653
  label: "Amount",
@@ -50258,7 +50658,7 @@ function JournalForm5({
50258
50658
  placeholder: "0.00"
50259
50659
  }
50260
50660
  ),
50261
- /* @__PURE__ */ jsx273(
50661
+ /* @__PURE__ */ jsx275(
50262
50662
  Fields_default.Select,
50263
50663
  {
50264
50664
  label: "Action",
@@ -50272,7 +50672,7 @@ function JournalForm5({
50272
50672
  }
50273
50673
  )
50274
50674
  ] }),
50275
- /* @__PURE__ */ jsx273(
50675
+ /* @__PURE__ */ jsx275(
50276
50676
  Fields_default.Textarea,
50277
50677
  {
50278
50678
  label: "Note",
@@ -50282,18 +50682,18 @@ function JournalForm5({
50282
50682
  rows: 3
50283
50683
  }
50284
50684
  ),
50285
- /* @__PURE__ */ jsxs242("div", { className: "flex justify-between items-center pt-4 border-t border-gray-100 dark:border-zinc-800", children: [
50286
- /* @__PURE__ */ jsx273("div", { children: isEdit && /* @__PURE__ */ jsx273(
50685
+ /* @__PURE__ */ jsxs244("div", { className: "flex justify-between items-center pt-4 border-t border-gray-100 dark:border-zinc-800", children: [
50686
+ /* @__PURE__ */ jsx275("div", { children: isEdit && /* @__PURE__ */ jsx275(
50287
50687
  ConfirmModal,
50288
50688
  {
50289
50689
  title: "Reverse Transaction",
50290
- description: /* @__PURE__ */ jsxs242("div", { className: "space-y-3 text-left", children: [
50291
- /* @__PURE__ */ jsx273("p", { children: "Are you sure you want to reverse this transaction?" }),
50292
- /* @__PURE__ */ jsx273("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."' })
50690
+ description: /* @__PURE__ */ jsxs244("div", { className: "space-y-3 text-left", children: [
50691
+ /* @__PURE__ */ jsx275("p", { children: "Are you sure you want to reverse this transaction?" }),
50692
+ /* @__PURE__ */ jsx275("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."' })
50293
50693
  ] }),
50294
50694
  confirmationWord: "delete",
50295
50695
  onSubmit: onReverse,
50296
- children: /* @__PURE__ */ jsx273(
50696
+ children: /* @__PURE__ */ jsx275(
50297
50697
  Button,
50298
50698
  {
50299
50699
  type: "button",
@@ -50306,8 +50706,8 @@ function JournalForm5({
50306
50706
  )
50307
50707
  }
50308
50708
  ) }),
50309
- /* @__PURE__ */ jsxs242("div", { className: "flex justify-end gap-3", children: [
50310
- close && /* @__PURE__ */ jsx273(
50709
+ /* @__PURE__ */ jsxs244("div", { className: "flex justify-end gap-3", children: [
50710
+ close && /* @__PURE__ */ jsx275(
50311
50711
  Button,
50312
50712
  {
50313
50713
  type: "button",
@@ -50317,7 +50717,7 @@ function JournalForm5({
50317
50717
  children: "Cancel"
50318
50718
  }
50319
50719
  ),
50320
- /* @__PURE__ */ jsx273(
50720
+ /* @__PURE__ */ jsx275(
50321
50721
  Button,
50322
50722
  {
50323
50723
  isLoading,
@@ -50339,13 +50739,13 @@ function JournalForm5({
50339
50739
  var journalForm_default2 = JournalForm5;
50340
50740
 
50341
50741
  // src/components/Transactions/cargoIM/CargoIM.tsx
50342
- import { Fragment as Fragment139, jsx as jsx274, jsxs as jsxs243 } from "react/jsx-runtime";
50742
+ import { Fragment as Fragment141, jsx as jsx276, jsxs as jsxs245 } from "react/jsx-runtime";
50343
50743
  function CargoIM({ v, url }) {
50344
- const { branchId } = useParams115();
50744
+ const { branchId } = useParams117();
50345
50745
  const { apiConfig } = useWarqadConfig();
50346
50746
  const { width } = useMediaSize();
50347
50747
  const isLargeScreen = width > 768;
50348
- const navigate = useNavigate66();
50748
+ const navigate = useNavigate67();
50349
50749
  const type = "supplier";
50350
50750
  const [deleteAccount, setDeleteAccount] = useState119(null);
50351
50751
  const { isLoading: isActionLoading, remove } = useApis_default();
@@ -50358,17 +50758,17 @@ function CargoIM({ v, url }) {
50358
50758
  const items = (data2) => [
50359
50759
  {
50360
50760
  label: `Edit ${type}`,
50361
- icon: /* @__PURE__ */ jsx274(FilePenLine44, { size: 16 }),
50761
+ icon: /* @__PURE__ */ jsx276(FilePenLine45, { size: 16 }),
50362
50762
  onClick: () => openState({
50363
50763
  type: "Account",
50364
- content: /* @__PURE__ */ jsx274(AccountForm_default3, { onReload: reload, close, id: data2?._id }),
50764
+ content: /* @__PURE__ */ jsx276(AccountForm_default3, { onReload: reload, close, id: data2?._id }),
50365
50765
  title: "Account Form",
50366
50766
  width: 800
50367
50767
  })
50368
50768
  },
50369
50769
  {
50370
50770
  label: `Delete ${type}`,
50371
- icon: /* @__PURE__ */ jsx274(Trash255, { className: "text-red-500", size: 16 }),
50771
+ icon: /* @__PURE__ */ jsx276(Trash256, { className: "text-red-500", size: 16 }),
50372
50772
  onClick: () => setDeleteAccount(data2)
50373
50773
  }
50374
50774
  ].filter(Boolean);
@@ -50379,7 +50779,7 @@ function CargoIM({ v, url }) {
50379
50779
  className: "w-full",
50380
50780
  cell: ({ row }) => {
50381
50781
  const account = row.original;
50382
- return /* @__PURE__ */ jsx274(
50782
+ return /* @__PURE__ */ jsx276(
50383
50783
  "span",
50384
50784
  {
50385
50785
  onClick: () => navigate(`${account?._id}`),
@@ -50408,8 +50808,8 @@ function CargoIM({ v, url }) {
50408
50808
  className: "w-px whitespace-nowrap",
50409
50809
  cell: ({ row }) => {
50410
50810
  const data2 = row.original;
50411
- return /* @__PURE__ */ jsxs243("div", { className: "flex gap-4 items-center", children: [
50412
- /* @__PURE__ */ jsx274(
50811
+ return /* @__PURE__ */ jsxs245("div", { className: "flex gap-4 items-center", children: [
50812
+ /* @__PURE__ */ jsx276(
50413
50813
  "button",
50414
50814
  {
50415
50815
  className: "cursor-pointer px-2 py-1 text-white rounded-lg text-xs bg-blue-500",
@@ -50417,7 +50817,7 @@ function CargoIM({ v, url }) {
50417
50817
  openState({
50418
50818
  type: "credit",
50419
50819
  closeOnOverlayClick: false,
50420
- content: /* @__PURE__ */ jsx274(
50820
+ content: /* @__PURE__ */ jsx276(
50421
50821
  InvoiceForm_default2,
50422
50822
  {
50423
50823
  onReload: reload,
@@ -50432,7 +50832,7 @@ function CargoIM({ v, url }) {
50432
50832
  children: "Inv"
50433
50833
  }
50434
50834
  ),
50435
- /* @__PURE__ */ jsx274(
50835
+ /* @__PURE__ */ jsx276(
50436
50836
  "button",
50437
50837
  {
50438
50838
  className: "cursor-pointer px-2 py-1 text-white rounded-lg text-xs bg-red-500",
@@ -50440,7 +50840,7 @@ function CargoIM({ v, url }) {
50440
50840
  openState({
50441
50841
  type: "debit",
50442
50842
  closeOnOverlayClick: false,
50443
- content: /* @__PURE__ */ jsx274(
50843
+ content: /* @__PURE__ */ jsx276(
50444
50844
  journalForm_default2,
50445
50845
  {
50446
50846
  onReload: reload,
@@ -50456,14 +50856,14 @@ function CargoIM({ v, url }) {
50456
50856
  children: "Pay"
50457
50857
  }
50458
50858
  ),
50459
- /* @__PURE__ */ jsx274(
50859
+ /* @__PURE__ */ jsx276(
50460
50860
  Dropdown,
50461
50861
  {
50462
50862
  className: "cursor-pointer",
50463
50863
  width: "w-[150px]",
50464
50864
  items: items(data2),
50465
50865
  triggerMode: "hover",
50466
- children: /* @__PURE__ */ jsx274(EllipsisVertical48, {})
50866
+ children: /* @__PURE__ */ jsx276(EllipsisVertical49, {})
50467
50867
  }
50468
50868
  )
50469
50869
  ] });
@@ -50487,9 +50887,9 @@ function CargoIM({ v, url }) {
50487
50887
  return error;
50488
50888
  }
50489
50889
  };
50490
- return /* @__PURE__ */ jsxs243(Fragment139, { children: [
50491
- /* @__PURE__ */ jsx274(Modal2, {}),
50492
- /* @__PURE__ */ jsx274(
50890
+ return /* @__PURE__ */ jsxs245(Fragment141, { children: [
50891
+ /* @__PURE__ */ jsx276(Modal2, {}),
50892
+ /* @__PURE__ */ jsx276(
50493
50893
  ConfirmModal,
50494
50894
  {
50495
50895
  isOpen: !!deleteAccount,
@@ -50502,7 +50902,7 @@ function CargoIM({ v, url }) {
50502
50902
  children: null
50503
50903
  }
50504
50904
  ),
50505
- /* @__PURE__ */ jsx274("div", { className: !isLargeScreen ? "origin-top" : "", children: /* @__PURE__ */ jsx274(
50905
+ /* @__PURE__ */ jsx276("div", { className: !isLargeScreen ? "origin-top" : "", children: /* @__PURE__ */ jsx276(
50506
50906
  TransactionViewComponent,
50507
50907
  {
50508
50908
  columns,
@@ -50513,7 +50913,7 @@ function CargoIM({ v, url }) {
50513
50913
  onCreate: () => {
50514
50914
  openState({
50515
50915
  type: "account",
50516
- content: /* @__PURE__ */ jsx274(AccountForm_default3, { onReload: reload, close }),
50916
+ content: /* @__PURE__ */ jsx276(AccountForm_default3, { onReload: reload, close }),
50517
50917
  title: "Account Form",
50518
50918
  width: 800
50519
50919
  });
@@ -50526,8 +50926,8 @@ var CargoIM_default = CargoIM;
50526
50926
 
50527
50927
  // src/components/Transactions/cargoIM/cargoIMReport.tsx
50528
50928
  import { useSearchParams as useSearchParams20 } from "react-router-dom";
50529
- import { useMemo as useMemo56, useState as useState120, useEffect as useEffect118 } from "react";
50530
- import { Fragment as Fragment140, jsx as jsx275, jsxs as jsxs244 } from "react/jsx-runtime";
50929
+ import { useMemo as useMemo57, useState as useState120, useEffect as useEffect118 } from "react";
50930
+ import { Fragment as Fragment142, jsx as jsx277, jsxs as jsxs246 } from "react/jsx-runtime";
50531
50931
  var CargoIMReport = () => {
50532
50932
  const { apiConfig, currencies: warqadCurrencies } = useWarqadConfig();
50533
50933
  const { TransactionView, openTransaction } = useTransactionView_default();
@@ -50571,9 +50971,9 @@ var CargoIMReport = () => {
50571
50971
  header: "Date",
50572
50972
  key: "date",
50573
50973
  className: "text-xs whitespace-nowrap",
50574
- render: (row) => /* @__PURE__ */ jsxs244("div", { className: "", children: [
50575
- /* @__PURE__ */ jsx275("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
50576
- /* @__PURE__ */ jsx275(
50974
+ render: (row) => /* @__PURE__ */ jsxs246("div", { className: "", children: [
50975
+ /* @__PURE__ */ jsx277("p", { className: "font-bold text-black dark:text-white print:text-black", children: row.date }),
50976
+ /* @__PURE__ */ jsx277(
50577
50977
  "span",
50578
50978
  {
50579
50979
  onClick: () => {
@@ -50592,13 +50992,13 @@ var CargoIMReport = () => {
50592
50992
  header: "Container No",
50593
50993
  key: "description",
50594
50994
  className: "text-xs w-full break-words",
50595
- render: (row) => /* @__PURE__ */ jsx275("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) => {
50995
+ render: (row) => /* @__PURE__ */ jsx277("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) => {
50596
50996
  const rowId = String(row._id || row.id || row.ref || idx).replace(
50597
50997
  /[^a-zA-Z0-9]/g,
50598
50998
  ""
50599
50999
  );
50600
51000
  const lineClass = `tx-line-${rowId}-${idx}`;
50601
- return /* @__PURE__ */ jsx275(
51001
+ return /* @__PURE__ */ jsx277(
50602
51002
  "div",
50603
51003
  {
50604
51004
  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`,
@@ -50612,13 +51012,13 @@ var CargoIMReport = () => {
50612
51012
  header: "Cbm",
50613
51013
  key: "cbm",
50614
51014
  className: "text-xs whitespace-nowrap text-right",
50615
- render: (row) => /* @__PURE__ */ jsx275("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) => {
51015
+ render: (row) => /* @__PURE__ */ jsx277("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) => {
50616
51016
  const rowId = String(row._id || row.id || row.ref || idx).replace(
50617
51017
  /[^a-zA-Z0-9]/g,
50618
51018
  ""
50619
51019
  );
50620
51020
  const lineClass = `tx-line-${rowId}-${idx}`;
50621
- return /* @__PURE__ */ jsx275(
51021
+ return /* @__PURE__ */ jsx277(
50622
51022
  "div",
50623
51023
  {
50624
51024
  className: `${lineClass} min-h-[24px] py-1 flex items-center justify-end font-bold text-black dark:text-white print:text-black whitespace-nowrap`,
@@ -50635,20 +51035,20 @@ var CargoIMReport = () => {
50635
51035
  ),
50636
51036
  0
50637
51037
  );
50638
- return totalCbm > 0 ? /* @__PURE__ */ jsx275("span", { className: "font-bold text-black dark:text-white print:text-black", children: totalCbm }) : null;
51038
+ return totalCbm > 0 ? /* @__PURE__ */ jsx277("span", { className: "font-bold text-black dark:text-white print:text-black", children: totalCbm }) : null;
50639
51039
  }
50640
51040
  },
50641
51041
  {
50642
51042
  header: "Price",
50643
51043
  key: "price",
50644
51044
  className: "text-xs whitespace-nowrap text-right",
50645
- render: (row) => /* @__PURE__ */ jsx275("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) => {
51045
+ render: (row) => /* @__PURE__ */ jsx277("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) => {
50646
51046
  const rowId = String(row._id || row.id || row.ref || idx).replace(
50647
51047
  /[^a-zA-Z0-9]/g,
50648
51048
  ""
50649
51049
  );
50650
51050
  const lineClass = `tx-line-${rowId}-${idx}`;
50651
- return /* @__PURE__ */ jsx275(
51051
+ return /* @__PURE__ */ jsx277(
50652
51052
  "div",
50653
51053
  {
50654
51054
  className: `${lineClass} min-h-[24px] py-1 flex items-center justify-end font-bold text-black dark:text-white print:text-black whitespace-nowrap`,
@@ -50662,13 +51062,13 @@ var CargoIMReport = () => {
50662
51062
  header: "Credit",
50663
51063
  key: "credit",
50664
51064
  className: "text-xs whitespace-nowrap text-right",
50665
- render: (row) => /* @__PURE__ */ jsx275("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) => {
51065
+ render: (row) => /* @__PURE__ */ jsx277("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) => {
50666
51066
  const rowId = String(row._id || row.id || row.ref || idx).replace(
50667
51067
  /[^a-zA-Z0-9]/g,
50668
51068
  ""
50669
51069
  );
50670
51070
  const lineClass = `tx-line-${rowId}-${idx}`;
50671
- return /* @__PURE__ */ jsx275(
51071
+ return /* @__PURE__ */ jsx277(
50672
51072
  "div",
50673
51073
  {
50674
51074
  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`,
@@ -50677,7 +51077,7 @@ var CargoIMReport = () => {
50677
51077
  idx
50678
51078
  );
50679
51079
  }) }),
50680
- renderFooter: (data2) => /* @__PURE__ */ jsx275("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
51080
+ renderFooter: (data2) => /* @__PURE__ */ jsx277("span", { className: "text-green-500 font-bold", children: Formats_default.Amount(
50681
51081
  data2.reduce(
50682
51082
  (acc, row) => acc + (row.lines || []).reduce(
50683
51083
  (lineAcc, line) => lineAcc + (line.type === "credit" ? line.amount : 0),
@@ -50691,13 +51091,13 @@ var CargoIMReport = () => {
50691
51091
  header: "Debit",
50692
51092
  key: "debit",
50693
51093
  className: "text-xs whitespace-nowrap text-right",
50694
- render: (row) => /* @__PURE__ */ jsx275("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) => {
51094
+ render: (row) => /* @__PURE__ */ jsx277("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) => {
50695
51095
  const rowId = String(row._id || row.id || row.ref || idx).replace(
50696
51096
  /[^a-zA-Z0-9]/g,
50697
51097
  ""
50698
51098
  );
50699
51099
  const lineClass = `tx-line-${rowId}-${idx}`;
50700
- return /* @__PURE__ */ jsx275(
51100
+ return /* @__PURE__ */ jsx277(
50701
51101
  "div",
50702
51102
  {
50703
51103
  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`,
@@ -50706,7 +51106,7 @@ var CargoIMReport = () => {
50706
51106
  idx
50707
51107
  );
50708
51108
  }) }),
50709
- renderFooter: (data2) => /* @__PURE__ */ jsx275("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
51109
+ renderFooter: (data2) => /* @__PURE__ */ jsx277("span", { className: "text-red-500 font-bold", children: Formats_default.Amount(
50710
51110
  data2.reduce(
50711
51111
  (acc, row) => acc + (row.lines || []).reduce(
50712
51112
  (lineAcc, line) => lineAcc + (line.type === "debit" ? line.amount : 0),
@@ -50720,14 +51120,14 @@ var CargoIMReport = () => {
50720
51120
  header: "Balance",
50721
51121
  key: "runningBalance",
50722
51122
  className: "text-xs whitespace-nowrap text-right",
50723
- render: (row) => /* @__PURE__ */ jsx275("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Price(row.runningBalance, currency) }),
50724
- renderFooter: (data2) => /* @__PURE__ */ jsx275("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
51123
+ render: (row) => /* @__PURE__ */ jsx277("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Price(row.runningBalance, currency) }),
51124
+ renderFooter: (data2) => /* @__PURE__ */ jsx277("span", { className: "text-black dark:text-white print:text-black font-bold", children: Formats_default.Price(
50725
51125
  data2.reduce((acc, row) => acc + (row.calculatedAmount || 0), 0),
50726
51126
  currency
50727
51127
  ) })
50728
51128
  }
50729
51129
  ];
50730
- const datas = useMemo56(() => {
51130
+ const datas = useMemo57(() => {
50731
51131
  let runningBalance = 0;
50732
51132
  const transactions = data?.data?.transactions;
50733
51133
  const res = (transactions || []).map((item) => {
@@ -50764,10 +51164,10 @@ var CargoIMReport = () => {
50764
51164
  { label: "Account Type", value: data?.data?.type },
50765
51165
  { label: "Currency", value: currencyFilter }
50766
51166
  ];
50767
- return /* @__PURE__ */ jsxs244(Fragment140, { children: [
50768
- /* @__PURE__ */ jsx275(Modal2, {}),
50769
- /* @__PURE__ */ jsx275(TransactionView, {}),
50770
- /* @__PURE__ */ jsx275(
51167
+ return /* @__PURE__ */ jsxs246(Fragment142, { children: [
51168
+ /* @__PURE__ */ jsx277(Modal2, {}),
51169
+ /* @__PURE__ */ jsx277(TransactionView, {}),
51170
+ /* @__PURE__ */ jsx277(
50771
51171
  A4DataView,
50772
51172
  {
50773
51173
  columns,
@@ -50782,7 +51182,7 @@ var CargoIMReport = () => {
50782
51182
  openState({
50783
51183
  type: "debit",
50784
51184
  closeOnOverlayClick: false,
50785
- content: row.type === "invoice-manager" ? /* @__PURE__ */ jsx275(
51185
+ content: row.type === "invoice-manager" ? /* @__PURE__ */ jsx277(
50786
51186
  InvoiceForm_default2,
50787
51187
  {
50788
51188
  close: closeTransaction,
@@ -50790,7 +51190,7 @@ var CargoIMReport = () => {
50790
51190
  onReload: reload,
50791
51191
  id: row._id
50792
51192
  }
50793
- ) : /* @__PURE__ */ jsx275(
51193
+ ) : /* @__PURE__ */ jsx277(
50794
51194
  journalForm_default2,
50795
51195
  {
50796
51196
  close: closeTransaction,
@@ -50803,7 +51203,7 @@ var CargoIMReport = () => {
50803
51203
  width: 800
50804
51204
  });
50805
51205
  },
50806
- headers: /* @__PURE__ */ jsx275("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ jsx275(
51206
+ headers: /* @__PURE__ */ jsx277("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ jsx277(
50807
51207
  Fields_default.Select,
50808
51208
  {
50809
51209
  options: currencies,
@@ -50819,19 +51219,19 @@ var CargoIMReport = () => {
50819
51219
  var cargoIMReport_default = CargoIMReport;
50820
51220
 
50821
51221
  // src/components/accounts/forex-2/Forex2Accounts.tsx
50822
- import { useNavigate as useNavigate67, useParams as useParams116 } from "react-router-dom";
51222
+ import { useNavigate as useNavigate68, useParams as useParams118 } from "react-router-dom";
50823
51223
  import {
50824
- EllipsisVertical as EllipsisVertical49,
51224
+ EllipsisVertical as EllipsisVertical50,
50825
51225
  FileChartLine as FileChartLine2,
50826
- FilePenLine as FilePenLine45,
50827
- Trash2 as Trash256
51226
+ FilePenLine as FilePenLine46,
51227
+ Trash2 as Trash257
50828
51228
  } from "lucide-react";
50829
51229
  import { useState as useState121 } from "react";
50830
51230
  import { message as message91 } from "antd";
50831
- import { Fragment as Fragment141, jsx as jsx276, jsxs as jsxs245 } from "react/jsx-runtime";
51231
+ import { Fragment as Fragment143, jsx as jsx278, jsxs as jsxs247 } from "react/jsx-runtime";
50832
51232
  function Forex2Accounts({ v, url }) {
50833
- const { branchId } = useParams116();
50834
- const navigate = useNavigate67();
51233
+ const { branchId } = useParams118();
51234
+ const navigate = useNavigate68();
50835
51235
  const type = "account";
50836
51236
  const [deleteAccount, setDeleteAccount] = useState121(null);
50837
51237
  const { isLoading: isActionLoading, remove } = useApis_default();
@@ -50844,22 +51244,22 @@ function Forex2Accounts({ v, url }) {
50844
51244
  const items = (data2) => [
50845
51245
  {
50846
51246
  label: `Currency Report`,
50847
- icon: /* @__PURE__ */ jsx276(FileChartLine2, { size: 16 }),
51247
+ icon: /* @__PURE__ */ jsx278(FileChartLine2, { size: 16 }),
50848
51248
  onClick: () => navigate(data2?._id)
50849
51249
  },
50850
51250
  {
50851
51251
  label: `Edit ${type}`,
50852
- icon: /* @__PURE__ */ jsx276(FilePenLine45, { size: 16 }),
51252
+ icon: /* @__PURE__ */ jsx278(FilePenLine46, { size: 16 }),
50853
51253
  onClick: () => openState({
50854
51254
  type: "forex account",
50855
- content: /* @__PURE__ */ jsx276(ForexAccountForm_default, { close, reloads: reload, id: data2?._id }),
51255
+ content: /* @__PURE__ */ jsx278(ForexAccountForm_default, { close, reloads: reload, id: data2?._id }),
50856
51256
  title: "Forex Account Form",
50857
51257
  width: 800
50858
51258
  })
50859
51259
  },
50860
51260
  {
50861
51261
  label: `Delete ${type}`,
50862
- icon: /* @__PURE__ */ jsx276(Trash256, { className: "text-red-500", size: 16 }),
51262
+ icon: /* @__PURE__ */ jsx278(Trash257, { className: "text-red-500", size: 16 }),
50863
51263
  onClick: () => setDeleteAccount(data2)
50864
51264
  }
50865
51265
  ].filter(Boolean);
@@ -50869,7 +51269,7 @@ function Forex2Accounts({ v, url }) {
50869
51269
  header: "Name",
50870
51270
  cell: ({ row }) => {
50871
51271
  const account = row.original;
50872
- return /* @__PURE__ */ jsx276(
51272
+ return /* @__PURE__ */ jsx278(
50873
51273
  "span",
50874
51274
  {
50875
51275
  onClick: () => navigate(`statements/${account?._id}`),
@@ -50884,7 +51284,7 @@ function Forex2Accounts({ v, url }) {
50884
51284
  header: "Phone",
50885
51285
  cell: ({ row }) => {
50886
51286
  const account = row.original;
50887
- return /* @__PURE__ */ jsx276("span", { children: account?.phoneNumber || "N/A" });
51287
+ return /* @__PURE__ */ jsx278("span", { children: account?.phoneNumber || "N/A" });
50888
51288
  }
50889
51289
  },
50890
51290
  {
@@ -50892,14 +51292,14 @@ function Forex2Accounts({ v, url }) {
50892
51292
  header: "Balances",
50893
51293
  cell: ({ row }) => {
50894
51294
  const account = row.original;
50895
- return /* @__PURE__ */ jsx276("div", { className: "flex flex-wrap items-center gap-2", children: Object.entries(account?.transactions || {}).map(
50896
- ([currency, data2]) => /* @__PURE__ */ jsxs245(
51295
+ return /* @__PURE__ */ jsx278("div", { className: "flex flex-wrap items-center gap-2", children: Object.entries(account?.transactions || {}).map(
51296
+ ([currency, data2]) => /* @__PURE__ */ jsxs247(
50897
51297
  "div",
50898
51298
  {
50899
51299
  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",
50900
51300
  children: [
50901
- /* @__PURE__ */ jsx276("span", { className: "text-[12px] font-bold text-gray-400 dark:text-gray-500 uppercase tracking-tighter", children: currency }),
50902
- /* @__PURE__ */ jsx276(
51301
+ /* @__PURE__ */ jsx278("span", { className: "text-[12px] font-bold text-gray-400 dark:text-gray-500 uppercase tracking-tighter", children: currency }),
51302
+ /* @__PURE__ */ jsx278(
50903
51303
  "span",
50904
51304
  {
50905
51305
  className: `text-[12px] font-bold tabular-nums ${data2.balance < 0 ? "text-red-500" : "text-green-600 dark:text-green-500"}`,
@@ -50918,8 +51318,8 @@ function Forex2Accounts({ v, url }) {
50918
51318
  header: "Actions",
50919
51319
  cell: ({ row }) => {
50920
51320
  const data2 = row.original;
50921
- return /* @__PURE__ */ jsxs245("div", { className: "flex gap-4 items-center", children: [
50922
- /* @__PURE__ */ jsx276(
51321
+ return /* @__PURE__ */ jsxs247("div", { className: "flex gap-4 items-center", children: [
51322
+ /* @__PURE__ */ jsx278(
50923
51323
  "button",
50924
51324
  {
50925
51325
  className: "cursor-pointer px-2 py-1 text-white rounded-lg text-xs bg-blue-500",
@@ -50927,7 +51327,7 @@ function Forex2Accounts({ v, url }) {
50927
51327
  openState({
50928
51328
  type: "credit",
50929
51329
  closeOnOverlayClick: false,
50930
- content: /* @__PURE__ */ jsx276(
51330
+ content: /* @__PURE__ */ jsx278(
50931
51331
  Forex2FormTransaction_default,
50932
51332
  {
50933
51333
  close,
@@ -50943,7 +51343,7 @@ function Forex2Accounts({ v, url }) {
50943
51343
  children: "Out"
50944
51344
  }
50945
51345
  ),
50946
- /* @__PURE__ */ jsx276(
51346
+ /* @__PURE__ */ jsx278(
50947
51347
  "button",
50948
51348
  {
50949
51349
  className: "cursor-pointer px-2 py-1 text-white rounded-lg text-xs bg-red-500",
@@ -50951,7 +51351,7 @@ function Forex2Accounts({ v, url }) {
50951
51351
  openState({
50952
51352
  type: "debit",
50953
51353
  closeOnOverlayClick: false,
50954
- content: /* @__PURE__ */ jsx276(
51354
+ content: /* @__PURE__ */ jsx278(
50955
51355
  Forex2FormTransaction_default,
50956
51356
  {
50957
51357
  close,
@@ -50967,13 +51367,13 @@ function Forex2Accounts({ v, url }) {
50967
51367
  children: "In"
50968
51368
  }
50969
51369
  ),
50970
- /* @__PURE__ */ jsx276(
51370
+ /* @__PURE__ */ jsx278(
50971
51371
  Dropdown,
50972
51372
  {
50973
51373
  className: "cursor-pointer w-[150px]",
50974
51374
  items: items(data2),
50975
51375
  triggerMode: "hover",
50976
- children: /* @__PURE__ */ jsx276(EllipsisVertical49, {})
51376
+ children: /* @__PURE__ */ jsx278(EllipsisVertical50, {})
50977
51377
  }
50978
51378
  )
50979
51379
  ] });
@@ -51012,9 +51412,9 @@ function Forex2Accounts({ v, url }) {
51012
51412
  };
51013
51413
  }).filter((item) => item.debit !== 0 || item.credit !== 0);
51014
51414
  console.log(currencies);
51015
- return /* @__PURE__ */ jsxs245(Fragment141, { children: [
51016
- /* @__PURE__ */ jsx276(Modal2, {}),
51017
- /* @__PURE__ */ jsx276(
51415
+ return /* @__PURE__ */ jsxs247(Fragment143, { children: [
51416
+ /* @__PURE__ */ jsx278(Modal2, {}),
51417
+ /* @__PURE__ */ jsx278(
51018
51418
  ConfirmModal,
51019
51419
  {
51020
51420
  isOpen: !!deleteAccount,
@@ -51027,9 +51427,9 @@ function Forex2Accounts({ v, url }) {
51027
51427
  children: null
51028
51428
  }
51029
51429
  ),
51030
- /* @__PURE__ */ jsxs245("div", { children: [
51031
- /* @__PURE__ */ jsx276(ForexAccountSummary_default, { currencies, isLoading }),
51032
- /* @__PURE__ */ jsx276(
51430
+ /* @__PURE__ */ jsxs247("div", { children: [
51431
+ /* @__PURE__ */ jsx278(ForexAccountSummary_default, { currencies, isLoading }),
51432
+ /* @__PURE__ */ jsx278(
51033
51433
  TransactionViewComponent,
51034
51434
  {
51035
51435
  columns,
@@ -51041,7 +51441,7 @@ function Forex2Accounts({ v, url }) {
51041
51441
  onCreate: () => {
51042
51442
  openState({
51043
51443
  type: "forex account",
51044
- content: /* @__PURE__ */ jsx276(ForexAccountForm_default, { close, reloads: reload }),
51444
+ content: /* @__PURE__ */ jsx278(ForexAccountForm_default, { close, reloads: reload }),
51045
51445
  title: "Forex Account Form",
51046
51446
  width: 800
51047
51447
  });
@@ -51054,14 +51454,14 @@ function Forex2Accounts({ v, url }) {
51054
51454
  var Forex2Accounts_default = Forex2Accounts;
51055
51455
 
51056
51456
  // src/components/reports/ProductList.tsx
51057
- import { useParams as useParams117 } from "react-router-dom";
51058
- import { Fragment as Fragment142, jsx as jsx277, jsxs as jsxs246 } from "react/jsx-runtime";
51059
- var options9 = [
51457
+ import { useParams as useParams119 } from "react-router-dom";
51458
+ import { Fragment as Fragment144, jsx as jsx279, jsxs as jsxs248 } from "react/jsx-runtime";
51459
+ var options10 = [
51060
51460
  { label: "Product", value: "product" },
51061
51461
  { label: "Pack", value: "pack" }
51062
51462
  ];
51063
51463
  var ProductList2 = ({ value = false }) => {
51064
- const { branchId } = useParams117();
51464
+ const { branchId } = useParams119();
51065
51465
  const { branches } = useAuth_default();
51066
51466
  const { TransactionView } = useTransactionView_default();
51067
51467
  const { getQuery, setQuery } = useApp_default();
@@ -51083,7 +51483,7 @@ var ProductList2 = ({ value = false }) => {
51083
51483
  key: "name",
51084
51484
  className: "text-xs whitespace-nowrap",
51085
51485
  render: (row) => {
51086
- return /* @__PURE__ */ jsx277("div", { className: "", children: /* @__PURE__ */ jsx277("p", { className: "font-bold uppercase text-black dark:text-white print:text-black", children: row.name }) });
51486
+ return /* @__PURE__ */ jsx279("div", { className: "", children: /* @__PURE__ */ jsx279("p", { className: "font-bold uppercase text-black dark:text-white print:text-black", children: row.name }) });
51087
51487
  }
51088
51488
  },
51089
51489
  ...value ? [
@@ -51091,14 +51491,14 @@ var ProductList2 = ({ value = false }) => {
51091
51491
  header: "Cost",
51092
51492
  key: "cost",
51093
51493
  className: "text-xs whitespace-nowrap text-right",
51094
- render: (row) => /* @__PURE__ */ jsx277("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Amount(row.cost, false) })
51494
+ render: (row) => /* @__PURE__ */ jsx279("span", { className: "font-bold text-black dark:text-white print:text-black", children: Formats_default.Amount(row.cost, false) })
51095
51495
  }
51096
51496
  ] : []
51097
51497
  ];
51098
51498
  const datas = data?.data || [];
51099
- return /* @__PURE__ */ jsxs246(Fragment142, { children: [
51100
- /* @__PURE__ */ jsx277(TransactionView, {}),
51101
- /* @__PURE__ */ jsx277(
51499
+ return /* @__PURE__ */ jsxs248(Fragment144, { children: [
51500
+ /* @__PURE__ */ jsx279(TransactionView, {}),
51501
+ /* @__PURE__ */ jsx279(
51102
51502
  A4DataView,
51103
51503
  {
51104
51504
  columns,
@@ -51108,10 +51508,10 @@ var ProductList2 = ({ value = false }) => {
51108
51508
  subtitle: branchId ? currentBranch?.name : "All Branches",
51109
51509
  tableTitle: "Stock List",
51110
51510
  fixed: false,
51111
- headers: /* @__PURE__ */ jsx277(
51511
+ headers: /* @__PURE__ */ jsx279(
51112
51512
  Select,
51113
51513
  {
51114
- options: options9,
51514
+ options: options10,
51115
51515
  value: stockType,
51116
51516
  className: "w-32! print:hidden",
51117
51517
  onChange: (e) => {