diff --git a/erpnext/accounts/doctype/budget/budget.py b/erpnext/accounts/doctype/budget/budget.py index 22b8d64971c..0fe40d2d5fe 100644 --- a/erpnext/accounts/doctype/budget/budget.py +++ b/erpnext/accounts/doctype/budget/budget.py @@ -460,13 +460,20 @@ def get_actual_expense(args): def get_accumulated_monthly_budget(monthly_distribution, posting_date, fiscal_year, annual_budget): distribution = {} if monthly_distribution: - for d in frappe.db.sql( - """select mdp.month, mdp.percentage_allocation - from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md - where mdp.parent=md.name and md.fiscal_year=%s""", - fiscal_year, - as_dict=1, - ): + mdp = frappe.qb.DocType("Monthly Distribution Percentage") + md = frappe.qb.DocType("Monthly Distribution") + + res = ( + frappe.qb.from_(mdp) + .join(md) + .on(mdp.parent == md.name) + .select(mdp.month, mdp.percentage_allocation) + .where(md.fiscal_year == fiscal_year) + .where(md.name == monthly_distribution) + .run(as_dict=True) + ) + + for d in res: distribution.setdefault(d.month, d.percentage_allocation) dt = frappe.db.get_value("Fiscal Year", fiscal_year, "year_start_date") diff --git a/erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.json b/erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.json index cca36536ac4..80eccce62fe 100644 --- a/erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.json +++ b/erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.json @@ -1,211 +1,78 @@ { - "allow_copy": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, + "actions": [], "autoname": "field:gateway_name", - "beta": 0, "creation": "2018-02-06 16:11:10.028249", - "custom": 0, - "docstatus": 0, "doctype": "DocType", - "document_type": "", "editable_grid": 1, "engine": "InnoDB", + "field_order": [ + "gateway_name", + "section_break_2", + "access_token", + "webhooks_secret", + "use_sandbox", + "header_img" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "gateway_name", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, "in_list_view": 1, - "in_standard_filter": 0, "label": "Payment Gateway Name", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "unique": 1 }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "section_break_2", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "fieldtype": "Section Break" }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "access_token", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, "in_list_view": 1, - "in_standard_filter": 0, "label": "Access Token", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "reqd": 1 }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "webhooks_secret", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Webhooks Secret", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "label": "Webhooks Secret" }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, + "default": "0", "fieldname": "use_sandbox", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Use Sandbox", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "label": "Use Sandbox" + }, + { + "fieldname": "header_img", + "fieldtype": "Attach Image", + "label": "Header Image" } ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "modified": "2022-02-12 14:18:47.209114", + "links": [], + "modified": "2024-07-22 12:34:26.791274", "modified_by": "Administrator", "module": "ERPNext Integrations", "name": "GoCardless Settings", - "name_case": "", + "naming_rule": "By fieldname", "owner": "Administrator", "permissions": [ { - "amend": 0, - "apply_user_permissions": 0, - "cancel": 0, "create": 1, "delete": 1, "email": 1, "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, "print": 1, "read": 1, "report": 1, "role": "System Manager", - "set_user_permissions": 0, "share": 1, - "submit": 0, "write": 1 } ], - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", - "track_changes": 1, - "track_seen": 0 -} + "states": [], + "track_changes": 1 +} \ No newline at end of file diff --git a/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.py b/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.py index 64363e20e39..a5690c477e4 100644 --- a/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.py +++ b/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.py @@ -50,7 +50,11 @@ def get_returned_materials(work_orders): raw_materials = frappe.get_all( "Stock Entry", - fields=["`tabStock Entry Detail`.`item_code`", "`tabStock Entry Detail`.`qty`"], + fields=[ + "`tabStock Entry`.`work_order`", + "`tabStock Entry Detail`.`item_code`", + "`tabStock Entry Detail`.`qty`", + ], filters=[ ["Stock Entry", "is_return", "=", 1], ["Stock Entry Detail", "docstatus", "=", 1], @@ -59,12 +63,14 @@ def get_returned_materials(work_orders): ) for d in raw_materials: - raw_materials_qty[d.item_code] += d.qty + key = (d.work_order, d.item_code) + raw_materials_qty[key] += d.qty for row in work_orders: row.returned_qty = 0.0 - if raw_materials_qty.get(row.raw_material_item_code): - row.returned_qty = raw_materials_qty.get(row.raw_material_item_code) + key = (row.parent, row.raw_material_item_code) + if raw_materials_qty.get(key): + row.returned_qty = raw_materials_qty.get(key) def get_fields(): diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js index b5d169f2364..d85f93c2845 100644 --- a/erpnext/projects/doctype/project/project.js +++ b/erpnext/projects/doctype/project/project.js @@ -190,7 +190,7 @@ frappe.ui.form.on("Project", { }, set_status: function (frm, status) { - frappe.confirm(__("Set Project and all Tasks to status {0}?", [status.bold()]), () => { + frappe.confirm(__("Set Project and all Tasks to status {0}?", [__(status).bold()]), () => { frappe .xcall("erpnext.projects.doctype.project.project.set_project_status", { project: frm.doc.name, diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 6c83756a006..9f8aa84f836 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -841,7 +841,6 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe } transaction_date() { - this.apply_pricing_rule() if (this.frm.doc.transaction_date) { this.frm.transaction_date = this.frm.doc.transaction_date; frappe.ui.form.trigger(this.frm.doc.doctype, "currency"); @@ -850,7 +849,6 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe posting_date() { var me = this; - me.apply_pricing_rule() if (this.frm.doc.posting_date) { this.frm.posting_date = this.frm.doc.posting_date; diff --git a/erpnext/selling/page/point_of_sale/pos_item_cart.js b/erpnext/selling/page/point_of_sale/pos_item_cart.js index eb84796c2d0..e4af306a488 100644 --- a/erpnext/selling/page/point_of_sale/pos_item_cart.js +++ b/erpnext/selling/page/point_of_sale/pos_item_cart.js @@ -913,10 +913,13 @@ erpnext.PointOfSale.ItemCart = class { const me = this; dfs.forEach((df) => { this[`customer_${df.fieldname}_field`] = frappe.ui.form.make_control({ - df: { ...df, onchange: handle_customer_field_change }, + df: df, parent: $customer_form.find(`.${df.fieldname}-field`), render_input: true, }); + this[`customer_${df.fieldname}_field`].$input?.on("blur", () => { + handle_customer_field_change.apply(this[`customer_${df.fieldname}_field`]); + }); this[`customer_${df.fieldname}_field`].set_value(this.customer_info[df.fieldname]); });