remove broken account_tree_custom.js, fix COA balance offset
Removed account_tree_custom.js which caused console errors due to accessing undefined treeview fields. Export functionality is already available via account_list.js. Added CSS fix for Chart of Accounts tree view where account balances were visually shifted down by one row due to float:right on balance-area. Fix uses flexbox on tree nodes instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fa1efba44d
commit
aa9d5640c0
|
|
@ -10,7 +10,6 @@ boot_session = "jey_erp.extend_party_types.add_company_to_party_account_types"
|
||||||
|
|
||||||
app_include_js = [
|
app_include_js = [
|
||||||
"/assets/jey_erp/js/vat_calculator.js",
|
"/assets/jey_erp/js/vat_calculator.js",
|
||||||
"/assets/jey_erp/js/account_tree_custom.js",
|
|
||||||
"/assets/jey_erp/js/sales_invoice.js",
|
"/assets/jey_erp/js/sales_invoice.js",
|
||||||
"/assets/jey_erp/js/sales_invoice_vat.js",
|
"/assets/jey_erp/js/sales_invoice_vat.js",
|
||||||
"/assets/jey_erp/js/sales_order_vat.js",
|
"/assets/jey_erp/js/sales_order_vat.js",
|
||||||
|
|
@ -19,11 +18,11 @@ app_include_js = [
|
||||||
|
|
||||||
app_include_css = [
|
app_include_css = [
|
||||||
"/assets/jey_erp/css/bank_reconciliation_tool.css",
|
"/assets/jey_erp/css/bank_reconciliation_tool.css",
|
||||||
|
"/assets/jey_erp/css/account_tree_fix.css",
|
||||||
]
|
]
|
||||||
|
|
||||||
doctype_js = {
|
doctype_js = {
|
||||||
"Payment Entry": "/public/js/payment_entry_mod.js",
|
"Payment Entry": "/public/js/payment_entry_mod.js",
|
||||||
"Account": "/public/js/account_tree_custom.js",
|
|
||||||
"Sales Invoice": "public/js/sales_invoice.js",
|
"Sales Invoice": "public/js/sales_invoice.js",
|
||||||
"Employee": "public/js/employee.js",
|
"Employee": "public/js/employee.js",
|
||||||
"Bank Reconciliation Tool": "public/js/bank_reconciliation_tool.js",
|
"Bank Reconciliation Tool": "public/js/bank_reconciliation_tool.js",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
.tree li {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.balance-area {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tree-children {
|
||||||
|
flex-basis: 100%;
|
||||||
|
}
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
frappe.provide("frappe.treeview_settings");
|
|
||||||
|
|
||||||
function _download_chart_of_accounts() {
|
|
||||||
frappe.call({
|
|
||||||
method: "jey_erp.custom.account_export.export_chart_of_accounts",
|
|
||||||
callback: function (r) {
|
|
||||||
if (!r.message) return;
|
|
||||||
const json = JSON.stringify(r.message, null, 2);
|
|
||||||
const blob = new Blob([json], { type: "application/json" });
|
|
||||||
const url = URL.createObjectURL(blob);
|
|
||||||
const a = document.createElement("a");
|
|
||||||
a.href = url;
|
|
||||||
a.download = "az_chart_of_accounts.json";
|
|
||||||
a.click();
|
|
||||||
URL.revokeObjectURL(url);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
frappe.treeview_settings["Account"] = frappe.treeview_settings["Account"] || {};
|
|
||||||
frappe.treeview_settings["Account"].onload = function (treeview) {
|
|
||||||
treeview.page.add_inner_button(__("Export Chart of Accounts"), function () {
|
|
||||||
_download_chart_of_accounts();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// Сохраняем оригинальные поля
|
|
||||||
var original_fields = frappe.treeview_settings["Account"].fields;
|
|
||||||
|
|
||||||
// Переопределяем массив полей, добавляя наши новые поля
|
|
||||||
frappe.treeview_settings["Account"].fields = original_fields.concat([
|
|
||||||
{
|
|
||||||
fieldtype: "Check",
|
|
||||||
fieldname: "is_account",
|
|
||||||
label: __("Is Account"),
|
|
||||||
description: __("Check if this is a regular account")
|
|
||||||
},
|
|
||||||
{
|
|
||||||
fieldtype: "Check",
|
|
||||||
fieldname: "is_sub_account",
|
|
||||||
label: __("Is Sub Account"),
|
|
||||||
description: __("Check if this is a sub account")
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
Loading…
Reference in New Issue