sagekit 0.1.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.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/CHANGELOG.md +3 -0
  4. data/CODE_OF_CONDUCT.md +84 -0
  5. data/Gemfile +10 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.org +346 -0
  8. data/Rakefile +8 -0
  9. data/bin/console +18 -0
  10. data/bin/setup +8 -0
  11. data/docs/index.html +940 -0
  12. data/docs/style.css +82 -0
  13. data/lib/sagekit/client.rb +97 -0
  14. data/lib/sagekit/error.rb +3 -0
  15. data/lib/sagekit/object.rb +18 -0
  16. data/lib/sagekit/objects/account_set.rb +4 -0
  17. data/lib/sagekit/objects/category.rb +4 -0
  18. data/lib/sagekit/objects/credit_note.rb +4 -0
  19. data/lib/sagekit/objects/customer.rb +4 -0
  20. data/lib/sagekit/objects/invoice.rb +4 -0
  21. data/lib/sagekit/objects/item.rb +4 -0
  22. data/lib/sagekit/objects/location.rb +4 -0
  23. data/lib/sagekit/objects/purchase_order.rb +4 -0
  24. data/lib/sagekit/objects/receipt.rb +4 -0
  25. data/lib/sagekit/objects/sales_history.rb +4 -0
  26. data/lib/sagekit/objects/sales_order.rb +4 -0
  27. data/lib/sagekit/objects/sales_person.rb +4 -0
  28. data/lib/sagekit/objects/vendor.rb +4 -0
  29. data/lib/sagekit/objects/vendor_contract_cost.rb +4 -0
  30. data/lib/sagekit/resource.rb +55 -0
  31. data/lib/sagekit/resources/account_sets.rb +27 -0
  32. data/lib/sagekit/resources/categories.rb +26 -0
  33. data/lib/sagekit/resources/credit_notes.rb +17 -0
  34. data/lib/sagekit/resources/customer_groups.rb +26 -0
  35. data/lib/sagekit/resources/customer_terms.rb +26 -0
  36. data/lib/sagekit/resources/customers.rb +26 -0
  37. data/lib/sagekit/resources/invoices.rb +12 -0
  38. data/lib/sagekit/resources/items.rb +27 -0
  39. data/lib/sagekit/resources/locations.rb +26 -0
  40. data/lib/sagekit/resources/purchase_orders.rb +16 -0
  41. data/lib/sagekit/resources/receipts.rb +16 -0
  42. data/lib/sagekit/resources/sales_history.rb +16 -0
  43. data/lib/sagekit/resources/sales_orders.rb +40 -0
  44. data/lib/sagekit/resources/sales_persons.rb +34 -0
  45. data/lib/sagekit/resources/vendor_contract_costs.rb +27 -0
  46. data/lib/sagekit/resources/vendor_groups.rb +26 -0
  47. data/lib/sagekit/resources/vendor_terms.rb +26 -0
  48. data/lib/sagekit/resources/vendors.rb +30 -0
  49. data/lib/sagekit/version.rb +5 -0
  50. data/lib/sagekit.rb +56 -0
  51. metadata +120 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bf9a2ad3103e00fb5a7c70db398b14b693da3458a3dd826f01ca453d37753cc2
4
+ data.tar.gz: 8bc67fc26a566568542d8675741a4593942014f3e2872e4f34f79cf2bb3bce7d
5
+ SHA512:
6
+ metadata.gz: adf9a8f1aed9563904da68f88238e9349ffe712b60d767661701e10206795037db32060d8c0e3784816c1bf6326549a9c871a53f3dab8babf4e75fa4e72dbf3a
7
+ data.tar.gz: 9fb19570edd2aacbd78189a4f62589c357bd0afa70ed7ef955eb6dcf2955752d4c57cb23813dd5d48c7ea2adb1c64846779e6b1534be014029c7da27ebdfb879
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 0.1.0 (2021-09-30)
2
+
3
+ - First release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at jose.perez@vertilux.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in sagekit.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+ gem "rspec", "~> 3.0"
10
+ gem "irb"
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Jose Perez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.org ADDED
@@ -0,0 +1,346 @@
1
+ #+TITLE: Sagekit
2
+ #+AUTHOR: Jose Perez
3
+ #+EMAIL: jose.perez@vertilux.com
4
+ #+EXPORT_FILE_NAME: ./docs/index.html
5
+ #+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
6
+ #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style.css">
7
+ #+OPTIONS: num:nil
8
+
9
+ Sagekit is a ruby gem client library to talk with Sage300 API.
10
+
11
+ The gem maps as closely as possible to the Sage300 API so you can easily convert API examples to gem code.
12
+ Responses are created as objects like. They're built using OpenStruct so you can easily access data in a Ruby-ish way.
13
+
14
+ The Sage 300 Web API makes it easier to create services that integrate with Sage 300 data and business logic. The Web API improves on existing tools for third-party integrations without requiring in-depth understanding of the Sage 300 View protocol and components.
15
+
16
+ ** Installation
17
+
18
+ Add this line to your application's Gemfile:
19
+
20
+ #+begin_src ruby
21
+ gem 'sagekit'
22
+ #+end_src
23
+
24
+ And then execute:
25
+
26
+ #+begin_src bash
27
+ $ bundle install
28
+ #+end_src
29
+
30
+ Or install it yourself as:
31
+
32
+ #+begin_src bash
33
+ $ gem install sagekit
34
+ #+end_src
35
+
36
+ ** Usage
37
+
38
+ Make sure you have Sage300 web services up and runing. Web service is an easy way to communicate with 3rd party application without hampering the existing system & this is the reason we will always suggest to go for web service integration, whenever any customer requires integration.
39
+
40
+ Initialize client to make requets:
41
+
42
+ #+begin_src ruby
43
+ require 'sagekit'
44
+ client = Sagekit::Client.new(URL, AUTH)
45
+ client.sales_orders.list(COMPANY, '$top':10)
46
+ #+end_src
47
+
48
+ Make sure to change:
49
+ - URL with the web serive url
50
+ Example: ~http://localhost/Sage300WebApi/v1.0/-/SAMLTD/AR/ARCustomers~
51
+
52
+ | Component | Description | Example |
53
+ |------------+-----------------------------------------------+-------------------------|
54
+ | {protocol} | The application protocol enabled in IIS setup | http, https |
55
+ | {host} | The path to the Web API | localhost/Sage300WebApi |
56
+ | {version} | The API version | v1.0 |
57
+ | {company} | The org ID of the company being requested | SAMLTD |
58
+ | {module} | SAge300 application module | AR, AP, GL, IC |
59
+ | {resource} | The resource entity being requested | APVendors, ARCustomers |
60
+
61
+ ~{company}~ needs to be pass by the request, ~module~ and ~resource~ the gem will take car of.
62
+
63
+ - AUTH with the Basic authentication key, Example:
64
+ #+begin_src
65
+ Authorization: Basic QURNSU46QURNSU4=
66
+ (constructed for user "ADMIN" and password "ADMIN")
67
+ #+end_src
68
+
69
+ - COMPANY with teh company id
70
+
71
+ ** Resources
72
+
73
+ The simplest way to retrieve records of a particular resource is to call a GET (list object).
74
+
75
+ #+begin_src ruby
76
+ client.sales_orders.list('COMPANY')
77
+ #+end_src
78
+
79
+ Currently the maximum number of records that can be returned for a single GET request is 100. In order to retrieve records beyond the first 100 or find records based on a given set of criteria, the use of query options is required.
80
+
81
+ To reduce the number of requests necessary for transferring large datasets, the maximum page size can be adjusted from the default value of 100 records per request.
82
+
83
+ *** Query options
84
+
85
+ | Component | Example |
86
+ |-----------------+-------------------------------------|
87
+ | {query-options} | $skip:100 |
88
+ | | $filer:"CustomerNumber eq 'LEPEPE'" |
89
+ | | $select |
90
+ | | $top:5 |
91
+ | | $count:true |
92
+
93
+ - ~$skip~
94
+
95
+ The =$skip= query option must be a positive integer N that specifies the records beyond which the response feed should start with, effectively skipping N records. This is typically used to retrieve records beyond the top 100, the default maximum limit of a single response page.
96
+
97
+ #+begin_src ruby
98
+ client.sales_orders.list('COMPANY', '$skip':5)
99
+ #+end_src
100
+
101
+ - ~$top~
102
+
103
+ The =$top= query option must a positive integer N that specifies the maximum number of records the response feed could contain, effectively selecting the first N records.
104
+
105
+ #+begin_src ruby
106
+ client.sales_orders.list('COMPANY', '$top':2)
107
+ #+end_src
108
+
109
+ - ~$count~
110
+
111
+ The =$count= query option specifies whether a count of all records will be returned as part of the response feed, regardless of how many records are actually returned in the response.
112
+
113
+ - ~$filter~
114
+
115
+ The =$filter= query option specifies a set of criteria that records must satisfy before being returned, effectively allowing the caller to retrieve a subset of the resource collection based on a specified filter.
116
+ Expressions can reference properties as well as literals. Literal values can be strings enclosed in single quotes, dates, numbers, and boolean values.
117
+ The following is a list of the operators that are supported in the Sage 300 Web API:
118
+
119
+ | Operator | Description | Example |
120
+ |----------+-----------------------+--------------------------------------------------------------|
121
+ | eq | equal | '$filter':"City eq 'Miami'" |
122
+ | ne | not equal | '$filter':"City ne 'Miami'" |
123
+ | gt | greater than | '$filter':"NumberOfDaysToPay" gt 30" |
124
+ | lt | less than | '$filter':"AccountPastDue" lt 90" |
125
+ | le | less than or equal to | '$filter':"DateLastMaintained le datetime'2015-12-31T12:00'" |
126
+ | and | and | '$filter':"GroupCode eq 'EXPORT' and OnHold eq 'No’" |
127
+ | or | or | '$filter':"City eq 'Los Angeles' or City eq 'Miami'" |
128
+
129
+ *Combining query options*
130
+
131
+ #+begin_src ruby
132
+ client.customers.list('COMPANY', '$filter':"CustomerNumber eq '112321' and OrderType eq 'Active'", '$skip':5, '$top':2)
133
+ #+end_src
134
+
135
+ *** Account Receivable (AR)
136
+
137
+ **** Customers
138
+
139
+ #+begin_src ruby
140
+ client.customers.list('COMPANY')
141
+ client.customers.retreive('COMPANY', 'IDCUST')
142
+ client.customers.create('COMPANY', {})
143
+ client.customers.update('COMPANY', {})
144
+ client.customers.delete('COMPANY', 'IDCUST')
145
+ #+end_src
146
+
147
+ **** Customer Groups
148
+
149
+ #+begin_src ruby
150
+ client.customer_groups.list('COMPANY')
151
+ client.customer_groups.retreive('COMPANY', 'GROUPCODE')
152
+ client.customer_groups.create('COMPANY', {})
153
+ client.customer_groups.update('COMPANY', {})
154
+ client.customer_groups.delete('COMPANY', 'GROUPCODE')
155
+ #+end_src
156
+
157
+ **** Customer Terms
158
+
159
+ #+begin_src ruby
160
+ client.customer_terms.list('COMPANY')
161
+ client.customer_terms.retreive('COMPANY', 'TERMSCODE')
162
+ client.customer_terms.create('COMPANY', {})
163
+ client.customer_terms.update('COMPANY', {})
164
+ client.customer_terms.delete('COMPANY', 'TERMSCODE')
165
+ #+end_src
166
+
167
+ **** Sales Persons
168
+
169
+ #+begin_src ruby
170
+ client.sales_persons.list('COMPANY')
171
+ client.sales_persons.retreive('COMPANY', 'KEY')
172
+ client.sales_persons.create('COMPANY', {})
173
+ client.sales_persons.update('COMPANY', {})
174
+ client.sales_persons.delete('COMPANY', 'KEY')
175
+ client.sales_persons.statistics('COMPANY')
176
+ client.sales_persons.filter_stats('COMPANY', 'SALESPERSON', 'YEAR', 'PERIDO')
177
+ #+end_src
178
+
179
+ **** Account Sets
180
+
181
+ #+begin_src ruby
182
+ client.account_sets.list('COMPANY')
183
+ client.account_sets.retreive('COMPANY', 'KEY')
184
+ client.account_sets.create('COMPANY', {})
185
+ client.account_sets.update('COMPANY', {})
186
+ client.account_sets.delete('COMPANY', 'KEY')
187
+ #+end_src
188
+
189
+ *** Account Payable (AP)
190
+
191
+ **** Vendors
192
+
193
+ #+begin_src ruby
194
+ client.vendors.list('COMPANY')
195
+ client.vendors.retreive('COMPANY', 'VENDCODE')
196
+ client.vendors.create('COMPANY', {})
197
+ client.vendors.update('COMPANY', {})
198
+ client.vendors.delete('COMPANY', 'NUMBER')
199
+ client.vendors.statistics('COMPANY', 'VENDCODE')
200
+ #+end_src
201
+
202
+ **** Vendor Groups
203
+
204
+ #+begin_src ruby
205
+ client.vendor_groups.list('COMPANY')
206
+ client.vendor_groups.retreive('COMPANY', 'GROUPCODE')
207
+ client.vendor_groups.create('COMPANY', {})
208
+ client.vendor_groups.update('COMPANY', {})
209
+ client.vendor_groups.delete('COMPANY', 'GROUPCODE')
210
+ #+end_src
211
+
212
+ **** Vendor Terms
213
+
214
+ #+begin_src ruby
215
+ client.vendor_terms.list('COMPANY')
216
+ client.vendor_terms.retreive('COMPANY', 'TERMSCODE')
217
+ client.vendor_terms.create('COMPANY', {})
218
+ client.vendor_terms.update('COMPANY', {})
219
+ client.vendor_terms.delete('COMPANY', 'TERMSCODE')
220
+ #+end_src
221
+
222
+ *** Invenotry Control (IC)
223
+
224
+ **** Items
225
+
226
+ #+begin_src ruby
227
+ client.items.list('COMPANY')
228
+ client.items.retreive('COMPANY', 'ITEMNO')
229
+ client.items.create('COMPANY', {})
230
+ client.items.update('COMPANY', {})
231
+ client.items.delete('COMPANY', 'ITEMNO')
232
+ #+end_src
233
+
234
+ **** Categories
235
+
236
+ #+begin_src ruby
237
+ client.categories.list('COMPANY')
238
+ client.categories.retreive('COMPANY', 'CATEGORYCODE')
239
+ client.categories.create('COMPANY', {})
240
+ client.categories.update('COMPANY', {})
241
+ client.categories.delete('COMPANY', 'CATEGORYCODE')
242
+ #+end_src
243
+
244
+ **** Locations
245
+
246
+ #+begin_src ruby
247
+ client.locations.list('COMPANY')
248
+ client.locations.retreive('COMPANY', 'LOCATION')
249
+ client.locations.create('COMPANY', {})
250
+ client.locations.update('COMPANY', {})
251
+ client.locations.delete('COMPANY', 'LOCATION')
252
+ #+end_src
253
+
254
+ *** Order Entry (OE)
255
+
256
+ **** Sales Orders
257
+
258
+ #+begin_src ruby
259
+ client.sales_orders.list('COMPANY')
260
+ client.sales_orders.retreive('COMPANY', 'ORDERID')
261
+ client.sales_orders.create('COMPANY', {})
262
+ #+end_src
263
+
264
+ **** Invoices
265
+
266
+ #+begin_src ruby
267
+ client.invoices.list('COMPANY')
268
+ client.invoices.retreive('COMPANY', 'INVUNIQ')
269
+ #+end_src
270
+
271
+ **** Sales History
272
+
273
+ #+begin_src ruby
274
+ client.sales_history.list('COMPANY', {})
275
+ client.sales_history.details('COMPANY', {})
276
+ client.sales_history.stats('COMPANY', {})
277
+ #+end_src
278
+
279
+ **** Credit Notes
280
+
281
+ #+begin_src ruby
282
+ client.credit_notes.list('COMPANY', {})
283
+ client.credit_notes.retreive('COMPANY', 'CNUNIQ')
284
+ client.credit_notes.create('COMPANY', {})
285
+ #+end_src
286
+
287
+ *** Purchase Orders (PO)
288
+
289
+ **** Purchase Orders
290
+
291
+ #+begin_src ruby
292
+ client.purchase_orders.list('COMPANY')
293
+ client.purchase_orders.retreive('COMPANY', 'SECUENCEID')
294
+ client.purchase_orders.create('COMPANY', {})
295
+ #+end_src
296
+
297
+ **** Receipts
298
+
299
+ #+begin_src ruby
300
+ client.receipts.list('COMPANY')
301
+ client.receipts.retreive('COMPANY', 'SECUENCEID')
302
+ client.receipts.create('COMPANY', {})
303
+ #+end_src
304
+
305
+ **** Vendor Contract Costs
306
+
307
+ #+begin_src ruby
308
+ client.vendor_contract_costs.list('COMPANY')
309
+ client.vendor_contract_costs.retreive('COMPANY', 'ITEMNO', 'VENDCODE')
310
+ client.vendor_contract_costs.create('COMPANY', {})
311
+ client.vendor_contract_costs.update('COMPANY', 'ITEMNO', 'VENDCODE', {})
312
+ client.vendor_contract_costs.delete('COMPANY', 'ITEMNO', 'VENDCODE')
313
+ #+end_src
314
+
315
+ ** Performance tips
316
+ It is possible to adjust the performance of Sage 300 Web API if improvements are required for integration purposes.
317
+
318
+ *** Increase page size for requets
319
+ When large amounts of records need to be retrieved through Sage 300 Web API, the page size setting can be increased to reduce the number of GET requests and thus reduce the overall time for the entire process.
320
+
321
+ In order to increase the page size setting, you can use a text editor to open the =Web.config= file located in the =Online\WebApi= folder under your Sage 300 installation folder. Search for the line in this file that contains the following text:
322
+
323
+ #+begin_src xml
324
+ <add key="PageSize" value="100" />
325
+ #+end_src
326
+
327
+ Increase the value to the required page size. The recommended setting for large numbers of records is 1000.
328
+
329
+ *** Change IIS idle time
330
+ By default, IIS terminates a web application after 20 minutes of inactivity. This means that if Sage 300 Web API requests are not made within 20 minutes of one another, a request will take longer than usual to process. To curb this behavior, the IIS application pool Idle Time-out setting can be adjusted.
331
+
332
+ To increase the Time-out time and Time-out Action:
333
+ 1. Open IIS Manager
334
+ 2. In Application Pools, select Sage300 Pool.
335
+ 3. In the Actions pane, click Advanced Settings.
336
+ 4. In the Process Model section, change the Idle Time-out Action from Terminate to Suspend.
337
+ 5. The Idle Time-out time should be increased to a more reasonable amount. 1447 minutes is the recommended value, as it is greater than a single day.
338
+
339
+ ** Contributing
340
+
341
+ Everyone is encouraged to help improve this project. Bug reports and pull requests are welcome at [[https://github.com/lepepe/sagekit/pulls]].
342
+ Feel free to open an [[https://github.com/lepepe/sagekit/issues][issue]] to get feedback on your idea before spending too much time on it.
343
+
344
+ ** License
345
+
346
+ The gem is available as open source under the terms of the [[https://opensource.org/licenses/MIT][MIT License]].
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
data/bin/console ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "sagekit"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ # Only for test purpose!
15
+ client = Sagekit::Client.new(base_url: 'http://10.255.6.60/Sage300WebApi/v1.0/vertilux', auth: 'Basic QURNSU46Vlg2ODUwTUlBTUk=')
16
+
17
+ require "irb"
18
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here