diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html
index c3603290f47..5aac9d902e1 100644
--- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html
+++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html
@@ -13,7 +13,7 @@
{% endif %}
-
{{ _("STATEMENT OF ACCOUNTS") }}
+ {{ _("GENERAL LEDGER") }}
{% if filters.party[0] == filters.party_name[0] %}
{{ _("Customer: ") }} {{ filters.party_name[0] }}
diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json
index ea1b61a31d4..dd021edd7f2 100644
--- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json
+++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json
@@ -1,5 +1,6 @@
{
"actions": [],
+ "allow_rename": 1,
"autoname": "Prompt",
"creation": "2020-05-22 16:46:18.712954",
"doctype": "DocType",
@@ -69,7 +70,7 @@
"fieldname": "frequency",
"fieldtype": "Select",
"label": "Frequency",
- "options": "Weekly\nMonthly\nQuarterly"
+ "options": "Daily\nWeekly\nBiweekly\nMonthly\nQuarterly"
},
{
"fieldname": "company",
@@ -416,7 +417,7 @@
}
],
"links": [],
- "modified": "2025-09-03 14:24:43.608565",
+ "modified": "2025-10-07 12:19:20.719898",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Statement Of Accounts",
diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
index 96389f67e1e..9cf27216b1e 100644
--- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
+++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
@@ -8,7 +8,7 @@ import frappe
from frappe import _
from frappe.desk.reportview import get_match_cond
from frappe.model.document import Document
-from frappe.utils import add_days, add_months, format_date, getdate, today
+from frappe.utils import add_days, add_months, add_to_date, format_date, getdate, today
from frappe.utils.jinja import validate_template
from frappe.utils.pdf import get_pdf
from frappe.www.printview import get_print_style
@@ -55,7 +55,7 @@ class ProcessStatementOfAccounts(Document):
enable_auto_email: DF.Check
filter_duration: DF.Int
finance_book: DF.Link | None
- frequency: DF.Literal["Weekly", "Monthly", "Quarterly"]
+ frequency: DF.Literal["Daily", "Weekly", "Biweekly", "Monthly", "Quarterly"]
from_date: DF.Date | None
ignore_cr_dr_notes: DF.Check
ignore_exchange_rate_revaluation_journals: DF.Check
@@ -555,8 +555,9 @@ def send_emails(document_name, from_scheduler=False, posting_date=None):
if doc.enable_auto_email and from_scheduler:
new_to_date = getdate(posting_date or today())
- if doc.frequency == "Weekly":
- new_to_date = add_days(new_to_date, 7)
+ if doc.frequency in ("Daily", "Weekly", "Biweekly"):
+ frequency = {"Daily": 1, "Weekly": 7, "Biweekly": 14}
+ new_to_date = add_days(new_to_date, frequency[doc.frequency])
else:
new_to_date = add_months(new_to_date, 1 if doc.frequency == "Monthly" else 3)
new_from_date = add_months(new_to_date, -1 * doc.filter_duration)
diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html
index 441a4b3da43..89ea90f6eb7 100644
--- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html
+++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html
@@ -23,7 +23,7 @@
{% endif %}
-{{ _(report.report_name) }}
+{{ _("STATEMENT OF ACCOUNTS") }}
{{ filters.customer_name }}
diff --git a/erpnext/assets/doctype/asset_movement/asset_movement.py b/erpnext/assets/doctype/asset_movement/asset_movement.py
index d63492846c9..25a06e463bb 100644
--- a/erpnext/assets/doctype/asset_movement/asset_movement.py
+++ b/erpnext/assets/doctype/asset_movement/asset_movement.py
@@ -5,7 +5,7 @@
import frappe
from frappe import _
from frappe.model.document import Document
-from frappe.utils import get_link_to_form
+from frappe.utils import cstr, get_link_to_form
from erpnext.assets.doctype.asset_activity.asset_activity import add_asset_activity
@@ -143,8 +143,8 @@ class AssetMovement(Document):
def update_asset_location_and_custodian(self, asset_id, location, employee):
asset = frappe.get_doc("Asset", asset_id)
- if employee and employee != asset.custodian:
- frappe.db.set_value("Asset", asset_id, "custodian", employee)
+ if cstr(employee) != asset.custodian:
+ frappe.db.set_value("Asset", asset_id, "custodian", cstr(employee))
if location and location != asset.location:
frappe.db.set_value("Asset", asset_id, "location", location)
diff --git a/erpnext/controllers/subcontracting_controller.py b/erpnext/controllers/subcontracting_controller.py
index cf3782c7e4b..db42d11ab0a 100644
--- a/erpnext/controllers/subcontracting_controller.py
+++ b/erpnext/controllers/subcontracting_controller.py
@@ -202,6 +202,9 @@ class SubcontractingController(StockController):
self.set(self.raw_material_table, [])
return
+ if not self.get(self.raw_material_table):
+ return
+
item_dict = self.__get_data_before_save()
if not item_dict:
return True
@@ -657,6 +660,9 @@ class SubcontractingController(StockController):
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos_for_outward
from erpnext.stock.get_item_details import get_filtered_serial_nos
+ if self.is_return:
+ return
+
for row in self.supplied_items:
item_details = frappe.get_cached_value(
"Item", row.rm_item_code, ["has_batch_no", "has_serial_no"], as_dict=1
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 5008b4707d8..b038ddab615 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -1692,6 +1692,17 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
);
var company_currency = this.get_company_currency();
+
+ if (
+ this._last_company_currency === company_currency &&
+ this._last_price_list_currency === this.frm.doc.price_list_currency
+ ) {
+ return;
+ }
+
+ this._last_company_currency = company_currency;
+ this._last_price_list_currency = this.frm.doc.price_list_currency;
+
this.change_form_labels(company_currency);
this.change_grid_labels(company_currency);
this.frm.refresh_fields();
diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py
index ad8218cfcfb..7a12844f1c6 100644
--- a/erpnext/stock/doctype/batch/batch.py
+++ b/erpnext/stock/doctype/batch/batch.py
@@ -158,7 +158,7 @@ class Batch(Document):
@frappe.whitelist()
def recalculate_batch_qty(self):
- batches = get_batch_qty(batch_no=self.name, item_code=self.item)
+ batches = get_batch_qty(batch_no=self.name, item_code=self.item, for_stock_levels=True)
batch_qty = 0.0
if batches:
for row in batches:
diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py
index 386e89af49b..91bbc6abdcb 100644
--- a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py
+++ b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py
@@ -2337,15 +2337,15 @@ def get_reserved_batches_for_sre(kwargs) -> dict:
if kwargs.batch_no:
if isinstance(kwargs.batch_no, list):
- query = query.where(sb_entry.batch_no.notin(kwargs.batch_no))
+ query = query.where(sb_entry.batch_no.isin(kwargs.batch_no))
else:
- query = query.where(sb_entry.batch_no != kwargs.batch_no)
+ query = query.where(sb_entry.batch_no == kwargs.batch_no)
if kwargs.warehouse:
if isinstance(kwargs.warehouse, list):
- query = query.where(sre.warehouse.notin(kwargs.warehouse))
+ query = query.where(sre.warehouse.isin(kwargs.warehouse))
else:
- query = query.where(sre.warehouse != kwargs.warehouse)
+ query = query.where(sre.warehouse == kwargs.warehouse)
if kwargs.ignore_voucher_nos:
query = query.where(sre.name.notin(kwargs.ignore_voucher_nos))
diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py
index bab68615d30..80d35ad3556 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -1074,16 +1074,15 @@ class update_entries_after:
for d in sabb_data:
incoming_rate = get_incoming_rate_for_serial_and_batch(self.item_code, d, sn_obj)
-
- if flt(incoming_rate, self.currency_precision) == flt(
- d.valuation_rate, self.currency_precision
- ) and not getattr(d, "stock_queue", None):
- continue
-
amount = incoming_rate * flt(d.qty)
tot_amt += flt(amount)
total_qty += flt(d.qty)
+ if flt(incoming_rate, self.currency_precision) == flt(
+ d.incoming_rate, self.currency_precision
+ ) and not getattr(d, "stock_queue", None):
+ continue
+
values_to_update = {
"incoming_rate": incoming_rate,
"stock_value_difference": amount,
diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js
index c9fe457ef79..fee1cac2542 100644
--- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js
+++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js
@@ -336,6 +336,10 @@ frappe.ui.form.on("Subcontracting Receipt", {
reset_raw_materials_table: (frm) => {
frm.clear_table("supplied_items");
+ frm.doc.__unsaved = true;
+ if (!frm.doc.set_posting_time) {
+ frm.set_value("posting_time", frappe.datetime.now_time());
+ }
frm.call({
method: "reset_raw_materials",
diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json
index f3a37cc8bb1..79b46ec146a 100644
--- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json
+++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json
@@ -649,6 +649,7 @@
"label": "Raw Materials Actions"
},
{
+ "description": "Click this button if you encounter a negative stock error for a serial or batch item. The system will fetch the available serials or batches automatically.",
"fieldname": "reset_raw_materials_table",
"fieldtype": "Button",
"label": "Reset Raw Materials Table"
@@ -678,7 +679,7 @@
"in_create": 1,
"is_submittable": 1,
"links": [],
- "modified": "2024-12-06 15:24:38.384232",
+ "modified": "2025-10-08 21:43:27.065640",
"modified_by": "Administrator",
"module": "Subcontracting",
"name": "Subcontracting Receipt",
@@ -739,6 +740,7 @@
"write": 1
}
],
+ "row_format": "Dynamic",
"search_fields": "status, posting_date, supplier",
"show_name_in_global_search": 1,
"sort_field": "creation",
@@ -747,4 +749,4 @@
"timeline_field": "supplier",
"title_field": "title",
"track_changes": 1
-}
\ No newline at end of file
+}