How to set default Terms and Conditions per company erpnext 15

I cannot figure out how to set Terms and conditions for a company on erpnext 15.

I did create the terms and condition template. One for each company.
Then went to company looking for “Default Terms & Conditions” field so that I can choose the correct t&c template for each company but cannot find such a field.

In the invoice, I can select the t&c template but this has to be done manually.

Is there a way to set default t&c? Like selling terms and buying terms.

Or is the setting somewhere else?

Hi,

Simple Solution is to add Custom Link Field Company on Terms and Condition Doctype.

For this Go to the Terms and Condition Doctype, click on three dots and click on Customize Form.

In the Form Add new field, give Label, Company and datatype select “Link” in the option type “Company”.

Update and save. Reload the Document. Now you can see the company field on the Terms and Condition, select the relevant company and save.

This will automatically filter the terms and conditions as per company in sales and purchase.

Thanks,

Divyesh Mangroliya

Hi @pvanthony and @mangroliya,

You don’t need to add a custom field for this. You can easily set it in the Company Master. Now, you can set the Default Buying Terms and Default Selling Terms in the Company doctype, so please check it.

2 Likes

Thank you for replying with a possible solution.
I do appreciate it.

Wow! this is so cool.

For terms and condition the variable for pdf is ‘doc.terms’.
What is the variable for default sales terms or default buying terms?

Or how to find such variables?

If you want to get the selling terms in print format apply like

{{ frappe.db.get_value("Company", doc.company, 'default_selling_terms') }}

I tried the above suggestion,

{{ frappe.db.get_value("Company", doc.company, 'default_selling_terms') }}

unfortunately, it just calls the name of the template set but not the contents of the template.

What did I miss?

Ohh :sweat_smile:, i forgot it.

Please check it.

{% set terms = frappe.db.get_value("Company", doc.company, 'default_selling_terms') %}
{% if terms %}
    {{ frappe.db.get_value("Terms and Conditions", terms, 'terms') }}
{% else %}
    No terms defined.
{% endif %}
1 Like

This works!!!

Thank you very much for sharing the solution.
I do appreciate it very much.