Advertisement
tko_pb

pak eko 5% 3 maret 1

Mar 2nd, 2021
1,658
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.21 KB | None | 0 0
  1. boolean isNeedRounding = docType.get_ValueAsBoolean("isneedroundingup");
  2. BigDecimal QtyRequisition = GetSumRequisitionFromPoDetail(mOrderLine.get_ID());
  3. BigDecimal QtyOrdered = (BigDecimal) mOrderLine.get_Value("QtyOrdered");
  4. BigDecimal pembanding = new BigDecimal ("1.05");
  5. BigDecimal orderMin = productPO.getOrder_Min();
  6. if(orderMin == null)
  7.     orderMin= BigDecimal.ZERO;
  8. if(isNeedRounding){
  9.     if(orderMin.compareTo(BigDecimal.ZERO) > 0 ){
  10.         if( QtyRequisition.compareTo(orderMin) > 0){
  11.             if(QtyOrdered.compareTo(QtyRequisition.multiply(pembanding)) > 0 ){
  12.                 msg = "Product atas " + mOrderLine.getProduct().getValue() + " melebihi MOQ dan 5% dari requisition || LINE NO:"+mOrderLine.getLine();
  13.                 throw new AdempiereException(msg);
  14.             }
  15.         }else if (QtyOrdered.compareTo(orderMin) > 0){
  16.             msg = "Product atas " + mOrderLine.getProduct().getValue() + " melebihi MOQ || LINE NO:"+mOrderLine.getLine();
  17.             throw new AdempiereException(msg);
  18.         }
  19.     }
  20.    
  21.     else { 
  22.         if(QtyRequisition.multiply(pembanding).compareTo(QtyOrdered) < 0 ){
  23.             msg = "Product atas " + mOrderLine.getProduct().getValue() + " melebihi MOQ dan 5% dari requisition || LINE NO:"+mOrderLine.getLine();
  24.             throw new AdempiereException(msg);
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement