1 (edited by pstevens 10/29/2023 04:49:24 pm)

Topic: Import Transactions not working

I'm on the latest version (oct 2023).  I'm trying to use the import transactions feature.  I have about 5 sales transactions to import.  I've formatted my data like the example.  However after I select the file and click process transactions (with or without the trial run selected) the spinner comes up on the screen and nothing happens.

I am getting some warnings in the log but I don't think they are fatal.  I also tried uploading a document, so I don't think it's  a permission problem for upload (BTW where do these files upload to?)

Can anyone help or give me ideas what to try next.  I'm trying to move stuff over from QB and this is my first hurdle!

[30-Oct-2023 00:10:27 Asia/Taipei] 1::hooks.inc:245:[before upgrade] Creation of dynamic property hooks_repgen::$path is deprecated
[30-Oct-2023 00:10:27 Asia/Taipei] 1::hooks.inc:245:[before upgrade] Creation of dynamic property hooks_import_items::$path is deprecated
[30-Oct-2023 00:10:27 Asia/Taipei] 1::hooks.inc:245:[before upgrade] Creation of dynamic property hooks_import_multijournalentries::$path is deprecated
[30-Oct-2023 00:11:36 Asia/Taipei] 1::hooks.inc:245:[before upgrade] Creation of dynamic property hooks_import_transactions::$path is deprecated
[30-Oct-2023 00:11:36 Asia/Taipei] 1::hooks.inc:245:[before upgrade] Creation of dynamic property hooks_repgen::$path is deprecated
[30-Oct-2023 00:11:36 Asia/Taipei] 1::hooks.inc:245:[before upgrade] Creation of dynamic property hooks_import_items::$path is deprecated
[30-Oct-2023 00:11:36 Asia/Taipei] 1::hooks.inc:245:[before upgrade] Creation of dynamic property hooks_import_multijournalentries::$path is deprecated
[30-Oct-2023 00:11:37 Asia/Taipei] 1::hooks.inc:245:[before upgrade] Creation of dynamic property hooks_import_transactions::$path is deprecated
[30-Oct-2023 00:11:37 Asia/Taipei] 1::hooks.inc:245:[before upgrade] Creation of dynamic property hooks_repgen::$path is deprecated
[30-Oct-2023 00:11:37 Asia/Taipei] 1::hooks.inc:245:[before upgrade] Creation of dynamic property hooks_import_items::$path is deprecated
[30-Oct-2023 00:11:37 Asia/Taipei] 1::hooks.inc:245:[before upgrade] Creation of dynamic property hooks_import_multijournalentries::$path is deprecated
[30-Oct-2023 00:14:51 Asia/Taipei] 1:admin:frontaccounting.php:66: Creation of dynamic property front_accounting::$renderer is deprecated

This is the relevant function:  (line 245 is the last nine before the first closing bracket.

    // install hooks provided by active extensions
    if (isset($installed_extensions) && !empty($installed_extensions)) {
        foreach($installed_extensions as $ext) {
            $hook_class = 'hooks_'.$ext['package'];
            if ($ext['active'] && class_exists($hook_class)) {
                $Hooks[$ext['package']] = new $hook_class;
                $Hooks[$ext['package']]->path = $ext['path'];
            }
        }    
    }
}

Re: Import Transactions not working

Your PHP is 8.2. Downgrade to php 8.0 and try it.

Subscription service based on FA
HRM CRM POS batch Themes

Re: Import Transactions not working

Thanks @kvvaradha, I suspected that, so I also installed it on my webserver which I can downgrade the PHP version.  I tried PHP 7.4 That had the same result.

Re: Import Transactions not working

@joe and @itronics

Whether all of our extensions updated with path variable. Needs your immediate attention to update them on our repository.

Subscription service based on FA
HRM CRM POS batch Themes

Re: Import Transactions not working

thanks @kvvardha I'm finding all kinds of deprecations with 8.2.  I've fixed a bunch in my installations.  Should I post them on Github or Manits?  or Here?  How is the best way to communicate these kinds of code changes to the dev team?  Most of them are minor.   I just changed a bunch of variables in functions where the required variable has to go last in 8.2 ie:  function_name( $a, $b=5, $c) needs to be function_name ($a, $c, $b=5) type of thing.  I fixed a bunch of those.

Re: Import Transactions not working

Post it here for a good discussion. Mantis participation is sparse but technical. Github is for accepted code after peer review.

Re: Import Transactions not working

Ok, here's an example:  /modules/import_transactions/includes/import_sales_order_entry.inc

PHP 8.2 produces deprecation warning  for line #11.  The constant must be moved to the end.  Moving $freightcost=0 to the end removes the warning:

