@bjsdistribution/dms-client-return 0.1.60-prod → 0.1.61-prod

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.
@@ -421,6 +421,7 @@ var AssignUpdateInitial = {
421
421
  };
422
422
  var reminderTableData = /*#__PURE__*/atom([]);
423
423
  var customerData = /*#__PURE__*/atom([]);
424
+ var flatCustomerData = /*#__PURE__*/atom([]);
424
425
  var actionTypeData = /*#__PURE__*/atom([]);
425
426
  var locationData = /*#__PURE__*/atom([]);
426
427
  var createReturnPayload = /*#__PURE__*/atom(CreateReturnInitial);
@@ -501,6 +502,9 @@ function useStatsCPCount() {
501
502
  function useCustomerData() {
502
503
  return useAtom(customerData);
503
504
  }
505
+ function useFlatCustomerData() {
506
+ return useAtom(flatCustomerData);
507
+ }
504
508
  function useActionType() {
505
509
  return useAtom(actionTypeData);
506
510
  }
@@ -611,7 +615,7 @@ var filterReducer = function filterReducer(state, action) {
611
615
  return f.field !== 'customer_id';
612
616
  }), [{
613
617
  field: 'customer_id',
614
- op: '=',
618
+ op: Array != null && Array.isArray(action == null ? void 0 : action.payload) ? 'in' : '=',
615
619
  value: action.payload
616
620
  }])
617
621
  });
