north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
@@ -1454,13 +1454,23 @@ if(titleUploadData.value.calculateType===3){ item.grossAmount=parseFloat(multiply(item.price , item.quantity)) }else if(titleUploadData.value.calculateType===4){ item.grossArea = countArea(item) item.computeGrossArea = item.grossArea item.grossAmount=parseFloat(divideAuto(item.width * item.height* item.quantity*item.price,1000000,company.decValue)) if(titleUploadData.value?.orderReview!==2){ item.grossArea = countArea(item) item.computeGrossArea = item.grossArea item.grossAmount=parseFloat(divideAuto(item.width * item.height* item.quantity*item.price,1000000,company.decValue)) }else{ item.grossAmount=parseFloat(divideAuto(item.width * item.height* item.quantity*item.price,1000000,company.decValue)) } }else{ item.grossArea = countArea(item) item.computeGrossArea = item.grossArea item.grossAmount=parseFloat(multiply(item.price , item.computeGrossArea)) if(titleUploadData.value?.orderReview!==2){ item.grossArea = countArea(item) item.computeGrossArea = item.grossArea item.grossAmount=parseFloat(multiply(item.price , item.computeGrossArea)) }else{ item.grossAmount=parseFloat(multiply(item.price , item.computeGrossArea)) } } } }) north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -502,9 +502,21 @@ BigDecimal getPrice= BigDecimal.valueOf(orderDetail.getPrice()); BigDecimal getQuantity= BigDecimal.valueOf(orderDetail.getQuantity()); BigDecimal getComputeGrossArea= BigDecimal.valueOf(orderDetail.getComputeGrossArea()); BigDecimal getComputeArea= BigDecimal.valueOf(orderDetail.getComputeArea()); BigDecimal getWidth= BigDecimal.valueOf(orderDetail.getWidth()); BigDecimal getHeight= BigDecimal.valueOf(orderDetail.getHeight()); if (calculateType == 3) { orderDetail.setGrossAmount(getPrice.multiply(getQuantity).setScale(2, RoundingMode.HALF_UP).doubleValue()); } else { }else if (calculateType == 4) { if(Objects.equals(orderDetail.getArea(), orderDetail.getComputeArea())&&Objects.equals(orderDetail.getGrossArea(), orderDetail.getComputeGrossArea())){ orderDetail.setGrossAmount(getWidth.multiply(getHeight).multiply(getQuantity).multiply(getPrice). divide(BigDecimal.valueOf(1000000), 2, RoundingMode.HALF_UP).doubleValue()); }else{ orderDetail.setGrossAmount(getPrice.multiply(getComputeGrossArea).setScale(2, RoundingMode.HALF_UP).doubleValue()); } }else if (calculateType == 1){ orderDetail.setGrossAmount(getPrice.multiply(getComputeArea).multiply(getQuantity).setScale(2, RoundingMode.HALF_UP).doubleValue()); }else{ orderDetail.setGrossAmount(getPrice.multiply(getComputeGrossArea).setScale(2, RoundingMode.HALF_UP).doubleValue()); } return orderDetail;