From 11184c41e6577be5e1ec5a91947fdd9ab1248b7e Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sun, 13 Oct 2019 22:33:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=96=B0=E5=A2=9E=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E5=AD=98=E9=87=8F=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/dbmapper/erp/MaterialMapper.xml | 6 +++++- .../resources/template/tpl/material/materialdetails.html | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/erp-modular/src/main/resources/dbmapper/erp/MaterialMapper.xml b/erp-modular/src/main/resources/dbmapper/erp/MaterialMapper.xml index b2c0aa92..491bc637 100644 --- a/erp-modular/src/main/resources/dbmapper/erp/MaterialMapper.xml +++ b/erp-modular/src/main/resources/dbmapper/erp/MaterialMapper.xml @@ -206,13 +206,17 @@ FORMAT(a.retail_price, 2) retailPrice, FORMAT(a.low_price, 2) lowPrice, FORMAT(a.estimate_purchase_price, 2) estimatePurchasePrice, - FORMAT(a.sale_price, 2) salePrice + FORMAT(a.sale_price, 2) salePrice, + SUM(c.oper_number * (CASE d.type WHEN 2 THEN 1 ELSE -1 END)) currentTock FROM erp_material_norms a LEFT JOIN erp_unit b ON a.unit_id = b.id + LEFT JOIN erp_depotitem c ON a.id = c.m_unit_id + LEFT JOIN erp_depothead d ON c.header_id = d.id WHERE a.meterial_id = #{id} AND a.delete_flag = '0' + GROUP BY a.id ORDER BY b.number ASC diff --git a/erp-modular/src/main/resources/template/tpl/material/materialdetails.html b/erp-modular/src/main/resources/template/tpl/material/materialdetails.html index 83005c1b..a9401af1 100644 --- a/erp-modular/src/main/resources/template/tpl/material/materialdetails.html +++ b/erp-modular/src/main/resources/template/tpl/material/materialdetails.html @@ -14,6 +14,12 @@