From 1bbbd261cbb6a6c6eac2a56cbf15384e564fab2e Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 7 May 2025 16:03:59 +0530 Subject: [PATCH 1/5] fix: warning message for COGS account in the stock entry (cherry picked from commit bba6b0ff45ac13a0f5d3516bcd3ddec852e9652b) --- erpnext/stock/doctype/stock_entry/stock_entry.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 90764180217..ca15db485fd 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -6,7 +6,7 @@ import json from collections import defaultdict import frappe -from frappe import _ +from frappe import _, bold from frappe.model.mapper import get_mapped_doc from frappe.query_builder.functions import Sum from frappe.utils import ( @@ -463,6 +463,14 @@ class StockEntry(StockController): OpeningEntryAccountError, ) + if self.purpose != "Material Issue" and acc_details.account_type == "Cost of Goods Sold": + frappe.msgprint( + _( + "At row {0}: You have selected the Difference Account {1}, which is a Cost of Goods Sold type account. Please select a different account" + ).format(d.idx, bold(get_link_to_form("Account", d.expense_account))), + title=_("Warning : Cost of Goods Sold Account"), + ) + def validate_warehouse(self): """perform various (sometimes conditional) validations on warehouse""" From 2389fd51456eeace37958223a5fc10d20b69be96 Mon Sep 17 00:00:00 2001 From: Yaiphalemba Mangshatabam Date: Thu, 8 May 2025 14:09:06 +0530 Subject: [PATCH 2/5] fix: typo in event.js "Sales Partners" -> "Sales Partner" (cherry picked from commit edee75c7576cd094e0e2d29845be46cd988032b5) --- erpnext/public/js/event.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/event.js b/erpnext/public/js/event.js index a6733915a5c..2950ace888d 100644 --- a/erpnext/public/js/event.js +++ b/erpnext/public/js/event.js @@ -47,7 +47,7 @@ frappe.ui.form.on("Event", { frm.add_custom_button( __("Add Sales Partners"), function () { - new frappe.desk.eventParticipants(frm, "Sales Partners"); + new frappe.desk.eventParticipants(frm, "Sales Partner"); }, __("Add Participants") ); From 949ed59f848cf9e5257307ff142d540c31882932 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 2 May 2025 15:45:46 +0530 Subject: [PATCH 3/5] fix: broken test suite due to incorrect OR filter (cherry picked from commit 37d74e387d68c64be36b381aa3267b3459e2b358) --- erpnext/setup/setup_wizard/operations/taxes_setup.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/erpnext/setup/setup_wizard/operations/taxes_setup.py b/erpnext/setup/setup_wizard/operations/taxes_setup.py index 354a68434b0..866b0ac6f7c 100644 --- a/erpnext/setup/setup_wizard/operations/taxes_setup.py +++ b/erpnext/setup/setup_wizard/operations/taxes_setup.py @@ -207,13 +207,12 @@ def get_or_create_account(company_name, account): default_root_type = "Liability" root_type = account.get("root_type", default_root_type) + or_filters = {"account_name": account.get("account_name")} + if account.get("account_number"): + or_filters.update({"account_number": account.get("account_number")}) + existing_accounts = frappe.get_all( - "Account", - filters={"company": company_name, "root_type": root_type}, - or_filters={ - "account_name": account.get("account_name"), - "account_number": account.get("account_number"), - }, + "Account", filters={"company": company_name, "root_type": root_type}, or_filters=or_filters ) if existing_accounts: From c6c1b00559b7d416e040514a24743fdefa453383 Mon Sep 17 00:00:00 2001 From: Abdeali Chharchhodawala <99460106+Abdeali099@users.noreply.github.com> Date: Tue, 13 May 2025 11:26:21 +0530 Subject: [PATCH 4/5] Merge pull request #47367 from Abdeali099/gl-report-field-float-to-currency fix: Use `Currency` instead of `Float` in GL report to show details (cherry picked from commit e4e0bb68ecc3ff2dce679481051ff53c0a77dcd1) --- .../report/general_ledger/general_ledger.py | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index ae48d617f48..76069c6fbe7 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -538,17 +538,20 @@ def get_account_type_map(company): def get_result_as_list(data, filters): - balance, _balance_in_account_currency = 0, 0 + balance = 0 for d in data: if not d.get("posting_date"): - balance, _balance_in_account_currency = 0, 0 + balance = 0 balance = get_balance(d, balance, "debit", "credit") + d["balance"] = balance d["account_currency"] = filters.account_currency + d["presentation_currency"] = filters.presentation_currency + return data @@ -574,11 +577,8 @@ def get_columns(filters): if filters.get("presentation_currency"): currency = filters["presentation_currency"] else: - if filters.get("company"): - currency = get_company_currency(filters["company"]) - else: - company = get_default_company() - currency = get_company_currency(company) + company = filters.get("company") or get_default_company() + filters["presentation_currency"] = currency = get_company_currency(company) columns = [ { @@ -599,19 +599,22 @@ def get_columns(filters): { "label": _("Debit ({0})").format(currency), "fieldname": "debit", - "fieldtype": "Float", + "fieldtype": "Currency", + "options": "presentation_currency", "width": 130, }, { "label": _("Credit ({0})").format(currency), "fieldname": "credit", - "fieldtype": "Float", + "fieldtype": "Currency", + "options": "presentation_currency", "width": 130, }, { "label": _("Balance ({0})").format(currency), "fieldname": "balance", - "fieldtype": "Float", + "fieldtype": "Currency", + "options": "presentation_currency", "width": 130, }, {"label": _("Voucher Type"), "fieldname": "voucher_type", "width": 120}, From a04feff2646e037536c3abd1c6a71f49ea40fc4b Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 13 May 2025 13:12:39 +0530 Subject: [PATCH 5/5] fix: ignore "Account Closing Balance" doctype on Period Closing Voucher cancellation (cherry picked from commit d6602d63fcb69d78560762e9a86c0b6bf8adbbdc) # Conflicts: # erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py --- .../period_closing_voucher/period_closing_voucher.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py index 59ffd656689..5119562382f 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py @@ -32,8 +32,13 @@ class PeriodClosingVoucher(AccountsController): def on_cancel(self): self.validate_future_closing_vouchers() + self.ignore_linked_doctypes = ( + "GL Entry", + "Stock Ledger Entry", + "Payment Ledger Entry", + "Account Closing Balance", + ) self.db_set("gle_processing_status", "In Progress") - self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Payment Ledger Entry") gle_count = frappe.db.count( "GL Entry", {"voucher_type": "Period Closing Voucher", "voucher_no": self.name, "is_cancelled": 0},