General Ledger Report Base from Journal Entry Accounts

Hi Guys,

Im trying to Create a report Similar to the General Ledger Report , What i did is instead of getting the data from “tabGL Entry” I change it to “tabJournal Entry Accounts” it works fine but it was not balanced with the General Ledger Report
because Sales Invoice and Purchase Invoice entries are in a seperate table.

Im trying to figure out if a code something like this is possible to pull data from SI and PI

gl_entries = frappe.db.sql(" QUERY FOR tabJournal Entry Accounts ")

si_entries = frappe.db.sql(" QUERY FOR Sales invoice ")

pi_entries = frappe.db.sql(" QUERY FOR Purchase invoice ")

gl_entries.append(si_entries)
gl_entries.append(pi_entries)

return gl_entries

why not jst copy the general ledger report from erpnext code and make your modification. I think that would be easier

1 Like

That’s what I did. but im kinda stuck in the code above its a code from GL Report.

Solved

1 Like