From b99fdc7a5afa27e7f881631bcf491d152c5827b1 Mon Sep 17 00:00:00 2001 From: maniamartial Date: Sun, 9 Jun 2024 17:12:07 +0300 Subject: [PATCH] Adding batch to sales invoice items --- .../burundi_compliance/api_classes/check_tin.py | 2 +- .../client_scripts/customer_supplier_check_tin.js | 1 - .../burundi_compliance/data/sale_invoice_data.py | 10 ++++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/burundi_compliance/burundi_compliance/api_classes/check_tin.py b/burundi_compliance/burundi_compliance/api_classes/check_tin.py index 59b6ea6..84cd7f6 100644 --- a/burundi_compliance/burundi_compliance/api_classes/check_tin.py +++ b/burundi_compliance/burundi_compliance/api_classes/check_tin.py @@ -38,7 +38,7 @@ def check_tin(self, tin): frappe.log_error(error_message, "CheckTin Request Error") frappe.log_error(f"Response content: {response}") frappe.throw(f"{tin} Not registered") - + obr_base_auth=OBRAPIBase() token=obr_base_auth.authenticate() diff --git a/burundi_compliance/burundi_compliance/client_scripts/customer_supplier_check_tin.js b/burundi_compliance/burundi_compliance/client_scripts/customer_supplier_check_tin.js index 63c2f9a..54dcc1a 100644 --- a/burundi_compliance/burundi_compliance/client_scripts/customer_supplier_check_tin.js +++ b/burundi_compliance/burundi_compliance/client_scripts/customer_supplier_check_tin.js @@ -34,7 +34,6 @@ function showInvoiceDetailsDialog(result, doctype) { read_only: true } - ] }); diff --git a/burundi_compliance/burundi_compliance/data/sale_invoice_data.py b/burundi_compliance/burundi_compliance/data/sale_invoice_data.py index ae5fa7e..b0a6ff7 100644 --- a/burundi_compliance/burundi_compliance/data/sale_invoice_data.py +++ b/burundi_compliance/burundi_compliance/data/sale_invoice_data.py @@ -115,9 +115,10 @@ def get_invoice_items(self): total_vat = 0 else: total_vat = 0 - + item_designation=item.item_code +"-" + item.batch_no if item.batch_no else item.item_code items.append({ - "item_designation": item.item_code, + "item_code": item.item_code, + "item_designation": item_designation, "item_quantity": abs(item.qty), "item_price": item.rate, "item_total_amount": item.amount, @@ -127,7 +128,6 @@ def get_invoice_items(self): "item_price_nvat": abs(int(item.amount)), "item_price_wvat": abs(int(item.amount + total_vat)) }) - return items def get_sales_data_for_stock_update(self, method=None): @@ -146,10 +146,12 @@ def get_sales_data_for_stock_update(self, method=None): item_movement_type = "SN" if self.doc.is_return==1: item_movement_type = "ER" + + item_designation = item.item_code + " - " + item.batch_no if item.batch_no else item.item_code data = { "system_or_device_id": get_system_tax_id(), "item_code": item.item_code, - "item_designation": item.item_name, + "item_designation": item_designation, "item_quantity": item.qty, "item_measurement_unit": item_uom, "item_purchase_or_sale_price": item.rate,