[Discussion] Expenses Module For ERPNext

Hello everyone,

As far as I know, ERPNext does not have a specific module for handling and tracking Expenses expect the Expense Claim in the HRM module.

Because of that a plugin called ERPNext Expense Requests / Expense Entry was created but it has not been updated for a long time.

For the same reason and based on that plugin, I thought of recreating the plugin to serve the same purpose but in a more broader way and it will be great if later ERPNext agreed to include it in their release.

So in this post I would like to know the usefulness of such plugin for you and I also would like to discuss every part of it to determine the needs that such plugin must serve and to receive suggestions from you.


Lets Start

1. Expense Entry

This doctype is the heart of the module, it stores the expenses of a company and the expenses entries will be inserted into the Journal Entry doctype.

It can be used to record expenses based on an Expense Request or not and to mark the expenses as advanced if they are.

Each entry will remain as draft until submitted then it will be recorded as a Journal Entry.

Do you think that Expenses module is needed?
  • Yes
  • No

0 voters

If you choose (No) in the previous pool, then there is no need for you to continue.

2. Expense Item

This doctype is similar to Item doctype in ERPNext but for storing expenses (both general and specifics) like Travel and Traveling Ticket.

It also stores the Account that the expense will be recorded against, default expense amount & currency and can specify whether the amount is fixed or changeable on request.

Such doctype exists in Odoo so I thought that it can exist in the Expenses module to add control over the things that the employee can create an Expnse Request for.

Do you think that Expense Item is needed?
  • Yes
  • No

0 voters

3. Expense Request

This doctype stores the requests of single or multiple expenses.

The employee create a request to notify the management of the exepenses that must be made and whether it is project related or not.

Employees can only read/write personal requests and the request created will remain as draft until submitted.

The Expense Approver users will be able to Approve, Reject or Cancel the employees requests and when a request is approved, an Expense Entry is immediately created for this request.

Do you think that Expense Request is needed?
  • Yes, record multiple expenses and treated as one when Approve or Reject
  • Yes, record multiple expenses and treated separately when Approve or Reject
  • Yes and only record a single expense
  • No

0 voters


4. Expense type

This doctype stores types of Expense Item like Travel as parent and Plane Ticket & Hotel Room as children. It is also used to create types total expenses report and chart.

Do you think that Expense Type is needed?
  • Yes
  • No

0 voters


That’s all that I have in mind for the Expenses module and I hope that I was able to explain the idea perfectly.

Your suggestions and comments will be appreciated.

Best regards

7 Likes

Draft #7


Expense Type :ballot_box_with_check:

Fields
  • Title
    (Required & Unique, Data)
  • Is Disabled
    (Optional, Check, Default: False)
  • Parent Type
    (Optional, Link, Expense Type)
  • Is Group
    (Optional, Check, Default: False)
  • Expense Accounts
    (Required if not group else Hidden, Table, Expense Account)

Expense Account :ballot_box_with_check:

:exclamation: Used by both, Expense Type and Expense Item

Fields
  • Company
    (Required, Link, Company)
  • Expense Account
    (Required, Link, Account)

Expense Item :ballot_box_with_check:

Fields
  • Name
    (Required & Unique, Data)
  • Is Disabled
    (Optional, Check, Default: False)
  • Expense Type
    (Required, Link, Expense Type)
  • Expense Accounts
    (Optional, Table, Expense Account, Use to override the expense accounts set by the expense type)
  • Expense Rules
    (Optional, Table, Expense Rule)

Expense Rule :ballot_box_with_check:

