beanie 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/lib/beanie/document.rb
DELETED
@@ -1,71 +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 Document < Api
|
32
|
-
attr_accessor :id, :bxref, :mime_type, :size, :src_file, :category
|
33
|
-
|
34
|
-
CATEGORY_UNFILED = 0
|
35
|
-
CATEGORY_DEBIT_CARD_EXPENSES = 1
|
36
|
-
CATEGORY_CASH_EXPENSES = 2
|
37
|
-
CATEGORY_PURCHASE_INVOICES = 3
|
38
|
-
CATEGORY_SALES_INVOICES = 4
|
39
|
-
CATEGORY_BANK_STATEMENTS = 5
|
40
|
-
CATEGORY_CONTRACTS = 6
|
41
|
-
CATEGORY_MISCELLANEOUS = 7
|
42
|
-
|
43
|
-
CATEGORIES = [
|
44
|
-
["Unfiled", CATEGORY_UNFILED],
|
45
|
-
["Debit Card Expenses", CATEGORY_DEBIT_CARD_EXPENSES],
|
46
|
-
["Cash Expenses", CATEGORY_CASH_EXPENSES],
|
47
|
-
["Purchase Invoices", CATEGORY_PURCHASE_INVOICES],
|
48
|
-
["Sales Invoices", CATEGORY_SALES_INVOICES],
|
49
|
-
["Bank Statements", CATEGORY_BANK_STATEMENTS],
|
50
|
-
["Contracts", CATEGORY_CONTRACTS],
|
51
|
-
["Miscellaneous", CATEGORY_MISCELLANEOUS]
|
52
|
-
].freeze
|
53
|
-
|
54
|
-
#
|
55
|
-
# Initialize instance variables
|
56
|
-
def initialize
|
57
|
-
@id = nil
|
58
|
-
@bxref = nil
|
59
|
-
@mime_type = nil
|
60
|
-
@size = nil
|
61
|
-
@src_file = nil
|
62
|
-
@category = nil
|
63
|
-
end
|
64
|
-
|
65
|
-
#
|
66
|
-
# Display a name for the document category
|
67
|
-
def category_name
|
68
|
-
CATEGORIES[self.category][0]
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
data/lib/beanie/fixed_asset.rb
DELETED
@@ -1,45 +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 FixedAsset < Api
|
32
|
-
attr_accessor :id, :acquired, :cost, :name, :value, :nominal_account_id
|
33
|
-
|
34
|
-
#
|
35
|
-
# Initialize instance variables
|
36
|
-
def initialize
|
37
|
-
@id = nil
|
38
|
-
@acquired = nil
|
39
|
-
@cost = nil
|
40
|
-
@name = nil
|
41
|
-
@value = nil
|
42
|
-
@nominal_account_id = nil
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
data/lib/beanie/journal.rb
DELETED
@@ -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 Journal < Api
|
32
|
-
attr_accessor :id, :date, :folio, :title, :number
|
33
|
-
|
34
|
-
#
|
35
|
-
# Initialize instance variables
|
36
|
-
def initialize
|
37
|
-
@id = nil
|
38
|
-
@date = nil
|
39
|
-
@folio = nil
|
40
|
-
@title = nil
|
41
|
-
@number = nil
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
data/lib/beanie/journal_item.rb
DELETED
@@ -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 JournalItem < Api
|
32
|
-
attr_accessor :id, :amount, :is_credit, :journal_id, :nominal_account_id
|
33
|
-
|
34
|
-
#
|
35
|
-
# Initialize instance variables
|
36
|
-
def initialize
|
37
|
-
@id = nil
|
38
|
-
@amount = nil
|
39
|
-
@is_credit = nil
|
40
|
-
@journal_id = nil
|
41
|
-
@nominal_account_id = nil
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,73 +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 NominalAccount < Api
|
32
|
-
attr_accessor :id, :na_type, :code, :name, :nominal_account_category_id
|
33
|
-
|
34
|
-
TYPE_FIXED_ASSETS = 0
|
35
|
-
TYPE_CURRENT_ASSETS = 1
|
36
|
-
TYPE_CURRENT_LIABILITIES = 2
|
37
|
-
TYPE_NON_CURRENT_LIABILITIES = 3
|
38
|
-
TYPE_RESERVES = 4
|
39
|
-
TYPE_INCOME = 5
|
40
|
-
TYPE_DIRECT_COSTS = 6
|
41
|
-
TYPE_EXPENSE = 7
|
42
|
-
TYPE_OTHER_EXPENSE = 8
|
43
|
-
TYPE_OTHER_INCOME = 9
|
44
|
-
|
45
|
-
TYPE_NAMES = [
|
46
|
-
["Fixed Assets", TYPE_FIXED_ASSETS],
|
47
|
-
["Current Assets", TYPE_CURRENT_ASSETS],
|
48
|
-
["Current Liabilities", TYPE_CURRENT_LIABILITIES],
|
49
|
-
["Non-Current Liabilities", TYPE_NON_CURRENT_LIABILITIES],
|
50
|
-
["Reserves", TYPE_RESERVES],
|
51
|
-
["Income", TYPE_INCOME],
|
52
|
-
["Direct Costs", TYPE_DIRECT_COSTS],
|
53
|
-
["Expense", TYPE_EXPENSE],
|
54
|
-
["Other Expense", TYPE_OTHER_EXPENSE],
|
55
|
-
["Other Income", TYPE_OTHER_INCOME]
|
56
|
-
].freeze
|
57
|
-
|
58
|
-
#
|
59
|
-
# Initialize instance variables
|
60
|
-
def initialize
|
61
|
-
@id = nil
|
62
|
-
@code = nil
|
63
|
-
@name = nil
|
64
|
-
@nominal_account_category_id = nil
|
65
|
-
end
|
66
|
-
|
67
|
-
#
|
68
|
-
# Show proper name for type
|
69
|
-
def type_name
|
70
|
-
TYPE_NAMES[na_type][0]
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
@@ -1,49 +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 NominalAccountCategory < Api
|
32
|
-
attr_accessor :id, :na_type, :name, :parent_category_id
|
33
|
-
|
34
|
-
#
|
35
|
-
# Initialize instance variables
|
36
|
-
def initialize
|
37
|
-
@id = nil
|
38
|
-
@na_type = nil
|
39
|
-
@name = nil
|
40
|
-
@parent_category_id = nil
|
41
|
-
end
|
42
|
-
|
43
|
-
#
|
44
|
-
# Show proper name for type
|
45
|
-
def type_name
|
46
|
-
NominalAccount::TYPE_NAMES[na_type][0]
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
data/lib/beanie/product.rb
DELETED
@@ -1,52 +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 Product < Api
|
32
|
-
attr_accessor :id, :description, :name, :code, :is_service
|
33
|
-
attr_accessor :nominal_account_id, :product_category_id, :unit_of_measure
|
34
|
-
|
35
|
-
#
|
36
|
-
# Initialize instance variables
|
37
|
-
def initialize
|
38
|
-
@id = nil
|
39
|
-
@description = nil
|
40
|
-
@name = nil
|
41
|
-
@code = nil
|
42
|
-
@is_service = nil
|
43
|
-
@nominal_account_id = nil
|
44
|
-
@product_category_id = nil
|
45
|
-
@unit_of_measure = nil
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.find_by_name(name)
|
49
|
-
Beanie.find("products", "name", name)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
@@ -1,43 +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 ProductCategory < Api
|
32
|
-
attr_accessor :id, :description, :name, :parent_category_id
|
33
|
-
|
34
|
-
#
|
35
|
-
# Initialize instance variables
|
36
|
-
def initialize
|
37
|
-
@id = nil
|
38
|
-
@description = nil
|
39
|
-
@name = nil
|
40
|
-
@parent_category_id = nil
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
data/lib/beanie/product_price.rb
DELETED
@@ -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 ProductPrice < Api
|
32
|
-
attr_accessor :id, :amount, :effective, :sales_tax_id, :product_id
|
33
|
-
|
34
|
-
#
|
35
|
-
# Initialize instance variables
|
36
|
-
def initialize
|
37
|
-
@id = nil
|
38
|
-
@amount = nil
|
39
|
-
@effective = nil
|
40
|
-
@sales_tax_id = nil
|
41
|
-
@product_id = nil
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,76 +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 ProductionOrder < Api
|
32
|
-
attr_accessor :id, :number, :state, :quantity, :notes
|
33
|
-
attr_accessor :sales_order_id, :bill_of_material_id, :work_centre_group_id
|
34
|
-
|
35
|
-
#
|
36
|
-
# Initialize instance variables
|
37
|
-
def initialize
|
38
|
-
@id = nil
|
39
|
-
@number = nil
|
40
|
-
@state = nil
|
41
|
-
@quantity = nil
|
42
|
-
@notes = nil
|
43
|
-
@sales_order_id = nil
|
44
|
-
@bill_of_material_id = nil
|
45
|
-
@work_centre_group_id = nil
|
46
|
-
@_private_data = nil
|
47
|
-
end
|
48
|
-
|
49
|
-
#
|
50
|
-
# Get the private data
|
51
|
-
def private_data
|
52
|
-
unless @_private_data
|
53
|
-
response = ProductionOrder.get(:url => "/production_orders/#{@id}/private_data")
|
54
|
-
@_private_data = response["data"]
|
55
|
-
end
|
56
|
-
return @_private_data
|
57
|
-
end
|
58
|
-
|
59
|
-
#
|
60
|
-
# Update/set the private data
|
61
|
-
def private_data=(data)
|
62
|
-
@_private_data = data
|
63
|
-
pdata = {:data => data}
|
64
|
-
ProductionOrder.post(pdata, :url => "/production_orders/#{@id}/private_data")
|
65
|
-
end
|
66
|
-
|
67
|
-
#
|
68
|
-
# Construct the path a little differently...
|
69
|
-
def construct_path(opts = {})
|
70
|
-
raise ":work_centre_group_id is not defined" unless opts[:work_centre_group_id]
|
71
|
-
path = "/work_centre_groups/#{opts[:work_centre_group_id]}/production_orders"
|
72
|
-
opts.delete(:work_centre_group_id)
|
73
|
-
path
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
@@ -1,55 +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 PurchaseInvoice < Api
|
32
|
-
attr_accessor :id, :date, :due_date, :is_credit_note, :is_paid, :local_gross, :number
|
33
|
-
attr_accessor :original_invoice_id, :shipping, :sub_total, :tax, :tax_point
|
34
|
-
attr_accessor :purchase_order_id, :document_id
|
35
|
-
|
36
|
-
#
|
37
|
-
# Initialize instance variables
|
38
|
-
def initialize
|
39
|
-
@id = nil
|
40
|
-
@date = nil
|
41
|
-
@due_date = nil
|
42
|
-
@is_credit_note = nil
|
43
|
-
@is_paid = nil
|
44
|
-
@local_gross = nil
|
45
|
-
@number = nil
|
46
|
-
@original_invoice_id = nil
|
47
|
-
@shipping = nil
|
48
|
-
@sub_total = nil
|
49
|
-
@tax = nil
|
50
|
-
@tax_point = nil
|
51
|
-
@purchase_order_id = nil
|
52
|
-
@document_id = nil
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,46 +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 PurchaseOrder < Api
|
32
|
-
attr_accessor :id, :date, :number, :title
|
33
|
-
attr_accessor :currency, :supplier_id
|
34
|
-
|
35
|
-
#
|
36
|
-
# Initialize instance variables
|
37
|
-
def initialize
|
38
|
-
@id = nil
|
39
|
-
@date = nil
|
40
|
-
@number = nil
|
41
|
-
@title = nil
|
42
|
-
@currency = nil
|
43
|
-
@supplier_id = nil
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|