forked from frappe/erpnext
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into strain_period_1
- Loading branch information
Showing
18 changed files
with
645 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
62 changes: 62 additions & 0 deletions
62
erpnext/accounts/report/statement_of_account/statement_of_account.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<h2 class="text-center">{%= __("Statement of Account") %}</h2> | ||
<h4 class="text-center"> | ||
{% if (filters.party_name) { %} | ||
{%= filters.party_name %} | ||
{% } else if (filters.party && filters.party.length) { %} | ||
{%= filters.party %} | ||
{% } else if (filters.account) { %} | ||
{%= filters.account %} | ||
{% } %} | ||
</h4> | ||
|
||
<h6 class="text-center"> | ||
{% if (filters.tax_id) { %} | ||
{%= __("Tax Id: ")%} {%= filters.tax_id %} | ||
{% } %} | ||
</h6> | ||
|
||
<h5 class="text-center"> | ||
{%= frappe.datetime.str_to_user(filters.from_date) %} | ||
{%= __("to") %} | ||
{%= frappe.datetime.str_to_user(filters.to_date) %} | ||
</h5> | ||
<hr> | ||
<table class="table table-bordered"> | ||
<thead> | ||
<tr> | ||
<th style="width: 12%">{%= __("Date") %}</th> | ||
<th style="width: 15%">{%= __("Description") %}</th> | ||
<th style="width: 15%">{%= __("Invoice") %}</th> | ||
<th style="width: 15%">{%= __("Payment/Credit") %}</th> | ||
<th style="width: 18%">{%= __("Balance (Dr - Cr)") %}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for(var i=0, l=data.length; i<l; i++) { %} | ||
<tr> | ||
{% if(data[i].posting_date) { %} | ||
<td>{%= frappe.datetime.str_to_user(data[i].posting_date) %}</td> | ||
<td>{%= data[i].voucher_type %} | ||
<br>{%= data[i].voucher_no %}</td> | ||
<td style="text-align: right"> | ||
{%= format_currency(data[i].debit, filters.presentation_currency) %}</td> | ||
<td style="text-align: right"> | ||
{%= format_currency(data[i].credit, filters.presentation_currency) %}</td> | ||
{% } else { %} | ||
<td></td> | ||
<td><b>{%= frappe.format(data[i].account, {fieldtype: "Link"}) || " " %}</b></td> | ||
<td style="text-align: right"> | ||
{%= data[i].account && format_currency(data[i].debit, filters.presentation_currency) %} | ||
</td> | ||
<td style="text-align: right"> | ||
{%= data[i].account && format_currency(data[i].credit, filters.presentation_currency) %} | ||
</td> | ||
{% } %} | ||
<td style="text-align: right"> | ||
{%= format_currency(data[i].balance, filters.presentation_currency) %} | ||
</td> | ||
</tr> | ||
{% } %} | ||
</tbody> | ||
</table> | ||
<p class="text-right text-muted">Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p> |
105 changes: 105 additions & 0 deletions
105
erpnext/accounts/report/statement_of_account/statement_of_account.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors | ||
// For license information, please see license.txt | ||
/* eslint-disable */ | ||
|
||
frappe.query_reports["Statement of Account"] = { | ||
"filters": [ | ||
{ | ||
"fieldname":"company", | ||
"label": __("Company"), | ||
"fieldtype": "Link", | ||
"options": "Company", | ||
"default": frappe.defaults.get_user_default("Company"), | ||
"reqd": 1 | ||
}, | ||
{ | ||
"fieldname":"finance_book", | ||
"label": __("Finance Book"), | ||
"fieldtype": "Link", | ||
"options": "Finance Book" | ||
}, | ||
{ | ||
"fieldname":"from_date", | ||
"label": __("From Date"), | ||
"fieldtype": "Date", | ||
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1), | ||
"reqd": 1, | ||
"width": "60px" | ||
}, | ||
{ | ||
"fieldname":"to_date", | ||
"label": __("To Date"), | ||
"fieldtype": "Date", | ||
"default": frappe.datetime.get_today(), | ||
"reqd": 1, | ||
"width": "60px" | ||
}, | ||
{ | ||
"fieldname":"account", | ||
"label": __("Account"), | ||
"fieldtype": "Link", | ||
"options": "Account", | ||
"get_query": function() { | ||
var company = frappe.query_report.get_filter_value('company'); | ||
return { | ||
"doctype": "Account", | ||
"filters": { | ||
"company": company, | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"fieldtype": "Break", | ||
}, | ||
{ | ||
"fieldname":"party_type", | ||
"label": __("Party Type"), | ||
"fieldtype": "Link", | ||
"options": "Party Type", | ||
"default": "", | ||
on_change: function() { | ||
frappe.query_report.set_filter_value('party', ""); | ||
} | ||
}, | ||
{ | ||
"fieldname":"party", | ||
"label": __("Party"), | ||
"fieldtype": "MultiSelectList", | ||
get_data: function(txt) { | ||
if (!frappe.query_report.filters) { | ||
return true; | ||
} | ||
let party_type = frappe.query_report.get_filter_value('party_type'); | ||
if (!party_type) { | ||
return true; | ||
} | ||
|
||
return frappe.db.get_link_options(party_type, txt); | ||
}, | ||
on_change: function() { | ||
var party_type = frappe.query_report.get_filter_value('party_type'); | ||
var parties = frappe.query_report.get_filter_value('party'); | ||
|
||
if(!party_type || parties.length === 0 || parties.length > 1) { | ||
frappe.query_report.set_filter_value('party_name', ""); | ||
return; | ||
} else { | ||
var party = parties[0]; | ||
var fieldname = erpnext.utils.get_party_name(party_type) || "name"; | ||
frappe.db.get_value(party_type, party, fieldname, function(value) { | ||
frappe.query_report.set_filter_value('party_name', value[fieldname]); | ||
}); | ||
} | ||
} | ||
}, | ||
{ | ||
"fieldname":"party_name", | ||
"label": __("Party Name"), | ||
"fieldtype": "Data", | ||
"hidden": 1 | ||
}, | ||
] | ||
}; | ||
|
||
erpnext.utils.add_dimensions('Statement of Account', 15) |
30 changes: 30 additions & 0 deletions
30
erpnext/accounts/report/statement_of_account/statement_of_account.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"add_total_row": 0, | ||
"creation": "2020-08-18 02:02:09.794045", | ||
"disable_prepared_report": 0, | ||
"disabled": 0, | ||
"docstatus": 0, | ||
"doctype": "Report", | ||
"idx": 0, | ||
"is_standard": "Yes", | ||
"modified": "2020-08-19 08:16:14.432529", | ||
"modified_by": "Administrator", | ||
"module": "Accounts", | ||
"name": "Statement of Account", | ||
"owner": "Administrator", | ||
"prepared_report": 0, | ||
"ref_doctype": "Sales Invoice", | ||
"report_name": "Statement of Account", | ||
"report_type": "Script Report", | ||
"roles": [ | ||
{ | ||
"role": "Accounts User" | ||
}, | ||
{ | ||
"role": "Accounts Manager" | ||
}, | ||
{ | ||
"role": "Fulfillment User" | ||
} | ||
] | ||
} |
Oops, something went wrong.