Topic: Cannot add new journal entry

Hello
I have serious  bug with journal entry. When i add new entry and choose the account when i click "Add Item" button it just do nothing,
It keep loading without performing any action !! how can i fix this I'm running version 2.3.25
regards

Re: Cannot add new journal entry

Test with latest FA v2.3.25+.

Re: Cannot add new journal entry

I'm already running FronAccounting v 2.3.25 Build 21.02.2016 is the version you mentioned newer one ?

Re: Cannot add new journal entry

also please check this video
https://www.dropbox.com/s/37nfjozmk8kirvy/FrontAccounting%20Triangle%20Issue.mp4?dl=0
i have recorded it to demonstrate the problem ,, i was shooting it mainly for hosting provider to check the issue from their side as well ,, please check it i think it would give you better overview of the problem ...
thanks

Re: Cannot add new journal entry

anyways i have downloaded and updated my installation with the one you provided and i still face the same issue.

Re: Cannot add new journal entry

Check on the config.php file (frontaccounting root folder) and enable debug options to understand where your error could be coming from.

Re: Cannot add new journal entry

those are the errors that happened today in the /home/fgc/public_html/tmp/errors.log
What does means and how to solve it
[18-Sep-2016 09:30:15 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 10:49:42 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 11:54:08 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 12:19:39 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 12:30:40 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 12:38:53 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 12:43:53 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 12:49:09 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 12:49:14 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 12:56:12 UTC] 0:nour:gl_journal_ui.inc:97: Invalid argument supplied for foreach()
[18-Sep-2016 12:57:00 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 12:59:02 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 13:00:54 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 13:01:00 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 13:02:47 UTC] 0:nour:gl_journal_ui.inc:97: Invalid argument supplied for foreach()
[18-Sep-2016 13:06:44 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 13:06:56 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 13:15:29 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 13:19:50 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 13:20:35 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 13:23:51 UTC] 0:nour:gl_journal_ui.inc:97: Invalid argument supplied for foreach()
[18-Sep-2016 13:32:51 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 14:08:52 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 14:17:58 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 14:18:00 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 14:18:12 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 14:24:56 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 14:27:13 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 14:27:15 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 14:39:47 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given
[18-Sep-2016 14:39:51 UTC] 0:nour:connect_db.inc:98: mysql_fetch_array() expects parameter 1 to be resource, boolean given

Re: Cannot add new journal entry

Here we go i see this error when i try to add new Item:
Undefined index: journal_items in file: /home/trials/public_html/frontaccountingtest/gl/gl_journal.php at line 295
Call to a member function add_gl_item() on null in /home/trials/public_html/frontaccountingtest/gl/gl_journal.php on line 295
-------------
how can i fix this ,, i really appreciate your help

Re: Cannot add new journal entry

@Mohammed  Nour - I have read your email as well. 

This is because of the file which has the  `add_gl_items`.  You need that file to fix it.

Can you check your gl folder with fresh copy from server.  Find the file than your problem might be solved.

Subscription service based on FA
HRM CRM POS batch Themes

Re: Cannot add new journal entry

kvvaradha : can you please explain more ,, this error happens with fresh new installation i didn't modify anything i didn't remove any files

11 (edited by apmuthu 09/20/2016 07:26:55 am)

Re: Cannot add new journal entry

FA v2.3.25 was released on 2016-02-21. Since then there have been many fixes. Please use FA 2.3.25+ which was last updated on 2016-07-26.

The errors you are getting possibly arise with incompatible php settings for your later version of PHP. What is your PHP/MySQL version and what platform and version is your server on (CentOS 6, Debian 8, etc)?

The offending line 295 in gl/gl_journal.php is:

    $_SESSION['journal_items']->add_gl_item($_POST['code_id'], $_POST['dimension_id'],
        $_POST['dimension2_id'], $amount, $_POST['LineMemo']);

The class member function add_gl_item is defined in includes/ui/items_cart.inc and it was last changed on 2014-09-22, much before the release of the version you are using. The file gl/gl_journal.php was last changed on 2015-03-15 and that too hasn't changed in your version. Hence it must be a generic issue of handling $_POST array's elements and that points to the newer PHP's idiosyncracies.

Re: Cannot add new journal entry

@apmuthu
Thanks for your reply i have update to the latest version you mentioned and i still face the same issue, I'm running cPanel  CloudLinux server with PHP 5.4,,, I have sent you logins for a test installation in PM ,, It would be great if you test it yourself ,,,Appreciate your help

13 (edited by apmuthu 09/21/2016 06:08:07 am)

Re: Cannot add new journal entry

The code is correct.
The way you entered the JV is wrong.
Each JV must have atleast 2 entries or the default 1060 (in your case) will be the contra entry filling in for the difference of all entries made in the JV till then. You had chosen the default contra account of 1060 (set in Banking & GL => Bank Accounts => Dflt=Yes) as the first entry and then did not provide any second entry as the transfer account.

@joe: JV should not be allowed to proceed if there is only 1 entry and it is the default Bank Account. Also, we need to prevent a JV from being entered if there are 2 entries and both have the same Account Code and Amount (one on the Credit side and the other on the Debit side). Mere transfer of one amount from one account to itself in entirety is meaningless.

Post's attachments

JV_screenshots.zip 18.1 kb, 3 downloads since 2016-09-21 

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

Re: Cannot add new journal entry

Most people using the journal entry know the rules. There should not be more restrictions than needed.
It should not be possible to enter a voucher, that is not balanced.

During the long time FA has been running, I have heared of no problems in the journal voucher.

Joe

Re: Cannot add new journal entry

thanks for the reply ,, i have shoot a new video that demonstrate the problem ,, please check it from here
https://www.dropbox.com/s/5l6yv7z5yml0jlc/FrontAccount%20Error.mp4?dl=0
it just 1.5 Min ,,,
After successfully adding 2 journal entries the program refused to add more and    the debugger shows
Undefined index: journal_items in file: /home/trials/public_html/frontaccountingtest/gl/gl_journal.php at line 295
Call to a member function add_gl_item() on null in /home/trials/public_html/frontaccountingtest/gl/gl_journal.php on line 295
The error appears when i click "Add Item" button not when i click "Process journal entry"
---
@apmuthu: i confirm that i was unable to add more items (unable to add more accounts / unable to add second transfer entry)

Re: Cannot add new journal entry

Ok, I will investigate this tomorrow.

Joe

Re: Cannot add new journal entry

Can you take a zip of your files and upload somewhere and provide us the download link.

Subscription service based on FA
HRM CRM POS batch Themes

Re: Cannot add new journal entry

Front Accounting Installation URL: http://trials.prodevcloud.com/frontaccountingtest/
Compressed ZIP file of this  buggy installation Can be downloaded from here: https://www.dropbox.com/s/liwzru2byeuzyqk/frontaccountingtest.zip?dl=0
Thanks joe, kvvaradha and apmuthu

Re: Cannot add new journal entry

Hello @mohamednour.

I have not used your install environment, but downloaded your backup from 21 sep 2016.
This file has been entered into my latest 2.3.25 build, and I cannot reproduce your errors. Everything is flne.

Please download the latest snapshot from this link.

and try again.

If you still have errors, then we have to search the errors in your environment. Server version, php version, mysql version etc.

/Joe

20 (edited by apmuthu 09/22/2016 10:50:21 am)

Re: Cannot add new journal entry

Your zip file was not downloadable.

I have not been able to replicate your issue on a fresh install. Attached are the screenshots of my being able to enter 4 JVs in a row and surviving a browser timeout and editing a JV as well without errors.

My test was done on PHP 5.3.1 on XAMPP in WinXPSP3 for FA 2.4RC1 which should better accomodate PHP 5.4 code. Yours appears to be a specific PHP 5.4 issue or your flavour of Linux's quirks (Cloud OS).

Remove the "?>" (without the quotes) in the last lines in all php and inc files for use of FA 2.3.25+ with PHP 5.4.

Post's attachments

FA24_JV_no_probs.zip 51.3 kb, file has never been downloaded. 

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