From 8afac7e97d646e95d2fa3ed5440a28fae57a2698 Mon Sep 17 00:00:00 2001 From: Faheedkhan Date: Tue, 2 Sep 2025 16:42:40 +0300 Subject: [PATCH] expense bill bug fixes --- inventory/templatetags/custom_filters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inventory/templatetags/custom_filters.py b/inventory/templatetags/custom_filters.py index 17832ab4..ed69ae5c 100644 --- a/inventory/templatetags/custom_filters.py +++ b/inventory/templatetags/custom_filters.py @@ -501,8 +501,8 @@ def bill_item_formset_table(context, item_formset): for item in item_formset: if item: print(item.fields["item_model"]) - item.initial["quantity"] = item.instance.po_quantity - item.initial["unit_cost"] = item.instance.po_unit_cost + item.initial["quantity"] = item.instance.po_quantity if item.instance.po_quantity else item.instance.quantity + item.initial["unit_cost"] = item.instance.po_unit_cost if item.instance.po_unit_cost else item.instance.unit_cost # print(item.instance.po_quantity) # print(item.instance.po_unit_cost) # print(item.instance.po_total_amount)