Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(General Ledger Report): Grouped Print #17662

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a67f413
Several Changes:
SaiFi0102 Oct 26, 2018
0c8745e
Several Changes in General Ledger Report:
SaiFi0102 Oct 26, 2018
5eb23d0
Added a more readable General Ledger print format
SaiFi0102 Oct 26, 2018
892eac0
Added remarks in PO, PREC, SO, DN
SaiFi0102 Oct 26, 2018
11c6605
Minor fix
SaiFi0102 Oct 26, 2018
1e486a1
Several Changes:
SaiFi0102 Oct 26, 2018
8e07fcf
Patch and minor fix:
SaiFi0102 Oct 27, 2018
1a0d5f2
Several Changes:
SaiFi0102 Oct 27, 2018
1eb8ef4
Use OrderedDict in General Ledger otherwise Group By feature will mes…
SaiFi0102 Oct 27, 2018
6423578
General Ledger field type Float to Currency
SaiFi0102 Oct 27, 2018
1b06bde
Get only unique accounts for GL Entry against field in Purchase Recei…
SaiFi0102 Oct 27, 2018
aa38b74
Hide reference column if all empty
SaiFi0102 Oct 27, 2018
99bb23f
Revert create_remarks() into validate()
SaiFi0102 Oct 27, 2018
e51fe0e
Comma, space in Against Account in Sales Invoice
SaiFi0102 Oct 27, 2018
acdae01
Comma, space for Purchase Invoice against account
SaiFi0102 Oct 27, 2018
e30e5e3
Removed automatically setting of "No Remarks"
SaiFi0102 Oct 27, 2018
7294437
Added links in General Ledger report print view
SaiFi0102 Oct 27, 2018
f390c72
Bug fix and labels
SaiFi0102 Oct 28, 2018
5bebec7
Apply Journal Entry's reference_no/date to all rows instead of just bank
SaiFi0102 Oct 29, 2018
e0d6af1
Ugh, create remarks always after validate_cheque_info!
SaiFi0102 Oct 29, 2018
fbffb08
Reference numbers for all GL Entries for Payment Entry too
SaiFi0102 Oct 29, 2018
e306ead
Format reference_date in General Ledger print format
SaiFi0102 Oct 29, 2018
895a644
Bug fix in General Ledger print format
SaiFi0102 Nov 18, 2018
cb98046
Fixed merge problem
SaiFi0102 Nov 18, 2018
36ad72e
Group By Voucher (Consolidated):
SaiFi0102 Nov 21, 2018
6d88da4
Merge branch 'staging-fixes' into JV-Multiple-Reference-No
nabinhait Nov 27, 2018
449df97
General Ledger Print: Added white-space:nowrap
SaiFi0102 Nov 27, 2018
4b93629
Merge branch 'staging' of https://github.com/frappe/erpnext into JV-M…
SaiFi0102 Dec 27, 2018
415ea18
fix: je to jea
SaiFi0102 Dec 27, 2018
bc2cafd
feat(General Ledger Report): Added filter by Sales Person
SaiFi0102 Jan 16, 2019
5b1dc6f
Merge branch 'master' of https://github.com/frappe/erpnext.git into J…
SaiFi0102 Feb 1, 2019
c02201c
chore: Update spaces in delivery_note.json
SaiFi0102 Feb 1, 2019
91c9d54
fix(General Ledger): Reordered columns
SaiFi0102 Feb 5, 2019
3d6f621
test(Journal Entry): test_jv_reference_no_in_gle
SaiFi0102 Feb 5, 2019
652e259
style: Reordered fields for remarks field
SaiFi0102 Feb 6, 2019
1e3b9de
Merge branch 'master' of https://github.com/frappe/erpnext.git into J…
SaiFi0102 Feb 12, 2019
6e3862b
Merge branch 'develop' of https://github.com/frappe/erpnext.git into …
SaiFi0102 Feb 12, 2019
34c1b02
patch: Update to v12
SaiFi0102 Feb 13, 2019
7ce4784
style: Bring remarks up in transactions
SaiFi0102 Feb 19, 2019
601092e
Merge branch 'develop' of https://github.com/frappe/erpnext.git into …
SaiFi0102 Mar 7, 2019
73c4bc6
feat(General Ledger Report): Filter by Posted By Voucher or Against o…
SaiFi0102 Mar 22, 2019
48badc0
style(General Ledger Report): Always show "Posted By Voucher" filter
SaiFi0102 Mar 22, 2019
6136a80
Merge branch 'JV-Multiple-Reference-No' of https://[email protected]
SaiFi0102 Mar 22, 2019
bd74405
Merge branch 'JV-Multiple-Reference-No' of https://[email protected]
SaiFi0102 Mar 22, 2019
138c48c
fix(General Ledger Report): Print margins on screen only
SaiFi0102 Apr 6, 2019
57a8bd2
Merge branch 'JV-Multiple-Reference-No' of https://[email protected]
SaiFi0102 Apr 6, 2019
a063dc1
fix(General Ledger Report): Print view padding 8mm
SaiFi0102 Apr 7, 2019
e57fdc9
fix(Payment Entry): Improve remarks
SaiFi0102 Apr 19, 2019
fde387e
Merge branch 'JV-Multiple-Reference-No' of https://[email protected]
SaiFi0102 Apr 19, 2019
b6667d4
Merge branch 'JV-Multiple-Reference-No' of https://[email protected]
SaiFi0102 Apr 19, 2019
d8e7423
Merge branch 'develop' of https://github.com/frappe/erpnext.git into …
SaiFi0102 Apr 24, 2019
70e065b
style: linting
SaiFi0102 Apr 24, 2019
7ab7fc7
feat(General Ledger Report): Using grouping utilities
SaiFi0102 May 16, 2019
f00571b
Merge branch 'General-Ledger-Grouped-Report' of https://saifi0102@git…
SaiFi0102 May 17, 2019
d1f62d1
fix(General Ledger Report): Filter by Sales Person set in Customer ma…
SaiFi0102 May 20, 2019
228b233
Merge branch 'General-Ledger-Filter-Sales-Person' into General-Ledger…
SaiFi0102 May 20, 2019
1fc3191
fix(General Ledger Report): Use composite key to group party and voucher
SaiFi0102 May 21, 2019
9d0d2b4
Merge branch 'General-Ledger-Grouped-Report' of https://saifi0102@git…
SaiFi0102 May 24, 2019
eb4f42e
fix(General Ledger Report): Update print format
SaiFi0102 May 25, 2019
fd4f17c
Merge branch 'General-Ledger-Grouped-Report' of https://saifi0102@git…
SaiFi0102 May 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ def get_payment_entries(self):

