Topic: Something wrong when Supplier Payment Entry on FA 2.2.3

When i entry supplier payment with Payments to Suppliers menu in purchases module, i get this error message :

DATABASE ERROR : Cannot retreive alloc to transactions
error code : 1064
error message : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY trans_no' at line 14
sql that failed was : SELECT trans.type, trans.trans_no, trans.reference, trans.tran_date, supplier.supp_name, supplier.curr_code, ov_amount+ov_gst+ov_discount AS Total, trans.alloc, trans.due_date, trans.supplier_id, supplier.address FROM 2_supp_trans as trans, 2_suppliers as supplier WHERE trans.supplier_id=supplier.supplier_id AND round(ABS(ov_amount+ov_gst+ov_discount)-alloc,6) > 0 AND trans.type != 22 AND trans.supplier_id= ORDER BY trans_no

I run FA 2.2.3 on Ubuntu 9.10 server edition with Mysql 5.1.37, Php 5.2.10,  and Apache 2.2.12.
Is it A bug? Could you help me how to fix this?

Thanks.

Re: Something wrong when Supplier Payment Entry on FA 2.2.3

That has been fixed in CVS.
You will also have to tab through (click and tab) Bank Fee and Payment Discount so they get filled with 0.00

That is also being looked at and will have a fix in CVS at some point

tom

Re: Something wrong when Supplier Payment Entry on FA 2.2.3

Thanks for your reply Tom.
I have done as your instructions, but until now still not working, error message still appears and I have not been able to make payment using that menu,strangely there was no error message when I tested with log in to demo company (company that created when instalation). Before I tell you that FA223 using our backup database that we created in FA22final.  Is there a mismatch database created by FA22 with FA223? There is any suggestion for me to fix it. Till now we pay our supplier invoiced with "Bank Payment" menu and using "Allocate Supplier Payments or Credit Notes" menu to allocate bank payment with that invoiced.

Re: Something wrong when Supplier Payment Entry on FA 2.2.3

hasnet,

I had the same problem. I looked into the code and find a bug in frontaccess\purchasing\includes\db\suppalloc_db.inc. Look for the line (around line 173)

AND trans.supplier_id=$supplier_id";

and replace it by

AND trans.supplier_id=".db_escape($supplier_id));

Cheers,
Sty

Re: Something wrong when Supplier Payment Entry on FA 2.2.3

Stylight,

It's works for me, my problem solved

Thanks.

Re: Something wrong when Supplier Payment Entry on FA 2.2.3

Stylight,

Your post is still usefull ! Currently using 2.2.7 and HAD the same trouble.
I just post here to thank you and let know other users that your solution works well on ver. 2.2.7
And ease search to next users :
Utilisateurs français : erreur 1064 achats Enregistrer décaissement Enregistrer décaissements
English users : error 1064 purchases Payments to Suppliers

Re: Something wrong when Supplier Payment Entry on FA 2.2.3

Please update your FA sources. This issue is fixed in current stable  2.2.8 release.
Janusz