beanie 0.0.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 +7 -0
- data/.gitignore +17 -0
- data/CONTRIBUTORS +1 -0
- data/Gemfile +3 -0
- data/LICENSE +339 -0
- data/LICENSE.txt +22 -0
- data/README.md +30 -0
- data/Rakefile +1 -0
- data/VERSION +1 -0
- data/beanie.gemspec +23 -0
- data/lib/beanie/api.rb +117 -0
- data/lib/beanie/bank_account.rb +34 -0
- data/lib/beanie/bank_statement.rb +34 -0
- data/lib/beanie/bank_statement_data.rb +35 -0
- data/lib/beanie/beanie_alert.rb +56 -0
- data/lib/beanie/billable.rb +35 -0
- data/lib/beanie/company.rb +40 -0
- data/lib/beanie/company_member.rb +34 -0
- data/lib/beanie/config_type.rb +50 -0
- data/lib/beanie/config_value.rb +34 -0
- data/lib/beanie/contact.rb +55 -0
- data/lib/beanie/contact_address.rb +35 -0
- data/lib/beanie/contact_note.rb +34 -0
- data/lib/beanie/customer.rb +34 -0
- data/lib/beanie/document.rb +60 -0
- data/lib/beanie/fixed_asset.rb +34 -0
- data/lib/beanie/journal.rb +34 -0
- data/lib/beanie/journal_item.rb +34 -0
- data/lib/beanie/nominal_account.rb +34 -0
- data/lib/beanie/nominal_account_category.rb +64 -0
- data/lib/beanie/product.rb +40 -0
- data/lib/beanie/product_category.rb +34 -0
- data/lib/beanie/product_price.rb +34 -0
- data/lib/beanie/purchase_invoice.rb +36 -0
- data/lib/beanie/purchase_order.rb +35 -0
- data/lib/beanie/purchase_order_item.rb +47 -0
- data/lib/beanie/sales_invoice.rb +65 -0
- data/lib/beanie/sales_invoice_item.rb +35 -0
- data/lib/beanie/sales_order.rb +34 -0
- data/lib/beanie/sales_order_item.rb +118 -0
- data/lib/beanie/stock_adjustment.rb +57 -0
- data/lib/beanie/stock_category.rb +34 -0
- data/lib/beanie/stock_item.rb +46 -0
- data/lib/beanie/stock_location.rb +34 -0
- data/lib/beanie/stock_supplier.rb +35 -0
- data/lib/beanie/supplier.rb +35 -0
- data/lib/beanie/tax_registration.rb +50 -0
- data/lib/beanie/vat_record.rb +56 -0
- data/lib/beanie/vat_return.rb +45 -0
- data/lib/beanie/version.rb +32 -0
- data/lib/beanie/work_centre.rb +62 -0
- data/lib/beanie/work_centre_group.rb +44 -0
- data/lib/beanie.rb +130 -0
- metadata +124 -0
@@ -0,0 +1,64 @@
|
|
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
|
+
NA_TYPE_FIXED_ASSETS = 0
|
35
|
+
NA_TYPE_CURRENT_ASSETS = 1
|
36
|
+
NA_TYPE_CURRENT_LIABILITIES = 2
|
37
|
+
NA_TYPE_NON_CURRENT_LIABILITIES = 3
|
38
|
+
NA_TYPE_RESERVES = 4
|
39
|
+
NA_TYPE_INCOME = 5
|
40
|
+
NA_TYPE_DIRECT_COSTS = 6
|
41
|
+
NA_TYPE_EXPENSE = 7
|
42
|
+
NA_TYPE_OTHER_EXPENSE = 8
|
43
|
+
NA_TYPE_OTHER_INCOME = 9
|
44
|
+
|
45
|
+
NA_TYPE_NAMES = [
|
46
|
+
["Fixed Assets", NA_TYPE_FIXED_ASSETS],
|
47
|
+
["Current Assets", NA_TYPE_CURRENT_ASSETS],
|
48
|
+
["Current Liabilities", NA_TYPE_CURRENT_LIABILITIES],
|
49
|
+
["Non-Current Liabilities", NA_TYPE_NON_CURRENT_LIABILITIES],
|
50
|
+
["Reserves", NA_TYPE_RESERVES],
|
51
|
+
["Income", NA_TYPE_INCOME],
|
52
|
+
["Direct Costs", NA_TYPE_DIRECT_COSTS],
|
53
|
+
["Expense", NA_TYPE_EXPENSE],
|
54
|
+
["Other Expense", NA_TYPE_OTHER_EXPENSE],
|
55
|
+
["Other Income", NA_TYPE_OTHER_INCOME]
|
56
|
+
].freeze
|
57
|
+
|
58
|
+
#
|
59
|
+
# Show proper name for type
|
60
|
+
def na_type_name
|
61
|
+
NA_TYPE_NAMES[na_type][0]
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,40 @@
|
|
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, :sku, :is_service
|
33
|
+
attr_accessor :nominal_account_id, :product_category_id, :unit_of_measure
|
34
|
+
|
35
|
+
def self.find_by_name(name)
|
36
|
+
puts "Find by name: #{name}"
|
37
|
+
Beanie.find("products", "name", name)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,34 @@
|
|
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
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,34 @@
|
|
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
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,36 @@
|
|
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
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,35 @@
|
|
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
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,47 @@
|
|
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
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,65 @@
|
|
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
|
+
# Show the state in a useful format
|
61
|
+
def state_name
|
62
|
+
STATE_NAMES[self.state][0]
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,35 @@
|
|
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
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,34 @@
|
|
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, :your_ref, :currency, :customer_id
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,118 @@
|
|
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, :frequency, :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
|
+
BILL_FREQUENCY_IMMEDIATE = 0
|
48
|
+
BILL_FREQUENCY_WEEKLY = 1
|
49
|
+
BILL_FREQUENCY_MONTHLY = 2
|
50
|
+
BILL_FREQUENCY_QUARTERLY = 3
|
51
|
+
BILL_FREQUENCY_ANNUALLY = 4
|
52
|
+
|
53
|
+
BILL_FREQUENCY_NAMES = [
|
54
|
+
["Immediate", BILL_FREQUENCY_IMMEDIATE],
|
55
|
+
["Weekly", BILL_FREQUENCY_WEEKLY],
|
56
|
+
["Monthly", BILL_FREQUENCY_MONTHLY],
|
57
|
+
["Quarterly", BILL_FREQUENCY_QUARTERLY],
|
58
|
+
["Yearly", BILL_FREQUENCY_ANNUALLY]
|
59
|
+
].freeze
|
60
|
+
|
61
|
+
SERVICE_PERIOD_ONEOFF = 0
|
62
|
+
SERVICE_PERIOD_HOURLY = 1
|
63
|
+
SERVICE_PERIOD_DAILY = 2
|
64
|
+
SERVICE_PERIOD_WEEKLY = 3
|
65
|
+
SERVICE_PERIOD_MONTHLY = 4
|
66
|
+
SERVICE_PERIOD_QUARTERLY = 5
|
67
|
+
SERVICE_PERIOD_ANNUALLY = 6
|
68
|
+
|
69
|
+
SERVICE_PERIOD_NAMES = [
|
70
|
+
["One-Off", SERVICE_PERIOD_ONEOFF],
|
71
|
+
["Hourly Rate", SERVICE_PERIOD_HOURLY],
|
72
|
+
["Daily Rate", SERVICE_PERIOD_DAILY],
|
73
|
+
["Weekly Rate", SERVICE_PERIOD_WEEKLY],
|
74
|
+
["Monthly Rate", SERVICE_PERIOD_MONTHLY],
|
75
|
+
["Quarterly Rate", SERVICE_PERIOD_QUARTERLY],
|
76
|
+
["Annual Rate", SERVICE_PERIOD_ANNUALLY]
|
77
|
+
].freeze
|
78
|
+
|
79
|
+
#
|
80
|
+
# Pretty name for the state
|
81
|
+
def state_name
|
82
|
+
STATE_NAMES[state][0]
|
83
|
+
end
|
84
|
+
|
85
|
+
#
|
86
|
+
# Pretty name for the frequency
|
87
|
+
def frequency_name
|
88
|
+
BILL_FREQUENCY_NAMES.each do |fn|
|
89
|
+
return fn[0] if fn[1] == self.frequency
|
90
|
+
end
|
91
|
+
return "Unknown?"
|
92
|
+
end
|
93
|
+
|
94
|
+
#
|
95
|
+
# Service period name
|
96
|
+
def period_name
|
97
|
+
SERVICE_PERIOD_NAMES[service_period][0]
|
98
|
+
end
|
99
|
+
|
100
|
+
#
|
101
|
+
# Is this item active?
|
102
|
+
def active?
|
103
|
+
state == STATE_READY
|
104
|
+
end
|
105
|
+
|
106
|
+
#
|
107
|
+
# Is this item blocked?
|
108
|
+
def blocked?
|
109
|
+
state == STATE_BLOCKED
|
110
|
+
end
|
111
|
+
|
112
|
+
#
|
113
|
+
# Is this a one-off rather than a time-based item?
|
114
|
+
def one_off?
|
115
|
+
self.service_period == SERVICE_PERIOD_ONEOFF
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,57 @@
|
|
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
|
+
# Convert the type into a useful name
|
53
|
+
def type_name
|
54
|
+
TYPE_NAMES[adjustment_type][0]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,34 @@
|
|
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
|
+
end
|
34
|
+
end
|