Back-dating memberships

How can I back-date a membership period? for some reason, the “validity” from date can only be today’s date or later.

For my annual memberships, I need to show that a some users paid for the period from Apr1 2020 to Mar31 2021. It keeps forcing the dates to May18 2020 and May18 2021.

Thx
S

Aha, so it appears it is hardcoded that you can’t change the “from date” unless you are logged in as “administrator” as you can see from:

https://github.com/frappe/erpnext/blob/develop/erpnext/non_profit/doctype/membership/membership.py:

	# if person applied for offline membership
	if last_membership and not frappe.session.user == "Administrator":
		# if last membership does not expire in 30 days, then do not allow to renew
		if getdate(add_days(last_membership.to_date, -30)) > getdate(nowdate()) :
			frappe.throw(_('You can only renew if your membership expires within 30 days'))

		self.from_date = add_days(last_membership.to_date, 1)
	elif frappe.session.user == "Administrator":
		self.from_date = self.from_date
	else:
		self.from_date = nowdate()

	if frappe.db.get_single_value("Membership Settings", "billing_cycle") == "Yearly":
		self.to_date = add_years(self.from_date, 1)
	else:
		self.to_date = add_months(self.from_date, 1)

Now, my next question is, where is the “Membership settings” doctype? I see that it is what they call a “Single DocType” but I can’t find it in the GUI anywhere.

Were you able to update this somehow? Any progress on this? We receive the following error on member:

App Versions

{
	"erpnext": "13.34.0",
	"frappe": "13.33.0",
	"iflliler": "0.0.1"
}

Route

Form/Member/NPO-MEM-2022-00001

Trackeback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 69, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 38, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 76, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1448, in call
    return fn(*args, **newargs)
TypeError: get_last_membership() missing 1 required positional argument: 'member'

Request Data

{
	"type": "POST",
	"args": {},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/erpnext.get_last_membership"
}

Response Data

{
	"exception": "TypeError: get_last_membership() missing 1 required positional argument: 'member'"
}

Same here on ERPnext 13.39, getting on every member a

TypeError: get_last_membership() missing 1 required positional argument: 'member

Hi,

I had the same error. I wrote a bug report and also suggested a fix. You can follow the ongoing progress of the bug fix there:

1 Like

The membership is only possible for 30 days! How’s that for a logic? Anyone has any idea?

I just created a pull request to delete the forced 30-days period. According to the memberships code, there should be a setting in nonprofit settings to configure this, however there is no such setting.

In my opinion, this should not be forced and every organization should have the freedom to choose the billing cycle.

1 Like