5,351

(19 replies, posted in Accounts Payable)

If you create a new currency make sure the company currency and the supplier currency be what they should be and that the exchange rates be set anew with "1" being the rate of the company default currency. Logout then and clear cache - possibly even the company cache (company/*/js/*.js) and then see if it persists.

5,352

(14 replies, posted in Setup)

If a computer hung when using FA, then the session would become stale in time, but the user can just reboot at once and then login again, otherwise the stale session would lock out any login if based on existing valid sessions being alive.

Hence, keep passwords safe and make and get staff to use separate usernames for audit trail.

Social engineering / hacking (looking for passwords over the user's shoulder as they are being typed) and looking thru CCTV footage should by now be well understood as they have been shown in movies / TV serials quite commonly.

access/login.php
access/logout.php

5,354

(1 replies, posted in Installation)

Create a file called faillog.php in the webroot's tmp folder and make the file writeable by the webserver user.

5,355

(1 replies, posted in Accounts Receivable)

Approval process in FA needs to be made as a separate module for each context it is desired to be in. In this case, the return reference would be the return entry's voucher number.

Cash Account should always be in debt to every account who provided it the cash in the first place. Hence in FA, is debit balance shown as positive?

Thanks Janusz for the clarification:

Maybe the temporary variable name $void_entry is misleading, but the
codelogic is right. The voiding action is abandoned if the selected
transaction has been voided before.

Janusz

In the file admin/void_transaction.php, lines 271-302 are:

function handle_void_transaction()
{
    if (check_valid_entries()==true) 
    {
        $void_entry = get_voided_entry($_POST['filterType'], $_POST['trans_no']);
        if ($void_entry != null) 
        {
            display_error(_("The selected transaction has already been voided."), true);
            unset($_POST['trans_no']);
            unset($_POST['memo_']);
            unset($_POST['date_']);
            set_focus('trans_no');
            return;
        }

        $ret = void_transaction($_POST['filterType'], $_POST['trans_no'],
            $_POST['date_'], $_POST['memo_']);

        if ($ret) 
        {
            display_notification_centered(_("Selected transaction has been voided."));
            unset($_POST['trans_no']);
            unset($_POST['memo_']);
            unset($_POST['date_']);
        }
        else {
            display_error(_("The entered transaction does not exist or cannot be voided."));
            set_focus('trans_no');

        }
    }
}

Shouldn't the second if condition have it's logic inverted?
The line above:

        if ($void_entry != null) 

will probably need to become

        if ($void_entry == null) 

This should actually mean that unless there are entries to be voided, do not attempt to void any (since none exist).

However, in @dedode's case, he must find out why a "missing" transaction was sought to be voided in the first place! Possibly attempting to void an already voided transaction - using the back button in the browser and re-submitting it or some browser cache issue.......

5,359

(18 replies, posted in Setup)

A slightly rehashed Italian SQL (need to choose the accounts for setup defaults) that you can start with.

5,360

(4 replies, posted in Reporting)

Thanks Joe, your fixes 1 and 2 do the job.

5,361

(18 replies, posted in Setup)

Hope you are not using Lira.....

Since Euro is used by most EU countries, take any of their Chart of Accounts from the repo and translate the head of accounts.....

All Extensions/Languages/Themes/Charts are expanded out and placed in my unofficial GitHub Repo. Place the resultant translated file by naming it like chart_it_IT-general-2.3.18-1.sql and place it in the sql folder.

Void Invoice and then make a new one.

or

Make sales orders instead of direct invoices and then let the staff edit them and proceed to convert them into delivery orders and invoices thereafter.

5,363

(13 replies, posted in FA Modifications)

The installed_extensions.php determines the default company - do not make the default company the active company for real accounts.

Also hide links in config file setting for inaccessible menu items.

5,364

(1 replies, posted in Report Bugs here)

Any change in browser / browser version since it last worked?

The link was provided only for an insight into what it does. Yes, as Elax says, install from within FA unless you follow the wiki to manually install it.

5,366

(5 replies, posted in Installation)

Use different table prefixes if you want to install into the same database. Since you are running WAMP in your own machine, you can choose to install FA on different databases for each instance. If both the Apache2 and MySQL are on the same machine, then the hostname can remain localhost or sometimes 127.0.0.1

You can create a new company only from the default company - see installed_extensions.php file in the root folder.

The said function that does the job is in sales/includes/db/cust_trans_db.inc

function get_customer_trans_version($type, $trans_no) {
    if (!is_array($trans_no))
        $trans_no = array( $trans_no );

    $sql= 'SELECT trans_no, version FROM '.TB_PREF. 'debtor_trans
            WHERE type='.db_escape($type).' AND (';

    foreach ($trans_no as $key=>$trans)
        $trans_no[$key] =     'trans_no='.db_escape($trans_no[$key]);

    $sql .= implode(' OR ', $trans_no) . ')';

    $res = db_query($sql, 'document version retreival');
    
    $vers = array();
    while($mysql=db_fetch($res)) {
        $vers[$mysql['trans_no']] = $mysql['version'];
    }
    return $vers;
}

If there are no transaction or just one transaction only then what would happen to the orphaned OR?

Also, there may be a typo in the field name 'type' being 'tpe' since both exist. The table definition is:

CREATE TABLE IF NOT EXISTS `0_debtor_trans` (
  `trans_no` int(11) unsigned NOT NULL default '0',
  `type` smallint(6) unsigned NOT NULL default '0',
  `version` tinyint(1) unsigned NOT NULL default '0',
  `debtor_no` int(11) unsigned default NULL,
  `branch_code` int(11) NOT NULL default '-1',
  `tran_date` date NOT NULL default '0000-00-00',
  `due_date` date NOT NULL default '0000-00-00',
  `reference` varchar(60) NOT NULL default '',
  `tpe` int(11) NOT NULL default '0',
  `order_` int(11) NOT NULL default '0',
  `ov_amount` double NOT NULL default '0',
  `ov_gst` double NOT NULL default '0',
  `ov_freight` double NOT NULL default '0',
  `ov_freight_tax` double NOT NULL default '0',
  `ov_discount` double NOT NULL default '0',
  `alloc` double NOT NULL default '0',
  `rate` double NOT NULL default '1',
  `ship_via` int(11) default NULL,
  `dimension_id` int(11) NOT NULL default '0',
  `dimension2_id` int(11) NOT NULL default '0',
  `payment_terms` int(11) default NULL,
  PRIMARY KEY  (`type`,`trans_no`),
  KEY `debtor_no` (`debtor_no`,`branch_code`),
  KEY `tran_date` (`tran_date`)
) ENGINE=InnoDB;

Should the line:

        $trans_no[$key] =     'trans_no='.db_escape($trans_no[$key]);

be

        $trans_no[$key] =     'trans_no='.db_escape($value);

?

The file includes/ui/ui_lists.inc has:

function sales_items_list_cells($label, $name, $selected_id=null, $all_option=false, $submit_on_change=false, $editkey=false)
{
    if ($editkey)
        set_editor('item', $name, $editkey);

    if ($label != null)
        echo "<td>$label</td>\n";
    echo sales_items_list($name, $selected_id, $all_option, $submit_on_change,
        '', array('cells'=>true));
}

The file sales/includes/ui/sales_order_ui.inc uses it in:

    else    // prepare new line
    {
        sales_items_list_cells(null,'stock_id', null, false, true, true);
        if (list_updated('stock_id')) {
                $Ajax->activate('price');
                $Ajax->activate('units');
                $Ajax->activate('qty');
                $Ajax->activate('line_total');
        }

5,370

(1 replies, posted in Report Bugs here)

asset_register module uses MySQL Functions apart from tables and indexes. Hence the database user for the FA database should be privileged to create, alter, drop and use them.

You will have to uninstall the asset_register, delete any tables associated with it and then re-install the module only after enabling the user privileges and flushing privileges (or restarting MySQL server).

5,371

(1 replies, posted in Report Bugs here)

The field definition for it is:

`collapsed` tinyint(4) NOT NULL

Check your databse if there is any default value such as 0 for the said field. Also see if changing it to NULL or VARCHAR makes any difference.

CREATE TABLE IF NOT EXISTS `0_dashboard_widgets` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `app` varchar(50) NOT NULL,
  `column_id` int(11) NOT NULL,
  `sort_no` int(11) NOT NULL,
  `collapsed` tinyint(4) NOT NULL,
  `widget` varchar(100) NOT NULL,
  `description` varchar(100) NOT NULL,
  `param` text,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

Wonder why the AUTO_INCREMENT was set to 6 !
Wonder why the tinyint(4) should not be tinyint(1) !

The relevant function that updates it is:

function update_dashboard_widget($selected_id, $app, $user_id, $column_id, $sort_no, $collapsed, $widget, $description, $param)
{
    $sql = "UPDATE ".TB_PREF."dashboard_widgets SET user_id=" . db_escape($user_id)
        . ",app=" . db_escape($app)
        . ",column_id=" . db_escape($column_id)
        . ",sort_no=" . db_escape($sort_no)
        . ",collapsed=" . db_escape($collapsed)
        . ",widget=" . db_escape($widget)
        . ",description=" . db_escape($description)
        . ",param=" . db_escape($param)
        . " WHERE id = " .db_escape($selected_id);
    db_query($sql,"The widget could not be updated");
}

The simplest fix may yet be:

function update_dashboard_widget($selected_id, $app, $user_id, $column_id, $sort_no, $collapsed, $widget, $description, $param)
{
    $sql = "UPDATE ".TB_PREF."dashboard_widgets SET user_id=" . db_escape($user_id)
        . ",app=" . db_escape($app)
        . ",column_id=" . db_escape($column_id)
        . ",sort_no=" . db_escape($sort_no)
        . ",collapsed=" . ((isset($collapsed) && $collapsed <> 1) ? 0 : 1)
        . ",widget=" . db_escape($widget)
        . ",description=" . db_escape($description)
        . ",param=" . db_escape($param)
        . " WHERE id = " .db_escape($selected_id);
    db_query($sql,"The widget could not be updated");
}

You will have to create your own theme with ajax auto-complete for it. The grouping system works on a hierarchial self lookup for parent-child entries. Any higher level groups created will be available for being the parent group of a new entry that needs to be under it.

5,373

(9 replies, posted in Reporting)

I have updated the Wiki on this score.

Search for

$rep->SetHeaderType('Header2');

in some of the reporting/*.php files and you will see how and where to include the function name.

Please pm me your backup from within FA for the said company. Also attach your config.inc.php file after deleting the db password.

Looks like it is a clear case of either some new variables with backward compatibility options not conforming to your specific choices or a database schema incompatibility. The latter would be so if you have been using FA for quite some time and have been incrementally upgrading it as versions change.

State whether you are using Linux or Windows or Mac and the webserver, php and mysql versions. Will try to hammer out a sql that you can restore to get it working. Also please check the charset and collations used.

There are some errors in the Norweigian COA - one extra field is present there and some are mis-ordered besides some default diffs. Attached are the corrections that may be taken into the appropriate package in the FA repo.

Try to rename .htaccess to x.htaccess and see if it works.