$newContract->is_latest = 0;
                 $newContract->offeringid = $id;
                 $newContract->previousrevision = $contract->id;
                 $newContract->nextrevisions = '';
                 $newContract->oqc_template = '';
                 // Some variables needs to be converted to floats in order to avoind Deprecated warnings
                 $newContract->total_cost = floatval($newContract->total_cost);
                 $newContract->install_cost = floatval($newContract->install_cost);
                 $newContract->shipment_cost = floatval($newContract->shipment_cost);
                 $newContract->grand_total_vat = floatval($newContract->grand_total_vat);
                 $newContract->unique_total_negotiated_price = floatval($newContract->unique_total_negotiated_price);
                 $newContract->recurring_total_negotiated_price = floatval($newContract->recurring_total_negotiated_price);
                 //$GLOBALS['log']->error('Test variable type '. gettype($this->bean->total_cost));
                 $newContract->save();
                 // add relationships after save because we need a new id
                 $newContract->add_relationships_from($offering);
                 // update old contract nextrevision field
                 $contract->nextrevisions = $newContract->id;
                 $contract->save();
                 $offering->contractid = $newContract->id;
                 $offering->processed_dates_times = array();
                 $offering->save();
                 // redirect to contract in EditView; signal that temporary version should not be versioned by setting isLinked
                 return header("Location: index.php?action=EditView&module=oqc_Contract&record={$newContract->id}&isLinked=true");
             } else {
                 $GLOBALS['log']->fatal("You already created contract for this offering! Please modify existing Contract or create new revision of Quote");
                 return header("Location: index.php?action=DetailView&module=oqc_Contract&record={$contract->id}");
             }
         }
     }
 } else {