Topic: Significance of field sys_types.type_no
The table #_sys_types has 3 fields, viz., type_id, type_no, next_reference.
The first one - type_id - serves to be the input form field suffix for the form textbox input element's name attribute in Setup => Forms Setup.
The last one - next_reference - serves to be the next ID number available for a new record in the appropriately related table.
All references in sql statements in FA refer to only these fields in the WHERE clauses.
In includes/db/references_db.inc:
function save_next_reference($type, $reference) => Updates the next_reference field
function get_next_reference($type) => Obtains the next_reference field
In includes/systypes.inc:
function get_systypes() => "SELECT * FROM ".TB_PREF."sys_types";
Where does the middle field "type_no" get used in?
The function get_systypes() gets called in the file admin/forms_setup.php only and that too once for displaying the form and then for saving the form values.
There appears to be nowhere that the field type_no is used.
Does the sys_prefs.type_no have anything to do with the type_no and trans_no in various related tables?
case 31 refers to the non existent "service_orders" table in function get_systype_db_info() in includes/systypes.inc.