Re: Import Transactions

apmuthu wrote:

It is possible that the module's files are accepting only integers as account numbers.

Didn't think about that possibility.  how and where would I change that?

Re: Import Transactions

Look in the modules folder's sub-folder of the extension used. The name of the extension's folder path is listed in the installed_extensions.php file.

Re: Import Transactions

Hello Raddison,

Thanks firstly for the extension mulitple journals import. I found yours was about the most efficient.

Please could you advise how to make this work for v2.4

Thanks in anticipation.

Regards.

Samuel Osoba

Re: Import Transactions

I seem to be having issues under 2.4.1 with regards to importing transactions.
When I try import the transactions I have the following:

An initial error pops up about the use_popup_window.
That line can be commented out and appears to have no impact.

Then on the actual import there is an error that references: mysql_fetch_assoc() expects parameter 1 to be resource, object given in file: /home/briteacc/public_html/gdp/modules/import_transactions/includes/import_transactions.inc at line 635

And followed up with: Call to undefined method references::exists() in /home/briteacc/public_html/gdp/modules/import_transactions/import_transactions.php on line 246

I have been using this module for about 3 years (since my previous posts) and its been great and all of a sudden I have this error under 2.4.1

Re: Import Transactions

The $use_popup_windows is set in the config.php file (see config.default.php) and is used in the said module in line 68 in modules/import_transactions/import_transactions.php.

By default, the entire module uses old mysql_xxx functions. Your PHP / MySQL build may need the newer mysqli_xxx construct. Try replacing the 3 instances of mysql_fetch_assoc with mysqli_fetch_assoc or better still, the generic db_fetch_array in modules/import_transactions/includes/import_transactions.inc.

The db driver is auto chosen in includes/db/connect_db.inc:

if (function_exists('mysqli_connect'))
    include_once("connect_db_mysqli.inc");
else
    include_once("connect_db_mysql.inc"); // use deprecated mysql_* API as fallback on old servers

The following modules/files too have the hardcoded mysql_xxx construct:

osc_orders/osCommerce.php
repgen/repgen_strings.php
repgen/repgen_test_sel.php

The zen_import module references the ZenCart DB and hence has mysql_xxx constructs hardcoded:

zen_import/zencart.php
zen_import/includes/zen_interface_db.inc
zen_import/includes/zen_orders_db.inc

Committed in my repo with filter fix as well.

Post's attachments

import_transactions_inc.zip 9.4 kb, 8 downloads since 2017-07-01 

You don't have the permssions to download the attachments of this post.

Re: Import Transactions

Is it perhaps replacing sql with sqli in the opening lines of modules/import_transactions/includes/import_transactions.inc?

Regards Barry

Re: Import Transactions

No. Just replace the said file with the one in the attachment above.

Re: Import Transactions

Will download the update and try and confirm that it works.

THanks.

Re: Import Transactions

Hello I replaced the "modules/import_transactions/includes/import_transactions.inc" file with the one from your ( import_transactions_inc.zip 9.36 kb )download and unfortunately continue to get the error: Undefined variable: use_popup_windows in file: /var/www/html/account/modules/import_transactions/import_transactions.php at line 68.

Regards Barry

Re: Import Transactions

After the above I replaced all modules with this contained in the folder FA24extensions-33822bf1787e1c92e59f44c298bf8c48b644dedf.

I also turned on debugging which shows:

include_once(../../includes/db/references_db.inc): failed to open stream: No such file or directory in file: /var/www/html/account/modules/import_transactions/import_transactions.php at line 39
include_once(): Failed opening '../../includes/db/references_db.inc' for inclusion (include_path='.:/usr/share/php') in file: /var/www/html/account/modules/import_transactions/import_transactions.php at line 39
include_once(../../includes/manufacturing.inc): failed to open stream: No such file or directory in file: /var/www/html/account/modules/import_transactions/includes/import_sales_order_ui.inc at line 14
include_once(): Failed opening '../../includes/manufacturing.inc' for inclusion (include_path='.:/usr/share/php') in file: /var/www/html/account/modules/import_transactions/includes/import_sales_order_ui.inc at line 14
Undefined variable: use_popup_windows in file: /var/www/html/account/modules/import_transactions/import_transactions.php at line 68

Any further suggestions please>

Regards Barry

Re: Import Transactions

