Topic: Purchases - Database Error

I am currently utilising version 2.3.11

When creating a direct invoice under purchases, I get the following error message if the supplier has the same currency as my company.  Each set up with ZAR as currency


DATABASE ERROR : Cannot insert a supplier transaction record
error code : 1265
error message : Data truncated for column 'ov_discount' at row 1
sql that failed was : INSERT INTO 0_supp_trans (trans_no, type, supplier_id, tran_date, due_date, reference, supp_reference, ov_amount, ov_gst, rate, ov_discount, tax_included) VALUES ('9', '20', '4', '2011-12-31', '2011-12-31', '3', '3', '25', '1.25', '1', '', '0')

Set-up error or bug?

Re: Purchases - Database Error

It seems to be a bug. I am out of office until Tuesday. I will have a look at it then.

Joe

Re: Purchases - Database Error

Yes, this should be fixed in sources. For now you can adjust your mysql configuration in my.ini/my.sfg file, removing STRICT_ALL_TABLES/STRICT_TRANS_TABLES from sql_mode setting.

Re: Purchases - Database Error

This has now been fixed in repository. Will be included in next minor release.

In the mean time you can change line 458 in /purchasing/po_entry_lines.php to:

            $inv->ov_amount = $inv->ov_gst = $inv->ov_discount = 0;

/Joe