1

(19 replies, posted in Modules Add-on's)

If you read the documentation /doc/access_levels.txt part 5.:

5. Example access control configuration file
--------------------------------------------

This is content of sample access control file for CRM extension module:

<?php
/*
    Define security section codes
*/
define('SS_CRM_C',    101<<8);
define('SS_CRM',    102<<8);
define('SS_CRM_A',    103<<8);

/*
    Additional security sections for CRM module
*/
$security_sections[SS_CRM_C] = _("CRM configuration");
$security_sections[SS_CRM] = _("CRM transactions");
$security_sections[SS_CRM_A] = _("CRM analytics");
/*
    Additional security areas for CRM module
*/
$security_areas['SA_CRMSETUP'] = array(SS_CRM_C|1, _("CRM module setup"));
$security_areas['SA_CRMCONTACTENTRY'] = array(SS_CRM|1, _("Customer contact entry"));
$security_areas['SA_CRMANALYITCS'] = array(SS_CRM|1, _("Pre-sale contact analytics"));

?>

The exact values used for security section codes are not very important, 
as they are rewritten by access control system during integration of
access extensions. Therefore numeric values of security sections/areas should 
never be used directly in the extensions source. Use string representations
instead when needed, or values retrieved from $security_areas array.

The exact values used for security section codes are not very important,
as they are rewritten by access control system during integration of
access extensions.

Though I never try to confirm this.

OK, after few trial & error I found out that the problem lies in
file /js/utils.js :: function price_format(post, num, dec, label, color) // line 209
because every time variable "num" is 0 the browser hangs

What makes it worse is that 0 is the default value of "num"

if(isNaN(num))
        num = "0";

I don't know the exact code which lead this behaviour but I can be sure that it you put any input inside exchange rate which lead to value zero or NaN I guarantee your browser will hang.
When I try to put

if (num == 0) num = 1;

just below the code above, the behaviour vanish because value zero will never happens.

Perhaps the author of function price_format can inspect the javascript code to find the bug.

Actually it's not just because of empty field, I put "0," in exchange rates and then click another element. viola my browser hangs

4

(5 replies, posted in Wish List)

I personally think Dimension should be dynamic so we can have as many as we want. But as of now Dimension is hardcoded to only have a maximum of two.
We can set the amount of Dimension used in Company setup. You can see this in /admin/company_preferences.php

number_list_row(_("Use Dimensions:"), 'use_dimension', null, 0, 2);

The limit number 2 is hardcoded, like a "magic number". I don't think this is a good practice.

Even if you change that number (for example I tried 4) and set the company Dimension to larger than 2 (for example 3), many codes that deal with Dimension usually only check whether the Dimension is 1, 2, or neither. So any number of Dimension larger than 2 (or whatever beside 1 and 2) is treated as 0 (use no Dimension).

For example, let's take a look at the function used to generate the table in Journal Entry
/gl/includes/ui/gl_journal_ui.inc

function display_gl_items($title, &$order)
{
...
    $dim = get_company_pref('use_dimension');
...
    if ($dim == 2)
        $th = array(_("Account Code"), _("Account Description"), _("Dimension")." 1",
            _("Dimension")." 2", _("Debit"), _("Credit"), _("Memo"), "");
    else if ($dim == 1)
        $th = array(_("Account Code"), _("Account Description"), _("Dimension"),
            _("Debit"), _("Credit"), _("Memo"), "");
    else
        $th = array(_("Account Code"), _("Account Description"),
            _("Debit"), _("Credit"), _("Memo"), "");
...
            if ($dim >= 1)
                   label_cell(get_dimension_string($item->dimension_id, true));
            if ($dim > 1)
                   label_cell(get_dimension_string($item->dimension2_id, true));
...

In the above code we can see that the function only handle up to 2 Dimension, beside that will be treated as no Dimension.

So, if you want to change this behavior, you have to change every code that uses

get_company_pref('use_dimension');

I don't know why the FA developer decides to use a maximum of 2 Dimension instead of preparing for dynamic number of Dimensions. Could somebody please explain to us?

Thanks.
kuro

5

(13 replies, posted in FA Modifications)

Setup > Install/Activate extensions > Choose the company desired in select box above

kuro

6

(13 replies, posted in FA Modifications)

have you followed itronics advice? have you made sure claim extension is active for the current company?

kuro

7

(28 replies, posted in Banking and General Ledger)

Hi, I too am looking for a Cash Flow Report in FA. After a quick search around this forum, I think there hasn't been any active discussion about implementing it.
So please if anybody has any ideas or is already implementing it, please share it here.

kuro

8

(8 replies, posted in Modules Add-on's)

BTW, I think you forgot to include "global $path_to_root;" inside claim_app constructor.

    function claim_app()
    {
        global $path_to_root;

Without it, $path_to_root will become null or empty string.

kuro

9

(13 replies, posted in FA Modifications)

have you enable the access for your logged in account for this extension?
for example if you are logging in as "admin" which means the role System Administrator, you have to open Access Setup menu and enable all priviledges of Claim extension for the role System Administration.
After you enable them, logout and login again to see whether you can see anything now.

10

(19 replies, posted in Modules Add-on's)

You're welcome

kuro

11

(13 replies, posted in FA Modifications)

You can take a look at this thread https://frontaccounting.com/punbb/viewtopic.php?id=1869 where evilive trying to create a new extension

12

(19 replies, posted in Modules Add-on's)

Hi, I am new to FA and I am planning to use FA in our new project. So for the past few days I have been inspecting about extension in FA.
I have notice that some extensions use something like this in their hooks.php file:

define('SS_ASSETREGISTER', 101<<8);

What I realize is that every time there is that, there is this:

function install_access()
{
    $security_sections[SS_ASSETREGISTER] = _("Asset Register");
    $security_areas['SA_ASSETTYPE'] = array(SS_ASSETREGISTER|1, _("Asset Type Entries"));
    $security_areas['SA_ASSETS'] = array(SS_ASSETREGISTER|2, _("Assets Entries"));
    $security_areas['SA_AMORTISATION'] = array(SS_ASSETREGISTER|3, _("Amortisation Posting"));
    return array($security_areas, $security_sections);
}

(source taken from asset_register extension)

So I conclude that prefix SS_ means Security Section, the "define" statement above is used to define some kind of unique security level identifier, and that this defined constant will be used to define the security areas used by the extension.

Hope that helps.