Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database Error 1406 Cannot insert bank transaction
07-20-2017, 05:57 AM
Post: #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
Find all posts by this user
Quote this message in a reply
07-20-2017, 06:15 AM (This post was last modified: 04-24-2018 10:22 AM by TurboPT.)
Post: #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
Visit this user's website Find all posts by this user
Quote this message in a reply
07-20-2017, 06:38 AM
Post: #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.
Find all posts by this user
Quote this message in a reply
08-07-2017, 12:19 AM
Post: #4
RE: Database Error 1406 Cannot insert bank transaction
This fix still hasn't been applied to SVN

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
08-11-2017, 11:02 AM
Post: #5
RE: Database Error 1406 Cannot insert bank transaction
Tim's change committed to SVN: revision 7813
Find all posts by this user
Quote this message in a reply
04-24-2018, 06:06 AM
Post: #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.
Find all posts by this user
Quote this message in a reply
04-24-2018, 07:09 AM
Post: #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
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)