diff --git a/kenya_compliance/kenya_compliance/apis/apis.py b/kenya_compliance/kenya_compliance/apis/apis.py index 2314a7e..870a0e4 100644 --- a/kenya_compliance/kenya_compliance/apis/apis.py +++ b/kenya_compliance/kenya_compliance/apis/apis.py @@ -803,7 +803,7 @@ def create_item(item: dict | frappe._dict) -> Document: @frappe.whitelist() def create_purchase_invoice_from_request(request_data: str) -> None: data = json.loads(request_data) - bhifd=get_first_branch_id() + bhfId=get_first_branch_id() # Check if supplier exists supplier = None if not frappe.db.exists("Supplier", data["supplier_name"], cache=False): @@ -827,7 +827,7 @@ def create_purchase_invoice_from_request(request_data: str) -> None: purchase_invoice.custom_supplier_branch_id = data["supplier_branch_id"] purchase_invoice.bill_no = data["supplier_invoice_no"] purchase_invoice.bill_date = data["supplier_invoice_date"] - purchase_invoice.bhifd = bhifd + purchase_invoice.branch = bhfId if "currency" in data: # The "currency" key is only available when creating from Imported Item purchase_invoice.currency = data["currency"]