Commit Graph

60483 Commits

Author SHA1 Message Date
Mihir Kandoi
4cd1b6a8bf fix: revalue batch reco slots only when the entry covers the full batch
stock_value_difference / qty equals the new batch rate only when the
reco entry carries the entire batch, as the split out/in reco SLEs and
batches reconciled from zero do. Partial direct-batch_no entries mix a
qty delta with existing stock, so their slots keep prior values.

Plain items need no such guard: the valuation engine collapses the
FIFO stack to qty_after * valuation_rate on every reconciliation, so
rescaling remaining slots at the reco rate matches the ledger. Lock
that with a test.
2026-07-21 14:09:28 +05:30
Mihir Kandoi
3ce31be80a fix: rescale batch FIFO slot values on stock reconciliation
Batch items take the batch-slot path, which mirrors the same value
arithmetic: the reco's incoming entry dumps the revaluation remainder
on one slot. Rescale each reconciled batch's slots at its post-reco
rate (stock_value_difference / qty of the incoming bundle entry).
2026-07-21 13:49:21 +05:30
Mihir Kandoi
7a68e8bf4d fix: rescale stock ageing FIFO slot values on stock reconciliation
A reconciliation's stock_value_difference includes the revaluation of
stock already in the FIFO queue, but the whole amount was attached to
the qty-delta slot while older slots kept pre-revaluation values. A
downward revaluation therefore produced negative bucket values in the
Stock Ageing report, and repeated recos let the queue total drift away
from Stock Balance.

