Errors entering data with changed decimal seperator


#1

Hi,

I’m currently evaluating if invoiceplane (v1.4.3) fits my needs and i stumbled upon some little bugs. I changed decimal separator to “,” and decimal point “.” as it is usual in Germany.

With these settings i observed these bugs so far:

  • If i try to create or update a Quote or Invoice without entering a discount i get the following error in my log:

ERROR - 2015-07-07 19:38:32 --> Query error: Incorrect decimal value: ‘’ for column ‘item_discount_amount’ at row 1
http://pastebin.com/raw.php?i=xA7BZsZY

  • The tax rates list and the tax rate form do not respect my changed decimal separator settings from “.” to “,”
  • Entering Products with a “,” as a decimal separator within “Price” or “Purchase Price” triggers a SQL Error like this one: http://pastebin.com/raw.php?i=tfMAvD61

Hope that helpsto further improve invoiceplane :smile:

Best regards,
Tim


#2

The first problem should be caused by mysql using strict mode.

The last two points both are caused by the separator settings. I created a bug report and @Kovah may assign it to me.

https://development.invoiceplane.com/browse/IP-310

Thanks for reporting


#3

Hi,

thanks for your reply. you’re right MySQL is set to STRICT_TRANS_TABLES. But the documentation tells that missing values will be replaced by the implicit default value for the data type which should be 0 for decimals.

For STRICT_TRANS_TABLES, MySQL converts an invalid value to the closest valid value for the column and inserts the adjusted value. If a value is missing, MySQL inserts the implicit default value for the column data type. In either case, MySQL generates a warning rather than an error and continues processing the statement. Implicit defaults are described in Section 11.6, “Data Type Default Values”.
https://dev.mysql.com/doc/refman/5.6/en/sql-mode.html#sqlmode_strict_trans_tables

For numeric types, the default is 0, with the exception that for integer or floating-point types declared with the AUTO_INCREMENT attribute, the default is the next value in the sequence.
https://dev.mysql.com/doc/refman/5.6/en/data-type-defaults.html

Maybe I get this wrong.

Is it a good idea to alter the structure to give the column “item_discount_amount” a default value?

Thanks in advance.


closed #4