Skip to content

Commit

Permalink
Merge branch 'pre-prod' of https://github.com/8848digital/erpnext int…
Browse files Browse the repository at this point in the history
…o jay_testcase
  • Loading branch information
8848jay committed Jan 15, 2025
2 parents 15985b5 + b7acce9 commit e269453
Show file tree
Hide file tree
Showing 70 changed files with 5,968 additions and 1,567 deletions.
2 changes: 1 addition & 1 deletion erpnext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import frappe
from frappe.utils.user import is_website_user

__version__ = "15.47.1"
__version__ = "15.48.0"

def get_default_company(user=None):
"""Get default company for user"""
Expand Down
29 changes: 16 additions & 13 deletions erpnext/accounts/doctype/account/account_tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,22 @@ frappe.treeview_settings["Account"] = {
},
post_render: function (treeview) {
frappe.treeview_settings["Account"].treeview["tree"] = treeview.tree;
treeview.page.set_primary_action(
__("New"),
function () {
let root_company = treeview.page.fields_dict.root_company.get_value();

if (root_company) {
frappe.throw(__("Please add the account to root level Company - {0}"), [root_company]);
} else {
treeview.new_node();
}
},
"add"
);
if (treeview.can_create) {
treeview.page.set_primary_action(
__("New"),
function () {
let root_company = treeview.page.fields_dict.root_company.get_value();
if (root_company) {
frappe.throw(__("Please add the account to root level Company - {0}"), [
root_company,
]);
} else {
treeview.new_node();
}
},
"add"
);
}
},
toolbar: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
args: {
bank_account: frm.doc.bank_account,
till_date: frappe.datetime.add_days(frm.doc.bank_statement_from_date, -1),
company: frm.doc.company,
},
callback: (response) => {
frm.set_value("account_opening_balance", response.message);
Expand All @@ -135,6 +136,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
args: {
bank_account: frm.doc.bank_account,
till_date: frm.doc.bank_statement_to_date,
company: frm.doc.company,
},
callback: (response) => {
frm.cleared_balance = response.message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,17 @@ def get_bank_transactions(bank_account, from_date=None, to_date=None):


@frappe.whitelist()
def get_account_balance(bank_account, till_date):
def get_account_balance(bank_account, till_date, company):
# returns account balance till the specified date
account = frappe.db.get_value("Bank Account", bank_account, "account")
filters = frappe._dict({"account": account, "report_date": till_date, "include_pos_transactions": 1})
filters = frappe._dict(
{
"account": account,
"report_date": till_date,
"include_pos_transactions": 1,
"company": company,
}
)
data = get_entries(filters)

balance_as_per_system = get_balance_on(filters["account"], filters["report_date"])
Expand All @@ -93,11 +100,7 @@ def get_account_balance(bank_account, till_date):

amounts_not_reflected_in_system = get_amounts_not_reflected_in_system(filters)

bank_bal = (
flt(balance_as_per_system) - flt(total_debit) + flt(total_credit) + amounts_not_reflected_in_system
)

return bank_bal
return flt(balance_as_per_system) - flt(total_debit) + flt(total_credit) + amounts_not_reflected_in_system


@frappe.whitelist()
Expand Down
Empty file.
Loading

0 comments on commit e269453

Please sign in to comment.