ordering-ui-admin-external 1.40.4 → 1.40.6
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/_bundles/{ordering-ui-admin.1c6dbec9fac48143a97a.js → ordering-ui-admin.d02d845770d3dce923e9.js} +2 -2
- package/_modules/components/Orders/OrderBill/index.js +2 -1
- package/_modules/components/Orders/OrderDetailsHeader/index.js +2 -2
- package/_modules/components/Orders/ProductItemAccordion/index.js +5 -3
- package/package.json +1 -1
- package/src/components/Orders/OrderBill/index.js +2 -1
- package/src/components/Orders/OrderDetailsHeader/index.js +2 -2
- package/src/components/Orders/ProductItemAccordion/index.js +3 -3
- /package/_bundles/{ordering-ui-admin.1c6dbec9fac48143a97a.js.LICENSE.txt → ordering-ui-admin.d02d845770d3dce923e9.js.LICENSE.txt} +0 -0
|
@@ -63,6 +63,7 @@ var OrderBill = exports.OrderBill = function OrderBill(props) {
|
|
|
63
63
|
4: t('SPOT_NUMBER_CURBSIDE', 'Spot number'),
|
|
64
64
|
5: t('SPOT_NUMBER_DRIVE_THRU', 'Drive thru lane')
|
|
65
65
|
};
|
|
66
|
+
var isPickupOrder = (order === null || order === void 0 ? void 0 : order.delivery_type) === 2;
|
|
66
67
|
var walletName = {
|
|
67
68
|
cash: {
|
|
68
69
|
name: t('CASH_WALLET', 'Cash Wallet')
|
|
@@ -169,7 +170,7 @@ var OrderBill = exports.OrderBill = function OrderBill(props) {
|
|
|
169
170
|
}, /*#__PURE__*/_react.default.createElement("td", null, t(offer === null || offer === void 0 || (_offer$name2 = offer.name) === null || _offer$name2 === void 0 || (_offer$name2 = _offer$name2.toUpperCase()) === null || _offer$name2 === void 0 ? void 0 : _offer$name2.replaceAll(' ', '_'), offer.name), offer.rate_type === 1 && /*#__PURE__*/_react.default.createElement("span", null, "(".concat((0, _utils.verifyDecimals)(offer === null || offer === void 0 ? void 0 : offer.rate, parsePrice), "%)"))), /*#__PURE__*/_react.default.createElement("td", null, "- ", parsePrice(offer === null || offer === void 0 || (_offer$summary2 = offer.summary) === null || _offer$summary2 === void 0 ? void 0 : _offer$summary2.discount, {
|
|
170
171
|
currency: (0, _utils.getCurrenySymbol)(order === null || order === void 0 ? void 0 : order.currency)
|
|
171
172
|
})));
|
|
172
|
-
})), typeof (order === null || order === void 0 || (_order$summary12 = order.summary) === null || _order$summary12 === void 0 ? void 0 : _order$summary12.delivery_price) === 'number' && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DELIVERY_FEE', 'Delivery Fee')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((order === null || order === void 0 || (_order$summary13 = order.summary) === null || _order$summary13 === void 0 ? void 0 : _order$summary13.delivery_price) + getIncludedTaxes(true), {
|
|
173
|
+
})), typeof (order === null || order === void 0 || (_order$summary12 = order.summary) === null || _order$summary12 === void 0 ? void 0 : _order$summary12.delivery_price) === 'number' && !isPickupOrder && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DELIVERY_FEE', 'Delivery Fee')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((order === null || order === void 0 || (_order$summary13 = order.summary) === null || _order$summary13 === void 0 ? void 0 : _order$summary13.delivery_price) + getIncludedTaxes(true), {
|
|
173
174
|
currency: (0, _utils.getCurrenySymbol)(order === null || order === void 0 ? void 0 : order.currency)
|
|
174
175
|
}))), (order === null || order === void 0 || (_order$taxes6 = order.taxes) === null || _order$taxes6 === void 0 ? void 0 : _order$taxes6.length) > 0 && (order === null || order === void 0 || (_order$taxes7 = order.taxes) === null || _order$taxes7 === void 0 ? void 0 : _order$taxes7.filter(function (tax) {
|
|
175
176
|
return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0 && (tax === null || tax === void 0 ? void 0 : tax.target) === 'delivery_fee';
|
|
@@ -94,7 +94,7 @@ var OrderDetailsHeader = exports.OrderDetailsHeader = function OrderDetailsHeade
|
|
|
94
94
|
return document.removeEventListener('click', closeSelect);
|
|
95
95
|
};
|
|
96
96
|
}, [showPrinterOptions]);
|
|
97
|
-
return /*#__PURE__*/_react.default.createElement(_styles2.OrderDetailsHeaderContainer, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h1", null, isServiceOrder ? t('APPOINTMENT_NO', 'Appointment No.') : t('INVOICE_ORDER_NO', 'Order No'), " ",
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement(_styles2.OrderDetailsHeaderContainer, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h1", null, isServiceOrder ? t('APPOINTMENT_NO', 'Appointment No.') : t('INVOICE_ORDER_NO', 'Order No'), " ", order.id), /*#__PURE__*/_react.default.createElement(_styles2.ButtonGroup, null, (user === null || user === void 0 ? void 0 : user.level) !== 5 && /*#__PURE__*/_react.default.createElement(_styles.IconButton, {
|
|
98
98
|
color: "black",
|
|
99
99
|
active: openMessage === null || openMessage === void 0 ? void 0 : openMessage.chat,
|
|
100
100
|
onClick: function onClick() {
|
|
@@ -161,7 +161,7 @@ var OrderDetailsHeader = exports.OrderDetailsHeader = function OrderDetailsHeade
|
|
|
161
161
|
onClick: function onClick() {
|
|
162
162
|
return closeSideBar();
|
|
163
163
|
}
|
|
164
|
-
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.XLg, null)))), (order === null || order === void 0 ? void 0 : order.external_id) && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h2", null, t('EXTERNAL_ID', 'External ID :'), " ", order === null || order === void 0 ? void 0 : order.external_id)), /*#__PURE__*/_react.default.createElement("p", null, (order === null || order === void 0 || (_order$payment_events = order.payment_events) === null || _order$payment_events === void 0 ? void 0 : _order$payment_events.length) > 0 ? order === null || order === void 0 || (_order$payment_events2 = order.payment_events) === null || _order$payment_events2 === void 0 ? void 0 : _order$payment_events2.filter(function (item) {
|
|
164
|
+
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.XLg, null)))), showExternalId && (order === null || order === void 0 ? void 0 : order.external_id) && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h2", null, t('EXTERNAL_ID', 'External ID :'), " ", order === null || order === void 0 ? void 0 : order.external_id)), /*#__PURE__*/_react.default.createElement("p", null, (order === null || order === void 0 || (_order$payment_events = order.payment_events) === null || _order$payment_events === void 0 ? void 0 : _order$payment_events.length) > 0 ? order === null || order === void 0 || (_order$payment_events2 = order.payment_events) === null || _order$payment_events2 === void 0 ? void 0 : _order$payment_events2.filter(function (item) {
|
|
165
165
|
return item.event === 'payment';
|
|
166
166
|
}).map(function (event, i) {
|
|
167
167
|
var _walletName$event$wal, _event$wallet_event, _event$paymethod, _event$paymethod2, _event$data, _event$paymethod3, _event$data2, _event$data3, _event$data4, _event$data5;
|
|
@@ -133,8 +133,9 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
133
133
|
_step2;
|
|
134
134
|
try {
|
|
135
135
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
136
|
+
var _suboption$half_price;
|
|
136
137
|
var suboption = _step2.value;
|
|
137
|
-
subOptionPrice += suboption.quantity * suboption.price;
|
|
138
|
+
subOptionPrice += suboption.quantity * (['left', 'right'].includes(suboption.position) ? (_suboption$half_price = suboption.half_price) !== null && _suboption$half_price !== void 0 ? _suboption$half_price : suboption.price : suboption.price);
|
|
138
139
|
}
|
|
139
140
|
} catch (err) {
|
|
140
141
|
_iterator2.e(err);
|
|
@@ -254,13 +255,14 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
254
255
|
}, /*#__PURE__*/_react.default.createElement("p", null, option.name), /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, {
|
|
255
256
|
className: "suboption"
|
|
256
257
|
}, option.suboptions.map(function (suboption) {
|
|
258
|
+
var _suboption$half_price2;
|
|
257
259
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
258
260
|
key: suboption.id
|
|
259
261
|
}, /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("span", null, getFormattedSubOptionName({
|
|
260
262
|
quantity: suboption.quantity,
|
|
261
263
|
name: suboption.name,
|
|
262
|
-
position: suboption.position !== 'whole' ? t(suboption.position.toUpperCase(), suboption.position) : '',
|
|
263
|
-
price: suboption.price
|
|
264
|
+
position: (suboption === null || suboption === void 0 ? void 0 : suboption.position) !== 'whole' ? t(suboption.position.toUpperCase(), suboption.position) : '',
|
|
265
|
+
price: ['left', 'right'].includes(suboption.position) ? (_suboption$half_price2 = suboption.half_price) !== null && _suboption$half_price2 !== void 0 ? _suboption$half_price2 : suboption.price : suboption.price
|
|
264
266
|
}))));
|
|
265
267
|
})));
|
|
266
268
|
})), product.comment && /*#__PURE__*/_react.default.createElement(_styles.ProductComment, null, /*#__PURE__*/_react.default.createElement("p", null, t('COMMENT', 'Comment')), /*#__PURE__*/_react.default.createElement("h3", null, product.comment))));
|
package/package.json
CHANGED
|
@@ -29,6 +29,7 @@ export const OrderBill = (props) => {
|
|
|
29
29
|
4: t('SPOT_NUMBER_CURBSIDE', 'Spot number'),
|
|
30
30
|
5: t('SPOT_NUMBER_DRIVE_THRU', 'Drive thru lane')
|
|
31
31
|
}
|
|
32
|
+
const isPickupOrder = order?.delivery_type === 2
|
|
32
33
|
|
|
33
34
|
const walletName = {
|
|
34
35
|
cash: {
|
|
@@ -189,7 +190,7 @@ export const OrderBill = (props) => {
|
|
|
189
190
|
</tr>
|
|
190
191
|
))
|
|
191
192
|
}
|
|
192
|
-
{typeof order?.summary?.delivery_price === 'number' && (
|
|
193
|
+
{typeof order?.summary?.delivery_price === 'number' && !isPickupOrder && (
|
|
193
194
|
<tr>
|
|
194
195
|
<td>{t('DELIVERY_FEE', 'Delivery Fee')}</td>
|
|
195
196
|
<td>{parsePrice(order?.summary?.delivery_price + getIncludedTaxes(true), { currency: getCurrenySymbol(order?.currency) })}</td>
|
|
@@ -96,7 +96,7 @@ export const OrderDetailsHeader = (props) => {
|
|
|
96
96
|
return (
|
|
97
97
|
<OrderDetailsHeaderContainer>
|
|
98
98
|
<div>
|
|
99
|
-
<h1>{isServiceOrder ? t('APPOINTMENT_NO', 'Appointment No.') : t('INVOICE_ORDER_NO', 'Order No')} {
|
|
99
|
+
<h1>{isServiceOrder ? t('APPOINTMENT_NO', 'Appointment No.') : t('INVOICE_ORDER_NO', 'Order No')} {order.id}</h1>
|
|
100
100
|
<ButtonGroup>
|
|
101
101
|
{user?.level !== 5 && (
|
|
102
102
|
<ButtonLink
|
|
@@ -184,7 +184,7 @@ export const OrderDetailsHeader = (props) => {
|
|
|
184
184
|
</ButtonLink>
|
|
185
185
|
</ButtonGroup>
|
|
186
186
|
</div>
|
|
187
|
-
{order?.external_id && (
|
|
187
|
+
{showExternalId && order?.external_id && (
|
|
188
188
|
<div>
|
|
189
189
|
<h2>
|
|
190
190
|
{t('EXTERNAL_ID', 'External ID :')} {order?.external_id}
|
|
@@ -107,7 +107,7 @@ export const ProductItemAccordion = (props) => {
|
|
|
107
107
|
if (product.options?.length > 0) {
|
|
108
108
|
for (const option of product.options) {
|
|
109
109
|
for (const suboption of option.suboptions) {
|
|
110
|
-
subOptionPrice += suboption.quantity * suboption.price
|
|
110
|
+
subOptionPrice += suboption.quantity * ((['left', 'right'].includes(suboption.position)) ? (suboption.half_price ?? suboption.price) : suboption.price)
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -292,8 +292,8 @@ export const ProductItemAccordion = (props) => {
|
|
|
292
292
|
{getFormattedSubOptionName({
|
|
293
293
|
quantity: suboption.quantity,
|
|
294
294
|
name: suboption.name,
|
|
295
|
-
position: (suboption
|
|
296
|
-
price: suboption.price
|
|
295
|
+
position: (suboption?.position !== 'whole') ? t(suboption.position.toUpperCase(), suboption.position) : '',
|
|
296
|
+
price: (['left', 'right'].includes(suboption.position)) ? (suboption.half_price ?? suboption.price) : suboption.price
|
|
297
297
|
})}
|
|
298
298
|
</span>
|
|
299
299
|
</li>
|