chore: updated education config
diff --git a/erpnext/regional/united_states/__init__.py b/erpnext/regional/united_states/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/regional/united_states/__init__.py
diff --git a/erpnext/regional/united_states/address_template.html b/erpnext/regional/united_states/address_template.html
new file mode 100644
index 0000000..089315e
--- /dev/null
+++ b/erpnext/regional/united_states/address_template.html
@@ -0,0 +1,4 @@
+{{ address_line1 }}<br>
+{% if address_line2 %}{{ address_line2 }}<br>{% endif -%}
+{{ city }}, {% if state %}{{ state }}{% endif -%}{% if pincode %} {{ pincode }}<br>{% endif -%}
+{% if country != "United States" %}{{ country|upper }}{% endif -%}
diff --git a/erpnext/regional/united_states/setup.py b/erpnext/regional/united_states/setup.py
new file mode 100644
index 0000000..cb82b63
--- /dev/null
+++ b/erpnext/regional/united_states/setup.py
@@ -0,0 +1,42 @@
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
+
+
+def setup(company=None, patch=True):
+ make_custom_fields()
+ add_print_formats()
+ update_address_template()
+
+
+def make_custom_fields():
+ custom_fields = {
+ 'Supplier': [
+ dict(fieldname='irs_1099', fieldtype='Check', insert_after='tax_id',
+ label='Is IRS 1099 reporting required for supplier?')
+ ]
+ }
+ create_custom_fields(custom_fields)
+
+
+def add_print_formats():
+ frappe.reload_doc("regional", "print_format", "irs_1099_form")
+ frappe.db.sql(""" update `tabPrint Format` set disabled = 0 where
+ name in('IRS 1099 Form') """)
+
+
+def update_address_template():
+ html = """{{ address_line1 }}<br>
+ {% if address_line2 %}{{ address_line2 }}<br>{% endif -%}
+ {{ city }}, {% if state %}{{ state }}{% endif -%}{% if pincode %} {{ pincode }}<br>{% endif -%}
+ {% if country != "United States" %}{{ country|upper }}{% endif -%}
+ """
+
+ address_template = frappe.db.get_value('Address Template', 'United States')
+ if address_template:
+ frappe.db.set_value('Address Template', 'United States', 'template', html)
+ else:
+ frappe.get_doc(dict(doctype='Address Template', country='United States', template=html)).insert()
diff --git a/erpnext/regional/united_states/test_united_states.py b/erpnext/regional/united_states/test_united_states.py
new file mode 100644
index 0000000..688f145
--- /dev/null
+++ b/erpnext/regional/united_states/test_united_states.py
@@ -0,0 +1,56 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
+import frappe
+import unittest
+from erpnext.regional.report.irs_1099.irs_1099 import execute as execute_1099_report
+
+
+class TestUnitedStates(unittest.TestCase):
+ def test_irs_1099_custom_field(self):
+
+ if not frappe.db.exists("Supplier", "_US 1099 Test Supplier"):
+ doc = frappe.new_doc("Supplier")
+ doc.supplier_name = "_US 1099 Test Supplier"
+ doc.supplier_group = "Services"
+ doc.supplier_type = "Company"
+ doc.country = "United States"
+ doc.tax_id = "04-1234567"
+ doc.irs_1099 = 1
+ doc.save()
+ frappe.db.commit()
+ supplier = frappe.get_doc('Supplier', "_US 1099 Test Supplier")
+ self.assertEqual(supplier.irs_1099, 1)
+
+ def test_irs_1099_report(self):
+ make_payment_entry_to_irs_1099_supplier()
+ filters = frappe._dict({"fiscal_year": "_Test Fiscal Year 2016", "company": "_Test Company"})
+ columns, data = execute_1099_report(filters)
+ print(columns, data)
+ expected_row = {'supplier': '_US 1099 Test Supplier',
+ 'supplier_group': 'Services',
+ 'payments': 100.0,
+ 'tax_id': '04-1234567'}
+ self.assertEqual(data[0], expected_row)
+
+
+def make_payment_entry_to_irs_1099_supplier():
+
+ frappe.db.sql("delete from `tabGL Entry` where party='_US 1099 Test Supplier'")
+ frappe.db.sql("delete from `tabGL Entry` where against='_US 1099 Test Supplier'")
+ frappe.db.sql("delete from `tabPayment Entry` where party='_US 1099 Test Supplier'")
+
+ pe = frappe.new_doc("Payment Entry")
+ pe.payment_type = "Pay"
+ pe.company = "_Test Company"
+ pe.posting_date = "2016-01-10"
+ pe.paid_from = "_Test Bank USD - _TC"
+ pe.paid_to = "_Test Payable USD - _TC"
+ pe.paid_amount = 100
+ pe.received_amount = 100
+ pe.reference_no = "For IRS 1099 testing"
+ pe.reference_date = "2016-01-10"
+ pe.party_type = "Supplier"
+ pe.party = "_US 1099 Test Supplier"
+ pe.insert()
+ pe.submit()