Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database Error 1406 Cannot insert bank transaction
07-20-2017, 05:57 AM,
#1
Database Error 1406 Cannot insert bank transaction
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
Reply
07-20-2017, 06:15 AM, (This post was last modified: 04-24-2018, 10:22 AM by TurboPT.)
#2
RE: Database Error 1406 Cannot insert bank transaction
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
Reply
07-20-2017, 06:38 AM,
#3
RE: Database Error 1406 Cannot insert bank transaction
I changed line 1973 of CounterSales.php and that seems to have corrected that error. Thank you.
Reply
08-07-2017, 12:19 AM,
#4
RE: Database Error 1406 Cannot insert bank transaction
This fix still hasn't been applied to SVN

Tim
Reply
08-11-2017, 11:02 AM,
#5
RE: Database Error 1406 Cannot insert bank transaction
Tim's change committed to SVN: revision 7813
Reply
04-24-2018, 06:06 AM,
#6
RE: Database Error 1406 Cannot insert bank transaction
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.
Reply
04-24-2018, 07:09 AM,
#7
RE: Database Error 1406 Cannot insert bank transaction
(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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)