Topic: Bug in creating new supplier

Using 2.3.10 there seems to be a bug in entering a new supplier and NOT checking the prices include VAT.

error message : Incorrect integer value: '' for column 'tax_included' at row 1
sql that failed was : UPDATE 1_suppliers SET supp_name='Printed.com', supp_ref='Printed.com', address='Unit 2\nArcot Court\nNelson Road\nCramlington\nNorthumberland\nNE23 1BB', supp_address='', gst_no='621141690', website='www.printed.com', supp_account_no='', bank_account='', credit_limit=0, dimension_id='0', dimension2_id='0', curr_code='GBP', payment_terms='5', payable_account='2100', purchase_account='', payment_discount_account='5000', notes='', tax_group_id='6', tax_included='' WHERE supplier_id = '49'

If the checkbox is ticked - then no problem - but that isn't good if the suppliers prices do NOT contain VAT.

Thanks

Re: Bug in creating new supplier

Please check that line 226 in /purchasing/manage/suppliers.php is

            add_supplier($_POST['supp_name'], $_POST['supp_ref'], $_POST['address'], $_POST['supp_address'],
                $_POST['gst_no'], $_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'], check_value('tax_included'));

if not, you should upgrade to 2.3.11.

/Joe

Re: Bug in creating new supplier

Using ver. 2.3.24 and can´t add suppliers.

I´m about to go blind and insane. Looked all over and can´t find any info on it that will correct the problem....plzzzz....HELP.

4 (edited by apmuthu 11/13/2015 07:40:41 am)

Re: Bug in creating new supplier

Which platform for server and what browser and version? Use latest stable snapshot.

Re: Bug in creating new supplier

HostGator / shared hosting
Program Versions / Program Version / Apache: 2.2.29 / CentOS: CentOS release 6.7 (Final) / cPanel: 11.48.4 (build 7)
Curl: 7.12.1 / MySQL 5.5.42-37.1 / phpMyAdmin 4.3.8 / Python: 2.6.6 / Program Version Perl: 5.8.8 / PHP: 5.4.43
ionCube Loader: 4.7.4 / Zend Optimizer:   / Ruby: 1.8.7 / Rails: 2.3.18 / OpenSSL: 1.0.1e-fips

Web Browser: Google Chrome / Ver. 46.0.2490.86 m

Hope we have provided you with the requested info.

For snapshot provided....I guess we need to upload zip and decompress in order to replace currrent FA folder....right ?

Re: Bug in creating new supplier

Yes, unzip the contents of the snapshot into your FA webroot overwriting existing files.
Make sure that the necessary folders and files are webserver writeable as needed.
The MySQL user should have the necessary privileges before installation.

7 (edited by sbt507 11/13/2015 06:34:15 pm)

Re: Bug in creating new supplier

db image & bd structure.....see here [img]http://s4.postimg.org/bt345zkft/2015_11_13_2.png[/img]

[img]http://s4.postimg.org/iktj8u9fd/2015_11_13_3.png[/img]

it seems as if script can´t communicate with db....that´s my impression.....FYI....I´m just an empirical fellow....so please, share your expert knowledge....it´ll be greatly appreciated.

Perhaps, you might want to check my supplier.php file here.....suppliers.php

8 (edited by apmuthu 11/13/2015 06:59:47 pm)

Re: Bug in creating new supplier

Since you are using cPanel, you might want to check if the username prefix is there - generally it will be your cPanel username with an underscore and then your actual username. The same may apply to your database as well. If you are able to login correctly, then your database is working okay.

Replace all instances of ruc_no with gst_no and R.U.C. No: with GSTNo: in your suppliers.php file. Looks like there is something wrong with your FA php files itself. The suppliers table is missing the supp_ref field and the gst_no field is wrongly named ruc_no.

DROP TABLE IF EXISTS `0_suppliers`;
CREATE TABLE IF NOT EXISTS `0_suppliers` (
  `supplier_id` int(11) NOT NULL auto_increment,
  `supp_name` varchar(60) NOT NULL default '',
  `supp_ref` varchar(30) NOT NULL default '',
  `address` tinytext NOT NULL,
  `supp_address` tinytext NOT NULL,
  `gst_no` varchar(25) NOT NULL default '',
  `contact` varchar(60) NOT NULL default '',
  `supp_account_no` varchar(40) NOT NULL default '',
  `website` varchar(100) NOT NULL default '',
  `bank_account` varchar(60) NOT NULL default '',
  `curr_code` char(3) default NULL,
  `payment_terms` int(11) default NULL,
  `tax_included` tinyint(1) NOT NULL default '0',
  `dimension_id` int(11) default '0',
  `dimension2_id` int(11) default '0',
  `tax_group_id` int(11) default NULL,
  `credit_limit` double NOT NULL default '0',
  `purchase_account` varchar(15) NOT NULL default '',
  `payable_account` varchar(15) NOT NULL default '',
  `payment_discount_account` varchar(15) NOT NULL default '',
  `notes` tinytext NOT NULL,
  `inactive` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`supplier_id`),
  KEY `supp_ref` (`supp_ref`)
) ENGINE=MyISAM;

RUC [General/National Taxpayers Register by its acronym in Spanish] Nr.

Which CoA are you using and from where?

Re: Bug in creating new supplier

My bad guys...sorry for disturbing your peace.....I guess I made a beginner´s mistake in changing the db field name from gst_no to ruc_no. I figured if php script was calling at ruc_no, then field name at db should have been named accordingly, but I guess a translation does not necessarily means the script core will change its path to the db.....Am I reasoning correctly ?

FYI, and based on my assumption, I went ahead and reversed the above changes on the db to its original " gst_no " ....and voila...it worked.

10 (edited by sbt507 11/14/2015 09:40:47 pm)

Re: Bug in creating new supplier

apmuthu......in regards to your COA question....I´m using the ones checked here on this image.....

http://screenshot.net/37qnktm......[img]http://screenshot.net/37qnktm.jpg[/img]


Let me know if it´s ok.

Thanks for collaboration.

11 (edited by apmuthu 11/15/2015 03:41:10 am)

Re: Bug in creating new supplier

Thanks for the feedback. I was wondering where the ruc_no came from....

You may henceforth refer to the various extension modules - Charts, Extensions, Languages and Themes - by linking to files in my unofficial GitHub repo's extensions folder or your fork of it. In this case it would be:

Default American coa (5 digits)
US chart of accounts for service company.
Spanish COA - ISO