condition = ""
if not self.include_reconciled_entries:
condition = " and (clearance_date is null or clearance_date='0000-00-00')"
condition = "and ({0}clearance_date is null or {0}clearance_date='0000-00-00')"

account_cond = ""
if self.bank_account_no:
account_cond = " and t2.bank_account_no = {0}".format(frappe.db.escape(self.bank_account_no))

journal_entries = frappe.db.sql("""
select
"Journal Entry" as payment_document, t1.name as payment_entry,
t1.cheque_no as cheque_number, t1.cheque_date,
sum(t2.debit_in_account_currency) as debit, sum(t2.credit_in_account_currency) as credit,
t1.posting_date, t2.against_account, t1.clearance_date, t2.account_currency
'Journal Entry' as payment_document, t1.name as payment_entry,
'Journal Entry Account' as payment_detail_dt, t2.name as payment_detail_dn,
t2.cheque_no as cheque_number, t2.cheque_date,
t2.debit_in_account_currency as debit, t2.credit_in_account_currency as credit,
t1.posting_date, t2.against_account, t2.clearance_date, t2.account_currency
from
`tabJournal Entry` t1, `tabJournal Entry Account` t2
where
t2.parent = t1.name and t2.account = %s and t1.docstatus=1
and t1.posting_date >= %s and t1.posting_date <= %s
and ifnull(t1.is_opening, 'No') = 'No' {0} {1}
group by t2.account, t1.name
order by t1.posting_date ASC, t1.name DESC
""".format(condition, account_cond), (self.bank_account, self.from_date, self.to_date), as_dict=1)
""".format(condition.format("t2."), account_cond), (self.bank_account, self.from_date, self.to_date), as_dict=1) # nosec

if self.bank_account_no:
condition = " and bank_account = %(bank_account_no)s"

payment_entries = frappe.db.sql("""
select
"Payment Entry" as payment_document, name as payment_entry,
'Payment Entry' as payment_document, name as payment_entry,
reference_no as cheque_number, reference_date as cheque_date,
if(paid_from=%(account)s, paid_amount, 0) as credit,
if(paid_from=%(account)s, 0, received_amount) as debit,
Expand All @@ -58,15 +58,15 @@ def get_payment_entries(self):
and posting_date >= %(from)s and posting_date <= %(to)s {0}
order by
posting_date ASC, name DESC
""".format(condition),
{"account":self.bank_account, "from":self.from_date,
"to":self.to_date, "bank_account_no": self.bank_account_no}, as_dict=1)
""".format(condition.format("")), # nosec
{"account":self.bank_account, "from": self.from_date,
"to": self.to_date, "bank_account_no": self.bank_account_no}, as_dict=1)

