mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
* fix: TaxJar update - nexus, selective api call (cherry picked from commitb01fe1c3e2) * fix: sales_tax attribute in api call before submit (cherry picked from commit3bb60a439a) * Update erpnext/erpnext_integrations/taxjar_integration.py Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> (cherry picked from commit0e527311b9) * Update erpnext/erpnext_integrations/doctype/taxjar_settings/taxjar_settings.py Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> (cherry picked from commit486d7c3a39) * Update erpnext/erpnext_integrations/doctype/taxjar_settings/taxjar_settings.js Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> (cherry picked from commit435a5e4fa3) * Update erpnext/erpnext_integrations/taxjar_integration.py Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> (cherry picked from commit11bd42467e) * fix: Renamed child table doctype, delete taxes for non nexus state (cherry picked from commit5c18654113) * fix: updated patch, add fields only if fields are checked (cherry picked from commit54754f4eb8) # Conflicts: # erpnext/patches/v13_0/custom_fields_for_taxjar_integration.py * fix: patch fix, fields disabling (cherry picked from commit0a28fed679) * fix: using db.exists and get_value instead of get_doc (cherry picked from commit8675ca5bdd) * fix: dt instead of document in set_value query (cherry picked from commitd3bb920e71) * minor fixes (cherry picked from commit254b20bc09) * fix: improved on_update method, added validation for tax calculation, sandbox mode checks (cherry picked from commit7114659ecc) * fix: linters fix (cherry picked from commit3ece05a9f7) * fix: patch fix added reload_doctype (cherry picked from commiteaa3614155) * fix: patch fixes- force reload doc, check for company (cherry picked from commit1b25e69af4) * fix: 'Taxjar' type fix (cherry picked from commitea2038489f) * fix: Update pacthes.txt (cherry picked from commit5d4c919c5c) * fix: Patch (cherry picked from commit2d19e2d54b) # Conflicts: # erpnext/patches.txt * fix: Move product tax category folder to taxjar settings (cherry picked from commitbd8cfb2e30) * Update custom_fields_for_taxjar_integration.py * fix: conflicts * fix: linter issues removed extra line * fix: patch fix einvoicing deprecation patch removed Co-authored-by: Subin Tom <subintom2@gmail.com> Co-authored-by: Subin Tom <36098155+nemesis189@users.noreply.github.com> Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com> Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
50 lines
1.8 KiB
Python
50 lines
1.8 KiB
Python
# 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
|
|
import os
|
|
import json
|
|
from frappe.permissions import add_permission, update_permission_property
|
|
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
|
|
|
|
|
def setup(company=None, patch=True):
|
|
# Company independent fixtures should be called only once at the first company setup
|
|
if frappe.db.count('Company', {'country': 'United States'}) <=1:
|
|
setup_company_independent_fixtures(patch=patch)
|
|
|
|
def setup_company_independent_fixtures(company=None, patch=True):
|
|
make_custom_fields()
|
|
add_print_formats()
|
|
|
|
def make_custom_fields(update=True):
|
|
custom_fields = {
|
|
'Supplier': [
|
|
dict(fieldname='irs_1099', fieldtype='Check', insert_after='tax_id',
|
|
label='Is IRS 1099 reporting required for supplier?')
|
|
],
|
|
'Sales Order': [
|
|
dict(fieldname='exempt_from_sales_tax', fieldtype='Check', insert_after='taxes_and_charges',
|
|
label='Is customer exempted from sales tax?')
|
|
],
|
|
'Sales Invoice': [
|
|
dict(fieldname='exempt_from_sales_tax', fieldtype='Check', insert_after='taxes_section',
|
|
label='Is customer exempted from sales tax?')
|
|
],
|
|
'Customer': [
|
|
dict(fieldname='exempt_from_sales_tax', fieldtype='Check', insert_after='represents_company',
|
|
label='Is customer exempted from sales tax?')
|
|
],
|
|
'Quotation': [
|
|
dict(fieldname='exempt_from_sales_tax', fieldtype='Check', insert_after='taxes_and_charges',
|
|
label='Is customer exempted from sales tax?')
|
|
]
|
|
}
|
|
create_custom_fields(custom_fields, update=update)
|
|
|
|
def add_print_formats():
|
|
frappe.reload_doc("regional", "print_format", "irs_1099_form")
|
|
frappe.db.set_value("Print Format", "IRS 1099 Form", "disabled", 0)
|