fix: fixed company field, updated patch
(cherry picked from commit 7f2d304f32fdf580a354c1dbba58189cdd4f35f2) # Conflicts: # erpnext/patches.txt
This commit is contained in:
parent
e51c4ba8a9
commit
d2915c6bc7
@ -11,14 +11,14 @@ frappe.ui.form.on('TaxJar Settings', {
|
||||
frm.set_query('shipping_account_head', function() {
|
||||
return {
|
||||
filters: {
|
||||
'company': frm.doc.current_company
|
||||
'company': frm.doc.company
|
||||
}
|
||||
};
|
||||
});
|
||||
frm.set_query('tax_account_head', function() {
|
||||
return {
|
||||
filters: {
|
||||
'company': frm.doc.current_company
|
||||
'company': frm.doc.company
|
||||
}
|
||||
};
|
||||
});
|
||||
|
@ -14,7 +14,6 @@
|
||||
"cb_keys",
|
||||
"sandbox_api_key",
|
||||
"configuration",
|
||||
"current_company",
|
||||
"column_break_10",
|
||||
"tax_account_head",
|
||||
"configuration_cb",
|
||||
@ -103,12 +102,6 @@
|
||||
"options": "TaxJar Nexus",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "current_company",
|
||||
"fieldtype": "Link",
|
||||
"label": "Company",
|
||||
"options": "Company"
|
||||
},
|
||||
{
|
||||
"fieldname": "configuration_cb",
|
||||
"fieldtype": "Column Break"
|
||||
@ -120,7 +113,7 @@
|
||||
],
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2021-11-08 14:40:15.684224",
|
||||
"modified": "2021-11-08 17:57:17.323275",
|
||||
"modified_by": "Administrator",
|
||||
"module": "ERPNext Integrations",
|
||||
"name": "TaxJar Settings",
|
||||
|
@ -6,7 +6,7 @@ from frappe import _
|
||||
from frappe.contacts.doctype.address.address import get_company_address
|
||||
from frappe.utils import cint, flt
|
||||
|
||||
from erpnext import get_default_company
|
||||
from erpnext import get_default_company, get_region
|
||||
|
||||
TAX_ACCOUNT_HEAD = frappe.db.get_single_value("TaxJar Settings", "tax_account_head")
|
||||
SHIP_ACCOUNT_HEAD = frappe.db.get_single_value("TaxJar Settings", "shipping_account_head")
|
||||
@ -19,7 +19,6 @@ SUPPORTED_STATE_CODES = ['AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', '
|
||||
'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE',
|
||||
'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD',
|
||||
'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY']
|
||||
USA_COMPANIES = frappe.get_all('Company', filters = {'country': 'United States'}, fields=['name'], pluck='name')
|
||||
|
||||
|
||||
|
||||
@ -160,8 +159,7 @@ def set_sales_tax(doc, method):
|
||||
if not TAXJAR_CALCULATE_TAX:
|
||||
return
|
||||
|
||||
taxjar_settings_company = frappe.db.get_single_value('TaxJar Settings','current_company')
|
||||
if taxjar_settings_company not in USA_COMPANIES:
|
||||
if get_region(doc.company):
|
||||
return
|
||||
|
||||
if not doc.items:
|
||||
|
@ -283,8 +283,12 @@ erpnext.patches.v13_0.reset_clearance_date_for_intracompany_payment_entries
|
||||
erpnext.patches.v13_0.einvoicing_deprecation_warning
|
||||
execute:frappe.reload_doc("erpnext_integrations", "doctype", "TaxJar Settings")
|
||||
execute:frappe.reload_doc("erpnext_integrations", "doctype", "Product Tax Category")
|
||||
<<<<<<< HEAD
|
||||
erpnext.patches.v13_0.custom_fields_for_taxjar_integration
|
||||
erpnext.patches.v14_0.delete_einvoicing_doctypes
|
||||
=======
|
||||
erpnext.patches.v13_0.custom_fields_for_taxjar_integration #08-11-2021
|
||||
>>>>>>> 7f2d304f32 (fix: fixed company field, updated patch)
|
||||
erpnext.patches.v13_0.set_operation_time_based_on_operating_cost
|
||||
erpnext.patches.v13_0.validate_options_for_data_field
|
||||
erpnext.patches.v13_0.create_gst_payment_entry_fields
|
||||
|
@ -30,7 +30,7 @@ def execute():
|
||||
label='Product Tax Category')
|
||||
],
|
||||
'TaxJar Settings': [
|
||||
dict(fieldname='current_company', fieldtype='Link', insert_after='configuration', options='Company',
|
||||
dict(fieldname='company', fieldtype='Link', insert_after='configuration', options='Company',
|
||||
label='Company')
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user