Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
Fixes- #208 Updated invoice_num starting point.
Browse files Browse the repository at this point in the history
add decimal mark
  • Loading branch information
hweng committed Jun 11, 2018
1 parent 8fb9395 commit 37a92db
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion app/controllers/invoices_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def new

def create
@invoice = Invoice.new(invoice_params)

if @invoice.save
redirect_to new_invoice_path, notice: 'A new invoice is created!'
else
Expand Down
2 changes: 2 additions & 0 deletions app/models/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Invoice < ActiveRecord::Base
delegate :country_code, to: :patron, prefix: :patron
# delegate :entity_pending_status, to: :patron, prefix: :patron

START = 50_010

def self.search_by_patron_name(search_term)
blank_term(search_term)

Expand Down
2 changes: 1 addition & 1 deletion app/views/invoices/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
= render 'shared/content_title', title: "Create a New Invoice"
= render 'shared/error_messages', obj: @invoice
%fieldset
= f.hidden_field :invoice_num, value: Invoice.count + 50001
= f.hidden_field :invoice_num, value: Invoice.count + Invoice::START
.required
= f.select :invoice_type, options_for_select(["Electronic PhotoCopy", "Book Loan"], nil)
.required
Expand Down
2 changes: 1 addition & 1 deletion coverage/.last_run.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"result": {
"covered_percent": 84.66
"covered_percent": 84.68
}
}
6 changes: 3 additions & 3 deletions coverage/.resultset.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
null,
1,
5,
null,
5,
2,
null,
Expand Down Expand Up @@ -325,7 +324,6 @@
1,
5,
null,
null,
5,
2,
null,
Expand Down Expand Up @@ -489,6 +487,8 @@
null,
null,
1,
null,
1,
6,
null,
6,
Expand Down Expand Up @@ -1218,6 +1218,6 @@
0
]
},
"timestamp": 1523999961
"timestamp": 1528759463
}
}

0 comments on commit 37a92db

Please sign in to comment.