Advertisement
aironman

rules file

Dec 12th, 2019
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1.  
  2. rule "Applying taxes to imported products."
  3. when
  4. $order: Order()
  5. $products: Product() from $order.getProducts()
  6. $product: Product($products.isImported())
  7. then
  8. $product.setSale_tax($product.getPrize() *5d/100);
  9. $order.setTotalPrize($product.getSale_tax() + $product.getPrize());
  10. $order.setTotalTaxes($product.getSale_tax());
  11. System.out.println($order.toString());
  12. System.out.println($order.getTotalPrize());
  13. System.out.println($order.getTotalTaxes());
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement