|
@@ -362,8 +362,10 @@ public class CmPayShopController extends BaseController {
|
|
|
cmChangePayShopProduct.setSingleShouldPayTotalTax(orderProduct.getSingleShouldPayTotalTax());
|
|
|
cmChangePayShopProductService.save(cmChangePayShopProduct);
|
|
|
}
|
|
|
-
|
|
|
+ // 成本
|
|
|
orderProduct.setCostPrice(costPrice);
|
|
|
+ // 成本 不含税
|
|
|
+ orderProduct.setCostPriceTax(product.getCostPrice() == null ? 0d : product.getCostPrice());
|
|
|
orderProduct.setOrganizeCostPrice(organizeCostPrice);
|
|
|
orderProduct.setCmCostPrice(cmCostPrice);
|
|
|
// 同步使用机构税率 作为供应商税率
|
|
@@ -638,32 +640,22 @@ public class CmPayShopController extends BaseController {
|
|
|
orderProduct.setShouldPayTotalTax(singleShouldPayTotalTax * (num + presentNum - returnNum));
|
|
|
totalTaxesFee += singleShouldPayTotalTax * (num + presentNum - returnNum);
|
|
|
}
|
|
|
- //总税费
|
|
|
- shopOrder.setShopTaxFee(totalTaxesFee);
|
|
|
- //商品费
|
|
|
- shopOrder.setShopProductAmount(totalCostFee);
|
|
|
+ shopOrder.setShopTaxFee(totalTaxesFee); //总税费
|
|
|
+ shopOrder.setShopProductAmount(totalCostFee); //商品费
|
|
|
}
|
|
|
// 比列成本
|
|
|
if ("2".equals(costType)) {
|
|
|
shopOrder.setProportional(proportional);
|
|
|
- //总税费
|
|
|
- shopOrder.setShopTaxFee(0D);
|
|
|
- //子订单金额
|
|
|
- Double productAmount = shopOrder.getProductAmount();
|
|
|
- //商品费
|
|
|
- shopOrder.setShopProductAmount(productAmount * proportional / 100);
|
|
|
+ shopOrder.setShopTaxFee(0D); //总税费
|
|
|
+ Double productAmount = shopOrder.getProductAmount();//子订单金额
|
|
|
+ shopOrder.setShopProductAmount(productAmount * proportional / 100); //商品费
|
|
|
}
|
|
|
- //运费
|
|
|
- shopOrder.setShopPostFee(freight);
|
|
|
- //付第三方
|
|
|
- shopOrder.setShopOtherFee(thirdPartyFee);
|
|
|
+ shopOrder.setShopPostFee(freight); //运费
|
|
|
+ shopOrder.setShopOtherFee(thirdPartyFee); //付第三方
|
|
|
shopOrder.setCostType(costType);
|
|
|
- //备注
|
|
|
- shopOrder.setModifyShouldPayNote(modifyShouldPayNote);
|
|
|
- //修改人的用户id
|
|
|
- shopOrder.setModifyShouldPayUserID(UserUtils.getUser().getId());
|
|
|
- //修改时间
|
|
|
- shopOrder.setModifyShouldPayDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
+ 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();
|
|
|
if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount < shopOrder.getPayedShopAmount()) {
|
|
@@ -671,9 +663,8 @@ public class CmPayShopController extends BaseController {
|
|
|
res.put("msg", "付供应商的金额不能小于已付款金额");
|
|
|
return res;
|
|
|
} else {
|
|
|
- if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount == shopOrder.getPayedShopAmount()) {
|
|
|
+ if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount == shopOrder.getPayedShopAmount())
|
|
|
shopOrder.setPayStatus("3");
|
|
|
- }
|
|
|
shopOrder.setShouldPayShopAmount(shouldPayShopAmount);
|
|
|
}
|
|
|
newShopOrderService.modifyPayShopAmount(shopOrder, orderProducts);
|
|
@@ -697,7 +688,7 @@ public class CmPayShopController extends BaseController {
|
|
|
int weekIdx = instance.get(Calendar.DAY_OF_WEEK) - 1;
|
|
|
String format = new SimpleDateFormat("HH:mm:ss").format(new Date());
|
|
|
Integer substring = Integer.valueOf(format.substring(0, 2));
|
|
|
- ids.forEach(i -> {
|
|
|
+ ids.forEach(i->{
|
|
|
//当前时间周五下午到周日都返回1不能结算,其他时间看够不够24小时
|
|
|
if ((5 == weekIdx && substring > 14) || 6 == weekIdx || 7 == weekIdx) {
|
|
|
flag.set(1);
|