+ if (!empty($SysPrefs->prefs['ref_no_auto_increase']))
+ $this->reference = $Refs->get_next($this->trans_type, null, array('date' => Today()));
+ if (!is_new_reference($this->reference, $this->trans_type))
+ {
+ commit_transaction();
+ return -1;
+ }