mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
Merge pull request #49327 from frappe/version-14-hotfix
chore: release v14
This commit is contained in:
@@ -55,46 +55,46 @@ class Dunning(AccountsController):
|
|||||||
"conversion_rate",
|
"conversion_rate",
|
||||||
"cost_center",
|
"cost_center",
|
||||||
]
|
]
|
||||||
inv = frappe.db.get_value("Sales Invoice", self.sales_invoice, invoice_fields, as_dict=1)
|
|
||||||
|
|
||||||
accounting_dimensions = get_accounting_dimensions()
|
accounting_dimensions = get_accounting_dimensions()
|
||||||
invoice_fields.extend(accounting_dimensions)
|
invoice_fields.extend(accounting_dimensions)
|
||||||
|
|
||||||
|
inv = frappe.db.get_value("Sales Invoice", self.sales_invoice, invoice_fields, as_dict=1)
|
||||||
|
|
||||||
dunning_in_company_currency = flt(self.dunning_amount * inv.conversion_rate)
|
dunning_in_company_currency = flt(self.dunning_amount * inv.conversion_rate)
|
||||||
default_cost_center = frappe.get_cached_value("Company", self.company, "cost_center")
|
default_cost_center = frappe.get_cached_value("Company", self.company, "cost_center")
|
||||||
|
|
||||||
gl_entries.append(
|
debit = {
|
||||||
self.get_gl_dict(
|
"account": inv.debit_to,
|
||||||
{
|
"party_type": "Customer",
|
||||||
"account": inv.debit_to,
|
"party": self.customer,
|
||||||
"party_type": "Customer",
|
"due_date": self.due_date,
|
||||||
"party": self.customer,
|
"against": self.income_account,
|
||||||
"due_date": self.due_date,
|
"debit": dunning_in_company_currency,
|
||||||
"against": self.income_account,
|
"debit_in_account_currency": self.dunning_amount,
|
||||||
"debit": dunning_in_company_currency,
|
"against_voucher": self.name,
|
||||||
"debit_in_account_currency": self.dunning_amount,
|
"against_voucher_type": "Dunning",
|
||||||
"against_voucher": self.name,
|
"cost_center": inv.cost_center or default_cost_center,
|
||||||
"against_voucher_type": "Dunning",
|
"project": inv.project,
|
||||||
"cost_center": inv.cost_center or default_cost_center,
|
}
|
||||||
"project": inv.project,
|
|
||||||
},
|
credit = {
|
||||||
inv.party_account_currency,
|
"account": self.income_account,
|
||||||
item=inv,
|
"against": self.customer,
|
||||||
)
|
"credit": dunning_in_company_currency,
|
||||||
)
|
"credit_in_account_currency": self.dunning_amount,
|
||||||
gl_entries.append(
|
"cost_center": inv.cost_center or default_cost_center,
|
||||||
self.get_gl_dict(
|
"project": inv.project,
|
||||||
{
|
}
|
||||||
"account": self.income_account,
|
|
||||||
"against": self.customer,
|
for dimension in accounting_dimensions:
|
||||||
"credit": dunning_in_company_currency,
|
if val := inv.get(dimension):
|
||||||
"cost_center": inv.cost_center or default_cost_center,
|
debit[dimension] = credit[dimension] = val
|
||||||
"credit_in_account_currency": self.dunning_amount,
|
|
||||||
"project": inv.project,
|
gl_entries = [
|
||||||
},
|
self.get_gl_dict(debit, inv.party_account_currency, item=inv),
|
||||||
item=inv,
|
self.get_gl_dict(credit, item=inv),
|
||||||
)
|
]
|
||||||
)
|
|
||||||
make_gl_entries(
|
make_gl_entries(
|
||||||
gl_entries, cancel=(self.docstatus == 2), update_outstanding="No", merge_entries=False
|
gl_entries, cancel=(self.docstatus == 2), update_outstanding="No", merge_entries=False
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ frappe.ui.form.on('Payment Entry', {
|
|||||||
payment_type: function(frm) {
|
payment_type: function(frm) {
|
||||||
set_default_party_type(frm);
|
set_default_party_type(frm);
|
||||||
if(frm.doc.payment_type == "Internal Transfer") {
|
if(frm.doc.payment_type == "Internal Transfer") {
|
||||||
$.each(["party", "party_balance", "paid_from", "paid_to",
|
$.each(["party", "party_type", "party_balance", "paid_from", "paid_to",
|
||||||
"references", "total_allocated_amount"], function(i, field) {
|
"references", "total_allocated_amount"], function(i, field) {
|
||||||
frm.set_value(field, null);
|
frm.set_value(field, null);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -42,6 +42,11 @@ frappe.ui.form.on("Supplier", {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
frm.make_methods = {
|
||||||
|
"Bank Account": () => erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name),
|
||||||
|
"Pricing Rule": () => erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name),
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function (frm) {
|
refresh: function (frm) {
|
||||||
|
|||||||
@@ -215,17 +215,9 @@ $.extend(erpnext.utils, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
make_bank_account: function (doctype, docname) {
|
make_bank_account: function (doctype, docname) {
|
||||||
frappe.call({
|
frappe.new_doc("Bank Account", {
|
||||||
method: "erpnext.accounts.doctype.bank_account.bank_account.make_bank_account",
|
party_type: doctype,
|
||||||
args: {
|
party: docname,
|
||||||
doctype: doctype,
|
|
||||||
docname: docname,
|
|
||||||
},
|
|
||||||
freeze: true,
|
|
||||||
callback: function (r) {
|
|
||||||
var doclist = frappe.model.sync(r.message);
|
|
||||||
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ frappe.ui.form.on("Customer", {
|
|||||||
method: "erpnext.selling.doctype.customer.customer.make_opportunity",
|
method: "erpnext.selling.doctype.customer.customer.make_opportunity",
|
||||||
frm: cur_frm,
|
frm: cur_frm,
|
||||||
}),
|
}),
|
||||||
|
"Bank Account": () => erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name),
|
||||||
};
|
};
|
||||||
|
|
||||||
frm.add_fetch("lead_name", "company_name", "customer_name");
|
frm.add_fetch("lead_name", "company_name", "customer_name");
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ erpnext.setup.EmployeeController = class EmployeeController extends frappe.ui.fo
|
|||||||
};
|
};
|
||||||
|
|
||||||
frappe.ui.form.on("Employee", {
|
frappe.ui.form.on("Employee", {
|
||||||
|
setup: function (frm) {
|
||||||
|
frm.make_methods = {
|
||||||
|
"Bank Account": () => erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
onload: function (frm) {
|
onload: function (frm) {
|
||||||
frm.set_query("department", function () {
|
frm.set_query("department", function () {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user