Invoice cancelling

This commit is contained in:
Martin Lensment 2015-04-27 11:15:09 +03:00
parent 56d7f9f2e2
commit a26ce110b2
17 changed files with 113 additions and 25 deletions

View file

@ -12,7 +12,7 @@ class Admin::BankTransactionsController < AdminController
end
def bind
if @bank_transaction.bind_invoice(params[:invoice_id])
if @bank_transaction.bind_invoice(params[:invoice_no])
flash[:notice] = I18n.t('record_created')
redirect_to [:admin, @bank_transaction]
else

View file

@ -28,6 +28,16 @@ class Registrar::InvoicesController < RegistrarController
end
end
def cancel
if @invoice.cancel
flash[:notice] = t('record_updated')
redirect_to([:registrar, @invoice])
else
flash.now[:alert] = t('failed_to_update_record')
render :show
end
end
def download_pdf
# render 'pdf', layout: false