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

Added PDC from journal entry in AR report #12844

Merged
merged 1 commit into from
Feb 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions erpnext/accounts/report/accounts_receivable/accounts_receivable.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,21 @@ def get_pdc_details(party_type):
group by pref.reference_name""", party_type, as_dict=1):
pdc_details.setdefault(pdc.invoice_no, pdc)

for pdc in frappe.db.sql("""
select
jea.reference_name as invoice_no, jea.party, jea.party_type,
max(je.cheque_date) as pdc_date, sum(ifnull(je.total_amount,0)) as pdc_amount,
GROUP_CONCAT(je.cheque_no SEPARATOR ', ') as pdc_ref
from
`tabJournal Entry` as je inner join `tabJournal Entry Account` as jea
on
(jea.parent = je.name)
where
je.docstatus = 0 and je.cheque_date > je.posting_date
and jea.party_type = %s
group by jea.reference_name""", party_type, as_dict=1):
pdc_details.setdefault(pdc.invoice_no, pdc)

return pdc_details

def get_dn_details(party_type):
Expand Down