mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 14:39:19 +00:00
fix: fixed company field, updated patch
(cherry picked from commit 7f2d304f32)
This commit is contained in:
@@ -11,14 +11,14 @@ frappe.ui.form.on('TaxJar Settings', {
|
|||||||
frm.set_query('shipping_account_head', function() {
|
frm.set_query('shipping_account_head', function() {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
'company': frm.doc.current_company
|
'company': frm.doc.company
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
frm.set_query('tax_account_head', function() {
|
frm.set_query('tax_account_head', function() {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
'company': frm.doc.current_company
|
'company': frm.doc.company
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
"cb_keys",
|
"cb_keys",
|
||||||
"sandbox_api_key",
|
"sandbox_api_key",
|
||||||
"configuration",
|
"configuration",
|
||||||
"current_company",
|
|
||||||
"column_break_10",
|
"column_break_10",
|
||||||
"tax_account_head",
|
"tax_account_head",
|
||||||
"configuration_cb",
|
"configuration_cb",
|
||||||
@@ -103,12 +102,6 @@
|
|||||||
"options": "TaxJar Nexus",
|
"options": "TaxJar Nexus",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "current_company",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Company",
|
|
||||||
"options": "Company"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "configuration_cb",
|
"fieldname": "configuration_cb",
|
||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
@@ -120,7 +113,7 @@
|
|||||||
],
|
],
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-11-08 14:40:15.684224",
|
"modified": "2021-11-08 17:57:17.323275",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "ERPNext Integrations",
|
"module": "ERPNext Integrations",
|
||||||
"name": "TaxJar Settings",
|
"name": "TaxJar Settings",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from frappe import _
|
|||||||
from frappe.contacts.doctype.address.address import get_company_address
|
from frappe.contacts.doctype.address.address import get_company_address
|
||||||
from frappe.utils import cint, flt
|
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")
|
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")
|
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',
|
'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',
|
'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD',
|
||||||
'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY']
|
'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:
|
if not TAXJAR_CALCULATE_TAX:
|
||||||
return
|
return
|
||||||
|
|
||||||
taxjar_settings_company = frappe.db.get_single_value('TaxJar Settings','current_company')
|
if get_region(doc.company):
|
||||||
if taxjar_settings_company not in USA_COMPANIES:
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if not doc.items:
|
if not doc.items:
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ erpnext.patches.v13_0.migrate_stripe_api
|
|||||||
erpnext.patches.v13_0.reset_clearance_date_for_intracompany_payment_entries
|
erpnext.patches.v13_0.reset_clearance_date_for_intracompany_payment_entries
|
||||||
execute:frappe.reload_doc("erpnext_integrations", "doctype", "TaxJar Settings")
|
execute:frappe.reload_doc("erpnext_integrations", "doctype", "TaxJar Settings")
|
||||||
execute:frappe.reload_doc("erpnext_integrations", "doctype", "Product Tax Category")
|
execute:frappe.reload_doc("erpnext_integrations", "doctype", "Product Tax Category")
|
||||||
erpnext.patches.v13_0.custom_fields_for_taxjar_integration
|
erpnext.patches.v13_0.custom_fields_for_taxjar_integration #08-11-2021
|
||||||
erpnext.patches.v13_0.set_operation_time_based_on_operating_cost
|
erpnext.patches.v13_0.set_operation_time_based_on_operating_cost
|
||||||
erpnext.patches.v13_0.validate_options_for_data_field
|
erpnext.patches.v13_0.validate_options_for_data_field
|
||||||
erpnext.patches.v13_0.create_website_items #30-09-2021
|
erpnext.patches.v13_0.create_website_items #30-09-2021
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ def execute():
|
|||||||
label='Product Tax Category')
|
label='Product Tax Category')
|
||||||
],
|
],
|
||||||
'TaxJar Settings': [
|
'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')
|
label='Company')
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user