Commit Graph

58192 Commits

Author SHA1 Message Date
Mihir Kandoi
b71eacd6b3 fix: invalid filter on item_group (#55186) 2026-05-22 16:44:09 +05:30
Loic Oberle
8fb962e50e refactor(supplier_scorecard_variable):replace sql with query builder (#55168) 2026-05-22 10:44:30 +00:00
Loic Oberle
1b23ef2ff4 refactor(request_for_quotation): use query builder instead of SQL (#55172) 2026-05-22 16:11:48 +05:30
Loic Oberle
f5899b5519 refactor(supplier_scorecard):replace sql with orm (#55161) 2026-05-22 16:11:04 +05:30
Loic Oberle
30ba93fb8f refactor(supplier_quotation): Replace SQL by the orm (#55155) 2026-05-22 16:10:40 +05:30
Loic Oberle
e7c4fb85f8 refactor(request_for_quotation): Use query builder instead of SQL (#55171) 2026-05-22 16:10:18 +05:30
Loic Oberle
1135429181 refactor(territory_wise_sales):replace sql with orm (#55177) 2026-05-22 10:39:41 +00:00
Loic Oberle
f6bf7d85ad refactor(supplier_qotation): Replace sql by query builder (#55154) 2026-05-22 16:09:15 +05:30
Loic Oberle
ab99c9a54e refactor(supplier_scorecard): Replace sql with orm (#55170) 2026-05-22 16:07:12 +05:30
Loic Oberle
e75de4d337 refactor(supplier_scorecard_variable): replace sql with query builder (#55167) 2026-05-22 16:06:30 +05:30
Loic Oberle
2eb2defd90 refactor(supplier_scorecard_variable): replace sql with query builder (#55163) 2026-05-22 16:06:04 +05:30
Loic Oberle
82d19677ed refactor(supplier_scorecard_variable): replace sql with query builder (#55164) 2026-05-22 16:05:33 +05:30
Loic Oberle
b84ec2d22a refactor(territory_wise_sales): replace SQL with query builder (#55176) 2026-05-22 16:04:18 +05:30
rohitwaghchaure
719cf8a48f Merge pull request #55091 from rohitwaghchaure/fixed-job-card-pending-qty
feat: pending qty in job card
2026-05-22 15:21:44 +05:30
Loic Oberle
1bc8d02cef refactor(queries): migrate item_query to Query Builder (#54834)
* 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
2026-05-22 09:42:06 +00:00
rohitwaghchaure
8915095804 Merge pull request #55159 from rohitwaghchaure/fixed-slow-query
fix: slow query
2026-05-22 14:46:19 +05:30
Nishka Gosalia
ace4e45cfe fix: edit stock uom qty for purchase documents (#55135) 2026-05-22 14:23:24 +05:30
Nihantra C. Patel
9eeccecd30 perf: skip delink_original_entry during cancellation when Immutable Ledger is enabled (#55130)
* perf: get payment ledger and remove update from delink when immutable ledger is enabled

* revert: changes of get_payment_ledger_entries

* perf: skip delink_original_entry during cancellation when Immutable Ledger is enabled

* test: for immutable ledger

* test: add posting_date in create_sales_invoice

* fix: link validation err with immutable ledger on

* test: update testcase of the immutable ledger

* refactor(test): simpler test for immutable invariants

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2026-05-22 12:32:53 +05:30
Rohit Waghchaure
d44f574581 fix: slow query 2026-05-22 11:41:13 +05:30
rohitwaghchaure
ebcdcfcd84 Merge pull request #53679 from aerele/feat/SDBNB-account
feat: add Stock Delivered But Not Billed (SDBNB) accounting for DN and SI
2026-05-22 08:41:39 +05:30
kavin-114
91026fbdb3 fix: classify Stock Delivered But Not Billed as a Current Asset
This account holds a debit balance (inventory value delivered but not yet
invoiced) and clears to COGS on Sales Invoice, so it is economically a
short-term clearing asset rather than a trade payable. Move it from the
Stock Liabilities group to Stock Assets under Current Assets, with
account_category "Stock Assets" (and account_number 1420 in the numbered
chart). The account_type "Stock Delivered But Not Billed" is unchanged,
so posting logic in Sales Invoice and Delivery Note continues to key off
the correct account.
2026-05-22 06:50:23 +05:30
rohitwaghchaure
61547fff44 chore: fixed test case 2026-05-22 06:50:23 +05:30
Rohit Waghchaure
ba1f40fdd9 fix: posting date and time 2026-05-22 06:50:23 +05:30
Pugazhendhi Velu
9ff3e28f5d fix: validate expense account for items linked to sales invoice 2026-05-22 06:50:23 +05:30
kavin-114
78993c1ebe fix: update cost center tests to use dynamic expense account
Existing tests hardcoded "Cost of Goods Sold" as expected GL account,
but SDBNB overrides it on DN submission. Use dn.items[0].expense_account
to work with both SDBNB-enabled and legacy companies.
2026-05-22 06:50:23 +05:30
kavin-114
6ee7dc0b49 test: add unit test cases for Stock Delivered But Not Billed 2026-05-22 06:50:23 +05:30
kavin-114
05877140d1 feat: handle post delivery invoices gl reposting 2026-05-22 01:13:12 +05:30
Pugazhendhi Velu
3364ee9274 feat(stock): add Stock Delivered But Not Billed GL entries on Delivery Note and Sales Invoice 2026-05-22 01:13:12 +05:30
Pugazhendhi Velu
8596d98ac4 feat(accounts): add Stock Delivered But Not Billed account type and defaults 2026-05-22 01:13:12 +05:30
Pugazhendhi Velu
bb5d4d8682 feat(company): add Stock Delivered But Not Billed account configuration 2026-05-22 01:13:12 +05:30
Khushi Rawat
8ea7efc01d Merge pull request #55146 from khushi8112/payment-entry-foreign-currency-remarks
fix: correct remarks for foreign currency payment entries
2026-05-21 20:11:38 +05:30
Khushi Rawat
23b5afc5de Merge pull request #54946 from Shllokkk/letter-head-fix
feat(company): add a default_letter_head_report field in company doctype
2026-05-21 20:05:56 +05:30
rohitwaghchaure
160b92f9cd Merge pull request #54466 from rohitwaghchaure/revamp-stock-entry
refactor: stock_entry file to improve readability and maintainability
2026-05-21 19:47:04 +05:30
Rohit Waghchaure
1be92f6d05 refactor: better timer and complete button 2026-05-21 19:45:10 +05:30
Khushi Rawat
70b9f549a4 Merge pull request #55147 from khushi8112/debit-note-rate-adjustment-description
fix: correct description for Is Rate Adjustment Entry (Debit Note) checkbox
2026-05-21 18:06:51 +05:30
Rohit Waghchaure
0a215b0717 refactor: job_card.js code for better readability 2026-05-21 17:46:29 +05:30
Rohit Waghchaure
db64f451c1 feat: pending qty in job card 2026-05-21 17:46:24 +05:30
khushi8112
92c969478e fix: correct description for Is Rate Adjustment Entry (Debit Note) checkbox 2026-05-21 17:33:59 +05:30
khushi8112
c6cde700b5 fix: correct remarks for foreign currency payment entries 2026-05-21 17:25:55 +05:30
Rohit Waghchaure
068f7b9a8d refactor: split large functions into smaller functions 2026-05-21 17:12:59 +05:30
Khushi Rawat
83f100bae1 Merge pull request #55142 from khushi8112/composite-asset-net-purchase-amount-reset
fix: don't reset net_purchase_amount for Composite Asset if already set
2026-05-21 17:07:41 +05:30
khushi8112
98dae6e43a fix: don't reset net_purchase_amount for Composite Asset if already set 2026-05-21 17:04:33 +05:30
diptanilsaha
18bdd0afd3 Merge pull request #55127 from diptanilsaha/fix/tax-rule-date-filter
refactor: migrate get_tax_template to query builder with hierarchical group matching
2026-05-21 17:04:02 +05:30
diptanilsaha
8c43118725 test: add tests for supplier group hierarchy and use_for_shopping_cart filter
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:43:00 +05:30
diptanilsaha
4d43c74f5f fix: default use_for_shopping_cart to 0 in set_taxes
Ensures regular transactions only match tax rules where
use_for_shopping_cart = 0, preventing webshop-specific rules
from applying to standard documents.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:43:00 +05:30
diptanilsaha
f98975f51a refactor: rewrite get_tax_template using query builder
Migrates from raw frappe.db.sql with string interpolation to frappe.qb.
Adds hierarchical supplier_group matching (mirrors customer_group behaviour).
Removes unused get_customer_group_condition helper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:43:00 +05:30
diptanilsaha
cb610b79d2 feat: add get_parent_supplier_groups using query builder
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:42:56 +05:30
diptanilsaha
91a2a7b0a0 refactor: migrate get_parent_customer_groups to query builder
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:41:53 +05:30
rohitwaghchaure
8aaa7c0993 Merge pull request #55134 from rohitwaghchaure/fixed-removed-redundant-code
fix: removed redundant code
2026-05-21 15:24:41 +05:30
khushi8112
1fd99337b3 fix: use get_query instead of get_all for data fetching 2026-05-21 15:05:44 +05:30