anchor.diff:      		<table class="table table-striped table-condensed">
       			<tr>
       				<th>Campaign</th>
  -    				<th>Signup</th>
  -    				<th>Sale</th>
  -    				<th>Raw clicks</th>
  -    				<th>Unique clicks</th>
  -    				<th>Signups</th>
  -    				<th>Orders</th>
  +    				<th class="text-center">Signup</th>
  +    				<th class="text-center">Sale</th>
  +    				<th class="text-center">Raw clicks</th>
  +    				<th class="text-center">Uniq. clicks</th>
  +    				<th class="text-center">Signups</th>
  +    				<th class="text-center">Orders</th>
  +            <th class="text-center">Conv. A</th>
  +            <th class="text-center">Conv. B</th>
  +            <th>Earn</th>
       			</tr>
  -    			<% campaigns.each do |campaign| %>
  +    			<% campaigns.each do |campaign| 
  +            earning =  Order.where(affiliate_campaign_id: campaign.id)
  +                            .where.not(status: ["in cart", "cancelled"])
  +                            .sum(:total) * campaign.sale_commission / 100.0 %>
       			<tr>
       				<td><%= link_to campaign.name, edit_admin_marketing_affiliate_campaign_path(campaign) %></td>
  -    				<td><%= number_to_currency campaign.signup_commission %></td>
  -    				<td><%= campaign.sale_commission %>%</td>
  -    				<td><%= campaign.raw_clicks %></td>
  -    				<td><%= campaign.unique_clicks %></td>
  -    				<td><%= campaign.signups %></td>
  -    				<td><%= campaign.orders %></td>
  +    				<td class="text-center"><%= number_to_currency campaign.signup_commission %></td>
  +    				<td class="text-center"><%= campaign.sale_commission %>%</td>
  +    				<td class="text-center"><%= number_with_delimiter(campaign.raw_clicks) %></td>
  +    				<td class="text-center"><%= number_with_delimiter(campaign.unique_clicks) %></td>
  +    				<td class="text-center"><%= number_with_delimiter(campaign.signups) %></td>
  +    				<td class="text-center"><%= number_with_delimiter(campaign.orders) %></td>
  +            <td class="text-center"><%= (100.0 * campaign.signups / campaign.unique_clicks).round(1) %>%</td>
  +            <td class="text-center"><%= (100.0 * campaign.orders / campaign.unique_clicks).round(1) %>%</td>
  +            <td><%= number_to_currency(earning) %></td>
       			</tr>
       			<% end %>
       		</table>
  
positive.code:     <% mods = Rails.configuration.modules %>
      
      <ul class="nav nav-tabs" role="tablist">
        
        <% if mods.include? :marketing %>
          <li role="presentation" class="<%= "active" if ["campaigns", "", nil].include? params[:q] %>"><a href="<%= admin_system_affiliate_path(@affiliate, q: "campaigns")%>" role="tab">Marketing Campaigns</a></li>
          <li role="presentation" class="<%= "active" if params[:q] == "commissions" %>"><a href="<%= admin_system_affiliate_path(@affiliate, q: "commissions")%>" role="tab">Commissions</a></li>
          <li role="presentation" class="<%= "active" if params[:q] == "payments" %>"><a href="<%= admin_system_affiliate_path(@affiliate, q: "payments")%>" role="tab">Payments</a></li>
        <% end %>
        
        <% if mods.include? :store %>
          <li role="presentation" class="<%= "active" if params[:q] == "orders" %>"><a href="<%= admin_system_affiliate_path(@affiliate, q: "orders")%>" role="tab">Orders</a></li>
        <% end %>
      </ul>
  		
      
  
negative.code:     
        <%
          campaigns = AffiliateCampaign.where(affiliate_id: @affiliate.id)
          orders = Order.includes(:affiliate_campaign)
                        .where(affiliate_campaign_id: campaigns)
                        .where.not(status: "in cart")
                        .order(submitted: :desc)
                        .paginate(page: params[:page], per_page: 10) 
        %>
    
        <%= will_paginate orders %>
        <table class="table table-striped table-condensed">
        	<tr>
        		<th>Order #</th>
        		<th>Date</th>
        		<th>Customer</th>
        		<th>Location</th>
        		<th>Amount</th>
            <th>Earn</th>
        		<th>Status</th>
        	</tr>
        	<% orders.each do |order| %>
        	<tr>
        		<td><%= link_to order.id, admin_store_order_path(order) %></td>
        		<td><%= systime order.submitted if order.submitted%></td>
        		<td><%= order.shipping_name || order.billing_name %></td>
        		<td><%= order.shipping_city %>, <%= order.shipping_state %></td>
        		<td><%= number_to_currency(order.total) %></td>
            <td><%= number_to_currency(order.total * order.affiliate_campaign.sale_commission / 100.0) %></td>
        		<td><%= order_status(order) %></td>
        	</tr>
        	<% end %>
        </table>
        
        <div class="table-summary">
        	<%= number_with_delimiter(orders.total_entries) %> records
        </div>
  
      <% elsif params[:q] == "payments" %>
      
  