fix: Item Tax Template

This commit is contained in:
mohammadahmad1990 2020-06-18 11:18:44 +05:00
parent 4bff9d8663
commit 41c0c9f46b
4 changed files with 16 additions and 7 deletions

View File

@ -570,7 +570,8 @@ def get_tax_template(doctype, txt, searchfield, start, page_len, filters):
args = {
'item_code': filters.get('item_code'),
'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)

View File

@ -1835,7 +1835,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
if (doc.tax_category)
filters['tax_category'] = doc.tax_category;
if (doc.company)
filters['company'] = doc.company;
return {
query: "erpnext.controllers.queries.get_tax_template",
filters: filters

View File

@ -1,5 +1,4 @@
{
"actions": [],
"creation": "2013-02-22 01:28:01",
"doctype": "DocType",
"editable_grid": 1,
@ -7,7 +6,8 @@
"field_order": [
"item_tax_template",
"tax_category",
"valid_from"
"valid_from",
"company"
],
"fields": [
{
@ -34,12 +34,19 @@
"fieldtype": "Date",
"in_list_view": 1,
"label": "Valid From"
},
{
"fetch_from": "item_tax_template.company",
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"options": "Company"
}
],
"idx": 1,
"istable": 1,
"links": [],
"modified": "2019-12-28 21:54:40.807849",
"modified": "2020-06-18 02:30:44.610171",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item Tax",

View File

@ -442,7 +442,7 @@ def _get_item_tax_template(args, taxes, out={}, for_validate=False):
taxes_with_no_validity = []
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
# 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')