Class: Spree::Billing::InvoiceController
Instance Method Summary
collapse
#collection_url, #current_vendor, #default_url_options, #edit_object_url, #handle_unauthorized_vendor, #page, #per_page, #required_vendor_user!, #set_locale, #switch_vendor, #vendors
#auth_action, #auth_entry, #auth_user, #authorize!, #authorize?, #authorize_admin, #authorize_role!, #redirect_unauthorized_access
Instance Method Details
#create ⇒ Object
11
12
13
14
|
# File 'app/controllers/spree/billing/invoice_controller.rb', line 11
def create
SpreeCmCommissioner::InvoiceCreator.call(order: @order)
redirect_back fallback_location: admin_path
end
|
#object_name ⇒ Object
31
32
33
|
# File 'app/controllers/spree/billing/invoice_controller.rb', line 31
def object_name
'spree_cm_commissioner_invoice'
end
|
#order ⇒ Object
23
24
25
|
# File 'app/controllers/spree/billing/invoice_controller.rb', line 23
def order
@order = Spree::Order.find_by!(number: params[:order_id])
end
|
#print_invoice_date ⇒ Object
print_invoice_date_billing_order_invoice_path => /spree/orders/:order_id/invoice/print_invoice_date method to record the date when the invoice was printed
18
19
20
|
# File 'app/controllers/spree/billing/invoice_controller.rb', line 18
def print_invoice_date
@order.invoice.update(invoice_issued_date: Time.zone.now)
end
|
#show ⇒ Object
7
8
9
|
# File 'app/controllers/spree/billing/invoice_controller.rb', line 7
def show
@invoice = @order.invoice
end
|