Topic: Tax type still showing when inactive

Hi,
Clean install with 'Standard new company American COA (4 digit)
No other entries made.

Created a tax, tax group and tax type

In create new item, tax type: new tax type can be selected from drop-down list, did not create item.

Then inactivate the new tax, tax group and tax type.

Return to create items and the new tax type is still available and can be selected and used?

Checked the database and inactive is 1 for the three taxes.

Server cache cleared
Browser cache cleared

Not sure if I'm doing something wrong or this is a bug?

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Tax type still showing when inactive

SESSION may have not been refreshed. Logout and close all instances of the browser and then try again.

Re: Tax type still showing when inactive

I did that, still can see the new tax type.

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Tax type still showing when inactive

I even tried on a different browser

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

5 (edited by poncho1234 10/28/2017 06:48:31 pm)

Re: Tax type still showing when inactive

So to investigate, the inactive flag is being posted to the server, so all tax, tax type, tax group are ok, and unlikely to have same bug in all three..

So File: \inventory\manage\items.php
394:     item_tax_types_list_row(_("Item Tax Type:"), 'tax_type_id', null);

calls to

via function item_tax_types_list_cells

File: \includes\ui\ui_lists.inc

1235: function item_tax_types_list($name, $selected_id=null)
1236: {
1237:     $sql ="SELECT id, name FROM ".TB_PREF."item_tax_types";
1238:     return combo_input($name, $selected_id, $sql, 'id', 'name', array('order' => 'id') );
1239: }
1240: 

I cannot see anything with inactive in here, comparing to other similar functions in ui_lists.inc; should line # 1237 read something like:-

$sql ="SELECT id, name, inactive FROM ".TB_PREF."item_tax_types";

I will try it

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

6 (edited by poncho1234 10/28/2017 06:44:23 pm)

Re: Tax type still showing when inactive

Ok so that worked: The inactive tax type now cannot be seen:-

File: \includes\ui\ui_lists.inc
1237:     
 - $sql ="SELECT id, name FROM ".TB_PREF."item_tax_types";
 + $sql ="SELECT id, name, inactive FROM ".TB_PREF."item_tax_types";

Questions:-

Is this a bug?
If not what is the intended functionality?

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Tax type still showing when inactive

I still see the inactive tax type.
The inactive field is missing in the SELECT field list in the functions tax_types_list() (line 1171) and tax_groups_list( (line 1205) too apart from your above item_tax_types_list() (line 1237) and templates_list() (line 1369) and workorders_list() (line 1399).

For any of the combo boxes, is it possible to add new elements on the fly?

@joe: is this fix necessary?

Re: Tax type still showing when inactive

Hi apmuthu, tax_types_list() (line 1171) and tax_groups_list( (line 1205) are not selected any whereelse, except in taxes and tax groups.

What's the point of making tax types inactive if you can still see them when you select an item?

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Tax type still showing when inactive

Looks like there must be atleast 1 entry in the "item_tax_types_list()" - there is no filter to remove the inactive ones. This is the "item_tax_types_list" and not merely the" tax_types_list".

Re: Tax type still showing when inactive

On further investigation, your fix is in order. See attachment. The inactive item_tax_type is seen with a strikethrough (CSS styled).

@joe: can commit it.

Post's attachments

InactiveTaxType.png 68.9 kb, file has never been downloaded. 

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

Re: Tax type still showing when inactive

Thank you apmuthu... looks good

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Tax type still showing when inactive

@apmuthu
wow.. you still use Firebug ??  i liked it much better than anything but i guess its dead now.

Re: Tax type still showing when inactive

Janusz is looking at this issue.

/Joe

Re: Tax type still showing when inactive

Yes, this was a bug in Item editor, just fixed in repo. Thanks for reporting.
Janusz

Re: Tax type still showing when inactive

The fix is a little long. @poncho1234's fix to acquire the inactive field's value directly in the sql may have sufficed as the combo box generation routine merges the $show_inactive variable appropriately like all other tables based combos. Functions like item_type_inactive($id) if replicated for each and every inactive field in FA's multitude of tables would become a veritable maze. Any overarching issues that were encountered in fixing it this way would be a lesson on coding similar pages for the community at large.

@itronics: Thanks for the quick fix.