Merge branch 'develop' into fix-no-account-in-gl-entry

This commit is contained in:
Mihir Kandoi
2025-07-18 16:28:16 +05:30
committed by GitHub
12 changed files with 68 additions and 29 deletions

View File

@@ -275,12 +275,14 @@ frappe.treeview_settings["Account"] = {
label: __("View Ledger"),
click: function (node, btn) {
frappe.route_options = {
account: node.label,
from_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
to_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
company:
frappe.treeview_settings["Account"].treeview.page.fields_dict.company.get_value(),
};
if (node.parent_label) {
frappe.route_options["account"] = node.label;
}
frappe.set_route("query-report", "General Ledger");
},
btnClass: "hidden-xs",

View File

@@ -1416,6 +1416,8 @@
"width": "50%"
},
{
"fetch_from": "sales_partner.commission_rate",
"fetch_if_empty": 1,
"fieldname": "commission_rate",
"fieldtype": "Float",
"label": "Commission Rate (%)",
@@ -1573,7 +1575,7 @@
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
"modified": "2025-06-24 12:13:28.242649",
"modified": "2025-07-17 16:51:40.886083",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",

View File

@@ -338,6 +338,11 @@ class POSInvoiceMergeLog(Document):
invoice.flags.ignore_pos_profile = True
invoice.pos_profile = ""
# Unset Commission Section
invoice.set("sales_partner", None)
invoice.set("commission_rate", 0)
invoice.set("total_commission", 0)
return invoice
def get_new_sales_invoice(self):

View File

@@ -1,21 +1,22 @@
{
"add_total_row": 0,
"add_translate_data": 0,
"columns": [],
"creation": "2013-05-06 12:28:23",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 3,
"idx": 6,
"is_standard": "Yes",
"modified": "2021-10-06 06:26:07.881340",
"letterhead": null,
"modified": "2025-07-17 23:16:19.892044",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Partners Commission",
"owner": "Administrator",
"prepared_report": 0,
"query": "SELECT\n sales_partner as \"Sales Partner:Link/Sales Partner:220\",\n\tsum(base_net_total) as \"Invoiced Amount (Excl. Tax):Currency:220\",\n\tsum(amount_eligible_for_commission) as \"Amount Eligible for Commission:Currency:220\",\n\tsum(total_commission) as \"Total Commission:Currency:170\",\n\tsum(total_commission)*100/sum(amount_eligible_for_commission) as \"Average Commission Rate:Percent:220\"\nFROM\n\t`tabSales Invoice`\nWHERE\n\tdocstatus = 1 and ifnull(base_net_total, 0) > 0 and ifnull(total_commission, 0) > 0\nGROUP BY\n\tsales_partner\nORDER BY\n\t\"Total Commission:Currency:120\"",
"query": "SELECT\n sales_partner as \"Sales Partner:Link / Sales Partner:220\",\n sum(base_net_total) as \"Invoiced Amount (Excl. Tax):Currency:220\",\n sum(amount_eligible_for_commission) as \"Amount Eligible for Commission:Currency:220\",\n sum(total_commission) as \"Total Commission:Currency:170\",\n sum(total_commission)*100 / sum(amount_eligible_for_commission) as \"Average Commission Rate:Percent:220\"\nFROM\n (\n SELECT\n sales_partner,\n base_net_total,\n total_commission,\n amount_eligible_for_commission\n FROM\n `tabSales Invoice` \n WHERE\n docstatus = 1\n AND IFNULL(base_net_total, 0) > 0\n AND IFNULL(total_commission, 0) > 0\n\n UNION ALL\n\n SELECT\n sales_partner,\n base_net_total,\n total_commission,\n amount_eligible_for_commission\n FROM\n `tabPOS Invoice`\n WHERE\n docstatus = 1\n AND IFNULL(base_net_total, 0) > 0\n AND IFNULL(total_commission, 0) > 0\n ) AS sub\nGROUP BY\n sales_partner\nORDER BY\n \"Total Commission:Currency:120\"",
"ref_doctype": "Sales Invoice",
"report_name": "Sales Partners Commission",
"report_type": "Query Report",
@@ -26,5 +27,6 @@
{
"role": "Accounts User"
}
]
}
],
"timeout": 0
}

View File

