ledger_web 1.4.10 → 1.4.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ledger_web/app.rb +2 -2
- data/lib/ledger_web/version.rb +1 -1
- data/test/report_spec.rb +12 -0
- metadata +4 -3
data/lib/ledger_web/app.rb
CHANGED
@@ -39,8 +39,8 @@ module LedgerWeb
|
|
39
39
|
session[:from] = Date.new(today.year - 1, today.month, today.day).strftime('%Y/%m/%d')
|
40
40
|
session[:to] = today.strftime('%Y/%m/%d')
|
41
41
|
else
|
42
|
-
session[:from] = Date.
|
43
|
-
session[:to] = Date.
|
42
|
+
session[:from] = Date.parse(params[:from]).strftime('%Y/%m/%d')
|
43
|
+
session[:to] = Date.parse(params[:to]).strftime('%Y/%m/%d')
|
44
44
|
end
|
45
45
|
|
46
46
|
redirect back
|
data/lib/ledger_web/version.rb
CHANGED
data/test/report_spec.rb
CHANGED
@@ -65,5 +65,17 @@ describe LedgerWeb::Report do
|
|
65
65
|
[Date.new(2012,1,1), 190, 100, -300, 10]
|
66
66
|
])
|
67
67
|
end
|
68
|
+
|
69
|
+
it "should respect other date formats" do
|
70
|
+
LedgerWeb::Report.session = {:from => '2012-01-01', :to => '2012-01-01'}
|
71
|
+
load_fixture('small')
|
72
|
+
|
73
|
+
report = LedgerWeb::Report.from_query("select xtn_month, account, sum(amount)::integer from ledger group by xtn_month, account")
|
74
|
+
report = report.pivot("account", "asc")
|
75
|
+
|
76
|
+
report.rows.should eq([
|
77
|
+
[Date.new(2012,1,1), 190, 100, -300, 10]
|
78
|
+
])
|
79
|
+
end
|
68
80
|
end
|
69
81
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ledger_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pg
|
@@ -323,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
323
323
|
version: '0'
|
324
324
|
requirements: []
|
325
325
|
rubyforge_project:
|
326
|
-
rubygems_version: 1.8.
|
326
|
+
rubygems_version: 1.8.23
|
327
327
|
signing_key:
|
328
328
|
specification_version: 3
|
329
329
|
summary: A web-based, sql-backed front-end for the Ledger command-line accounting
|
@@ -336,3 +336,4 @@ test_files:
|
|
336
336
|
- test/fixtures/small.dat
|
337
337
|
- test/report_spec.rb
|
338
338
|
- test/spec_helper.rb
|
339
|
+
has_rdoc:
|