fix: Add view ledger button for cancelled docs (#22432)

* fix: Add view ledger button for cancelled docs

* fix: Add moddified to date in Stock Ledger
This commit is contained in:
Deepesh Garg
2020-06-25 15:34:01 +05:30
committed by GitHub
parent ecff8f9582
commit 8a55ec1580
8 changed files with 37 additions and 24 deletions

View File

@@ -9,12 +9,15 @@ frappe.ui.form.on(cur_frm.doctype, {
}
if (['Loan Disbursement', 'Loan Repayment', 'Loan Interest Accrual'].includes(frm.doc.doctype)
&& frm.doc.docstatus == 1) {
&& frm.doc.docstatus > 0) {
frm.add_custom_button(__("Accounting Ledger"), function() {
frappe.route_options = {
voucher_no: frm.doc.name,
company: frm.doc.company
company: frm.doc.company,
from_date: frm.doc.posting_date,
to_date: moment(frm.doc.modified).format('YYYY-MM-DD'),
show_cancelled_entries: frm.doc.docstatus === 2
};
frappe.set_route("query-report", "General Ledger");