blob: cae28bee8bc8a1b69404c12ef32f52accfa08292 [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?')
17 ]
18 }
Deepesh Garg9df45322020-06-11 21:33:43 +053019 create_custom_fields(custom_fields, update=update)
Tyler Matteson53a64922019-01-17 14:04:01 -050020
Tyler Matteson53a64922019-01-17 14:04:01 -050021def add_print_formats():
22 frappe.reload_doc("regional", "print_format", "irs_1099_form")
23 frappe.db.sql(""" update `tabPrint Format` set disabled = 0 where
24 name in('IRS 1099 Form') """)