Fields
  • Company
    (Required, Link, Company)
  • Custom Currency
    (Optional, Check, Default: False, Enable to change the expense currency)
  • Currency
    (Required if custom currency else Read Only, Link, Currency)
  • Flexible Currency
    (Optional if custom currency else Read Only, Check, Default: False, Enable to unrestrict the expense currency)
  • Allowed Currencies
    (Optional if flexible currency else Read Only, Table MultiSelect, Expense Rule Currency, Use to limit the choices for the expense currency)
  • Cost
    (Optional if not flexible currency else Read Only, Float, Default: 0, Use to define a fixed expense cost)
  • Cost Currency
    (Required if flexible currency and minimum or maximum cost is set else Read Only, Currency, Used for comparing the user entered cost against both minimum and maximum cost)
  • Minimum Cost
    (Optional if cost is zero else Read Only, Float, Default: 0, Use to restrict the minimum expense cost)
  • Maximum Cost
    (Optional if cost is zero else Read Only, Float, Default: 0, Use to restrict the maximum expense cost)
  • Quantity
    (Optional, Float, Default: 0, Use to restrict the expense quantity)
  • Minimum Quantity
    (Optional if quantity is zero else Read Only, Float, Default: 0, Use to restrict the minimum expense quantity)
  • Maximum Quantity
    (Optional if quantity is zero else Read Only, Float, Default: 0, Use to restrict the maximum expense quantity)

:warning: If Flexible Currency is allowed and either Minimum Cost or Maximum Cost is set then the user entered cost will be converted from the user selected currency to the Cost Currency when compared against Minimum Cost or Maximum Cost.


Expense Rule Currency :ballot_box_with_check:

Fields
  • Currency
    (Required, Link, Currency)

Expenses Request

Fields
  • Company
    (Required, Link, Company)
  • Mode of Payment
    (Required, Link, Mode of Payment)
  • Posting Date
    (Required if permlevel 1 else Hidden, Date, Default: Today)
  • Required By :information_source:
    (Optional, Date, Default: Today)
  • Default Project :information_source:
    (Optional, Link, Project)
  • Expenses
    (Required, Table, Expense Data)
  • Remarks
    (Optional, Small Text, Allowed after submit)
  • File Attachments
    (Optional, Table, Expense Attachment, Allowed after submit)

Expense Data

:exclamation: Used by both, Expense Request and Expense Entry

Fields
  • Expense Item
    (Required, Link, Expense Item)
  • Currency
    (Required if flexible item currency else Read Only, Link, Currency)
  • Cost
    (Required if flexible item cost else Read Only, Float)
  • Quantity
    (Required if flexible item quantity else Read Only, Float, Default: 1)
  • Exchange Rate
    ⚠️ Used by Expense Entry only
    (Required if flexible item currency else Read Only, Float, Default: 1)
  • Total Cost
    (Read Only, Currency)
  • Is Advance :information_source:
    (Optional, Check, Default: False)
  • Description
    (Optional, Small Text)
  • Project :information_source:
    (Optional, Link, Project, Default: Default project)
  • Cost Center :information_source:
    ⚠️ Used by Expense Entry only
    (Optional, Link, Cost Center, Default: Default cost center)

Expense Attachment :ballot_box_with_check:

:exclamation: Used by both, Expense Request and Expense Entry

Fields
  • Expense Item
    (Required, Link, Expense Item)
  • File
    (Required, Attach)
  • Description
    (Optional, Data)

Expenses Entry

Fields
  • Company
    (Required, Link, Company)
  • Mode of Payment
    (Required if has company else Read Only, Link, Mode of Payment)
  • Posting Date
    (Required, Date, Default: Today)
  • Default Project :information_source:
    (Optional, Link, Project)
  • Default Cost Center :information_source:
    (Optional, Link, Cost Center)
  • Expenses
    (Required, Table, Expense Data)
  • Remarks
    (Optional, Small Text)
  • Exchange Rate
    (Optional, Float, Default: Auto fetch of latest rate)
  • Total
    (Read Only, Currency, Default: Sum of expense total field from expenses converted to total currency)
  • Total Currency
    (Read Only, Link, Currency, Default: Company account currency linked with mode of payment)
  • Payment Reference
    (Required if mode of payment type is bank else Read Only, Data)
  • Reference / Clearance Date
    (Required if mode of payment type is bank else Read Only, Date)
  • File Attachments
    (Optional, Table, Expense Attachment)

