fixed sn or barcode constraint

Changed condition to check if sn|barcode has NOT empty data (instead of "has any data").
Added test condition + fixed existing ones.