ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Dead Community?


#1

I asked a question, no one answered.

Thats it :slight_smile:


#2

This would require you to enter SMS API settings in this SMS Settings Page.

Then on the hook on_submit, write a function that utilises the inbuilt send_sms function to send an sms to the Debtor and the Creditor. I believe their details will have to fetched from the child table Journal Entry Account

In Hooks.py of your custom app

doc_events = {
	"Journal Entry": {
		"on_submit": "your_app.your_module.file_name.function_name",
	},

Then in the file,

from frappe.core.doctype.sms_settings.sms_settings import send_sms

def jv_send_sms(doc, method):
	
	message = "{} Amount has been processed".format(doc.total_amount)
	contact_numbers = []

	for row in doc.get('accounts'):
		if row.party_type = "Customer":
            contact_numbers.append(row.party.mobile_no)

    send_sms(contact_numbers, message)

This code can stay in your custom app which will let ERPnext code stay untouched.

I was not sure about Accounts situation, I’ve been really bad at understanding this credit and debit situations. However if you give a screenshot with dummy data, I’ll let you know how to fetch those data. One more thing :

In the statement: contact_numbers.append(row.party.mobile_no) I’m assuming you are using Version 11 on the master branch. I know that as of this version, each time a customer is saved a primary contact is linked to the Customer with relevant phone details.


Retreive the total Credit and Debit and the the Debtor and Creditors mobile number
#6

I sent multiple posts because apparently new users cannot post more than 1 image in one post… which is just dumb. But oh well :smiley:

EDIT: Ok, nvm. Figured the other part out (Ignore this if you haven’t seen this prior to the edit :stuck_out_tongue:)

Thank You so much for your time, I really appreciate it :slight_smile:


#7

Also, here’s what the saved Mobile Number looks like: