@bjsdistribution/dms-client-return 0.1.51-prod → 0.1.52-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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.51-prod",
2
+ "version": "0.1.52-prod",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -8,8 +8,8 @@ function CollapsedContent() {
8
8
 
9
9
  const calculateTotal = (items: any[], field: 'cube' | 'weight') => {
10
10
  return items
11
- .reduce((total, item) => {
12
- const val = parseFloat(item[field]);
11
+ ?.reduce((total, item) => {
12
+ const val = parseFloat(item?.[field]);
13
13
  return total + (isNaN(val) ? 0 : val);
14
14
  }, 0)
15
15
  .toFixed(2);
@@ -21,10 +21,16 @@ function CollapsedContent() {
21
21
  <Dimensions>Products to be Returned</Dimensions>
22
22
 
23
23
  {productsData?.length > 0 && (
24
- <Items style={{ display: 'flex' }}>
25
- Total: {calculateTotal(productsData, 'weight')}KG /{' '}
26
- {calculateTotal(productsData, 'cube')}m³
27
- </Items>
24
+ <>
25
+ <Items style={{ display: 'flex' }}>
26
+ Total: {calculateTotal(productsData, 'weight')}KG /{' '}
27
+ {calculateTotal(productsData, 'cube')}m³
28
+ </Items>
29
+
30
+ <Items style={{ display: 'flex' }}>
31
+ Orders- {new Set(productsData?.map((item: any) => item?.order_id).filter((id: any) => id != null)).size} / Products- {productsData?.length}
32
+ </Items>
33
+ </>
28
34
  )}
29
35
  </Container>
30
36
  );