Item wise taxes in print formate

I am very new to erpnext and i am trying to fetch item wise taxes in print format.
Already we are maintaining hsn wise and item wise taxes.

I really appreciate your help.

Hello @Khaja_Kareem_Shaik

Currently it’s not available in default system(Item tax now available in html format). Either you can create a separate child table or add a new field in existing Items table for storing that information and call print format.

Thanks

@Khaja_Kareem_Shaik

Please find the link. May be it will help.

Thanks

Thanks for your reference Its working but it shows only 14% in CGST Rate and SGST Rate,even if the items have multiple taxes like 28% or 18%

After the latest India Compliance update, you can get the SGST/CGST/IGST rates and amount directly from the item table.

1 Like

Hello @rtdany10

Do we need Indian compliance for that, or does the newest ERPNext handle it by default? Because we require a similar feature but outside of India. Thank you.

You can use this function: https://github.com/frappe/erpnext/blob/develop/erpnext/regional/united_arab_emirates/utils.py#L9 to get tax rate and amount in the item table. You will have to create the fields in the table and trigger this function on validate.

1 Like

Thanks for your help.It is working but it shows only 14% in CGST Rate and SGST Rate,even if the items have different item_tax_templates.The Output is showing like this.Please give me any suggestion

Regards
Thanks

I use this

{% set cgst_rate = [] -%}
{% set sgst_rate = [] -%}
{% set igst_rate = [] -%}
{% set cgst_account_head = [] -%}
{% set sgst_account_head = [] -%}
{% set igst_account_head = [] -%}
{% set tot_cgst_amount = [] %}
{% set tot_sgst_amount = [] %}
{% set grand_total = {"qty":0.0, "amount":0.0, "cgst_amt":0.0, "sgst_amt":0.0, "igst_amt":0.0} %}

{%- for row in doc.taxes -%}
   {% if 'CGST' in row.account_head -%}
	    {% set _ = cgst_account_head.append(row.account_head) %}
	    {% set _ = cgst_rate.append(row.rate) %}
   {%- endif -%}
   {% if 'SGST' in row.account_head -%}
	    {% set _ = sgst_account_head.append(row.account_head) %}
	    {% set _ = sgst_rate.append(row.rate) %}
    {%- endif -%}
   {% if 'IGST' in row.account_head -%}
	    {% set _ = igst_account_head.append(row.account_head) %}
	    {% set _ = igst_rate.append(row.rate) %}
   {%- endif -%}
{%- endfor -%}

{%- for row in doc.items -%}


{% set cgst_amt = [] -%}
{% set sgst_amt = [] -%}
{% set igst_amt = [] -%}
{% set it_cgst_rate = [] -%}
{% set it_sgst_rate = [] -%}
{% set it_igst_rate = [] -%}
{% set rate_found_item = 0 -%}
{%- set item_record = frappe.get_doc(“Item”, row.item_code) -%}
{% for item_tax in item_record.taxes %}
{% if item_tax.item_tax_template == igst_account_head[0] %}
{% set _ = it_igst_rate.append(item_tax.tax_category) %}
{% set _ = igst_amt.append(row.amount * it_igst_rate[0] / 100) -%}
{% set rate_found_item = 1 -%}
{% endif %}
{% if item_tax.item_tax_template == sgst_account_head[0] %}
{% set _ = it_sgst_rate.append(item_tax.tax_category) %}
{% set _ = sgst_amt.append(row.amount * it_sgst_rate[0] / 100) -%}
{% set rate_found_item = 1 -%}
{% endif %}
{% if item_tax.item_tax_template == cgst_account_head[0] %}
{% set _ = it_cgst_rate.append(item_tax.tax_category) %}
{% set _ = cgst_amt.append(row.amount * it_cgst_rate[0] / 100) -%}
{% set rate_found_item = 1 -%}
{% endif %}
{% endfor %}
{% if rate_found_item == 0 %}
{% if cgst_rate[0] -%}
{% set _ = cgst_amt.append((row.amount * cgst_rate[0])/100) -%}
{% set _= it_cgst_rate.append(cgst_rate[0]) -%}
{% set rate_found_inv = 1 -%}
{%- endif -%}
{% if sgst_rate[0] -%}
{% set _ = sgst_amt.append((row.amount * sgst_rate[0])/100) -%}
{% set _= it_sgst_rate.append(sgst_rate[0]) -%}
{%- endif -%}
{% if igst_rate[0] -%}
{% set _ = igst_amt.append((row.amount * igst_rate[0])/100) -%}
{% set _= it_igst_rate.append(igst_rate[0]) -%}
{% set rate_found_inv = 1 -%}
{%- endif -%}
{% endif %}
{% if not it_cgst_rate[0] %}
{% set _ = it_cgst_rate.append(0) %}
{% set _ = cgst_amt.append(0) %}
{% endif %}
{% if not it_sgst_rate[0] %}
{% set _ = it_sgst_rate.append(0) %}
{% set _ = sgst_amt.append(0) %}
{% endif %}
{% if not it_igst_rate[0] %}
{% set _ = it_igst_rate.append(0) %}
{% set _ = igst_amt.append(0) %}
{% endif %}
{% set temp_cgst_amt = grand_total[“cgst_amt”] + cgst_amt[0] %}
{% set temp_sgst_amt = grand_total[“sgst_amt”] + sgst_amt[0] %}
{% set temp_igst_amt = grand_total[“igst_amt”] + igst_amt[0] %}
{% set temp_qty = grand_total[“qty”] + row.qty %}
{% set temp_amount = grand_total[“amount”] + row.amount %}
{% set check = grand_total.update({“qty”: temp_qty, “amount”: temp_amount, “cgst_amt”:temp_cgst_amt, “sgst_amt”:temp_sgst_amt, “igst_amt”:temp_igst_amt}) %}













{%- endfor -%}












Sr Description Tariff/HSN Quantity Rate Amount CGST Rate CGST Amount SGST Rate SGST Amount IGST Rate IGST Amount
{{ row.idx }}
{% if row.item_code != row.item_name -%}
{{ row.item_code}}

{%- endif %}
{{ row.item_name }}
{{ row.gst_hsn_code }} {{ row.uom or row.stock_uom }}            {{ row.qty }} {{
row.get_formatted(“rate”, doc) }}
{{
row.get_formatted(“amount”, doc) }}
{{
it_cgst_rate[0] }}%
{{
“₹ {:,.2f}”.format(cgst_amt[0]) }}
{{
it_sgst_rate[0] }}%
{{
“₹ {:,.2f}”.format(sgst_amt[0]) }}
{{
it_igst_rate[0] }}%
{{
“₹ {:,.2f}”.format(igst_amt[0]) }}

Total
{{ grand_total[“qty”] }} {{
“₹ {:,.2f}”.format(grand_total[“amount”]) }}
{{
“₹ {:,.2f}”.format(grand_total[“cgst_amt”]) }}
{{
“₹ {:,.2f}”.format(grand_total[“sgst_amt”]) }}
{{
“₹ {:,.2f}”.format(grand_total[“igst_amt”]) }}
code to achieve this

@Khaja_Kareem_Shaik update to the latest version and check