mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-18 12:39:18 +00:00
Merge pull request #45132 from frappe/version-14-hotfix
chore: release v14
This commit is contained in:
@@ -460,13 +460,20 @@ def get_actual_expense(args):
|
|||||||
def get_accumulated_monthly_budget(monthly_distribution, posting_date, fiscal_year, annual_budget):
|
def get_accumulated_monthly_budget(monthly_distribution, posting_date, fiscal_year, annual_budget):
|
||||||
distribution = {}
|
distribution = {}
|
||||||
if monthly_distribution:
|
if monthly_distribution:
|
||||||
for d in frappe.db.sql(
|
mdp = frappe.qb.DocType("Monthly Distribution Percentage")
|
||||||
"""select mdp.month, mdp.percentage_allocation
|
md = frappe.qb.DocType("Monthly Distribution")
|
||||||
from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
|
|
||||||
where mdp.parent=md.name and md.fiscal_year=%s""",
|
res = (
|
||||||
fiscal_year,
|
frappe.qb.from_(mdp)
|
||||||
as_dict=1,
|
.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)
|
distribution.setdefault(d.month, d.percentage_allocation)
|
||||||
|
|
||||||
dt = frappe.db.get_value("Fiscal Year", fiscal_year, "year_start_date")
|
dt = frappe.db.get_value("Fiscal Year", fiscal_year, "year_start_date")
|
||||||
|
|||||||
@@ -1,211 +1,78 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"actions": [],
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"autoname": "field:gateway_name",
|
"autoname": "field:gateway_name",
|
||||||
"beta": 0,
|
|
||||||
"creation": "2018-02-06 16:11:10.028249",
|
"creation": "2018-02-06 16:11:10.028249",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "",
|
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"gateway_name",
|
||||||
|
"section_break_2",
|
||||||
|
"access_token",
|
||||||
|
"webhooks_secret",
|
||||||
|
"use_sandbox",
|
||||||
|
"header_img"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "gateway_name",
|
"fieldname": "gateway_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Payment Gateway Name",
|
"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,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"unique": 1
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "section_break_2",
|
"fieldname": "section_break_2",
|
||||||
"fieldtype": "Section Break",
|
"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
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "access_token",
|
"fieldname": "access_token",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Access Token",
|
"label": "Access Token",
|
||||||
"length": 0,
|
"reqd": 1
|
||||||
"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
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "webhooks_secret",
|
"fieldname": "webhooks_secret",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"label": "Webhooks Secret"
|
||||||
"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
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"default": "0",
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "use_sandbox",
|
"fieldname": "use_sandbox",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Use Sandbox"
|
||||||
"ignore_user_permissions": 0,
|
},
|
||||||
"ignore_xss_filter": 0,
|
{
|
||||||
"in_filter": 0,
|
"fieldname": "header_img",
|
||||||
"in_global_search": 0,
|
"fieldtype": "Attach Image",
|
||||||
"in_list_view": 0,
|
"label": "Header Image"
|
||||||
"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
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
"links": [],
|
||||||
"hide_heading": 0,
|
"modified": "2024-07-22 12:34:26.791274",
|
||||||
"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",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "ERPNext Integrations",
|
"module": "ERPNext Integrations",
|
||||||
"name": "GoCardless Settings",
|
"name": "GoCardless Settings",
|
||||||
"name_case": "",
|
"naming_rule": "By fieldname",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"amend": 0,
|
|
||||||
"apply_user_permissions": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 1,
|
"delete": 1,
|
||||||
"email": 1,
|
"email": 1,
|
||||||
"export": 1,
|
"export": 1,
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 1,
|
"report": 1,
|
||||||
"role": "System Manager",
|
"role": "System Manager",
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 1,
|
"share": 1,
|
||||||
"submit": 0,
|
|
||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"read_only": 0,
|
|
||||||
"read_only_onload": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"track_changes": 1,
|
"states": [],
|
||||||
"track_seen": 0
|
"track_changes": 1
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,11 @@ def get_returned_materials(work_orders):
|
|||||||
|
|
||||||
raw_materials = frappe.get_all(
|
raw_materials = frappe.get_all(
|
||||||
"Stock Entry",
|
"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=[
|
filters=[
|
||||||
["Stock Entry", "is_return", "=", 1],
|
["Stock Entry", "is_return", "=", 1],
|
||||||
["Stock Entry Detail", "docstatus", "=", 1],
|
["Stock Entry Detail", "docstatus", "=", 1],
|
||||||
@@ -59,12 +63,14 @@ def get_returned_materials(work_orders):
|
|||||||
)
|
)
|
||||||
|
|
||||||
for d in raw_materials:
|
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:
|
for row in work_orders:
|
||||||
row.returned_qty = 0.0
|
row.returned_qty = 0.0
|
||||||
if raw_materials_qty.get(row.raw_material_item_code):
|
key = (row.parent, row.raw_material_item_code)
|
||||||
row.returned_qty = raw_materials_qty.get(row.raw_material_item_code)
|
if raw_materials_qty.get(key):
|
||||||
|
row.returned_qty = raw_materials_qty.get(key)
|
||||||
|
|
||||||
|
|
||||||
def get_fields():
|
def get_fields():
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ frappe.ui.form.on("Project", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
set_status: function (frm, status) {
|
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
|
frappe
|
||||||
.xcall("erpnext.projects.doctype.project.project.set_project_status", {
|
.xcall("erpnext.projects.doctype.project.project.set_project_status", {
|
||||||
project: frm.doc.name,
|
project: frm.doc.name,
|
||||||
|
|||||||
@@ -841,7 +841,6 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
}
|
}
|
||||||
|
|
||||||
transaction_date() {
|
transaction_date() {
|
||||||
this.apply_pricing_rule()
|
|
||||||
if (this.frm.doc.transaction_date) {
|
if (this.frm.doc.transaction_date) {
|
||||||
this.frm.transaction_date = this.frm.doc.transaction_date;
|
this.frm.transaction_date = this.frm.doc.transaction_date;
|
||||||
frappe.ui.form.trigger(this.frm.doc.doctype, "currency");
|
frappe.ui.form.trigger(this.frm.doc.doctype, "currency");
|
||||||
@@ -850,7 +849,6 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
|
|
||||||
posting_date() {
|
posting_date() {
|
||||||
var me = this;
|
var me = this;
|
||||||
me.apply_pricing_rule()
|
|
||||||
if (this.frm.doc.posting_date) {
|
if (this.frm.doc.posting_date) {
|
||||||
this.frm.posting_date = this.frm.doc.posting_date;
|
this.frm.posting_date = this.frm.doc.posting_date;
|
||||||
|
|
||||||
|
|||||||
@@ -913,10 +913,13 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
const me = this;
|
const me = this;
|
||||||
dfs.forEach((df) => {
|
dfs.forEach((df) => {
|
||||||
this[`customer_${df.fieldname}_field`] = frappe.ui.form.make_control({
|
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`),
|
parent: $customer_form.find(`.${df.fieldname}-field`),
|
||||||
render_input: true,
|
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]);
|
this[`customer_${df.fieldname}_field`].set_value(this.customer_info[df.fieldname]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user