public static function invoice_data(SI_Invoice $invoice)
 {
     $invoice_data = array('title' => $invoice->get_title(), 'id' => $invoice->get_id(), 'invoice_id' => $invoice->get_invoice_id(), 'status' => $invoice->get_status(), 'balance' => $invoice->get_balance(), 'deposit' => $invoice->get_deposit(), 'issue_date' => $invoice->get_issue_date(), 'estimate_id' => $invoice->get_estimate_id(), 'due_date' => $invoice->get_due_date(), 'expiration_date' => $invoice->get_expiration_date(), 'client_id' => $invoice->get_client_id(), 'client_data' => array(), 'po_number' => $invoice->get_po_number(), 'discount' => $invoice->get_discount(), 'tax' => $invoice->get_tax(), 'tax2' => $invoice->get_tax2(), 'currency' => $invoice->get_currency(), 'subtotal' => $invoice->get_subtotal(), 'calculated_total' => $invoice->get_calculated_total(), 'project_id' => $invoice->get_project_id(), 'terms' => $invoice->get_terms(), 'notes' => $invoice->get_notes(), 'line_items' => $invoice->get_line_items(), 'user_id' => $invoice->get_user_id(), 'payment_ids' => $invoice->get_payments());
     if ($invoice->get_client_id()) {
         $client = SI_Client::get_instance($invoice->get_client_id());
         if (is_a($client, 'SI_Client')) {
             $invoice_data['client_data'] = self::client_data($client);
         }
     }
     return $invoice_data;
 }