stockor 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.rubocop.yml +15 -0
- data/Gemfile +3 -1
- data/Gemfile.lock +97 -193
- data/client/skr/Extension.coffee +8 -4
- data/client/skr/api.js +21 -0
- data/client/skr/api.scss +148 -0
- data/client/skr/api/Components/AddressForm.cjsx +47 -0
- data/client/skr/api/Components/Base.coffee +7 -0
- data/client/skr/api/Components/SaleHistory.cjsx +32 -0
- data/client/skr/api/Components/SingleItemCart.cjsx +30 -0
- data/client/skr/api/Models/Base.coffee +10 -0
- data/client/skr/api/Models/Cart.coffee +40 -0
- data/client/skr/api/Models/Sale.coffee +43 -0
- data/client/skr/api/Models/SalesHistory.coffee +17 -0
- data/client/skr/api/Models/Sku.coffee +16 -0
- data/client/skr/api/SingleItemCheckout.cjsx +99 -0
- data/client/skr/api/namespace.js +6 -0
- data/client/skr/api/onReady.coffee +23 -0
- data/client/skr/components/CreditCardForm.cjsx +35 -0
- data/client/skr/components/CustomerFinder.cjsx +0 -3
- data/client/skr/components/InvoiceFinder.cjsx +1 -0
- data/client/skr/components/LatexSnippets.cjsx +65 -0
- data/client/skr/components/LocationChooser.cjsx +5 -1
- data/client/skr/components/PrintButton.cjsx +33 -0
- data/client/skr/components/PrintFormChooser.cjsx +10 -10
- data/client/skr/components/SalesOrderFinder.cjsx +2 -1
- data/client/skr/components/SystemSettings.cjsx +69 -9
- data/client/skr/components/address/index.js +1 -0
- data/client/skr/models/Address.coffee +3 -0
- data/client/skr/models/CreditCard.coffee +49 -0
- data/client/skr/models/CreditCardGateway.coffee +27 -0
- data/client/skr/models/Invoice.coffee +13 -5
- data/client/skr/models/Location.coffee +6 -4
- data/client/skr/models/Payment.coffee +33 -13
- data/client/skr/models/SalesOrder.coffee +7 -3
- data/client/skr/models/SequentialId.coffee +17 -0
- data/client/skr/models/Sku.coffee +1 -1
- data/client/skr/models/TimeEntry.coffee +3 -4
- data/client/skr/models/mixins/PrintSupport.coffee +4 -1
- data/client/skr/models/mixins/SkuLine.coffee +1 -1
- data/client/skr/screens/customer-maint/CustomerMaint.cjsx +1 -2
- data/client/skr/screens/customer-projects/CustomerProjects.cjsx +7 -3
- data/client/skr/screens/customer-projects/index.scss +1 -0
- data/client/skr/screens/fresh-books-import/ApiInfo.cjsx +1 -1
- data/client/skr/screens/gl-accounts/GlAccounts.cjsx +1 -1
- data/client/skr/screens/gl-transactions/GlTransactions.cjsx +1 -1
- data/client/skr/screens/invoice/Invoice.cjsx +9 -17
- data/client/skr/screens/invoice/Payment.cjsx +94 -13
- data/client/skr/screens/invoice/index.scss +32 -0
- data/client/skr/screens/locations/Locations.cjsx +3 -2
- data/client/skr/screens/payment-category/PaymentCategory.cjsx +1 -1
- data/client/skr/screens/payments/Payments.cjsx +5 -4
- data/client/skr/screens/sale-report/SaleReport.cjsx +73 -0
- data/client/skr/screens/sale-report/index.js +5 -0
- data/client/skr/screens/sale-report/index.scss +9 -0
- data/client/skr/screens/sales-order/SalesOrder.cjsx +4 -4
- data/client/skr/screens/sku-maint/SkuMaint.cjsx +5 -0
- data/client/skr/screens/sku-maint/SkuUomList.cjsx +45 -56
- data/client/skr/screens/sku-maint/index.scss +33 -13
- data/client/skr/screens/time-invoicing/TimeInvoicing.cjsx +2 -2
- data/client/skr/screens/time-tracking/EditEntry.cjsx +2 -4
- data/client/skr/screens/time-tracking/TimeTracking.cjsx +1 -1
- data/client/skr/screens/vendor-maint/VendorMaint.cjsx +1 -1
- data/client/skr/vendor/index.js +2438 -0
- data/config/lanes.rb +10 -3
- data/config/routes.rb +9 -7
- data/config/screens.rb +39 -13
- data/db/migrate/20160517032350_create_remove_location_logos.rb +11 -0
- data/db/migrate/20160531014306_create_public_skus.rb +7 -0
- data/db/migrate/20160604195848_create_null_addresses.rb +9 -0
- data/db/migrate/20160605024432_create_sku_associations_views.rb +48 -0
- data/db/migrate/20160608023553_create_invoice_payments.rb +9 -0
- data/db/migrate/20160620010455_add_payments_to_inv_details.rb +54 -0
- data/db/schema.sql +206 -38
- data/db/seed.rb +6 -0
- data/lib/skr.rb +1 -1
- data/lib/skr/access_roles.rb +6 -1
- data/lib/skr/concerns/has_gl_transaction.rb +8 -0
- data/lib/skr/concerns/inv_extensions.rb +11 -0
- data/lib/skr/concerns/is_order_like.rb +3 -3
- data/lib/skr/concerns/visible_id_identifier.rb +3 -8
- data/lib/skr/configuration.rb +2 -0
- data/lib/skr/extension.rb +6 -0
- data/lib/skr/handlers/credit_card_gateway.rb +31 -0
- data/lib/skr/handlers/invoice_from_time_entries.rb +12 -26
- data/lib/skr/handlers/sales.rb +44 -0
- data/lib/skr/handlers/sequential_ids.rb +46 -0
- data/lib/skr/handlers/skus.rb +36 -0
- data/lib/skr/jobs/fresh_books/import.rb +3 -1
- data/lib/skr/merchant_gateway.rb +37 -0
- data/lib/skr/models/address.rb +7 -5
- data/lib/skr/models/bank_account.rb +12 -0
- data/lib/skr/models/business_entity.rb +1 -1
- data/lib/skr/models/gl_transaction.rb +3 -0
- data/lib/skr/models/inv_line.rb +7 -2
- data/lib/skr/models/inventory_adjustment.rb +0 -5
- data/lib/skr/models/invoice.rb +25 -36
- data/lib/skr/models/location.rb +1 -1
- data/lib/skr/models/payment.rb +56 -10
- data/lib/skr/models/po_receipt.rb +0 -8
- data/lib/skr/models/sales_order.rb +7 -2
- data/lib/skr/models/sequential_id.rb +6 -1
- data/lib/skr/models/sku.rb +3 -0
- data/lib/skr/print.rb +1 -0
- data/lib/skr/print/context.rb +19 -0
- data/lib/skr/print/form.rb +7 -1
- data/lib/skr/version.rb +1 -1
- data/npm-build/package.json +26 -0
- data/npm-build/vendor.js +10 -0
- data/npm-build/webpack.config.js +25 -0
- data/spec/fixtures/skr/bank_account.yml +9 -0
- data/spec/fixtures/skr/customer.yml +10 -0
- data/spec/fixtures/skr/inv_line.yml +12 -0
- data/spec/fixtures/skr/invoice.yml +17 -0
- data/spec/fixtures/skr/payment_category.yml +6 -0
- data/spec/fixtures/skr/sales_order.yml +1 -1
- data/spec/fixtures/skr/sku.yml +10 -0
- data/spec/fixtures/skr/sku_loc.yml +4 -0
- data/spec/fixtures/skr/uom.yml +6 -0
- data/spec/server/handlers/invoice_from_time_entries_spec.rb +13 -6
- data/spec/server/handlers/sequential_ids_spec.rb +22 -0
- data/spec/server/models/invoice_spec.rb +36 -0
- data/spec/server/models/payment_spec.rb +50 -22
- data/spec/server/models/sales_order_spec.rb +12 -0
- data/spec/server/print/form_spec.rb +20 -4
- data/spec/skr/api/SingleItemCheckoutSpec.cjsx +10 -0
- data/spec/skr/screens/sale-report/SaleReportSpec.coffee +5 -0
- data/stockor.gemspec +5 -4
- data/templates/print/layout.tex.erb +1 -1
- data/templates/print/packages/INSTALL +7 -0
- data/templates/print/packages/qrcode.sty +3051 -0
- data/templates/print/packages/svgnam.def +186 -0
- data/templates/print/packages/x11nam.def +352 -0
- data/templates/print/packages/xcolor.pro +58 -0
- data/templates/print/packages/xcolor.sty +1460 -0
- data/templates/print/types/invoice/default.tex.erb +2 -0
- data/templates/print/types/invoice/labor.tex.erb +2 -1
- data/templates/print/types/invoice/ticket.tex.erb +41 -0
- data/templates/print/types/payment/default.tex.erb +13 -12
- metadata +78 -12
data/npm-build/vendor.js
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
var previousLanes = global.Lanes;
|
2
|
+
|
3
|
+
var Lanes = ( global.Lanes || (global.Lanes = {}) );
|
4
|
+
|
5
|
+
Lanes.Skr = ( Lanes.Skr || {} );
|
6
|
+
|
7
|
+
Lanes.Skr.Vendor = ( Lanes.Skr.Vendor || {} );
|
8
|
+
|
9
|
+
Lanes.Skr.Vendor.Card = require('card/src/coffee/card');
|
10
|
+
Lanes.Skr.Vendor.Payment = require('payment/src/payment');
|
@@ -0,0 +1,25 @@
|
|
1
|
+
var fs = require('fs');
|
2
|
+
var path = require('path');
|
3
|
+
var webpack = require("webpack");
|
4
|
+
|
5
|
+
var ENTRIES = {
|
6
|
+
index: "./vendor.js"
|
7
|
+
}
|
8
|
+
|
9
|
+
module.exports = {
|
10
|
+
cache: false,
|
11
|
+
entry: ENTRIES,
|
12
|
+
output: {
|
13
|
+
path: path.join(__dirname, "../client/skr/vendor"),
|
14
|
+
filename: "[name].js"
|
15
|
+
},
|
16
|
+
module: {
|
17
|
+
loaders: [
|
18
|
+
{ test: /\.scss$/, loader: 'style!css!sass?includePaths[]=./node_modules' },
|
19
|
+
{ test: /\.coffee$/, loader: "coffee" }
|
20
|
+
]
|
21
|
+
},
|
22
|
+
resolve: {
|
23
|
+
extensions: ["", ".scss", ".coffee", ".js"]
|
24
|
+
}
|
25
|
+
};
|
@@ -1,3 +1,12 @@
|
|
1
|
+
default:
|
2
|
+
code: DEFAULT
|
3
|
+
name: The default bank account
|
4
|
+
description: My default account
|
5
|
+
routing_number: 12345
|
6
|
+
account_number: 123456789
|
7
|
+
address: bigcobank
|
8
|
+
gl_account: bank_checking
|
9
|
+
|
1
10
|
checking:
|
2
11
|
code: CHECKING
|
3
12
|
name: A test checking account
|
@@ -33,3 +33,13 @@ sw:
|
|
33
33
|
gl_receivables_account: ar
|
34
34
|
billing_address: sw_billing
|
35
35
|
shipping_address: sw_shipping
|
36
|
+
|
37
|
+
|
38
|
+
anon1:
|
39
|
+
code: ANON
|
40
|
+
name: Anonymous
|
41
|
+
terms: cash
|
42
|
+
notes: Walk-In Customer
|
43
|
+
gl_receivables_account: ar
|
44
|
+
billing_address: sw_billing
|
45
|
+
shipping_address: sw_shipping
|
@@ -35,3 +35,15 @@ tiny_time:
|
|
35
35
|
uom_code: HOUR
|
36
36
|
uom_size: 1
|
37
37
|
position: 3
|
38
|
+
|
39
|
+
event_line:
|
40
|
+
invoice: event
|
41
|
+
time_entry: siteprep
|
42
|
+
sku_loc: event_def
|
43
|
+
qty: 2
|
44
|
+
price: 49.98
|
45
|
+
sku_code: EVENT
|
46
|
+
description: An Awesome Event
|
47
|
+
uom_code: TCKT
|
48
|
+
uom_size: 1
|
49
|
+
position: 1
|
@@ -11,3 +11,20 @@ tiny:
|
|
11
11
|
form: labor
|
12
12
|
invoice_date: <%= 1.days.ago %>
|
13
13
|
state: 0
|
14
|
+
|
15
|
+
|
16
|
+
event:
|
17
|
+
visible_id: 13024
|
18
|
+
customer: anon1
|
19
|
+
location: default
|
20
|
+
billing_address: hg_billing
|
21
|
+
shipping_address: sw_shipping
|
22
|
+
terms: cash
|
23
|
+
form: ticket
|
24
|
+
invoice_date: <%= 1.days.ago %>
|
25
|
+
state: 0
|
26
|
+
options:
|
27
|
+
event_info: |
|
28
|
+
Show at 7:30 pm (doors open at 6:30pm)
|
29
|
+
|
30
|
+
Dress code: Business Casual
|
data/spec/fixtures/skr/sku.yml
CHANGED
@@ -77,3 +77,13 @@ ship:
|
|
77
77
|
default_uom_code: EA
|
78
78
|
gl_asset_account: ship
|
79
79
|
can_backorder: false
|
80
|
+
|
81
|
+
event:
|
82
|
+
code: EVENT
|
83
|
+
description: An Awesome Event
|
84
|
+
default_vendor: rump
|
85
|
+
gl_asset_account: inventory
|
86
|
+
default_uom_code: TCKT
|
87
|
+
is_other_charge: false
|
88
|
+
does_track_inventory: no
|
89
|
+
can_backorder: no
|
data/spec/fixtures/skr/uom.yml
CHANGED
@@ -4,19 +4,26 @@ class InvoiceFromTimeEntriesSpec < Skr::TestCase
|
|
4
4
|
|
5
5
|
subject { Skr::Handlers::InvoiceFromTimeEntries }
|
6
6
|
let (:project) { skr_customer_project(:goatpens) }
|
7
|
-
let (:
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
let (:data) { {
|
8
|
+
'customer_project_id' => project.id,
|
9
|
+
'time_entry_ids' => project.time_entries.map(&:id),
|
10
|
+
'po_num' => 'Testing Only!'
|
11
|
+
}
|
11
12
|
}
|
13
|
+
let (:authentication) { Lanes::API::AuthenticationProvider.new({}) }
|
14
|
+
let (:controller) {
|
15
|
+
subject.new( Invoice, authentication, {}, data )
|
16
|
+
}
|
17
|
+
let (:invoice_data) { controller.perform_creation[:data]['invoice'] }
|
18
|
+
let (:invoice) { Invoice.find(invoice_data['id']) }
|
12
19
|
let (:time_entry) { skr_time_entry(:siteprep) }
|
13
20
|
let (:line) { invoice.lines.first }
|
14
21
|
|
15
22
|
it "raises exception if ids are not found" do
|
16
23
|
assert_raises(ActiveRecord::RecordNotFound) {
|
17
24
|
subject.new(
|
18
|
-
|
19
|
-
).
|
25
|
+
Invoice, authentication, {}, data.merge('time_entry_ids' => [12345])
|
26
|
+
).perform_creation
|
20
27
|
}
|
21
28
|
end
|
22
29
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
class SequentialIdsSpec < Skr::TestCase
|
4
|
+
|
5
|
+
subject { Skr::Handlers::SequentialIds }
|
6
|
+
|
7
|
+
let (:authentication) { Lanes::API::AuthenticationProvider.new({}) }
|
8
|
+
let (:controller) { subject.new( Skr::Invoice, authentication, {}, {} ) }
|
9
|
+
let (:sids) { controller.perform_retrieval[:data]['ids'] }
|
10
|
+
|
11
|
+
it "retrieves the list of sequential ids" do
|
12
|
+
assert_kind_of Array, sids
|
13
|
+
|
14
|
+
sids[0...sids.length-2].each do | si |
|
15
|
+
assert_includes Skr::Handlers::SequentialIds::TYPES, si['id']
|
16
|
+
assert_kind_of Fixnum, si['count']
|
17
|
+
end
|
18
|
+
bank = skr_bank_account(:checking)
|
19
|
+
assert sids.last['id'], Payment::SEQUENTIAL_ID_PREFIX + bank.id.to_s
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -36,4 +36,40 @@ class InvoiceSpec < Skr::TestCase
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
it "applies payments" do
|
40
|
+
inv = skr_invoice(:tiny)
|
41
|
+
amount = '10.1'
|
42
|
+
|
43
|
+
ar_account = inv.customer.gl_receivables_account
|
44
|
+
bank_account = skr_bank_account(:checking)
|
45
|
+
|
46
|
+
assert_difference ->{ bank_account.gl_account.trial_balance }, BigDecimal.new(amount) do
|
47
|
+
assert_difference ->{ ar_account.trial_balance }, BigDecimal.new(amount) * -1 do
|
48
|
+
assert_difference ->{ GlTransaction.count }, 1 do
|
49
|
+
assert inv.payments.create!(
|
50
|
+
amount: 10.10, bank_account: bank_account
|
51
|
+
)
|
52
|
+
inv.mark_partialy_paid!
|
53
|
+
assert inv.reload.partialy_paid?
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'queries using view helper scopes' do
|
60
|
+
tiny = skr_invoice(:tiny)
|
61
|
+
tiny.payments.create!( amount: 10.10, bank_account: skr_bank_account(:checking) )
|
62
|
+
assert_equal Skr::Invoice.with_sku_id(skr_sku(:yarn).id).pluck(:id), [tiny.id]
|
63
|
+
attrs = Skr::Invoice.with_details.where(id: tiny.id).first.attributes
|
64
|
+
assert_equal( attrs.slice('customer_code', 'customer_name', 'bill_addr_name',
|
65
|
+
'invoice_total', 'sales_order_visible_id', 'invoice_total', 'amount_paid'), {
|
66
|
+
"customer_code" => "GOAT",
|
67
|
+
"customer_name" => "Billy Goat Gruff",
|
68
|
+
"bill_addr_name" => "Hansel and Gretel",
|
69
|
+
"sales_order_visible_id" => '1021',
|
70
|
+
'amount_paid' => BigDecimal.new('10.1'),
|
71
|
+
"invoice_total" => BigDecimal.new('285.10')
|
72
|
+
})
|
73
|
+
end
|
74
|
+
|
39
75
|
end
|
@@ -2,39 +2,67 @@ require_relative '../spec_helper'
|
|
2
2
|
|
3
3
|
class PaymentSpec < Skr::TestCase
|
4
4
|
|
5
|
+
let (:amount) { BigDecimal.new('42.42') }
|
6
|
+
let (:vendor) { skr_vendor(:cinderella) }
|
7
|
+
let (:category) { skr_payment_category(:labor) }
|
8
|
+
let (:bank_account) { skr_bank_account(:checking) }
|
9
|
+
let (:invoice) { skr_invoice(:tiny) }
|
10
|
+
|
5
11
|
it "can be created" do
|
6
12
|
assert Payment.create(
|
7
|
-
amount:
|
8
|
-
|
9
|
-
category: skr_payment_category(:labor),
|
10
|
-
bank_account: skr_bank_account(:checking),
|
13
|
+
amount: amount, name: 'Test One, Two, Three',
|
14
|
+
category: category, bank_account: bank_account,
|
11
15
|
notes: 'A test payment'
|
12
16
|
), "failed to create payment"
|
13
17
|
end
|
14
18
|
|
15
|
-
it "posts to
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
assert_difference ->{
|
24
|
-
bank_account.gl_account.trial_balance
|
25
|
-
}, BigDecimal.new('-42.42') do
|
26
|
-
|
27
|
-
Payment.create(
|
28
|
-
amount: 42.42,
|
29
|
-
name: 'Test One, Two, Three',
|
30
|
-
category: category,
|
31
|
-
bank_account: bank_account,
|
32
|
-
notes: 'A test payment'
|
19
|
+
it "posts to gl for categories" do
|
20
|
+
assert_difference -> { category.gl_account.trial_balance }, amount do
|
21
|
+
assert_difference -> { bank_account.gl_account.trial_balance }, amount * -1 do
|
22
|
+
assert Payment.create(
|
23
|
+
amount: amount, category: category,
|
24
|
+
bank_account: bank_account,
|
25
|
+
name: 'Test One, Two, Three'
|
33
26
|
)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
it "posts to gl for vendors" do
|
32
|
+
assert_difference -> { vendor.gl_payables_account.trial_balance }, amount do
|
33
|
+
assert_difference -> { bank_account.gl_account.trial_balance }, amount * -1 do
|
34
|
+
assert Payment.create( amount: amount, vendor: vendor, bank_account: bank_account )
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
34
38
|
|
39
|
+
it 'posts to gl for invoices' do
|
40
|
+
assert_difference -> {
|
41
|
+
invoice.customer.gl_receivables_account.trial_balance
|
42
|
+
}, amount * -1 do
|
43
|
+
assert_difference ->{ bank_account.gl_account.trial_balance }, amount do
|
44
|
+
pymnt = Payment.create(
|
45
|
+
amount: amount, invoice: invoice, bank_account: bank_account
|
46
|
+
)
|
47
|
+
assert_equal pymnt.name, invoice.billing_address.name
|
35
48
|
end
|
36
49
|
end
|
50
|
+
end
|
37
51
|
|
52
|
+
it 'charges when saving if card and invoice are present' do
|
53
|
+
bank_account = skr_bank_account(:checking)
|
54
|
+
payment = Payment.new(
|
55
|
+
amount: amount, invoice: invoice, bank_account: bank_account
|
56
|
+
)
|
57
|
+
payment.credit_card = {
|
58
|
+
'name' => 'Bob Tester',
|
59
|
+
'number' => '4111111111111111',
|
60
|
+
'month' => '8',
|
61
|
+
'year' => Time.now.year + 1,
|
62
|
+
'verification_value' => '000'
|
63
|
+
}
|
64
|
+
assert payment.save
|
65
|
+
assert_match(/\d+/, payment.metadata["authorization"])
|
38
66
|
end
|
39
67
|
|
40
68
|
end
|
@@ -19,4 +19,16 @@ class SalesOrderSpec < Skr::TestCase
|
|
19
19
|
assert model.save
|
20
20
|
end
|
21
21
|
|
22
|
+
it 'queries using view helper scopes' do
|
23
|
+
tiny = skr_sales_order(:tiny)
|
24
|
+
assert_equal Skr::SalesOrder.with_sku_id(skr_sku(:yarn).id).pluck(:id), [tiny.id]
|
25
|
+
attrs = Skr::SalesOrder.with_details.where(id: tiny.id).first.attributes
|
26
|
+
assert_equal( attrs.slice('customer_code', 'customer_name', 'bill_addr_name', 'invoice_total', 'order_total'), {
|
27
|
+
"customer_code" => "GOAT",
|
28
|
+
"customer_name" => "Billy Goat Gruff",
|
29
|
+
"bill_addr_name" => "Hansel and Gretel",
|
30
|
+
"order_total" => BigDecimal.new('115.48')
|
31
|
+
})
|
32
|
+
end
|
33
|
+
|
22
34
|
end
|
@@ -4,9 +4,15 @@ class PrintSpec < Skr::TestCase
|
|
4
4
|
|
5
5
|
# for debugging add a generate(pdf) to one of the specs
|
6
6
|
def generate(pdf)
|
7
|
-
Lanes::SystemSettings.config
|
8
|
-
|
9
|
-
|
7
|
+
config = Lanes::SystemSettings.config
|
8
|
+
unless config.logo
|
9
|
+
logo = config.build_logo
|
10
|
+
logo.store_uploaded_file(
|
11
|
+
filename: Pathname.new(__FILE__).dirname.join('../../fixtures/stockor.png')
|
12
|
+
)
|
13
|
+
logo.save!
|
14
|
+
config.save!
|
15
|
+
end
|
10
16
|
begin
|
11
17
|
File.open('/tmp/skr-test.tex', 'w'){|f| f.write pdf.as_latex }
|
12
18
|
File.open('/tmp/skr-test.pdf', 'w'){|f| f.write pdf.as_pdf.read }
|
@@ -18,7 +24,10 @@ class PrintSpec < Skr::TestCase
|
|
18
24
|
|
19
25
|
it "can generate default invoice" do
|
20
26
|
inv = skr_invoice(:tiny)
|
21
|
-
inv.
|
27
|
+
inv.payments.create!(
|
28
|
+
amount: inv.total - 2.22,
|
29
|
+
name: 'test', bank_account: skr_bank_account(:checking)
|
30
|
+
)
|
22
31
|
assert inv.update_attributes form: 'default'
|
23
32
|
pdf = Skr::Print::Form.new('invoice', inv.hash_code)
|
24
33
|
assert pdf.as_latex
|
@@ -43,5 +52,12 @@ class PrintSpec < Skr::TestCase
|
|
43
52
|
assert pdf.as_latex
|
44
53
|
end
|
45
54
|
|
55
|
+
it 'can generate tickets' do
|
56
|
+
inv = skr_invoice(:event)
|
57
|
+
assert inv.update_attributes form: 'ticket'
|
58
|
+
pdf = Skr::Print::Form.new('invoice', inv.hash_code)
|
59
|
+
assert pdf.as_latex
|
60
|
+
end
|
61
|
+
|
46
62
|
|
47
63
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
##=require 'skr/api'
|
2
|
+
|
3
|
+
describe "Skr.Api.SingleItemCheckout", ->
|
4
|
+
|
5
|
+
# beforeEach ->
|
6
|
+
# Lanes.Test.ModelSaver.setUser('admin')
|
7
|
+
|
8
|
+
|
9
|
+
it "sends failure messages when code isn't set", (done) ->
|
10
|
+
checkout = LT.renderComponent(Skr.Api.SingleItemCheckout, props: skuCode: 'HAT')
|
data/stockor.gemspec
CHANGED
@@ -23,11 +23,12 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
spec.required_ruby_version = '>= 2.1'
|
25
25
|
|
26
|
-
spec.add_dependency 'aasm', '~>4.1'
|
27
|
-
spec.add_dependency 'erb_latex', '0
|
28
|
-
spec.add_dependency 'lanes', '~> 0.
|
26
|
+
spec.add_dependency 'aasm', '~>4.10.1'
|
27
|
+
spec.add_dependency 'erb_latex', '1.0'
|
28
|
+
spec.add_dependency 'lanes', '~> 0.5.5'
|
29
29
|
spec.add_dependency 'numbers_in_words', '~> 0.4.0'
|
30
|
-
spec.add_dependency 'ruby-freshbooks'
|
30
|
+
spec.add_dependency 'ruby-freshbooks', '~> 0.4'
|
31
|
+
spec.add_dependency 'activemerchant', '~> 1.59'
|
31
32
|
|
32
33
|
spec.add_development_dependency "bundler", "~> 1.5"
|
33
34
|
spec.add_development_dependency "rake"
|