3,476

(3 replies, posted in Setup)

Even if we mimic the mysqli_multi_query in the mysql driver used in FA 2.3.x, it is still very slow when the equivalent function below is used:

function multiQuery($queryBlock, $delimiter = ';') {
    $inString = false;
    $escChar = false;
    $sql = '';
    $stringChar = '';
    $queryLine = array();
    $sqlRows = explode ( "\n", $queryBlock );
    $delimiterLen = strlen ( $delimiter );
    do {
        $sqlRow = current ( $sqlRows ) . "\n";
        $sqlRowLen = strlen ( $sqlRow );
        for ( $i = 0; $i < $sqlRowLen; $i   ) {
            if ( ( substr ( ltrim ( $sqlRow ), $i, 2 ) === '--' || substr ( ltrim ( $sqlRow ), $i, 1 ) === '#' ) && !$inString ) {
                break;
            }
            $znak = substr ( $sqlRow, $i, 1 );
            if ( $znak === '\'' || $znak === '"' ) {
                if ( $inString ) {
                    if ( !$escChar && $znak === $stringChar ) {
                        $inString = false;
                    }
                }
                else {
                    $stringChar = $znak;
                    $inString = true;
                }
            }
            if ( $znak === '\\' && substr ( $sqlRow, $i - 1, 2 ) !== '\\\\' ) {
                $escChar = !$escChar;
            }
            else {
                $escChar = false;
            }
            if ( substr ( $sqlRow, $i, $delimiterLen ) === $delimiter ) {
                if ( !$inString ) {
                    $sql = trim ( $sql );
                    $delimiterMatch = array();
                    if ( preg_match ( '/^DELIMITER[[:space:]]*([^[:space:]] )$/i', $sql, $delimiterMatch ) ) {
                        $delimiter = $delimiterMatch [1];
                        $delimiterLen = strlen ( $delimiter );
                    }
                    else {
                        $queryLine [] = $sql;
                    }
                    $sql = '';
                    continue;
                }
            }
            $sql .= $znak;
        }
    } while ( next( $sqlRows ) !== false );
 
    return $queryLine;
}

It's usage will be:

$multiple_queries = 'SELECT CURRENT_USER();
SELECT Name FROM City ORDER BY ID LIMIT 20, 5;';
 
$sql_queries = multiQuery($multiple_queries);
 
foreach($sql_queries as $sql_query) {
    // Execute each query
    mysql_query($sql_query) or exit('SQL: '.$sql_query.', Error: '.mysql_error());
}

Tutorial on MySQLi multi query function

The file includes/db/audit_trail_db.inc has the functions close_transactions() and open_transactions() and in both, only the audit_trail.gl_seq field is updated and the gl_trans.gl_date field is unnecessarily being called in for ordering whereas the audit_trail.gl_date already has the info taken from the former at the time of transaction creation.

In the function open_transactions() there is no need for any ordering as a mere set to 0 of the gl_seq field is all that is done wholesale.

In the close_transactions(), the LEFT JOIN should be an INNER JOIN as there is no point in attempting to update records in audit_trail table where no id exists if it only existed in the gl_trans table!

A pure MySQL implementation of the close_transactions sql would reduce to:

SET @lastyr:=0;
SET @counter:=1;
CREATE TEMPORARY TABLE audit_tmp SELECT id, Counter AS gl_seq FROM (
SELECT id, gl_date, fiscal_year
    , (@counter:=IF(fiscal_year <> @lastyr, 1, @counter+1)) AS Counter
    , (@lastyr:=IF(fiscal_year <> @lastyr, fiscal_year, @lastyr)) AS LastYr FROM
( SELECT DISTINCT a.id, a.gl_date, a.fiscal_year 
FROM gl_trans gl INNER JOIN audit_trail a ON (gl.type=a.type AND gl.type_no=a.trans_no) 
WHERE gl_date<='2015-12-31' AND NOT ISNULL(gl_seq) 
ORDER BY a.fiscal_year, a.gl_date, a.id) b
) c;
UPDATE audit_tmp a LEFT JOIN audit_trail b USING (id) SET b.gl_seq=a.gl_seq;
DROP TABLE audit_tmp;

Likewise, the open_transactions sql would reduce to:

UPDATE audit_trail SET gl_seq=0 WHERE gl_date>='2016-01-01' AND !ISNULL(gl_seq);

Failure to correct this will cause a timeout when trying to close large fiscal years.

1. Start with a new FA install and create a Supplier and a few items
2. Take a backup 1.
3. Create your PO entry to a supplier
4. Make an Advance Payment
5. Enter the deposit Refund
6. Delete the PO
7. Take a backup 2.
8. Restore backup 1
9. Make an Advance Payment to some Supplier
10. Enter the deposit Refund
11. Check that the Allocation line for the supplier is absent (since no PO)
12. Take backup 3.

Now compare backup 2 and 3 and see which field needs to be manually changed for the allocation entry to vanish.

3,479

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

For those who need to know what Fund Accounting Compliance is, these links would prove useful.

Job Description of a Fund Accountant

Fund Accounting manual - 90 pages, 592 Kb

EU Fund Administration

Just disable Manufacturing in FA (and possibly remove the related tables) to simplify for use in Fund Accounting (FA pun) smile

The payment is still linked to a purchase order. Delink the payment and then void the purchase order in that sequence.

3,481

(7 replies, posted in Banking and General Ledger)

Done.

3,482

(28 replies, posted in Accounts Receivable)

The default English language one is available at lang/new_language_template/locale.inc and will possibly be taken when no specific one a any chosen language is unavailable.

3,483

(7 replies, posted in Banking and General Ledger)

Assume you pay an annual lease of Rs. 40,000/- in April (Indian Accounting year begins on Apr 1st and ends on Mar 31st but the govt is looking into fiddling with it now) and would like to account for it as an expense each quarter to help with proper costing of overheads, then this module will apportion the amount into 4 equal parts as if payable at the beginning of each quarter.

2015-04-01 By Property Owner  Cr. 10000
2015-04-01 To Lease Expenses A/c                    Dr. 10000
2015-05-16 To Property Owner                           Dr. 40000
2015-05-16 By Bank Chq A/c      Cr. 40000
2015-07-01 By Property Owner  Cr. 10000
2015-07-01 To Lease Expenses A/c                    Dr. 10000
2015-10-01 By Property Owner  Cr. 10000
2015-10-01 To Lease Expenses A/c                    Dr. 10000
2016-01-01 By Property Owner  Cr. 10000
2016-01-01 To Lease Expenses A/c                    Dr. 10000

3,484

(4 replies, posted in Setup)

It is possible that your version of php may fail:

function_exists("preg_replace_callback")

FA v2.3.22 was released on 2014-09-29 whilst the file reporting/includes/html_entity_decode_php4.php was changed on:
Sep 7, 2015, Nov 7, 2014 and introduced on Aug 24, 2008.

If the supplier invoice has been voided, the Supplier Allocation entry should vanish. Try to logout and clear cache and then login again and check.

The v2.4 unstable branch has part of your fixes committed now and my fork's commit has the relevant URLs.

Yes, it appears broken in the online demos. Tested with FF 37 on WinXP SP3.

Is it that all reports are purposely disabled?
Data for the current fiscal year 2016 is there - any change in fiscal year needed?

@joe/Janusz - please fix it.

3,488

(7 replies, posted in Banking and General Ledger)

Insurance was just an example there. It can be for any costs/ income pertaining in part or whole to another fiscal year provided for here for later dated allocation or as for previous dated allocation.

Some dimension related data like qty, price, amount and possibly with date get computed and stored.

@joe: any clues?

FA.pem in your FA webroot should match the one in the github repo.

3,491

(18 replies, posted in Items and Inventory)

Upload attachments somewhere and provide link here. Check MySQL / apache error logs for hints.

Any amount accepted from the supplier is cash/bank/journal vouchered into the respective account. It is monies received on account of the supplier.Since you have not allocated any payment to a specific supplier invoice but had merely paid an advance amount to the supplier on account, it will get contra-ed by the refund amounts received from the supplier.

The posts in these forums are from across most major countries in the world and certainly a few Philippine users exist here.

There is even a CoA for it - chart_en_PH-general:

General Phillipines chart of accounts.     None     2.3.0-3     iso-8859-1

There is currently no Philippine Language translation available - perhaps you would like to contribute one.

3,494

(4 replies, posted in Setup)

If it is linux, make sure the language is enabled in the OS itself and the language .mo files are compiled for UTF-8.

3,495

(10 replies, posted in Reporting)

Banking & General Ledger -> Balance Sheet Drilldown -> Current Assets (OR) Current Liabiliries -> Accounts Receivables (OR) Accounts Payables -> Choose Account -> Click "Show" button.

In the general case when the a top account like "Accounts Receivables" is chosen, all customers transactions are listed. In case you wish to generate it for a specific customer, make it a sub-ledger here.

@joe: any other way?

3,496

(10 replies, posted in Reporting)

Choose a Ledger Folio printout for the customer for the current active fiscal year.

3,497

(10 replies, posted in Reporting)

@joe: does this need fixing?

1. De-allocate the advance payment made to the supplier.
2. The receipt of the refund should now balance the advances lying in the supplier account as allocations do not exist anymore for this supplier for this order.
3. Now cancel the order to the supplier.

All fiscal years store their data in the same database's tables, We can switch back and forth among the fiscal year of interest and hence the historical data of stock moves need to remain stored.

3,500

(12 replies, posted in Reporting)

You're right, reporting/rep110.php provides the Delivery Note / Packing Slip.

At line 139:

                $rep->row = $newrow;

insert the following:

                $rep->Line($rep->row-1);