示例#1
0
			}
		}
	}

	$_REQUEST['mode'] = 'edit';
}elseif($_REQUEST['mode'] == 'delete_link'){
	if(intval($_REQUEST['link_id']) == 0){
		fatal_error("You must provide a link id to delete a link!");
	}

	$ill = new SI_InvoiceLineLink();
	if($ill->get($_REQUEST['link_id']) === FALSE){
		$error_msg .= "Could not get invoice line!";
		debug_message($ill->getLastError());	
	}else{
		$line->quantity -= $ill->getQuantity();
		$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{