beanie 0.1.4 → 0.2.0
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 +5 -5
- data/Gemfile +4 -0
- data/README.md +79 -16
- data/Rakefile +8 -1
- data/beanie.gemspec +44 -25
- data/docs/BankAccount.md +24 -0
- data/docs/BankAccountApi.md +154 -0
- data/docs/BankAccountInput.md +24 -0
- data/docs/ErrorModel.md +9 -0
- data/git_push.sh +55 -0
- data/lib/beanie/api/bank_account_api.rb +183 -0
- data/lib/beanie/api_client.rb +388 -0
- data/lib/beanie/api_error.rb +38 -0
- data/lib/beanie/configuration.rb +202 -0
- data/lib/beanie/models/bank_account.rb +358 -0
- data/lib/beanie/models/bank_account_input.rb +357 -0
- data/lib/beanie/models/error_model.rb +202 -0
- data/lib/beanie/version.rb +13 -30
- data/lib/beanie.rb +32 -115
- data/spec/api/bank_account_api_spec.rb +71 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/bank_account_input_spec.rb +137 -0
- data/spec/models/bank_account_spec.rb +137 -0
- data/spec/models/error_model_spec.rb +47 -0
- data/spec/spec_helper.rb +111 -0
- metadata +174 -71
- data/.gitignore +0 -17
- data/VERSION +0 -1
- data/lib/beanie/api.rb +0 -182
- data/lib/beanie/bank_account.rb +0 -44
- data/lib/beanie/bank_statement.rb +0 -45
- data/lib/beanie/bank_statement_data.rb +0 -51
- data/lib/beanie/beanie_alert.rb +0 -66
- data/lib/beanie/bill_of_material.rb +0 -44
- data/lib/beanie/billable.rb +0 -46
- data/lib/beanie/bom_item.rb +0 -44
- data/lib/beanie/company.rb +0 -66
- data/lib/beanie/company_member.rb +0 -43
- data/lib/beanie/config_type.rb +0 -62
- data/lib/beanie/config_value.rb +0 -42
- data/lib/beanie/customer.rb +0 -51
- data/lib/beanie/customer_address.rb +0 -63
- data/lib/beanie/customer_note.rb +0 -42
- data/lib/beanie/document.rb +0 -71
- data/lib/beanie/fixed_asset.rb +0 -45
- data/lib/beanie/journal.rb +0 -44
- data/lib/beanie/journal_item.rb +0 -44
- data/lib/beanie/nominal_account.rb +0 -73
- data/lib/beanie/nominal_account_category.rb +0 -49
- data/lib/beanie/product.rb +0 -52
- data/lib/beanie/product_category.rb +0 -43
- data/lib/beanie/product_price.rb +0 -44
- data/lib/beanie/production_order.rb +0 -76
- data/lib/beanie/purchase_invoice.rb +0 -55
- data/lib/beanie/purchase_order.rb +0 -46
- data/lib/beanie/purchase_order_item.rb +0 -60
- data/lib/beanie/sales_invoice.rb +0 -83
- data/lib/beanie/sales_invoice_item.rb +0 -50
- data/lib/beanie/sales_order.rb +0 -74
- data/lib/beanie/sales_order_item.rb +0 -126
- data/lib/beanie/stock_adjustment.rb +0 -70
- data/lib/beanie/stock_category.rb +0 -44
- data/lib/beanie/stock_item.rb +0 -58
- data/lib/beanie/stock_location.rb +0 -42
- data/lib/beanie/stock_supplier.rb +0 -48
- data/lib/beanie/supplier.rb +0 -48
- data/lib/beanie/supplier_address.rb +0 -53
- data/lib/beanie/supplier_note.rb +0 -42
- data/lib/beanie/tax_registration.rb +0 -59
- data/lib/beanie/vat_record.rb +0 -66
- data/lib/beanie/vat_return.rb +0 -60
- data/lib/beanie/work_centre.rb +0 -99
- data/lib/beanie/work_centre_group.rb +0 -50
@@ -1,60 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2017-2018, AltoYield Limited. All rights reserved.
|
3
|
-
#
|
4
|
-
# This is free software; you can redistribute it and/or modify it
|
5
|
-
# under the terms of the GNU General Public License as published by
|
6
|
-
# the Free Software Foundation; either version 2, or (at your option)
|
7
|
-
# any later version.
|
8
|
-
#
|
9
|
-
# It is distributed in the hope that it will be useful, but WITHOUT
|
10
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12
|
-
# for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this product; see the file COPYING. If not, write to the Free
|
16
|
-
# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY ALTOYIELD LIMITED "AS IS" AND ANY EXPRESS
|
19
|
-
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
21
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL ALTOYIELD LIMITED BE LIABLE FOR
|
22
|
-
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
23
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
24
|
-
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
25
|
-
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
26
|
-
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
27
|
-
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
#
|
30
|
-
module Beanie
|
31
|
-
class PurchaseOrderItem < Api
|
32
|
-
attr_accessor :id, :description, :discount, :quantity, :state, :unit_cost
|
33
|
-
attr_accessor :purchase_order_id, :sales_tax
|
34
|
-
|
35
|
-
STATE_NEW = 0
|
36
|
-
STATE_PARTIAL = 1
|
37
|
-
STATE_BACKORDER = 2
|
38
|
-
STATE_COMPLETE = 3
|
39
|
-
|
40
|
-
STATE_NAMES = [
|
41
|
-
["Awaiting Receipt", STATE_NEW],
|
42
|
-
["Partial Delivery", STATE_PARTIAL],
|
43
|
-
["Back-Order", STATE_BACKORDER],
|
44
|
-
["Item Complete", STATE_COMPLETE]
|
45
|
-
].freeze
|
46
|
-
|
47
|
-
#
|
48
|
-
# Initialize instance variables
|
49
|
-
def initialize
|
50
|
-
@id = nil
|
51
|
-
@description = nil
|
52
|
-
@discount = nil
|
53
|
-
@quantity = nil
|
54
|
-
@state = nil
|
55
|
-
@unit_cost = nil
|
56
|
-
@purchase_order_id = nil
|
57
|
-
@sales_tax = nil
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
data/lib/beanie/sales_invoice.rb
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2017-2018, AltoYield Limited. All rights reserved.
|
3
|
-
#
|
4
|
-
# This is free software; you can redistribute it and/or modify it
|
5
|
-
# under the terms of the GNU General Public License as published by
|
6
|
-
# the Free Software Foundation; either version 2, or (at your option)
|
7
|
-
# any later version.
|
8
|
-
#
|
9
|
-
# It is distributed in the hope that it will be useful, but WITHOUT
|
10
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12
|
-
# for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this product; see the file COPYING. If not, write to the Free
|
16
|
-
# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY ALTOYIELD LIMITED "AS IS" AND ANY EXPRESS
|
19
|
-
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
21
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL ALTOYIELD LIMITED BE LIABLE FOR
|
22
|
-
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
23
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
24
|
-
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
25
|
-
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
26
|
-
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
27
|
-
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
#
|
30
|
-
module Beanie
|
31
|
-
class SalesInvoice < Api
|
32
|
-
attr_accessor :id, :date, :due_date, :number, :is_credit_note, :local_gross, :shipping, :sub_total, :tax
|
33
|
-
attr_accessor :tax_point, :sales_order_id, :original_invoice, :state
|
34
|
-
|
35
|
-
STATE_NEW = 0
|
36
|
-
STATE_POSTED = 1
|
37
|
-
STATE_SENT = 2
|
38
|
-
STATE_PAID = 3
|
39
|
-
STATE_CANCELLED = 4
|
40
|
-
STATE_OVERDUE1 = 5
|
41
|
-
STATE_OVERDUE2 = 6
|
42
|
-
STATE_OVERDUE3 = 7
|
43
|
-
STATE_OVERDUE4 = 8
|
44
|
-
STATE_OVERDUE5 = 9
|
45
|
-
|
46
|
-
STATE_NAMES = [
|
47
|
-
["New (Unposted)", STATE_NEW],
|
48
|
-
["Posted to Journal", STATE_POSTED],
|
49
|
-
["Sent to Customer", STATE_SENT],
|
50
|
-
["Paid", STATE_PAID],
|
51
|
-
["Cancelled", STATE_CANCELLED],
|
52
|
-
["Overdue (Past 30 days)", STATE_OVERDUE1],
|
53
|
-
["Overdue (Past 45 days)", STATE_OVERDUE2],
|
54
|
-
["Overdue (Over 60 days)", STATE_OVERDUE3],
|
55
|
-
["Overdue (Over 90 days)", STATE_OVERDUE4],
|
56
|
-
["Overdue (Over 120 days)", STATE_OVERDUE5]
|
57
|
-
].freeze
|
58
|
-
|
59
|
-
#
|
60
|
-
# Initialize instance variables
|
61
|
-
def initialize
|
62
|
-
@id = nil
|
63
|
-
@date = nil
|
64
|
-
@due_date = nil
|
65
|
-
@number = nil
|
66
|
-
@is_credit_note = nil
|
67
|
-
@local_gross = nil
|
68
|
-
@shipping = nil
|
69
|
-
@sub_total = nil
|
70
|
-
@tax = nil
|
71
|
-
@tax_point = nil
|
72
|
-
@sales_order_id = nil
|
73
|
-
@original_invoice = nil
|
74
|
-
@state = nil
|
75
|
-
end
|
76
|
-
|
77
|
-
#
|
78
|
-
# Show the state in a useful format
|
79
|
-
def state_name
|
80
|
-
STATE_NAMES[self.state][0]
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2017-2018, AltoYield Limited. All rights reserved.
|
3
|
-
#
|
4
|
-
# This is free software; you can redistribute it and/or modify it
|
5
|
-
# under the terms of the GNU General Public License as published by
|
6
|
-
# the Free Software Foundation; either version 2, or (at your option)
|
7
|
-
# any later version.
|
8
|
-
#
|
9
|
-
# It is distributed in the hope that it will be useful, but WITHOUT
|
10
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12
|
-
# for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this product; see the file COPYING. If not, write to the Free
|
16
|
-
# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY ALTOYIELD LIMITED "AS IS" AND ANY EXPRESS
|
19
|
-
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
21
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL ALTOYIELD LIMITED BE LIABLE FOR
|
22
|
-
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
23
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
24
|
-
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
25
|
-
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
26
|
-
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
27
|
-
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
#
|
30
|
-
module Beanie
|
31
|
-
class SalesInvoiceItem < Api
|
32
|
-
attr_accessor :id, :description, :discount, :quantity, :run_date, :run_length, :unit_cost
|
33
|
-
attr_accessor :sales_invoice_id, :sales_order_item_id, :sales_tax
|
34
|
-
|
35
|
-
#
|
36
|
-
# Initialize instance variables
|
37
|
-
def initialize
|
38
|
-
@id = nil
|
39
|
-
@description = nil
|
40
|
-
@discount = nil
|
41
|
-
@quantity = nil
|
42
|
-
@run_date = nil
|
43
|
-
@run_length = nil
|
44
|
-
@unit_cost = nil
|
45
|
-
@sales_invoice_id = nil
|
46
|
-
@sales_order_item_id = nil
|
47
|
-
@sales_tax = nil
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
data/lib/beanie/sales_order.rb
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2017-2018, AltoYield Limited. All rights reserved.
|
3
|
-
#
|
4
|
-
# This is free software; you can redistribute it and/or modify it
|
5
|
-
# under the terms of the GNU General Public License as published by
|
6
|
-
# the Free Software Foundation; either version 2, or (at your option)
|
7
|
-
# any later version.
|
8
|
-
#
|
9
|
-
# It is distributed in the hope that it will be useful, but WITHOUT
|
10
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12
|
-
# for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this product; see the file COPYING. If not, write to the Free
|
16
|
-
# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY ALTOYIELD LIMITED "AS IS" AND ANY EXPRESS
|
19
|
-
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
21
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL ALTOYIELD LIMITED BE LIABLE FOR
|
22
|
-
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
23
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
24
|
-
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
25
|
-
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
26
|
-
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
27
|
-
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
#
|
30
|
-
module Beanie
|
31
|
-
class SalesOrder < Api
|
32
|
-
attr_accessor :id, :cash_customer_ref, :number, :date, :title, :billing_frequency
|
33
|
-
attr_accessor :your_ref, :currency_id, :customer_id
|
34
|
-
|
35
|
-
BILL_FREQUENCY_DAILY = 0
|
36
|
-
BILL_FREQUENCY_WEEKLY = 1
|
37
|
-
BILL_FREQUENCY_FORTNIGHTLY = 2
|
38
|
-
BILL_FREQUENCY_MONTHLY = 3
|
39
|
-
BILL_FREQUENCY_QUARTERLY = 4
|
40
|
-
BILL_FREQUENCY_ANNUALLY = 5
|
41
|
-
|
42
|
-
BILL_FREQUENCY_NAMES = [
|
43
|
-
["Daily", BILL_FREQUENCY_DAILY],
|
44
|
-
["Weekly", BILL_FREQUENCY_WEEKLY],
|
45
|
-
["Fortnightly", BILL_FREQUENCY_FORTNIGHTLY],
|
46
|
-
["Monthly", BILL_FREQUENCY_MONTHLY],
|
47
|
-
["Quarterly", BILL_FREQUENCY_QUARTERLY],
|
48
|
-
["Yearly", BILL_FREQUENCY_ANNUALLY]
|
49
|
-
].freeze
|
50
|
-
|
51
|
-
#
|
52
|
-
# Initialize instance variables
|
53
|
-
def initialize
|
54
|
-
@id = nil
|
55
|
-
@cash_customer_ref = nil
|
56
|
-
@number = nil
|
57
|
-
@date = nil
|
58
|
-
@title = nil
|
59
|
-
@billing_frequency = BILL_FREQUENCY_DAILY
|
60
|
-
@your_ref = nil
|
61
|
-
@currency = nil
|
62
|
-
@customer_id = nil
|
63
|
-
end
|
64
|
-
|
65
|
-
#
|
66
|
-
# Pretty name for the frequency
|
67
|
-
def frequency_name
|
68
|
-
BILL_FREQUENCY_NAMES.each do |fn|
|
69
|
-
return fn[0] if fn[1] == self.billing_frequency
|
70
|
-
end
|
71
|
-
return "Unknown?"
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
@@ -1,126 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2017-2018, AltoYield Limited. All rights reserved.
|
3
|
-
#
|
4
|
-
# This is free software; you can redistribute it and/or modify it
|
5
|
-
# under the terms of the GNU General Public License as published by
|
6
|
-
# the Free Software Foundation; either version 2, or (at your option)
|
7
|
-
# any later version.
|
8
|
-
#
|
9
|
-
# It is distributed in the hope that it will be useful, but WITHOUT
|
10
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12
|
-
# for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this product; see the file COPYING. If not, write to the Free
|
16
|
-
# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY ALTOYIELD LIMITED "AS IS" AND ANY EXPRESS
|
19
|
-
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
21
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL ALTOYIELD LIMITED BE LIABLE FOR
|
22
|
-
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
23
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
24
|
-
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
25
|
-
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
26
|
-
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
27
|
-
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
#
|
30
|
-
module Beanie
|
31
|
-
class SalesOrderItem < Api
|
32
|
-
attr_accessor :id, :completion, :description, :discount, :quantity, :rundate, :state
|
33
|
-
attr_accessor :sales_order_id, :product_id, :service_period, :unit_cost, :sales_tax
|
34
|
-
|
35
|
-
STATE_NEW = 0
|
36
|
-
STATE_READY = 1
|
37
|
-
STATE_DONE = 2
|
38
|
-
STATE_BLOCKED = 3
|
39
|
-
|
40
|
-
STATE_NAMES = [
|
41
|
-
["New Order Item", STATE_NEW],
|
42
|
-
["Billable", STATE_READY],
|
43
|
-
["Complete", STATE_DONE],
|
44
|
-
["Blocked", STATE_BLOCKED]
|
45
|
-
].freeze
|
46
|
-
|
47
|
-
SERVICE_PERIOD_ONEOFF = 0
|
48
|
-
SERVICE_PERIOD_HOURLY = 1
|
49
|
-
SERVICE_PERIOD_DAILY = 2
|
50
|
-
SERVICE_PERIOD_WEEKLY = 3
|
51
|
-
SERVICE_PERIOD_MONTHLY = 4
|
52
|
-
SERVICE_PERIOD_QUARTERLY = 5
|
53
|
-
SERVICE_PERIOD_ANNUALLY = 6
|
54
|
-
|
55
|
-
SERVICE_PERIOD_NAMES = [
|
56
|
-
["One-Off", SERVICE_PERIOD_ONEOFF],
|
57
|
-
["Hourly Rate", SERVICE_PERIOD_HOURLY],
|
58
|
-
["Daily Rate", SERVICE_PERIOD_DAILY],
|
59
|
-
["Weekly Rate", SERVICE_PERIOD_WEEKLY],
|
60
|
-
["Monthly Rate", SERVICE_PERIOD_MONTHLY],
|
61
|
-
["Quarterly Rate", SERVICE_PERIOD_QUARTERLY],
|
62
|
-
["Annual Rate", SERVICE_PERIOD_ANNUALLY]
|
63
|
-
].freeze
|
64
|
-
|
65
|
-
#
|
66
|
-
# Initialize instance variables
|
67
|
-
def initialize
|
68
|
-
@id = nil
|
69
|
-
@completion = nil
|
70
|
-
@description = nil
|
71
|
-
@discount = nil
|
72
|
-
@quantity = nil
|
73
|
-
@rundate = nil
|
74
|
-
@state = nil
|
75
|
-
@sales_order_id = nil
|
76
|
-
@product_id = nil
|
77
|
-
@service_period = nil
|
78
|
-
@unit_cost = nil
|
79
|
-
@sales_tax = nil
|
80
|
-
end
|
81
|
-
|
82
|
-
#
|
83
|
-
# Pretty name for the state
|
84
|
-
def state_name
|
85
|
-
STATE_NAMES[state][0]
|
86
|
-
end
|
87
|
-
|
88
|
-
#
|
89
|
-
# Service period name
|
90
|
-
def period_name
|
91
|
-
SERVICE_PERIOD_NAMES[service_period][0]
|
92
|
-
end
|
93
|
-
|
94
|
-
#
|
95
|
-
# Is this item active?
|
96
|
-
def active?
|
97
|
-
state == STATE_READY
|
98
|
-
end
|
99
|
-
|
100
|
-
#
|
101
|
-
# Is this item blocked?
|
102
|
-
def blocked?
|
103
|
-
state == STATE_BLOCKED
|
104
|
-
end
|
105
|
-
|
106
|
-
#
|
107
|
-
# Is this a one-off rather than a time-based item?
|
108
|
-
def one_off?
|
109
|
-
self.service_period == SERVICE_PERIOD_ONEOFF
|
110
|
-
end
|
111
|
-
|
112
|
-
#
|
113
|
-
# Get the private data
|
114
|
-
def private_data
|
115
|
-
response = SalesOrderItem.get(:url => "/sales_order_items/#{@id}/private_data")
|
116
|
-
response["data"]
|
117
|
-
end
|
118
|
-
|
119
|
-
#
|
120
|
-
# Update/set the private data
|
121
|
-
def private_data=(data)
|
122
|
-
pdata = {:data => data}
|
123
|
-
response = SalesOrderItem.post(pdata, :url => "/sales_order_items/#{@id}/private_data")
|
124
|
-
end
|
125
|
-
end
|
126
|
-
end
|
@@ -1,70 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2017-2018, AltoYield Limited. All rights reserved.
|
3
|
-
#
|
4
|
-
# This is free software; you can redistribute it and/or modify it
|
5
|
-
# under the terms of the GNU General Public License as published by
|
6
|
-
# the Free Software Foundation; either version 2, or (at your option)
|
7
|
-
# any later version.
|
8
|
-
#
|
9
|
-
# It is distributed in the hope that it will be useful, but WITHOUT
|
10
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12
|
-
# for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this product; see the file COPYING. If not, write to the Free
|
16
|
-
# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY ALTOYIELD LIMITED "AS IS" AND ANY EXPRESS
|
19
|
-
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
21
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL ALTOYIELD LIMITED BE LIABLE FOR
|
22
|
-
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
23
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
24
|
-
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
25
|
-
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
26
|
-
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
27
|
-
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
#
|
30
|
-
module Beanie
|
31
|
-
class StockAdjustment < Api
|
32
|
-
attr_accessor :id, :effective, :adjustment_type, :amount, :note
|
33
|
-
attr_accessor :stock_item_id, :stock_supplier_id, :purchase_order_item_id
|
34
|
-
|
35
|
-
TYPE_STOCK_TAKING = 0
|
36
|
-
TYPE_SCHED_REQUEST = 1
|
37
|
-
TYPE_ORDER_WAIT = 2
|
38
|
-
TYPE_TO_INVENTORY = 3
|
39
|
-
TYPE_FROM_INVENTORY = 3
|
40
|
-
TYPE_SPOILAGE = 4
|
41
|
-
|
42
|
-
TYPE_NAMES = [
|
43
|
-
["Stock-Taking", TYPE_STOCK_TAKING],
|
44
|
-
["Scheduled Request", TYPE_SCHED_REQUEST],
|
45
|
-
["Awaiting Delivery", TYPE_ORDER_WAIT],
|
46
|
-
["Move to Inventory", TYPE_TO_INVENTORY],
|
47
|
-
["Move from Inventory", TYPE_FROM_INVENTORY],
|
48
|
-
["Spoilage", TYPE_SPOILAGE]
|
49
|
-
].freeze
|
50
|
-
|
51
|
-
#
|
52
|
-
# Initialize instance variables
|
53
|
-
def initialize
|
54
|
-
@id = nil
|
55
|
-
@effective = nil
|
56
|
-
@adjustment_type = nil
|
57
|
-
@amount = nil
|
58
|
-
@note = nil
|
59
|
-
@stock_item_id = nil
|
60
|
-
@stock_supplier_id = nil
|
61
|
-
@purchase_order_item_id = nil
|
62
|
-
end
|
63
|
-
|
64
|
-
#
|
65
|
-
# Convert the type into a useful name
|
66
|
-
def type_name
|
67
|
-
TYPE_NAMES[adjustment_type][0]
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2017-2018, AltoYield Limited. All rights reserved.
|
3
|
-
#
|
4
|
-
# This is free software; you can redistribute it and/or modify it
|
5
|
-
# under the terms of the GNU General Public License as published by
|
6
|
-
# the Free Software Foundation; either version 2, or (at your option)
|
7
|
-
# any later version.
|
8
|
-
#
|
9
|
-
# It is distributed in the hope that it will be useful, but WITHOUT
|
10
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12
|
-
# for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this product; see the file COPYING. If not, write to the Free
|
16
|
-
# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY ALTOYIELD LIMITED "AS IS" AND ANY EXPRESS
|
19
|
-
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
21
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL ALTOYIELD LIMITED BE LIABLE FOR
|
22
|
-
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
23
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
24
|
-
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
25
|
-
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
26
|
-
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
27
|
-
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
#
|
30
|
-
module Beanie
|
31
|
-
class StockCategory < Api
|
32
|
-
attr_accessor :id, :code, :name, :description, :nominal_account_id
|
33
|
-
|
34
|
-
#
|
35
|
-
# Initialize instance variables
|
36
|
-
def initialize
|
37
|
-
@id = nil
|
38
|
-
@code = nil
|
39
|
-
@name = nil
|
40
|
-
@description = nil
|
41
|
-
@nominal_account_id = nil
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
data/lib/beanie/stock_item.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2017-2018, AltoYield Limited. All rights reserved.
|
3
|
-
#
|
4
|
-
# This is free software; you can redistribute it and/or modify it
|
5
|
-
# under the terms of the GNU General Public License as published by
|
6
|
-
# the Free Software Foundation; either version 2, or (at your option)
|
7
|
-
# any later version.
|
8
|
-
#
|
9
|
-
# It is distributed in the hope that it will be useful, but WITHOUT
|
10
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12
|
-
# for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this product; see the file COPYING. If not, write to the Free
|
16
|
-
# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY ALTOYIELD LIMITED "AS IS" AND ANY EXPRESS
|
19
|
-
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
21
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL ALTOYIELD LIMITED BE LIABLE FOR
|
22
|
-
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
23
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
24
|
-
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
25
|
-
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
26
|
-
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
27
|
-
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
#
|
30
|
-
module Beanie
|
31
|
-
class StockItem < Api
|
32
|
-
attr_accessor :id, :description, :item_type, :name, :sku, :stock_category_id, :unit_of_measure
|
33
|
-
|
34
|
-
TYPE_PURCHASED = 0
|
35
|
-
TYPE_RAW_MATERIAL = 1
|
36
|
-
TYPE_WORK_IN_PROGRESS = 2
|
37
|
-
TYPE_FINISHED_GOODS = 3
|
38
|
-
|
39
|
-
TYPE_NAMES = [
|
40
|
-
["Purchased for Resale", TYPE_PURCHASED],
|
41
|
-
["Raw Materials", TYPE_RAW_MATERIAL],
|
42
|
-
["Work In Progress", TYPE_WORK_IN_PROGRESS],
|
43
|
-
["Finished Goods", TYPE_FINISHED_GOODS]
|
44
|
-
].freeze
|
45
|
-
|
46
|
-
#
|
47
|
-
# Initialize instance variables
|
48
|
-
def initialize
|
49
|
-
@id = nil
|
50
|
-
@description = nil
|
51
|
-
@item_type = nil
|
52
|
-
@name = nil
|
53
|
-
@sku = nil
|
54
|
-
@stock_category_id = nil
|
55
|
-
@unit_of_measure = nil
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2017-2018, AltoYield Limited. All rights reserved.
|
3
|
-
#
|
4
|
-
# This is free software; you can redistribute it and/or modify it
|
5
|
-
# under the terms of the GNU General Public License as published by
|
6
|
-
# the Free Software Foundation; either version 2, or (at your option)
|
7
|
-
# any later version.
|
8
|
-
#
|
9
|
-
# It is distributed in the hope that it will be useful, but WITHOUT
|
10
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12
|
-
# for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this product; see the file COPYING. If not, write to the Free
|
16
|
-
# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY ALTOYIELD LIMITED "AS IS" AND ANY EXPRESS
|
19
|
-
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
21
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL ALTOYIELD LIMITED BE LIABLE FOR
|
22
|
-
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
23
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
24
|
-
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
25
|
-
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
26
|
-
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
27
|
-
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
#
|
30
|
-
module Beanie
|
31
|
-
class StockLocation < Api
|
32
|
-
attr_accessor :id, :description, :name
|
33
|
-
|
34
|
-
#
|
35
|
-
# Initialize instance variables
|
36
|
-
def initialize
|
37
|
-
@id = nil
|
38
|
-
@description = nil
|
39
|
-
@name = nil
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2017-2018, AltoYield Limited. All rights reserved.
|
3
|
-
#
|
4
|
-
# This is free software; you can redistribute it and/or modify it
|
5
|
-
# under the terms of the GNU General Public License as published by
|
6
|
-
# the Free Software Foundation; either version 2, or (at your option)
|
7
|
-
# any later version.
|
8
|
-
#
|
9
|
-
# It is distributed in the hope that it will be useful, but WITHOUT
|
10
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12
|
-
# for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this product; see the file COPYING. If not, write to the Free
|
16
|
-
# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY ALTOYIELD LIMITED "AS IS" AND ANY EXPRESS
|
19
|
-
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
21
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL ALTOYIELD LIMITED BE LIABLE FOR
|
22
|
-
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
23
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
24
|
-
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
25
|
-
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
26
|
-
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
27
|
-
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
#
|
30
|
-
module Beanie
|
31
|
-
class StockSupplier < Api
|
32
|
-
attr_accessor :id, :priority, :supplier_partno, :lot_size, :lead_time, :last_price
|
33
|
-
attr_accessor :stock_item_id, :supplier_id
|
34
|
-
|
35
|
-
#
|
36
|
-
# Initialize instance variables
|
37
|
-
def initialize
|
38
|
-
@id = nil
|
39
|
-
@priority = nil
|
40
|
-
@supplier_partno = nil
|
41
|
-
@lot_size = nil
|
42
|
-
@lead_time = nil
|
43
|
-
@last_price = nil
|
44
|
-
@stock_item_id = nil
|
45
|
-
@supplier_id = nil
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|