Assuming the error you are seeing is "...  would result in exceeding authorized overdraft".  Options to address are:

  1. The standard advice is to change the account type to a non-cash account.  This may require a database tool because I do not believe that FA allows the account type to be changed.

  2. Create a new non-cash account, transfer the $ from the cash account to the non-cash account, and use the non-cash account in the future.

  3. Add a temporary offset (i.e. deposit) to the cash account against some other asset account.

  4. Change the code.  Always return null in function get_bank_account_limit in core/gl/includes/db/gl_db_bank_accounts.inc.

Options 1 and 2 may be unsatisfactory if a cash type account is needed for direct supplier invoices or POS because of FA restrictions on account type.

77

(7 replies, posted in Banking and General Ledger)

Do tags or dimensions help?

78

(4 replies, posted in Items and Inventory)

FA lacks extensible fields.  See, Additional Fields Extension.

79

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

simpleAPI pagination

80

(7 replies, posted in Manufactoring)

FA Advanced Manufacturing does not require a BOM.   A, B,C are issues and D is the manufactured item.

Your approach is promising.  This should work in theory for lists which are the most frequent occurrence of ajax sync, so perhaps this approach could fix the lions share of the problem.  However, ajax sync can be called for other data types, such as dates, so it is not a complete solution.

I don't have the ability to test this, but it seems like it does close one avenue of data corruption in FA in a more user friendly way than just simply reloading the page as I proposed.

82

(4 replies, posted in Reporting)

@@ -67,7 +67,7 @@ function getTaxTransactions($from, $to)
         $sql .= " AND taxrec.tran_date >= '$fromdate'
                        AND taxrec.tran_date <= '$todate'
         GROUP BY taxrec.id
-               ORDER BY taxrec.trans_type, taxrec.tran_date, taxrec.trans_no, taxrec.ex_rate";
+               ORDER BY taxrec.tran_date, taxrec.trans_type, taxrec.trans_no, taxrec.ex_rate";
 
     return db_query($sql,"No transactions were returned");

83

(18 replies, posted in Setup)

I suggest making a fork of the FA project on github, and adding your changes in, perhaps with help from a 3-way diff tool.  Then as new changes are made in FA, you can sync your fork with the upstream code.  Often the new changes are incorporated without any additional effort but sometimes there are conflicts, but then you run git mergetool to help determine how to proceed.

84

(18 replies, posted in Setup)

Just for the record, round2() is mainly needed starting at line 55 to sum up the the boms.  Line 65 is just the additional materials.

85

(2 replies, posted in Reporting)

I'm thinking this was fixed.  Make a copy of your database and upgrade it 2.4 and let us know what you find out.

86

(18 replies, posted in Setup)

This is an FA bug, sort of, and it affects my site as well, but I haven't gotten around to fixing it yet.  And yes, a journal entry is probably the only way to address it without fixing the code.

When FA closes a work order, it calls work_order_produce() which first creates the Finished Product Requirements.   The g/l created by each requirement eventually calls add_gl_trans().  Note the rounding in this function:

function add_gl_trans($type, $trans_id, $date_, $account, $dimension, $dimension2, $memo_,
    $amount, $currency=null, $person_type_id=null, $person_id=null, $err_msg="", $rate=0)
{
    global $SysPrefs;

    $date = date2sql($date_);
    if ($currency != null)
    {
        if ($rate == 0)
            $amount_in_home_currency = to_home_currency($amount, $currency, $date_);
        else
            $amount_in_home_currency = round2($amount * $rate,  user_price_dec());
    }
    else
        $amount_in_home_currency = round2($amount, user_price_dec());

OK, so each requirement is rounded, and then added up.

But wait, there is more to do.  work_order_produce() then sums up the Finished Product Recieval:

        // 1. calculate sums of material/labour/overhead costs

        // sum collected BOM material & labour costs (no way for separate overhead here for now - needs flag in bom or stock_master)
        $bom = get_wo_requirements($woid);
        $m_cost = $l_cost = 0;
        while ($component = db_fetch($bom))
        {
            if (!is_service($component["mb_flag"]))
                $m_cost += $component['unit_cost']*$component['units_issued'];
            else
                $l_cost += $component['unit_cost']*$component['units_issued'];
        }

        // add additional material issues
        $issues = get_additional_issues($woid);
        while ($issue = db_fetch($issues))
        {
            if (!is_service($issue["mb_flag"]))
                $m_cost += $issue['unit_cost']*$issue['qty_issued'];
            else
                $l_cost += $issue['unit_cost']*$issue['qty_issued'];
        }

        // and additional costs
        $o_cost = get_gl_wo_cost($woid, WO_OVERHEAD);
        $l_cost += get_gl_wo_cost($woid, WO_LABOUR);

        $total_cost = $o_cost + $m_cost + $l_cost;

        add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $product['wip_account'],
            0, 0, $memo, -$total_cost);

        add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $product['inventory_account'],
            0, 0, $memo, $total_cost);

So if all units were able to be manufactured, the calculation should be the same.

Except for the lack of rounding in this code.

So if it disturbs you to see these rounding errors, what can you do?  Well, you could try rounding m_cost and l_cost like in add_gl_trans.  Maybe try:

          if (!is_service($issue["mb_flag"]))
                $m_cost += round2($issue['unit_cost']*$issue['qty_issued'], user_price_dec());
            else
                $l_cost += round2($issue['unit_cost']*$issue['qty_issued'], user_price_dec());

I haven't tried this, so it might not work.  But this is first thing I would try.