Re-derive every slot value as qty * valuation_rate after processing a
reco SLE, since a reconciliation values the entire balance at its rate.
Covers both single-SLE recos and the zero-out/re-add pair that flows
through the transfer bucket.
2026-07-21 13:44:36 +05:30
Shllokkk
98d58bcd6a fix: sync process loss percentage when fg qty changes (#57063) 2026-07-21 07:32:43 +00:00
Henil Maru
83e04dd773 fix: show transaction currency symbol in Payment Request schedule dialog and reference table (#57050)
* fix: show transaction currency symbol in Payment Request schedule dialog and reference table

When company currency (INR) differs from customer currency (USD), the Amount
column in the Select Payment Schedule dialog and the Payment Reference table on
the Payment Request form incorrectly displayed the company currency symbol (₹)
instead of the transaction currency symbol ($).

- Pass `currency` from the parent document on each schedule row returned by
  `get_available_payment_schedules` so the dialog can resolve the symbol.
- Add a hidden `currency` field to the dialog table and set `options: "currency"`
  on `payment_amount` so Frappe renders the correct symbol.
- Propagate `currency` into Payment Reference rows in `set_payment_references`.
- Add a hidden `currency` Link field to the Payment Reference child DocType and
  set `options: "currency"` on its `amount` field so the table renders correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: preserve currency when serializing payment schedule rows

get_available_payment_schedules set `schedule.currency` directly on
the Payment Schedule Document row, but `currency` isn't a field on
that DocType, so the API response serializer stripped it before it
reached the client. The Select Payment Schedule dialog and the
Payment Reference table therefore always fell back to the company
currency symbol, even with the earlier options="currency" changes in
place.

Convert each row to a plain dict via as_dict() first, then set the
currency key on the dict so it survives serialization.

* refactor: source schedule currency in dialog instead of API serializer

get_available_payment_schedules had to convert each child row with
as_dict() and re-attach currency, because currency is not a field on
Payment Schedule and the response serializer drops attributes set on the
Document itself.

The schedule dialog already has the transaction currency on frm.doc, so
set it there and let the API keep returning the schedule rows unchanged.
Payment Reference still stores currency per row.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Jatin3128 <jatinsarna8@gmail.com>
Co-authored-by: Jatin3128 <140256508+Jatin3128@users.noreply.github.com>
2026-07-21 11:58:38 +05:30
Diptanil Saha
8327f19ebf ci: fix zh two_letters_code mapping (#57307) 2026-07-21 01:06:14 +05:30
MochaMind
ab6931279d fix: sync translations from crowdin (#57259) 2026-07-21 00:41:52 +05:30
Soham Kulkarni
9d5e3be0b3 Merge pull request #57305 from frappe/revert-57292-customer
Revert "fix: mark selling as default workspace for customer"
2026-07-21 00:01:04 +05:30
Soham Kulkarni
58b839eb71 Revert "fix: mark selling as default workspace for customer" 2026-07-20 21:44:49 +05:30
Mihir Kandoi
1b36459d2b Merge pull request #57301 from mihir-kandoi/stock-summary-bin-qty-fields
feat(stock): expose all Bin qty fields in Stock Summary and Stock Projected Qty
2026-07-20 20:17:25 +05:30
Mihir Kandoi
e146c318e5 Merge pull request #57300 from mihir-kandoi/bin-recalculate-values
feat: recalculate valuation rate and stock value from Bin
2026-07-20 20:10:07 +05:30
Mihir Kandoi
59c0c15c2e feat(stock): expose all Bin qty fields in Stock Summary and Stock Projected Qty
Stock Summary's sort selector only offered 5 of Bin's 10 qty fields; add
the rest (ordered, requested, planned, reserved for production plan,
reserved stock) and extend get_data's or_filters so bins whose only
nonzero qty is one of the new fields show up when sorted by it. Sort
labels now mirror Bin field labels.

Stock Projected Qty report had a column for every Bin qty field except
reserved_stock; add it.
2026-07-20 20:05:37 +05:30
Mihir Kandoi
49a43aad81 fix: keep Standard Cost stock value in step with the standard rate
Mirrors update_qty's Standard Cost handling and drops fixed test item
names so reruns start from fresh SLE-less items.
2026-07-20 19:59:13 +05:30
Mihir Kandoi
df79e85f53 feat: recalculate valuation rate and stock value from Bin
Renames the Recalculate Bin Qty button to Recalculate Values and sets
valuation_rate and stock_value from the last SLE (0 when none exists).
2026-07-20 19:48:10 +05:30
Nabin Hait
7d351153bb feat: warn when a draft linked document already exists
When creating a follow-up document (SO->DN, PO->PR, PI->Payment Entry,
etc.), warn the user if a draft of the target doctype already linked to
the source document exists, with links to the drafts and the option to
proceed anyway.

The target doctype comes from the make_mapped_doc response via the new
frappe.model.add_mapped_doc_guard hook, so every open_mapped_doc flow is
covered without per-doctype code or method-name inference. The server
lookup walks parent-level and child-table Link / Dynamic Link fields of
the target doctype and queries through frappe.get_list, so role and user
permissions apply and docstatus filtering happens in the query itself.
Payment Entry creation bypasses open_mapped_doc, so its controller runs
the same guard explicitly.
2026-07-20 18:37:24 +05:30
Jatin3128
b917aca361 refactor: clearer labels for the overdue billing control (#57298)
refactor: clearer labels and messages, drop "threshold" wording

User-facing text only, no field or behaviour changes:

- Accounts Settings toggle label -> "Restrict Customer Over Billing".
- Bypass role label -> "Role Allowed to Bypass Over Billing Restriction".
- Customer Credit Limit field label -> "Overdue Limit".
- Rewrote the descriptions and the block message to match and to stop
  saying "threshold".
2026-07-20 18:14:44 +05:30
Mihir Kandoi
f19216979b Merge pull request #57280 from aerele/timesheet_group_by
fix(report): handle nonetype error in timesheet billing summary group…
2026-07-20 17:43:31 +05:30
Deepesh Garg
3b10ff7df7 fix: Ignore permission while deleting user permission 2026-07-20 17:05:21 +05:30
Diptanil Saha
73004c6e4b refactor: rework appointment booking lifecycle and portal verification (#57270)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 16:35:58 +05:30
Soham Kulkarni
e728c24b80 Merge pull request #57292 from sokumon/customer
fix: mark selling as default workspace for customer
2026-07-20 16:06:09 +05:30
sokumon
873bce3c46 fix: mark selling as default workspace for customer 2026-07-20 15:53:41 +05:30
Poovetha
9a7209e668 fix(report): handle nonetype error in timesheet billing summary grouping logic 2026-07-20 13:39:07 +05:30
rohitwaghchaure
4cdaa8dba6 fix: block changing Stock account type when stock ledger entries exist (#57283) 2026-07-20 13:20:10 +05:30
Mihir Kandoi
276e688949 Merge pull request #57273 from aerele/typo-fix-allow-negative-stock
fix: correct typo in allow_negative_stock parameter
2026-07-20 12:31:13 +05:30
Nishka Gosalia
ccb9b16378 Merge pull request #57274 from nishkagosalia/gh-57206
fix: project % complete field allowing modification when manual method
2026-07-20 11:46:20 +05:30
nishkagosalia
21009c18c0 fix: project % complete field allowing modification when manual method 2026-07-20 11:34:09 +05:30
Afsal Syed
b3a616c328 fix: correct typo in allow_negative_stock parameter 2026-07-20 10:52:00 +05:30
rohitwaghchaure
2eecdc48bf feat: inline serial and batch entries editor (#57216)
* feat: inline serial and batch entries editor in Purchase Receipt

* feat: grid-style UX, deferred saves, scan and range options for inline serial batch editor

* feat: extend inline serial batch editor to all bundle doctypes with auto fetch

* fix: address review comments on inline serial batch editor

* fix: escape untrusted values in inline editor alerts

* fix: clear child bundle reference only when the row owns the bundle

* fix: keep inline serial batch editor disabled on existing sites via patch
2026-07-19 19:21:09 +05:30
MochaMind
ddb094084e chore: update POT file (#57269) 2026-07-19 14:50:34 +02:00
Nabin Hait
e932105ee3 fix(selling): recompute proforma amount for all rows on qty change
Refreshing a single grid row only updates the active row, so the derived amount
for rows after the edited one went stale. Recompute every row's amount from
qty x rate and re-render the grid.
2026-07-19 12:26:34 +05:30
Nabin Hait
654c9e6ad8 style(selling): form-builder layout tweaks and label rename
- Proforma Invoice form: place Grand Total beside Total Quantity (column break)
  and minor field reorder
- Rename the tab button to "New Proforma Invoice"
- Add the Proforma Invoice client-script scaffold
2026-07-19 11:25:40 +05:30
Nabin Hait
7314cedd53 feat(selling): surface proforma settings in Selling Settings tabs
- Move the Proforma Invoice settings section from the Subcontracting Inward tab
  to the Transaction tab
- List Proforma Invoice in the Document Naming tab so its naming series can be
  configured there
2026-07-19 11:21:41 +05:30
Mihir Kandoi
1cd32b9c73 Merge pull request #57258 from mihir-kandoi/per-master-company-restriction 2026-07-18 20:39:13 +05:30
Mihir Kandoi
ea5c648ab0 refactor: gate company restrictions per master via Restrict to Companies checkbox
Replaces the Global Defaults toggle. Each Item/Customer/Supplier now
carries a Restrict to Companies checkbox: the Allowed Companies table
only shows (and is mandatory) when checked, is cleared on uncheck, and
permission filtering, read denial and write validation apply only to
masters that have the checkbox set.
2026-07-18 19:03:31 +05:30
Mihir Kandoi
4d49cfa1de Merge pull request #57256 from mihir-kandoi/fix-multi-batch-serial-stock-reco
fix: scope current serial nos to the selected batch in stock reconciliation
2026-07-18 18:56:15 +05:30
Mihir Kandoi
f43f8f75d0 fix: scope current serial nos to the selected batch in stock reconciliation
get_stock_balance_for fetched serial nos across every batch in the
warehouse, so reconciling one batch of a serial+batch item compared the
selected serials against the pool of all batches and failed whenever
multiple batches existed.
2026-07-18 16:51:46 +05:30
Mihir Kandoi
71ccc8885e Merge pull request #57253 from aerele/fix-pick-list-work-order-transferred-qty-leak
fix: exclude transferred_qty from work order item to pick list item m…
2026-07-18 14:05:55 +05:30
pandiyan
5b36f12596 fix: exclude transferred_qty from work order item to pick list item mapping
get_mapped_doc copies same-named fields by default. work order item's
transferred_qty (cumulative across the whole work order) was leaking into
the new pick list item's transferred_qty (meant to track how much of
that pick list row has been converted into a stock entry, starting at 0).

the leaked value then got subtracted again in
get_pending_transfer_stock_qty(), so every pick list after the first
under-transferred raw materials by whatever was already recorded on the
work order, driving material_transferred_for_manufacturing towards zero
across repeated partial pick-list/finish cycles.

fixes #57236, related to #56596
2026-07-18 13:36:48 +05:30
Mihir Kandoi
ca5bec2b77 Merge pull request #57249 from mihir-kandoi/ppmr
fix: add fetch from in production plan material request child table
2026-07-17 22:19:58 +05:30
Mihir Kandoi
dfc2a411e1 fix: add fetch from in production plan material request child table 2026-07-17 22:08:15 +05:30
kaulith
1aee0df79a fix: force-delete repost data file during cleanup (#57245)
* fix(stock): force-delete repost data file during cleanup

* test(stock): cover repost data file cleanup with attach guard
2026-07-17 22:07:20 +05:30
Mihir Kandoi
e0896c656c Merge pull request #57244 from mihir-kandoi/fix-clear-old-logs-orphan-references
fix: clear linked comments, versions and attachments with old logs
2026-07-17 22:06:23 +05:30
Mihir Kandoi
6a69237130 Update erpnext/utilities/__init__.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-07-17 21:53:16 +05:30
Mihir Kandoi
334346e0f8 Merge pull request #57241 from mihir-kandoi/fix-material-request-buying-price-list
fix: validate buying price list on material request and update item rates on change
2026-07-17 21:38:10 +05:30
Mihir Kandoi
3a63f61832 chore: remove unneccessary flt 2026-07-17 21:24:40 +05:30
Mihir Kandoi
1887825ce5 fix: clear linked comments, versions and attachments with old logs
Repost Item Valuation and BOM Update Log cleared old logs with a raw
delete on the parent table, orphaning timeline comments, versions,
attachments and other reference records.

Fixes #57237
2026-07-17 21:24:08 +05:30
Mihir Kandoi
1ef3cd1d3f fix: dont overwrite rate with 0 if not found 2026-07-17 21:23:49 +05:30
Mihir Kandoi
a31119353c Merge pull request #57223 from aerele/project_validation
fix(projects): include on hold status in project filters and reports
2026-07-17 20:46:11 +05:30
Mihir Kandoi
6dcc0cab3a fix: pass ctx keys get_price_list_rate_for reads, skip rate update on insert
update_item_rates passed price_not_uom_dependent, a key
get_price_list_rate_for never reads, and omitted conversion_factor, so a
stock-UOM price was never converted to the row UOM. The function's
(historically misnamed) price_list_uom_dependant ctx key carries the
Price List's price_not_uom_dependent value: truthy returns the found
rate as-is, falsy multiplies by conversion_factor.

Also guard on_update with is_new(): has_value_changed returns True when
there is no doc_before_save, so every first save re-wrote item rates.
2026-07-17 20:44:07 +05:30
Mihir Kandoi
18b15f2ca9 fix: validate buying price list on material request and update item rates on change 2026-07-17 20:44:07 +05:30