|
@@ -11,6 +11,7 @@ import com.caimei.modules.order.service.*;
|
|
|
import com.caimei.modules.sys.utils.UploadImageUtils;
|
|
|
import com.caimei.modules.user.entity.CmUserOrganize;
|
|
|
import com.caimei.modules.user.service.CmUserOrganizeService;
|
|
|
+import com.caimei.utils.MathUtil;
|
|
|
import com.thinkgem.jeesite.common.config.Global;
|
|
|
import com.thinkgem.jeesite.common.persistence.Page;
|
|
|
import com.thinkgem.jeesite.common.utils.Encodes;
|
|
@@ -302,6 +303,11 @@ public class CmPayShopController extends BaseController {
|
|
|
if (soZeroCostFlag && costPrice > 0) {
|
|
|
soZeroCostFlag = false;
|
|
|
}
|
|
|
+ // 在订单商品含税的情况下, 成本计算税费
|
|
|
+ if ("0".equals(product.getIncludedTax()) && null != product.getTaxRate() && product.getTaxRate() > 0d) {
|
|
|
+ costPrice = MathUtil.add(costPrice, MathUtil.div(MathUtil.mul(costPrice, product.getTaxRate()), 100)).doubleValue();
|
|
|
+ }
|
|
|
+ // product.setSingleShouldPayTotalTax(MathUtil.div(MathUtil.mul(MathUtil.div(product.getCostPrice(), MathUtil.div(MathUtil.add(product.getTaxRate(), 100),100)), product.getSupplierTaxRate()), 100).doubleValue());
|
|
|
Double singleShouldPayTotalTax = product.getSingleShouldPayTotalTax() == null ? 0d : product.getSingleShouldPayTotalTax();
|
|
|
Double supplierTaxRate = product.getSupplierTaxRate() == null ? 0d : product.getSupplierTaxRate();
|
|
|
// 获取已被退款的商品数量
|
|
@@ -490,7 +496,7 @@ public class CmPayShopController extends BaseController {
|
|
|
shopOrder.setModifyShouldPayNote(modifyShouldPayNote); //备注
|
|
|
shopOrder.setModifyShouldPayUserID(UserUtils.getUser().getId()); //修改人的用户id
|
|
|
shopOrder.setModifyShouldPayDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); //修改时间
|
|
|
- double shouldPayShopAmount = shopOrder.getShopProductAmount() + shopOrder.getShopPostFee() + shopOrder.getShopTaxFee();
|
|
|
+ double shouldPayShopAmount = shopOrder.getShopProductAmount() + shopOrder.getShopPostFee(); // + shopOrder.getShopTaxFee();
|
|
|
if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount == shopOrder.getPayedShopAmount())
|
|
|
shopOrder.setPayStatus("3");
|
|
|
shopOrder.setShouldPayShopAmount(shouldPayShopAmount);
|