ish_manager 0.1.8.453 → 0.1.8.454
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/ish_manager/invoices_controller.rb +41 -10
- data/app/controllers/ish_manager/leadsets_controller.rb +5 -1
- data/app/controllers/ish_manager/products_controller.rb +87 -1
- data/app/controllers/ish_manager/subscriptions_controller.rb +7 -6
- data/app/views/ish_manager/application/_main_header_admin.haml +9 -9
- data/app/views/ish_manager/invoices/_form.haml +18 -10
- data/app/views/ish_manager/invoices/index.haml +26 -25
- data/app/views/ish_manager/invoices/new.haml +6 -4
- data/app/views/ish_manager/invoices/show.haml +19 -0
- data/app/views/ish_manager/leads/show.haml +12 -2
- data/app/views/ish_manager/leadsets/_form.haml +8 -5
- data/app/views/ish_manager/leadsets/index.haml +2 -0
- data/app/views/ish_manager/leadsets/show.haml +15 -2
- data/app/views/ish_manager/products/_form.haml +28 -0
- data/app/views/ish_manager/products/edit.haml +5 -0
- data/app/views/ish_manager/products/index.haml +28 -2
- data/app/views/ish_manager/products/show.haml +5 -0
- data/app/views/ish_manager/subscriptions/index.haml +9 -26
- data/config/routes.rb +2 -2
- metadata +6 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: fc91675a3fe4a13904b9afe625c1319e6b80f8488ed948d33a86295a2eeac6c5
         | 
| 4 | 
            +
              data.tar.gz: 75852ed84a3471fd35c874b0a80154b2a9ec1db79cef31291aa630451e57c0d1
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 8678024b34818b07b884f6cbe8be12abffe791471a6d55817cd898a6af3abb043aaebdd1981302a861c8e705672234920e63dd4a1036e436217c12e42a84fa2b
         | 
| 7 | 
            +
              data.tar.gz: d048bea2933f6bb1e44bd212591cee8895b1053f0400601818adb2326221bee29a0c6bf90176f3f4eb003c1dde812e0eaa58041af74d50f26139d714c7c88e03
         | 
| @@ -3,24 +3,55 @@ class ::IshManager::InvoicesController < IshManager::ApplicationController | |
| 3 3 |  | 
| 4 4 | 
             
              before_action :set_lists
         | 
| 5 5 |  | 
| 6 | 
            +
              def create
         | 
| 7 | 
            +
                @invoice = Ish::Invoice.new params[:invoice].permit!
         | 
| 8 | 
            +
                authorize! :create, @invoice
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                stripe_invoice = Stripe::Invoice.create({
         | 
| 11 | 
            +
                  customer:          @invoice.leadset.customer_id,
         | 
| 12 | 
            +
                  collection_method: 'send_invoice',
         | 
| 13 | 
            +
                  days_until_due:    0,
         | 
| 14 | 
            +
                  # collection_method: 'charge_automatically',
         | 
| 15 | 
            +
                  pending_invoice_items_behavior: 'exclude',
         | 
| 16 | 
            +
                })
         | 
| 17 | 
            +
                params[:invoice][:items].each do |item|
         | 
| 18 | 
            +
                  invoice_item = Stripe::InvoiceItem.create({
         | 
| 19 | 
            +
                    customer: @invoice.leadset.customer_id,
         | 
| 20 | 
            +
                    price:    item,
         | 
| 21 | 
            +
                    invoice:  stripe_invoice.id,
         | 
| 22 | 
            +
                  })
         | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
                Stripe::Invoice.send_invoice(stripe_invoice[:id])
         | 
| 25 | 
            +
                @invoice.update_attributes({ invoice_id: stripe_invoice[:id] })
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                if @invoice.save
         | 
| 28 | 
            +
                  flash[:notice] = "Created the invoice."
         | 
| 29 | 
            +
                  redirect_to action: :show, id: @invoice.id
         | 
| 30 | 
            +
                else
         | 
| 31 | 
            +
                  flash[:alert] = "Cannot create invoice: #{@invoice.errors.messages}"
         | 
| 32 | 
            +
                  render :new
         | 
| 33 | 
            +
                end
         | 
| 34 | 
            +
              end
         | 
| 35 | 
            +
             | 
| 6 36 | 
             
              def index
         | 
| 7 37 | 
             
                authorize! :index, Ish::Invoice
         | 
| 8 | 
            -
                @invoices = Ish::Invoice.all | 
| 38 | 
            +
                @invoices = Ish::Invoice.all
         | 
| 39 | 
            +
                if params[:leadset_id]
         | 
| 40 | 
            +
                  @invoices = @invoices.where( leadset_id: params[:leadset_id] )
         | 
| 41 | 
            +
                end
         | 
| 42 | 
            +
                @invoices = @invoices.includes( :payments )
         | 
| 9 43 | 
             
              end
         | 
| 10 44 |  | 
| 11 45 | 
             
              def new
         | 
| 12 46 | 
             
                authorize! :new, @invoice
         | 