function can_process($line, $customer_id, $branchNo, $reference, $date, $dimension_id, $dimension2_id, $delfrom, $deldate, $delto, $deladdress, $contactphone, $email, $custref, $shipvia, $comments, $exrate, $freightcost=0) {

There are other instances of this throughout this file.

Re: Import Transactions not working

Ok so I managed to get PHP 7.4 working on my NAS.  So the import transaction module seems to be working, sort of.  However, no transactions are imported and nothing happens with dry run.

I'm trying to import my transaction history from years back.  I'm thinking could this be the problem?  Do I need to open accounting years back in history?  Is this even possible to import historical transactions?

9 (edited by poncho1234 11/06/2023 06:01:50 pm)

Re: Import Transactions not working

pstevens wrote:

I'm on the latest version (oct 2023).  I'm trying to use the import transactions feature.  I have about 5 sales transactions to import.

It really would be quicker and easier to enter 5 transactions manually.

____________________________________________________

Have at least two installations of FA, use the extra for training yourself and then it doesn't matter if you make a mistake. Copy your backup from your existing actual to your training accounts; then use it before you use a new part of FA for your actual accounts. You'll learn more from your mistakes.

On your actual accounts backup at every opportunity and keep a comment/note of each backup.

____________________________________________________

Are you using $show_sql = 1; in config.php? it's close to the go_debug line; its very useful for debuging
____________________________________________________

pstevens wrote:

Do I need to open accounting years back in history?

Yes go to Setup>Fiscal years.

pstevens wrote:

Is this even possible to import historical transactions?

All transactions are historical



FA is worth it but does require effort, patience and resolve in the beginning. Keep going! You'll get there.

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Import Transactions not working

Thanks @poncho1234, I have thousands of transactions to import, I'm just testing with the first 5 to see if I can make it happen.  So far not working.  I've checked my import file so many times now.  The dates are correct format, the codes are all correct in all the columns.  My only remaining question is am I supposed to include the column titles in the csv?

I've tried everything I can think of and nothing is working.

Re: Import Transactions not working

@pstevens
I have to admit its not easy to crack Import Transactions module. But once you link all fields correctly then its a piece of cake and you will be proud of yourself. From experience and maybe you have done this already you have to:

Reference should tally i.e If you want to import 004/2022 then your pattern should be {001}/{YYYY} and you make sure 004/2022 does not exist in the system. Also the system will not accept blank reference. It accepts a space (NULL). All fields in the spreadsheet should also be formatted accordingly..i.e Reference is General and Date is Date with the identical date format...etc..Also make sure the Fiscal Year that you are posting into is active and the Banking and GL Configuration has the Allow entry on non closed Fiscal years ticked.

Hope this will help.

Re: Import Transactions not working

pstevens wrote:

My only remaining question is am I supposed to include the column titles in the csv?

All the example templates have headers... \modules\import_transactions\templates


In addition to @rafat's excellent advice you may want to reduce your 5 transactions to one or two.

Also open in a text editor and count commas, header and data should match and no comma at the end.

Archived posts on module is here...https://frontaccounting.com/punbb/viewtopic.php?id=5396 there are155 of them, only some useful and/or relevant though.

@rafat in that post apmuthu published an additional test file (Post 118), I couldn't get that to work either , can you check it and if necessary update it and then upload, sure users will find it useful.

@rafat; do you mean Allow entry on non closed Fiscal years which is in access setup? Cannot find anything in Banking & GL

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

13 (edited by rafat 11/09/2023 01:45:24 am)

Re: Import Transactions not working

@poncho1234
Yes the Allow Entry on non closed Fiscal Years is found in Access Setup under Banking and GL configuration.
I will take a look at apmuthu file and revert back here.

Re: Import Transactions not working

I looked at apmuthu file. It did work for FA 2.4.4 after that I tested at 2.4.8 it did not and nothing after that. Not at 2.4.17. I dont know why. Could not figure it out.

Re: Import Transactions not working

It didn't show any errors or warnings for me, were any showing for you?

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Import Transactions not working

Yes it did. For me it did not make sense as the error was coming from outside the Module and I think it is from the core. If you look at it the insert fields do not tally with what is in the csv file. Here is the error:

10-Nov-2023 01:31:32 Europe/Berlin] <b>DATABASE ERROR :</b> order Cannot be Added<br>error code : 1265<br>error message : Data truncated for column 'prep_amount' at row 1<br>sql that failed was : INSERT INTO 0_sales_orders (order_no, type, debtor_no, trans_type, branch_code, customer_ref, reference, comments, ord_date,
        order_type, ship_via, deliver_to, delivery_address, contact_phone,
        freight_cost, from_stk_loc, delivery_date, payment_terms, total, prep_amount)
        VALUES ('9','0','1', '30','1', '009/2017','auto','','2017-12-20', '1', '1','Donald Easter LLC','N/A', '', '0', 'DEF', '2017-12-20','4','70','')<br><br><br>

