shareneus 1.4.38 → 1.4.39
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.
|
@@ -4,6 +4,7 @@ exports.GetItemPriceForPriceList = GetItemPriceForPriceList;
|
|
|
4
4
|
exports.CalcItemFinalSalePrice = CalcItemFinalSalePrice;
|
|
5
5
|
const math_operations_1 = require("../../shared/math-operations");
|
|
6
6
|
const util_1 = require("../../shared/util");
|
|
7
|
+
const tr_utils_1 = require("../../utils/tr-utils");
|
|
7
8
|
function GetItemPriceForPriceList(item, priceList, includeMargin = false) {
|
|
8
9
|
var _a, _b;
|
|
9
10
|
let salePricesByPriceListId = [];
|
|
@@ -37,8 +38,10 @@ function GetItemPriceForPriceList(item, priceList, includeMargin = false) {
|
|
|
37
38
|
batchSalePrice = item.SalePrices.filter((batch) => priceList._id.toString() == batch.PrListId.toString() && batch.BN == null);
|
|
38
39
|
}
|
|
39
40
|
element.MRP = element.Price;
|
|
41
|
+
console.log("Batch Sale Price:", batchSalePrice);
|
|
40
42
|
if (batchSalePrice.length > 0) {
|
|
41
43
|
if ((0, util_1.IsNotNull)(batchSalePrice[0].Price) && (0, util_1.IsNotNull)(batchSalePrice[0].Disc)) {
|
|
44
|
+
console.log("Price:", batchSalePrice[0].Price, "Discount:", batchSalePrice[0].Disc);
|
|
42
45
|
element.Price = CalcItemFinalSalePrice(batchSalePrice[0].Price, batchSalePrice[0].Disc, priceList, markUp);
|
|
43
46
|
}
|
|
44
47
|
else if ((0, util_1.IsNotNull)(batchSalePrice[0].Price) && (0, util_1.IsNull)(batchSalePrice[0].Disc)) {
|
|
@@ -53,6 +56,7 @@ function GetItemPriceForPriceList(item, priceList, includeMargin = false) {
|
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
}
|
|
59
|
+
console.log("Item after applying price list:", tr_utils_1.TrUtils.Stringify(item));
|
|
56
60
|
return item;
|
|
57
61
|
}
|
|
58
62
|
return CalculatePriceBasedOnPriceList(item, priceList, includeMargin);
|