* refactor(queries): migrate item_query to Query Builder
Use Frappe Query Builder to ensure compatibility with PostgreSQL.
The implementation still relies on raw SQL for fcond and mcond through
LiteralValue to maintain compatibility with legacy filter builders.
* refactor(queries): migrate item_query to Query Builder
Fix the bugs found by coderabbit.
For the eol condition: PostgreSQL raises DatetimeFieldOverflow when evaluating '0000-00-00' as
a date literal, even inside NULLIF(). Added a db_type guard to skip the
zero-date condition on PostgreSQL, where it can never be stored anyway.
No generic cross-db solution found for this case; open to revisiting
* refactor(queries): Rework item_query to use get_query
Rework the item_query method to use get_query with the ignore_permissions flag at False
* refactor(controller): Fix the query builder
Fix the build query in item_query according to coderabbit
* refactor(queries): explicitly add has_variants
Explicitely add has_variants==0 to the query according to coderabbit feedback
* Revert "fix: debit credit not equal in purchase transactions for multi currency"
This reverts commit 75bcea57f4.
* Revert "test: add test case"
This reverts commit 1d30a202c3.
* Revert "fix: include rejected qty in tax (purchase receipt)"
This reverts commit 8c9a88abbe.
* fix(dashboard-trends): set default fiscal year and company before validating filters Ensure and are populated with default values
* fix(dashboard-trends): ensure fiscal_year and company are properly set before validation to avoid empty filter issues
* Update erpnext/controllers/trends.py
---------
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
* feat: add support for 'not applicable' tax in item tax templates
* refactor: remove unused imports
* fix: import NOT_APPLICABLE_TAX in get_item_tax_map function
* fix: add item wise tax details for not applicable taxes
* test: added test case for `not_applicable`
* fix: do not create item wise tax details for not applicable tax
* fix: ensure tax rate is set to 0 for not applicable tax rows
* refactor: changes as per review
* test: update selling settings
* test: correct settings
* fix: return both net and current tax amounts for not applicable tax