tko_pb

pak eko 5% 3 maret 1

Mar 2nd, 2021
1,302
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×