mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
(cherry picked from commit 2341061852)
# Conflicts:
# erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
# erpnext/accounts/report/profitability_analysis/profitability_analysis.js
# erpnext/accounts/report/trial_balance/trial_balance.js
# erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js
# erpnext/buying/report/procurement_tracker/procurement_tracker.js
# erpnext/buying/report/purchase_analytics/purchase_analytics.js
# erpnext/manufacturing/report/job_card_summary/job_card_summary.js
# erpnext/manufacturing/report/production_analytics/production_analytics.js
# erpnext/selling/report/sales_analytics/sales_analytics.js
# erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.js
# erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js
# erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js
# erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js
136 lines
3.6 KiB
JavaScript
136 lines
3.6 KiB
JavaScript
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
|
// License: GNU General Public License v3. See license.txt
|
|
|
|
frappe.require("assets/erpnext/js/financial_statements.js", function () {
|
|
frappe.query_reports["Trial Balance"] = {
|
|
filters: [
|
|
{
|
|
fieldname: "company",
|
|
label: __("Company"),
|
|
fieldtype: "Link",
|
|
options: "Company",
|
|
default: frappe.defaults.get_user_default("Company"),
|
|
reqd: 1,
|
|
},
|
|
{
|
|
fieldname: "fiscal_year",
|
|
label: __("Fiscal Year"),
|
|
fieldtype: "Link",
|
|
options: "Fiscal Year",
|
|
default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
|
|
reqd: 1,
|
|
on_change: function (query_report) {
|
|
var fiscal_year = query_report.get_values().fiscal_year;
|
|
if (!fiscal_year) {
|
|
return;
|
|
}
|
|
frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
|
|
var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
|
|
frappe.query_report.set_filter_value({
|
|
from_date: fy.year_start_date,
|
|
to_date: fy.year_end_date,
|
|
});
|
|
});
|
|
},
|
|
},
|
|
{
|
|
<<<<<<< HEAD
|
|
fieldname: "from_date",
|
|
label: __("From Date"),
|
|
fieldtype: "Date",
|
|
default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
|
|
},
|
|
{
|
|
fieldname: "to_date",
|
|
label: __("To Date"),
|
|
fieldtype: "Date",
|
|
default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
|
|
=======
|
|
"fieldname": "from_date",
|
|
"label": __("From Date"),
|
|
"fieldtype": "Date",
|
|
"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
|
|
},
|
|
{
|
|
"fieldname": "to_date",
|
|
"label": __("To Date"),
|
|
"fieldtype": "Date",
|
|
<<<<<<< HEAD
|
|
"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2],
|
|
>>>>>>> 4496a6760e (fix: Default year start and end dates in reports)
|
|
=======
|
|
"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
|
|
>>>>>>> 2341061852 (fix: Default year start and end date in reports)
|
|
},
|
|
{
|
|
fieldname: "cost_center",
|
|
label: __("Cost Center"),
|
|
fieldtype: "Link",
|
|
options: "Cost Center",
|
|
get_query: function () {
|
|
var company = frappe.query_report.get_filter_value("company");
|
|
return {
|
|
doctype: "Cost Center",
|
|
filters: {
|
|
company: company,
|
|
},
|
|
};
|
|
},
|
|
},
|
|
{
|
|
fieldname: "project",
|
|
label: __("Project"),
|
|
fieldtype: "Link",
|
|
options: "Project",
|
|
},
|
|
{
|
|
fieldname: "finance_book",
|
|
label: __("Finance Book"),
|
|
fieldtype: "Link",
|
|
options: "Finance Book",
|
|
},
|
|
{
|
|
fieldname: "presentation_currency",
|
|
label: __("Currency"),
|
|
fieldtype: "Select",
|
|
options: erpnext.get_presentation_currency_list(),
|
|
},
|
|
{
|
|
fieldname: "with_period_closing_entry",
|
|
label: __("Period Closing Entry"),
|
|
fieldtype: "Check",
|
|
default: 1,
|
|
},
|
|
{
|
|
fieldname: "show_zero_values",
|
|
label: __("Show zero values"),
|
|
fieldtype: "Check",
|
|
},
|
|
{
|
|
fieldname: "show_unclosed_fy_pl_balances",
|
|
label: __("Show unclosed fiscal year's P&L balances"),
|
|
fieldtype: "Check",
|
|
},
|
|
{
|
|
fieldname: "include_default_book_entries",
|
|
label: __("Include Default FB Entries"),
|
|
fieldtype: "Check",
|
|
default: 1,
|
|
},
|
|
{
|
|
fieldname: "show_net_values",
|
|
label: __("Show net values in opening and closing columns"),
|
|
fieldtype: "Check",
|
|
default: 1,
|
|
},
|
|
],
|
|
formatter: erpnext.financial_statements.formatter,
|
|
tree: true,
|
|
name_field: "account",
|
|
parent_field: "parent_account",
|
|
initial_depth: 3,
|
|
};
|
|
|
|
erpnext.utils.add_dimensions("Trial Balance", 6);
|
|
});
|