rerobe-js-orm 3.9.1 → 3.9.2
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.
|
@@ -549,7 +549,7 @@ class OrderHelpers {
|
|
|
549
549
|
}
|
|
550
550
|
buildReceiptObjFromOrder({ order, merchant, merchantLogoUrl = '', receiptNumber = '', additionalInfo = '', }) {
|
|
551
551
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
552
|
-
const { address: merchantAddress, legalName, name, contactEmail, phone = '', organizationNumber = '', primaryDomain, currency: storeCurrencyCode, } = merchant;
|
|
552
|
+
const { address: merchantAddress, legalName, name, contactEmail, phone = '', organizationNumber = '', primaryDomain, currency: storeCurrencyCode, returnPolicy, } = merchant;
|
|
553
553
|
const currencyCode = ((_a = order.totalPricePresentment) === null || _a === void 0 ? void 0 : _a.currencyCode) || storeCurrencyCode;
|
|
554
554
|
const presentmentLocale = (0, Utilities_1.getPresentmentLocaleByCurrencyCode)(currencyCode);
|
|
555
555
|
const mapLineItem = (l) => {
|
|
@@ -632,11 +632,17 @@ class OrderHelpers {
|
|
|
632
632
|
};
|
|
633
633
|
const paymentTerminalInfo = this.getPaymentTerminalReceiptInfo(order);
|
|
634
634
|
const receiptLabels = this.generateReceiptLabels(presentmentLocale, (_b = order.paymentType) !== null && _b !== void 0 ? _b : '', (_c = paymentTerminalInfo.entryMode) !== null && _c !== void 0 ? _c : '');
|
|
635
|
+
let info = additionalInfo;
|
|
636
|
+
if (returnPolicy) {
|
|
637
|
+
info = `${returnPolicy}`;
|
|
638
|
+
if (additionalInfo) {
|
|
639
|
+
info = `${info}\n\n${additionalInfo}`;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
635
642
|
return Object.assign(Object.assign({ merchantLogoUrl, merchantName: name, legalName, storeAddress: buildStoreAddress(), phone,
|
|
636
643
|
contactEmail,
|
|
637
644
|
organizationNumber,
|
|
638
|
-
primaryDomain, storeUrl: `https://${primaryDomain}`, orderDate: (0, Utilities_1.getFormattedTimestamp)(presentmentLocale), receiptNumber,
|
|
639
|
-
additionalInfo, lineItems: buildLineItems(), subTotal: (0, Utilities_1.formatPrice)({
|
|
645
|
+
primaryDomain, storeUrl: `https://${primaryDomain}`, orderDate: (0, Utilities_1.getFormattedTimestamp)(presentmentLocale), receiptNumber, additionalInfo: info, lineItems: buildLineItems(), subTotal: (0, Utilities_1.formatPrice)({
|
|
640
646
|
currencyCode,
|
|
641
647
|
amount: (_e = (_d = order.subtotalPricePresentment) === null || _d === void 0 ? void 0 : _d.amount) !== null && _e !== void 0 ? _e : '',
|
|
642
648
|
fractionDigits: 2,
|