@bjsdistribution/dms-client-return 0.0.21 → 0.0.23

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.
@@ -9532,7 +9532,6 @@ function SelectionFilter() {
9532
9532
  type: 'SET_CLIENT_FILTER',
9533
9533
  payload: storedClientId
9534
9534
  });
9535
- // Reset to the first page
9536
9535
  dispatch({
9537
9536
  type: 'SET_PAGE',
9538
9537
  payload: 1
@@ -9549,7 +9548,6 @@ function SelectionFilter() {
9549
9548
  type: 'SET_ACTIONS_FILTER',
9550
9549
  payload: selectedFilterValue
9551
9550
  });
9552
- // Reset to the first page
9553
9551
  dispatch({
9554
9552
  type: 'SET_PAGE',
9555
9553
  payload: 1
@@ -9561,20 +9559,12 @@ function SelectionFilter() {
9561
9559
  type: 'SET_LOCATION_FILTER',
9562
9560
  payload: selectedLocationValue
9563
9561
  });
9564
- // Reset to the first page
9565
9562
  dispatch({
9566
9563
  type: 'SET_PAGE',
9567
9564
  payload: 1
9568
9565
  });
9569
9566
  }
9570
9567
  };
9571
- useEffect(function () {
9572
- return function () {
9573
- dispatch({
9574
- type: 'CLEAR_CLIENT'
9575
- });
9576
- };
9577
- }, []);
9578
9568
  useEffect(function () {
9579
9569
  if (storedClientId) {
9580
9570
  dispatch({
@@ -9603,6 +9593,7 @@ function SelectionFilter() {
9603
9593
  });
9604
9594
  }
9605
9595
  }, [selectedFilterValue, selectedLocationValue]);
9596
+ console.log(storedName, 'storedName');
9606
9597
  return React.createElement(Wrapper$k, null, React.createElement(FilterRow, null, React.createElement(LeftColumn, null, React.createElement(FilterColumn, null, React.createElement(Label$g, null, "Clients"), React.createElement(StyledAntSelect$4, {
9607
9598
  options: clientOptions,
9608
9599
  placeholder: "Select Client Name",
@@ -9611,7 +9602,7 @@ function SelectionFilter() {
9611
9602
  minWidth: '14vw'
9612
9603
  },
9613
9604
  value: storedName
9614
- })), storedName && location.pathname.includes("/filter/") ? React.createElement(React.Fragment, null, React.createElement(FilterColumn, null, React.createElement(Label$g, null, "Action Type"), React.createElement(StyledAntSelect$4, {
9605
+ })), storedName && location.pathname.includes("filter/") ? React.createElement(React.Fragment, null, React.createElement(FilterColumn, null, React.createElement(Label$g, null, "Action Type"), React.createElement(StyledAntSelect$4, {
9615
9606
  options: actionTypeOptions,
9616
9607
  placeholder: "Select Action Type",
9617
9608
  value: selectedFilterValue,
@@ -9994,13 +9985,11 @@ var ReturnOrderTable = function ReturnOrderTable() {
9994
9985
  setPaginationObject = _UsePaginationData[1];
9995
9986
  var _usefetchAgain = usefetchAgain(),
9996
9987
  callForFetch = _usefetchAgain[0];
9997
- // console.log(callForFetch, 'callForFetchcallForFetchcallForFetchcallForFetch');
9998
9988
  var OpenDropDown = function OpenDropDown(index) {
9999
9989
  setPrintToggle(function (prevIndex) {
10000
9990
  return prevIndex === index ? null : index;
10001
9991
  });
10002
9992
  };
10003
- console.log(newpayload, 'newpayload');
10004
9993
  // Close dropdown outside click
10005
9994
  useEffect(function () {
10006
9995
  document.addEventListener('mousedown', handleClickOutside);
@@ -10094,8 +10083,6 @@ var ReturnOrderTable = function ReturnOrderTable() {
10094
10083
  setGrouped([]);
10095
10084
  }
10096
10085
  };
10097
- console.log(selectedReturnOrder, 'selectedReturnOrder');
10098
- console.log(newpayload, 'newpayload');
10099
10086
  var handleSelectOrderReturn = function handleSelectOrderReturn(id, return_location, return_locations, order_product_return_action, new_location, legacy_product_id) {
10100
10087
  setSelectedReturnOrder(function (prevSelectedLocations) {
10101
10088
  var isSelected = prevSelectedLocations == null ? void 0 : prevSelectedLocations.some(function (loc) {
@@ -10178,7 +10165,7 @@ var ReturnOrderTable = function ReturnOrderTable() {
10178
10165
  }, React.createElement(Checkbox$1, {
10179
10166
  checked: selectAll,
10180
10167
  onChange: handleSelectAll
10181
- })) : React.createElement("th", null), React.createElement("th", null, "Product Location"), React.createElement("th", null, "Return Location"), React.createElement("th", null, "Recipient"), React.createElement("th", null, "Return Action Type"), React.createElement("th", null, "Code"), React.createElement("th", null, "Description"), React.createElement("th", null, "Part"), React.createElement("th", null, "Weight"), React.createElement("th", null, "CBM"), React.createElement("th", null, "Return Reason"), React.createElement("th", null, "Collected"), React.createElement("th", null, "Collection Reason"), React.createElement("th", {
10168
+ })) : React.createElement("th", null), React.createElement("th", null, "Product Location"), React.createElement("th", null, "Return Location"), React.createElement("th", null, "Recipient"), React.createElement("th", null, "Code"), React.createElement("th", null, "Description"), React.createElement("th", null, "Part"), React.createElement("th", null, "Weight"), React.createElement("th", null, "CBM"), React.createElement("th", null, "Return Reason"), React.createElement("th", null, "Collected"), React.createElement("th", null, "Collection Reason"), React.createElement("th", {
10182
10169
  className: "emailInvoiceShare"
10183
10170
  }, "Labels"))), React.createElement("tbody", null, load ? React.createElement("tr", null, React.createElement("td", {
10184
10171
  colSpan: 6
@@ -10189,7 +10176,7 @@ var ReturnOrderTable = function ReturnOrderTable() {
10189
10176
  })) : (returnData == null ? void 0 : returnData.length) === 0 ? React.createElement("tr", null, React.createElement("td", {
10190
10177
  colSpan: 14
10191
10178
  }, React.createElement(EmptyDataContainer$1, null, React.createElement(Empty, null)))) : returnData == null ? void 0 : returnData.map(function (item, index) {
10192
- var _item$order_product_r2, _item$orders_products, _item$orders_products2, _item$order_data, _item$order_data2, _item$order_product_r3, _item$return_reasons, _item$order_product_r4, _item$collection_reas;
10179
+ var _item$order_product_r2, _item$orders_products, _item$orders_products2, _item$order_data, _item$order_data2, _item$return_reasons, _item$order_product_r3, _item$collection_reas;
10193
10180
  return React.createElement("tr", {
10194
10181
  key: item.id
10195
10182
  }, React.createElement("td", null, (item == null || (_item$order_product_r2 = item.order_product_return_action) == null ? void 0 : _item$order_product_r2.type) == 'RTS' ? React.createElement(React.Fragment, null, React.createElement(Checkbox$1, {
@@ -10217,7 +10204,7 @@ var ReturnOrderTable = function ReturnOrderTable() {
10217
10204
  style: {
10218
10205
  color: '#888075'
10219
10206
  }
10220
- }, displayValueOrNA(item == null || (_item$order_data2 = item.order_data) == null || (_item$order_data2 = _item$order_data2.order_recipient) == null ? void 0 : _item$order_data2.postcode)))), React.createElement("td", null, displayValueOrNA(item == null || (_item$order_product_r3 = item.order_product_return_action) == null ? void 0 : _item$order_product_r3.type)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.code)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.description)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.parts_count)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.weight), ' ', item != null && item.weight && (item == null ? void 0 : item.weight) !== null ? 'KG' : ''), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.cube)), React.createElement("td", null, displayValueOrNA(item == null || (_item$return_reasons = item.return_reasons) == null ? void 0 : _item$return_reasons.reason)), React.createElement("td", null, (item == null || (_item$order_product_r4 = item.order_product_returns) == null ? void 0 : _item$order_product_r4.length) > 0 ? item.order_product_returns.map(function (ret) {
10207
+ }, displayValueOrNA(item == null || (_item$order_data2 = item.order_data) == null || (_item$order_data2 = _item$order_data2.order_recipient) == null ? void 0 : _item$order_data2.postcode)))), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.code)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.description)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.parts_count)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.weight), ' ', item != null && item.weight && (item == null ? void 0 : item.weight) !== null ? 'KG' : ''), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.cube)), React.createElement("td", null, displayValueOrNA(item == null || (_item$return_reasons = item.return_reasons) == null ? void 0 : _item$return_reasons.reason)), React.createElement("td", null, (item == null || (_item$order_product_r3 = item.order_product_returns) == null ? void 0 : _item$order_product_r3.length) > 0 ? item.order_product_returns.map(function (ret) {
10221
10208
  return ret != null && ret.collected_at ? format(new Date(ret.collected_at), 'dd/MM/yyyy') : 'UNKNOWN';
10222
10209
  }) : 'UNKNOWN'), React.createElement("td", null, displayValueOrNA(item == null || (_item$collection_reas = item.collection_reasons) == null ? void 0 : _item$collection_reas.reason)), React.createElement("td", null, React.createElement("ul", {
10223
10210
  className: "actionbox"
@@ -12519,12 +12506,21 @@ function ReturnClient() {
12519
12506
  // const [, dispatch] = useAtom(filtersReducerAtom);
12520
12507
  console.log(selectedClientString, 'selectedClient');
12521
12508
  console.log("../filter/:" + selectedClientString);
12509
+ var splitPath = function splitPath(str) {
12510
+ var _str$split;
12511
+ var parts = str == null || (_str$split = str.split('/')) == null ? void 0 : _str$split.filter(function (part) {
12512
+ return part !== '';
12513
+ }); // Filter out empty parts
12514
+ return parts;
12515
+ };
12516
+ var paths = splitPath(location.pathname);
12517
+ console.log(paths, 'pathssssssssssssssssssssssssssss');
12522
12518
  useEffect(function () {
12523
- if (location.pathname.includes('/returnClient')) {
12519
+ console.log(paths[paths.length - 1], 'paths[paths.length] paths[paths.length]');
12520
+ if (paths[paths.length - 1] === 'returnclient') {
12524
12521
  localStorage.removeItem('clientName');
12525
12522
  localStorage.removeItem('clientId');
12526
12523
  localStorage.removeItem('uuid');
12527
- localStorage.removeItem('customer_id');
12528
12524
  // dispatch({ type: 'CLEAR_CLIENT', payload: [] });
12529
12525
  }
12530
12526
  }, [location.pathname]);