function beforeDelete($dependants_array, $roo)
{
- print_R($dependants_array);exit;
+ // check if assigned.
+
+ $ass = DB_DataObject::factory('ipass');
+ $ass->ipsass_ipshead_id = $this->ipshead_id;
+ if ($ass->count()) {
+ $roo->jerr("This price list is assigned to a customer - please change that customer to another price list first");
+ }
+ $ass = DB_DataObject::factory('ipsiteminfo');
+ $ass->query("DELETE FROM ipsiteminfo WHERE ipsiteminfo_ipshead_id = {$this->id}");
+ return true;
}