Commit b1ad5e50 authored by 1650842865's avatar 1650842865

采购订单明细增加包装费;工序外协打印增加包装费;采购信息记录中价格单位只能大于等于1

parent 2d7def0d
...@@ -19,7 +19,6 @@ function loadProcessOutsourceOrderListGrid() { ...@@ -19,7 +19,6 @@ function loadProcessOutsourceOrderListGrid() {
columns: [ columns: [
{display: "申请单编号", name: "billCode", width: 120, minWidth: 60, type: "string", align: "left"}, {display: "申请单编号", name: "billCode", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请状态", name: "statusTextView", width: 60, minWidth: 60, type: "string", align: "left"}, {display: "申请状态", name: "statusTextView", width: 60, minWidth: 60, type: "string", align: "left"},
{display: "外发状态", name: "sendOut", width: 60, minWidth: 60, type: "string", align: "left"},
{display: "申请日期", name: "fillinDate", width: 120, minWidth: 60, type: "datetime", align: "left"}, {display: "申请日期", name: "fillinDate", width: 120, minWidth: 60, type: "datetime", align: "left"},
{display: "工厂", name: "werksName", width: 200, minWidth: 60, type: "string", align: "left"}, {display: "工厂", name: "werksName", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "采购订单", name: "ebeln", width: 120, minWidth: 60, type: "string", align: "left"}, {display: "采购订单", name: "ebeln", width: 120, minWidth: 60, type: "string", align: "left"},
......
...@@ -185,8 +185,8 @@ function getOrderColumns(){ ...@@ -185,8 +185,8 @@ function getOrderColumns(){
columns.push({ columns.push({
display: "单位", name: "unitName", width: 60, minWidth: 60, type: "string", align: "left", display: "单位", name: "unitName", width: 60, minWidth: 60, type: "string", align: "left",
},); },);
columns.push({display: "外发工序编号",width: 30, name: "outProcess", hide: true},); columns.push({display: "外发工序编号",width: 100, name: "outProcess"},);
columns.push({display: "外发工序", name: "outProcessName", width: 100, minWidth: 60, type: "string", align: "left", columns.push({display: "外发工序", name: "outProcessName", width: 150, minWidth: 60, type: "string", align: "left",
editor: { editor: {
required: true, type: "select", required: true, type: "select",
data: { data: {
......
...@@ -162,7 +162,9 @@ function getItemColumns(){ ...@@ -162,7 +162,9 @@ function getItemColumns(){
columns.push({ columns.push({
display: "产品名称", name: "productName", width: 300, minWidth: 60, type: "string", align: "left", display: "产品名称", name: "productName", width: 300, minWidth: 60, type: "string", align: "left",
},); },);
columns.push({display: "外发工序", name: "outProcessName", width: 100, minWidth: 60, type: "string", align: "left", columns.push({display: "外发工序编码", name: "outProcess", width: 100, minWidth: 60, type: "string", align: "left",
},);
columns.push({display: "外发工序名称", name: "outProcessName", width: 150, minWidth: 60, type: "string", align: "left",
},); },);
columns.push({ columns.push({
display: "机台", name: "machineTool", width: 100, minWidth: 60, type: "string", align: "left", display: "机台", name: "machineTool", width: 100, minWidth: 60, type: "string", align: "left",
......
...@@ -557,6 +557,10 @@ function doSaveDefine() { ...@@ -557,6 +557,10 @@ function doSaveDefine() {
Public.tip("标准采购订单数量必须大于最小采购订单量!"); Public.tip("标准采购订单数量必须大于最小采购订单量!");
return false; return false;
} }
if (MathUtil.compare($("#peinh").val(),1) < 0){
Public.tip("价格单位必须大于等于 1");
return false;
}
if (returnResult) { if (returnResult) {
if (row.length > 0) { if (row.length > 0) {
for (var u = 0; u < row.length; u++) { for (var u = 0; u < row.length; u++) {
......
...@@ -52,6 +52,7 @@ function getGridColumns() { ...@@ -52,6 +52,7 @@ function getGridColumns() {
{display: "库存地点的描述", name: "lgobe", width: "200", align: "left", type: "string"}, {display: "库存地点的描述", name: "lgobe", width: "200", align: "left", type: "string"},
{display: "含税单价", name: "netpr", width: "100", align: "left", type: "string"}, {display: "含税单价", name: "netpr", width: "100", align: "left", type: "string"},
{display: "运输费", name: "kbetr2", width: "100", align: "left", type: "string"}, {display: "运输费", name: "kbetr2", width: "100", align: "left", type: "string"},
{display: "包装费", name: "kbetr3", width: "100", align: "left", type: "string"},
{display: "价格基数", name: "peinh", width: "100", align: "left", type: "string"}, {display: "价格基数", name: "peinh", width: "100", align: "left", type: "string"},
//{display: "税码", name: "mwskz", width: "100", align: "left", type: "string"}, //{display: "税码", name: "mwskz", width: "100", align: "left", type: "string"},
{display: "进项税率(%)", name: "kbetr", width: "100", align: "left", type: "string"}, {display: "进项税率(%)", name: "kbetr", width: "100", align: "left", type: "string"},
......
...@@ -140,9 +140,19 @@ function sendOutHandler(){ ...@@ -140,9 +140,19 @@ function sendOutHandler(){
for (var i = 0; i < rows.length; i++){ for (var i = 0; i < rows.length; i++){
var row=rows[i]; var row=rows[i];
if (row.status != "3"){ if (row.status != "3"){
Public.tip("请审批完成并发送订单给供应商后再标记已外发"); Public.tip("请审批完成并发送订单给供应商后才能标记外发状态");
return false; return false;
} }
//工序外协ZNB3
//成品外购的类型是ZNB1+knttp包含‘M’
if ((row.bsart == "ZNB1" && row.knttp.indexOf("M") !== -1) || row.bsart == "ZNB3"){
}else {
Public.tip("采购订单类型是生产性物品采购申请并且项目类别描述是M,或者工序外协采购订单才能标记外发状态");
return false;
}
ids.push(row.id) ids.push(row.id)
} }
Public.ajax(web_app.name + "/sapPurchaseOrder/sendOutProcess.ajax",{ids:$.toJSON(ids)},function () { Public.ajax(web_app.name + "/sapPurchaseOrder/sendOutProcess.ajax",{ids:$.toJSON(ids)},function () {
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</div> </div>
<x:searchButtons/> <x:searchButtons/>
</form> </form>
<x:title title="" hideTable="#purchaseOrderGrid" name="list"/> <%--<x:title title="" hideTable="#purchaseOrderGrid" name="list"/>--%>
<div id="purchaseOrderGrid" style="margin:2px;"></div> <div id="purchaseOrderGrid" style="margin:2px;"></div>
</div> </div>
</div> </div>
......
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tr> </tr>
</table> </table>
<table> <table>
<tr> <tr style="height: 60pt">
<td class="td1"> <td class="td1">
<p class="p1"><span style="font-weight:bolder ">备注</span></p> <p class="p1"><span style="font-weight:bolder ">备注</span></p>
</td> </td>
......
...@@ -236,20 +236,24 @@ ...@@ -236,20 +236,24 @@
<#--</table>--> <#--</table>-->
<table cellspacing="0px" cellpadding="0px" class="tableBorder"> <table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup> <colgroup>
<col width='12%'/> <col width='10%'/>
<col width='12%'/> <col width='10%'/>
<col width='12%'/> <col width='10%'/>
<col width='12%'/> <col width='10%'/>
<col width='12%'/> <col width='10%'/>
<col width='12%'/> <col width='10%'/>
<col width='12%'/> <col width='10%'/>
<col width='12%'/> <col width='10%'/>
<col width='10%'/>
<col width='10%'/>
</colgroup> </colgroup>
<tr> <tr>
<td class="center">单价</td> <td class="center">单价</td>
<td class="center">${netpr?default("")?html}</td> <td class="center">${netpr?default("")?html}</td>
<td class="center">运输费用</td> <td class="center">运输费用</td>
<td class="center">${kbetr2?default("")?html}</td> <td class="center">${kbetr2?default("")?html}</td>
<td class="center">包装费用</td>
<td class="center">${kbetr3?default("")?html}</td>
<td class="center">合计单价</td> <td class="center">合计单价</td>
<td class="center">${priceAmount?default("")?html}</td> <td class="center">${priceAmount?default("")?html}</td>
<td class="center">总额</td> <td class="center">总额</td>
......
...@@ -477,8 +477,9 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except ...@@ -477,8 +477,9 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except
resultMap.put("TYPE", sapResult.getTYPE()); resultMap.put("TYPE", sapResult.getTYPE());
resultMap.put("MESSAGE", sapResult.getMESSAGE()); resultMap.put("MESSAGE", sapResult.getMESSAGE());
} }
//SAP单据编号
exceptionReport.setDealResult(sapResult.getMESSAGE_V1()); exceptionReport.setSapBillNo(sapResult.getMESSAGE_V1());
//exceptionReport.setDealResult(sapResult.getMESSAGE_V1());
} catch (IOException e) { } catch (IOException e) {
resultMap.put("TYPE", "E"); resultMap.put("TYPE", "E");
...@@ -722,6 +723,12 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except ...@@ -722,6 +723,12 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except
ExceptionReport exceptionReport=this.exceptionReportRepository.findOne(id); ExceptionReport exceptionReport=this.exceptionReportRepository.findOne(id);
List<ExceptionReportItem> itemList=exceptionReportItemApplication.findByExceptionReportId(id); List<ExceptionReportItem> itemList=exceptionReportItemApplication.findByExceptionReportId(id);
//去掉前导零
for (ExceptionReportItem exceptionReportItem : itemList) {
String productCode = exceptionReportItem.getProductCode();
String replaced = productCode.replaceFirst("^0*", "");
exceptionReportItem.setProductCode(replaced);
}
List<ExceptionReportDutyPerson> dutyList=exceptionReportDutyPersonApplication.findByExceptionReportId(id); List<ExceptionReportDutyPerson> dutyList=exceptionReportDutyPersonApplication.findByExceptionReportId(id);
if ("in".equals(exceptionReport.getExceptionType())){ if ("in".equals(exceptionReport.getExceptionType())){
exceptionReport.setExceptionType("内部"); exceptionReport.setExceptionType("内部");
......
...@@ -605,7 +605,7 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA ...@@ -605,7 +605,7 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
nonProdApplyBaseInfo.setApprover(operator.getPersonMemberName()); nonProdApplyBaseInfo.setApprover(operator.getPersonMemberName());
nonProdApplyBaseInfo.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName())); nonProdApplyBaseInfo.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
nonProdApplyBaseInfo.setMaintenanceType("extend"); nonProdApplyBaseInfo.setMaintenanceType("new");
nonProdApplyBaseInfo.setApprovalDate(new Date()); nonProdApplyBaseInfo.setApprovalDate(new Date());
nonProdApplyBaseInfo.setKind("product"); nonProdApplyBaseInfo.setKind("product");
......
...@@ -470,8 +470,11 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu ...@@ -470,8 +470,11 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
} }
public Map<String, Object> getSupplierInfo(Map<String, Object> map, String lifnr){ public Map<String, Object> getSupplierInfo(Map<String, Object> map, String lifnr){
List<SuppliersInfo> suppliersInfoList = new ArrayList<>();
suppliersInfoList = suppliersInfoRepository.findByPartner(lifnr);
lifnr = lifnr.replaceFirst("^0*", ""); lifnr = lifnr.replaceFirst("^0*", "");
List<SuppliersInfo> suppliersInfoList = suppliersInfoRepository.findByPartner(lifnr); List<SuppliersInfo> suppliersInfoList2 = suppliersInfoRepository.findByPartner(lifnr);
suppliersInfoList.addAll(suppliersInfoList2);
if (CollectionUtils.isEmpty(suppliersInfoList)){ if (CollectionUtils.isEmpty(suppliersInfoList)){
throw new RuntimeException("根据编码:" + lifnr + "未找到供应商信息"); throw new RuntimeException("根据编码:" + lifnr + "未找到供应商信息");
} }
...@@ -526,11 +529,13 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu ...@@ -526,11 +529,13 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
map.put("saleOrderVos",saleOrderVos); map.put("saleOrderVos",saleOrderVos);
//计算总额 = (含税单价+运输费)* 成品数量 //计算总额 = (含税单价+运输费)* 成品数量
BigDecimal netpr = purchaseOrderItem.getNetpr();//含税单价 BigDecimal netpr = purchaseOrderItem.getNetpr();//含税单价
BigDecimal kbetr2 = purchaseOrderItem.getKbetr2();//运输费 BigDecimal kbetr2 = purchaseOrderItem.getKbetr2() == null ? BigDecimal.ZERO:purchaseOrderItem.getKbetr2();//运输费
BigDecimal kbetr3 = purchaseOrderItem.getKbetr3() == null ? BigDecimal.ZERO:purchaseOrderItem.getKbetr3();//包装费
BigDecimal amount = netpr.add(kbetr2).multiply(zero); BigDecimal amount = netpr.add(kbetr2).multiply(zero);
map.put("netpr",netpr); map.put("netpr",netpr);
map.put("kbetr2",kbetr2); map.put("kbetr2",kbetr2);
map.put("priceAmount",netpr.add(kbetr2));//合计单价 map.put("kbetr3",kbetr3);
map.put("priceAmount",netpr.add(kbetr2).add(kbetr3));//合计单价
map.put("amount",amount); map.put("amount",amount);
map.put("loss","1%");//LOSS数,默认1% map.put("loss","1%");//LOSS数,默认1%
......
...@@ -250,4 +250,10 @@ public class SapPurchaseOrderItem extends AbstractEntity { ...@@ -250,4 +250,10 @@ public class SapPurchaseOrderItem extends AbstractEntity {
@Column(name = "KBETR2") @Column(name = "KBETR2")
private BigDecimal kbetr2; private BigDecimal kbetr2;
/**
* 包装费用
*/
@Column(name = "kbetr3")
private BigDecimal kbetr3;
} }
\ No newline at end of file
...@@ -151,4 +151,10 @@ public class SapPurchaseOrderItemVo { ...@@ -151,4 +151,10 @@ public class SapPurchaseOrderItemVo {
@JsonProperty("KBETR2") @JsonProperty("KBETR2")
private BigDecimal kbetr2; private BigDecimal kbetr2;
/**
* 包装费用
*/
@JsonProperty("KBETR3")
private BigDecimal kbetr3;
} }
\ No newline at end of file
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<query-mappings> <query-mappings>
<query name="sapPurchaseOrderList" label="SAP采购审批" table="sap_purchase_order"> <query name="sapPurchaseOrderList" label="SAP采购审批" table="sap_purchase_order">
<sql-query> <sql-query>
select t.* from sap_purchase_order t SELECT t.*, oi.KNTTP FROM sap_purchase_order t
LEFT JOIN ( SELECT oi.purchase_order_id, group_concat( oi.KNTTP SEPARATOR ',' ) AS KNTTP FROM sap_purchase_order_item oi GROUP BY oi.purchase_order_id ) oi ON t.id = oi.purchase_order_id
where 1=1
</sql-query> </sql-query>
<condition column="bill_code" name="billCode" type="java.lang.String" symbol="like" alias="t"/> <condition column="bill_code" name="billCode" type="java.lang.String" symbol="like" alias="t"/>
<condition column="ebeln" name="ebeln" type="java.lang.String" symbol="like" alias="t"/> <condition column="ebeln" name="ebeln" type="java.lang.String" symbol="like" alias="t"/>
......
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