Commit 084bd534 authored by 1650842865's avatar 1650842865

销售订单:退货退款和换货退回,改成联系人和联系电话;其他类型订单都是取跟单员的电话。工序报价增加价格单位,工序外协:多个项次相同的材料,计算单价按合并数量去计算单价

parent 861cef77
...@@ -27,9 +27,15 @@ ...@@ -27,9 +27,15 @@
<x:hidden name="merchandiser"/> <x:hidden name="merchandiser"/>
<div class="hg-form-cols"> <div class="hg-form-cols">
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="telPhoneLong" required="true" label="联系电话长号" labelCol="2" maxLength="64" fieldCol="2"/> <c:if test="${orderType=='ZRE1' || orderType=='ZHR'}">
<x:inputC name="telPhoneShort" required="false" label="联系电话短号" labelCol="2" fieldCol="2"/> <x:inputC name="contact" required="true" label="客户联系人" labelCol="1" maxLength="64" fieldCol="2"/>
<x:inputC name="kunnr" required="true" label="售达方" labelCol="2" fieldCol="2"/> <x:inputC name="telPhoneLong" required="true" label="客户联系电话" labelCol="1" maxLength="64" fieldCol="2"/>
</c:if>
<c:if test="${orderType!='ZRE1' && orderType!='ZHR'}">
<x:inputC name="telPhoneLong" required="false" label="联系电话长号" labelCol="1" maxLength="64" fieldCol="2"/>
</c:if>
<x:inputC name="telPhoneShort" required="false" label="联系电话短号" labelCol="1" fieldCol="2"/>
<x:inputC name="kunnr" required="true" label="售达方" labelCol="1" fieldCol="2"/>
</div> </div>
</div> </div>
<div class="blank_div clearfix"></div> <div class="blank_div clearfix"></div>
......
...@@ -11,6 +11,9 @@ function initUI() { ...@@ -11,6 +11,9 @@ function initUI() {
var defaultcols = [ var defaultcols = [
{display: "单据编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "left"}, {display: "单据编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "创建日期", name: "fillinDate", width: 120, minWidth: 60, type: "string", align: "left"}, {display: "创建日期", name: "fillinDate", width: 120, minWidth: 60, type: "string", align: "left"},
{
display: "订单类型", name: "orderTypeName", width: 200, minWidth: 60, type: "string", align: "left",
},
{ {
display: "订单原因(业务交易原因)", name: "augru", width: 200, minWidth: 60, type: "string", align: "left", display: "订单原因(业务交易原因)", name: "augru", width: 200, minWidth: 60, type: "string", align: "left",
}, },
......
...@@ -61,6 +61,10 @@ function initializate() { ...@@ -61,6 +61,10 @@ function initializate() {
Public.tip("客供料不维护仓库管理视图和财务核算视图"); Public.tip("客供料不维护仓库管理视图和财务核算视图");
$("#businessUsageS").prop("checked",false); $("#businessUsageS").prop("checked",false);
$("#businessUsageB").prop("checked",false); $("#businessUsageB").prop("checked",false);
//分类类型、分类名称
$("#klart").val("023");
$("#classify").val("Z_YCL");
} }
initKunnrName(data.value); initKunnrName(data.value);
//刀工模板具 //刀工模板具
......
...@@ -126,17 +126,32 @@ function loadOrderItemGrid() { ...@@ -126,17 +126,32 @@ function loadOrderItemGrid() {
Public.ajax(web_app.name + "/processQuotedPrice/findPriceByProductAndProcess.ajax?" + Public.ajax(web_app.name + "/processQuotedPrice/findPriceByProductAndProcess.ajax?" +
"productCode="+item.record.productCode+ "productCode="+item.record.productCode+
"&outProcess="+item.record.wempf+ "&outProcess="+item.record.wempf+
"&number="+item.record.menge+ "&number="+getMengs(item.record)+
"&lifnr="+item.record.lifnr, "&lifnr="+item.record.lifnr,
{ {
},function (data){ },function (data){
orderItemGridManager.updateRow(item.record,{ var _grid = UICtrl.getGridManager('#orderItemGrid');
kbetr:data.unitPrice, if (_grid != null ){
purchaseMwskzTextView:data.purchaseMwskzTextView, var datas = _grid.rows;
purchaseMwskz:data.purchaseMwskz, if (datas.length > 0 ){
amount: data.unitPrice * item.record.menge $.each(datas, function (i, row) {
}) //统计同产品,同工序的数量
amountChange(); if (row.productCode == item.record.productCode && row.wempf == item.record.wempf){
orderItemGridManager.updateRow(row,{
kbetr:data.unitPrice,
purchaseMwskzTextView:data.purchaseMwskzTextView,
purchaseMwskz:data.purchaseMwskz,
amount: MathUtil.mul(data.unitPrice , row.menge).div(data.kpein),
kpein: data.kpein,
lifnr:item.record.lifnr,
lifnrName:item.record.lifnrName
})
amountChange();
}
});
}
}
}) })
} }
if(item.column.name == "kbetr" || item.column.name == "menge"){ if(item.column.name == "kbetr" || item.column.name == "menge"){
...@@ -173,6 +188,25 @@ function amountChange(){ ...@@ -173,6 +188,25 @@ function amountChange(){
} }
} }
function getMengs(record){
var mengs = 0;//总数量
var _grid = UICtrl.getGridManager('#orderItemGrid');
if (_grid != null ){
var datas = _grid.rows;
if (datas.length > 0 ){
var mengs = 0;//总数量
$.each(datas, function (i, data) {
//统计同产品,同工序的数量
if (data.productCode == record.productCode && data.wempf == record.wempf){
mengs = MathUtil.add(mengs,data.menge);
}
});
}
}
return mengs;
}
function getOrderColumns(){ function getOrderColumns(){
var columns = []; var columns = [];
columns.push({display: "采购订单", name: "ebeln", width: 120, minWidth: 60, type: "string", align: "left"}); columns.push({display: "采购订单", name: "ebeln", width: 120, minWidth: 60, type: "string", align: "left"});
...@@ -312,7 +346,7 @@ function getOrderColumns(){ ...@@ -312,7 +346,7 @@ function getOrderColumns(){
columns.push({ columns.push({
display: "单价", name: "kbetr", width: 140, minWidth: 60, type: "string", align: "left", display: "单价", name: "kbetr", width: 140, minWidth: 60, type: "string", align: "left",
editor: { editor: {
type: "text", mask: '9999999.999', required: true type: "text", mask: '9999999.9999', required: true
} }
},); },);
columns.push({ columns.push({
......
...@@ -331,6 +331,7 @@ function loadClickItemGrid() { ...@@ -331,6 +331,7 @@ function loadClickItemGrid() {
{display: "数量止", name: "numberTo", width: 100, minWidth: 60, type: "String", align: "left"}, {display: "数量止", name: "numberTo", width: 100, minWidth: 60, type: "String", align: "left"},
{display: "数量区间", name: "numberSection", width: 200, minWidth: 60, type: "String", align: "left"}, {display: "数量区间", name: "numberSection", width: 200, minWidth: 60, type: "String", align: "left"},
{display: "备注", name: "remark", width: 200, minWidth: 60, type: "String", align: "left"}, {display: "备注", name: "remark", width: 200, minWidth: 60, type: "String", align: "left"},
{display: "价格单位", name: "priceUnit", width: 100, minWidth: 60, type: "String", align: "left"},
{display: "含税单价", name: "unitPrice", width: 100, minWidth: 60, type: "String", align: "left"}, {display: "含税单价", name: "unitPrice", width: 100, minWidth: 60, type: "String", align: "left"},
{display: "税码", name: "purchaseMwskzTextView", width: 140, minWidth: 60, type: "string", align: "left"}, {display: "税码", name: "purchaseMwskzTextView", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "不含税单价", name: "excludeTaxPrice", width: 100, minWidth: 60, type: "String", align: "left"}, {display: "不含税单价", name: "excludeTaxPrice", width: 100, minWidth: 60, type: "String", align: "left"},
......
...@@ -206,6 +206,7 @@ function showItemNumber(row,panel){ ...@@ -206,6 +206,7 @@ function showItemNumber(row,panel){
{display: "数量止", name: "numberTo", width: 100, minWidth: 60, type: "String", align: "left"}, {display: "数量止", name: "numberTo", width: 100, minWidth: 60, type: "String", align: "left"},
{display: "数量区间", name: "numberSection", width: 200, minWidth: 60, type: "String", align: "left"}, {display: "数量区间", name: "numberSection", width: 200, minWidth: 60, type: "String", align: "left"},
{display: "备注", name: "remark", width: 200, minWidth: 60, type: "String", align: "left"}, {display: "备注", name: "remark", width: 200, minWidth: 60, type: "String", align: "left"},
{display: "价格单位", name: "priceUnit", width: 100, minWidth: 60, type: "String", align: "left"},
{display: "含税单价", name: "unitPrice", width: 100, minWidth: 60, type: "String", align: "left"}, {display: "含税单价", name: "unitPrice", width: 100, minWidth: 60, type: "String", align: "left"},
{display: " 不含税单价", name: "excludeTaxPrice", width: 100, minWidth: 60, type: "String", align: "left"}, {display: " 不含税单价", name: "excludeTaxPrice", width: 100, minWidth: 60, type: "String", align: "left"},
{display: "运输费", name: "freight", width: 100, minWidth: 60, type: "String", align: "left",}, {display: "运输费", name: "freight", width: 100, minWidth: 60, type: "String", align: "left",},
......
...@@ -54,6 +54,12 @@ function loadItemNumberGrid() { ...@@ -54,6 +54,12 @@ function loadItemNumberGrid() {
required: false, type: "text" required: false, type: "text"
} }
}, },
{
display: "价格单位", name: "priceUnit", width: 100, minWidth: 60, type: "String", align: "left",
editor: {
required: true, type: "text",mask: '9999999'
}
},
{ {
display: "含税单价", name: "unitPrice", width: 100, minWidth: 60, type: "String", align: "left", display: "含税单价", name: "unitPrice", width: 100, minWidth: 60, type: "String", align: "left",
editor: { editor: {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</style> </style>
</head> </head>
<body> <body>
<div class="billTitle">物品领料单</div> <div class="billTitle">放行条</div>
<span class="fs" style="font-family:SimSun;position: absolute;right: 60px;top: 1px"> <span class="fs" style="font-family:SimSun;position: absolute;right: 60px;top: 1px">
<img class="barcode" src="${barCode}"></img> <img class="barcode" src="${barCode}"></img>
</span> </span>
......
...@@ -234,18 +234,28 @@ public class EpSaleOrderApplicationImpl extends FlowBroker implements EpSaleOrde ...@@ -234,18 +234,28 @@ public class EpSaleOrderApplicationImpl extends FlowBroker implements EpSaleOrde
//初始化用户信息 //初始化用户信息
String personCode = epSaleOrderVos.get(0).getPersonCode(); String personCode = epSaleOrderVos.get(0).getPersonCode();
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "loadPersonMemberId"); Org createorg = orgApplication.loadMainOrgByLoginName(personCode);
String personMemberId = this.sqlExecutorDao.queryToString(queryDescriptor.getSql(), personCode); if (createorg == null){
if (StringUtil.isBlank(personMemberId)){
throw new RuntimeException("未找到编码为:" + personCode + " 的人员"); throw new RuntimeException("未找到编码为:" + personCode + " 的人员");
} }
// QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "loadPersonMemberId");
// String personMemberId = this.sqlExecutorDao.queryToString(queryDescriptor.getSql(), personCode);
// if (StringUtil.isBlank(personMemberId)){
// throw new RuntimeException("未找到编码为:" + personCode + " 的人员");
// }
//String createdById = SystemCache.getParameter("adminPersonId", String.class); //String createdById = SystemCache.getParameter("adminPersonId", String.class);
Operator operator = operatorApplication.createOperatorByPersonMemberId(personMemberId); Operator operator = operatorApplication.createOperatorByPersonMemberId(createorg.getId());
SDO sdo = new SDO(); //SDO sdo = new SDO();
//localSdo.setOperator(operator); //localSdo.setOperator(operator);
ThreadLocalUtil.putOperator(operator); ThreadLocalUtil.putOperator(operator);
epSaleOrder.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName())); epSaleOrder.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
//退货退款和换货退回的才这样改:两个电话改成联系人和联系电话,不用加字段
//其他类型订单都是取跟单员的电话,没有带出来就是空的,可以继续审批。
if (!"ZRE1".equals(epSaleOrderVo.getOrderType()) && !"ZHR".equals(epSaleOrderVo.getOrderType())){
epSaleOrder.setTelPhoneLong(createorg.getPerson().getMobilePhone());//长号取移动电话
epSaleOrder.setTelPhoneShort(createorg.getPerson().getOfficePhone());//短号取办公电话
}
Map<String, Object> formData = BeanUtil.beanToMap(epSaleOrder); Map<String, Object> formData = BeanUtil.beanToMap(epSaleOrder);
List<EpSaleOrderItemVo> epSaleOrderItemVos = epSaleOrderVo.getEpSaleOrderItemVos(); List<EpSaleOrderItemVo> epSaleOrderItemVos = epSaleOrderVo.getEpSaleOrderItemVos();
Set<String> vbelns = epSaleOrderItemVos.stream().map(EpSaleOrderItemVo::getVbeln).collect(Collectors.toSet()); Set<String> vbelns = epSaleOrderItemVos.stream().map(EpSaleOrderItemVo::getVbeln).collect(Collectors.toSet());
......
...@@ -40,6 +40,12 @@ public class EpSaleOrder extends FlowBillAbstractEntity { ...@@ -40,6 +40,12 @@ public class EpSaleOrder extends FlowBillAbstractEntity {
@Column(name = "tel_phone_short") @Column(name = "tel_phone_short")
private String telPhoneShort; private String telPhoneShort;
/**
* 联系人
*/
@Column(name = "contact")
private String contact;
/** /**
* 售达方 * 售达方
*/ */
......
...@@ -42,11 +42,17 @@ public class EpSaleOrderVo implements Serializable { ...@@ -42,11 +42,17 @@ public class EpSaleOrderVo implements Serializable {
@JsonProperty("telPhoneShort") @JsonProperty("telPhoneShort")
private String telPhoneShort; private String telPhoneShort;
/**
* 联系人
*/
@JsonProperty("contact")
private String contact;
/** /**
* 售达方 * 售达方
*/ */
@JsonProperty("kunnr") @JsonProperty("kunnr")
private String kunnr; private String kunnr;
@JsonProperty("epSaleOrderItemVos") @JsonProperty("epSaleOrderItemVos")
private List<EpSaleOrderItemVo> epSaleOrderItemVos; private List<EpSaleOrderItemVo> epSaleOrderItemVos;
......
...@@ -156,15 +156,16 @@ public class ClientMaterialsApplicationImpl extends BaseApplication implements C ...@@ -156,15 +156,16 @@ public class ClientMaterialsApplicationImpl extends BaseApplication implements C
//推送待办任务 //推送待办任务
this.pushTask(clientMaterialsDb,personMaps); this.pushTask(clientMaterialsDb,personMaps);
}else { }else {
ClientMaterials clientMaterialsDb = clientMaterialsDbs.get(0); for (ClientMaterials clientMaterialsDb : clientMaterialsDbs) {
//不为空,更新数据 //不为空,更新数据
BeanUtil.copyProperties(clientMaterialsVo,clientMaterialsDb); BeanUtil.copyProperties(clientMaterialsVo,clientMaterialsDb);
//根据物料编码查询客户名称 //根据物料编码查询客户名称
if (StringUtils.isNotBlank(clientMaterialsVo.getMatnr()) && StringUtil.isBlank(clientMaterialsDb.getKunnrName())){ if (StringUtils.isNotBlank(clientMaterialsVo.getMatnr()) && StringUtil.isBlank(clientMaterialsDb.getKunnrName())){
String kunnrName = nonProdApplyDeptApplication.queryKunnrNameByMatnr(clientMaterialsVo.getMatnr()); String kunnrName = nonProdApplyDeptApplication.queryKunnrNameByMatnr(clientMaterialsVo.getMatnr());
clientMaterialsDb.setKunnrName(kunnrName); clientMaterialsDb.setKunnrName(kunnrName);
}
clientMaterialsRepository.save(clientMaterialsDb);
} }
clientMaterialsRepository.save(clientMaterialsDb);
} }
} }
......
...@@ -159,6 +159,13 @@ public class ProcessQuotedPriceItemApplicationImpl extends BaseApplication imple ...@@ -159,6 +159,13 @@ public class ProcessQuotedPriceItemApplicationImpl extends BaseApplication imple
if (packMoney != null){ if (packMoney != null){
unitPrice = unitPrice.add(packMoney); unitPrice = unitPrice.add(packMoney);
} }
//如果维护了价格单位
if (processQuotedPriceItemNumber.getPriceUnit() != null
&& processQuotedPriceItemNumber.getPriceUnit().compareTo(BigDecimal.ZERO) > 0){
processQuotedPriceAndMwskzVo.setKpein(processQuotedPriceItemNumber.getPriceUnit());
}else {
processQuotedPriceAndMwskzVo.setKpein(BigDecimal.ONE);
}
processQuotedPriceAndMwskzVo.setUnitPrice(unitPrice); processQuotedPriceAndMwskzVo.setUnitPrice(unitPrice);
processQuotedPriceAndMwskzVo.setPurchaseMwskz(processQuotedPriceItemNumber.getPurchaseMwskz()); processQuotedPriceAndMwskzVo.setPurchaseMwskz(processQuotedPriceItemNumber.getPurchaseMwskz());
String detailText = DictUtil.getDictionaryDetailText("purchaseMwskz", processQuotedPriceAndMwskzVo.getPurchaseMwskz()); String detailText = DictUtil.getDictionaryDetailText("purchaseMwskz", processQuotedPriceAndMwskzVo.getPurchaseMwskz());
......
...@@ -53,6 +53,12 @@ public class ProcessQuotedPriceItemNumber extends AbstractEntity { ...@@ -53,6 +53,12 @@ public class ProcessQuotedPriceItemNumber extends AbstractEntity {
@Column(name = "unit_price") @Column(name = "unit_price")
private BigDecimal unitPrice; private BigDecimal unitPrice;
/**
* 价格单位
*/
@Column(name = "price_unit")
private BigDecimal priceUnit;
/** /**
* 不含税单价 * 不含税单价
*/ */
......
...@@ -23,4 +23,9 @@ public class ProcessQuotedPriceAndMwskzVo implements Serializable { ...@@ -23,4 +23,9 @@ public class ProcessQuotedPriceAndMwskzVo implements Serializable {
private String purchaseMwskz; private String purchaseMwskz;
private String purchaseMwskzTextView; private String purchaseMwskzTextView;
/**
* 定价基数(价格单位)
*/
private BigDecimal kpein;
} }
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