@@ -1192,8 +1196,7 @@ var countReducerAtom = /*#__PURE__*/atomWithReducer(initialState$1, popupReducer
1192
1196
  var _templateObject;
1193
1197
  function SelectionFilter() {
1194
1198
  var _useCustomerData = useCustomerData(),
1195
- customers = _useCustomerData[0],
1196
- setCustomers = _useCustomerData[1];
1199
+ customers = _useCustomerData[0];
1197
1200
  var _useSelectedAction = useSelectedAction(),
1198
1201
  selectedFilterValue = _useSelectedAction[0],
1199
1202
  setSelectedFilterValue = _useSelectedAction[1];
@@ -1223,9 +1226,9 @@ function SelectionFilter() {
1223
1226
  setLocationOptions = _useLocationOptions[1];
1224
1227
  var _useSearchParams = useSearchParams(),
1225
1228
  searchParams = _useSearchParams[0];
1229
+ var navigate = useNavigate();
1226
1230
  var _useClientPortal = useClientPortal(),
1227
1231
  clientPortal = _useClientPortal[0];
1228
- var navigate = useNavigate();
1229
1232
  var _useClientLoading = useClientLoading(),
1230
1233
  clientLoading = _useClientLoading[0];
1231
1234
  //API for client data
@@ -1240,33 +1243,61 @@ function SelectionFilter() {
1240
1243
  fetchedCustomerData = _useAxios.data,
1241
1244
  loading = _useAxios.loading,
1242
1245
  fetchData = _useAxios.fetchData;
1243
- //need to fix
1246
+ var _useFlatCustomerData = useFlatCustomerData(),
1247
+ flatCustomers = _useFlatCustomerData[0],
1248
+ setFlatCustomers = _useFlatCustomerData[1];
1244
1249
  useEffect(function () {
1245
1250
  if (!clientPortal && !clientLoading) {
1246
- fetchData();
1251
+ if (!flatCustomers || flatCustomers.length === 0) {
1252
+ fetchData();
1253
+ }
1247
1254
  }
1248
1255
  }, [clientLoading]);
1249
1256
  useEffect(function () {
1250
1257
  if (fetchedCustomerData && fetchedCustomerData != null && fetchedCustomerData.data) {
1251
- setCustomers(fetchedCustomerData == null ? void 0 : fetchedCustomerData.data);
1258
+ setFlatCustomers(fetchedCustomerData == null ? void 0 : fetchedCustomerData.data);
1252
1259
  }
1253
1260
  }, [loading]);
1254
1261
  //new codee
1255
1262
  var urlCustomerId = searchParams.get('customerId');
1256
1263
  var urlActiontype = searchParams.get('type');
1257
- var selectedCustomer = customers == null ? void 0 : customers.find(function (customer) {
1264
+ // Used strictly for getting the account number for the API payload (works for both parent and children)
1265
+ var selectedFlatCustomer = flatCustomers == null ? void 0 : flatCustomers.find(function (customer) {
1258
1266
  var _customer$customer_id;
1259
1267
  return (customer == null || (_customer$customer_id = customer.customer_id) == null ? void 0 : _customer$customer_id.toString()) === urlCustomerId;
1260
1268
  });
1261
- var accountNumber = selectedCustomer == null ? void 0 : selectedCustomer.account_number;
1269
+ var accountNumber = selectedFlatCustomer == null ? void 0 : selectedFlatCustomer.account_number;
1270
+ // Used strictly for retrieving children bundling IDs (only populates if it's a parent)
1271
+ var selectedGroupedCustomer = customers == null ? void 0 : customers.find(function (customer) {
1272
+ var _customer$customer_id2;
1273
+ return (customer == null || (_customer$customer_id2 = customer.customer_id) == null ? void 0 : _customer$customer_id2.toString()) === urlCustomerId;
1274
+ });
1275
+ var getFilterPayload = function getFilterPayload() {
1276
+ var _selectedGroupedCusto;
1277
+ var payload = urlCustomerId;
1278
+ if (selectedGroupedCustomer != null && selectedGroupedCustomer.children && (selectedGroupedCustomer == null || (_selectedGroupedCusto = selectedGroupedCustomer.children) == null ? void 0 : _selectedGroupedCusto.length) > 0) {
1279
+ var _selectedGroupedCusto2;
1280
+ payload = [urlCustomerId].concat(selectedGroupedCustomer == null || (_selectedGroupedCusto2 = selectedGroupedCustomer.children) == null ? void 0 : _selectedGroupedCusto2.map(function (child) {
1281
+ var _child$customer_id;
1282
+ return child == null || (_child$customer_id = child.customer_id) == null ? void 0 : _child$customer_id.toString();
1283
+ }));
1284
+ }
1285
+ return payload;
1286
+ };
1262
1287
  //customer name
1263
- var clientOptions = customers == null ? void 0 : customers.filter(function (option) {
1264
- return 'customer_id' in option && option.customer_id != null;
1288
+ var clientOptions = [].concat(flatCustomers || [], customers || []).filter(function (v, i, a) {
1289
+ return (a == null ? void 0 : a.findIndex(function (t) {
1290
+ var _t$customer_id, _v$customer_id;
1291
+ return (t == null || (_t$customer_id = t.customer_id) == null ? void 0 : _t$customer_id.toString()) === (v == null || (_v$customer_id = v.customer_id) == null ? void 0 : _v$customer_id.toString());
1292
+ })) === i;
1293
+ }).filter(function (option) {
1294
+ return (option == null ? void 0 : option.customer_id) != null;
1265
1295
  }).map(function (option) {
1266
- var _option$customer_name, _option$customer_name2;
1296
+ var _name$charAt;
1297
+ var name = String((option == null ? void 0 : option.customer_name) || (option == null ? void 0 : option.trading_as) || '');
1267
1298
  return {
1268
- label: (option == null || (_option$customer_name = option.customer_name) == null || (_option$customer_name = _option$customer_name.charAt(0)) == null ? void 0 : _option$customer_name.toUpperCase()) + (option == null || (_option$customer_name2 = option.customer_name) == null ? void 0 : _option$customer_name2.slice(1)),
1269
- value: option == null ? void 0 : option.customer_id,
1299
+ label: ((_name$charAt = name.charAt(0)) == null ? void 0 : _name$charAt.toUpperCase()) + (name == null ? void 0 : name.slice(1)),
1300
+ value: Number(option == null ? void 0 : option.customer_id),
1270
1301
  actions: option == null ? void 0 : option.actions,
1271
1302
  return_locations: option == null ? void 0 : option.return_locations,
1272
1303
  account_number: option == null ? void 0 : option.account_number
@@ -1387,7 +1418,7 @@ function SelectionFilter() {
1387
1418
  if (urlCustomerId) {
1388
1419
  dispatch({
1389
1420
  type: 'SET_CLIENT_FILTER',
1390
- payload: urlCustomerId
1421
+ payload: getFilterPayload()
1391
1422
  });
1392
1423
  dispatch({
1393
1424
  type: 'SET_PAGE',
@@ -1461,7 +1492,7 @@ function SelectionFilter() {
1461
1492
  if (urlCustomerId && urlActiontype) {
1462
1493
  dispatch({
1463
1494
  type: 'SET_CLIENT_FILTER',
1464
- payload: urlCustomerId
1495
+ payload: getFilterPayload()
1465
1496
  });
1466
1497
  setSelectedClient(+urlCustomerId);
1467
1498
  dispatch({
@@ -1476,7 +1507,7 @@ function SelectionFilter() {
1476
1507
  } else if (urlCustomerId) {
1477
1508
  dispatch({
1478
1509
  type: 'SET_CLIENT_FILTER',
1479
- payload: urlCustomerId
1510
+ payload: getFilterPayload()
1480
1511
  });
1481
1512
  setSelectedClient(+urlCustomerId);
1482
1513
  dispatch({
@@ -1484,7 +1515,7 @@ function SelectionFilter() {
1484
1515
  payload: 1
1485
1516
  });
1486
1517
  }
1487
- }, [urlCustomerId]);
1518
+ }, [urlCustomerId, customers]);
1488
1519
  var handleClearAction = function handleClearAction() {
1489
1520
  dispatch({
1490
1521
  type: 'CLEAR_ACTION'
@@ -1502,7 +1533,7 @@ function SelectionFilter() {
1502
1533
  style: {
1503
1534
  minWidth: '250px'
1504
1535
  },
1505
- value: selectedClient,
1536
+ value: (clientOptions == null ? void 0 : clientOptions.length) > 0 ? selectedClient || undefined : undefined,
1506
1537
  allowClear: true,
1507
1538
  onClear: handleClear,
1508
1539
  filterOption: function filterOption(input, option) {
@@ -1513,7 +1544,7 @@ function SelectionFilter() {
1513
1544
  })), selectedClient && React.createElement(React.Fragment, null, React.createElement(FilterColumn, null, React.createElement(Label, null, "Action Type"), React.createElement(StyledAntSelect, {
1514
1545
  options: actionTypeOptions,
1515
1546
  placeholder: "Select Action Type",
1516
- value: selectedFilterValue,
1547
+ value: (actionTypeOptions == null ? void 0 : actionTypeOptions.length) > 0 ? selectedFilterValue || undefined : undefined,
1517
1548
  onChange: handleActionClick,
1518
1549
  style: {
1519
1550
  minWidth: '200px'
@@ -1522,7 +1553,7 @@ function SelectionFilter() {
1522
1553
  onClear: handleClearAction
1523
1554
  })), React.createElement(FilterColumn, null, React.createElement(Label, null, "Location "), React.createElement(StyledAntSelect, {
1524
1555
  options: locationOptions,
1525
- value: selectedLocationValue,
1556
+ value: (locationOptions == null ? void 0 : locationOptions.length) > 0 ? selectedLocationValue || undefined : undefined,
1526
1557
  placeholder: "Select Location",
1527
1558
  onChange: handleLocationChange,
1528
1559
  style: {
@@ -18474,6 +18505,8 @@ var SearchType = function SearchType() {
18474
18505
  state = _useAtom[0];
18475
18506
  var _UsePaginationOvervie = UsePaginationOverviewData(),
18476
18507
  setPaginationObject = _UsePaginationOvervie[1];
18508
+ var _useStatsLoading = useStatsLoading(),
18509
+ setStatsLoading = _useStatsLoading[1];
18477
18510
  var didMountRef = useRef(false);
18478
18511
  var filters = state['x-filters'],
18479
18512
  pagination = state['x-pagination'];
@@ -18508,7 +18541,7 @@ var SearchType = function SearchType() {
18508
18541
  if (searchData && Array.isArray(searchData == null ? void 0 : searchData.data)) {
18509
18542
  setClientData(searchData == null ? void 0 : searchData.data);
18510
18543
  }
18511
- }, [searchData, loading]);
18544
+ }, [searchData]);
18512
18545
  var handleClear = function handleClear() {
18513
18546
  setSearchText('');
18514
18547
  setDebouncedSearchText('');
@@ -18524,6 +18557,13 @@ var SearchType = function SearchType() {
18524
18557
  statsDataLoading = _useAxios2.loading,
18525
18558
  paginationData = _useAxios2.paginationData,
18526
18559
  fetchAllData = _useAxios2.fetchData;
18560
+ useEffect(function () {
18561
+ if (debouncedSearchText && (debouncedSearchText == null ? void 0 : debouncedSearchText.length) > 0) {
18562
+ setStatsLoading(loading);
18563
+ } else {
18564
+ setStatsLoading(statsDataLoading);
18565
+ }
18566
+ }, [loading, statsDataLoading, debouncedSearchText]);
18527
18567
  useEffect(function () {
18528
18568
  if (fetchedClientData && fetchedClientData.data) {
18529
18569
  var result = fetchedClientData == null ? void 0 : fetchedClientData.data;
@@ -18594,9 +18634,6 @@ var Filters = function Filters() {
18594
18634
  var ReturnTable$1 = function ReturnTable() {
18595
18635
  var _useClientData = useClientData(),
18596
18636
  clientData = _useClientData[0];
18597
- var _useState = useState([]),
18598
- updatedData = _useState[0],
18599
- setUpdatedData = _useState[1];
18600
18637
  var _useStatsLoading = useStatsLoading(),
18601
18638
  statsLoading = _useStatsLoading[0];
18602
18639
  var _useAtom = useAtom(filtersReducerAtom),
@@ -18604,11 +18641,13 @@ var ReturnTable$1 = function ReturnTable() {
18604
18641
  var navigate = useNavigate();
18605
18642
  var _useCustomerData = useCustomerData(),
18606
18643
  customers = _useCustomerData[0];
18644
+ var _useInternalSearchTex = useInternalSearchText(),
18645
+ debouncedSearchText = _useInternalSearchTex[0];
18607
18646
  // const [searchParams] = useSearchParams();
18608
18647
  //sorting
18609
- var _useState2 = useState(null),
18610
- sortConfig = _useState2[0],
18611
- setSortConfig = _useState2[1];
18648
+ var _useState = useState(null),
18649
+ sortConfig = _useState[0],
18650
+ setSortConfig = _useState[1];
18612
18651
  var handleSort = function handleSort(key) {
18613
18652
  setSortConfig(function (prev) {
18614
18653
  if ((prev == null ? void 0 : prev.key) === key && prev.direction === 'asc') {
@@ -18623,6 +18662,29 @@ var ReturnTable$1 = function ReturnTable() {
18623
18662
  };
18624
18663
  });
18625
18664
  };
18665
+ //updated client data
18666
+ var updatedData = useMemo(function () {
18667
+ var baseCustomers = debouncedSearchText && (debouncedSearchText == null ? void 0 : debouncedSearchText.length) > 0 ? clientData || [] : customers || [];
18668
+ var mappedCustomers = (baseCustomers == null ? void 0 : baseCustomers.map(function (customer) {
18669
+ var _customer$children;
18670
+ // Normal state: Merge aggregate stats from the stats API onto the generic customers list
18671
+ var matchingClientStats = clientData == null ? void 0 : clientData.find(function (client) {
18672
+ var _customer$customer_id;
18673
+ return (client == null ? void 0 : client.customer_id) != null && (client == null ? void 0 : client.customer_id.toString()) === (customer == null || (_customer$customer_id = customer.customer_id) == null ? void 0 : _customer$customer_id.toString());
18674
+ });
18675
+ var processedChildren = customer == null || (_customer$children = customer.children) == null ? void 0 : _customer$children.map(function (child) {
18676
+ var matchingChildStats = clientData == null ? void 0 : clientData.find(function (client) {
18677
+ var _child$customer_id;
18678
+ return (client == null ? void 0 : client.customer_id) != null && (client == null ? void 0 : client.customer_id.toString()) === (child == null || (_child$customer_id = child.customer_id) == null ? void 0 : _child$customer_id.toString());
18679
+ });
18680
+ return _extends({}, child, matchingChildStats);
18681
+ });
18682
+ return _extends({}, customer, matchingClientStats, {
18683
+ children: processedChildren
18684
+ });
18685
+ })) || [];
18686
+ return mappedCustomers;
18687
+ }, [customers, clientData, debouncedSearchText]);
18626
18688
  var sortedData = useMemo(function () {
18627
18689
  if (!updatedData || !sortConfig) return updatedData;
18628
18690
  var key = sortConfig.key,
@@ -18645,18 +18707,6 @@ var ReturnTable$1 = function ReturnTable() {
18645
18707
  }
18646
18708
  return sortConfig.direction === 'asc' ? React.createElement(CaretDownFilledIcon, null) : React.createElement(CaretDownFilledIcon, null);
18647
18709
  };
18648
- //updated client data
18649
- useEffect(function () {
18650
- var updatedClientData = clientData == null ? void 0 : clientData.map(function (client) {
18651
- var matchingCustomer = customers == null ? void 0 : customers.find(function (customer) {
18652
- return (customer == null ? void 0 : customer.customer_id) === (client == null ? void 0 : client.customer_id);
18653
- });
18654
- return _extends({}, client, {
18655
- account_number: matchingCustomer ? matchingCustomer == null ? void 0 : matchingCustomer.account_number : null
18656
- });
18657
- });
18658
- setUpdatedData(updatedClientData);
18659
- }, [customers, clientData]);
18660
18710
  //handle Redirect
18661
18711
  var handleRedirect = function handleRedirect(customerId) {
18662
18712
  if (customerId) {
@@ -18765,31 +18815,144 @@ var ReturnTable$1 = function ReturnTable() {
18765
18815
  }))) : (sortedData == null ? void 0 : sortedData.length) === 0 ? React.createElement("tr", null, React.createElement("td", {
18766
18816
  colSpan: 12
18767
18817
  }, React.createElement(EmptyDataContainer, null, React.createElement(Empty, null)))) : sortedData == null ? void 0 : sortedData.map(function (key, index) {
18818
+ var _key$children, _key$children2;
18819
+ if (!key) return null; // Safe rendering fallback
18820
+ var renderDataRow = function renderDataRow(rowKey, isChild) {
18821
+ var _rowKey$children, _rowKey$orders, _rowKey$return_order_, _rowKey$RTS, _rowKey$PENDING, _rowKey$CLAIMSPAID, _rowKey$DISPOSE, _rowKey$REALLOCATE, _rowKey$REDEL, _rowKey$RECYCLE, _rowKey$UNKNOWN;
18822
+ if (isChild === void 0) {
18823
+ isChild = false;
18824
+ }
18825
+ if (!rowKey) return null; // Prevent properties of undefined UI crashes
18826
+ return React.createElement("tr", {
18827
+ key: isChild ? "child-" + (rowKey == null ? void 0 : rowKey.customer_id) : rowKey == null ? void 0 : rowKey.customer_id,
18828
+ style: isChild ? {
18829
+ backgroundColor: '#ffffff'
18830
+ } : {}
18831
+ }, React.createElement("td", {
18832
+ style: {
18833
+ paddingLeft: '15px',
18834
+ color: 'inherit'
18835
+ }
18836
+ }, React.createElement("span", {
18837
+ style: {
18838
+ fontWeight: !isChild && (rowKey == null || (_rowKey$children = rowKey.children) == null ? void 0 : _rowKey$children.length) > 0 ? 600 : 400
18839
+ }
18840
+ }, rowKey == null ? void 0 : rowKey.trading_as)), React.createElement("td", {
18841
+ onClick: function onClick() {
18842
+ return handleRedirect(rowKey == null ? void 0 : rowKey.customer_id);
18843
+ },
18844
+ style: {
18845
+ color: '#0099ff',
18846
+ fontWeight: 600,
18847
+ cursor: 'pointer'
18848
+ }
18849
+ }, React.createElement("span", null, rowKey == null ? void 0 : rowKey.customer_name)), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, (_rowKey$orders = rowKey == null ? void 0 : rowKey.orders) != null ? _rowKey$orders : 0))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, (_rowKey$return_order_ = rowKey == null ? void 0 : rowKey.return_order_products) != null ? _rowKey$return_order_ : 0))), React.createElement("td", {
18850
+ style: {
18851
+ color: (rowKey == null ? void 0 : rowKey.RTS) > 0 ? '#0099ff' : 'inherit',
18852
+ fontWeight: (rowKey == null ? void 0 : rowKey.RTS) > 0 ? 600 : 'normal',
18853
+ cursor: (rowKey == null ? void 0 : rowKey.RTS) > 0 ? 'pointer' : 'default'
18854
+ },
18855
+ onClick: (rowKey == null ? void 0 : rowKey.RTS) > 0 ? function () {
18856
+ return handleRedirectRTS(rowKey == null ? void 0 : rowKey.customer_id, 'RTS');
18857
+ } : undefined
18858
+ }, React.createElement(ColumStyle, null, React.createElement(GreyBox, {
18859
+ style: {
18860
+ backgroundColor: (rowKey == null ? void 0 : rowKey.RTS) > 0 ? 'rgba(99, 150, 229, 0.1)' : 'rgba(153, 153, 153, 0.1)'
18861
+ }
18862
+ }, (_rowKey$RTS = rowKey == null ? void 0 : rowKey.RTS) != null ? _rowKey$RTS : 0))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, (_rowKey$PENDING = rowKey == null ? void 0 : rowKey.PENDING) != null ? _rowKey$PENDING : 0))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, (_rowKey$CLAIMSPAID = rowKey == null ? void 0 : rowKey['CLAIMS PAID']) != null ? _rowKey$CLAIMSPAID : 0))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, (_rowKey$DISPOSE = rowKey == null ? void 0 : rowKey.DISPOSE) != null ? _rowKey$DISPOSE : 0))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, (_rowKey$REALLOCATE = rowKey == null ? void 0 : rowKey['RE-ALLOCATE']) != null ? _rowKey$REALLOCATE : 0), ' ')), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, (_rowKey$REDEL = rowKey == null ? void 0 : rowKey['RE-DEL']) != null ? _rowKey$REDEL : 0))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, (_rowKey$RECYCLE = rowKey == null ? void 0 : rowKey.RECYCLE) != null ? _rowKey$RECYCLE : 0))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, (_rowKey$UNKNOWN = rowKey == null ? void 0 : rowKey.UNKNOWN) != null ? _rowKey$UNKNOWN : 0))));
18863
+ };
18864
+ if (!(key != null && key.children) || (key == null || (_key$children = key.children) == null ? void 0 : _key$children.length) === 0) {
18865
+ return React.createElement(React.Fragment, {
18866
+ key: index
18867
+ }, renderDataRow(key, false));
18868
+ }
18768
18869
  return React.createElement("tr", {
18769
- key: index
18770
- }, React.createElement("td", null, key == null ? void 0 : key.trading_as), React.createElement("td", {
18771
- onClick: function onClick() {
18772
- return handleRedirect(key == null ? void 0 : key.customer_id);
18773
- },
18870
+ key: "group-" + index
18871
+ }, React.createElement("td", {
18872
+ colSpan: 12,
18774
18873
  style: {
18775
- color: '#0099ff',
18776
- fontWeight: 600,
18777
- cursor: 'pointer'
18874
+ padding: 0,
18875
+ border: 'none',
18876
+ background: 'transparent'
18778
18877
  }
18779
- }, React.createElement("span", null, key == null ? void 0 : key.customer_name)), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.orders))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.return_order_products))), React.createElement("td", {
18878
+ }, React.createElement("div", {
18780
18879
  style: {
18781
- color: (key == null ? void 0 : key.RTS) > 0 ? '#0099ff' : 'inherit',
18782
- fontWeight: (key == null ? void 0 : key.RTS) > 0 ? 600 : 'normal',
18783
- cursor: (key == null ? void 0 : key.RTS) > 0 ? 'pointer' : 'default'
18784
- },
18785
- onClick: (key == null ? void 0 : key.RTS) > 0 ? function () {
18786
- return handleRedirectRTS(key == null ? void 0 : key.customer_id, 'RTS');
18787
- } : undefined
18788
- }, React.createElement(ColumStyle, null, React.createElement(GreyBox, {
18880
+ margin: '12px 10px',
18881
+ backgroundColor: '#f8fafc',
18882
+ borderRadius: '16px',
18883
+ border: '1px solid rgba(0,0,0,0.08)',
18884
+ borderLeft: '4px solid #0099ff',
18885
+ boxShadow: 'inset 0 1px 4px rgba(0,0,0,0.02)'
18886
+ }
18887
+ }, React.createElement(StyledTableWrapper, {
18789
18888
  style: {
18790
- backgroundColor: (key == null ? void 0 : key.RTS) > 0 ? 'rgba(99, 150, 229, 0.1)' : 'rgba(153, 153, 153, 0.1)'
18889
+ margin: '0',
18890
+ border: 'none',
18891
+ borderRadius: '15px',
18892
+ overflow: 'hidden'
18791
18893
  }
18792
- }, key == null ? void 0 : key.RTS))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.PENDING))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['CLAIMS PAID']))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.DISPOSE))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['RE-ALLOCATE']), ' ')), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['RE-DEL']))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.RECYCLE))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.UNKNOWN))));
18894
+ }, React.createElement(StyledTable, {
18895
+ style: {
18896
+ marginBottom: 0
18897
+ }
18898
+ }, React.createElement("thead", {
18899
+ style: {
18900
+ visibility: 'collapse'
18901
+ }
18902
+ }, React.createElement("tr", null, [{
18903
+ label: 'Trading Name',
18904
+ key: 'trading_as'
18905
+ }, {
18906
+ label: 'Client',
18907
+ key: 'customer_name'
18908
+ }, {
18909
+ label: 'Orders',
18910
+ key: 'orders'
18911
+ }, {
18912
+ label: 'Products',
18913
+ key: 'return_order_products'
18914
+ }, {
18915
+ label: 'RTS',
18916
+ key: 'RTS'
18917
+ }, {
18918
+ label: 'Pending',
18919
+ key: 'PENDING'
18920
+ }, {
18921
+ label: 'Claims Paid',
18922
+ key: 'CLAIMS PAID'
18923
+ }, {
18924
+ label: 'Dispose',
18925
+ key: 'DISPOSE'
18926
+ }, {
18927
+ label: 'Re-allocate',
18928
+ key: 'RE-ALLOCATE'
18929
+ }, {
18930
+ label: 'Re-Del',
18931
+ key: 'RE-DEL'
18932
+ }, {
18933
+ label: 'Recycle',
18934
+ key: 'RECYCLE'
18935
+ }, {
18936
+ label: 'Unknown',
18937
+ key: 'UNKNOWN'
18938
+ }].map(function (_ref2) {
18939
+ var label = _ref2.label,
18940
+ thKey = _ref2.key;
18941
+ return React.createElement("th", {
18942
+ key: "hidden-" + thKey,
18943
+ style: {
18944
+ padding: '0 15px',
18945
+ border: 'none',
18946
+ height: 0
18947
+ }
18948
+ }, React.createElement("div", {
18949
+ style: {
18950
+ display: 'flex'
18951
+ }
18952
+ }, label));
18953
+ }))), React.createElement("tbody", null, renderDataRow(key, false), key == null || (_key$children2 = key.children) == null ? void 0 : _key$children2.map(function (child) {
18954
+ return renderDataRow(child, true);
18955
+ })))))));
18793
18956
  })))));
18794
18957
  };
18795
18958
 
@@ -18834,7 +18997,7 @@ function ReturnMainTable() {
18834
18997
  };
18835
18998
  //API for client data
18836
18999
  var _useAxios = useAxios({
18837
- endpoint: "/v1/return/product/customers/",
19000
+ endpoint: "/v1/return/product/customers/?grouped=true",
18838
19001
  method: 'GET',
18839
19002
  //@ts-ignore
18840
19003
  pagination: {