Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boolean isNeedRounding = docType.get_ValueAsBoolean("isneedroundingup");
- BigDecimal QtyRequisition = GetSumRequisitionFromPoDetail(mOrderLine.get_ID());
- BigDecimal QtyOrdered = (BigDecimal) mOrderLine.get_Value("QtyOrdered");
- BigDecimal pembanding = new BigDecimal ("1.05");
- BigDecimal orderMin = productPO.getOrder_Min();
- if(orderMin == null)
- orderMin= BigDecimal.ZERO;
- if(isNeedRounding){
- if(orderMin.compareTo(BigDecimal.ZERO) > 0 ){
- if( QtyRequisition.compareTo(orderMin) > 0){
- if(QtyOrdered.compareTo(QtyRequisition.multiply(pembanding)) > 0 ){
- msg = "Product atas " + mOrderLine.getProduct().getValue() + " melebihi MOQ dan 5% dari requisition || LINE NO:"+mOrderLine.getLine();
- throw new AdempiereException(msg);
- }
- }else if (QtyOrdered.compareTo(orderMin) > 0){
- msg = "Product atas " + mOrderLine.getProduct().getValue() + " melebihi MOQ || LINE NO:"+mOrderLine.getLine();
- throw new AdempiereException(msg);
- }
- }
- else {
- if(QtyRequisition.multiply(pembanding).compareTo(QtyOrdered) < 0 ){
- msg = "Product atas " + mOrderLine.getProduct().getValue() + " melebihi MOQ dan 5% dari requisition || LINE NO:"+mOrderLine.getLine();
- throw new AdempiereException(msg);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement