Topic: Error on update of supplier

Hi

I am getting this error when trying to update supplier.

DATABASE ERROR : The supplier could not be updated
error code : 1366
error message : Incorrect integer value: '' for column 'tax_included' at row 1
sql that failed was : UPDATE suppliers SET supp_name='ADM Milling Ltd', supp_ref='ADM Milling', address='Kingsgate\n1, King Edward Road\nBrentwood, Essex\nCM14 4HG', supp_address='Kingsgate\n1, King Edward Road\nBrentwood, Essex\nCM14 4HG', gst_no='', website='', supp_account_no='', bank_account='', credit_limit=0, dimension_id='0', dimension2_id='0', curr_code='GBP', payment_terms='5', payable_account='13201', purchase_account='', payment_discount_account='20109', notes='', tax_group_id='1', tax_included='' WHERE supplier_id = '2'

Re: Error on update of supplier

Certain newer versions of MySql doesn't accept empty values for numeric values.

Will be fixed to next minor.

/joe

Re: Error on update of supplier

This was a strange behaviour. Have tried to reproduce, but the default field value of tax_included is 0.

Which version of FA are you using?

/Joe

Re: Error on update of supplier

I'm using latest version 2.3.13 and Mysql version 5.5.28

Re: Error on update of supplier

Thanks, please download the file suppliers.php1. Rename it to suppliers.php and replace the file in /purchasing/manage/suppliers.php.

/Joe

Post's attachments

suppliers.php1 11.6 kb, 5 downloads since 2013-01-03 

You don't have the permssions to download the attachments of this post.

Re: Error on update of supplier

Hi Joe

Update has fixed the bug.

Thanks

Re: Error on update of supplier

Thanks Joe,

The change set 3130 is reproduced here to help detect and fix similar errors:

--- old/purchasing/manage/suppliers.php    Thu Oct 04 13:09:47 2012
+++ new/purchasing/manage/suppliers.php    Sat Jan 05 10:17:23 2013
@@ -214,7 +214,7 @@
                 $_POST['website'], $_POST['supp_account_no'], $_POST['bank_account'], 
                 input_num('credit_limit', 0), $_POST['dimension_id'], $_POST['dimension2_id'], $_POST['curr_code'],
                 $_POST['payment_terms'], $_POST['payable_account'], $_POST['purchase_account'], $_POST['payment_discount_account'],
-                $_POST['notes'], $_POST['tax_group_id'], @$_POST['tax_included']);
+                $_POST['notes'], $_POST['tax_group_id'], get_post('tax_included', 0));
             update_record_status($_POST['supplier_id'], $_POST['inactive'],
                 'suppliers', 'supplier_id');