I agree that the loss of data is frustrating, but this might be the only easy way to assure data integrity.  The code assumes that the ajax operation will complete successfully.  For a list, the list is already updated on the browser page and then the code requests the ajax update. If the ajax operation does not occur successfully, the page will have inconsistent data.

In the example of the customer payments screen, if the customer is updated and ajax fails, the branch will be wrong as well as the allocations and who knows what else?  Perhaps the customer has multiple branches, and the branch is updated and ajax fails.  Then the allocations would be assigned to the correct customer, but what effect will having the wrong branch have on the code? What if the bank account is changed, but ajax fails, and now the currency calculations are wrong?

There might be some easy way to cache the page before ajax is called and then restore the page if it fails, but that is beyond my knowledge.

There would likely be many areas in FA that are adversely affected by ajax timeouts caused by physical networking problems.  Trying to identify them and handle them in code would not be the best approach.  My recommendation would be changing the ajax timeout function in utils.js to something like:

                if(retry)
                    JsHttpRequest._request(trigger, form, tout, retry-1);
                else location.reload(true);

So on error, ajax would simply try to reload the page from the server.  If the network was still down, the browser clears the page and displays something like "cannot load page from server".  Thus it becomes impossible for the user to continue on with a loaded FA page that did not successfully run the ajax code.  This would prevent the problem that your site is experiencing.

The current FA approach to an ajax timeout is to display the warning sign, but this assumes that the internet is working, because if it is not, it may not be able to load the warning sign from the server if it is not already in cache.

89

(3 replies, posted in Setup)

Branches are a good suggestion, but FA support for reporting/inquiry by branch is limited.  I have been working to improve this in my fork and you might be able to rework this commit to FA (ignore the first two ui_lists.inc changes).

See also, https://frontaccounting.com/punbb/viewtopic.php?id=8379.

90

(114 replies, posted in Reporting)

When entering journal entries, make sure that "Include in tax register" is checked.  Then they should appear on Tax Inquiry.

91

(114 replies, posted in Reporting)

Make sure that Tax Bank Payments and Deposits is checked in Company preferences.   The default is not checked.  With this checked, the pull request should result in the same output as 2.3.

As you discovered in your first two trials, 2.4 does not have this code.  I believe it may be planned for 2.5.

Yes, just copy the entire directory to modules.  Then install it like any other module, activate it and enable access permissions.

The module does not handle import of split transactions.  How would it know how to split the transaction?  So if you need split transactions, you have to create those manually.

Its an FA bug unmasked by an advanced version of php, requiring a code change to fix.  You might make it quiet down by adding:

$line .= chr(32);

after $len = strlen($line);

on line 181.

94

(7 replies, posted in Accounts Receivable)

Regenerating sessions periodically is used to make session hijacking more difficult.  I suppose if you are not concerned about that you could change the code to not do it and it could make debugging easier.  But my guess is that following this trail will get cold.  The old session is probably the one that is expiring and you don't care about that anyway.

You could look at the extension that I wrote https://github.com/braathwaate/FA24extensions/tree/master/Extensions/bank_auto_reconcile.  The main focus is to reconcile a bank statement with existing manually entered g/l entries in FA; however, missing g/l entries can be automatically imported using the same g/l accounts as used previously.  That is, once there has been one match, future entries are imported using the comment field, assuming that some of the comment on the bank statement is consistent.  (E.g. WATER UTILITY X75GGGGFX will match each time based on WATER UTILITY in the comment even if other numbers in the bank statement comment change).   Therefore, auto deductions with varying amounts each month auto-import using the same g/l accounts as the prior month.  Bank statement formats are hard coded, but easily modified in the code in a table.

96

(12 replies, posted in Installation)

Are you running Chrome in incognito mode per chance?  If so, there isn't any session saved on the server.   Try using a different browser.  Does the problem occur in all browsers?  If so, you will have to trace down the problem.  Use print() followed by die() before the session/server check.

97

(7 replies, posted in Accounts Receivable)

You can find out what session the browser was using before the logout event and then see if it still exists or is corrupted in some way after the logout event.  For Firefox, open the storage inspector with shift F9.  The session name is stored as a cookie.  After the unexpected logout, look for the session file on the server.  If it is gone, then you know that something on the server removed it.

If it is still there, then the problem becomes more interesting, as then you will need to examine the file for clues why FA could not use it.  I would also guess that if it were still there, FA would display "authorization timeout" or some other error message.

Note that when a session file is removed unexpectedly, FA will initiate a logout and create a new session.  So looking for the session cookie name after logout tells you nothing.  FA apparently does not issue an error message if its cookie is gone.  The screen display is the same as when a brand new session is initiated with FA.

98

(7 replies, posted in Accounts Receivable)

If you see the message "Authorization timeout", then FA is the culprit.  If not, then the php session was removed/corrupted/not accessible.  The php maximum session lifetime is stored in php.ini.  On ubuntu, the sessions are stored in /var/lib/php/sessions.   You can monitor the session file in this directory and see what happened to it when the client was logged out.  What your client was doing in FA at the time should have no bearing on the logout.

99

(2 replies, posted in Accounts Receivable)

My word of advice: don't.  Customers will see the discount schedule and always take the largest discount no matter when the payment is made.  Then you are stuck with sending them a statement asking for more money which they may dispute and believe me can lead to legal action.   If you go this route, you just need to add the calculation on the invoice like you would for invoice signature.   Like the built-in FA prompt payment discount, this would be informative only and you manually split the invoice amount and discount on the customer payment screen.

My recommendation is to work out the varying customer discounts in advance.  Send them notice that their customer discount will be changing due to slow payment, low volume, etc.  Then change their discount to a lower or no discount in their customer record.

Does the bank account use the same currency as the home currency?  If not, see this post.