@@ -444,7 +444,7 @@ frappe.ui.form.on("Work Order", {
frm.doc.material_transferred_for_manufacturing -
frm.doc.produced_qty -
frm.doc.process_loss_qty;
if (pending_complete) {
if (pending_complete > 0) {
var width = (pending_complete / frm.doc.qty) * 100 - added_min;
title = __("{0} items in progress", [pending_complete]);
bars.push({
@@ -896,6 +896,19 @@ erpnext.work_order = {
description: __("Max: {0}", [max]),
default: max,
},
{
fieldtype: "Check",
label: __("Consider Process Loss"),
fieldname: "consider_process_loss",
default: 0,
onchange: function () {
if (this.value) {
frm.qty_prompt.set_value("qty", max - frm.doc.process_loss_qty);
} else {
frm.qty_prompt.set_value("qty", max);
}
},
},
];
if (purpose === "Disassemble") {
@@ -917,7 +930,7 @@ erpnext.work_order = {
}
return new Promise((resolve, reject) => {
frappe.prompt(
frm.qty_prompt = frappe.prompt(
fields,
(data) => {
max += (frm.doc.qty * (frm.doc.__onload.overproduction_percentage || 0.0)) / 100;

View File

@@ -426,4 +426,5 @@ erpnext.patches.v15_0.update_pegged_currencies
erpnext.patches.v15_0.set_status_cancelled_on_cancelled_pos_opening_entry_and_pos_closing_entry
erpnext.patches.v15_0.set_company_on_pos_inv_merge_log
erpnext.patches.v15_0.rename_price_list_to_buying_price_list
erpnext.patches.v15_0.repost_gl_entries_with_no_account_subcontracting
erpnext.patches.v15_0.repost_gl_entries_with_no_account_subcontracting
erpnext.patches.v15_0.remove_sales_partner_from_consolidated_sales_invoice

View File

@@ -0,0 +1,19 @@
import frappe
def execute():
SalesInvoice = frappe.qb.DocType("Sales Invoice")
query = (
frappe.qb.update(SalesInvoice)
.set(SalesInvoice.sales_partner, "")
.set(SalesInvoice.commission_rate, 0)
.set(SalesInvoice.total_commission, 0)
.where(SalesInvoice.is_consolidated == 1)
)
# For develop/version-16
if frappe.db.has_column("Sales Invoice", "is_created_using_pos"):
query = query.where(SalesInvoice.is_created_using_pos == 0)
query.run()

View File

@@ -88,9 +88,9 @@ frappe.ui.form.on("Project", {
);
frm.add_custom_button(
__("Update Total Purchase Cost"),
__("Update Costing and Billing"),
() => {
frm.events.update_total_purchase_cost(frm);
frm.events.update_costing_and_billing(frm);
},
__("Actions")
);
@@ -129,15 +129,15 @@ frappe.ui.form.on("Project", {
}
},
update_total_purchase_cost: function (frm) {
update_costing_and_billing: function (frm) {
frappe.call({
method: "erpnext.projects.doctype.project.project.recalculate_project_total_purchase_cost",
method: "erpnext.projects.doctype.project.project.update_costing_and_billing",
args: { project: frm.doc.name },
freeze: true,
freeze_message: __("Recalculating Purchase Cost against this Project..."),
freeze_message: __("Updating Costing and Billing fields against this Project..."),
callback: function (r) {
if (r && !r.exc) {
frappe.msgprint(__("Total Purchase Cost has been updated"));
frappe.msgprint(__("Costing and Billing fields has been updated"));
frm.refresh();
}
},

View File

@@ -749,12 +749,7 @@ def calculate_total_purchase_cost(project: str | None = None):
@frappe.whitelist()
def recalculate_project_total_purchase_cost(project: str | None = None):
if project:
total_purchase_cost = calculate_total_purchase_cost(project)
frappe.db.set_value(
"Project",
project,
"total_purchase_cost",
(total_purchase_cost and total_purchase_cost[0][0] or 0),
)
def update_costing_and_billing(project: str | None = None):
project = frappe.get_doc("Project", project)
project.update_costing()
project.db_update()

View File

@@ -13,7 +13,7 @@ frappe.query_reports["Sales Partner Commission Summary"] = {
fieldname: "doctype",
label: __("Document Type"),
fieldtype: "Select",
options: "Sales Order\nDelivery Note\nSales Invoice",
options: "Sales Order\nDelivery Note\nSales Invoice\nPOS Invoice",
default: "Sales Order",
},
{

View File

@@ -21,7 +21,7 @@ frappe.query_reports["Sales Partner Target Variance based on Item Group"] = {
fieldname: "doctype",
label: __("Document Type"),
fieldtype: "Select",
options: "Sales Order\nDelivery Note\nSales Invoice",
options: "Sales Order\nDelivery Note\nSales Invoice\nPOS Invoice",
default: "Sales Order",
},
{

View File

@@ -13,7 +13,7 @@ frappe.query_reports["Sales Partner Transaction Summary"] = {
fieldname: "doctype",
label: __("Document Type"),
fieldtype: "Select",
options: "Sales Order\nDelivery Note\nSales Invoice",
options: "Sales Order\nDelivery Note\nSales Invoice\nPOS Invoice",
default: "Sales Order",
},
{