Payment Entry not created

I’ve updated my charts of accounts (but did not touch the bank accounts) and now when try to make any sales or purchase invoices, 2 things happen:

  1. The prices are not reflected, all showing 0
  2. This error comes up: “Note: Payment Entry not created since ‘Cash/Bank Account’ was not specified”

Any ideas how to fix that?

This is the if.else error in the sales_invoice.py file… Can somebody please explain to me what’s the issue here and how to fix it?

	# Set default warehouse from pos setting
	#----------------------------------------
	if cint(self.doc.is_pos) == 1:
		self.set_actual_qty()
		w = self.get_warehouse()
		if w:
			for d in getlist(self.doclist, 'entries'):
				if not d.warehouse:
					d.warehouse = cstr(w)

		if flt(self.doc.paid_amount) == 0:
			if self.doc.cash_bank_account: 
				webnotes.conn.set(self.doc, 'paid_amount', 
					(flt(self.doc.grand_total) - flt(self.doc.write_off_amount)))
			else:
				# show message that the amount is not paid
				webnotes.conn.set(self.doc,'paid_amount',0)
				webnotes.msgprint("Note: Payment Entry not created since 'Cash/Bank Account' was not specified.")

This is v4! What is the error trace?

This pop up error shows up whenever I try to make any sales invoice, sales order, quotation or pretty much everything that involves selecting a product. I’m not sure where to look for the error trace exactly, but I can definitely check find it if you just show me where to look.

To clarify, there’s no error showing up in the error snapshots menu, it’s just a pop up notification. I think if we knew why the prices are not reflected and showing as zeros, that should fix it.

With that said, I already checked the mode of payment, cash/credit bank and both are selected correctly.

Any thoughts?

This is the only change I’ve made is changing the charts of accounts to match my country/company preferences. Here it is…

@Hiato not able to understand what your error is and the code snippet you showed.

When I select any item to sell or purchase, its price doesn’t get reflected, instead, it shows as zeros and I have to manually change the price. When I hit save the sales or purchase or whatever order I’m in, a notification shows up at the top of the page saying “Note: Payment Entry not created since ‘Cash/Bank Account’ was not specified”

I searched for this error within the whole code and the only place i could find it is in sales_invoice.py module which i pasted here…

Hope that makes it more clear.

Any luck?

Do you maintain price lists?

Do you have customizations?

Yes I do maintain price lists and items prices as well.

And no, i don’t have any customization other than an updated accounts chart.

Hard to guess. Can you replicate it on demo.erpnext.com (or a new erpnext account)?

Ok I’ll try and let you know…

You are still using version 4. It is really difficult to guess the exact issue.

Seems like, you did not set “Bank/Cash Account” in POS Settings. Thats why you are getting that message.

@nabinhait No I’m not using v4, I’m using the latest version… I just searched for the popup error that I get and only found it in the above py module, hence posted it.

I did not find any such code in erpnext repo. Also all the functions used in that code is from version 4 only.