Skip to content

Commit

Permalink
feat: new method updated
Browse files Browse the repository at this point in the history
  • Loading branch information
AshishBarvaliya committed Aug 16, 2024
1 parent 4af5022 commit 08afb3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions d2h/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ def create_purchase_receipt(purchase_order, items):
new_item.margin_rate_or_amount = item.get("margin_rate_or_amount")
new_item.rate_with_margin = item.get("rate_with_margin")
new_item.base_rate_with_margin = item.get("base_rate_with_margin")
new_item.amount = item["qty"] * item.get("rate")
new_item.amount = item["qty"] * (item.get("rate") or 0)
new_item.rate = item.get("rate")
new_item.stock_qty = item["qty"] * item.get("conversion_factor")
new_item.stock_qty = item["qty"] * (item.get("conversion_factor") or 0)
new_item.base_rate = item.get("base_rate")
new_item.base_amount = item["qty"] * item.get("base_rate")
new_item.base_amount = item["qty"] * (item.get("base_rate") or 0)
new_item.discount_percentage = item.get("discount_percentage")
new_item.discount_amount = item.get("discount_amount")
new_item.base_discount_amount = item.get("base_discount_amount")
Expand Down

0 comments on commit 08afb3d

Please sign in to comment.