The file includes/db/references_db.inc was in FA 2.3.x but is not there in FA 2.4.x anymore.

Re: Import Transactions

Hello your message at Today 04:06:52 pm (CAT) refers. "The file includes/db/references_db.inc was in FA 2.3.x but is not there in FA 2.4.x anymore."

Thank you but how do I fix it?

Regards Barry

Re: Import Transactions

In addition the "Undefined variable: use_popup_windows in file: /var/www/html/account/modules/import_transactions/import_transactions.php at line 68" is still there even after having replaced the module with your new one AND the mondifications suggested to mysqli and  db_fetch_array.

Regards Barry

Re: Import Transactions

We need to find equivalents in the reflines class for the functions in the old file.

Re: Import Transactions

Hello.  Given that I am a PHP noob what is better?: To try and fix the extension as contemplated above or revert to the vanilla version and try and just try and sort out the pop-up problem. Does is also not make sense to involve the add-on developer? How does one do that on the forum.  I am finding this a bit frustrating as FA suits our accounting needs generally very well but I really need an import facility as our accountant has become used to this simple method of dealing with bank statements and I will have difficulty in selling a reversion to manual!

Regards Barry

Re: Import Transactions

The popup problem has been sorted out.

All FA 2.4.x extensions are in my unofficial repo. Fork it and get your developers to work on them and submit pull requests to incorporate them in the upstream.

Re: Import Transactions

Hi there. Please excuse my ignorance but if my specific issue has been addressed can I not simply reinstall from the unofficial repo including the fixed extensions?

Regards Barry

Re: Import Transactions

As FA 2.4.1 has just been released officially a few weeks ago, the extensions will need time to be tested for compatibility. My unofficial repo has the individual files only and they will need to be manually installed till they get into the official pkg repo.

There are other issues in getting this module to work in FA 2.4.x FA installs that are being worked upon. @braathwaate's fork of the unofficial FA24 extensions repo has some developments you may wish to partake of.

Re: Import Transactions

My Bad. There were typo's in one or two GL codes

Regards Barry

Re: Import Transactions

Those using FA 2.4.1+ please provide feedback on the latest import_transactions module in the unofficial GitHub FA 2.4 extensions  repo - this is a "fixed" version of the pkg in the official repo. This contains the mods / fixes by @braathwaate cleaned up for whitespace and spaced indentations.

Post's attachments

import_transactions.zip 49.9 kb, 7 downloads since 2017-07-22 

You don't have the permssions to download the attachments of this post.

Re: Import Transactions

Hello.

I downloaded and applied the latest Extensions modules from GITHub and applied the new modules, themes and languages.

Unfortunately the dreaded:         "Undefined variable: use_popup_windows in file: /var/www/html/accounts/modules/import_transactions/import_transactions.php at line 68" error has reappeared.

I edited the /includes/import_transactions.inc file as recommended in an earlier post but this did not resolve the problem.

Your suggestions will be appreciated.

Regards Barry

Re: Import Transactions

You may not have applied the correct version of import_transactions/import_transactions.php.  Lines 63 to 68 of the said file should be:

all_delete($yes = false);
$js = "";
if ($SysPrefs->use_popup_windows) 
    $js .= get_js_open_window(800, 500);
$help_context = "Import General Journals  / Deposits / Payments / Bank Statements / Sales Orders / Sales Invoices  <a href='spreadsheet_headers.html'>Help: Formats</a>";
page(_($help_context), false, false, "", $js);

All modules must be unzipped into the <FA_WebRoot>/modules/ folder to be usable. When installed and activated, they must find an entry in the relevant installed_extensions.php files.

Clear the browser cache and try anew.

Re: Import Transactions

I unzipped the modules in the downloads folder, copied them into the <FA_WebRoot>/modules/ folder. Then in FA I removed the previous modules and reinstalled same.  Will this automatically add them to the installed_extensions.php files?

Regards Barry

Re: Import Transactions

Oh I also made all the modules RW.

Regards Barry

Re: Import Transactions

It looks like I need to repair my installed_extensions.php file. (You mentioned files plural. Is there another one?)

Is the best way to do this to remove all extensions and themes, reset $next_extension_id = ***; // unique id for next installed extension, to 1 and then reinstall the themes and modules?

BTW I see that in the the installed extensions array all the extensions are shown as  'active' => false. Is this correct?

Regards Barry