Fixes in valuation rate calculation in purchase receipt
diff --git a/controllers/buying_controller.py b/controllers/buying_controller.py
index 4aa08d6..f014f72 100644
--- a/controllers/buying_controller.py
+++ b/controllers/buying_controller.py
@@ -184,7 +184,7 @@
for item in self.doclist.get({"parentfield": parentfield}):
- if item.item_code and item.qty and item.item_code in stock_items:
+ if item.item_code and item.qty and stock_items_amount and item.item_code in stock_items:
item.item_tax_amount = flt(flt(item.amount) * total_valuation_amount \
/ stock_items_amount, self.precision("item_tax_amount", item))