@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/dist/dms-client-return.cjs.development.js +12 -4
- package/dist/dms-client-return.cjs.development.js.map +1 -1
- package/dist/dms-client-return.cjs.production.min.js +1 -1
- package/dist/dms-client-return.cjs.production.min.js.map +1 -1
- package/dist/dms-client-return.esm.js +12 -4
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/order-view/products-info/collapsed-content/index.tsx +12 -6
|
@@ -8199,18 +8199,26 @@ function CollapsedContent$1() {
|
|
|
8199
8199
|
var _useProductDetails = useProductDetails(),
|
|
8200
8200
|
productsData = _useProductDetails[0];
|
|
8201
8201
|
var calculateTotal = function calculateTotal(items, field) {
|
|
8202
|
-
return items.reduce(function (total, item) {
|
|
8203
|
-
var val = parseFloat(item[field]);
|
|
8202
|
+
return items == null ? void 0 : items.reduce(function (total, item) {
|
|
8203
|
+
var val = parseFloat(item == null ? void 0 : item[field]);
|
|
8204
8204
|
return total + (isNaN(val) ? 0 : val);
|
|
8205
8205
|
}, 0).toFixed(2);
|
|
8206
8206
|
};
|
|
8207
8207
|
return React.createElement(Container$P, null, React.createElement(SectionHeader, {
|
|
8208
8208
|
label: "Products"
|
|
8209
|
-
}), React.createElement(Dimensions, null, "Products to be Returned"), (productsData == null ? void 0 : productsData.length) > 0 && React.createElement(Items, {
|
|
8209
|
+
}), React.createElement(Dimensions, null, "Products to be Returned"), (productsData == null ? void 0 : productsData.length) > 0 && React.createElement(React.Fragment, null, React.createElement(Items, {
|
|
8210
8210
|
style: {
|
|
8211
8211
|
display: 'flex'
|
|
8212
8212
|
}
|
|
8213
|
-
}, "Total: ", calculateTotal(productsData, 'weight'), "KG /", ' ', calculateTotal(productsData, 'cube'), "m\xB3")
|
|
8213
|
+
}, "Total: ", calculateTotal(productsData, 'weight'), "KG /", ' ', calculateTotal(productsData, 'cube'), "m\xB3"), React.createElement(Items, {
|
|
8214
|
+
style: {
|
|
8215
|
+
display: 'flex'
|
|
8216
|
+
}
|
|
8217
|
+
}, "Orders- ", new Set(productsData == null ? void 0 : productsData.map(function (item) {
|
|
8218
|
+
return item == null ? void 0 : item.order_id;
|
|
8219
|
+
}).filter(function (id) {
|
|
8220
|
+
return id != null;
|
|
8221
|
+
})).size, " / Products- ", productsData == null ? void 0 : productsData.length)));
|
|
8214
8222
|
}
|
|
8215
8223
|
var Dimensions = /*#__PURE__*/styled.span(_templateObject$1k || (_templateObject$1k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #6a7378;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px; /* 171.429% */\n"])));
|
|
8216
8224
|
var Container$P = /*#__PURE__*/styled.div(_templateObject2$$ || (_templateObject2$$ = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n /* justify-content: space-between; */\n width: 100%;\n gap: 30px;\n"])));
|