|
@@ -1678,6 +1678,37 @@ public class Order extends Controller {
|
|
|
return getErrReturnObject().setErrMsg("订单不存在").toString();
|
|
return getErrReturnObject().setErrMsg("订单不存在").toString();
|
|
|
}
|
|
}
|
|
|
Row row = rows.get(0);
|
|
Row row = rows.get(0);
|
|
|
|
|
+ String type = row.getString("type");
|
|
|
|
|
+ String typemx = row.getString("typemx");
|
|
|
|
|
+ ArrayList<String> sqllist= new ArrayList<>();
|
|
|
|
|
+ if(type.equals("配件订单")){
|
|
|
|
|
+ Rows rowsdetails=dbConnect.runSqlQuery("select t1.price,t1.amount,t1.sa_orderitemsid,t1.itemid,ifnull(t2.iswriteoff,0) iswriteoff,t3.begdate,t3.enddate from sa_orderitems t1 " +
|
|
|
|
|
+ "left join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid " +
|
|
|
|
|
+ "left join sa_warrantycard t3 on t1.cardno=t3.cardno and t1.siteid=t3.siteid and t3.isvoid=0 and t3.deleted=0");
|
|
|
|
|
+ for(Row rowsdetail :rowsdetails){
|
|
|
|
|
+ String billingstatus="";
|
|
|
|
|
+ BigDecimal price=rowsdetail.getBigDecimal("price");
|
|
|
|
|
+ BigDecimal amount=rowsdetail.getBigDecimal("amount");
|
|
|
|
|
+ String begdate=rowsdetail.getString("begdate");
|
|
|
|
|
+ String enddate=rowsdetail.getString("enddate");
|
|
|
|
|
+ if(StringUtils.isBlank(begdate) || StringUtils.isBlank(enddate)){
|
|
|
|
|
+ billingstatus="保外收费";
|
|
|
|
|
+ }else{
|
|
|
|
|
+ Date date=new Date();
|
|
|
|
|
+ if(date.before(rowsdetail.getDate("enddate"))){
|
|
|
|
|
+ if(rowsdetail.getBoolean("iswriteoff")){
|
|
|
|
|
+ billingstatus="保内收费";
|
|
|
|
|
+ }else{
|
|
|
|
|
+ billingstatus="保内免费";
|
|
|
|
|
+ price=BigDecimal.ZERO;
|
|
|
|
|
+ amount=BigDecimal.ZERO;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ sqllist.add("upadte sa_orderitems set price="+price+",amount="+amount+",billingstatus='"+billingstatus+"' where sa_orderitemsid="+rowsdetail.getLong("sa_orderitemsid"));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ dbConnect.runSqlUpdate(sqllist);
|
|
|
//付款账户信息
|
|
//付款账户信息
|
|
|
JSONArray accountclassinfos = row.getJSONArray("sa_accountclassinfos");
|
|
JSONArray accountclassinfos = row.getJSONArray("sa_accountclassinfos");
|
|
|
//扣款的金额
|
|
//扣款的金额
|
|
@@ -1687,8 +1718,6 @@ public class Order extends Controller {
|
|
|
if (sa_accountclassid <= 0) {
|
|
if (sa_accountclassid <= 0) {
|
|
|
return getErrReturnObject().setErrMsg("请选择支付账号").toString();
|
|
return getErrReturnObject().setErrMsg("请选择支付账号").toString();
|
|
|
}
|
|
}
|
|
|
- String type = row.getString("type");
|
|
|
|
|
- String typemx = row.getString("typemx");
|
|
|
|
|
if (siteid.equalsIgnoreCase("CCYOSG") && !type.equals("促销订单")) {
|
|
if (siteid.equalsIgnoreCase("CCYOSG") && !type.equals("促销订单")) {
|
|
|
if (typemx.equals("工程") || typemx.equals("电商") || typemx.equals("内部")) {
|
|
if (typemx.equals("工程") || typemx.equals("电商") || typemx.equals("内部")) {
|
|
|
|
|
|
|
@@ -1945,6 +1974,9 @@ public class Order extends Controller {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//总的金额
|
|
//总的金额
|
|
|
BigDecimal amountAll = amount;
|
|
BigDecimal amountAll = amount;
|
|
|
BigDecimal costamount_single = BigDecimal.ZERO;
|
|
BigDecimal costamount_single = BigDecimal.ZERO;
|
|
@@ -3788,6 +3820,7 @@ public class Order extends Controller {
|
|
|
public CashbillEntity getCashbillEntity(BigDecimal amount, Long ownerid, String source, String sourcenotes, String remarks) throws YosException {
|
|
public CashbillEntity getCashbillEntity(BigDecimal amount, Long ownerid, String source, String sourcenotes, String remarks) throws YosException {
|
|
|
CashbillEntity entity = new CashbillEntity();
|
|
CashbillEntity entity = new CashbillEntity();
|
|
|
entity.setAmount(amount);
|
|
entity.setAmount(amount);
|
|
|
|
|
+ entity.setDiscountamountamount(BigDecimal.ZERO);
|
|
|
entity.setOwnerid(ownerid);
|
|
entity.setOwnerid(ownerid);
|
|
|
entity.setOwnertable("sa_order");
|
|
entity.setOwnertable("sa_order");
|
|
|
entity.setSource(source);
|
|
entity.setSource(source);
|