Commit 50191afd by 江和松

1.采购合同计算原材料时根据重量*单价计算

parent 1d2cdf1f
......@@ -279,6 +279,26 @@ public class ServiceHGPZ005 extends ServiceBase {
}
/**
* 下拉框 (不默认状态)
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "下拉框(原料、零件、耗材)")
public EiInfo queryInventCodeProdTypeFourBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getInentTypeThree());
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ005.FIELD_STATUS,1);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询规格失败");
}
return inInfo;
}
/**
* 下拉框
*
* @param inInfo
......
......@@ -170,7 +170,8 @@ public class ServiceHGSC009 extends ServiceEPBase {
* @param hgsc009
*/
private void checkUpdateStatusData(HGSC009 hgsc009) {
List<HGSC009A> hgsc009AList = HGSCTools.HGSC009.getByPlanMaterialCode(hgsc009.getPlanMaterialCode());
hgsc009 = HGSCTools.THGSC009.getById(hgsc009.getId());
List<HGSC009A> hgsc009AList = HGSCTools.THGSC009.getByPlanMaterialCode(hgsc009.getPlanMaterialCode());
List<Long> materialPlanIds = hgsc009AList.stream().map(HGSC009A::getId).collect(Collectors.toList());
List<HGCG001> hgcg001List = HGCGTools.HgCg001.listByMaterialPlanIds(materialPlanIds);
hgsc009AList.forEach(o->{
......
......@@ -217,7 +217,7 @@ public class ServiceHGSC009A extends ServiceBase {
public EiInfo insertcg(EiInfo inInfo) {
try {
String[] orderDetailIds = inInfo.getString("planMaterialCodes").split(",");
List<HGSC009A> hgsc009AList = HGSCTools.HGSC009.getByPlanMaterialCodes(orderDetailIds);
List<HGSC009A> hgsc009AList = HGSCTools.THGSC009.getByPlanMaterialCodes(orderDetailIds);
List<String> inventCodes = Optional.ofNullable(hgsc009AList).orElse(new ArrayList<>()).stream().map(HGSC009A::getInventCode).collect(Collectors.toList());
Map<String,String> inventUnitMap = new HashMap<>();
if(CollectionUtils.isNotEmpty(inventCodes)){
......
......@@ -1185,7 +1185,7 @@ public class HGSCTools {
}
public static class HGSC009{
public static class THGSC009{
/* public static void generatorOrder(List<HGSC005> hgsc005List, List<HGSC005A> hgsc005AList){
Map<String, Optional<HGSC005>> hgsc005Map = hgsc005List.stream().collect(Collectors.groupingBy(HGSC005::getPlanCode,Collectors.maxBy(
Comparator.comparingLong(HGSC005::getId))));
......@@ -1211,7 +1211,11 @@ public class HGSCTools {
hgsc006.setAssignStatus(UNASSIGN.getCode());
return hgsc006;
}*/
public static HGSC009 getById(Long taskId){
AssertUtils.isTrue(Objects.isNull(taskId)||taskId<=0, "材料计划ID不能为空!");
HGSC009 results = (HGSC009)DaoBase.getInstance().get(HGSC009.QUERY, HGSC009.FIELD_ID, taskId);
return results;
}
public static List<HGSC009A> getByPlanMaterialCodes(String[] planMaterialCodes){
AssertUtils.isTrue(Objects.isNull(planMaterialCodes)||planMaterialCodes.length<=0, "材料计划编码不能为空!");
Map map = new HashMap<>();
......
......@@ -100,18 +100,36 @@ $(function () {
* @param coefficient
*/
let calAmount = function (item) {
if(item.purQty && item.price && item.taxRate){
// 数量*单价金额
let totalAmount = item.purQty * item.price;
//不含税金额
let amount = totalAmount / (1 + item.taxRate / 100);
//税额
let taxAmount = totalAmount - amount;
//含税金额
let taxIncludeAmount = totalAmount;
resultGrid.setCellValue(item, 'taxAmount', taxAmount)
resultGrid.setCellValue(item, 'amount', amount)
resultGrid.setCellValue(item, 'taxIncludeAmount', taxIncludeAmount)
//原材料
if(item.inventTypeDetail === '3'){
if(item.purWeight && item.price && item.taxRate){
// 重量*单价金额
let totalAmount = item.purWeight * item.price;
//不含税金额
let amount = totalAmount / (1 + item.taxRate / 100);
//税额
let taxAmount = totalAmount - amount;
//含税金额
let taxIncludeAmount = totalAmount;
resultGrid.setCellValue(item, 'taxAmount', taxAmount)
resultGrid.setCellValue(item, 'amount', amount)
resultGrid.setCellValue(item, 'taxIncludeAmount', taxIncludeAmount)
}
}else{
if(item.purQty && item.price && item.taxRate){
// 数量*单价金额
let totalAmount = item.purQty * item.price;
//不含税金额
let amount = totalAmount / (1 + item.taxRate / 100);
//税额
let taxAmount = totalAmount - amount;
//含税金额
let taxIncludeAmount = totalAmount;
resultGrid.setCellValue(item, 'taxAmount', taxAmount)
resultGrid.setCellValue(item, 'amount', amount)
resultGrid.setCellValue(item, 'taxIncludeAmount', taxIncludeAmount)
}
}
}
......
......@@ -83,6 +83,8 @@
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型明细" enable="false" width="100" align="center" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -11,11 +11,6 @@ $(function () {
},
columns: [{
field: "inventCode",
filter: function (options) {
return _.filter(inventAllBlockId, function (item) {
return item["param1Field"] == "true";
})
},
template: function (item) {
let template = "";
if(item.inventCode){
......@@ -33,7 +28,7 @@ $(function () {
let inInfo = new EiInfo();
inInfo.set("field", options.field);
let dataSource = inventRecordBoxBlockId;
EiCommunicator.send("HGPZ005", "queryInventCodeBox", inInfo, {
EiCommunicator.send("HGPZ005", "queryInventCodeProdTypeFourBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_record_box_block_id").getMappedRows();
},
......
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