pos_entries = []
if self.include_pos_transactions:
pos_entries = frappe.db.sql("""
select
"Sales Invoice Payment" as payment_document, sip.name as payment_entry, sip.amount as debit,
'Sales Invoice Payment' as payment_document, sip.name as payment_entry, sip.amount as debit,
si.posting_date, si.debit_to as against_account, sip.clearance_date,
account.account_currency, 0 as credit
from `tabSales Invoice Payment` sip, `tabSales Invoice` si, `tabAccount` account
Expand All @@ -75,8 +75,8 @@ def get_payment_entries(self):
and account.name = sip.account and si.posting_date >= %(from)s and si.posting_date <= %(to)s {0}
order by
si.posting_date ASC, si.name DESC
""".format(condition),
{"account":self.bank_account, "from":self.from_date, "to":self.to_date}, as_dict=1)
""".format(condition.format("sip.")), # nosec
{"account":self.bank_account, "from":self.from_date, "to":self.to_date}, as_dict=1)

entries = sorted(list(payment_entries)+list(journal_entries+list(pos_entries)),
key=lambda k: k['posting_date'] or getdate(nowdate()))
Expand Down Expand Up @@ -115,8 +115,8 @@ def update_clearance_date(self):

frappe.db.set_value(d.payment_document, d.payment_entry, "clearance_date", d.clearance_date)
frappe.db.sql("""update `tab{0}` set clearance_date = %s, modified = %s
where name=%s""".format(d.payment_document),
(d.clearance_date, nowdate(), d.payment_entry))
where name=%s""".format(d.get("payment_detail_dt") or d.payment_document),
(d.clearance_date, nowdate(), d.get("payment_detail_dn") or d.payment_entry))

clearance_date_updated = True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,72 @@
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "payment_detail_dt",
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Payment Detail DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "payment_detail_dn",
"fieldtype": "Dynamic Link",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Payment Detail DocName",
"length": 0,
"no_copy": 0,
"options": "payment_detail_dt",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
"has_web_view": 0,
Expand All @@ -323,7 +389,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2019-01-07 16:52:07.174687",
"modified": "2018-10-27 04:38:34.979129",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Reconciliation Detail",
Expand All @@ -337,4 +403,4 @@
"track_changes": 0,
"track_seen": 0,
"track_views": 0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ def populate_payment_entries(self):

def map_transactions_on_journal_entry(self):
for entry in self.new_transaction_items:
vouchers = frappe.db.sql("""select name, posting_date from `tabJournal Entry`
where posting_date='{0}' and total_credit={1} and cheque_no='{2}' and docstatus != 2
vouchers = frappe.db.sql("""select jv.name, jv.posting_date
from `tabJournal Entry` jv, `tabJournal Entry` jvd
where jvd.parent = jv.name and jv.docstatus != 2
and jv.posting_date='{0}' and jv.total_credit={1} and jvd.cheque_no='{2}'
group by jv.name, jv.posting_date
""".format(entry.transaction_date, abs(entry.amount), frappe.safe_decode(entry.description)), as_dict=True)
if (len(vouchers) == 1):
entry.reference_name = vouchers[0].name
Expand Down
Loading