killbill-invoice-test 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/invoice_test/api.rb +1 -1
- data/pom.xml +1 -1
- data/spec/invoice_test/base_plugin_spec.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 113cfbf53e802d9bfec1b966b9f5cca7dcf6fed7
|
4
|
+
data.tar.gz: 6068c9022e8d5db98475da37ca65b548e8738217
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31e1dbccafc37933ced4ce8b6a8690488e5ed1584c524718122b1aa215e59ff6ab67af8e9d132d2c2c650831a419125ccbf2ed2957640694ee8276c189d0ce78
|
7
|
+
data.tar.gz: aeea59c943a90ceea1f99bbd7c20e381432989e97a08b1aca516b39eb5cc31ed456336f5dc3de58be7d595083e869a1c6c17e394450b8022be045f081c07e76a
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/invoice_test/api.rb
CHANGED
@@ -4,7 +4,7 @@ module InvoiceTest
|
|
4
4
|
|
5
5
|
# This implementation is idempotent, will apply tax on old invoices if needed
|
6
6
|
# and automatically handle adjustments
|
7
|
-
def get_additional_invoice_items(new_invoice, properties, context)
|
7
|
+
def get_additional_invoice_items(new_invoice, dry_run, properties, context)
|
8
8
|
all_invoices = @kb_apis.invoice_user_api.get_invoices_by_account(new_invoice.account_id, context)
|
9
9
|
# Workaround for https://github.com/killbill/killbill/issues/265
|
10
10
|
all_invoices << new_invoice unless all_invoices.find { |inv| inv.id == new_invoice.id }
|
data/pom.xml
CHANGED
@@ -27,7 +27,7 @@
|
|
27
27
|
<groupId>org.kill-bill.billing.plugin.ruby</groupId>
|
28
28
|
<artifactId>invoice-test-plugin</artifactId>
|
29
29
|
<packaging>pom</packaging>
|
30
|
-
<version>0.1.
|
30
|
+
<version>0.1.1</version>
|
31
31
|
<name>invoice-test-plugin</name>
|
32
32
|
<description></description>
|
33
33
|
<scm>
|
@@ -33,7 +33,7 @@ describe InvoiceTest::InvoicePlugin do
|
|
33
33
|
recurring_item = build_invoice_item(150, :RECURRING)
|
34
34
|
invoice = build_invoice([fixed_item, recurring_item])
|
35
35
|
|
36
|
-
new_items = @plugin.get_additional_invoice_items(invoice, @properties, @call_context)
|
36
|
+
new_items = @plugin.get_additional_invoice_items(invoice, false, @properties, @call_context)
|
37
37
|
new_items.size.should == 2
|
38
38
|
|
39
39
|
check_invoice_item(new_items[0], 7, fixed_item)
|
@@ -49,7 +49,7 @@ describe InvoiceTest::InvoicePlugin do
|
|
49
49
|
fixed_adj_item = build_invoice_item(-100, :ITEM_ADJ, fixed_item.id)
|
50
50
|
invoice = build_invoice([fixed_item, recurring_item, recurring_adj_item, fixed_adj_item])
|
51
51
|
|
52
|
-
new_items = @plugin.get_additional_invoice_items(invoice, @properties, @call_context)
|
52
|
+
new_items = @plugin.get_additional_invoice_items(invoice, false, @properties, @call_context)
|
53
53
|
new_items.size.should == 0
|
54
54
|
|
55
55
|
check_idempotency(invoice, new_items)
|
@@ -61,7 +61,7 @@ describe InvoiceTest::InvoicePlugin do
|
|
61
61
|
fixed_adj_item = build_invoice_item(-100, :ITEM_ADJ, fixed_item.id)
|
62
62
|
invoice = build_invoice([fixed_item, recurring_item, fixed_adj_item])
|
63
63
|
|
64
|
-
new_items = @plugin.get_additional_invoice_items(invoice, @properties, @call_context)
|
64
|
+
new_items = @plugin.get_additional_invoice_items(invoice, false, @properties, @call_context)
|
65
65
|
new_items.size.should == 1
|
66
66
|
|
67
67
|
check_invoice_item(new_items[0], 10.5, recurring_item)
|
@@ -75,7 +75,7 @@ describe InvoiceTest::InvoicePlugin do
|
|
75
75
|
fixed_adj_item = build_invoice_item(-20, :ITEM_ADJ, fixed_item.id)
|
76
76
|
invoice = build_invoice([fixed_item, tax_item, fixed_adj_item])
|
77
77
|
|
78
|
-
new_items = @plugin.get_additional_invoice_items(invoice, @properties, @call_context)
|
78
|
+
new_items = @plugin.get_additional_invoice_items(invoice, false, @properties, @call_context)
|
79
79
|
new_items.size.should == 1
|
80
80
|
|
81
81
|
check_invoice_item(new_items[0], -1.4, tax_item, :ITEM_ADJ)
|
@@ -110,7 +110,7 @@ describe InvoiceTest::InvoicePlugin do
|
|
110
110
|
|
111
111
|
def check_idempotency(original_invoice, new_items)
|
112
112
|
invoice = build_invoice(original_invoice.invoice_items + new_items)
|
113
|
-
additional_items = @plugin.get_additional_invoice_items(invoice, @properties, @call_context)
|
113
|
+
additional_items = @plugin.get_additional_invoice_items(invoice, false, @properties, @call_context)
|
114
114
|
additional_items.size.should == 0
|
115
115
|
end
|
116
116
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: killbill-invoice-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kill Bill core team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: killbill
|