Topic: direct invoice & sales order problem

Hi,

I tried to enter a 'direct sales invoice' having setup cutomers & branches etc, when I clicked on 'place invoice' an exclamation mark triangle appears at the top of the screen. I have tried to enter direct sales invoices a few times but the sytem will not post them, I just keep getting the warning triangle? This happens as admin or a user.

After doing a sales order enquiry, I found 27 sales orders even though I have not entered any. When I click on an order # or attempt to edit one I get:

Database error: FATAL sales order returning nothing-0 plus a whole lot of other errors?

Where am I going wrong here and how do I delete the empty sales orders?

I am using Linux ubuntu server and FA 2.2.2.

Thanks for any help.

David

Re: direct invoice & sales order problem

Can you see something spurious in your error_log for the specific operation periods?

/Joe

Re: direct invoice & sales order problem

Hi Joe,

Can't see anything in the log to do with direct sales invoices or sales orders which I tried to post yesterday, the only error that occurs regularly is:

[10-Jan-2010 21:26:51] 1:admin:class.pdf.inc:63: Declaration of Cpdf::ellipse() should be compatible with that of TCPDF::Ellipse()

When I tried to post the direct sales invoice there were 2 revolving progress arrows which stopped an then the red warning triangle icon. When I checked the sales order transactions I found the raft of sales orders that I cannot delete?

David

Re: direct invoice & sales order problem

Hello David,
Strange.
Maybe you can run a System Diagnostics (Setup tab) and either copy this into a text file or take a picture of it and send it to us.
You see our email in the Anouncement Forum.

/Joe

Re: direct invoice & sales order problem

Hi Joe,

I have emailed the system diagnostics output (from setup) as a pdf to you.

It all looks ok really apart from I am using lighttpd and not apache.

Cheers,

David

Re: direct invoice & sales order problem

Thanks David,
I have sent it to Janusz for further investigation. If you haven't tried the $go_debug=1 in config.php you might try it. So if you already have backed your client, you could try the direct invoice again to see if anything show up with $go_debug flag set to 1.

/Joe

Re: direct invoice & sales order problem

Hi Joe,

You read my mind, I set go_debug to 1 and this was the log output when I tried to enter a direct sales invoice:

[11-Jan-2010 12:52:19] PHP Fatal error:  Call to a member function run() on a non-object in /var/www/html/frontaccount/includes/session.inc on line 22
[11-Jan-2010 12:52:22] PHP Fatal error:  Call to a member function run() on a non-object in /var/www/html/frontaccount/includes/session.inc on line 22
[11-Jan-2010 12:52:25] PHP Fatal error:  Call to a member function run() on a non-object in /var/www/html/frontaccount/includes/session.inc on line 22

The progress arrows start blue, turn red then the warning triangle icon appears.

Thanks for your help,

David

Re: direct invoice & sales order problem

Hello again,
Janusz is busy at present and asked me to give this advise to you:

"We have seen these before. They were related to broken session variables. I would advice
check save_path for session variables, restart www server, and clear borwser
cache."

So please try this, David. And let us know if it helps.

/Joe

Re: direct invoice & sales order problem

Hi Joe,

Thanks for that.

What does the 'check save_path for session variables' mean? What do I have to do to check that?

Cheers,

David

Re: direct invoice & sales order problem

The session_save_path is set in your php.ini file. Check where this folder is located by searching for this session_save_path.
Then check the session file inside this folder for broken sessions. This is not easy, but maybe you can see if there seems to be broken sessions at the end.

/Joe

Re: direct invoice & sales order problem

Hi Joe,

Thanks for all this help by the way.

I checked php.ini, on ubuntu it's session.save_path and it's not set by default just commented out.

I decided to set the session.save_path to "/tmp" as an experiment but the problem still persists; after restarting webserver, clearing browser cache and attempting another direct sales invoice same problem and error message.

Cheers,

David

Re: direct invoice & sales order problem

Hi Joe,

I emailed janusz as after I did a fresh install with 2.2.3 (new db, db user) the direct invoice function still gave the same errors and produced 3 ghost sales orders.

If I do sales order->delivery->invoice there's no problem at all, so something is up with the direct sales invoice function in the code.

It seems to be seeing the location as blank for some reason, but I'm sure you will figure it out-if i was any good at php i would try and figure it out myself smile.

Cheers,

David

Re: direct invoice & sales order problem

Hi David, did you resolve this problem as I am having similar issues?

Re: direct invoice & sales order problem

Hi wbaileynzl,

I have been emailing Janusz with any details I can find and I think it's been tracked down to an sql setup file glitch.

I have used en_GB-general.sql to setup my companies, so I don't know if the fix below applies yet.

Janusz recommends this fix:

I think we have finally found the problem. Probably you haven't tax_types
table created in your database.

We had a bug in en_US-new.sql which caused error during installation when
example data option was not selected.  Unfortunately because of another issue in Create/Update companies page company with broken database was created and the error message is only displayed by the moment.

You can repair your database structure by removing invalid sales_order, sales_order_details, refs records and recreating tax_types table with:

CREATE TABLE `0_tax_types` (
   `id` int(11) NOT NULL auto_increment,
   `rate` double NOT NULL default '0',
   `sales_gl_code` varchar(11) NOT NULL default '',
   `purchasing_gl_code` varchar(11) NOT NULL default '',
   `name` varchar(60) NOT NULL default '',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`)
) ENGINE=InnoDB;

I think you log in to mysql with root password, choose the database for FA then run the above command, I need more advice before I attempt it.

Re: direct invoice & sales order problem

Finally the exact problem on Dave's database appeared as  deleted default POS. This shouldn't happen, but due to bug in checking routine it was possible.
If this is the case - add default POS with cash sales on, and update every defined FA user record (Edit/Update). After this sales order form should have all fields available.
Janusz

16 (edited by Stylight 01/20/2010 03:02:46 pm)

Re: direct invoice & sales order problem

Hi,

I have the same problem like londondaveuk. I also deleted the default POS. So I just recreated default POS with cash sales and updated user records, but it didn't solve the problem.

I looked into the code and it seems that 1) clicking on "Place Invoice" results in three calls to sales_order_entry.php (so each call creates sales order),  and 2) the value of $src->trans_type in function write() in cart_class.inc looks "strange".

Cheers,
St

Re: direct invoice & sales order problem

The 3 calls is result of retry after failure in ajax mode. To have some info what went wrong you can try call Direct Invoice page with javascript switched off in your browser. Also release 2.2.4 has improved error handling in this point.
Janusz