Commit 98f78e4d by 江和松

采购收票选择结算单:增加收票数量(默认等于数量,可修改)、收票重量(默认等于数量,可修改)、收票金额(默认等于数量,可修改),剩余数量(数量-收票数量)、剩余重…

采购收票选择结算单:增加收票数量(默认等于数量,可修改)、收票重量(默认等于数量,可修改)、收票金额(默认等于数量,可修改),剩余数量(数量-收票数量)、剩余重量(重量-收票重量)、剩余收票金额(收货金额-收票金额)
parent f3f747f1
......@@ -72,6 +72,12 @@ public class HGCG003B extends DaoEPBase {
public static final String FIELD_CALCULATION_METHOD = "calculationMethod"; /* 计算方式 0-数量乘单价 1-重量乘单价*/
public static final String FIELD_CANCEL_AMOUNT = "cancelAmount"; /* 核销金额*/
public static final String FIELD_UN_CANCEL_AMOUNT = "unCancelAmount"; /* 未核销金额*/
public static final String FIELD_INVOICE_QTY = "invoiceQty"; /* 收票数量*/
public static final String FIELD_INVOICE_WEIGHT = "invoiceWeight"; /* 收票重量*/
public static final String FIELD_INVOICE_AMOUNT = "invoiceAmount"; /* 收票金额*/
public static final String FIELD_INVOICE_REMAINING_QTY = "invoiceRemainingQty"; /* 收票剩余数量*/
public static final String FIELD_INVOICE_REMAINING_WEIGHT = "invoiceRemainingWeight"; /* 收票剩余重量*/
public static final String FIELD_INVOICE_REMAINING_AMOUNT = "invoiceRemainingAmount"; /* 收票剩余金额*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -174,6 +180,12 @@ public class HGCG003B extends DaoEPBase {
private Integer calculationMethod = 0; /* 计算方式 0-数量乘单价 1-重量乘单价*/
private BigDecimal cancelAmount = new BigDecimal("0"); /* 核销金额*/
private BigDecimal unCancelAmount = new BigDecimal("0"); /* 未核销金额*/
private BigDecimal invoiceQty = new BigDecimal("0"); /* 收票数量*/
private BigDecimal invoiceWeight = new BigDecimal("0"); /* 收票重量*/
private BigDecimal invoiceAmount = new BigDecimal("0"); /* 收票金额*/
private BigDecimal invoiceRemainingQty = new BigDecimal("0"); /* 收票剩余数量*/
private BigDecimal invoiceRemainingWeight = new BigDecimal("0"); /* 收票剩余重量*/
private BigDecimal invoiceRemainingAmount = new BigDecimal("0"); /* 收票剩余金额*/
/**
* initialize the metadata.
......@@ -426,6 +438,49 @@ public class HGCG003B extends DaoEPBase {
eiColumn.setFieldLength(12);
eiColumn.setDescName("未核销金额");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收票数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收票重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(12);
eiColumn.setDescName("收票金额");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_REMAINING_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收票剩余数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_REMAINING_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收票剩余重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_REMAINING_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(12);
eiColumn.setDescName("收票剩余金额");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -1188,6 +1243,54 @@ public class HGCG003B extends DaoEPBase {
this.contractLineNo = contractLineNo;
}
public BigDecimal getInvoiceQty() {
return invoiceQty;
}
public void setInvoiceQty(BigDecimal invoiceQty) {
this.invoiceQty = invoiceQty;
}
public BigDecimal getInvoiceWeight() {
return invoiceWeight;
}
public void setInvoiceWeight(BigDecimal invoiceWeight) {
this.invoiceWeight = invoiceWeight;
}
public BigDecimal getInvoiceAmount() {
return invoiceAmount;
}
public void setInvoiceAmount(BigDecimal invoiceAmount) {
this.invoiceAmount = invoiceAmount;
}
public BigDecimal getInvoiceRemainingQty() {
return invoiceRemainingQty;
}
public void setInvoiceRemainingQty(BigDecimal invoiceRemainingQty) {
this.invoiceRemainingQty = invoiceRemainingQty;
}
public BigDecimal getInvoiceRemainingWeight() {
return invoiceRemainingWeight;
}
public void setInvoiceRemainingWeight(BigDecimal invoiceRemainingWeight) {
this.invoiceRemainingWeight = invoiceRemainingWeight;
}
public BigDecimal getInvoiceRemainingAmount() {
return invoiceRemainingAmount;
}
public void setInvoiceRemainingAmount(BigDecimal invoiceRemainingAmount) {
this.invoiceRemainingAmount = invoiceRemainingAmount;
}
/**
* get the value from Map.
*
......@@ -1246,6 +1349,12 @@ public class HGCG003B extends DaoEPBase {
setCalculationMethod(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CALCULATION_METHOD)), calculationMethod));
setCancelAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_CANCEL_AMOUNT)), cancelAmount));
setUnCancelAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UN_CANCEL_AMOUNT)), unCancelAmount));
setInvoiceQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INVOICE_QTY)), invoiceQty));
setInvoiceWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INVOICE_WEIGHT)), invoiceWeight));
setInvoiceAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INVOICE_AMOUNT)), invoiceAmount));
setInvoiceRemainingQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INVOICE_REMAINING_QTY)), invoiceRemainingQty));
setInvoiceRemainingWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INVOICE_REMAINING_WEIGHT)), invoiceRemainingWeight));
setInvoiceRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INVOICE_REMAINING_AMOUNT)), invoiceRemainingAmount));
}
/**
......@@ -1305,6 +1414,12 @@ public class HGCG003B extends DaoEPBase {
map.put(FIELD_CALCULATION_METHOD, StringUtils.toString(calculationMethod, eiMetadata.getMeta(FIELD_CALCULATION_METHOD)));
map.put(FIELD_CANCEL_AMOUNT, StringUtils.toString(cancelAmount, eiMetadata.getMeta(FIELD_CANCEL_AMOUNT)));
map.put(FIELD_UN_CANCEL_AMOUNT, StringUtils.toString(unCancelAmount, eiMetadata.getMeta(FIELD_UN_CANCEL_AMOUNT)));
map.put(FIELD_INVOICE_QTY, StringUtils.toString(invoiceQty, eiMetadata.getMeta(FIELD_INVOICE_QTY)));
map.put(FIELD_INVOICE_WEIGHT, StringUtils.toString(invoiceWeight, eiMetadata.getMeta(FIELD_INVOICE_WEIGHT)));
map.put(FIELD_INVOICE_AMOUNT, StringUtils.toString(invoiceAmount, eiMetadata.getMeta(FIELD_INVOICE_AMOUNT)));
map.put(FIELD_INVOICE_REMAINING_QTY, StringUtils.toString(invoiceRemainingQty, eiMetadata.getMeta(FIELD_INVOICE_REMAINING_QTY)));
map.put(FIELD_INVOICE_REMAINING_WEIGHT, StringUtils.toString(invoiceRemainingWeight, eiMetadata.getMeta(FIELD_INVOICE_REMAINING_WEIGHT)));
map.put(FIELD_INVOICE_REMAINING_AMOUNT, StringUtils.toString(invoiceRemainingAmount, eiMetadata.getMeta(FIELD_INVOICE_REMAINING_AMOUNT)));
return map;
}
......
......@@ -50,7 +50,13 @@
PROJ_NAME as "projName", <!-- 项目名称 -->
CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
CANCEL_AMOUNT as "cancelAmount",
UN_CANCEL_AMOUNT as "unCancelAmount"
UN_CANCEL_AMOUNT as "unCancelAmount",
INVOICE_QTY as "invoiceQty",
INVOICE_WEIGHT as "invoiceWeight",
INVOICE_AMOUNT as "invoiceAmount",
INVOICE_REMAINING_QTY as "invoiceRemainingQty",
INVOICE_REMAINING_WEIGHT as "invoiceRemainingWeight",
INVOICE_REMAINING_AMOUNT as "invoiceRemainingAmount"
</sql>
<sql id="condition">
......@@ -273,7 +279,13 @@
PROJ_NAME, <!-- 项目名称 -->
CALCULATION_METHOD, <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
CANCEL_AMOUNT,
UN_CANCEL_AMOUNT
UN_CANCEL_AMOUNT,
INVOICE_QTY,
INVOICE_WEIGHT,
INVOICE_AMOUNT,
INVOICE_REMAINING_QTY,
INVOICE_REMAINING_WEIGHT,
INVOICE_REMAINING_AMOUNT
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#,
#companyCode#, #companyName#, #receiveDate#, #receiveNo#, #receiveLineNo#, #planNo#,
......@@ -282,7 +294,8 @@
#material#, #unit#, #length#, #width#, #thick#, #receiveQty#, #deliverQty#,
#depositQty#, #receiveUnitWeight#, #receiveWeight#, #status#, #price#, #amount#,
#taxIncludeAmount#, #taxAmount#, #taxRate#, #inventTypeDetail#, #primaryId#,
#isInvoicing#, #projCode#, #projName#, #calculationMethod#, #cancelAmount#, #unCancelAmount#
#isInvoicing#, #projCode#, #projName#, #calculationMethod#, #cancelAmount#, #unCancelAmount#,
#invoiceQty#, #invoiceWeight#, #invoiceAmount#, #invoiceRemainingQty#, #invoiceRemainingWeight#, #invoiceRemainingAmount#
)
</insert>
......@@ -327,6 +340,12 @@
IS_INVOICING = #isInvoicing#,
CANCEL_AMOUNT = #cancelAmount#,
UN_CANCEL_AMOUNT = #unCancelAmount#,
INVOICE_QTY = #invoiceQty#,
INVOICE_WEIGHT = #invoiceWeight#,
INVOICE_AMOUNT = #invoiceAmount#,
INVOICE_REMAINING_QTY = #invoiceRemainingQty#,
INVOICE_REMAINING_WEIGHT = #invoiceRemainingWeight#,
INVOICE_REMAINING_AMOUNT = #invoiceRemainingAmount#,
<include refid="updateRevise"/>
WHERE ID = #id#
</update>
......@@ -418,7 +437,13 @@
b.PUR_USER_ID as "purUserId", <!-- 采购员 -->
b.PUR_USER_NAME as "purUserName", <!-- 采购员名称 -->
a.CANCEL_AMOUNT as "cancelAmount",
a.UN_CANCEL_AMOUNT as "unCancelAmount"
a.UN_CANCEL_AMOUNT as "unCancelAmount",
a.INVOICE_QTY as "invoiceQty",
a.INVOICE_WEIGHT as "invoiceWeight",
a.INVOICE_AMOUNT as "invoiceAmount",
a.INVOICE_REMAINING_QTY as "invoiceRemainingQty",
a.INVOICE_REMAINING_WEIGHT as "invoiceRemainingWeight",
a.INVOICE_REMAINING_AMOUNT as "invoiceRemainingAmount"
FROM ${hggpSchema}.HGCG003A a
LEFT JOIN ${hggpSchema}.HGCG003 b ON a.PRIMARY_ID = b.id
WHERE 1=1
......
......@@ -51,6 +51,14 @@ public class HGCW013 extends DaoEPBase {
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_CONTRACT_NO = "contractNo"; /* 合同号*/
//页面取值字段
public static final String FIELD_SAVE_INVOICE_QTY = "saveInvoiceQty"; /* 收票数量*/
public static final String FIELD_SAVE_INVOICE_WEIGHT = "saveInvoiceWeight"; /* 收票重量*/
public static final String FIELD_SAVE_INVOICE_AMOUNT = "saveInvoiceAmount"; /* 收票金额*/
public static final String FIELD_INVOICE_REMAINING_QTY = "invoiceRemainingQty"; /* 收票剩余数量*/
public static final String FIELD_INVOICE_REMAINING_WEIGHT = "invoiceRemainingWeight"; /* 收票剩余重量*/
public static final String FIELD_INVOICE_REMAINING_AMOUNT = "invoiceRemainingAmount"; /* 收票剩余金额*/
public static final String COL_ID = "ID";
public static final String COL_MAIN_ID = "MAIN_ID"; /* 主表ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -104,6 +112,14 @@ public class HGCW013 extends DaoEPBase {
private String spec = " "; /* 规格*/
private String contractNo = " "; /* 合同号*/
//页面取值字段
private BigDecimal saveInvoiceQty = new BigDecimal("0"); /* 收票数量*/
private BigDecimal saveInvoiceWeight = new BigDecimal("0"); /* 收票重量*/
private BigDecimal saveInvoiceAmount = new BigDecimal("0"); /* 收票金额*/
private BigDecimal invoiceRemainingQty = new BigDecimal("0"); /* 收票剩余数量*/
private BigDecimal invoiceRemainingWeight = new BigDecimal("0"); /* 收票剩余重量*/
private BigDecimal invoiceRemainingAmount = new BigDecimal("0"); /* 收票剩余金额*/
/**
* initialize the metadata.
*/
......@@ -213,6 +229,48 @@ public class HGCW013 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_CONTRACT_NO);
eiColumn.setDescName("合同号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SAVE_INVOICE_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收票数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SAVE_INVOICE_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收票重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SAVE_INVOICE_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(12);
eiColumn.setDescName("收票金额");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_REMAINING_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收票剩余数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_REMAINING_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收票剩余重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_REMAINING_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(12);
eiColumn.setDescName("收票剩余金额");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -576,6 +634,54 @@ public class HGCW013 extends DaoEPBase {
this.contractNo = contractNo;
}
public BigDecimal getSaveInvoiceQty() {
return saveInvoiceQty;
}
public void setSaveInvoiceQty(BigDecimal saveInvoiceQty) {
this.saveInvoiceQty = saveInvoiceQty;
}
public BigDecimal getSaveInvoiceWeight() {
return saveInvoiceWeight;
}
public void setSaveInvoiceWeight(BigDecimal saveInvoiceWeight) {
this.saveInvoiceWeight = saveInvoiceWeight;
}
public BigDecimal getSaveInvoiceAmount() {
return saveInvoiceAmount;
}
public void setSaveInvoiceAmount(BigDecimal saveInvoiceAmount) {
this.saveInvoiceAmount = saveInvoiceAmount;
}
public BigDecimal getInvoiceRemainingQty() {
return invoiceRemainingQty;
}
public void setInvoiceRemainingQty(BigDecimal invoiceRemainingQty) {
this.invoiceRemainingQty = invoiceRemainingQty;
}
public BigDecimal getInvoiceRemainingWeight() {
return invoiceRemainingWeight;
}
public void setInvoiceRemainingWeight(BigDecimal invoiceRemainingWeight) {
this.invoiceRemainingWeight = invoiceRemainingWeight;
}
public BigDecimal getInvoiceRemainingAmount() {
return invoiceRemainingAmount;
}
public void setInvoiceRemainingAmount(BigDecimal invoiceRemainingAmount) {
this.invoiceRemainingAmount = invoiceRemainingAmount;
}
/**
* get the value from Map.
*
......@@ -609,6 +715,13 @@ public class HGCW013 extends DaoEPBase {
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setContractNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NO)), contractNo));
//页面取值字段
setSaveInvoiceQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_SAVE_INVOICE_QTY)), saveInvoiceQty));
setSaveInvoiceWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_SAVE_INVOICE_WEIGHT)), saveInvoiceWeight));
setSaveInvoiceAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_SAVE_INVOICE_AMOUNT)), saveInvoiceAmount));
setInvoiceRemainingQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INVOICE_REMAINING_QTY)), invoiceRemainingQty));
setInvoiceRemainingWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INVOICE_REMAINING_WEIGHT)), invoiceRemainingWeight));
setInvoiceRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INVOICE_REMAINING_AMOUNT)), invoiceRemainingAmount));
}
/**
......@@ -644,6 +757,13 @@ public class HGCW013 extends DaoEPBase {
map.put(FIELD_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
map.put(FIELD_CONTRACT_NO, StringUtils.toString(contractNo, eiMetadata.getMeta(FIELD_CONTRACT_NO)));
map.put(FIELD_SAVE_INVOICE_QTY, StringUtils.toString(saveInvoiceQty, eiMetadata.getMeta(FIELD_SAVE_INVOICE_QTY)));
map.put(FIELD_SAVE_INVOICE_WEIGHT, StringUtils.toString(saveInvoiceWeight, eiMetadata.getMeta(FIELD_SAVE_INVOICE_WEIGHT)));
map.put(FIELD_SAVE_INVOICE_AMOUNT, StringUtils.toString(saveInvoiceAmount, eiMetadata.getMeta(FIELD_SAVE_INVOICE_AMOUNT)));
map.put(FIELD_INVOICE_REMAINING_QTY, StringUtils.toString(invoiceRemainingQty, eiMetadata.getMeta(FIELD_INVOICE_REMAINING_QTY)));
map.put(FIELD_INVOICE_REMAINING_WEIGHT, StringUtils.toString(invoiceRemainingWeight, eiMetadata.getMeta(FIELD_INVOICE_REMAINING_WEIGHT)));
map.put(FIELD_INVOICE_REMAINING_AMOUNT, StringUtils.toString(invoiceRemainingAmount, eiMetadata.getMeta(FIELD_INVOICE_REMAINING_AMOUNT)));
return map;
}
}
......@@ -12,11 +12,13 @@ import com.baosight.hggp.hg.cg.constant.HgCgConst;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.domain.*;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -408,17 +410,44 @@ public class ServiceHGCW012 extends ServiceBase {
//hgcw012.setRemainingAmount(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
DaoUtils.insert(HGCW012.INSERT, hgcw012);
List<HGCG003B> hgcg003BList = MapUtils.toDaoEPBases(inInfo, HGCG003B.class);
Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetDataEp(hgcg003BList);
//生成明细表
for (HGCW013 hgcw013 : hgcw013List) {
HGCG003B hgcg003B = dbCg003BMap.get(hgcw013.getId());
hgcw013.setMainId(hgcw012.getId());
//跟新采购收票状态
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HGCG003B.FIELD_RECEIVE_NO, hgcw013.getSettlementNumber());
paramMap.put(HGCG003B.FIELD_IS_INVOICING, HGConstant.CgIsInvoicing.S_1);
paramMap.put(HGCG003B.FIELD_IS_INVOICING, HGConstant.CgIsInvoicing.S_0);
paramMap.put(HGCG003B.FIELD_CANCEL_AMOUNT, hgcw013.getTotalContractPriceIncluding());
paramMap.put(HGCG003B.FIELD_UN_CANCEL_AMOUNT, 0);
paramMap.put(HGCG003B.FIELD_ID, hgcw013.getId());
if(Objects.nonNull(hgcg003B)){
paramMap.put(HGCG003B.FIELD_INVOICE_QTY, hgcg003B.getInvoiceQty().add(hgcw013.getSaveInvoiceQty()));
paramMap.put(HGCG003B.FIELD_INVOICE_WEIGHT, hgcg003B.getInvoiceWeight().add(hgcw013.getSaveInvoiceWeight()));
paramMap.put(HGCG003B.FIELD_INVOICE_AMOUNT, hgcg003B.getInvoiceAmount().add(hgcw013.getSaveInvoiceAmount()));
if(hgcg003B.getInvoiceRemainingQty().compareTo(BigDecimal.ZERO) > 0){
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_QTY, hgcg003B.getInvoiceRemainingQty().subtract(hgcw013.getSaveInvoiceQty()));
}else{
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_QTY, hgcg003B.getReceiveQty().subtract(hgcw013.getSaveInvoiceQty()));
}
if(hgcg003B.getInvoiceRemainingWeight().compareTo(BigDecimal.ZERO) > 0){
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_WEIGHT, hgcg003B.getInvoiceRemainingWeight().subtract(hgcw013.getSaveInvoiceWeight()));
}else{
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_WEIGHT, hgcg003B.getReceiveWeight().subtract(hgcw013.getSaveInvoiceWeight()));
}
if(hgcg003B.getInvoiceRemainingAmount().compareTo(BigDecimal.ZERO) > 0){
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_AMOUNT, hgcg003B.getInvoiceRemainingAmount().subtract(hgcw013.getSaveInvoiceAmount()));
}else{
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_AMOUNT, hgcg003B.getAmount().subtract(hgcw013.getSaveInvoiceAmount()));
}
//收货金额等于开票金额
if(hgcg003B.getAmount().compareTo(hgcg003B.getInvoiceAmount().add(hgcw013.getSaveInvoiceAmount())) == 0){
paramMap.put(HGCG003B.FIELD_IS_INVOICING, HGConstant.CgIsInvoicing.S_1);
}
}
DaoUtils.update(HGSqlConstant.HgCg003A.UPDATE_IS_INVOICING, paramMap);
hgcw013.setId(null);
this.addHGCW013(hgcw013);
......
......@@ -456,7 +456,13 @@
A.IS_INVOICING as "isInvoicing",
A.CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
A.CANCEL_AMOUNT as "cancelAmount",
A.UN_CANCEL_AMOUNT as "unCancelAmount"
A.UN_CANCEL_AMOUNT as "unCancelAmount",
A.INVOICE_QTY as "invoiceQty",
A.INVOICE_WEIGHT as "invoiceWeight",
A.INVOICE_AMOUNT as "invoiceAmount",
A.INVOICE_REMAINING_QTY as "invoiceRemainingQty",
A.INVOICE_REMAINING_WEIGHT as "invoiceRemainingWeight",
A.INVOICE_REMAINING_AMOUNT as "invoiceRemainingAmount"
FROM ${hggpSchema}.HGCG003A A LEFT JOIN ${hggpSchema}.HGCG003 B ON A.PRIMARY_ID = B.ID
WHERE A.DELETE_FLAG = 0 and b.delete_flag = 0
<isNotEmpty prepend=" AND " property="id">
......
......@@ -75,6 +75,66 @@ function btnSaveFunc(btnNode, gridNode) {
return;
}
let flag = true;
if(gridNode == 'result'){
$.each(rows, function(index, item) {
let saveInvoiceQty = item['saveInvoiceQty'];
let depositQty = item['depositQty'];
let invoiceRemainingQty = item['invoiceRemainingQty'];
if (!isNumber(saveInvoiceQty) && !isPositiveNumber(saveInvoiceQty)) {
message("勾选的第" + (index + 1) + "行收票数量必须是大于0的数字");
flag = false;
return false;
}
if (parseFloat(saveInvoiceQty) > parseFloat(depositQty)) {
message("第" + (index + 1) + "行收票数量不能大于数量");
flag = false;
return false;
}
if (parseFloat(saveInvoiceQty) > parseFloat(invoiceRemainingQty)) {
message("第" + (index + 1) + "行收票数量不能大于收票剩余数量");
flag = false;
return false;
}
let saveInvoiceWeight = item['saveInvoiceWeight'];
let receiveWeight = item['receiveWeight'];
let invoiceRemainingWeight = item['invoiceRemainingWeight'];
if (!isNumber(saveInvoiceWeight) && !isPositiveNumber(saveInvoiceWeight)) {
message("勾选的第" + (index + 1) + "行收票重量必须是大于0的数字");
flag = false;
return false;
}
if (parseFloat(saveInvoiceWeight) > parseFloat(receiveWeight)) {
message("第" + (index + 1) + "行收票重量不能大于重量");
flag = false;
return false;
}
if (parseFloat(saveInvoiceWeight) > parseFloat(invoiceRemainingWeight)) {
message("第" + (index + 1) + "行收票重量不能大于收票剩余重量");
flag = false;
return false;
}
let thisSettlementAmount = item['thisSettlementAmount'];
let amount = item['amount'];
let invoiceRemainingAmount = item['invoiceRemainingAmount'];
if (!isNumber(thisSettlementAmount) && !isPositiveNumber(thisSettlementAmount)) {
message("勾选的第" + (index + 1) + "行发票总额必须是大于0的数字");
flag = false;
return false;
}
if (parseFloat(thisSettlementAmount) > parseFloat(amount)) {
message("第" + (index + 1) + "行发票总额不能大于收货金额");
flag = false;
return false;
}
if (parseFloat(thisSettlementAmount) > parseFloat(invoiceRemainingAmount)) {
message("第" + (index + 1) + "行发票总额不能大于收票剩余金额");
flag = false;
return false;
}
})
}
if(gridNode == 'resultA'){
$.each(rows, function(index, item) {
let thisAmount = item['thisAmount'];
......@@ -222,7 +282,7 @@ $(function () {
field: "depositQty",
title: "数量",
headerTemplate: "<span style='color: '>数量 </span>",
format:"{0:N0}",
format:"{0:N2}",
align:"right",
enable: false,
locked: false
......@@ -243,7 +303,7 @@ $(function () {
editType: "date",
parseFormats:"['yyyyMMdd']",
dateFormat:"yyyy-MM-dd",
enable: true,
enable: false,
locked: false,
template: function (date) {
if (date.receiveDate instanceof Date){
......@@ -271,18 +331,104 @@ $(function () {
format:"{0:C2}",
align:"right",
locked: false,
attributes: {required: true},
template: function (item) {
if (isBlank(item.thisSettlementAmount)){
//剩余金额大于0,默认为剩余金额
if (item.isInvoicing == 0 && item.invoiceRemainingAmount > 0 && isBlank(item.thisSettlementAmount)){
item.thisSettlementAmount = item.invoiceRemainingAmount;
}else if (isBlank(item.thisSettlementAmount)){
item.thisSettlementAmount = item.taxIncludeAmount;
resultGrid.setCellValue(item, "thisSettlementAmount", item.taxIncludeAmount)
}
item.saveInvoiceAmount = item.thisSettlementAmount;
return kendo.format("{0:C2}",parseFloat(item.thisSettlementAmount));
}
},
{
field: "saveInvoiceQty",
title: "收票数量",
headerTemplate: "<span style='color: '>收票数量 </span>",
format:"{0:N2}",
align:"right",
enable: true,
locked: false,
attributes: {required: true},
template: function (item) {
if (item.isInvoicing == 0 && item.invoiceRemainingQty > 0 && isBlank(item.saveInvoiceQty)){
item.saveInvoiceQty = item.invoiceRemainingQty;
}else if (item.isInvoicing == 0 && isBlank(item.saveInvoiceQty)){
item.saveInvoiceQty = item.depositQty;
}
return kendo.format("{0:N2}",parseFloat(item.saveInvoiceQty));
}
},
{
field: "saveInvoiceWeight",
title: "收票重量",
headerTemplate: "<span style='color: '>收票重量 </span>",
format:"{0:N2}",
align:"right",
enable: true,
locked: false,
attributes: {required: true},
template: function (item) {
if (item.isInvoicing == 0 && item.invoiceRemainingWeight > 0 && isBlank(item.saveInvoiceWeight)){
item.saveInvoiceWeight = item.invoiceRemainingWeight;
}else if (item.isInvoicing == 0 && isBlank(item.saveInvoiceWeight)){
item.saveInvoiceWeight = item.receiveWeight;
}
return kendo.format("{0:N2}",parseFloat(item.saveInvoiceWeight));
}
},
{
field: "invoiceRemainingQty",
title: "收票剩余数量",
headerTemplate: "<span style='color: '>收票剩余数量 </span>",
format:"{0:N2}",
align:"right",
enable: false,
locked: false,
template: function (item) {
if (item.isInvoicing == 0 && item.invoiceRemainingQty == 0){
item.invoiceRemainingQty = item.depositQty;
}
return kendo.format("{0:N2}",parseFloat(item.invoiceRemainingQty));
}
},
{
field: "invoiceRemainingWeight",
title: "收票剩余重量",
headerTemplate: "<span style='color: '>收票剩余重量 </span>",
format:"{0:N2}",
align:"right",
enable: false,
locked: false,
template: function (item) {
if (item.isInvoicing == 0 && item.invoiceRemainingWeight == 0){
item.invoiceRemainingWeight = item.receiveWeight;
}
return kendo.format("{0:N2}",parseFloat(item.invoiceRemainingWeight));
}
},
{
field: "invoiceRemainingAmount",
title: "收票剩余金额",
headerTemplate: "<span style='color: '>收票剩余金额 </span>",
format:"{0:C2}",
align:"right",
enable: false,
locked: false,
template: function (item) {
if (item.isInvoicing == 0 && item.invoiceRemainingAmount == 0){
item.invoiceRemainingAmount = item.amount;
}
return kendo.format("{0:N2}",parseFloat(item.invoiceRemainingAmount));
}
}],
loadComplete: function(grid) {
// 此 grid 对象
$("#info-tab-1").on("click", function () {
grid.dataSource.page(1);
});
},
dataBound: function (e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment