FrontAccounting Change Default Company - Kvcodes
X

Congrats, You are Subscribed to Receive Updates.

FrontAccounting Change Default Company


Introduction

FrontAccounting Change Default Company is mostly a weird thing. But sometimes you might need to go with new company for another fresh instance, you will be in trouble to change the access to create companies. Now lets change any company to the default company, Just follow the below steps to make it happen.

  • Change the  config_db.php file.
  • security_role table field adjustment.

 

Config_db Changes

open config_db.php file from the main FrontAccounting(FA) folder. Default coding look likes following

$db_connections = array (
 0 => 
 array (
 'name' => 'First Company',    //Default Company
 'host' => 'localhost',
 'dbname' => 'frontaccounting',
 'collation' => 'utf8_xx',
 'tbpref' => '0_',
 'dbuser' => 'root',
 'dbpassword' => '',
 ),
1 => 
 array (
 'name' => 'Second Company',
 'host' => 'localhost',
 'dbuser' => 'root',
 'dbpassword' => '',
 'dbname' => 'frontaccounting2',
 'collation' => 'utf8_xx',
 'tbpref' => '1_',
 ),
);

Suppose if you have more than two companies created through company settings. config_db.php file have more than one  $db_connections.

Now lets  change the second company as a default company.

1 => 
 array (
 'name' => 'Second Company',
 'host' => 'localhost',
 'dbuser' => 'root',
 'dbpassword' => '',
 'dbname' => 'frontaccounting2',
 'collation' => 'utf8_xx',
 'tbpref' => '1_',
 ),

Just cut the above array of data and paste it just above the first company array, or this should be the first array within it. And make  array ( 0 => array (...));  So the array will be like this.

$db_connections = array (
 0 => 
 array (
 'name' => 'Second Company', //Default Company
 'host' => 'localhost',
 'dbname' => 'frontaccounting2',
 'collation' => 'utf8_xx',
 'tbpref' => '1_',
 'dbuser' => 'root',
 'dbpassword' => '',
 ),
1 => 
 array (
 'name' => 'First Company',
 'host' => 'localhost',
 'dbuser' => 'root',
 'dbpassword' => '',
 'dbname' => 'frontaccounting',
 'collation' => 'utf8_xx',
 'tbpref' => '0_',
 ),
);

Security  Role Table Change:

Open the 0_security_roles table from first company Database.Copy the sections and areas field values for System Administrator and paste it to the second company that you want to set the default company’s sections and areas field for System Administrator in the security_roles table, Screenshot for your reference

 

Now your second company is your main company. You can login again through browser and check the access, if you have issues or doubt during the change comment on next tab with enough details, I will help you with it.

commenter

About Varadharaj V

The founder of Kvcodes, Varadharaj V is an ERP Analyst and a Web developer specializing in WordPress(WP), WP Theme development, WP Plugin development, Frontaccounting(FA), Sales, Purchases, Inventory, Ledgers, Payroll & HRM, CRM, FA Core Customization, OpenCart Theme Development, PHP, HTML, CSS, jQuery, Bootstrap development and content SEO.

Comment Below

Your email address will not be published. Required fields are marked *

*

Current ye@r *

Menu

Sidebar

Subscribe E-mail Updates

Congrats, You are Subscribed to Receive Updates.

Advertisement

Category Posts