function beforeUpdate($old, $q,$roo)
{
-
+ // we still use comptype in some old systems...
+
+ if (!empty($q['comptype_id'])) {
+ $en = DB_DataObject::Factory('core_enum');
+ $en->get($q['comptype_id']);
+ $this->comptype = $en->name;
+ }
+
+
if(!empty($q['_flag_delete'])){
$this->deleted_dt = $this->sqlValue("NOW()");
$this->deleted_by = $roo->getAuthUser()->id;