Your suggestions are highly appreciated


Last Update: 18/10/2022

1 Like

Discussion


  • Should the Expense Type have multiple levels (Tree) or only just one level? :ballot_box_with_check:
    Yes, must be of multiple levels (Tree)

  • Should there be a table to add companies and their respective expense account for each type or item? :ballot_box_with_check:
    Yes, for each Expense Type

  • Can the cost of an Expense Item be in a different currency than the company’s expense account? Or it should be the same? :ballot_box_with_check:
    Yes and exchange rates can be automatically fetched and manually changed when creating an Expense Entry

  • Should the Expense Request be used for expense claims?

  • Should the Expense Request be linked to a project? :ballot_box_with_check:
    Yes, but optional

  • Should the Expense Request be linked to a cost center?

  • Can the cost of an Expense Item in the Expense Request be an advance payment like Insurance or Internet Service?

  • Should the Expense Request have a total field to sum all the expenses cost, keeping in mind the expense currency difference?

  • When calculating the expense item total cost for the Journal Entry in the Expense Entry, is it better to convert the cost into the expense account currency then the payment account currency (Cash, Bank) or convert the cost to the payment account currency directly?


Please help me make a decision.
Your contribution is much appreciated.

Multiple levels of expense type imo.
For example, for an overnight sales and delivery trip, one may need to give some funds to the employee, in advance, this can be for fuel expenses, hotel allowance, food allowance, emergency funds, etc. But this all can be grouped under trip expenses. And another subgroup for vehicle expenses to include fuel exp, and maintainence exp, another subgroup for employee allowance to include food allowance and living accom. Allowance.
I’m just getting started with this, and have not recorded any expenses yet, as there is nothing straightforward about recording expenses inbuilt.

1 Like

I think each company can have its own expenses managed seperately. I personally have had a bit of a headache trying to enter purchase invoices in a foreign currency, so i’m not banking on the forex functionality at all

1 Like

@Nirmal_Balani Thank you so much for your comments, it really helped me a lot…

1 Like

It can be different in some cases.

1 Like

@Saumyaseelan_Pv Thank you so much for your comment. You have helped a lot…

Hi, any progress on this?

1 Like

@Nirmal_Balani Almost done with the Alpha version. I’m looking for some volunteer tester, so are you able to contribute to the testing phase?

1 Like

Yes, will do gladly

2 Likes

I also want to do testing. please guide me how to test it.

1 Like

Alpha #2


Expenses Settings :ballot_box_with_check:

Fields
  • Auto Check For Update (Daily)
    (Optional, Check, Default: True)
  • Send Update Notification
    (Optional, Check, Default: True)
  • Update Notification Sender
    (Required if send update notification else Read Only, Link, User)
  • Update Notification Receivers
    (Required if send update notification else Read Only, Table MultiSelect, Expenses Notification Receivers)
  • Update Note
    (Read Only, HTML)
  • Latest Version
    (Read Only, Data)
  • Latest Check
    (Read Only, Data)
  • Check Now
    (Optional, Button)

Expenses Notification Receiver :ballot_box_with_check:

Fields
  • User
    (Required, Link, User)

Expense Type :ballot_box_with_check:

Fields
  • Name
    (Required, Data)
  • Is Disabled
    (Optional if not new else Hidden, Check, Default: False)
  • Is Group
    (Optional if new else Hidden, Check, Default: False, Type items can only be created under Groups and Expense Items can only belong to type items)
  • Parent Type
    (Required if is not group else Optional, Link, Expense Type)
  • Expense Accounts
    (Optional, Table, Expense Account)

Expense Item :ballot_box_with_check:

Fields
  • Name
    (Required, Data)
  • Is Disabled
    (Optional if not new else Hidden, Check, Default: False)
  • Expense Type
    (Required, Link, Expense Type)
  • Expense Accounts
    (Optional, Table, Expense Account, Use to customize the expense defaults)

