[Discussion] Configurable rules for account selection (Income Account, etc.)

We’ve often seen cases where the Income Account selection needs to be more flexible than the available options to set defaults in Item/Item Group/Brand/Company.

Problem

  • Users having setups with multiple income accounts often find it hard to manually keep selecting the right income account while creating an invoice
  • The defaults set at the Item / Item Group / Brand / Company level are not flexible enough.
  • The use case is that we want a mix of conditions to determine the Income Account per Item Row:
    • Income Account “A” when:
      • Item Group = “Products”
      • & Customer = “ABC Industries”
      • & Tax Category = “Inland”
      • & Sales Invoice.field = “XYZ”
    • Income Account “B” when:
      • Item Group = “Products”
      • & Customer Group = “Internal Products”
      • & Tax Category = “Inland”

Suggestion

  • Introduce rules for Account selection similar to a “Tax Rule”.
  • This rule should cover default accounts (or maybe even other defaults in the image):
  • These rules should be given first priority for resolution > then the defaults in Item > Item Group > Brand > Company

Questions to the Community

Although I’ve seen a handful of posts where users have to write elaborate scripts to select the Income Account:

  1. What values in your case require more dynamic rules that are not supported out-of-the-box by ERPNext? (eg, Income Account, Expense Account, Cost Center, etc.)
  2. Can you give us an instance of what these conditions (to determine the account) look like?
  3. Are these account selection criteria mostly DocType specific or more general in your case?

There is an open issue for this topic as well: Dynamic Rules for Account Selection · Issue #47444 · frappe/erpnext · GitHub

2 Likes

We already have an app for that… let me check if I can share the link