Advertisement
aironman

rules file

Dec 12th, 2019
121
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement