5 Creating a company

5.1 Using setup.pl

LedgerSMB comes with a tool called ’setup.pl’. It’s the beginning of a web-based database administration interface to LedgerSMB. This tool can be used to create company databases as well as backups of existing ones. There’s also a command line based Unix-only setup tool - this tool is covered in the next section.

Please note that while executing the steps described in this section, it may take a while for the next screen to appear after clicking on each button: Some buttons involve a large amount of processing on the server before the next screen can be presented.

5.1.1 Step 1: setup.pl login

Jack installed LedgerSMB using the default installation instructions, which means that the url for his setup.pl is https://example.com/ledgersmb/setup.pl. Figure 5.1 on page 5.1 shows the login screen for the tool.

Please note that you can’t be logged into the administration tool (setup.pl) and the webapp through the same browser at the same time in this version of LedgerSMB - due to technicalities.

The login screen shows three fields: (a) a user, (b) a password and (c) a database name.

The user name you use to log in needs to be a PostgreSQL super user: a user you can use to log into the database using the “psql” command as well.

The password must be the same as the one used to log in from the command line using the “psql” tool or the password you used upon creation using the “createdb” tool. Both “psql” and “createdb” are PostgreSQL tools (not LedgerSMB tools).

The third field is the name of the database to be created, which is the same as the name of the company to be logged into later on through the login page shown in Figure 6.1 on page 6.1. The next paragraph discusses this field and its meaning more in-depth.

Figure 5.1: setup.pl login screen

5.1.2 Step 2: Company creation

When creating a company database, there are a few things that are of importance:

  • The name of the database is the same as the name used at login time and hence will be used by all users - a choice of a suitable, recognizable value is important

  • The name of the database entered (and hence the company name) is case-sensitive

  • The name can’t be more than 63 characters long

After choosing “example_inc” as his company name, Jack clicks the Login button at which time the screen from Figure 5.2 on page 5.2 shows up. The screen says the database doesn’t yet exist and offers its creation. The backup buttons being offered are not useful at this stage - they have value if the database exists and setup.pl is being used to upgrade the database; one of its other functionalities.

Figure 5.2: setup.pl company creation screen

Jack clicks “Yes” to create the database and load it with LedgerSMB’s database schema, authorization rules and stored procedures44Parts of the program inside the database.. It may take a while (30 seconds or more) for the next screen to appear55Note that during the creation of the database, logs are kept so that if there are errors these can be reviewed either by the person installing the software or by support personnel. On Linux/Unix systems these are stored, by default, in /tmp/ledgersmb/ and named dblog, dblog_stderr and dblog_stdout..

5.1.3 Step 3: Selection of a Chart of Accounts

LedgerSMB comes with numerous predefined charts of accounts. These have been grouped per country making the selection of a chart a two-step procedure. setup.pl allows for users wanting to define their own charts by offering a “Skip” button. This button skips the process of loading a chart.

Note that you need to define a chart of accounts before you can meaningfully do anything inside LedgerSMB. If you don’t load a pre-defined one you’ll need to create or import your own later.

Figure 5.3 on page 5.3 shows the first screen in the chart of accounts selection procedure. In this screen you select the country for which you want to use the chart of accounts. Note that charts of accounts are highly country dependent and you may want to consult an accountant if no default chart of accounts is included for your country.

As Jack runs his company in the US, that’s what he selects.

Figure 5.3: Chart of accounts - Country selection

Figure 5.4 on page 5.4 shows the second screen in the chart of accounts selection procedure. The drop down contains a list of all charts of accounts defined for the selected country.

Jack selects the General.sql chart of accounts: that will leave him enough room to specialize the setup later if he has to, but for the time being offers a broadly useable setup.

Figure 5.4: Chart of accounts - Chart selection

5.1.4 Step 4: Initial user

In the last paragraph the technical part of the company creation procedure was completed. However, it’s not possible to log in to the company yet. This paragraph describes how to create a first user. Figure 5.5 on page 5.5 shows the user creation screen. The fields in this screen have the same meaning as those discussed as part of user management in Section 20.2 on page 20.2.

Figure 5.5: setup.pl initial user creation screen

Jack chooses to create an administrative user called admin who will be authorized to do everything in the application. Later on he will also create a user jack who will be authorized to do everything but changing the configuration and doing application administration. He’ll use the latter user to log in for day to day operations. This will help him prevent changing things by accident.

Note that none of the fields in this screen are optional. If the name of the user being created isn’t already used with other companies, leave the Import option set to No, otherwise please read the chapter on user creation mentioned above.

Note: The password you enter here is a temporary one which will remain in effect for 24 hours only. Be sure to execute the steps in Section 6.2 on page 6.2 before these 24 hours elapse, because the user will be disabled after that.

The setup.pl program offers the user to be created to be one of two types:

  • Manage Users

  • All Permissions

Jack’s choice for a fully authorized admin user leads him to select the All permissions option.

Figure 5.6: setup.pl successful completion screen

Jack succeeded to correctly create his company database. His story continues in the next chapter “The first login”.