blob: 24ab1cf049f54e58ca2a9d14a4001f86b8a0a7e8 [file] [log] [blame]
Tyler Matteson53a64922019-01-17 14:04:01 -05001# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
2# License: GNU General Public License v3. See license.txt
3
4from __future__ import unicode_literals
5import frappe
6from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
7
Tyler Matteson53a64922019-01-17 14:04:01 -05008def setup(company=None, patch=True):
9 make_custom_fields()
10 add_print_formats()
Tyler Matteson53a64922019-01-17 14:04:01 -050011
Deepesh Garg9df45322020-06-11 21:33:43 +053012def make_custom_fields(update=True):
Tyler Matteson53a64922019-01-17 14:04:01 -050013 custom_fields = {
14 'Supplier': [
15 dict(fieldname='irs_1099', fieldtype='Check', insert_after='tax_id',
16 label='Is IRS 1099 reporting required for supplier?')
vishdhad3ec1c12020-03-24 11:31:41 +053017 ],
18 'Sales Order': [
19 dict(fieldname='exempt_from_sales_tax', fieldtype='Check', insert_after='taxes_and_charges',
20 label='Is customer exempted from sales tax?')
21 ],
22 'Sales Invoice': [
23 dict(fieldname='exempt_from_sales_tax', fieldtype='Check', insert_after='taxes_section',
24 label='Is customer exempted from sales tax?')
25 ],
26 'Customer': [
27 dict(fieldname='exempt_from_sales_tax', fieldtype='Check', insert_after='represents_company',
28 label='Is customer exempted from sales tax?')
29 ],
30 'Quotation': [
31 dict(fieldname='exempt_from_sales_tax', fieldtype='Check', insert_after='taxes_and_charges',
32 label='Is customer exempted from sales tax?')
Tyler Matteson53a64922019-01-17 14:04:01 -050033 ]
34 }
Deepesh Garg9df45322020-06-11 21:33:43 +053035 create_custom_fields(custom_fields, update=update)
Tyler Matteson53a64922019-01-17 14:04:01 -050036
Tyler Matteson53a64922019-01-17 14:04:01 -050037def add_print_formats():
38 frappe.reload_doc("regional", "print_format", "irs_1099_form")
barredterra1521b312021-03-03 12:33:48 +010039 frappe.db.set_value("Print Format", "IRS 1099 Form", "disabled", 0)