spree_invoice 1.1.11 → 1.1.12

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.
data/README.md CHANGED
@@ -8,7 +8,7 @@ Basic Installation
8
8
 
9
9
  1. Add the following to your Gemfile
10
10
  <pre>
11
- gem 'spree_invoice', '~> 1.1.11'
11
+ gem 'spree_invoice', '~> 1.1.12'
12
12
  </pre>
13
13
  2. Run `bundle install`
14
14
  3. To copy and apply migrations run:
@@ -1,9 +1,9 @@
1
1
  module Spree
2
2
  class InvoiceController < BaseController
3
-
3
+
4
4
  def show
5
- order_id = params[:order_id].to_i
6
- @order = Order.find_by_id(order_id)
5
+ @order = Order.find_by_id(params[:order_id])
6
+ @order.create_invoice(:user => @order.user)
7
7
  @address = @order.bill_address
8
8
  @invoice_print = current_user.has_role?(:admin) ? Spree::Invoice.find_or_create_by_order_id({:order_id => order_id, :user_id => @order ? @order.user_id : nil}) : current_user.invoices.find_or_create_by_order_id(order_id)
9
9
  if @invoice_print
@@ -1,11 +1,11 @@
1
1
  Spree::Order.class_eval do
2
2
  has_one :invoice, :dependent => :destroy
3
- after_update :add_invoice
3
+ #after_update :add_invoice
4
4
 
5
5
  private
6
- def add_invoice
6
+ #def add_invoice
7
7
  # Only create an invoice if the order is completed!
8
8
  # And only create it if there is no invoice yet.
9
- self.create_invoice(:user => user) if self.completed? && self.invoice.blank?
10
- end
9
+ # self.create_invoice(:user => user) if self.completed? && self.invoice.blank?
10
+ #end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module SpreeInvoice
2
- VERSION = "1.1.11"
2
+ VERSION = "1.1.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_invoice
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11
4
+ version: 1.1.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-11-06 00:00:00.000000000 Z
14
+ date: 2012-12-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: spree_core