| 47 | 
            +
                @leadset = Leadset.find params[:leadset_id]
         | 
| 48 | 
            +
                @products_list = Wco::Product.list
         | 
| 13 49 | 
             
              end
         | 
| 14 50 |  | 
| 15 | 
            -
              def  | 
| 16 | 
            -
                @invoice = Ish::Invoice. | 
| 17 | 
            -
                authorize! : | 
| 18 | 
            -
                 | 
| 19 | 
            -
                  flash[:notice] = "created invoice"
         | 
| 20 | 
            -
                else
         | 
| 21 | 
            -
                  flash[:alert] = "Cannot create invoice: #{@invoice.errors.messages}"
         | 
| 22 | 
            -
                end
         | 
| 23 | 
            -
                redirect_to :action => 'index'
         | 
| 51 | 
            +
              def show
         | 
| 52 | 
            +
                @invoice = Ish::Invoice.find params[:id]
         | 
| 53 | 
            +
                authorize! :show, @invoice
         | 
| 54 | 
            +
                @stripe_invoice = Stripe::Invoice.retrieve @invoice.invoice_id
         | 
| 24 55 | 
             
              end
         | 
| 25 56 |  | 
| 26 57 | 
             
              def update
         | 
| @@ -36,6 +36,9 @@ class ::IshManager::LeadsetsController < IshManager::ApplicationController | |
| 36 36 | 
             
                @leadsets = Leadset.all.kept.includes(:leads)
         | 
| 37 37 | 
             
                if params[:q].present?
         | 
| 38 38 | 
             
                  @leadsets = @leadsets.where(" company_url LIKE ? ", "%#{params[:q]}%" )
         | 
| 39 | 
            +
                  if @leadsets.length == 1
         | 
| 40 | 
            +
                    return redirect_to action: :show, id: @leadsets[0][:id]
         | 
| 41 | 
            +
                  end
         | 
| 39 42 | 
             
                end
         | 
| 40 43 | 
             
                @leadsets = @leadsets.page( params[:leadsets_page] ).per( current_profile.per_page )
         | 
| 41 44 | 
             
              end
         | 
| @@ -52,6 +55,7 @@ class ::IshManager::LeadsetsController < IshManager::ApplicationController | |
| 52 55 | 
             
                @leadset.employees.each do |lead|
         | 
| 53 56 | 
             
                  @email_contexts[lead.email] = lead.email_contexts
         | 
| 54 57 | 
             
                end
         | 
| 58 | 
            +
                @employees = @leadset.employees.page( params[:leads_page] ).per( current_profile.per_page )
         | 
| 55 59 | 
             
              end
         | 
| 56 60 |  | 
| 57 61 | 
             
              def update
         | 
| @@ -62,7 +66,7 @@ class ::IshManager::LeadsetsController < IshManager::ApplicationController | |
| 62 66 | 
             
                else
         | 
| 63 67 | 
             
                  flash[:alert] = "Cannot update leadset: #{@leadset.errors.messages}"
         | 
| 64 68 | 
             
                end
         | 
| 65 | 
            -
                redirect_to :action => ' | 
| 69 | 
            +
                redirect_to :action => 'show', id: @leadset.id
         | 
| 66 70 | 
             
              end
         | 
| 67 71 |  | 
| 68 72 | 
             
              ##
         | 
| @@ -5,11 +5,97 @@ class IshManager::ProductsController < IshManager::ApplicationController | |
| 5 5 |  | 
| 6 6 | 
             
              # alphabetized : )
         | 
| 7 7 |  | 
| 8 | 
            +
              def create
         | 
| 9 | 
            +
                @product = Wco::Product.new params[:product].permit!
         | 
| 10 | 
            +
                authorize! :create, @product
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                stripe_product = Stripe::Product.create({ name: params[:product][:name] })
         | 
| 13 | 
            +
                puts! stripe_product, 'stripe_product'
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                price_hash = {
         | 
| 16 | 
            +
                  product: stripe_product.id,
         | 
| 17 | 
            +
                  unit_amount: params[:product][:price_cents],
         | 
| 18 | 
            +
                  currency: 'usd',
         | 
| 19 | 
            +
                }
         | 
| 20 | 
            +
                if params[:product][:interval].present?
         | 
| 21 | 
            +
                  price_hash[:recurring] = { interval: params[:product][:interval] }
         | 
| 22 | 
            +
                end
         | 
| 23 | 
            +
                stripe_price = Stripe::Price.create( price_hash )
         | 
| 24 | 
            +
                puts! stripe_price, 'stripe_price'
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                @product.product_id = stripe_product[:id]
         | 
| 27 | 
            +
                @product.price_id   = stripe_price[:id]
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                flag = @product.save
         | 
| 30 | 
            +
                if flag
         | 
| 31 | 
            +
                  flash[:notice] = 'Created the product.'
         | 
| 32 | 
            +
                  redirect_to action: :index
         | 
| 33 | 
            +
                else
         | 
| 34 | 
            +
                  flash[:alert] = "No luck: #{@product.errors.full_messages.join(', ')}."
         | 
| 35 | 
            +
                  render action: :index
         | 
| 36 | 
            +
                end
         | 
| 37 | 
            +
              end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
              def destroy
         | 
| 40 | 
            +
                authorize! :destroy, Wco::Product
         | 
| 41 | 
            +
                # product = Wco::Product.find params[:id]
         | 
| 42 | 
            +
             | 
| 43 | 
            +
                Stripe.api_key = ::STRIPE_SK
         | 
| 44 | 
            +
                Stripe.api_version = '2020-08-27'
         | 
| 45 | 
            +
                flag = Stripe::Product.delete( params[:id] )
         | 
| 46 | 
            +
                # puts! flag, 'flag'
         | 
| 47 | 
            +
                flash[:notice] = flag
         | 
| 48 | 
            +
                # if product.destroy
         | 
| 49 | 
            +
                #   flash[:notice] = 'Success'
         | 
| 50 | 
            +
                # else
         | 
| 51 | 
            +
                #   flash[:alert] = "Cannot destroy product: #{product.errors.fill_messages.join(', ')}."
         | 
| 52 | 
            +
                # end
         | 
| 53 | 
            +
                redirect_to action: :index
         | 
| 54 | 
            +
              end
         | 
| 55 | 
            +
             | 
| 56 | 
            +
              def edit
         | 
| 57 | 
            +
                @product = Wco::Product.find params[:id]
         | 
| 58 | 
            +
                authorize! :edit, @product
         | 
| 59 | 
            +
              end
         | 
| 60 | 
            +
             | 
| 8 61 | 
             
              def index
         | 
| 9 62 | 
             
                authorize! :index, Wco::Product
         | 
| 63 | 
            +
                @stripe_products = {}
         | 
| 64 | 
            +
             | 
| 10 65 | 
             
                Stripe.api_key = ::STRIPE_SK
         | 
| 11 66 | 
             
                Stripe.api_version = '2020-08-27'
         | 
| 12 | 
            -
                @ | 
| 67 | 
            +
                @_stripe_products = Stripe::Product.list().data
         | 
| 68 | 
            +
                @_stripe_prices = Stripe::Price.list().data
         | 
| 69 | 
            +
             | 
| 70 | 
            +
                @_stripe_products.each do |sp|
         | 
| 71 | 
            +
                  @stripe_products[sp[:id]] = sp
         | 
| 72 | 
            +
                  @stripe_products[sp[:id]][:prices] ||= {}
         | 
| 73 | 
            +
                end
         | 
| 74 | 
            +
                @_stripe_prices.each do |price|
         | 
| 75 | 
            +
                  @stripe_products[price[:product]][:prices][price[:id]] = price
         | 
| 76 | 
            +
                end
         | 
| 77 | 
            +
             | 
| 78 | 
            +
                @products = Wco::Product.all
         | 
| 79 | 
            +
             | 
| 80 | 
            +
              end
         | 
| 81 | 
            +
             | 
| 82 | 
            +
              def show
         | 
| 83 | 
            +
                authorize! :show, @product
         | 
| 84 | 
            +
                @product = Wco::Product.find params[:id]
         | 
| 85 | 
            +
              end
         | 
| 86 | 
            +
             | 
| 87 | 
            +
              def update
         | 
| 88 | 
            +
                authorize! :edit, @product
         | 
| 89 | 
            +
                @product = Wco::Product.find params[:id]
         | 
| 90 | 
            +
             | 
| 91 | 
            +
                if @product.update_attributes params[:product].permit!
         | 
| 92 | 
            +
                  flash[:notice] = 'Success.'
         | 
| 93 | 
            +
                  redirect_to action: :show, id: @product.id
         | 
| 94 | 
            +
                else
         | 
| 95 | 
            +
                  flash[:alert] = "No luck: #{@product.errors.full_messages.join(', ')}."
         | 
| 96 | 
            +
                  render action: :edit
         | 
| 97 | 
            +
                end
         | 
| 98 | 
            +
             | 
| 13 99 | 
             
              end
         | 
| 14 100 |  | 
| 15 101 | 
             
            end
         | 
| @@ -8,12 +8,13 @@ class IshManager::SubscriptionsController < IshManager::ApplicationController | |
| 8 8 | 
             
              def index
         | 
| 9 9 | 
             
                authorize! :index, Wco::Subscription
         | 
| 10 10 |  | 
| 11 | 
            -
                 | 
| 12 | 
            -
                 | 
| 13 | 
            -
             | 
| 14 | 
            -
                 | 
| 15 | 
            -
                @ | 
| 16 | 
            -
                @ | 
| 11 | 
            +
                @stripe_customers = Stripe::Customer.list().data
         | 
| 12 | 
            +
                @stripe_subscriptions = Stripe::Subscription.list().data
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                emails = @stripe_customers.map &:email
         | 
| 15 | 
            +
                @leadsets = Leadset.find_by( email: emails )
         | 
