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?
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.
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.
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.
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.
I, correctly understand, to organize work according to the SaaS type (renting).
Need to install Moqui Marble ERP on the server?
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.
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.
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
According to the logic in SaaS, one should limit for one company:
Number of users (employees).
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?