Your add to cart has:
$ATC_salecode = floatval("R");// column binding
floatval() converts values to numbers... you need to store the text "R" not a number.
That line should read:
$ATC_salecode = "R";// column binding
It looks like you added that line manually. If you added it with the Server Behavior it would have been done correctly.