| 16 | 
            +
                puts! @leadsets, '@leadsets'
         | 
| 17 | 
            +
             | 
| 17 18 | 
             
              end
         | 
| 18 19 |  | 
| 19 20 | 
             
            end
         | 
| @@ -60,6 +60,9 @@ | |
| 60 60 | 
             
                      = link_to '[+]', new_email_template_path
         | 
| 61 61 | 
             
                    %li
         | 
| 62 62 | 
             
                      = link_to "Companies (#{Leadset.kept.length})", leadsets_path
         | 
| 63 | 
            +
                      .inline-search
         | 
| 64 | 
            +
                        = form_tag leadsets_path, method: :get do
         | 
| 65 | 
            +
                          = text_field_tag :q
         | 
| 63 66 | 
             
                      = link_to '[+]', new_leadset_path
         | 
| 64 67 |  | 
| 65 68 |  | 
| @@ -97,6 +100,12 @@ | |
| 97 100 | 
             
                      = link_to "OActions (#{Office::Action.count})", office_actions_path
         | 
| 98 101 | 
             
                      = link_to '[+]', new_office_action_path
         | 
| 99 102 |  | 
| 103 | 
            +
                  %ul
         | 
| 104 | 
            +
                    %li
         | 
| 105 | 
            +
                      = link_to 'Products & Prices', products_path
         | 
| 106 | 
            +
                    %li
         | 
| 107 | 
            +
                      = link_to 'Customers & Subscriptions', subscriptions_path
         | 
| 108 | 
            +
             | 
| 100 109 | 
             
                .c
         | 
| 101 110 |  | 
| 102 111 | 
             
                %i.fa.fa-compress.collapse-expand#collapseHeaderIro
         | 
| @@ -118,12 +127,3 @@ | |
| 118 127 | 
             
                      = link_to '[+]', new_iro_purse_path
         | 
| 119 128 | 
             
                .c
         | 
| 120 129 |  | 
| 121 | 
            -
                %i.fa.fa-compress.collapse-expand#collapseHeaderWco
         | 
| 122 | 
            -
                  Wco
         | 
| 123 | 
            -
                .a
         | 
| 124 | 
            -
                  %ul
         | 
| 125 | 
            -
                    %li
         | 
| 126 | 
            -
                      = link_to 'Products & Prices', products_path
         | 
| 127 | 
            -
                    %li
         | 
| 128 | 
            -
                      = link_to 'Customers & Subscriptions', subscriptions_path
         | 
| 129 | 
            -
                .c
         | 
| @@ -2,20 +2,28 @@ | |
| 2 2 | 
             
            - url = invoice.persisted? ? invoice_path( invoice.id ) : invoices_path
         | 
| 3 3 |  | 
| 4 4 | 
             
            = form_for invoice, :as => :invoice, :url => url do |f|
         | 
| 5 | 
            +
              = hidden_field_tag 'invoice[leadset_id]', @leadset.id
         | 
| 6 | 
            +
             | 
| 5 7 | 
             
              .input-field
         | 
| 6 8 | 
             
                %label Email
         | 
| 7 | 
            -
                =  | 
| 9 | 
            +
                = @leadset.email
         | 
| 10 | 
            +
                -# - if @leadset.email
         | 
| 11 | 
            +
                -#   = f.text_field :email, value: @leadset.email
         | 
| 12 | 
            +
                -# - elsif @leadset.employees.length == 1
         | 
| 13 | 
            +
                -#   = f.text_field :email, value: @leadset.employees[0].email
         | 
| 14 | 
            +
                -# - else
         | 
| 15 | 
            +
                -#   = f.select :email, options_for_select([[nil,nil]] + @leadset.employees.map { |i| [ i.email, i.email ] } )
         | 
| 8 16 |  | 
| 9 17 | 
             
              .input-field
         | 
| 10 | 
            -
                %label  | 
| 11 | 
            -
                =  | 
| 18 | 
            +
                %label item
         | 
| 19 | 
            +
                = select_tag 'invoice[items][]', options_for_select( @products_list )
         | 
| 12 20 |  | 
| 13 | 
            -
              .input-field
         | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 21 | 
            +
              -# .input-field
         | 
| 22 | 
            +
              -#   %label number
         | 
| 23 | 
            +
              -#   = f.number_field :number
         | 
| 24 | 
            +
             | 
| 25 | 
            +
              -# .input-field
         | 
| 26 | 
            +
              -#   %label Description
         | 
| 27 | 
            +
              -#   = f.text_area :description
         | 
| 16 28 |  | 
| 17 | 
            -
              .input-field
         | 
| 18 | 
            -
                %label Description
         | 
| 19 | 
            -
                = f.text_area :description
         | 
| 20 | 
            -
              
         | 
| 21 29 | 
             
              = f.submit 'Save'
         | 
| @@ -1,30 +1,31 @@ | |
| 1 1 |  | 
| 2 | 
            -
             | 
| 3 | 
            -
            -# invoices / index.haml
         | 
| 4 | 
            -
            -#
         | 
| 2 | 
            +
            .invoices-index.max-width
         | 
| 5 3 |  | 
| 6 | 
            -
            %h3
         | 
| 7 | 
            -
              Invoices
         | 
| 8 | 
            -
              = link_to '[+]', new_invoice_path
         | 
| 9 4 |  | 
| 10 | 
            -
             | 
| 11 | 
            -
             | 
| 12 | 
            -
                =  | 
| 13 | 
            -
            %hr
         | 
| 5 | 
            +
              %h5
         | 
| 6 | 
            +
                Invoices
         | 
| 7 | 
            +
                -# = link_to '[+]', new_invoice_path
         | 
| 14 8 |  | 
| 15 | 
            -
             | 
| 16 | 
            -
               | 
| 17 | 
            -
             | 
| 18 | 
            -
             | 
| 19 | 
            -
             | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
                  %th Created At
         | 
| 23 | 
            -
              %tbody
         | 
| 24 | 
            -
                - @invoices.each do |i|
         | 
| 9 | 
            +
              -# .row
         | 
| 10 | 
            +
              -#   .col.s12.col.m6.col-md-offset-3
         | 
| 11 | 
            +
              -#     = render 'form', :invoice => @new_invoice
         | 
| 12 | 
            +
              %hr
         | 
| 13 | 
            +
             | 
| 14 | 
            +
              %table#dataTable
         | 
| 15 | 
            +
                %thead
         | 
| 25 16 | 
             
                  %tr
         | 
| 26 | 
            -
                    % | 
| 27 | 
            -
                    % | 
| 28 | 
            -
                    % | 
| 29 | 
            -
                    % | 
| 30 | 
            -
                    % | 
| 17 | 
            +
                    %th
         | 
| 18 | 
            +
                    %th Leadset
         | 
| 19 | 
            +
                    %th Number
         | 
| 20 | 
            +
                    %th Amount
         | 
| 21 | 
            +
                    %th Amount Paid
         | 
| 22 | 
            +
                    %th Created At
         | 
| 23 | 
            +
                %tbody
         | 
| 24 | 
            +
                  - @invoices.each do |i|
         | 
| 25 | 
            +
                    %tr
         | 
| 26 | 
            +
                      %td= link_to "View", invoice_path( i )
         | 
| 27 | 
            +
                      %td= i.leadset.name
         | 
| 28 | 
            +
                      %td= i.number
         | 
| 29 | 
            +
                      %td= i.amount
         | 
| 30 | 
            +
                      %td= i.paid_amount
         | 
| 31 | 
            +
                      %td= i.created_at.to_s[0..10]
         | 
| @@ -1,5 +1,7 @@ | |
| 1 1 |  | 
| 2 | 
            -
            . | 
| 3 | 
            -
             | 
| 4 | 
            -
             | 
| 5 | 
            -
                 | 
| 2 | 
            +
            .invoices-new.max-width
         | 
| 3 | 
            +
             | 
| 4 | 
            +
              .row
         | 
| 5 | 
            +
                .col.s12.col.m6.col-md-offset-3
         | 
| 6 | 
            +
                  %h5 New Invoice for `#{link_to @leadset&.name, leadset_path(@leadset)}`:
         | 
| 7 | 
            +
                  = render 'form', invoice: @new_invoice
         | 
| @@ -0,0 +1,19 @@ | |
| 1 | 
            +
             | 
| 2 | 
            +
            - i = @invoice
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            .invoices-show.max-width
         | 
| 5 | 
            +
              %h5 Invoice ##{@invoice.number}
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              %ul
         | 
| 8 | 
            +
                %li email: #{i.email}
         | 
| 9 | 
            +
                %li leadset: #{link_to i.leadset.name, leadset_path( i.leadset) }
         | 
| 10 | 
            +
                %li invoice_id: #{i.invoice_id}
         | 
| 11 | 
            +
                %li items: #{i.items}
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                = @invoice.inspect
         | 
| 14 | 
            +
             | 
| 15 | 
            +
              %hr
         | 
| 16 | 
            +
             | 
| 17 | 
            +
              %pre
         | 
| 18 | 
            +
                = @stripe_invoice.inspect
         | 
| 19 | 
            +
             | 
| @@ -9,7 +9,7 @@ | |
| 9 9 | 
             
              %ul
         | 
| 10 10 | 
             
                %li Name: #{@lead.name}
         | 
| 11 11 | 
             
                %li Email: #{@lead.email}
         | 
| 12 | 
            -
                %li Company: #{ link_to @lead.company.company_url, leadset_path(@lead.company) }
         | 
| 12 | 
            +
                %li Company (leadset): #{ link_to @lead.company.company_url, leadset_path(@lead.company) }
         | 
| 13 13 | 
             
                %li Phone: #{@lead.phone}
         | 
| 14 14 | 
             
                %li Address: #{@lead.address}
         | 
| 15 15 | 
             
                %li Comment: #{raw @lead.comment}
         | 
| @@ -24,10 +24,12 @@ | |
| 24 24 | 
             
                      %li
         | 
| 25 25 | 
             
                        = pp_date( ctx.sent_at ) || 'not sent'
         | 
| 26 26 | 
             
                        = link_to ctx.subject.presence||"No Subj?!", email_context_path(ctx)
         | 
| 27 | 
            +
             | 
| 27 28 | 
             
                .col-md-6.schs
         | 
| 28 29 | 
             
                  %h5
         | 
| 29 30 | 
             
                    Scheduled actions (#{@schs.length})
         | 
| 30 | 
            -
                    = link_to '[+]', '#'
         | 
| 31 | 
            +
                    -# = link_to '[+]', '#'
         | 
| 32 | 
            +
                    \[+]
         | 
| 31 33 | 
             
                  %ul
         | 
| 32 34 | 
             
                    - @schs.each do |sch|
         | 
| 33 35 | 
             
                      %li
         | 
| @@ -36,6 +38,14 @@ | |
| 36 38 | 
             
                        (#{link_to 'proto-action', edit_email_action_path(sch.email_action)})
         | 
| 37 39 | 
             
                        = sch.perform_at
         | 
| 38 40 |  | 
| 41 | 
            +
                  %hr
         | 
| 42 | 
            +
                  %h5
         | 
| 43 | 
            +
                    Invoices (?)
         | 
| 44 | 
            +
                    = link_to '[+]', new_invoice_path({ leadset_id: @lead.m3_leadset_id })
         | 
| 45 | 
            +
                  %ul
         | 
| 46 | 
            +
                    %li None?
         | 
| 47 | 
            +
             | 
| 48 | 
            +
             | 
| 39 49 |  | 
| 40 50 | 
             
              .row
         | 
| 41 51 | 
             
                .col-md-12.msgs
         | 
| @@ -10,11 +10,14 @@ | |
| 10 10 | 
             
                = f.label :name
         | 
| 11 11 | 
             
                = f.text_field :name
         | 
| 12 12 | 
             
              .input-field
         | 
| 13 | 
            -
                = f.label : | 
| 14 | 
            -
                = f.text_field : | 
| 13 | 
            +
                = f.label :email
         | 
| 14 | 
            +
                = f.text_field :email
         | 
| 15 15 | 
             
              -# .input-field
         | 
| 16 | 
            -
              -#   = f.label : | 
| 17 | 
            -
              -#   = f.text_field : | 
| 18 | 
            -
              . | 
| 16 | 
            +
              -#   = f.label :tag
         | 
| 17 | 
            +
              -#   = f.text_field :tag
         | 
| 18 | 
            +
              .input-field
         | 
| 19 | 
            +
                %label Stripe customer_id
         | 
| 20 | 
            +
                = f.text_field :customer_id
         | 
| 21 | 
            +
              .actions
         | 
| 19 22 | 
             
                = f.submit
         | 
| 20 23 |  | 
| @@ -18,6 +18,7 @@ | |
| 18 18 | 
             
              %table.bordered
         | 
| 19 19 | 
             
                %thead
         | 
| 20 20 | 
             
                  %tr
         | 
| 21 | 
            +
                    %th  
         | 
| 21 22 | 
             
                    %th  
         | 
| 22 23 | 
             
                    %th.company-url Company Url
         | 
| 23 24 | 
             
                    %th Tags
         | 
| @@ -28,6 +29,7 @@ | |
| 28 29 | 
             
                  - @leadsets.each_with_index do |leadset, idx1|
         | 
| 29 30 | 
             
                    %tr
         | 
| 30 31 | 
             
                      %td= check_box_tag 'leadset_ids[]', leadset.id, nil, { class: 'i-sel' }
         | 
| 32 | 
            +
                      %td= link_to '[~]', edit_leadset_path( leadset )
         | 
| 31 33 | 
             
                      %td= link_to leadset.company_url, leadset_path(leadset)
         | 
| 32 34 |  | 
| 33 35 | 
             
                      %td.tags
         | 
| @@ -1,5 +1,18 @@ | |
| 1 1 |  | 
| 2 2 | 
             
            .leadsets-show.max-width
         | 
| 3 3 | 
             
              .header
         | 
| 4 | 
            -
                %h2.title | 
| 5 | 
            -
             | 
| 4 | 
            +
                %h2.title
         | 
| 5 | 
            +
                  Leadset `#{@leadset.name}`
         | 
| 6 | 
            +
                  = link_to '[~]', edit_leadset_path( @leadset )
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              %ul
         | 
| 9 | 
            +
                %li <b>Email:</b> #{@leadset.email}
         | 
| 10 | 
            +
                %li <b>Stripe customer_id:</b> #{@leadset.customer_id}
         | 
| 11 | 
            +
                %li <b>company_url</b>: #{@leadset.company_url}
         | 
| 12 | 
            +
                %li
         | 
| 13 | 
            +
                  = link_to invoices_path({ leadset_id: @leadset.id }) do
         | 
| 14 | 
            +
                    Invoices
         | 
| 15 | 
            +
                    (#{@leadset.invoices.length})
         | 
| 16 | 
            +
                  = link_to '[+]', new_invoice_path({ leadset_id: @leadset.id })
         | 
| 17 | 
            +
             | 
| 18 | 
            +
              = render 'ish_manager/leads/index', leads: @employees
         | 
| @@ -0,0 +1,28 @@ | |
| 1 | 
            +
             | 
| 2 | 
            +
            - url = product.new_record? ? products_path : product_path( product )
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            .products--form
         | 
| 5 | 
            +
              = form_for product, as: :product, url: url do |f|
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                .form-field
         | 
| 8 | 
            +
                  %label Name
         | 
| 9 | 
            +
                  = f.text_field :name
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                .form-field
         | 
| 12 | 
            +
                  %label Price in cents
         | 
| 13 | 
            +
                  = f.text_field :price_cents
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                .form-field
         | 
| 16 | 
            +
                  %label Recurring?
         | 
| 17 | 
            +
                  = f.select :interval, options_for_select(Wco::Product::INTERVALS)
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                -# .form-field
         | 
| 20 | 
            +
                -#   %label Stripe product_id
         | 
| 21 | 
            +
                -#   = f.text_field :product_id
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                -# .form-field
         | 
| 24 | 
            +
                -#   %label Stripe price_id
         | 
| 25 | 
            +
                -#   = f.text_field :price_id
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                .actions
         | 
| 28 | 
            +
                  = f.submit 'Submit'
         | 
| @@ -1,7 +1,33 @@ | |
| 1 1 |  | 
| 2 2 | 
             
            .products-index.max-width
         | 
| 3 | 
            -
              %h5 Products
         | 
| 4 3 |  | 
| 4 | 
            +
              %h5
         | 
| 5 | 
            +
                Stripe Products (#{@stripe_products.length}):
         | 
| 6 | 
            +
                -# = link_to '[+]', new_product_path
         | 
| 7 | 
            +
              %ol
         | 
| 8 | 
            +
                - @stripe_products.each do |product_id, product|
         | 
| 9 | 
            +
                  %li
         | 
| 10 | 
            +
                    = link_to '[~]', edit_product_path( product.id )
         | 
| 11 | 
            +
                    .inline-block= button_to '[x]', product_path( product.id ), :method => :delete, :data => { :confirm => 'Are you sure?' }
         | 
| 12 | 
            +
                    %span.gray= product.id
         | 
| 13 | 
            +
                    = product.name
         | 
| 14 | 
            +
                    %ul
         | 
| 15 | 
            +
                      - product[:prices].each do |price_id, price|
         | 
| 16 | 
            +
                        %li
         | 
| 17 | 
            +
                          %span.gray= price.id
         | 
| 18 | 
            +
                          $#{price[:unit_amount].to_f/100}/#{(price[:recurring]||{})[:interval]||'onetime'}
         | 
| 19 | 
            +
                          -# = price.inspect
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              %hr
         | 
| 22 | 
            +
             | 
| 23 | 
            +
              %h5 New Product:
         | 
| 24 | 
            +
              = render 'ish_manager/products/form', product: Wco::Product.new
         | 
| 25 | 
            +
             | 
| 26 | 
            +
              %hr
         | 
| 27 | 
            +
              %h5 Wco::Product's (#{@products.length})
         | 
| 5 28 | 
             
              %ul
         | 
| 6 29 | 
             
                - @products.each do |product|
         | 
| 7 | 
            -
                  %li | 
| 30 | 
            +
                  %li
         | 
| 31 | 
            +
                    = link_to '[~]', edit_product_path( product )
         | 
| 32 | 
            +
                    = product.inspect
         | 
| 33 | 
            +
             | 
| @@ -1,11 +1,11 @@ | |
| 1 1 |  | 
| 2 2 | 
             
            .container.subscriptions-index.padded
         | 
| 3 3 | 
             
              .row
         | 
| 4 | 
            -
                .col-md-6
         | 
| 5 4 |  | 
| 5 | 
            +
                .col-md-6
         | 
| 6 6 | 
             
                  %h5 Stripe Customers
         | 
| 7 7 | 
             
                  %ul
         | 
| 8 | 
            -
                    - @ | 
| 8 | 
            +
                    - @stripe_customers.each do |customer|
         | 
| 9 9 | 
             
                      %li
         | 
| 10 10 | 
             
                        %ul
         | 
| 11 11 | 
             
                          %li <b>Email:</b> #{customer.email}
         | 
| @@ -13,35 +13,18 @@ | |
| 13 13 | 
             
                          %li
         | 
| 14 14 | 
             
                            <b>Subscriptions:</b>
         | 
| 15 15 | 
             
                            %ul
         | 
| 16 | 
            -
                              - @ | 
| 16 | 
            +
                              - @stripe_subscriptions.each do |sub|
         | 
| 17 17 | 
             
                                - if sub.customer == customer.id
         | 
| 18 18 | 
             
                                  %li= sub.items.data[0].plan.product
         | 
| 19 19 |  | 
| 20 20 | 
             
                .col-md-6
         | 
| 21 | 
            -
                  %h5  | 
| 22 | 
            -
                  %ul
         | 
| 23 | 
            -
                    - @users.each do |user|
         | 
| 24 | 
            -
                      %li
         | 
| 25 | 
            -
                        = user.email
         | 
| 26 | 
            -
                        %ul
         | 
| 27 | 
            -
                          %li <b>profile:</b> #{user.profile.email}
         | 
| 28 | 
            -
                          - if user.profile.organization
         | 
| 29 | 
            -
                            %li <b>organization:</b> #{user.profile.organization.name}, customer_id: #{user.profile.organization.customer_id}
         | 
| 30 | 
            -
                            %li <b>subscriptions:</b> #{user.profile.organization.subscriptions.inspect}
         | 
| 31 | 
            -
                  %hr
         | 
| 32 | 
            -
                  %h5 Wco Organizations
         | 
| 21 | 
            +
                  %h5 Stripe Subscriptions
         | 
| 33 22 | 
             
                  %ul
         | 
| 34 | 
            -
                    - @ | 
| 23 | 
            +
                    - @stripe_subscriptions.each do |sub|
         | 
| 35 24 | 
             
                      %li
         | 
| 36 | 
            -
                        = org.name
         | 
| 37 25 | 
             
                        %ul
         | 
| 38 | 
            -
                          %li  | 
| 39 | 
            -
             | 
| 40 | 
            -
             | 
| 41 | 
            -
             | 
| 42 | 
            -
              %hr
         | 
| 43 | 
            -
              %h5 Subscriptions
         | 
| 44 | 
            -
              %ul
         | 
| 45 | 
            -
                - @subscriptions.each do |sub|
         | 
| 46 | 
            -
                  %li= sub.inspect
         | 
| 26 | 
            +
                          %li plan: $#{sub[:plan][:amount].to_f/100}/#{sub[:plan][:interval]}
         | 
| 27 | 
            +
                          %li product: #{sub[:plan][:product]}
         | 
| 28 | 
            +
                          %li customer: #{sub[:customer]}
         | 
| 29 | 
            +
                          -# %li= sub.inspect
         | 
| 47 30 |  | 
    
        data/config/routes.rb
    CHANGED
    
    | @@ -22,9 +22,9 @@ IshManager::Engine.routes.draw do | |
| 22 22 |  | 
| 23 23 | 
             
              get 'image_assets', to: 'image_assets#index', as: :image_assets
         | 
| 24 24 |  | 
| 25 | 
            -
               | 
| 25 | 
            +
              resources :invoices do
         | 
| 26 26 | 
             
              #   resources :payments
         | 
| 27 | 
            -
               | 
| 27 | 
            +
              end
         | 
| 28 28 | 
             
              # resources :orders
         | 
| 29 29 |  | 
| 30 30 | 
             
              get 'iro_positins/roll_prep/:id', to: 'iro_purses#roll_prep', as: :iro_roll_prep
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: ish_manager
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1.8. | 
| 4 | 
            +
              version: 0.1.8.454
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - piousbox
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2023-08- | 
| 11 | 
            +
            date: 2023-08-11 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         | 
| @@ -641,6 +641,7 @@ files: | |
| 641 641 | 
             
            - app/views/ish_manager/invoices/_form.haml
         | 
| 642 642 | 
             
            - app/views/ish_manager/invoices/index.haml
         | 
| 643 643 | 
             
            - app/views/ish_manager/invoices/new.haml
         | 
| 644 | 
            +
            - app/views/ish_manager/invoices/show.haml
         | 
| 644 645 | 
             
            - app/views/ish_manager/iro_mailer/condor_followup_alerb.html.erb
         | 
| 645 646 | 
             
            - app/views/ish_manager/iro_mailer/option_alert.html.erb
         | 
| 646 647 | 
             
            - app/views/ish_manager/iro_mailer/stock_alert.html.erb
         | 
| @@ -729,7 +730,10 @@ files: | |
| 729 730 | 
             
            - app/views/ish_manager/photos/new.haml
         | 
| 730 731 | 
             
            - app/views/ish_manager/photos/show.haml
         | 
| 731 732 | 
             
            - app/views/ish_manager/photos/without_gallery.haml
         | 
| 733 | 
            +
            - app/views/ish_manager/products/_form.haml
         | 
| 734 | 
            +
            - app/views/ish_manager/products/edit.haml
         | 
| 732 735 | 
             
            - app/views/ish_manager/products/index.haml
         | 
| 736 | 
            +
            - app/views/ish_manager/products/show.haml
         | 
| 733 737 | 
             
            - app/views/ish_manager/reports/_form.haml
         | 
| 734 738 | 
             
            - app/views/ish_manager/reports/_index.haml
         | 
| 735 739 | 
             
            - app/views/ish_manager/reports/_show_mini.haml
         |