Commit 182273de by 13420

结算单,开票,采购bug调整

parent 83a72b01
......@@ -86,7 +86,7 @@ public class ServiceHGCW008 extends ServiceBase {
HGCW008.setCompanyCode(userVO.getUsercode());
HGCW008.setCompanyName(userVO.getUsername());
HGCW008.setSettlementNumber(settlementNumber);
HGCW008.setReviewStatus(0);
HGCW008.setReviewStatus(2);
HGCW008.setContractDate(DateUtils.formatShort(HGCW008.getContractDate()));
HGCW008.setRemainingAmount(HGCW008.getThisPriceTax());
this.add(HGCW008);
......@@ -139,6 +139,7 @@ public class ServiceHGCW008 extends ServiceBase {
*/
@OperationLogAnnotation(operModul = "租赁合同",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
......
......@@ -135,7 +135,7 @@
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.service.HGCW012">
resultClass="com.baosight.hggp.hg.cw.domain.HGCW012">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
......
......@@ -16,6 +16,7 @@ import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -402,9 +403,9 @@ public class HGCWTools {
String remainingAmount = row.get("thisAmount").toString();
BigDecimal taxPoints = new BigDecimal(row.get("taxPoints").toString()); // 假设这是以整数形式给出的税率,比如17表示17%
BigDecimal thisAmount = new BigDecimal(row.get("thisAmount").toString());
BigDecimal taxRateAsDecimal = taxPoints.divide(new BigDecimal("100")); // 将税率转换为小数形式
BigDecimal thisSettlementTax = thisAmount.multiply(taxRateAsDecimal); // 计算税额
BigDecimal thisSettlementAmount = thisAmount.subtract(thisSettlementTax);
BigDecimal taxRateAsDecimal = taxPoints.divide(new BigDecimal("100")).add(new BigDecimal("1")); // 将税率转换为小数形式
BigDecimal thisSettlementAmount = thisAmount.divide(taxRateAsDecimal, 2, RoundingMode.HALF_UP);
BigDecimal thisSettlementTax = thisAmount.subtract(thisSettlementAmount); // 计算税额
HGCW011.setTotalContractPriceIncluding(new BigDecimal(remainingAmount));
HGCW011.setSettlementNumber(settlementNumber);
HGCW011.setThisSettlementTax(thisSettlementTax.toString());
......
......@@ -19,7 +19,7 @@
<EF:EFInput cname="合同名称" ename="contractName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFDateSpan startCname="结算日期(从)" endCname="至" blockId="inqu_status"
startName="contractDateFrom" endName="contractDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
format="yyyyMMdd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="结算编号" ename="settlementNumber" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="结算类别" ename="inqu_status-0-settlementType" colWidth="3" filter="contains">
......@@ -28,7 +28,7 @@
</EF:EFSelect>
<EF:EFSelect cname="审批状态" ename="inqu_status-0-reviewStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus" condition = "ITEM_CODE IN ('2','3')"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
......@@ -49,6 +49,7 @@
</EF:EFComboColumn>
<EF:EFColumn ename="thisSettlementAmount" cname="本次结算金额" align="center" enable="false"/>
<EF:EFColumn ename="thisSettlementTax" cname="本次结算税金" align="center" enable="false"/>
<EF:EFColumn ename="thisPriceTax" cname="本次结算含税金额" align="center" enable="false"/>
<EF:EFColumn ename="contractDate" cname="结算日期" align="center" enable="false"/>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
......
......@@ -258,7 +258,18 @@ function cancelFunc() {
}
function btnSaveFunc() {
fieldValidation();
{
var projCode = $("#result-0-projCode").val();
if (isBlank(projCode)) {
message("请选择项目!")
}
var contractDate = $("#result-0-contractDate").val();
if (isBlank(contractDate)) {
message("请选择结算日期!")
return;
}
}
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail1", "HGCW008", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
......@@ -392,13 +403,7 @@ function calculateAmount2(taxPoints) {
$("#result-0-cumulativePriceTax").val(parseFloat(cumulativePriceTax).toFixed(3))
}
function fieldValidation() {
var projCode = $("#result-0-projCode").val();
if (isBlank(projCode)) {
message("请选择项目!");
return;
}
}
$(window).load(function () {
refreshRowNo();
});
......
......@@ -14,9 +14,9 @@
resultId="contract_combo_box"
save="false" popupType="ServiceGrid"
valueField="projCode" textField="projCode"
columnEnames="projCode,projName,contractNumber,contractName,totalContractPriceExcluding"
columnEnames="projCode,projName,contractNumber,contractName,totalContractPriceIncluding"
columnCnames="项目编码,项目名称,合同号,合同名称,合同总价"
backFillColumnIds="projCode,projName,contractNumber,contractName,totalContractPriceExcluding,contractType"
backFillColumnIds="projCode,projName,contractNumber,contractName,totalContractPriceIncluding,contractType"
backFillFieldIds="result-0-projCode,result-0-projName,result-0-contractNumber,result-0-contractName,result-0-totalContractPrice,contractType"
readonly="true" required="true"
resizable="true" popupTitle="项目信息" popupWidth="800">
......@@ -46,7 +46,8 @@
<EF:EFCodeOption codeName="hggp.cw.priceTaxSeparation"/>
</EF:EFSelect>
<EF:EFDatePicker cname="结算日期" ename="result-0-contractDate" colWidth="4"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"
enable="true" align="center" required="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-thisSettlementAmount" cname="本次结算金额(元)" colWidth="4" readonly="true"/>
......
......@@ -33,11 +33,11 @@ $(function() {
var item = e.items[0];
if(e.field == "taxPoints"){
if(item.taxPoints && item.totalContractPriceIncluding){
let thisSettlementTax = item.taxPoints*item.totalContractPriceIncluding/100;
let thisSettlementTax = item.totalContractPriceIncluding-item.thisSettlementAmount;
resultGrid.setCellValue(item,'thisSettlementTax',thisSettlementTax)
}
if(item.thisSettlementTax && item.totalContractPriceIncluding){
let thisSettlementAmount = item.totalContractPriceIncluding-item.thisSettlementTax;
let thisSettlementAmount = item.totalContractPriceIncluding/(item.taxPoints/100+1);
resultGrid.setCellValue(item,'thisSettlementAmount',thisSettlementAmount)
}
loadChange(grid,e,"price");
......
......@@ -27,7 +27,7 @@ $(function() {
$("#SELECT_BILL").on("click",addFunc);
$("#BTN_UPDATE").on("click",updateFunc);
$("#SUBMIT").on("click",submitFunc);
$("#B_SAVE").on("click",saveFunc);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
......@@ -71,6 +71,57 @@ function addFunc() {
callbackName: windowCallback
});
}
/**
* 保存
*/
function saveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let reviewStatus= item.get("reviewStatus");
if((reviewStatus === "1")){
message("数据已审核");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW012", "save", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
}
});
}
}
/**
* 修改
......
......@@ -34,8 +34,10 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true" >
<EF:EFCodeOption codeName="hggp.cw.billTybe"/>
</EF:EFComboColumn>
<EF:EFColumn ename="receiveDate" cname="收票日期" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="signingDate" cname="开票日期" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="receiveDate" cname="签订日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFColumn ename="signingDate" cname="签订日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" 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="thisSettlementAmount" cname="不含税金额" width="120" enable="false" readonly="true" align="center"/>
......
......@@ -147,6 +147,7 @@ $(function () {
field: "receiveDate",
title: "结算日期",
headerTemplate: "<span style='color: '>结算日期 </span>",
enable: false,
locked: true
},
{
......@@ -159,6 +160,7 @@ $(function () {
field: "amount",
title: "结算金额",
headerTemplate: "<span style='color: '>结算金额 </span>",
enable: false,
locked: false
},
{
......
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