$line->addTax(); if($line->update() === FALSE){ $error_msg .= "Could not update quantity on line item!"; debug_message($line->getLastError()); }else{ $ct = new SI_CompanyTransaction(); if($ct->get($invoice->trans_id) === FALSE){ $error_msg .= "Error getting transaction for invoice!"; debug_message($ct->getLastError()); }else{ $ct->amount -= $ill->getPrice(); if($ct->update() === FALSE){ $error_msg .= "Error updating company transaction with new price"; debug_message($ct->getLastError()); }else{ if($ill->delete() === FALSE){ $error_msg .= "Error deleting line link"; debug_message($ill->getLastError()); }else{ header('Location: '.getCurrentURL(null, false).'?mode=edit&id='.$line->id."\r\n"); die(); } } } } } $_REQUEST['mode'] = 'edit'; } if($line->id > 0){ $line->get($line->id);