Skip to content

Commit 8eeb5c5

Browse files
committed
fixed price calculation is not using discounted price
1 parent 82dee02 commit 8eeb5c5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ allprojects {
2424
}
2525

2626
project.ext {
27-
sdkVersion='0.6.10'
27+
sdkVersion='0.6.11'
2828
versionCode=1
2929

3030
compileSdkVersion=27

core/src/main/java/io/snabble/sdk/Product.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,14 @@ public boolean getSaleStop(){
217217

218218
public int getPriceForQuantity(int quantity, RoundingMode roundingMode){
219219
if (type == Product.Type.UserWeighed || type == Product.Type.PreWeighed) {
220-
BigDecimal pricePerUnit = new BigDecimal(price)
220+
BigDecimal pricePerUnit = new BigDecimal(getDiscountedPrice())
221221
.divide(new BigDecimal(1000));
222222

223223
return pricePerUnit.multiply(new BigDecimal(quantity))
224224
.setScale(0, roundingMode)
225225
.intValue();
226226
} else {
227-
return quantity * price;
227+
return quantity * getDiscountedPrice();
228228
}
229229
}
230230

0 commit comments

Comments
 (0)