@pisell/private-materials 6.12.233 → 6.12.234
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/plus/saleDetail/tmpl/B/components/Invoice/ReceiptRenderer.js +3 -3
- package/lib/plus/saleDetail/tmpl/B/components/Invoice/ReceiptRenderer.js +3 -3
- package/package.json +5 -5
|
@@ -123,7 +123,7 @@ function isDiscountExtension(row) {
|
|
|
123
123
|
return /^\s*-/.test(String(row.value || ""));
|
|
124
124
|
}
|
|
125
125
|
function buildProductDetailRows(product, quantity, locale, indent, scaleCombinationQuantity = true) {
|
|
126
|
-
var _product$product_note;
|
|
126
|
+
var _product$base_price, _product$product_note;
|
|
127
127
|
const options = Array.isArray(product.options) ? product.options : Array.isArray(product.combinations_options) ? product.combinations_options : [];
|
|
128
128
|
const combinations = Array.isArray(product.combinations) ? product.combinations : Array.isArray(product.product_bundle) ? product.product_bundle : [];
|
|
129
129
|
const extensionRows = Array.isArray(product.extension_list) ? product.extension_list.filter((row) => !/^\s*\d+(?:\.\d+)?\s*@\s*.+\s+EACH\s*$/i.test(String((row === null || row === void 0 ? void 0 : row.item) || ""))) : [];
|
|
@@ -132,7 +132,7 @@ function buildProductDetailRows(product, quantity, locale, indent, scaleCombinat
|
|
|
132
132
|
const optionRows = buildOptionRows(options, quantity, indent + 1);
|
|
133
133
|
const optionTotal = product.options_total_price ? String(product.options_total_price) : sumReceiptMoney(optionRows.map((row) => row.value), product.original_price || product.price);
|
|
134
134
|
const originalTotal = product.total_original_price ? String(product.total_original_price) : multiplyReceiptMoney(product.original_price || product.price || "", quantity);
|
|
135
|
-
const
|
|
135
|
+
const authoritativeBasePrice = String((_product$base_price = product.base_price) !== null && _product$base_price !== void 0 ? _product$base_price : "").trim();
|
|
136
136
|
const productTotal = productDisplayTotal(product, quantity);
|
|
137
137
|
const showBasePrice = Boolean(originalTotal && (options.length || combinations.length || discountRows.length || receiptMoneyValuesDiffer(originalTotal, productTotal)));
|
|
138
138
|
const combinationTotals = combinations.map((combination) => {
|
|
@@ -154,7 +154,7 @@ function buildProductDetailRows(product, quantity, locale, indent, scaleCombinat
|
|
|
154
154
|
});
|
|
155
155
|
if (showBasePrice) rows.push({
|
|
156
156
|
item: label("Base price", locale),
|
|
157
|
-
value:
|
|
157
|
+
value: authoritativeBasePrice || subtractReceiptMoney(originalTotal, optionTotal ? [optionTotal] : []),
|
|
158
158
|
indent
|
|
159
159
|
});
|
|
160
160
|
if (options.length) {
|
|
@@ -126,7 +126,7 @@ function isDiscountExtension(row) {
|
|
|
126
126
|
return /^\s*-/.test(String(row.value || ""));
|
|
127
127
|
}
|
|
128
128
|
function buildProductDetailRows(product, quantity, locale, indent, scaleCombinationQuantity = true) {
|
|
129
|
-
var _product$product_note;
|
|
129
|
+
var _product$base_price, _product$product_note;
|
|
130
130
|
const options = Array.isArray(product.options) ? product.options : Array.isArray(product.combinations_options) ? product.combinations_options : [];
|
|
131
131
|
const combinations = Array.isArray(product.combinations) ? product.combinations : Array.isArray(product.product_bundle) ? product.product_bundle : [];
|
|
132
132
|
const extensionRows = Array.isArray(product.extension_list) ? product.extension_list.filter((row) => !/^\s*\d+(?:\.\d+)?\s*@\s*.+\s+EACH\s*$/i.test(String((row === null || row === void 0 ? void 0 : row.item) || ""))) : [];
|
|
@@ -135,7 +135,7 @@ function buildProductDetailRows(product, quantity, locale, indent, scaleCombinat
|
|
|
135
135
|
const optionRows = buildOptionRows(options, quantity, indent + 1);
|
|
136
136
|
const optionTotal = product.options_total_price ? String(product.options_total_price) : require_receipt.sumReceiptMoney(optionRows.map((row) => row.value), product.original_price || product.price);
|
|
137
137
|
const originalTotal = product.total_original_price ? String(product.total_original_price) : require_receipt.multiplyReceiptMoney(product.original_price || product.price || "", quantity);
|
|
138
|
-
const
|
|
138
|
+
const authoritativeBasePrice = String((_product$base_price = product.base_price) !== null && _product$base_price !== void 0 ? _product$base_price : "").trim();
|
|
139
139
|
const productTotal = productDisplayTotal(product, quantity);
|
|
140
140
|
const showBasePrice = Boolean(originalTotal && (options.length || combinations.length || discountRows.length || require_receipt.receiptMoneyValuesDiffer(originalTotal, productTotal)));
|
|
141
141
|
const combinationTotals = combinations.map((combination) => {
|
|
@@ -157,7 +157,7 @@ function buildProductDetailRows(product, quantity, locale, indent, scaleCombinat
|
|
|
157
157
|
});
|
|
158
158
|
if (showBasePrice) rows.push({
|
|
159
159
|
item: label("Base price", locale),
|
|
160
|
-
value:
|
|
160
|
+
value: authoritativeBasePrice || require_receipt.subtractReceiptMoney(originalTotal, optionTotal ? [optionTotal] : []),
|
|
161
161
|
indent
|
|
162
162
|
});
|
|
163
163
|
if (options.length) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.234",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
"react-zoom-pan-pinch": "^3.7.0",
|
|
70
70
|
"styled-components": "^6.0.0-rc.3",
|
|
71
71
|
"use-sync-external-store": "^1.6.0",
|
|
72
|
-
"@pisell/
|
|
73
|
-
"@pisell/materials": "6.12.61",
|
|
74
|
-
"@pisell/icon": "0.0.11",
|
|
72
|
+
"@pisell/utils": "3.0.4",
|
|
75
73
|
"@pisell/date-picker": "3.0.10",
|
|
76
|
-
"@pisell/
|
|
74
|
+
"@pisell/materials": "6.12.61",
|
|
75
|
+
"@pisell/pi-payment-sdk": "0.0.3",
|
|
76
|
+
"@pisell/icon": "0.0.11"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"react": "^18.0.0",
|