Merge branch 'version-15-hotfix' into mergify/bp/version-15-hotfix/pr-46214

This commit is contained in:
marination
2025-05-15 18:50:58 +02:00
6 changed files with 19 additions and 8 deletions

View File

@@ -168,8 +168,9 @@ def validate_loyalty_points(ref_doc, points_to_redeem):
loyalty_amount = flt(points_to_redeem * loyalty_program_details.conversion_factor)
if loyalty_amount > ref_doc.rounded_total:
frappe.throw(_("You can't redeem Loyalty Points having more value than the Rounded Total."))
total_amount = ref_doc.grand_total if ref_doc.is_rounded_total_disabled() else ref_doc.rounded_total
if loyalty_amount > total_amount:
frappe.throw(_("You can't redeem Loyalty Points having more value than the Total Amount."))
if not ref_doc.loyalty_amount and ref_doc.loyalty_amount != loyalty_amount:
ref_doc.loyalty_amount = loyalty_amount

View File

@@ -405,7 +405,9 @@ class PartyLedgerSummaryReport:
gl = qb.DocType("GL Entry")
query = (
qb.from_(gl)
.select(gl.voucher_type, gl.voucher_no)
.select(
gl.posting_date, gl.account, gl.party, gl.voucher_type, gl.voucher_no, gl.debit, gl.credit
)
.where(
(gl.docstatus < 2)
& (gl.is_cancelled == 0)

View File

@@ -480,6 +480,10 @@ erpnext.bom.BomController = class BomController extends erpnext.TransactionContr
child.bom_no = "";
}
if (doc.item == child.item_code) {
child.do_not_explode = 1;
}
get_bom_material_detail(doc, cdt, cdn, scrap_items);
}

View File

@@ -1369,6 +1369,7 @@ def make_purchase_order_for_default_supplier(source_name, selected_items=None, t
{
"Sales Order": {
"doctype": "Purchase Order",
"field_map": {"dispatch_address_name": "dispatch_address"},
"field_no_map": [
"address_display",
"contact_display",
@@ -1488,6 +1489,7 @@ def make_purchase_order(source_name, selected_items=None, target_doc=None):
{
"Sales Order": {
"doctype": "Purchase Order",
"field_map": {"dispatch_address_name": "dispatch_address"},
"field_no_map": [
"address_display",
"contact_display",

View File

@@ -148,7 +148,7 @@ def get_items(start, page_length, price_list, item_group, pos_profile, search_te
bin_join_selection, bin_join_condition = "", ""
if hide_unavailable_items:
bin_join_selection = "LEFT JOIN `tabBin` bin ON bin.item_code = item.name"
bin_join_condition = "AND item.is_stock_item = 0 OR (item.is_stock_item = 1 AND bin.warehouse = %(warehouse)s AND bin.actual_qty > 0)"
bin_join_condition = "AND (item.is_stock_item = 0 OR (item.is_stock_item = 1 AND bin.warehouse = %(warehouse)s AND bin.actual_qty > 0))"
items_data = frappe.db.sql(
"""

View File

@@ -520,17 +520,19 @@ class StockEntry(StockController):
if acc_details.account_type == "Stock":
frappe.throw(
_(
"At row {0}: the Difference Account must not be a Stock type account, please change the Account Type for the account {1} or select a different account"
"At row #{0}: the Difference Account must not be a Stock type account, please change the Account Type for the account {1} or select a different account"
).format(d.idx, get_link_to_form("Account", d.expense_account)),
OpeningEntryAccountError,
title=_("Difference Account in Items Table"),
)
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"
"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"),
title=_("Cost of Goods Sold Account in Items Table"),
indicator="orange",
alert=1,
)
def validate_warehouse(self):