Commit 453bb24e by liuyang

2024-07-09 采购开票修复发票号编辑和税点选择计算

parent eaa15396
......@@ -22,11 +22,28 @@ $(function() {
return template;
}
}],
loadComplete: function (e) {
loadComplete: function (grid) {
$("#SELECT_BILL").on("click",addFunc);
//$("#BTN_UPDATE").on("click",updateFunc);
$("#SUBMIT").on("click",submitFunc);
$("#B_SAVE").on("click",saveFunc);
grid.dataSource.bind("change",function(e){
var item = e.items[0];
if(e.field == "taxPoints"){
if(item.thisSettlementTax && item.totalContractPriceIncluding){
let thisSettlementAmount = item.totalContractPriceIncluding / (item.taxPoints / 100 + 1);
// 使用toFixed方法四舍五入到两位小数,并转换为数字
thisSettlementAmount = Number(thisSettlementAmount.toFixed(2));
resultGrid.setCellValue(item,'thisSettlementAmount',thisSettlementAmount)
}
if(item.taxPoints && item.totalContractPriceIncluding){
let thisSettlementTax = item.totalContractPriceIncluding-item.thisSettlementAmount;
// 使用toFixed方法四舍五入到两位小数,并转换为数字
thisSettlementTax = Number(thisSettlementTax.toFixed(2));
resultGrid.setCellValue(item,'thisSettlementTax',thisSettlementTax)
}
}
})
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
......
......@@ -42,8 +42,11 @@
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" />
<EF:EFColumn ename="signingDate" cname="开票日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" />
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="taxPoints" cname="税率" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="true" readonly="false" align="center"/>
<EF:EFComboColumn ename="taxPoints" cname="税率" width="120" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true" >
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFComboColumn>
<EF:EFColumn ename="thisSettlementAmount" cname="不含税金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementTax" cname="税额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="发票总额" width="120" enable="false" readonly="true" align="center"/>
......
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