Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
create new company on a web host
06-05-2013, 08:20 PM, (This post was last modified: 06-05-2013, 11:58 PM by Buz.)
#11
RE: create new company on a web host
Thanks, Exson.

Phil gave me some advice that worked. This solution applies when there is an existing DB (that's logical - you must have an existing company before you can create a new one):

1. Create a new DB in your ISP's cpanel, named (eg) "newDB" (my ISP requires a prefix, so it might be "<prefix>_newDB"). Do NOT use a Database Wizard if it requires that a new user be created as well as the DB.
2. Assign the user to the new DB that is defined in config.php. In my case, it's "user", and assign ALL_PRIVILEGES to this user. This is key - do NOT create a new user. Assign the one in config.php. Do NOT use the ADD NEW USER function; use ADD USER TO DATABASE instead.
3. IMPORT tables from your existing webERP DB into the new DB; use EXPORT in your ISP's cpanel to create the SQL.
4. Run <your URL>/Z_MakeNewCompany.php. This is key: enter the new DB name in the company field. Upload Image Logo file. Do NOT set the Create Database? check box. Click Proceed.
5. Log in to webERP using the new company (ie: the new DB) from the Company drop list with User Name of "admin" and Password of "weberp".
6. Add a new user and delete the initial log in name.

Once I understood the rules, it took two minutes to create a new company. But we must especially understand these two key points:
1. webERP looks for the user to be the one defined in config.php. So you MUST assign this existing user to the new DB instead of creating a new user. In my cpanel, I use Add User To Database to choose the database and user.
2. Z_MakeNewCompany.php looks for the new company name to be the name of the new DB. This is the main point I missed. It's not intuitive that I should make the name my new company the same as the new DB name.

It would be great if some of you try this and provide feedback here so we can create a solid set of rules for creating a new company that works in all cases.

Some believe that info like this should be held close to the vest. That may make sense because webERP is open source and contractors may think that the way to earn a living is by selling knowledge like this.

But I believe otherwise. ALL info should be public and clear. Let contractors earn a living by building applications for clients.

I'm a happy camper now. I'm comforted that there are people like Phil and Exson who believe the way I do. Heart

Regards,
Buz
Reply
06-06-2013, 09:35 PM,
#12
RE: create new company on a web host
Hi, Buz:

I'm wondering if you can log in to the weberpdemo company after you've created the new company.

Best regards!

Exson
Reply
06-07-2013, 12:24 AM,
#13
RE: create new company on a web host
Hi Exson.

Yes I can. I now have 8 companies in my webERP login screen! Some do not work because I did not know how to set up a company properly until yesterday. When I choose a valid company and log in I see the company name displayed at the top right of the Main Menu window.

There will be more questions, like: can I do consolidated accounting, purchase order creation, etc if I have separate companies? The parent company may have a joint venture partner, a separate entity, but might like to take advantage of buying for both.

There is no end to questions in a serious ERP program. Isn't this fun?
Buz
Reply
06-07-2013, 07:33 AM,
#14
RE: create new company on a web host
There is no consolidation of companies - I have thought a bit about how to do this and have some ideas. Would be keen to explore if we have a client who wishes to support such a development :-)

Of course you can combine the order quantities to negotiate a better deal - but webERP doesn't combine planning across companies - there is no mapping of codes between companies or anything like that. Each company is completely independent of each other.
Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Reply
03-10-2014, 05:21 PM, (This post was last modified: 03-10-2014, 05:32 PM by jo lwebuga.)
#15
RE: create new company on a web host
(06-05-2013, 08:20 PM)Buz Wrote: Thanks, Exson.

Phil gave me some advice that worked. This solution applies when there is an existing DB (that's logical - you must have an existing company before you can create a new one):

1. Create a new DB in your ISP's cpanel, named (eg) "newDB" (my ISP requires a prefix, so it might be "<prefix>_newDB"). Do NOT use a Database Wizard if it requires that a new user be created as well as the DB.
2. Assign the user to the new DB that is defined in config.php. In my case, it's "user", and assign ALL_PRIVILEGES to this user. This is key - do NOT create a new user. Assign the one in config.php. Do NOT use the ADD NEW USER function; use ADD USER TO DATABASE instead.
3. IMPORT tables from your existing webERP DB into the new DB; use EXPORT in your ISP's cpanel to create the SQL.
4. Run <your URL>/Z_MakeNewCompany.php. This is key: enter the new DB name in the company field. Upload Image Logo file. Do NOT set the Create Database? check box. Click Proceed.
5. Log in to webERP using the new company (ie: the new DB) from the Company drop list with User Name of "admin" and Password of "weberp".
6. Add a new user and delete the initial log in name.

Once I understood the rules, it took two minutes to create a new company. But we must especially understand these two key points:
1. webERP looks for the user to be the one defined in config.php. So you MUST assign this existing user to the new DB instead of creating a new user. In my cpanel, I use Add User To Database to choose the database and user.
2. Z_MakeNewCompany.php looks for the new company name to be the name of the new DB. This is the main point I missed. It's not intuitive that I should make the name my new company the same as the new DB name.

It would be great if some of you try this and provide feedback here so we can create a solid set of rules for creating a new company that works in all cases.

Some believe that info like this should be held close to the vest. That may make sense because webERP is open source and contractors may think that the way to earn a living is by selling knowledge like this.

But I believe otherwise. ALL info should be public and clear. Let contractors earn a living by building applications for clients.

I'm a happy camper now. I'm comforted that there are people like Phil and Exson who believe the way I do. Heart

Regards,
Buz

Huh
Hello Friends
I know versions have changed since the post from BUZ, for now creating a new company on a hosted installation it doesn't seem to work for 4.11.3.

I have tried the above solution but i get

ERROR Message Report : This company cannot be added because either it already exists or no logo is being uploaded!
INFORMATION Message : _FILES[LogoFile] is not set
INFORMATION Message : _FILES[LogoFile][name] is blank


Though when using localhost server the Z_MakeNewCompany.php script works pretty well.


Reply
03-11-2014, 05:45 PM, (This post was last modified: 03-11-2014, 05:51 PM by jo lwebuga.)
#16
RE: create new company on a web host
(03-10-2014, 05:21 PM)jo lwebuga Wrote:
(06-05-2013, 08:20 PM)Buz Wrote: Thanks, Exson.

Phil gave me some advice that worked. This solution applies when there is an existing DB (that's logical - you must have an existing company before you can create a new one):

1. Create a new DB in your ISP's cpanel, named (eg) "newDB" (my ISP requires a prefix, so it might be "<prefix>_newDB"). Do NOT use a Database Wizard if it requires that a new user be created as well as the DB.
2. Assign the user to the new DB that is defined in config.php. In my case, it's "user", and assign ALL_PRIVILEGES to this user. This is key - do NOT create a new user. Assign the one in config.php. Do NOT use the ADD NEW USER function; use ADD USER TO DATABASE instead.
3. IMPORT tables from your existing webERP DB into the new DB; use EXPORT in your ISP's cpanel to create the SQL.
4. Run <your URL>/Z_MakeNewCompany.php. This is key: enter the new DB name in the company field. Upload Image Logo file. Do NOT set the Create Database? check box. Click Proceed.
5. Log in to webERP using the new company (ie: the new DB) from the Company drop list with User Name of "admin" and Password of "weberp".
6. Add a new user and delete the initial log in name.

Once I understood the rules, it took two minutes to create a new company. But we must especially understand these two key points:
1. webERP looks for the user to be the one defined in config.php. So you MUST assign this existing user to the new DB instead of creating a new user. In my cpanel, I use Add User To Database to choose the database and user.
2. Z_MakeNewCompany.php looks for the new company name to be the name of the new DB. This is the main point I missed. It's not intuitive that I should make the name my new company the same as the new DB name.

It would be great if some of you try this and provide feedback here so we can create a solid set of rules for creating a new company that works in all cases.

Some believe that info like this should be held close to the vest. That may make sense because webERP is open source and contractors may think that the way to earn a living is by selling knowledge like this.

But I believe otherwise. ALL info should be public and clear. Let contractors earn a living by building applications for clients.

I'm a happy camper now. I'm comforted that there are people like Phil and Exson who believe the way I do. Heart

Regards,
Buz

Huh
Hello Friends
I know versions have changed since the post from BUZ, for now creating a new company on a hosted installation it doesn't seem to work for 4.11.3.

I have tried the above solution but i get

ERROR Message Report : This company cannot be added because either it already exists or no logo is being uploaded!
INFORMATION Message : _FILES[LogoFile] is not set
INFORMATION Message : _FILES[LogoFile][name] is blank


Though when using localhost server the Z_MakeNewCompany.php script works pretty well.

Create a new database using in the cpanel <prefix>_weberpdb, import the default weberp db (version 4.11.3)

Copy and rename the existing company name under /webERP/company folder, replace the logo files with the dimensions of 170 x 80 px .

At this point ../webERP/company/ folder has 2 folders for the 2 companies

Edit the config.php file and add the lines below

error_reporting (E_ALL & ~E_NOTICE);
//Installed companies
$CompanyList[0] = array('database'=>'root_companyadb' 'company'=>'root_companyadb' );
$CompanyList[1] = array('database'=>'root_weberpdb' ,'company'=>'root_weberpdb' );

Ensure that the $DBuser in the config file has full privillages on your web server where the 2 databases are created.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)