payday 1.0.0beta2 → 1.0.0beta3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +35 -9
- data/lib/payday/pdf_renderer.rb +1 -1
- data/lib/payday/version.rb +1 -1
- data/test/invoice_test.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -20,14 +20,14 @@ It's pretty easy to use Payday with the built in objects. We include the Invoice
|
|
20
20
|
Example:
|
21
21
|
|
22
22
|
invoice = Payday::Invoice.new(:invoice_number => 12)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
invoice.line_items << LineItem.new(:price => 20, :quantity => 5, :description => "Pants")
|
24
|
+
invoice.line_items << LineItem.new(:price => 10, :quantity => 3, :description => "Shirts")
|
25
|
+
invoice.line_items << LineItem.new(:price => 5, :quantity => 200, :description => "Hats")
|
26
|
+
invoice.render_pdf_to_file("/path/to_file.pdf")
|
27
27
|
|
28
28
|
Documentation
|
29
29
|
===
|
30
|
-
Documentation for the latest version of Payday is available at [rdoc.info](http://rdoc.info/github/commondream/payday/v1.0.
|
30
|
+
Documentation for the latest version of Payday is available at [rdoc.info](http://rdoc.info/github/commondream/payday/v1.0.0beta2/frames).
|
31
31
|
|
32
32
|
Customizing Your Logo and Company Name
|
33
33
|
===
|
@@ -42,7 +42,7 @@ Example:
|
|
42
42
|
Using Payday with ActiveRecord Objects (or any other objects, for that matter)
|
43
43
|
===
|
44
44
|
|
45
|
-
Payday focuses on two main objects, an invoice and a line item, so to Payday with ActiveRecord you'll want to create your own classes for those objects. We include the Payday::Invoiceable and Payday::LineItemable modules to help out with that.
|
45
|
+
Payday focuses on two main objects, an invoice and a line item, so to use Payday with ActiveRecord you'll want to create your own classes for those objects. We include the Payday::Invoiceable and Payday::LineItemable modules to help out with that.
|
46
46
|
|
47
47
|
Here's the simplest possible implementation of a custom invoice and line item with Payday:
|
48
48
|
|
@@ -102,11 +102,11 @@ In your controller:
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
-
Be sure to restart your server after you edit the mime_types initializer. The
|
105
|
+
Be sure to restart your server after you edit the mime_types initializer. The updated setting won't take effect until you do.
|
106
106
|
|
107
107
|
Examples
|
108
108
|
===
|
109
|
-
Here's an [example PDF Invoice](https://github.com/downloads/commondream/payday/
|
109
|
+
Here's an [example PDF Invoice](https://github.com/downloads/commondream/payday/example.pdf)
|
110
110
|
|
111
111
|
There's also an example Rails application running on Heroku at [http://payday-example.heroku.com](http://payday-example.heroku.com). You can check out the source at [http://github.com/commondream/payday-example](http://github.com/commondream/payday-example).
|
112
112
|
|
@@ -133,4 +133,30 @@ Here's what we're planning on working on with Payday in the near future:
|
|
133
133
|
* Add ability to show skus or product ids on each line item
|
134
134
|
|
135
135
|
* Add page numbers
|
136
|
-
* Ability to render invoice to html for web viewing
|
136
|
+
* Ability to render invoice to html for web viewing
|
137
|
+
|
138
|
+
Acknowledgements
|
139
|
+
===
|
140
|
+
This wouldn't be possible without the amazing [Prawn](http://prawn.majesticseacreature.com) gem and the team behind it.
|
141
|
+
|
142
|
+
License
|
143
|
+
===
|
144
|
+
Copyright (C) 2011 by Alan Johnson
|
145
|
+
|
146
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
147
|
+
of this software and associated documentation files (the "Software"), to deal
|
148
|
+
in the Software without restriction, including without limitation the rights
|
149
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
150
|
+
copies of the Software, and to permit persons to whom the Software is
|
151
|
+
furnished to do so, subject to the following conditions:
|
152
|
+
|
153
|
+
The above copyright notice and this permission notice shall be included in
|
154
|
+
all copies or substantial portions of the Software.
|
155
|
+
|
156
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
157
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
158
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
159
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
160
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
161
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
162
|
+
THE SOFTWARE.
|
data/lib/payday/pdf_renderer.rb
CHANGED
@@ -136,7 +136,7 @@ module Payday
|
|
136
136
|
bold_cell(pdf, "Quantity", :align => :center, :borders => []),
|
137
137
|
bold_cell(pdf, "Amount", :align => :center, :borders => [])]
|
138
138
|
invoice.line_items.each do |line|
|
139
|
-
table_data << [line.description, number_to_currency(line.price), line.quantity.to_s,
|
139
|
+
table_data << [line.description, number_to_currency(line.price), BigDecimal.new(line.quantity.to_s).to_s("F"),
|
140
140
|
number_to_currency(line.amount)]
|
141
141
|
end
|
142
142
|
|
data/lib/payday/version.rb
CHANGED
data/test/invoice_test.rb
CHANGED
@@ -107,7 +107,7 @@ module Payday
|
|
107
107
|
3.times do
|
108
108
|
i.line_items << LineItem.new(:price => 20, :quantity => 5, :description => "Pants")
|
109
109
|
i.line_items << LineItem.new(:price => 10, :quantity => 3, :description => "Shirts")
|
110
|
-
i.line_items << LineItem.new(:price => 5, :quantity => 200, :description => "Hats")
|
110
|
+
i.line_items << LineItem.new(:price => 5, :quantity => 200.0, :description => "Hats")
|
111
111
|
end
|
112
112
|
|
113
113
|
assert_not_nil i.render_pdf
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: payday
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 62196357
|
5
5
|
prerelease: 5
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 1.0.
|
11
|
+
- 3
|
12
|
+
version: 1.0.0beta3
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Alan Johnson
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-03-
|
20
|
+
date: 2011-03-08 00:00:00 -05:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|