Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item Tax Template NOT Filter Properly in Sales Invoice #42115

Open
osman-yasser opened this issue Jun 30, 2024 · 1 comment
Open

Item Tax Template NOT Filter Properly in Sales Invoice #42115

osman-yasser opened this issue Jun 30, 2024 · 1 comment
Labels

Comments

@osman-yasser
Copy link

Information about bug

I go throw the code for the filtration of Item Tax Template in Sales Invoice and encounter a function called is_within_valid_range in apps/erpnext/erpnext/stock/get_item_details.py

The implementation for function:

def is_within_valid_range(args, tax):
	if not flt(tax.maximum_net_rate):
		# No range specified, just ignore
		return True
	elif flt(tax.minimum_net_rate) <= flt(args.get("base_net_rate")) <= flt(tax.maximum_net_rate):
		return True

	return False

In the elif block the system compare the tax.minimum_net_rate and tax.maximum_net_rate with args.get("base_net_rate") but when I see if base_net_rate in args dict I found that the key never there and never put in the args dict from the first call to filter function

Code Flow:

  1. sales_common.js
  2. transaction.js
  3. queries.py
  4. get_item_details.py
  5. get_item_details.py

So, When I have to choose an Item Tax Template for an Item in Sales Invoice there nothing to choose from.

I suggest to add new key in filters variable in transaction.js called base_net_rate and handle this key to be part of args that passed to _get_item_tax_template in get_tax_template

I can create PR by this

Module

stock

Version

Frappe Framework: v15.32.0 (version-15)
ERPNext: v15.28.2 (version-15)

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

No response

@Nihantra-Patel
Copy link
Contributor

Nihantra-Patel commented Jul 1, 2024

Please submit the PR. If it's valid, it will be accepted. Also, include a video showing the issue before and after the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants