mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
fix: Item Tax Template
This commit is contained in:
@@ -570,7 +570,8 @@ def get_tax_template(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
args = {
|
args = {
|
||||||
'item_code': filters.get('item_code'),
|
'item_code': filters.get('item_code'),
|
||||||
'posting_date': filters.get('valid_from'),
|
'posting_date': filters.get('valid_from'),
|
||||||
'tax_category': filters.get('tax_category')
|
'tax_category': filters.get('tax_category'),
|
||||||
|
'company': filters.get('company')
|
||||||
}
|
}
|
||||||
|
|
||||||
taxes = _get_item_tax_template(args, taxes, for_validate=True)
|
taxes = _get_item_tax_template(args, taxes, for_validate=True)
|
||||||
|
|||||||
@@ -1835,7 +1835,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
|
|
||||||
if (doc.tax_category)
|
if (doc.tax_category)
|
||||||
filters['tax_category'] = doc.tax_category;
|
filters['tax_category'] = doc.tax_category;
|
||||||
|
if (doc.company)
|
||||||
|
filters['company'] = doc.company;
|
||||||
return {
|
return {
|
||||||
query: "erpnext.controllers.queries.get_tax_template",
|
query: "erpnext.controllers.queries.get_tax_template",
|
||||||
filters: filters
|
filters: filters
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
|
||||||
"creation": "2013-02-22 01:28:01",
|
"creation": "2013-02-22 01:28:01",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
@@ -7,7 +6,8 @@
|
|||||||
"field_order": [
|
"field_order": [
|
||||||
"item_tax_template",
|
"item_tax_template",
|
||||||
"tax_category",
|
"tax_category",
|
||||||
"valid_from"
|
"valid_from",
|
||||||
|
"company"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -34,12 +34,19 @@
|
|||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Valid From"
|
"label": "Valid From"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fetch_from": "item_tax_template.company",
|
||||||
|
"fieldname": "company",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Company",
|
||||||
|
"options": "Company"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"modified": "2020-06-18 02:30:44.610171",
|
||||||
"modified": "2019-12-28 21:54:40.807849",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Item Tax",
|
"name": "Item Tax",
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ def _get_item_tax_template(args, taxes, out={}, for_validate=False):
|
|||||||
taxes_with_no_validity = []
|
taxes_with_no_validity = []
|
||||||
|
|
||||||
for tax in taxes:
|
for tax in taxes:
|
||||||
if tax.valid_from:
|
if tax.valid_from and tax.company == args['company']:
|
||||||
# In purchase Invoice first preference will be given to supplier invoice date
|
# In purchase Invoice first preference will be given to supplier invoice date
|
||||||
# if supplier date is not present then posting date
|
# if supplier date is not present then posting date
|
||||||
validation_date = args.get('transaction_date') or args.get('bill_date') or args.get('posting_date')
|
validation_date = args.get('transaction_date') or args.get('bill_date') or args.get('posting_date')
|
||||||
|
|||||||
Reference in New Issue
Block a user