Topic: Release 2.1 - Extensions to FrontAccounting. How to?

Extensions to FrontAccounting

We have prepared for installation of Extensions. Like installed modules.
In the root directory there is a file, installed_extensions.php. This file contains an array over installed extensions, $installed_extensions.
There is an example array in the file.

app_file = the application to be put inside the /applications directory
name = array key name of the application
title = menu title
folder = directory where the extension resides. Use same structure inside this as the core extensions.

The Extension will be placed as the second last menu, before 'Setup'.

At present there is no automatic installation of the extensions. They will have to be done manuelly.

2 (edited by Gerhard 06/07/2010 10:24:28 pm)

Re: Release 2.1 - Extensions to FrontAccounting. How to?

I have just created a new module using FrontAccounting 2.2.9 and this is how I did it.
This in NOT a howto just an explanation of what I have on the subject
I have excluded access levels to make it simpler

You need to update installed_extensions.php in the root folder to let FrontAccounting know that the class exist, then you need to update each  installed_extensions.php in the company folder “company\0\” and / or company in wich the module should display. The last is for display purposes and the first is for creation of the object.

My entries were:
    2 => array ( 'tab' => 'meminfo',
            'path' => 'meminfo',
            'active' => '1',
            'type' => 'module',
            'filename' => 'meminfo.php',

What each entry is for:
'tab' => 'meminfo'
is the name of your class but in the class it should have an additional _app
For this example
class meminfo_app extends application

'type' => 'module',
We are creating a module and not a plugin

'path' => 'meminfo',
The path in which app_file is located. It would be best to keep all your files seperate from the development files.

'filename' => 'meminfo.php',
This is the file that should contain the main class look at the applications folder for examples

The Class /meminfo/meminfo.php

This class is basically just a menu to your seperate functions
class meminfo_app extends application // Name of your class remember to add the _app
   function meminfo_app()
      // This is the constructor read about php objects for more
    $this->application("members", _($this->help_context = "&Member Info"));
      // members is the application argument in the $_GET string and "&Member
      //Info" is the name of the tab
      // The firsgroup of links take a look in the applications folder
      //for more examples
    $this->add_lapp_function(0, _("Tester &Title"),
        "meminfo/member_display.php", 'SA_USER_STATUS');
    // A link take a look in teh applications folder for more examples

Re: Release 2.1 - Extensions to FrontAccounting. How to?

Many thanks for the example. There is still no good documentation on extension system. One of the reasons are changes implemented in forthgoing 2.3 release. Hope those will be the last bigger changes in extension system.


Re: Release 2.1 - Extensions to FrontAccounting. How to?

If there will be a difference in 2.3 then it will be more productive to work on 2.3 but I can not locate the 2.3 CVS.
Can you point me in the right direction?

Re: Release 2.1 - Extensions to FrontAccounting. How to?

Code for 2.3 release (still in progress) is located on CVS server. This is branch named unstable.


Re: Release 2.1 - Extensions to FrontAccounting. How to?

1) I can't seem to get the "Import Multiple Journal Entries" extension working.  I notice Joe's message from 2009 says that extensions must be installed manually.  Is this still the case?  It is installed and available and shows as activated under the Install/Activate extensions page for the desired company.

2) Also in regard to this extension I would like to ask if this is the best way to integrate journal entries of a subsidiary?  Say I have a subsidiary set up as another company, can I just export the journal entries from that company, and then import them to the parent company, perhaps using a new dimension for the entries?



Re: Release 2.1 - Extensions to FrontAccounting. How to?

Best way:
1. Take sql backup.
2. Manually make 1 entry.
3. Take another sql backup
4. Compare the backups and see what changed
5. Generate and execute MySQL statements (in phpMyAdmin, SQLyog, etc) to simulate these changes (Inserts / Updates) for all other entries to be imported.