1. Home
  2. Docs
  3. Sales & Marketing
  4. ERPNext Customizations for Marketing

ERPNext Customizations for Marketing

Salutation List

  • Mr. (default for male)
  • Ms. (default for female)
  • Miss
  • Mrs.

Customer Group Tree

All Customer Groups

  • Commercial
  • Government
  • Individual
  • Non Profit

Territory Tree

Make sure to have: Indonesia, as this is currently used (hardcoded) by Lovia Billing to create new Customer.

MongoDB Additional Fields

CollectionFieldTypeDescription
usercustomerIdStringName of ERPNext Customer document

Contact & Customer – Customizations

Note: The following doctype customization is done via custom app “lovia”.

FieldTypeDescriptionUsed By
SSO ID (Contact.sso_id, Customer.sso_id)StringCustomer user ID in FusionAuth SSOLovia Billing
Miluv v4 ID (Contact.miluv_v4_id, Customer.miluv_v4_id)IntegerMiluv v4 user ID as 32-bit integerLovia Billing
Lovia username (Contact.lovia_username, Customer.lovia_username)StringUsername used by Miluv and LoviaLovia Billing

Subscriptions

Subscription PlanCost Center
Miluv Plus – Lifetime
Miluv Plus – Bonus
(not yet used, because: You can only have Plans with the same billing cycle in a Subscription)
Miluv Silver – 3 monthsLove Counseling – L
Miluv Silver – 6 monthsLove Counseling – L
Miluv Silver – 1 yearLove Counseling – L
Miluv Silver – 2 yearsLove Counseling – L
Miluv Silver – 3 yearsLove Counseling – L
Miluv Silver – 5 yearsLove Counseling – L

Important:

  • You must already have an active Fiscal Year at the transaction date, otherwise transaction will fail immediately.
  • Make sure your items has an Item Price with proper Valid From, otherwise price will be 0.

For subscriptions, technically we should use ERPNext Subscriptions and Subscription Plan, but this seems to require deeper integration than directly creating Sales Invoice and Payment Entry. To execute Subscriptions > Fetch Updates, you need to set at least Company’s Default Income Account (4110.xxx).

Watch out of bug #23681. Workaround: In the Subscription Plan, use Price List, then set the price using Item > Item Price. This means that each subscription plan needs to have its own Item.

Based on Subscription Form UI, to call Fetch Subscription Updates via REST API, POST to https://erp-staging.lovia.life/api/method/erpnext.accounts.doctype.subscription.subscription.get_subscription_updates. This is implemented by erpnext/erpnext/accounts/doctype/subscription/subscription.py which calls Subscription::process().

Curiously, it is able to refresh the form UI, not like when we used custom Server Action. Probably because it uses JavaScript frm.add_custom_button() instead:

	refresh: function(frm) {
				...
				frm.add_custom_button(
					__('Fetch Subscription Updates'),
					() => frm.events.get_subscription_updates(frm)
				);
				...
	},

Input is JSON object of subscription name:

{
    "name": "ACC-SUB-2020-00001"
}

Successful response is always {}.
The problem with Subscription is you can only customize discount per subscription, but can’t customize the invoice amount on a per-invoice basis, so you’ll need to account for that during Payment Entry (deduction).

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *