def index            
      if logged_in?
        if @invoice.customer_id.nil?
          @invoice.customer_id = logged_in_user.id
          @invoice.save
        end                        
        #redirect_to '/checkout/addresses'
        #return
        
        @invoice.verify_invoice_packages
        
        # See if any there are any empty invoice packages          
        #@invoice.invoice_packages.each do |op|
        #  count = 0
        #  @invoice.line_items.each do |li|
        #    count = count + 1 if li.invoice_package_id == op.id
        #  end
        #  op.destroy if count == 0
        #end
        #
        ## See if any line items aren't associated with an invoice package
        #line_items_attached = true
        #@invoice.line_items.each do |li|
        #  line_items_attached = false if li.invoice_package_id.nil?
        #end
        #  
        #ops = @invoice.invoice_packages
        #if ops.count == 0 || !line_items_attached
        #  @invoice.calculate
        #  LineItem.where(:invoice_id => @invoice.id).update_all(:invoice_package_id => nil)
        #  InvoicePackage.where(:invoice_id => @invoice.id).destroy_all          
        #  InvoicePackage.create_for_invoice(@invoice)
        #end
      
        #render :file => "caboose/checkout/checkout_#{@site.store_config.pp_name}"
        render :file => "caboose/checkout/checkout"                                                                                                                      
      end
    end
def index            
      if logged_in?
        if @invoice.customer_id.nil?
          @invoice.customer_id = logged_in_user.id
          @invoice.save
        end                        
        #redirect_to '/checkout/addresses'
        #return
        
        @invoice.verify_invoice_packages
        
        # See if any there are any empty invoice packages          
        #@invoice.invoice_packages.each do |op|
        #  count = 0
        #  @invoice.line_items.each do |li|
        #    count = count + 1 if li.invoice_package_id == op.id
        #  end
        #  op.destroy if count == 0
        #end
        #
        ## See if any line items aren't associated with an invoice package
        #line_items_attached = true
        #@invoice.line_items.each do |li|
        #  line_items_attached = false if li.invoice_package_id.nil?
        #end
        #  
        #ops = @invoice.invoice_packages
        #if ops.count == 0 || !line_items_attached
        #  @invoice.calculate
        #  LineItem.where(:invoice_id => @invoice.id).update_all(:invoice_package_id => nil)
        #  InvoicePackage.where(:invoice_id => @invoice.id).destroy_all          
        #  InvoicePackage.create_for_invoice(@invoice)
        #end
      
        #render :file => "caboose/checkout/checkout_#{@site.store_config.pp_name}"
        render :file => "caboose/checkout/checkout"                                                                                                                      
      end
    end
===========================================================================
 Step 1 - Login or register
 @route GET /checkout