Commit 1ffb5e81 by liuyang

2024-09-20 合并结算单问题

parent 2b15d8a1
...@@ -188,13 +188,22 @@ public class ServiceHGCW008 extends ServiceBase { ...@@ -188,13 +188,22 @@ public class ServiceHGCW008 extends ServiceBase {
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGCW008 hgcw008 = new HGCW008(); HGCW008 hgcw008 = new HGCW008();
hgcw008.fromMap(resultRow); hgcw008.fromMap(resultRow);
List<HGCW006> hgcw006s = DaoBase.getInstance().query(HGCW006.QUERY,new HashMap<String,Object>(){
{put("contractNumber",hgcw008.getContractNumber());}
});
List<HGCW010> hgcw010List = DaoBase.getInstance().query(HGCW010.QUERY, List<HGCW010> hgcw010List = DaoBase.getInstance().query(HGCW010.QUERY,
new HashMap<String, Object>(){{ new HashMap<String, Object>(){{
put(HGCW010.FIELD_SETTLEMENT_NUMBER,hgcw008.getSettlementNumber()); put(HGCW010.FIELD_SETTLEMENT_NUMBER,hgcw008.getSettlementNumber());
}}); }});
AssertUtils.isNotEmpty(hgcw010List, "结算单[" + hgcw008.getSettlementNumber() + "]已生成销售开票,不能删除!"); AssertUtils.isNotEmpty(hgcw010List, "结算单[" + hgcw008.getSettlementNumber() + "]已生成销售开票,不能删除!");
if (hgcw006s.size()>0){
// 反写租赁剩余金额
HGCWTools.HgCw006.deductionAmount(hgcw008.getContractNumber(), hgcw008.getThisPriceTax().negate());
}else {
// 反写金额 // 反写金额
HGCWTools.HgCw008.remainingAmount(hgcw008.getContractNumber(), hgcw008.getThisPriceTax().negate()); HGCWTools.HgCw008.remainingAmount(hgcw008.getContractNumber(), hgcw008.getThisPriceTax().negate());
}
DaoUtils.update(HGCW008.DELETE, hgcw008); DaoUtils.update(HGCW008.DELETE, hgcw008);
// 更新累计金额 // 更新累计金额
HGCWTools.HgCw008.updateCumulativeSettlement(hgcw008.getContractNumber()); HGCWTools.HgCw008.updateCumulativeSettlement(hgcw008.getContractNumber());
......
...@@ -26,7 +26,9 @@ $(function() { ...@@ -26,7 +26,9 @@ $(function() {
} else { } else {
return ""; return "";
} }
} else { }else if(!isBlank(item.totalTaxPrice)){
return parseFloat(item.totalTaxPrice);
}else {
return parseFloat(item.totalPrice); return parseFloat(item.totalPrice);
} }
} }
...@@ -55,10 +57,14 @@ $(function() { ...@@ -55,10 +57,14 @@ $(function() {
}, },
onAdd: function (e) { onAdd: function (e) {
var contractType = $("#contractType").val(); var contractType = $("#contractType").val();
if (contractType == "1") { if (contractType == "1" || contractType == "5") {
$.each(e.items, function (index, item) { $.each(e.items, function (index, item) {
item['settlementBasis'] = "罚款"; item['settlementBasis'] = "罚款";
}); });
}else if (contractType == "6" || contractType == "7") {
$.each(e.items, function (index, item) {
item['settlementBasis'] = "合同内";
});
} }
}, },
onSave: function (e) { onSave: function (e) {
...@@ -267,8 +273,9 @@ function choiceCallbackFunc(result1, result2, result3) { ...@@ -267,8 +273,9 @@ function choiceCallbackFunc(result1, result2, result3) {
detail1Grid.setCellValue(0, "thisEngineeringQuantity", item.deviceNumber); detail1Grid.setCellValue(0, "thisEngineeringQuantity", item.deviceNumber);
detail1Grid.setCellValue(0, "taskName", item.deviceName); detail1Grid.setCellValue(0, "taskName", item.deviceName);
detail1Grid.setCellValue(0, "unit", item.unit); detail1Grid.setCellValue(0, "unit", item.unit);
detail1Grid.setCellValue(0, "unitPrice", item.unitPrice * item.dayNumber); detail1Grid.setCellValue(0, "unitPrice", item.totalPriceIncluding/ item.deviceNumber);
detail1Grid.setCellValue(0, "totalPrice", item.totalPrice.toFixed(2)); detail1Grid.setCellValue(0, "totalPrice", item.totalPrice.toFixed(2));
detail1Grid.setCellValue(0, "totalTaxPrice", item.totalPriceIncluding.toFixed(2));
detail1Grid.setCellValue(0, "inventoryId", item.id); detail1Grid.setCellValue(0, "inventoryId", item.id);
detail1Grid.refresh(); detail1Grid.refresh();
}) })
...@@ -325,11 +332,12 @@ function btnSaveFunc() { ...@@ -325,11 +332,12 @@ function btnSaveFunc() {
fieldValidation(); fieldValidation();
JSUtils.confirm("确定对数据做\"保存\"操作? ", { JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("detail1", "HGCW008", "save", false, JSUtils.submitGrid("detail1", "HGCW008", "save", {isAlldata:true,onSuccessCallback:parent.windowNewCallback})
/*JSUtils.submitGridsData("detail1", "HGCW008", "save", false,
function (res) { function (res) {
parent.windowNewCallback(res); parent.windowNewCallback(res);
} }
); );*/
} }
}); });
} }
......
...@@ -23,6 +23,8 @@ $(function() { ...@@ -23,6 +23,8 @@ $(function() {
} else { } else {
return ""; return "";
} }
}else if(!isBlank(item.totalTaxPrice)){
return parseFloat(item.totalTaxPrice);
} else { } else {
return parseFloat(item.totalTaxPrice); return parseFloat(item.totalTaxPrice);
} }
...@@ -59,10 +61,14 @@ $(function() { ...@@ -59,10 +61,14 @@ $(function() {
item['settlementNumber'] = settlementNumber; item['settlementNumber'] = settlementNumber;
}); });
var contractType = $("#contractType").val(); var contractType = $("#contractType").val();
if (contractType == "1") { if (contractType == "1" || contractType == "5") {
$.each(e.items, function (index, item) { $.each(e.items, function (index, item) {
item['settlementBasis'] = "罚款"; item['settlementBasis'] = "罚款";
}); });
}else if (contractType == "6" || contractType == "7") {
$.each(e.items, function (index, item) {
item['settlementBasis'] = "合同内";
});
} }
}, },
onSave: function (e) { onSave: function (e) {
...@@ -225,8 +231,9 @@ function choiceCallbackFunc(result1, result2) { ...@@ -225,8 +231,9 @@ function choiceCallbackFunc(result1, result2) {
detail1Grid.setCellValue(0, "thisEngineeringQuantity", item.deviceNumber); detail1Grid.setCellValue(0, "thisEngineeringQuantity", item.deviceNumber);
detail1Grid.setCellValue(0, "taskName", item.deviceName); detail1Grid.setCellValue(0, "taskName", item.deviceName);
detail1Grid.setCellValue(0, "unit", item.unit); detail1Grid.setCellValue(0, "unit", item.unit);
detail1Grid.setCellValue(0, "unitPrice", item.unitPrice * item.dayNumber); detail1Grid.setCellValue(0, "unitPrice", item.totalPriceIncluding/ item.deviceNumber);
detail1Grid.setCellValue(0, "totalPrice", item.totalPrice.toFixed(2)); detail1Grid.setCellValue(0, "totalPrice", item.totalPrice.toFixed(2));
detail1Grid.setCellValue(0, "totalTaxPrice", item.totalPriceIncluding.toFixed(2));
detail1Grid.setCellValue(0, "inventoryId", item.id); detail1Grid.setCellValue(0, "inventoryId", item.id);
detail1Grid.refresh(); detail1Grid.refresh();
}) })
......
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