public function render_customer_revenue_column($id)
 {
     $customer = Customer::get($id);
     $revenue = 0.0;
     $stats = get_post_meta($customer->get_ID(), '_easy_customer_invoices_stats', true);
     if (is_array($stats) && isset($stats['total'])) {
         $revenue = $stats['total'];
     }
     echo Util::format_price($revenue);
 }
 public function get_customer()
 {
     return Customer::get($this->get_meta('customer'));
 }
 public function get_customer($request)
 {
     $invoice = Entities\Customer::get(absint($request['id']));
     if (null === $invoice) {
         return new WP_Error('wpeci_rest_customer_invalid_id', __('Invalid customer id.', 'easy-customer-invoices'), array('status' => 404));
     }
     return $invoice->prepare_for_api();
 }