|
@@ -99,7 +99,7 @@ public class cashbill extends Controller {
|
|
|
// 华为云
|
|
// 华为云
|
|
|
e = getExcelAttachment(content.getLong("attachmentid"));
|
|
e = getExcelAttachment(content.getLong("attachmentid"));
|
|
|
// 本地
|
|
// 本地
|
|
|
- //e = getPostExcelFactory();
|
|
|
|
|
|
|
+ //e = getPostExcel();
|
|
|
|
|
|
|
|
// Rows keyRow = dbConnect.runSqlQuery("select fagentnum,faddress from tagents
|
|
// Rows keyRow = dbConnect.runSqlQuery("select fagentnum,faddress from tagents
|
|
|
// where 1=2");
|
|
// where 1=2");
|
|
@@ -109,6 +109,7 @@ public class cashbill extends Controller {
|
|
|
keys.add("agentnum");
|
|
keys.add("agentnum");
|
|
|
keys.add("accountname");
|
|
keys.add("accountname");
|
|
|
keys.add("amount");
|
|
keys.add("amount");
|
|
|
|
|
+ keys.add("discountamount");
|
|
|
keys.add("type");
|
|
keys.add("type");
|
|
|
keys.add("typemx");
|
|
keys.add("typemx");
|
|
|
keys.add("period");
|
|
keys.add("period");
|
|
@@ -226,6 +227,7 @@ public class cashbill extends Controller {
|
|
|
sqlFactoryupload.addParameter("siteid", siteid);
|
|
sqlFactoryupload.addParameter("siteid", siteid);
|
|
|
sqlFactoryupload.addParameter("remarks", row.getString("remarks"));
|
|
sqlFactoryupload.addParameter("remarks", row.getString("remarks"));
|
|
|
sqlFactoryupload.addParameter("amount", row.getDouble("amount"));
|
|
sqlFactoryupload.addParameter("amount", row.getDouble("amount"));
|
|
|
|
|
+ sqlFactoryupload.addParameter("discountamount", StringUtils.isBlank(row.getString("discountamount"))?0:row.getDouble("discountamount"));
|
|
|
sqlFactoryupload.addParameter("subclass", row.getString("typemx"));
|
|
sqlFactoryupload.addParameter("subclass", row.getString("typemx"));
|
|
|
sqlFactoryupload.addParameter("class", row.getString("type"));
|
|
sqlFactoryupload.addParameter("class", row.getString("type"));
|
|
|
sqlFactoryupload.addParameter("userid", userid);
|
|
sqlFactoryupload.addParameter("userid", userid);
|
|
@@ -234,7 +236,6 @@ public class cashbill extends Controller {
|
|
|
sqlFactoryupload.addParameter("ownerid", 0);
|
|
sqlFactoryupload.addParameter("ownerid", 0);
|
|
|
sqlFactoryupload.addParameter("source", "");
|
|
sqlFactoryupload.addParameter("source", "");
|
|
|
sqlFactoryupload.addParameter("sourcenote", "");
|
|
sqlFactoryupload.addParameter("sourcenote", "");
|
|
|
- sqlFactoryupload.addParameter("discountamount", 0);
|
|
|
|
|
if (StringUtils.isBlank(row.getString("period"))) {
|
|
if (StringUtils.isBlank(row.getString("period"))) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
sqlFactoryupload.addParameter("billdate", sdf.format(new Date()));
|
|
sqlFactoryupload.addParameter("billdate", sdf.format(new Date()));
|
|
@@ -254,6 +255,7 @@ public class cashbill extends Controller {
|
|
|
map.put("agentnum", "经销商编码");
|
|
map.put("agentnum", "经销商编码");
|
|
|
map.put("accountname", "账户名称");
|
|
map.put("accountname", "账户名称");
|
|
|
map.put("amount", "金额");
|
|
map.put("amount", "金额");
|
|
|
|
|
+ map.put("discountamount", "优惠金额");
|
|
|
map.put("type", "分类");
|
|
map.put("type", "分类");
|
|
|
map.put("typemx", "分类明细");
|
|
map.put("typemx", "分类明细");
|
|
|
map.put("period", "单据日期");
|
|
map.put("period", "单据日期");
|
|
@@ -264,6 +266,7 @@ public class cashbill extends Controller {
|
|
|
colNameList.add("agentnum");
|
|
colNameList.add("agentnum");
|
|
|
colNameList.add("accountname");
|
|
colNameList.add("accountname");
|
|
|
colNameList.add("amount");
|
|
colNameList.add("amount");
|
|
|
|
|
+ colNameList.add("discountamount");
|
|
|
colNameList.add("type");
|
|
colNameList.add("type");
|
|
|
colNameList.add("typemx");
|
|
colNameList.add("typemx");
|
|
|
colNameList.add("period");
|
|
colNameList.add("period");
|
|
@@ -272,6 +275,7 @@ public class cashbill extends Controller {
|
|
|
keytypemap.put("agentnum", String.class);
|
|
keytypemap.put("agentnum", String.class);
|
|
|
keytypemap.put("accountname", String.class);
|
|
keytypemap.put("accountname", String.class);
|
|
|
keytypemap.put("amount", String.class);
|
|
keytypemap.put("amount", String.class);
|
|
|
|
|
+ keytypemap.put("discountamount", String.class);
|
|
|
keytypemap.put("type", String.class);
|
|
keytypemap.put("type", String.class);
|
|
|
keytypemap.put("typemx", String.class);
|
|
keytypemap.put("typemx", String.class);
|
|
|
keytypemap.put("period", String.class);
|
|
keytypemap.put("period", String.class);
|
|
@@ -674,7 +678,7 @@ public class cashbill extends Controller {
|
|
|
} else {
|
|
} else {
|
|
|
BigDecimal canuseamount = rowsaccountbalance.get(0).getBigDecimal("creditquota").add(rowsaccountbalance.get(0).getBigDecimal("balance")).add(rowsaccountbalance.get(0).getBigDecimal("discountamount"));
|
|
BigDecimal canuseamount = rowsaccountbalance.get(0).getBigDecimal("creditquota").add(rowsaccountbalance.get(0).getBigDecimal("balance")).add(rowsaccountbalance.get(0).getBigDecimal("discountamount"));
|
|
|
if ((rows.get(0).getBigDecimal("amount").add(canuseamount)).compareTo(BigDecimal.ZERO) == -1 && rows.get(0).getBigDecimal("amount").compareTo(BigDecimal.ZERO) <= 0) {
|
|
if ((rows.get(0).getBigDecimal("amount").add(canuseamount)).compareTo(BigDecimal.ZERO) == -1 && rows.get(0).getBigDecimal("amount").compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
- return getErrReturnObject().setErrMsg("该营销账户可用余额不足,收入凭证无法审核").toString();
|
|
|
|
|
|
|
+ //return getErrReturnObject().setErrMsg("该营销账户可用余额不足,收入凭证无法审核").toString();
|
|
|
}
|
|
}
|
|
|
balance = rows.get(0).getBigDecimal("amount").add(rowsaccountbalance.get(0).getBigDecimal("balance"));
|
|
balance = rows.get(0).getBigDecimal("amount").add(rowsaccountbalance.get(0).getBigDecimal("balance"));
|
|
|
discountamount = rows.get(0).getBigDecimal("discountamount").add(rowsaccountbalance.get(0).getBigDecimal("discountamount"));
|
|
discountamount = rows.get(0).getBigDecimal("discountamount").add(rowsaccountbalance.get(0).getBigDecimal("discountamount"));
|
|
@@ -779,7 +783,7 @@ public class cashbill extends Controller {
|
|
|
} else {
|
|
} else {
|
|
|
BigDecimal canuseamount = rowsaccountbalance.get(0).getBigDecimal("creditquota").add(rowsaccountbalance.get(0).getBigDecimal("balance")).add(rowsaccountbalance.get(0).getBigDecimal("discountamount"));
|
|
BigDecimal canuseamount = rowsaccountbalance.get(0).getBigDecimal("creditquota").add(rowsaccountbalance.get(0).getBigDecimal("balance")).add(rowsaccountbalance.get(0).getBigDecimal("discountamount"));
|
|
|
if (rows.get(0).getBigDecimal("amount").compareTo(canuseamount) == 1) {
|
|
if (rows.get(0).getBigDecimal("amount").compareTo(canuseamount) == 1) {
|
|
|
- return getErrReturnObject().setErrMsg("该营销账户可用余额不足,收入凭证无法反审核").toString();
|
|
|
|
|
|
|
+ //return getErrReturnObject().setErrMsg("该营销账户可用余额不足,收入凭证无法反审核").toString();
|
|
|
}
|
|
}
|
|
|
BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").subtract(rows.get(0).getBigDecimal("amount"));
|
|
BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").subtract(rows.get(0).getBigDecimal("amount"));
|
|
|
balance = newbalance;
|
|
balance = newbalance;
|
|
@@ -917,6 +921,7 @@ public class cashbill extends Controller {
|
|
|
titleMap.put("type_ch", "收支类型");
|
|
titleMap.put("type_ch", "收支类型");
|
|
|
titleMap.put("accountname", "账户名称");
|
|
titleMap.put("accountname", "账户名称");
|
|
|
titleMap.put("amount", "收支金额");
|
|
titleMap.put("amount", "收支金额");
|
|
|
|
|
+ titleMap.put("discountamount", "优惠金额");
|
|
|
titleMap.put("remarks", "备注");
|
|
titleMap.put("remarks", "备注");
|
|
|
titleMap.put("source", "凭证来源");
|
|
titleMap.put("source", "凭证来源");
|
|
|
titleMap.put("checkby", "审核人");
|
|
titleMap.put("checkby", "审核人");
|
|
@@ -1239,7 +1244,7 @@ public class cashbill extends Controller {
|
|
|
} else {
|
|
} else {
|
|
|
datarow.createCell(i1).setCellValue(row.getString((String) keylist.get(i1)));
|
|
datarow.createCell(i1).setCellValue(row.getString((String) keylist.get(i1)));
|
|
|
}
|
|
}
|
|
|
- if (i1 == 7) {
|
|
|
|
|
|
|
+ if (i1 == 8) {
|
|
|
datarow.getCell(i1).setCellStyle(xssfCellStyle1);
|
|
datarow.getCell(i1).setCellStyle(xssfCellStyle1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1282,7 +1287,7 @@ public class cashbill extends Controller {
|
|
|
} else {
|
|
} else {
|
|
|
datarow.createCell(i1).setCellValue(row.getString((String) keylist.get(i1)));
|
|
datarow.createCell(i1).setCellValue(row.getString((String) keylist.get(i1)));
|
|
|
}
|
|
}
|
|
|
- if (i1 == 7) {
|
|
|
|
|
|
|
+ if (i1 == 8) {
|
|
|
datarow.getCell(i1).setCellStyle(xssfCellStyle1);
|
|
datarow.getCell(i1).setCellStyle(xssfCellStyle1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|