Expense Account :ballot_box_with_check:

:large_blue_circle: Used by both, Expense Type and Expense Item

Fields
  • Company
    (Required, Link, Company)
  • Expense Account
    (Required for Expense Type else Optional, Link, Account)
  • Cost (:warning: Only For Expense Item)
    (Optional, Currency, Default: 0, Use to set a fixed expense cost)
  • Minimum Cost (:warning: Only For Expense Item)
    (Optional, Currency, Default: 0, Use to set a minimum expense cost but will be ignored if a fixed expense cost is set)
  • Maximum Cost (:warning: Only For Expense Item)
    (Optional, Currency, Default: 0, Use to set a maximum expense cost but will be ignored if a fixed expense cost is set)
  • Quantity (:warning: Only For Expense Item)
    (Optional, Float, Default: 0, Use to set a fixed expense quantity)
  • Minimum Quantity (:warning: Only For Expense Item)
    (Optional, Float, Default: 0, Use to set a minimum expense quantity but will be ignored if a fixed expense quantity is set)
  • Maximum Quantity (:warning: Only For Expense Item)
    (Optional, Float, Default: 0, Use to set a maximum expense quantity but will be ignored if a fixed expense quantity is set)

Expense :ballot_box_with_check:

Fields
  • Company
    (Required, Link, Company)
  • Expense Item
    (Required, Link, Expense Item)
  • Required By
    (Required, Date, Default: Today)
  • Description
    (Optional, Small Text)
  • Currency
    (Read Only, Link, Currency)
  • Cost
    (Required if not fixed cost else Read Only, Currency)
  • Quantity
    (Required if not fixed quantity else Read Only, Float)
  • Total
    (Read Only, Currency)
  • Is Paid
    (Optional if no HRM else Hidden, Check, Default: False)
  • Paid By
    (Required if no HRM and is paid else Hidden, Link, User)
  • Is Advance
    (Optional, Check, Default: False)
  • Party Type
    (Optional, Link, Party Type, Use only if expense is party related)
  • Party
    (Required if party type else Read Only, Dynamic Link, Supplier/Customer)
  • Project
    (Optional, Link, Project, Use only if expense is project related)
  • Attachments
    (Optional, Table, Expense Attachment)

Expense Attachment :ballot_box_with_check:

:large_blue_circle: Used by both, Expense and Expenses Entry

Fields
  • File
    (Required, Attach)
  • Description
    (Optional, Small Text)

Expenses Request :ballot_box_with_check:

Fields
  • Company
    (Required, Link, Company)
  • Posting Date
    (Required if permlevel 1 else Hidden, Date, Default: Today)
  • Expenses
    (Required, Table, Expenses Request Expense)
  • Remarks
    (Optional, Small Text)

Expenses Request Expense :ballot_box_with_check:

Fields
  • Expense
    (Required, Link, Expense)

Expenses Entry :ballot_box_with_check:

Fields
  • Company
    (Required, Link, Company)
  • Mode of Payment
    (Required, Link, Mode of Payment)
  • Posting Date
    (Required if permlevel 1 else Hidden, Date, Default: Today)
  • Default Project
    (Optional, Link, Project)
  • Default Cost Center
    (Optional, Link, Cost Center, Default: Company Default Cost Center)
  • Expenses
    (Required, Table, Expenses Entry Account)
  • Remarks
    (Optional, Small Text)
  • Currency
    (Read Only, Link, Currency, Default: Mode of Payment Company Account Currency)
  • Total
    (Read Only, Currency)
  • Exchange Rate
    (Optional, Float, Default: 1)
  • Total In Company Currency
    (Read Only, Currency)
  • Payment Reference
    (Required if mode of payment type is bank else Hidden, Data)
  • Payment / Clearance Date
    (Required if mode of payment type is bank else Hidden, Date)
  • Attachments
    (Optional, Table, Expense Attachment)

