Commit 084bd534 authored by 1650842865's avatar 1650842865

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

parent 861cef77
......@@ -27,9 +27,15 @@
<x:hidden name="merchandiser"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="telPhoneLong" required="true" label="联系电话长号" labelCol="2" maxLength="64" fieldCol="2"/>
<x:inputC name="telPhoneShort" required="false" label="联系电话短号" labelCol="2" fieldCol="2"/>
<x:inputC name="kunnr" required="true" label="售达方" labelCol="2" fieldCol="2"/>
<c:if test="${orderType=='ZRE1' || orderType=='ZHR'}">
<x:inputC name="contact" required="true" label="客户联系人" labelCol="1" maxLength="64" 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 class="blank_div clearfix"></div>
......
......@@ -11,6 +11,9 @@ function initUI() {
var defaultcols = [
{display: "单据编号", name: "billCode", width: 150, 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",
},
......
......@@ -61,6 +61,10 @@ function initializate() {
Public.tip("客供料不维护仓库管理视图和财务核算视图");
$("#businessUsageS").prop("checked",false);
$("#businessUsageB").prop("checked",false);
//分类类型、分类名称
$("#klart").val("023");
$("#classify").val("Z_YCL");
}
initKunnrName(data.value);
//刀工模板具
......
......@@ -126,17 +126,32 @@ function loadOrderItemGrid() {
Public.ajax(web_app.name + "/processQuotedPrice/findPriceByProductAndProcess.ajax?" +
"productCode="+item.record.productCode+
"&outProcess="+item.record.wempf+
"&number="+item.record.menge+
"&number="+getMengs(item.record)+
"&lifnr="+item.record.lifnr,
{
},function (data){
orderItemGridManager.updateRow(item.record,{
var _grid = UICtrl.getGridManager('#orderItemGrid');
if (_grid != null ){
var datas = _grid.rows;
if (datas.length > 0 ){
$.each(datas, function (i, row) {
//统计同产品,同工序的数量
if (row.productCode == item.record.productCode && row.wempf == item.record.wempf){
orderItemGridManager.updateRow(row,{
kbetr:data.unitPrice,
purchaseMwskzTextView:data.purchaseMwskzTextView,
purchaseMwskz:data.purchaseMwskz,
amount: data.unitPrice * item.record.menge
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"){
......@@ -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(){
var columns = [];
columns.push({display: "采购订单", name: "ebeln", width: 120, minWidth: 60, type: "string", align: "left"});
......@@ -312,7 +346,7 @@ function getOrderColumns(){
columns.push({
display: "单价", name: "kbetr", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
type: "text", mask: '9999999.999', required: true
type: "text", mask: '9999999.9999', required: true
}
},);
columns.push({
......
......@@ -331,6 +331,7 @@ function loadClickItemGrid() {
{display: "数量止", name: "numberTo", width: 100, 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: "priceUnit", 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: "excludeTaxPrice", width: 100, minWidth: 60, type: "String", align: "left"},
......
......@@ -206,6 +206,7 @@ function showItemNumber(row,panel){
{display: "数量止", name: "numberTo", width: 100, 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: "priceUnit", 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: "freight", width: 100, minWidth: 60, type: "String", align: "left",},
......
......@@ -54,6 +54,12 @@ function loadItemNumberGrid() {
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",
editor: {
......
......@@ -13,7 +13,7 @@
</style>
</head>
<body>
<div class="billTitle">物品领料单</div>
<div class="billTitle">放行条</div>
<span class="fs" style="font-family:SimSun;position: absolute;right: 60px;top: 1px">
<img class="barcode" src="${barCode}"></img>
</span>
......
......@@ -234,18 +234,28 @@ public class EpSaleOrderApplicationImpl extends FlowBroker implements EpSaleOrde
//初始化用户信息
String personCode = epSaleOrderVos.get(0).getPersonCode();
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "loadPersonMemberId");
String personMemberId = this.sqlExecutorDao.queryToString(queryDescriptor.getSql(), personCode);
if (StringUtil.isBlank(personMemberId)){
Org createorg = orgApplication.loadMainOrgByLoginName(personCode);
if (createorg == null){
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);
Operator operator = operatorApplication.createOperatorByPersonMemberId(personMemberId);
SDO sdo = new SDO();
Operator operator = operatorApplication.createOperatorByPersonMemberId(createorg.getId());
//SDO sdo = new SDO();
//localSdo.setOperator(operator);
ThreadLocalUtil.putOperator(operator);
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);
List<EpSaleOrderItemVo> epSaleOrderItemVos = epSaleOrderVo.getEpSaleOrderItemVos();
Set<String> vbelns = epSaleOrderItemVos.stream().map(EpSaleOrderItemVo::getVbeln).collect(Collectors.toSet());
......
......@@ -40,6 +40,12 @@ public class EpSaleOrder extends FlowBillAbstractEntity {
@Column(name = "tel_phone_short")
private String telPhoneShort;
/**
* 联系人
*/
@Column(name = "contact")
private String contact;
/**
* 售达方
*/
......
......@@ -42,6 +42,12 @@ public class EpSaleOrderVo implements Serializable {
@JsonProperty("telPhoneShort")
private String telPhoneShort;
/**
* 联系人
*/
@JsonProperty("contact")
private String contact;
/**
* 售达方
*/
......
......@@ -156,7 +156,7 @@ public class ClientMaterialsApplicationImpl extends BaseApplication implements C
//推送待办任务
this.pushTask(clientMaterialsDb,personMaps);
}else {
ClientMaterials clientMaterialsDb = clientMaterialsDbs.get(0);
for (ClientMaterials clientMaterialsDb : clientMaterialsDbs) {
//不为空,更新数据
BeanUtil.copyProperties(clientMaterialsVo,clientMaterialsDb);
//根据物料编码查询客户名称
......@@ -167,6 +167,7 @@ public class ClientMaterialsApplicationImpl extends BaseApplication implements C
clientMaterialsRepository.save(clientMaterialsDb);
}
}
}
//删除已关单的数据
List<ClientMaterials> clientMaterialsList = clientMaterialsRepository.findAll();
......
......@@ -159,6 +159,13 @@ public class ProcessQuotedPriceItemApplicationImpl extends BaseApplication imple
if (packMoney != null){
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.setPurchaseMwskz(processQuotedPriceItemNumber.getPurchaseMwskz());
String detailText = DictUtil.getDictionaryDetailText("purchaseMwskz", processQuotedPriceAndMwskzVo.getPurchaseMwskz());
......
......@@ -53,6 +53,12 @@ public class ProcessQuotedPriceItemNumber extends AbstractEntity {
@Column(name = "unit_price")
private BigDecimal unitPrice;
/**
* 价格单位
*/
@Column(name = "price_unit")
private BigDecimal priceUnit;
/**
* 不含税单价
*/
......
......@@ -23,4 +23,9 @@ public class ProcessQuotedPriceAndMwskzVo implements Serializable {
private String purchaseMwskz;
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