Can someone please tell me where do I get a list of all the values like doc.get_formatted("base_total, doc.get_formatted(“total”, doc) etc, so that I can customise the format further ?.
I can help but I don’t understand what you want to do. Share some final outcome you need so that we can assist.
e.g.
{{ frappe.db.get_value(“Company”, doc.company, “registration_details”) or “” }}
Thank you very much for the contribution.
I’ve tried the layout and I’ve noticed that there is always an extra blank page whenever the PDF is saved. (even when the invoice has one entry)
How have you managed to overcome this?
Thanking You
hey,
I’ve tried your print format, its good.
I am trying to bring tax rate & tax calculations on row basis, rather that tax charges shown below.
I am running
ERPNext: v12.x.x-develop () (develop)
Frappe Framework: v12.0.18 (version-12)
& I am using item tax template to calculate different taxes.
Can you please help me bring calculations to a single line in your format.
Not sure if this will help but give it a shot:
<TABLE border=1 style="width: 100%; border-collapse: collapse; border: 1px solid black;">
<colgroup>
<col style="width: 5%">
<col style="width: 35%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<THEAD>
<TR>
<TH style="text-align:center">SI</TD>
<TH style="text-align:center">Particulars</TD>
<TH style="text-align:center">QTY</TD>
<TH style="text-align:center">VAT</TD>
<TH style="text-align:center">Rate</TD>
<TH style="text-align:center">Amount</TD>
</TR>
</THEAD>
{% for item in doc.items %}
<TR>
<TD>{{ loop.index }}</TD>
<TD>
<b>{{ item.item_name }}</b>
{% if (item.description != item.item_name) %}
<br>{{ item.description }}
{% endif %}
</TD>
<TD align=center>
{{ item.get_formatted("qty", 0) }}
{{ item.get_formatted("uom", 0) }}
</TD>
<TD align=center>
{% set mydict = json.loads(item.item_tax_rate) %}
{% if item.item_tax_rate == "{}" %}
{% for row in doc.taxes %}
{{ row.get_formatted("rate",0) }}%
{% endfor %}
{% else %}
{% set ns = namespace(vat=none) %}
{% for key, value in mydict.items() %}
{% set ns.vat = value %}
{% endfor %}
{{ ns.vat }}%
{% endif %}
</TD>
<TD align=right>{{ item.get_formatted("net_rate", doc) }}</TD>
<TD align=right>{{ item.get_formatted("net_amount", doc) }}</TD>
</TR>
{% endfor %}
<TR>
<TD rowspan=5 colspan=4 style="vertical-align: top !important;">
Amount in Words<br>
<B>{{ doc.in_words }}</B><br><br>
<B>
{% if doc.currency != "TZS" %}
{{ doc.base_in_words }}
{% endif %}
</B>
</TD>
<TD align=right><B>SUB. TOTAL</B></TD>
<TD align=right><B>{{ doc.get_formatted("net_total", doc) }}</B></TD>
</TR>
<TR>
<TD align=right><B>V.A.T.</B></TD>
<TD align=right><B>{{ doc.get_formatted("total_taxes_and_charges", doc) }}</B></TD>
</TR>
<TR>
<TD align=right><B>TOTAL</B></TD>
<TD align=right><B>{{ doc.get_formatted("grand_total", doc) }}</B></TD>
</TR>
<TR>
<TD colspan=2 align=right><i><small><strong>E&OE</strong></small></i></TD>
</TR>
<TR>
<TD align=left><STRONG>Assessable Value:</STRONG></TD>
<TD align=right>
{% if (doc.base_total_taxes_and_charges == 0) %}
{{ frappe.utils.fmt_money(0, currency="") }}
{% else %}
{% if (doc.base_net_total != doc.base_total) %}
{{ frappe.utils.fmt_money(doc.base_net_total, currency="") }}
{% else %}
{{ frappe.utils.fmt_money(doc.base_total_taxes_and_charges / 0.18, currency="") }}
{% endif %}
{% endif %}
</TD>
</TR>
<TR>
<TD colspan=4 rowspan=5 style="padding:0px; margin:0px; vertical-align: top !important;">
{% if (doc.from_date != None) %}
PERIOD: FROM {{ frappe.utils.formatdate(doc.from_date, 'dd-MMM-YYYY') }} TO {{ frappe.utils.formatdate(doc.to_date, 'dd-MMM-YYYY') }}<br>
{% endif %}
{% if (doc.remarks != "No Remarks") %}{{ doc.remarks }}{% endif %}
</TD>
<TD align=left><STRONG>VAT Amount:</STRONG></TD>
<TD align=right>{{ frappe.utils.fmt_money(doc.base_total_taxes_and_charges, currency="") }}</TD>
</TR>
<TR>
<TD align=left><STRONG>Exempt:</STRONG></TD>
<TD align=right>
{% if (doc.base_total_taxes_and_charges == 0) %}
{{ frappe.utils.fmt_money(doc.base_total, currency="") }}
{% else %}
{% if (doc.base_net_total != doc.base_total) %}
{{ frappe.utils.fmt_money(doc.base_grand_total - (doc.base_net_total + doc.base_total_taxes_and_charges), currency="") }}
{% else %}
{{ frappe.utils.fmt_money(doc.base_grand_total - ((doc.base_total_taxes_and_charges / 0.18) + doc.base_total_taxes_and_charges), currency="") }}
{% endif %}
{% endif %}
</TD>
</TR>
<TR>
<TD align=left><STRONG>Special Relief:</STRONG></TD>
<TD align=right> </TD>
</TR>
<TR>
<TD align=left><STRONG>Zero Rated:</STRONG></TD>
<TD align=right> </TD>
</TR>
<TR>
<TD align=left><STRONG>Total:</STRONG></TD>
<TD align=right style="border-top: 2px solid black;"><b>{{ frappe.utils.fmt_money(doc.base_grand_total, currency="") }}</b></TD>
</TR>
</TABLE>
<div id="header-html" class="hidden-pdf">
<div id="variables" style="display:none;">
<span id="margin-top">1mm</span>
<span id="margin-left">1mm</span>
<span id="margin-right">1mm</span>
<span id="margin-bottom">0mm</span>
</div>
</div>
It has got some hardcoding for our environment, so you may have to soft-code it. If you do, then share the code as well.
Hey thanks for prompt reply.
Here is print format screenshot of the code you sent.
This is what we have setup, based on your print format.
We have three tax heads CGST, SGST & IGST.
In the print format above of sales invoice two tax heads are applicable, CGST 6% & SGST 6% (These are applicable for inter-state, if supply would have been made intra-state then IGST would have been applicable @ 12%)
What I want, please find s.s below
Can you please help with this type of format.
You will have to use this part of the code in every tax column with its respected tax name. And using its percentage you can get the tax value. This will be a formula which will calculate the rate in the basis on item master tax table tax rate.
Hey.
Thanks for ur reply
I will try it out soon and get back to you.
Thanx
Please share the Screenshot of the Item Tax table in Item form and of item tax details in sales invoice Item row.
Will try to help you with the script.
@fkardame Hey Thanks for your prompt reply.
I am using Item tax template to call correct tax rate. I have set tax category in party master to In state / Out state. In item master I have created 6 item tax templates according to tax % in india for ex. In state 18% / out state 18%, In state 12% / Out State 12%.
Please see screenshot below.
Item Master Form
Item Tax Template
Item Tax Template
Customer Master Form
Also I tried other_charges_calculation field in my print format, its gives me this :-
I want this print format, it gives gst rate and amount row wise. Also a total column at the end will be good. Please see below
Looks like you’re using V12 and I am not familiar with V12 tax methods. Sorry about that, I thought you were on V11.
Maybe some else can help you with this.
Ok. Thanks for your reply
Can anybody please help overcome this issue in v12 ?
Can anybody resolve this issue please ?
Please confirm whether Tally Format available in ERPNext,
If yes, how to configure the same
See if this helps.
Hi
Can someone help achieve this in V12 !!??
i want to generate invoice click on custom button in custom doctype and custom button
so can u help me
Could you please give more details.
Welcome to the community. You can use custom script. You will need to use Javascript and you may find information https://docs.erpnext.com/docs/user/manual/en/customize-erpnext/custom-scripts useful