Expenses Entry Account :ballot_box_with_check:

Fields
  • Expense Account
    (Required, Link, Account)
  • Description
    (Optional, Small Text)
  • Currency
    (Read Only, Link, Currency)
  • Cost
    (Required, Currency, Account Currency)
  • Exchange Rate
    (Optional, Float, Default: 1, From account currency to company currency)
  • Cost In Company Currency
    (Read Only, Currency)
  • Project
    (Optional, Link, Project, Use only if expense is project related)
  • Cost Center
    (Optional, Link, Cost Center, Default: Company Default Cost Center)
  • Is Paid
    (Optional if no HRM else Hidden, Check, Default: False)
  • Paid By
    (Required if no HRM and is paid else Hidden, Link, User)
  • Is Advance
    (Optional, Check, Default: False)
  • Party Type
    (Optional, Link, Party Type)
  • Party
    (Required if party type else Read Only, Dynamic Link, Supplier/Customer)

Your suggestions are highly appreciated


Last Update: 05/11/2022

1 Like

@Nirmal_Balani & @Pheakdey_Tes The alpha version is ready. If you want to test it please PM me your github username and I will give you access to the repo since it’s private…

ERPNext Expenses - Discord

Hey, what about tax details? (I didn’t see that, sorry if I have missed).

Functionally it should have a checkbox on expense form or some setting somewhere (UX need to be discussed) to add break-up with tax.

This to allow three different set of users, one who have understanding of taxes on expense invoice, two who don’t know, third those who don’t have invoices.
Tax entries facilitate tax credits and will constitute current assets for company.

1 Like

@jalajc Thanks a lot buddy for your contribution…

I meant to add taxing to the plugin but since my knowledge isn’t that good about taxes, I left it for future improvements…

My idea for taxes is to add tax account and tax amount or percentage to the expense accounts table which can be set in expense types or in expense items…

So please let me know what do you think about this approach to taxes and if you want to test the alpha version please PM your github username so I can give you access…

Dear users…

Now the plugin is public and accessible by everyone although it is still in the Alpha stage since only one person is helping by testing it…

So, feel free to give it a try and please report any bugs you find…

Best regards

4 Likes

Nice Work! Looking to try it out. I just have one question though. How are the expenses tracked? Are they tied to employees, users, or customers? This question is to enable me to determine if it fits my use case.

I currently use cash advance (for expense requests) and expense claim (for expense retirement/reporting) to manage expenses, using a single ledger to manage debit and credit. I would therefore like to know if this handles expenses in a similar manner before installation.

For now, it’s linked to users and if the expense is already paid it can be linked to an already paid Expense Claim…

The plugin is meant to work without HRM, but if HRM is installed then the link to paid expense claim can be used…

If you have any suggestion, please don’t hesitate to inform me…

Hi, great job on spotting Odoo’s expense feature not available in erpnext. I had also noticed that but just a user and tester and not a developer for now.

However, i observed that the expense type does not save even when you select “Is group”

I also believe the expense type selection rather than selecting the expense general ledger. Since the app is a workflow that may cut across department, other department such as admin and marketing may not know the appropriate GL to select which is why I love the idea of the expense item because the accountant would have configured that already and anyone selected will just inherit the GL

Also it would be nice to have 2 fields read only

  1. that can display the total amount of spent for that expense type for the financial year.
  2. Display the balance left the in budget for that expense either for the month or year of the data has been populated in budget.

I know this may not be possible with the multiple expense selection which I why I recommend a dependency where at the start you can select single or multiple expense. I’m which case if it is single the filed for 1 and 2 above will show and if multiple it won’t show.

One of the challenges accountants face is the need to know the total expenses already expended in a GL and what is left in the budget. This helps them to take an informed decision rather than wonder what caused a budget variation.

These are my contribution. And good job to all the contributors as well

1 Like