}
//----------------------------------------------------------------------------
-
-function is_new_reference($ref, $type)
+//
+// Check if reference was not used so far (for other transaction than $trans_no)
+//
+function is_new_reference($ref, $type, $trans_no=0)
{
$db_info = get_systype_db_info($type);
$db_name = $db_info[0];