Trying to record a Payment Entry against a Donation, but it throws my accounts out of whack, since the donation doesn’t get added to the accounts receivable (only paid from from it).
What am I doing wrong?
Pictured: the balance sheet after a payment entry against a 180$ donation (the $7.32 is the PayPal fee, listed on the payment entry as a deduction).
Have you booked this as income at any point, either via an invoice/receipt or a journal entry? Before you take money out of accounts receivable, you need to get it in there first.
That’s exactly what I’m trying to figure out how to do.
As I mentioned, I created a Donation, and then am issuing a Payment Entry against that, as written in the Docs. Shouldn’t the donation be the income that gets it into accounts receivable? And if not, then what am I missing?
That’s really weird. Looking at the doctype code, nothing suggests that ledger entries are being created at any point. Without ledger entries, I’m not really sure what the point of the doctype actually is, since it’s not booking the income. It shouldn’t be too difficult to add this, but right now it doesn’t do that automatically.
Yeah, that’s probably how I’d do it. In theory, it could be done with a relatively simple custom script, but I’d be reluctant to do too much customization around ledger entries.
I am trying to use the module too. Same observation. The donation entry does nothing. The payment enry actually posts in the bank and leaves the same amount in the receivable so the total current asset remains the same. The money in receivables should go to the income account. I then had to do a manual journal entry to post from receivable to the income account. I guess this is the part that would need automation.
Strange modules. Seems incomplete or there is an assumption somewhere.
For anyone interested, I have resolved mine. I am sure others have too. You need to create a python script in your custom app (not in the server script from erpnext) and then update the hook for you doc_event in the hook.py of your custom app. So i created a custom folder under my app. custom_app/custom/donation_entry.py
@frappe.whitelist() # Allows the function to be called via API
def create_journal_entry(doc, event):
doc = frappe.get_doc(“Donation”, doc.name)
je = frappe.new_doc("Journal Entry")
je.posting_date = doc.date
je.company = doc.company
je.remark = f"Donation from {doc.donor_name} at {doc.donor}"
# Get correct accounts (update these to match your Chart of Accounts)
receivable_account = "1310 - Debtors - OSI"
donation_income_account = "4130 - Donations - OSI"
bank_account = "1210 - GT Bank - OSI"
je.append("accounts", {
"account": receivable_account,
"debit_in_account_currency": doc.amount,
"party_type": "Donor", # Ensure Donor is correct
"party": doc.donor
})
je.append("accounts", {
"account": donation_income_account,
"credit_in_account_currency": doc.amount
})
je.save()
je.submit()
if doc.paid:
pe = frappe.new_doc("Payment Entry")
pe.payment_type = "Receive"
pe.party_type = "Donor"
pe.party = doc.donor
pe.paid_from = receivable_account
pe.paid_to = bank_account
pe.paid_amount = doc.amount
pe.received_amount = doc.amount
pe.reference_no = doc.name
pe.reference_date = doc.date
pe.save()
pe.submit()
return f"Journal Entry and Payment Entry created for {doc.name}" #(Not relevant)
frappe.msgprint(f"Journal Entry and Payment Entry created for {doc.name}") #(Pops a message on submit)