mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 00:44:45 +00:00
Merge pull request #47529 from frappe/version-14-hotfix
chore: release v14
This commit is contained in:
@@ -32,8 +32,13 @@ class PeriodClosingVoucher(AccountsController):
|
|||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
self.validate_future_closing_vouchers()
|
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.db_set("gle_processing_status", "In Progress")
|
||||||
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Payment Ledger Entry")
|
|
||||||
gle_count = frappe.db.count(
|
gle_count = frappe.db.count(
|
||||||
"GL Entry",
|
"GL Entry",
|
||||||
{"voucher_type": "Period Closing Voucher", "voucher_no": self.name, "is_cancelled": 0},
|
{"voucher_type": "Period Closing Voucher", "voucher_no": self.name, "is_cancelled": 0},
|
||||||
|
|||||||
@@ -538,17 +538,20 @@ def get_account_type_map(company):
|
|||||||
|
|
||||||
|
|
||||||
def get_result_as_list(data, filters):
|
def get_result_as_list(data, filters):
|
||||||
balance, _balance_in_account_currency = 0, 0
|
balance = 0
|
||||||
|
|
||||||
for d in data:
|
for d in data:
|
||||||
if not d.get("posting_date"):
|
if not d.get("posting_date"):
|
||||||
balance, _balance_in_account_currency = 0, 0
|
balance = 0
|
||||||
|
|
||||||
balance = get_balance(d, balance, "debit", "credit")
|
balance = get_balance(d, balance, "debit", "credit")
|
||||||
|
|
||||||
d["balance"] = balance
|
d["balance"] = balance
|
||||||
|
|
||||||
d["account_currency"] = filters.account_currency
|
d["account_currency"] = filters.account_currency
|
||||||
|
|
||||||
|
d["presentation_currency"] = filters.presentation_currency
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
@@ -574,11 +577,8 @@ def get_columns(filters):
|
|||||||
if filters.get("presentation_currency"):
|
if filters.get("presentation_currency"):
|
||||||
currency = filters["presentation_currency"]
|
currency = filters["presentation_currency"]
|
||||||
else:
|
else:
|
||||||
if filters.get("company"):
|
company = filters.get("company") or get_default_company()
|
||||||
currency = get_company_currency(filters["company"])
|
filters["presentation_currency"] = currency = get_company_currency(company)
|
||||||
else:
|
|
||||||
company = get_default_company()
|
|
||||||
currency = get_company_currency(company)
|
|
||||||
|
|
||||||
columns = [
|
columns = [
|
||||||
{
|
{
|
||||||
@@ -599,19 +599,22 @@ def get_columns(filters):
|
|||||||
{
|
{
|
||||||
"label": _("Debit ({0})").format(currency),
|
"label": _("Debit ({0})").format(currency),
|
||||||
"fieldname": "debit",
|
"fieldname": "debit",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Currency",
|
||||||
|
"options": "presentation_currency",
|
||||||
"width": 130,
|
"width": 130,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Credit ({0})").format(currency),
|
"label": _("Credit ({0})").format(currency),
|
||||||
"fieldname": "credit",
|
"fieldname": "credit",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Currency",
|
||||||
|
"options": "presentation_currency",
|
||||||
"width": 130,
|
"width": 130,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Balance ({0})").format(currency),
|
"label": _("Balance ({0})").format(currency),
|
||||||
"fieldname": "balance",
|
"fieldname": "balance",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Currency",
|
||||||
|
"options": "presentation_currency",
|
||||||
"width": 130,
|
"width": 130,
|
||||||
},
|
},
|
||||||
{"label": _("Voucher Type"), "fieldname": "voucher_type", "width": 120},
|
{"label": _("Voucher Type"), "fieldname": "voucher_type", "width": 120},
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ frappe.ui.form.on("Event", {
|
|||||||
frm.add_custom_button(
|
frm.add_custom_button(
|
||||||
__("Add Sales Partners"),
|
__("Add Sales Partners"),
|
||||||
function () {
|
function () {
|
||||||
new frappe.desk.eventParticipants(frm, "Sales Partners");
|
new frappe.desk.eventParticipants(frm, "Sales Partner");
|
||||||
},
|
},
|
||||||
__("Add Participants")
|
__("Add Participants")
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -207,13 +207,12 @@ def get_or_create_account(company_name, account):
|
|||||||
default_root_type = "Liability"
|
default_root_type = "Liability"
|
||||||
root_type = account.get("root_type", default_root_type)
|
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(
|
existing_accounts = frappe.get_all(
|
||||||
"Account",
|
"Account", filters={"company": company_name, "root_type": root_type}, or_filters=or_filters
|
||||||
filters={"company": company_name, "root_type": root_type},
|
|
||||||
or_filters={
|
|
||||||
"account_name": account.get("account_name"),
|
|
||||||
"account_number": account.get("account_number"),
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if existing_accounts:
|
if existing_accounts:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import json
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _, bold
|
||||||
from frappe.model.mapper import get_mapped_doc
|
from frappe.model.mapper import get_mapped_doc
|
||||||
from frappe.query_builder.functions import Sum
|
from frappe.query_builder.functions import Sum
|
||||||
from frappe.utils import (
|
from frappe.utils import (
|
||||||
@@ -463,6 +463,14 @@ class StockEntry(StockController):
|
|||||||
OpeningEntryAccountError,
|
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):
|
def validate_warehouse(self):
|
||||||
"""perform various (sometimes conditional) validations on warehouse"""
|
"""perform various (sometimes conditional) validations on warehouse"""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user