How to be able to have different organized ledgers for fully separated companies

Hi Community,
Currently i run the GrowERP system on top of Moqui as a SAAS system where all companies are completely separated. The system is working well except one point: I can only have a single ledger organization.

What would be the best way of implementing the possibility of having separate ledgers?

I looked into this and see there is an organizationPartyId field required in the GlAccount entity or this entity should be merged with the GlAccountOrganization entity.

is this the right way to go, or are there any other possibilities?


Further thinking,

when a user has set his company preference, all reads by the framework could use this using the ownerPartyId to select, which is already present in many entities
Also for write operations, the ownerPartyId can be automatically filled with the preference.

This would make the moqui system a multicompany SAAS system?

after some more study…
another possibility is to treat the system ledger account number (GlAccount) just as a number with no meaning, and put the actual glAccount number into the accountCode field, then when using the entity GlAccountOrganization in the view GlAccountAndOrganization still the correct ledger will be used. Not sure about the impact on other parts of the system.

then using several different defaultSettings templates which can be loaded, different ledger organizations can be used at the same time.

If anybody has some thoughts on this i would appreciate a comment.

1 Like

Hi @hansbak , have you looked at accounting settings? Each internal organization can have its own GL account structure. See screenshot. The settings link to the right of each record is where you setup the GL.

1 Like

Thanks Vince, sure i saw that, however this is all based on the same ledger accounts,
My understanding is that you can only just select or not select a glAccount, not a completely different organization.

Maybe I am misunderstanding your requirement. It sounds like you are using internal organizations as a way to separate your SaaS customers in the same instance. And each one of these needs their own chart of accounts (CoA), is this correct?
It is possible to define different chart of accounts (CoA) for each organization. There is a default CoA available with seed data but you can change those and use that as the basis for new internal orgs. As an example, Ziziwork Sales has not been setup yet. When you click the clone button it will add the CoA specific to that organization based on the selected accounting settings.

Having said all that, have you considered just running separate instances for each of your clients?

1 Like

Vince, thanks for your reply and yes i would like different ledger organizations for different companies…currently they can only be selected from the default settings.

And since the accountCode in the GlAccount has a unique index, different companies cannot have have the same accountCode for different GlAccounts.

I am now implementing my reply from march 24 and apart from this index…this could work…

There is a single table for GlAccount and while each organization can use a subset of that fill set of GL accounts the superset of all GL accounts used across all organizations would have to be in the GlAccount table.

If you have different companies with very different charts of accounts that will get messy, but could be done.

1 Like


I, correctly understand, to organize work according to the SaaS type (renting).

  1. Need to install Moqui Marble ERP on the server?
  2. And, to manage client ERP, deploy and connect HiveMind?
  • Purpose: to install ERP and integrate additional framework solutions to it in order to expand the functionality of ERP, as an option through MDM (master data management). After that, offer various campaigns to rent (by SaaS type) Marble ERP.
1 Like

For SaaS type renting, I’m not sure how much work has been done on this. Without much code modification I would have separate instances of moqui for each client with Marble ERP, HiveMind, and whatever other components needed installed.

For managing the client ERPs, it’s a bit more tricky. If you are fully managing it, then you would give your clients user access to the applications, but not give them admin privileges while only you or your team would have admin privileges. This means that you would need to fix problems in data and educate your users on how to use moqui. Another option is allowing your client to have admin access. This is a bit more tricky because they might accidentally remove you from accessing the server and to help them you’d need to go into the database with sql and add yourself or whatever. This would require less maintenance once your clients users have been educated, but it would be more education on the internals of how moqui works.

If you are interested in doing more code modification, segregating user organizations, and having more than one client on one machine, get in touch. I’d like to have a conversation with what you’re thinking about doing, and maybe we can figure something out.

Also, rather than commenting on another post, next time please just create another post.

I did the implementation , and it looks likes it works fine, however just using the REST interface.
In the Rest Interface I make sure that userlogins are always connected to a company, and this companyPartyId is used to access the data using the ownerPartyId field which is present in most enities.

Concerning the ledger i treat the glAccountId just as an id and let the system allocate them at creation. the actual accountId field is now used. To make this work you have to make the index on this field nonUnique

Further, on company creation time a new ledger need to be created either from the default settings or being uploaded making sure the glAccountId is created by the system.

All this is open source:
frontend at GitHub - growerp/growerp: GrowERP Flutter Administrator front-end & Hotel & Ecommerce for Android, IOS and Web using, Apache OFBiz
backend moqui component at: GitHub - growerp/growerp-moqui: GrowERP backend component for the framework and ERP. Used by the growerp flutter frontend when using

check the README for installation.

  • At the same time, do you register individual companies as separate accounts manually? Then, how are employees entered into the list of a particular company?

It’s just that in my understanding, there are tariffs in SaaS, and for example, Tariff Lite - where the company is limited to the number of users, for example 10 accounts for one company.

And another such moment. SaaS often assumes that an individual client will have its own access to the API. How can this issue be resolved?

Again, the system is only accessed using the REST interface where i created my own endpoints. In these custom endpoints i can do processing and security before calling the Moqui service.
So your example can be implemented in the custom loginUserADD endpoint, where the existing userLogins can be checked before adding a new one.

regarding access as I wrote before, again using custom REST endpoints, all logins party id’s have a relationship to the company they belong to, and this company is checked in the ownerPartyId in the various entities. You can check the implementation in the moqui GrowERP component at


Thank you! But what if I want to limit for one company not only the number of its users (employees), but also the number of gigabytes, for example: 10 GB. for one company?

that gets more difficult, what you can implement fairly easy is the to limit the revenue or number of products or suppliers or customers?

  • According to the logic in SaaS, one should limit for one company:
  1. Number of users (employees).
  2. Disk quota (GB). If this is not possible, then it is really possible to limit the number of products (for example: under the “Light” tariff to 1000 products) - however, the question will arise here: "a product can also have media content (video, photos, 3d), which means that one company can take 1-2 GB, and the other may be small and 10 GB. - how to be?

you could add the sizes of all images for a company…on the other hand is disk size so important?
Again this is all with the flutter growerp frontend, not with the moqui screens?

  • On the one hand, it seems like yes. After all, one SaaS server can serve 100 companies or 10 companies, the cost of service will vary greatly.

Do you additionally provide separate access to the API via SaaS so that the company can integrate with third-party services/services if necessary?

The API is available not only to the flutter app, but to any app following the same access procedures. Documentation can be found at the website

Allow me one more question.

If I integrate a separate CRM framework into Moqui via API. What would you recommend to achieve my SaaS goal?


One panel for company users (ERP and CRM).
Lack of double authorization (so that you do not have to log in each time separately in each system).

Thank you.