shareneus 1.7.330 → 1.7.332
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.
|
@@ -146,6 +146,10 @@ function CalculatePriceBasedOnPriceList(item, priceList, includeMargin, quantity
|
|
|
146
146
|
if (priceList.Fixed && (0, util_1.IsNotNull)(priceList.Fixed.Price)) {
|
|
147
147
|
const fixedPrice = priceList.Fixed.Price;
|
|
148
148
|
const fixedDisc = priceList.Fixed.Disc || 0;
|
|
149
|
+
console.log('Track', item.Track);
|
|
150
|
+
console.log('Batches', item.Batches);
|
|
151
|
+
console.log('is Array', Array.isArray(item.Batches));
|
|
152
|
+
console.log('condition', item.Track === "BN" && Array.isArray(item.Batches));
|
|
149
153
|
if (item.Track === "TR" || item.Track === "SN") {
|
|
150
154
|
item.Sale["MRP"] = item.Sale.Price;
|
|
151
155
|
if ((0, util_1.IsNotNull)(fixedDisc) && fixedDisc > 0) {
|
|
@@ -160,6 +164,7 @@ function CalculatePriceBasedOnPriceList(item, priceList, includeMargin, quantity
|
|
|
160
164
|
}
|
|
161
165
|
else if (item.Track === "BN" && Array.isArray(item.Batches)) {
|
|
162
166
|
for (const batch of item.Batches) {
|
|
167
|
+
console.log('element batch before price calculation', batch);
|
|
163
168
|
batch.MRP = batch.Price;
|
|
164
169
|
if ((0, util_1.IsNotNull)(fixedDisc) && fixedDisc > 0) {
|
|
165
170
|
batch.Price = CalcItemFinalSalePrice(fixedPrice, fixedDisc, priceList);
|
|
@@ -170,6 +175,7 @@ function CalculatePriceBasedOnPriceList(item, priceList, includeMargin, quantity
|
|
|
170
175
|
if (includeMargin && (0, util_1.IsNotNull)(batch.Cost)) {
|
|
171
176
|
batch.Margin = (0, math_operations_1.GetMarginValue)(batch.Price, batch.Cost);
|
|
172
177
|
}
|
|
178
|
+
console.log('element batch', batch);
|
|
173
179
|
}
|
|
174
180
|
}
|
|
175
181
|
}
|
|
@@ -217,6 +223,7 @@ function CalculatePriceBasedOnPriceList(item, priceList, includeMargin, quantity
|
|
|
217
223
|
}
|
|
218
224
|
}
|
|
219
225
|
}
|
|
226
|
+
console.log('item after price list application', item);
|
|
220
227
|
return item;
|
|
221
228
|
}
|
|
222
229
|
function ApplyRounding(price, priceList) {
|
package/package.json
CHANGED
|
@@ -179,7 +179,10 @@ function CalculatePriceBasedOnPriceList(
|
|
|
179
179
|
if (priceList.Fixed && IsNotNull(priceList.Fixed.Price)) {
|
|
180
180
|
const fixedPrice = priceList.Fixed.Price;
|
|
181
181
|
const fixedDisc = priceList.Fixed.Disc || 0;
|
|
182
|
-
|
|
182
|
+
console.log('Track', item.Track);
|
|
183
|
+
console.log('Batches', item.Batches);
|
|
184
|
+
console.log('is Array', Array.isArray(item.Batches));
|
|
185
|
+
console.log('condition', item.Track === "BN" && Array.isArray(item.Batches));
|
|
183
186
|
if (item.Track === "TR" || item.Track === "SN") {
|
|
184
187
|
item.Sale["MRP"] = item.Sale.Price;
|
|
185
188
|
if (IsNotNull(fixedDisc) && fixedDisc > 0) {
|
|
@@ -193,6 +196,7 @@ function CalculatePriceBasedOnPriceList(
|
|
|
193
196
|
}
|
|
194
197
|
} else if (item.Track === "BN" && Array.isArray(item.Batches)) {
|
|
195
198
|
for (const batch of item.Batches) {
|
|
199
|
+
console.log('element batch before price calculation', batch);
|
|
196
200
|
batch.MRP = batch.Price;
|
|
197
201
|
if (IsNotNull(fixedDisc) && fixedDisc > 0) {
|
|
198
202
|
batch.Price = CalcItemFinalSalePrice(fixedPrice, fixedDisc, priceList);
|
|
@@ -202,6 +206,7 @@ function CalculatePriceBasedOnPriceList(
|
|
|
202
206
|
if (includeMargin && IsNotNull(batch.Cost)) {
|
|
203
207
|
batch.Margin = GetMarginValue(batch.Price, batch.Cost);
|
|
204
208
|
}
|
|
209
|
+
console.log('element batch', batch);
|
|
205
210
|
}
|
|
206
211
|
}
|
|
207
212
|
}
|
|
@@ -250,7 +255,7 @@ function CalculatePriceBasedOnPriceList(
|
|
|
250
255
|
}
|
|
251
256
|
}
|
|
252
257
|
}
|
|
253
|
-
|
|
258
|
+
console.log('item after price list application', item);
|
|
254
259
|
return item;
|
|
255
260
|
}
|
|
256
261
|
|