diff --git a/india_compliance/gst_india/api_classes/e_invoice.py b/india_compliance/gst_india/api_classes/e_invoice.py index c59b6c7543..e337623014 100644 --- a/india_compliance/gst_india/api_classes/e_invoice.py +++ b/india_compliance/gst_india/api_classes/e_invoice.py @@ -21,6 +21,8 @@ class EInvoiceAPI(BaseAPI): # Cancel IRN errors "9999": "Invoice is not active", "4002": "EwayBill is already generated for this IRN", + # IRN Generated in different Portal + "2148": "Requested IRN data is not available", # Invalid GSTIN error "3028": "GSTIN is invalid", "3029": "GSTIN is not active", diff --git a/india_compliance/gst_india/doctype/gst_return_log/gst_return_log.py b/india_compliance/gst_india/doctype/gst_return_log/gst_return_log.py index e9b5126b01..2dd9d6631d 100644 --- a/india_compliance/gst_india/doctype/gst_return_log/gst_return_log.py +++ b/india_compliance/gst_india/doctype/gst_return_log/gst_return_log.py @@ -169,7 +169,7 @@ def get_return_status(self): self.gstin, self.return_period, ) - self.filing_status = status + self.db_set("filing_status", status) return status diff --git a/india_compliance/gst_india/overrides/transaction.py b/india_compliance/gst_india/overrides/transaction.py index c2844f1caa..ce006220f0 100644 --- a/india_compliance/gst_india/overrides/transaction.py +++ b/india_compliance/gst_india/overrides/transaction.py @@ -937,11 +937,12 @@ def get_gst_details(party_details, doctype, company, *, update_place_of_supply=F gst_details.update(party_gst_details) # POS - gst_details.place_of_supply = ( - party_details.place_of_supply - if (not update_place_of_supply and party_details.place_of_supply) - else get_place_of_supply(party_details, doctype) - ) + if not update_place_of_supply and party_details.place_of_supply: + gst_details.place_of_supply = party_details.place_of_supply + else: + place_of_supply = get_place_of_supply(party_details, doctype) + gst_details.place_of_supply = place_of_supply + party_details.place_of_supply = place_of_supply if is_sales_transaction: source_gstin = party_details.company_gstin @@ -1016,12 +1017,7 @@ def get_gst_details(party_details, doctype, company, *, update_place_of_supply=F if default_tax := get_tax_template( master_doctype, company, - is_inter_state_supply( - party_details.copy().update( - doctype=doctype, - place_of_supply=gst_details.place_of_supply, - ) - ), + is_inter_state_supply(frappe._dict({**party_details, "doctype": doctype})), party_details.company_gstin[:2], party_details.is_reverse_charge, ): diff --git a/india_compliance/gst_india/report/gst_sales_register_beta/gst_sales_register_beta.py b/india_compliance/gst_india/report/gst_sales_register_beta/gst_sales_register_beta.py index c424dca2b8..80744ba694 100644 --- a/india_compliance/gst_india/report/gst_sales_register_beta/gst_sales_register_beta.py +++ b/india_compliance/gst_india/report/gst_sales_register_beta/gst_sales_register_beta.py @@ -222,6 +222,12 @@ def get_columns(filters): columns.extend( [ + { + "label": _("Item Qty"), + "fieldname": "qty", + "fieldtype": "Data", + "width": 100, + }, { "label": _("HSN Code"), "fieldname": "gst_hsn_code", diff --git a/india_compliance/gst_india/utils/e_waybill.py b/india_compliance/gst_india/utils/e_waybill.py index ae2b795b2a..fca0c68acc 100644 --- a/india_compliance/gst_india/utils/e_waybill.py +++ b/india_compliance/gst_india/utils/e_waybill.py @@ -166,6 +166,11 @@ def _generate_e_waybill(doc, throw=True, force=False): if result.error_code == "4002": result = api(doc).get_e_waybill_by_irn(doc.get("irn")) + if result.error_code == "2148": + with_irn = False + data = EWaybillData(doc).get_data(with_irn=with_irn) + result = EWaybillAPI(doc).generate_e_waybill(data) + except GSPServerError as e: handle_server_errors(settings, doc, "e-Waybill", e) return diff --git a/india_compliance/gst_india/utils/gstr_1/gstr_1_data.py b/india_compliance/gst_india/utils/gstr_1/gstr_1_data.py index 315facf4d1..a068dc37a9 100644 --- a/india_compliance/gst_india/utils/gstr_1/gstr_1_data.py +++ b/india_compliance/gst_india/utils/gstr_1/gstr_1_data.py @@ -448,6 +448,7 @@ def get_invoices_for_hsn_wise_summary(self): frappe.qb.from_(query) .select( "*", + Sum(query.qty).as_("qty"), Sum(query.taxable_value).as_("taxable_value"), Sum(query.cgst_amount).as_("cgst_amount"), Sum(query.sgst_amount).as_("sgst_amount"),