webERP Forum
Database Error 1406 Cannot insert bank transaction - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (http://www.weberp.org/forum/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (http://www.weberp.org/forum/forumdisplay.php?fid=8)
+--- Thread: Database Error 1406 Cannot insert bank transaction (/showthread.php?tid=4449)



Database Error 1406 Cannot insert bank transaction - sunshinelock - 07-20-2017

Running 4.13.1

My host had a kernel update and now I have to weed out bugs.

When I try to do a Counter Sale, the following error shows:

SUCCESS Report : Order Number 13946 has been entered
Database Error 1406 : Cannot insert a bank transaction
Data too long for column 'ref' at row 1
Database Rollback Due to Error Above : Rolling Back Transaction OK


RE: Database Error 1406 Cannot insert bank transaction - TimSchofield - 07-20-2017

Line 1973 should be changed to read:

'" . mb_substr($_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') . ' ' . $InvoiceNo, 0, 50) . "',

You appear to have fallen foul of the sql_mode (https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html issue that I have banged on about for many years. Mysql can run in many different modes that are more or less tolerant of different issues and your hosting company seem to have been a bit naughty in changing mode on you without warning.

Tim


RE: Database Error 1406 Cannot insert bank transaction - sunshinelock - 07-20-2017

I changed line 1973 of CounterSales.php and that seems to have corrected that error. Thank you.


RE: Database Error 1406 Cannot insert bank transaction - TimSchofield - 08-07-2017

This fix still hasn't been applied to SVN

Tim


RE: Database Error 1406 Cannot insert bank transaction - TurboPT - 08-11-2017

Tim's change committed to SVN: revision 7813


RE: Database Error 1406 Cannot insert bank transaction - sunshinelock - 04-24-2018

Upgraded to 4.14 over the weekend.

I noticed that I posted with this error several months ago and it was resolved. However I get this error now:

SUCCESS Report : Order Number 15102 has been entered
Database Error : Cannot insert a bank transaction
Data too long for column 'ref' at row 1

I check for a record of sales and it's not there.

The strange thing... if I'm logged in as me (administrator) I don't get this error. If I'm logged in as my front counter salesperson, I keep getting this error and sales aren't recorded. I checked line 1973 and it reads as it should as mentioned in Post # 2 above.


RE: Database Error 1406 Cannot insert bank transaction - TimSchofield - 04-24-2018

(04-24-2018, 06:06 AM)sunshinelock Wrote: Upgraded to 4.14 over the weekend.

I noticed that I posted with this error several months ago and it was resolved

Your welcome Smile

This has been fixed in the latest code on Github. Change line number 1973 to be:

'" . mb_substr($_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') . ' ' . $InvoiceNo, 0, 50) . "',

rather than

'" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') . ' ' . $InvoiceNo . "',

and this should fix it

Tim