And here's the contents of the csv file

customer_id,branch_No,reference,date,payment_id,sales_type_name,dimension_id,dimension2_id,item_code,item_description,quantity,unit,price,discountpercentage,freightcost,delfrom,deldate,delto,deladdress,contactphone,email,custref,shipvia,comments,ex_rate
1,1,009/2017,2017/12/20,4,Retail,,,202,Maintenance,2,Each,35,0,,DEF,2017/12/20,Mr A,1 Abe Street Glasgow G32 FHT,984578545,customer@example.in,,,,
1,1,010/2017,2017/12/21,4,Retail,,,202,Maintenance,2,Each,15,0,,DEF,2017/12/21,Mr A,1 Abe Street Glasgow G32 FHT,984578545,customer@example.in,,,,

Re: Import Transactions not working

I don't get any errors.  Even with one record, just nothing happens when I press the button.

I do however get an error in my sales orders (when I go and check after wards) 


processing_end(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "import_sales_cart" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in file: /share/MD0_DATA/Web/frontaccounting/sales/includes/sales_ui.inc at line 32

Re: Import Transactions not working

rafat wrote:

Yes it did. For me it did not make sense as the error was coming from outside the Module and I think it is from the core. If you look at it the insert fields do not tally with what is in the csv file. Here is the error:

10-Nov-2023 01:31:32 Europe/Berlin] <b>DATABASE ERROR :</b> order Cannot be Added<br>error code : 1265<br>error message : Data truncated for column 'prep_amount' at row 1<br>sql that failed was : INSERT INTO 0_sales_orders (order_no, type, debtor_no, trans_type, branch_code, customer_ref, reference, comments, ord_date,
        order_type, ship_via, deliver_to, delivery_address, contact_phone,
        freight_cost, from_stk_loc, delivery_date, payment_terms, total, prep_amount)
        VALUES ('9','0','1', '30','1', '009/2017','auto','','2017-12-20', '1', '1','Donald Easter LLC','N/A', '', '0', 'DEF', '2017-12-20','4','70','')<br><br><br>

And here's the contents of the csv file

customer_id,branch_No,reference,date,payment_id,sales_type_name,dimension_id,dimension2_id,item_code,item_description,quantity,unit,price,discountpercentage,freightcost,delfrom,deldate,delto,deladdress,contactphone,email,custref,shipvia,comments,ex_rate
1,1,009/2017,2017/12/20,4,Retail,,,202,Maintenance,2,Each,35,0,,DEF,2017/12/20,Mr A,1 Abe Street Glasgow G32 FHT,984578545,customer@example.in,,,,
1,1,010/2017,2017/12/21,4,Retail,,,202,Maintenance,2,Each,15,0,,DEF,2017/12/21,Mr A,1 Abe Street Glasgow G32 FHT,984578545,customer@example.in,,,,

Dunno if this is resolved yet...
That error is a DB column type issue or the column value exceeds the max length.  Check database structure?

Re: Import Transactions not working

Ok I think I'm getting somewhere finally.  Aerodonkey thanks so much for the extra logging tip.  It's failing because it's not finding my customer ID.  So I assumed that the customer_id in the spreadsheet was the debtor number.  Is this correct?  Or is there some other customer ID.

Re: Import Transactions not working

I need some help with importing bank transactions (Deposit Processing and Payment Processing).  I was able to get it to work successfully in 2.4.11, and I'm trying again with the same CSV format in 2.4.18.

The import goes through and shows me the journal entries, but when I check the GJ reports none of the transactions are there.  Debug mode shows no errors.

Any idea why the transactions are not getting written?

Re: Import Transactions not working

We should make a plaid banking plugin. I was thinking and looking into it but didn't feel like doing the work lol!

Re: Import Transactions not working

Exactly what happened to me.  I brought it up.  Crickets.  Ever figure it out?

Re: Import Transactions not working

Well somebody needs to do something. Perhaps a few of us need to hire a programmer and then just sell the solution until we break even. This issue has been going on for years. 

trafficpest wrote:

We should make a plaid banking plugin. I was thinking and looking into it but didn't feel like doing the work lol!

Re: Import Transactions not working

Plaid is a great API to connect to banking institutions and isn't that complicated. I will probably start on it after I finish working on recurring deliveries + auto route optimization.
You are in US so for sure plaid will work for you. That is the drag about global accounting software without adoption of a global standard banking network. (Bitcoin, Cough cough)

Check out plaid here
https://plaid.com

Re: Import Transactions not working

Some time ago I found a similar api to Plaid on freewebapi.com