|
@@ -625,8 +625,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
Double productTax = 0d;
|
|
|
Double discountTax = 0d;
|
|
|
if (taxFlag) {
|
|
|
- productTax = MathUtil.div(MathUtil.mul(productPrice, product.getShopTaxRate()), 100, 2).doubleValue();
|
|
|
- discountTax = MathUtil.div(MathUtil.mul(discountPrice, product.getShopTaxRate()), 100, 2).doubleValue();
|
|
|
+ productTax = MathUtil.div(MathUtil.mul(productPrice, product.getTaxRate()), 100, 2).doubleValue();
|
|
|
+ discountTax = MathUtil.div(MathUtil.mul(discountPrice, product.getTaxRate()), 100, 2).doubleValue();
|
|
|
} else if (!Integer.valueOf(1).equals(product.getIncludedTax())) {
|
|
|
// 不含税不可开票商品和未知商品,税率置为0
|
|
|
product.setTaxRate(0d);
|
|
@@ -634,8 +634,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
log.info("促销赠品计算:productTax===" + productTax);
|
|
|
// 商品价格
|
|
|
if (Integer.valueOf(0).equals(product.getIncludedTax())) {
|
|
|
- if (null != product.getShopTaxRate() && product.getShopTaxRate() > 0d) {
|
|
|
- product.setPrice(MathUtil.add(productPrice, MathUtil.mul(productPrice, MathUtil.div(product.getShopTaxRate(), 100, 2))).doubleValue());
|
|
|
+ if (null != product.getTaxRate() && product.getTaxRate() > 0d) {
|
|
|
+ product.setPrice(MathUtil.add(productPrice, MathUtil.mul(productPrice, MathUtil.div(product.getTaxRate(), 100, 2))).doubleValue());
|
|
|
}
|
|
|
} else {
|
|
|
product.setPrice(productPrice);
|
|
@@ -698,7 +698,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
BigDecimal svipReduction = MathUtil.sub(productPrice, discountPrice);
|
|
|
if (taxFlag) {
|
|
|
// 商品税费超级会员优惠
|
|
|
- BigDecimal svipTaxReduction = MathUtil.div(MathUtil.mul(svipReduction, product.getShopTaxRate()), 100, 2);
|
|
|
+ BigDecimal svipTaxReduction = MathUtil.div(MathUtil.mul(svipReduction, product.getTaxRate()), 100, 2);
|
|
|
svipReduction = MathUtil.add(svipReduction, svipTaxReduction);
|
|
|
}
|
|
|
// 统计超级会员优惠
|
|
@@ -758,12 +758,12 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
return ResponseJson.error("商品购买价格不能为0!", null);
|
|
|
}
|
|
|
// 不含税可开票商品计算税费
|
|
|
- if (null == product.getShopTaxRate() || product.getShopTaxRate() <= 0) {
|
|
|
+ if (null == product.getTaxRate() || product.getTaxRate() <= 0) {
|
|
|
product.setTaxRate(0d);
|
|
|
}
|
|
|
if (taxFlag) {
|
|
|
- productTax = MathUtil.div(MathUtil.mul(productPrice, product.getShopTaxRate()), 100, 2).doubleValue();
|
|
|
- discountTax = MathUtil.div(MathUtil.mul(discountPrice, product.getShopTaxRate()), 100, 2).doubleValue();
|
|
|
+ productTax = MathUtil.div(MathUtil.mul(productPrice, product.getTaxRate()), 100, 2).doubleValue();
|
|
|
+ discountTax = MathUtil.div(MathUtil.mul(discountPrice, product.getTaxRate()), 100, 2).doubleValue();
|
|
|
} else if (!Integer.valueOf(1).equals(product.getIncludedTax())) {
|
|
|
// 不含税不可开票商品和未知商品,税率置为0
|
|
|
product.setTaxRate(0d);
|
|
@@ -771,8 +771,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
log.info("productTax===" + productTax);
|
|
|
// 商品价格
|
|
|
if (Integer.valueOf(0).equals(product.getIncludedTax())) {
|
|
|
- if (null != product.getShopTaxRate() && product.getShopTaxRate() > 0d) {
|
|
|
- product.setPrice(MathUtil.add(productPrice, MathUtil.mul(productPrice, MathUtil.div(product.getShopTaxRate(), 100, 2))).doubleValue());
|
|
|
+ if (null != product.getTaxRate() && product.getTaxRate() > 0d) {
|
|
|
+ product.setPrice(MathUtil.add(productPrice, MathUtil.mul(productPrice, MathUtil.div(product.getTaxRate(), 100, 2))).doubleValue());
|
|
|
}
|
|
|
} else {
|
|
|
product.setPrice(productPrice);
|
|
@@ -823,7 +823,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
promotionsIds.add(promotions.getId());
|
|
|
promotions.setPromotionsId(promotions.getId());
|
|
|
if (taxFlag) {
|
|
|
- promotions.setTouchPrice( MathUtil.add(promotions.getTouchPrice(), MathUtil.div(MathUtil.mul(promotions.getTouchPrice(), product.getShopTaxRate()), 100, 2)).doubleValue());
|
|
|
+ promotions.setTouchPrice(MathUtil.add(promotions.getTouchPrice(), MathUtil.div(MathUtil.mul(promotions.getTouchPrice(), product.getTaxRate()), 100, 2)).doubleValue());
|
|
|
}
|
|
|
promotionList.add(promotions);
|
|
|
}
|
|
@@ -844,7 +844,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
promotionsIds.add(promotions.getId());
|
|
|
promotions.setPromotionsId(promotions.getId());
|
|
|
if (taxFlag) {
|
|
|
- promotions.setTouchPrice( MathUtil.add(promotions.getTouchPrice(), MathUtil.div(MathUtil.mul(promotions.getTouchPrice(), product.getShopTaxRate()), 100, 2)).doubleValue());
|
|
|
+ promotions.setTouchPrice(MathUtil.add(promotions.getTouchPrice(), MathUtil.div(MathUtil.mul(promotions.getTouchPrice(), product.getTaxRate()), 100, 2)).doubleValue());
|
|
|
}
|
|
|
promotionList.add(promotions);
|
|
|
} else {
|
|
@@ -893,7 +893,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
// 通过售价*比例得到成本价
|
|
|
double costTax = 0d;
|
|
|
if (taxFlag) {
|
|
|
- costTax = MathUtil.div(MathUtil.mul(product.getCostPrice(), product.getShopTaxRate()), 100, 2).doubleValue();
|
|
|
+ costTax = MathUtil.div(MathUtil.mul(product.getCostPrice(), product.getTaxRate()), 100, 2).doubleValue();
|
|
|
}
|
|
|
costPrice = MathUtil.add(product.getCostPrice(), costTax).doubleValue();
|
|
|
}
|
|
@@ -983,8 +983,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
if (StringUtils.isNotEmpty(organizeSkuInfo.getCostCheckFlag()) && "1".equals(organizeSkuInfo.getCostCheckFlag())) {
|
|
|
// 固定成本
|
|
|
if (taxFlag) {
|
|
|
- organizeSkuInfo.setOrganizeCostPrice(MathUtil.add(organizeSkuInfo.getOrganizeCostPrice(), MathUtil.div(MathUtil.mul(organizeSkuInfo.getOrganizeCostPrice(), product.getShopTaxRate()), 100)).doubleValue());
|
|
|
- organizeSkuInfo.setCmCostPrice(MathUtil.add(organizeSkuInfo.getCmCostPrice(), MathUtil.div(MathUtil.mul(organizeSkuInfo.getCmCostPrice(), product.getShopTaxRate()), 100)).doubleValue());
|
|
|
+ organizeSkuInfo.setOrganizeCostPrice(MathUtil.add(organizeSkuInfo.getOrganizeCostPrice(), MathUtil.div(MathUtil.mul(organizeSkuInfo.getOrganizeCostPrice(), product.getTaxRate()), 100)).doubleValue());
|
|
|
+ organizeSkuInfo.setCmCostPrice(MathUtil.add(organizeSkuInfo.getCmCostPrice(), MathUtil.div(MathUtil.mul(organizeSkuInfo.getCmCostPrice(), product.getTaxRate()), 100)).doubleValue());
|
|
|
}
|
|
|
product.setOrganizeCostPrice(organizeSkuInfo.getOrganizeCostPrice());
|
|
|
product.setCmCostPrice(organizeSkuInfo.getCmCostPrice());
|
|
@@ -2251,12 +2251,12 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
return ResponseJson.error("商品购买价格不能为0!", null);
|
|
|
}
|
|
|
// 不含税可开票商品计算税费
|
|
|
- if (null == product.getShopTaxRate() || product.getShopTaxRate() <= 0) {
|
|
|
+ if (null == product.getTaxRate() || product.getTaxRate() <= 0) {
|
|
|
product.setTaxRate(0d);
|
|
|
}
|
|
|
if (taxFlag) {
|
|
|
- productTax = MathUtil.div(MathUtil.mul(productPrice, product.getShopTaxRate()), 100, 2).doubleValue();
|
|
|
- discountTax = MathUtil.div(MathUtil.mul(discountPrice, product.getShopTaxRate()), 100, 2).doubleValue();
|
|
|
+ productTax = MathUtil.div(MathUtil.mul(productPrice, product.getTaxRate()), 100, 2).doubleValue();
|
|
|
+ discountTax = MathUtil.div(MathUtil.mul(discountPrice, product.getTaxRate()), 100, 2).doubleValue();
|
|
|
} else if (!Integer.valueOf(1).equals(product.getIncludedTax())) {
|
|
|
// 不含税不可开票商品和未知商品,税率置为0
|
|
|
product.setTaxRate(0d);
|
|
@@ -2299,7 +2299,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
// 通过售价*比例得到成本价
|
|
|
double costTax = 0d;
|
|
|
if (taxFlag) {
|
|
|
- costTax = MathUtil.div(MathUtil.mul(product.getCostPrice(), product.getShopTaxRate()), 100, 2).doubleValue();
|
|
|
+ costTax = MathUtil.div(MathUtil.mul(product.getCostPrice(), product.getTaxRate()), 100, 2).doubleValue();
|
|
|
}
|
|
|
costPrice = MathUtil.add(product.getCostPrice(), costTax).doubleValue();
|
|
|
}
|
|
@@ -2308,7 +2308,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
// 通过售价*比例得到成本价
|
|
|
double discountTax = 0d;
|
|
|
if (taxFlag) {
|
|
|
- discountTax = MathUtil.div(MathUtil.mul(product.getDiscountPrice(), product.getShopTaxRate()), 100, 2).doubleValue();
|
|
|
+ discountTax = MathUtil.div(MathUtil.mul(product.getDiscountPrice(), product.getTaxRate()), 100, 2).doubleValue();
|
|
|
}
|
|
|
costPrice = MathUtil.div(MathUtil.mul(MathUtil.add(product.getDiscountPrice(), discountTax), product.getCostProportional()), 100, 2).doubleValue();
|
|
|
}
|
|
@@ -2321,7 +2321,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
product.setShopTaxRate(product.getTaxRate());
|
|
|
}
|
|
|
if (taxFlag) {
|
|
|
- shopTax = MathUtil.div(MathUtil.mul(MathUtil.div(costPrice, MathUtil.div(MathUtil.add(product.getShopTaxRate(), 100), 100)), product.getShopTaxRate()), 100, 2).doubleValue();
|
|
|
+ shopTax = MathUtil.div(MathUtil.mul(MathUtil.div(costPrice, MathUtil.div(MathUtil.add(product.getTaxRate(), 100), 100)), product.getShopTaxRate()), 100, 2).doubleValue();
|
|
|
} else if (!Integer.valueOf(1).equals(product.getIncludedTax())) {
|
|
|
// 不含税不可开票商品和未知商品,税率置为0
|
|
|
product.setShopTaxRate(0d);
|
|
@@ -2384,8 +2384,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
if (StringUtils.isNotEmpty(organizeSkuInfo.getCostCheckFlag()) && "1".equals(organizeSkuInfo.getCostCheckFlag())) {
|
|
|
// 固定成本
|
|
|
if (taxFlag) {
|
|
|
- organizeSkuInfo.setOrganizeCostPrice(MathUtil.add(organizeSkuInfo.getOrganizeCostPrice(), MathUtil.div(MathUtil.mul(organizeSkuInfo.getOrganizeCostPrice(), product.getShopTaxRate()), 100)).doubleValue());
|
|
|
- organizeSkuInfo.setCmCostPrice(MathUtil.add(organizeSkuInfo.getCmCostPrice(), MathUtil.div(MathUtil.mul(organizeSkuInfo.getCmCostPrice(), product.getShopTaxRate()), 100)).doubleValue());
|
|
|
+ organizeSkuInfo.setOrganizeCostPrice(MathUtil.add(organizeSkuInfo.getOrganizeCostPrice(), MathUtil.div(MathUtil.mul(organizeSkuInfo.getOrganizeCostPrice(), product.getTaxRate()), 100)).doubleValue());
|
|
|
+ organizeSkuInfo.setCmCostPrice(MathUtil.add(organizeSkuInfo.getCmCostPrice(), MathUtil.div(MathUtil.mul(organizeSkuInfo.getCmCostPrice(), product.getTaxRate()), 100)).doubleValue());
|
|
|
}
|
|
|
product.setOrganizeCostPrice(organizeSkuInfo.getOrganizeCostPrice());
|
|
|
product.setCmCostPrice(organizeSkuInfo.getCmCostPrice());
|