sagekit 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e41f4e099bde651245639540edf15eb2258d9c08bb64cd8750bf0c9b5f34d735
4
- data.tar.gz: ec4fc63aeafbc85d3757ab4ce39c816f716988b327b466d2e54caa67efb1c5ae
3
+ metadata.gz: 17a9eb26d57913a0f890d45326f755cb6ae6fff5c9093999b92972fa2260c7eb
4
+ data.tar.gz: 76bfa5f78323048e16cc6870763824b77594baa6c9e80db9fd5db0a031630023
5
5
  SHA512:
6
- metadata.gz: f996b5ba6c86e129cdee8b1ab2376b0757c8f367b1c45a71dde94b24693eb4b2c8a6e120350f243c24297a309d7d96ddb4ac5b82385a45fe24a8651f23a4334f
7
- data.tar.gz: 4ae79babfb127596bb82d399dc47d2023342d97996faefa8a59440902e871dc464b34f64bc6d6a502850161b27023877802a50b8f14470c2dc64eba049aee99e
6
+ metadata.gz: c8ff6152d7fdd6228295aab8777e393496d81c335cc4e5f8bea9469213408fbe35b88d2327556c3d65629a4aeded8efc06f08c3ee183f13befbca26dd5c80fc3
7
+ data.tar.gz: c52a86f3e7afe726c8359637cba3d29c0c105a2ad96571ea308369cfb45bb640ca943ddb06c93c3af4a1de9dd54351ab9230ce714f4d7c674e9ad6b72dfd2bdc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
1
  ## 0.1.0 (2021-09-30)
2
2
 
3
3
  - First release
4
+
5
+ ## 0.1.1 (2021-10-05)
6
+
7
+ - Allow to create sales orders with json body
8
+
9
+ ## 0.1.2 (2021-10-14)
10
+
11
+ - Add collection rerouces for pagination
12
+ - Fixed IC Invoices endpoint
data/README.org CHANGED
@@ -112,6 +112,14 @@ To reduce the number of requests necessary for transferring large datasets, the
112
112
 
113
113
  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.
114
114
 
115
+ - ~$select~
116
+
117
+ The =$select= query option get records with a subset of properties to include in the response
118
+
119
+ #+begin_src ruby
120
+ client.sales_orders.list('COMPANY', '$select':'OrderNumber,CustomerNumber')
121
+ #+end_src
122
+
115
123
  - ~$filter~
116
124
 
117
125
  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.
@@ -142,7 +150,7 @@ client.customers.list('COMPANY', '$filter':"CustomerNumber eq '112321' and Order
142
150
  client.customers.list('COMPANY')
143
151
  client.customers.retreive('COMPANY', 'IDCUST')
144
152
  client.customers.create('COMPANY', {})
145
- client.customers.update('COMPANY', {})
153
+ client.customers.update('COMPANY', 'IDCUST', {})
146
154
  client.customers.delete('COMPANY', 'IDCUST')
147
155
  #+end_src
148
156
 
@@ -152,7 +160,7 @@ client.customers.delete('COMPANY', 'IDCUST')
152
160
  client.customer_groups.list('COMPANY')
153
161
  client.customer_groups.retreive('COMPANY', 'GROUPCODE')
154
162
  client.customer_groups.create('COMPANY', {})
155
- client.customer_groups.update('COMPANY', {})
163
+ client.customer_groups.update('COMPANY', 'GROUPCODE', {})
156
164
  client.customer_groups.delete('COMPANY', 'GROUPCODE')
157
165
  #+end_src
158
166
 
@@ -162,7 +170,7 @@ client.customer_groups.delete('COMPANY', 'GROUPCODE')
162
170
  client.customer_terms.list('COMPANY')
163
171
  client.customer_terms.retreive('COMPANY', 'TERMSCODE')
164
172
  client.customer_terms.create('COMPANY', {})
165
- client.customer_terms.update('COMPANY', {})
173
+ client.customer_terms.update('COMPANY', 'TERMSCODE', {})
166
174
  client.customer_terms.delete('COMPANY', 'TERMSCODE')
167
175
  #+end_src
168
176
 
@@ -172,7 +180,7 @@ client.customer_terms.delete('COMPANY', 'TERMSCODE')
172
180
  client.sales_persons.list('COMPANY')
173
181
  client.sales_persons.retreive('COMPANY', 'KEY')
174
182
  client.sales_persons.create('COMPANY', {})
175
- client.sales_persons.update('COMPANY', {})
183
+ client.sales_persons.update('COMPANY', 'KEY', {})
176
184
  client.sales_persons.delete('COMPANY', 'KEY')
177
185
  client.sales_persons.statistics('COMPANY')
178
186
  client.sales_persons.filter_stats('COMPANY', 'SALESPERSON', 'YEAR', 'PERIDO')
@@ -184,7 +192,7 @@ client.sales_persons.filter_stats('COMPANY', 'SALESPERSON', 'YEAR', 'PERIDO')
184
192
  client.account_sets.list('COMPANY')
185
193
  client.account_sets.retreive('COMPANY', 'KEY')
186
194
  client.account_sets.create('COMPANY', {})
187
- client.account_sets.update('COMPANY', {})
195
+ client.account_sets.update('COMPANY', 'KEY', {})
188
196
  client.account_sets.delete('COMPANY', 'KEY')
189
197
  #+end_src
190
198
 
@@ -196,8 +204,8 @@ client.account_sets.delete('COMPANY', 'KEY')
196
204
  client.vendors.list('COMPANY')
197
205
  client.vendors.retreive('COMPANY', 'VENDCODE')
198
206
  client.vendors.create('COMPANY', {})
199
- client.vendors.update('COMPANY', {})
200
- client.vendors.delete('COMPANY', 'NUMBER')
207
+ client.vendors.update('COMPANY', 'VENDCODE', {})
208
+ client.vendors.delete('COMPANY', 'VENDCODE')
201
209
  client.vendors.statistics('COMPANY', 'VENDCODE')
202
210
  #+end_src
203
211
 
@@ -207,7 +215,7 @@ client.vendors.statistics('COMPANY', 'VENDCODE')
207
215
  client.vendor_groups.list('COMPANY')
208
216
  client.vendor_groups.retreive('COMPANY', 'GROUPCODE')
209
217
  client.vendor_groups.create('COMPANY', {})
210
- client.vendor_groups.update('COMPANY', {})
218
+ client.vendor_groups.update('COMPANY', 'GROUPCODE', {})
211
219
  client.vendor_groups.delete('COMPANY', 'GROUPCODE')
212
220
  #+end_src
213
221
 
@@ -217,7 +225,7 @@ client.vendor_groups.delete('COMPANY', 'GROUPCODE')
217
225
  client.vendor_terms.list('COMPANY')
218
226
  client.vendor_terms.retreive('COMPANY', 'TERMSCODE')
219
227
  client.vendor_terms.create('COMPANY', {})
220
- client.vendor_terms.update('COMPANY', {})
228
+ client.vendor_terms.update('COMPANY', 'TERMSCODE', {})
221
229
  client.vendor_terms.delete('COMPANY', 'TERMSCODE')
222
230
  #+end_src
223
231
 
@@ -229,7 +237,7 @@ client.vendor_terms.delete('COMPANY', 'TERMSCODE')
229
237
  client.items.list('COMPANY')
230
238
  client.items.retreive('COMPANY', 'ITEMNO')
231
239
  client.items.create('COMPANY', {})
232
- client.items.update('COMPANY', {})
240
+ client.items.update('COMPANY', 'ITEMNO', {})
233
241
  client.items.delete('COMPANY', 'ITEMNO')
234
242
  #+end_src
235
243
 
@@ -237,10 +245,10 @@ client.items.delete('COMPANY', 'ITEMNO')
237
245
 
238
246
  #+begin_src ruby
239
247
  client.categories.list('COMPANY')
240
- client.categories.retreive('COMPANY', 'CATEGORYCODE')
248
+ client.categories.retreive('COMPANY', 'CATEGORY')
241
249
  client.categories.create('COMPANY', {})
242
- client.categories.update('COMPANY', {})
243
- client.categories.delete('COMPANY', 'CATEGORYCODE')
250
+ client.categories.update('COMPANY', 'CATEGORY', {})
251
+ client.categories.delete('COMPANY', 'CATEGORY')
244
252
  #+end_src
245
253
 
246
254
  **** Locations
@@ -249,7 +257,7 @@ client.categories.delete('COMPANY', 'CATEGORYCODE')
249
257
  client.locations.list('COMPANY')
250
258
  client.locations.retreive('COMPANY', 'LOCATION')
251
259
  client.locations.create('COMPANY', {})
252
- client.locations.update('COMPANY', {})
260
+ client.locations.update('COMPANY', 'LOCATION', {})
253
261
  client.locations.delete('COMPANY', 'LOCATION')
254
262
  #+end_src
255
263
 
data/docs/index.html CHANGED
@@ -3,7 +3,7 @@
3
3
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
4
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5
5
  <head>
6
- <!-- 2021-10-08 Fri 09:23 -->
6
+ <!-- 2021-10-14 Thu 11:37 -->
7
7
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
8
  <meta name="viewport" content="width=device-width, initial-scale=1" />
9
9
  <title>Sagekit</title>
@@ -208,60 +208,60 @@
208
208
  <h2>Table of Contents</h2>
209
209
  <div id="text-table-of-contents" role="doc-toc">
210
210
  <ul>
211
- <li><a href="#org440bdcf">Installation</a></li>
212
- <li><a href="#org7d1db6d">Usage</a></li>
213
- <li><a href="#orgb24a4f7">Resources</a>
211
+ <li><a href="#org0d66645">Installation</a></li>
212
+ <li><a href="#org42c4f7d">Usage</a></li>
213
+ <li><a href="#orgcf4a116">Resources</a>
214
214
  <ul>
215
- <li><a href="#org2664de8">Query options</a></li>
216
- <li><a href="#orgf3c2edb">Account Receivable (AR)</a>
215
+ <li><a href="#orgd4085cd">Query options</a></li>
216
+ <li><a href="#orgffb38b9">Account Receivable (AR)</a>
217
217
  <ul>
218
- <li><a href="#orgc7937bc">Customers</a></li>
219
- <li><a href="#org107fce5">Customer Groups</a></li>
220
- <li><a href="#org60d2c45">Customer Terms</a></li>
221
- <li><a href="#org8054856">Sales Persons</a></li>
222
- <li><a href="#org3516ea0">Account Sets</a></li>
218
+ <li><a href="#orgdfb1deb">Customers</a></li>
219
+ <li><a href="#org6b641f6">Customer Groups</a></li>
220
+ <li><a href="#org43e2b09">Customer Terms</a></li>
221
+ <li><a href="#org166be64">Sales Persons</a></li>
222
+ <li><a href="#orgb429d5a">Account Sets</a></li>
223
223
  </ul>
224
224
  </li>
225
- <li><a href="#orga609a19">Account Payable (AP)</a>
225
+ <li><a href="#orgc5c3b9c">Account Payable (AP)</a>
226
226
  <ul>
227
- <li><a href="#org7ba1865">Vendors</a></li>
228
- <li><a href="#orge2f01ca">Vendor Groups</a></li>
229
- <li><a href="#orgb2251dc">Vendor Terms</a></li>
227
+ <li><a href="#org90f80ac">Vendors</a></li>
228
+ <li><a href="#org3eca8ff">Vendor Groups</a></li>
229
+ <li><a href="#org5231aaa">Vendor Terms</a></li>
230
230
  </ul>
231
231
  </li>
232
- <li><a href="#orgcce1fbb">Invenotry Control (IC)</a>
232
+ <li><a href="#orgbe44e1e">Invenotry Control (IC)</a>
233
233
  <ul>
234
- <li><a href="#org7c68eea">Items</a></li>
235
- <li><a href="#orgea7f575">Categories</a></li>
236
- <li><a href="#org440c768">Locations</a></li>
234
+ <li><a href="#orga6d68d9">Items</a></li>
235
+ <li><a href="#orgc83934e">Categories</a></li>
236
+ <li><a href="#org466cade">Locations</a></li>
237
237
  </ul>
238
238
  </li>
239
- <li><a href="#orgd76b214">Order Entry (OE)</a>
239
+ <li><a href="#orgb1ade6b">Order Entry (OE)</a>
240
240
  <ul>
241
- <li><a href="#org62bd88f">Sales Orders</a></li>
242
- <li><a href="#org9382b9a">Invoices</a></li>
243
- <li><a href="#orga0f291b">Sales History</a></li>
244
- <li><a href="#org71b8e95">Credit Notes</a></li>
241
+ <li><a href="#orgfb7e454">Sales Orders</a></li>
242
+ <li><a href="#orgd46f9c1">Invoices</a></li>
243
+ <li><a href="#orgfce5f99">Sales History</a></li>
244
+ <li><a href="#orga1d9486">Credit Notes</a></li>
245
245
  </ul>
246
246
  </li>
247
- <li><a href="#orge6526fa">Purchase Orders (PO)</a>
247
+ <li><a href="#org697354c">Purchase Orders (PO)</a>
248
248
  <ul>
249
- <li><a href="#org973ebd4">Purchase Orders</a></li>
250
- <li><a href="#orgb86f2aa">Receipts</a></li>
251
- <li><a href="#orgc4ccb79">Vendor Contract Costs</a></li>
249
+ <li><a href="#org3dca9f4">Purchase Orders</a></li>
250
+ <li><a href="#org3e9f005">Receipts</a></li>
251
+ <li><a href="#org139f4eb">Vendor Contract Costs</a></li>
252
252
  </ul>
253
253
  </li>
254
254
  </ul>
255
255
  </li>
256
- <li><a href="#orgd9473be">Performance tips</a>
256
+ <li><a href="#org18b47f0">Performance tips</a>
257
257
  <ul>
258
- <li><a href="#orgf8a818f">Increase page size for requets</a></li>
259
- <li><a href="#orgbbf1ff3">Change IIS idle time</a></li>
258
+ <li><a href="#org9c391a3">Increase page size for requets</a></li>
259
+ <li><a href="#orgd5c088a">Change IIS idle time</a></li>
260
260
  </ul>
261
261
  </li>
262
- <li><a href="#orge95b8c1">Contributing</a></li>
263
- <li><a href="#org9fc6187">License</a></li>
264
- <li><a href="#org41d5974"><span class="todo TODO">TODO</span> Sagekit todo list.</a></li>
262
+ <li><a href="#orge1c47bd">Contributing</a></li>
263
+ <li><a href="#org5d9e313">License</a></li>
264
+ <li><a href="#org035e16b"><span class="todo TODO">TODO</span> Sagekit todo list.</a></li>
265
265
  </ul>
266
266
  </div>
267
267
  </div>
@@ -270,7 +270,7 @@ Sagekit is a ruby gem client library to talk with Sage300 API.
270
270
  </p>
271
271
 
272
272
 
273
- <div id="orgd43e6b6" class="figure">
273
+ <div id="org2597773" class="figure">
274
274
  <p><img src="https://badge.fury.io/rb/sagekit.svg" alt="sagekit.svg" />
275
275
  </p>
276
276
  </div>
@@ -284,9 +284,9 @@ Responses are created as objects like. They&rsquo;re built using OpenStruct so y
284
284
  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.
285
285
  </p>
286
286
 
287
- <div id="outline-container-org440bdcf" class="outline-2">
288
- <h2 id="org440bdcf">Installation</h2>
289
- <div class="outline-text-2" id="text-org440bdcf">
287
+ <div id="outline-container-org0d66645" class="outline-2">
288
+ <h2 id="org0d66645">Installation</h2>
289
+ <div class="outline-text-2" id="text-org0d66645">
290
290
  <p>
291
291
  Add this line to your application&rsquo;s Gemfile:
292
292
  </p>
@@ -316,9 +316,9 @@ Or install it yourself as:
316
316
  </div>
317
317
  </div>
318
318
 
319
- <div id="outline-container-org7d1db6d" class="outline-2">
320
- <h2 id="org7d1db6d">Usage</h2>
321
- <div class="outline-text-2" id="text-org7d1db6d">
319
+ <div id="outline-container-org42c4f7d" class="outline-2">
320
+ <h2 id="org42c4f7d">Usage</h2>
321
+ <div class="outline-text-2" id="text-org42c4f7d">
322
322
  <p>
323
323
  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 &amp; this is the reason we will always suggest to go for web service integration, whenever any customer requires integration.
324
324
  </p>
@@ -416,9 +416,9 @@ Authorization: Basic QURNSU46QURNSU4=
416
416
  </div>
417
417
  </div>
418
418
 
419
- <div id="outline-container-orgb24a4f7" class="outline-2">
420
- <h2 id="orgb24a4f7">Resources</h2>
421
- <div class="outline-text-2" id="text-orgb24a4f7">
419
+ <div id="outline-container-orgcf4a116" class="outline-2">
420
+ <h2 id="orgcf4a116">Resources</h2>
421
+ <div class="outline-text-2" id="text-orgcf4a116">
422
422
  <p>
423
423
  The simplest way to retrieve records of a particular resource is to call a GET (list object).
424
424
  </p>
@@ -437,9 +437,9 @@ To reduce the number of requests necessary for transferring large datasets, the
437
437
  </p>
438
438
  </div>
439
439
 
440
- <div id="outline-container-org2664de8" class="outline-3">
441
- <h3 id="org2664de8">Query options</h3>
442
- <div class="outline-text-3" id="text-org2664de8">
440
+ <div id="outline-container-orgd4085cd" class="outline-3">
441
+ <h3 id="orgd4085cd">Query options</h3>
442
+ <div class="outline-text-3" id="text-orgd4085cd">
443
443
  <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
444
444
 
445
445
 
@@ -517,6 +517,19 @@ The <code>$top</code> query option must a positive integer N that specifies the
517
517
  The <code>$count</code> 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.
518
518
  </p></li>
519
519
 
520
+ <li><p>
521
+ <code>$select</code>
522
+ </p>
523
+
524
+ <p>
525
+ The <code>$select</code> query option get records with a subset of properties to include in the response
526
+ </p>
527
+
528
+ <div class="org-src-container">
529
+ <pre class="src src-ruby"> client.sales_orders.list(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'$select'</span>:<span style="color: #f1fa8c;">'OrderNumber,CustomerNumber'</span>)
530
+ </pre>
531
+ </div></li>
532
+
520
533
  <li><p>
521
534
  <code>$filter</code>
522
535
  </p>
@@ -601,60 +614,60 @@ The following is a list of the operators that are supported in the Sage 300 Web
601
614
  </div>
602
615
  </div>
603
616
 
604
- <div id="outline-container-orgf3c2edb" class="outline-3">
605
- <h3 id="orgf3c2edb">Account Receivable (AR)</h3>
606
- <div class="outline-text-3" id="text-orgf3c2edb">
617
+ <div id="outline-container-orgffb38b9" class="outline-3">
618
+ <h3 id="orgffb38b9">Account Receivable (AR)</h3>
619
+ <div class="outline-text-3" id="text-orgffb38b9">
607
620
  </div>
608
- <div id="outline-container-orgc7937bc" class="outline-4">
609
- <h4 id="orgc7937bc">Customers</h4>
610
- <div class="outline-text-4" id="text-orgc7937bc">
621
+ <div id="outline-container-orgdfb1deb" class="outline-4">
622
+ <h4 id="orgdfb1deb">Customers</h4>
623
+ <div class="outline-text-4" id="text-orgdfb1deb">
611
624
  <div class="org-src-container">
612
625
  <pre class="src src-ruby">client.customers.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
613
626
  client.customers.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'IDCUST'</span>)
614
627
  client.customers.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
615
- client.customers.update(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
628
+ client.customers.update(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'IDCUST'</span>, {})
616
629
  client.customers.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'IDCUST'</span>)
617
630
  </pre>
618
631
  </div>
619
632
  </div>
620
633
  </div>
621
634
 
622
- <div id="outline-container-org107fce5" class="outline-4">
623
- <h4 id="org107fce5">Customer Groups</h4>
624
- <div class="outline-text-4" id="text-org107fce5">
635
+ <div id="outline-container-org6b641f6" class="outline-4">
636
+ <h4 id="org6b641f6">Customer Groups</h4>
637
+ <div class="outline-text-4" id="text-org6b641f6">
625
638
  <div class="org-src-container">
626
639
  <pre class="src src-ruby">client.customer_groups.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
627
640
  client.customer_groups.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'GROUPCODE'</span>)
628
641
  client.customer_groups.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
629
- client.customer_groups.update(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
642
+ client.customer_groups.update(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'GROUPCODE'</span>, {})
630
643
  client.customer_groups.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'GROUPCODE'</span>)
631
644
  </pre>
632
645
  </div>
633
646
  </div>
634
647
  </div>
635
648
 
636
- <div id="outline-container-org60d2c45" class="outline-4">
637
- <h4 id="org60d2c45">Customer Terms</h4>
638
- <div class="outline-text-4" id="text-org60d2c45">
649
+ <div id="outline-container-org43e2b09" class="outline-4">
650
+ <h4 id="org43e2b09">Customer Terms</h4>
651
+ <div class="outline-text-4" id="text-org43e2b09">
639
652
  <div class="org-src-container">
640
653
  <pre class="src src-ruby">client.customer_terms.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
641
654
  client.customer_terms.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'TERMSCODE'</span>)
642
655
  client.customer_terms.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
643
- client.customer_terms.update(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
656
+ client.customer_terms.update(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'TERMSCODE'</span>, {})
644
657
  client.customer_terms.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'TERMSCODE'</span>)
645
658
  </pre>
646
659
  </div>
647
660
  </div>
648
661
  </div>
649
662
 
650
- <div id="outline-container-org8054856" class="outline-4">
651
- <h4 id="org8054856">Sales Persons</h4>
652
- <div class="outline-text-4" id="text-org8054856">
663
+ <div id="outline-container-org166be64" class="outline-4">
664
+ <h4 id="org166be64">Sales Persons</h4>
665
+ <div class="outline-text-4" id="text-org166be64">
653
666
  <div class="org-src-container">
654
667
  <pre class="src src-ruby">client.sales_persons.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
655
668
  client.sales_persons.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'KEY'</span>)
656
669
  client.sales_persons.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
657
- client.sales_persons.update(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
670
+ client.sales_persons.update(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'KEY'</span>, {})
658
671
  client.sales_persons.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'KEY'</span>)
659
672
  client.sales_persons.statistics(<span style="color: #f1fa8c;">'COMPANY'</span>)
660
673
  client.sales_persons.filter_stats(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'SALESPERSON'</span>, <span style="color: #f1fa8c;">'YEAR'</span>, <span style="color: #f1fa8c;">'PERIDO'</span>)
@@ -663,14 +676,14 @@ client.sales_persons.filter_stats(<span style="color: #f1fa8c;">'COMPANY'</span>
663
676
  </div>
664
677
  </div>
665
678
 
666
- <div id="outline-container-org3516ea0" class="outline-4">
667
- <h4 id="org3516ea0">Account Sets</h4>
668
- <div class="outline-text-4" id="text-org3516ea0">
679
+ <div id="outline-container-orgb429d5a" class="outline-4">
680
+ <h4 id="orgb429d5a">Account Sets</h4>
681
+ <div class="outline-text-4" id="text-orgb429d5a">
669
682
  <div class="org-src-container">
670
683
  <pre class="src src-ruby">client.account_sets.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
671
684
  client.account_sets.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'KEY'</span>)
672
685
  client.account_sets.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
673
- client.account_sets.update(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
686
+ client.account_sets.update(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'KEY'</span>, {})
674
687
  client.account_sets.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'KEY'</span>)
675
688
  </pre>
676
689
  </div>
@@ -678,47 +691,47 @@ client.account_sets.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span
678
691
  </div>
679
692
  </div>
680
693
 
681
- <div id="outline-container-orga609a19" class="outline-3">
682
- <h3 id="orga609a19">Account Payable (AP)</h3>
683
- <div class="outline-text-3" id="text-orga609a19">
694
+ <div id="outline-container-orgc5c3b9c" class="outline-3">
695
+ <h3 id="orgc5c3b9c">Account Payable (AP)</h3>
696
+ <div class="outline-text-3" id="text-orgc5c3b9c">
684
697
  </div>
685
- <div id="outline-container-org7ba1865" class="outline-4">
686
- <h4 id="org7ba1865">Vendors</h4>
687
- <div class="outline-text-4" id="text-org7ba1865">
698
+ <div id="outline-container-org90f80ac" class="outline-4">
699
+ <h4 id="org90f80ac">Vendors</h4>
700
+ <div class="outline-text-4" id="text-org90f80ac">
688
701
  <div class="org-src-container">
689
702
  <pre class="src src-ruby">client.vendors.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
690
703
  client.vendors.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'VENDCODE'</span>)
691
704
  client.vendors.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
692
- client.vendors.update(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
693
- client.vendors.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'NUMBER'</span>)
705
+ client.vendors.update(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'VENDCODE'</span>, {})
706
+ client.vendors.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'VENDCODE'</span>)
694
707
  client.vendors.statistics(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'VENDCODE'</span>)
695
708
  </pre>
696
709
  </div>
697
710
  </div>
698
711
  </div>
699
712
 
700
- <div id="outline-container-orge2f01ca" class="outline-4">
701
- <h4 id="orge2f01ca">Vendor Groups</h4>
702
- <div class="outline-text-4" id="text-orge2f01ca">
713
+ <div id="outline-container-org3eca8ff" class="outline-4">
714
+ <h4 id="org3eca8ff">Vendor Groups</h4>
715
+ <div class="outline-text-4" id="text-org3eca8ff">
703
716
  <div class="org-src-container">
704
717
  <pre class="src src-ruby">client.vendor_groups.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
705
718
  client.vendor_groups.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'GROUPCODE'</span>)
706
719
  client.vendor_groups.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
707
- client.vendor_groups.update(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
720
+ client.vendor_groups.update(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'GROUPCODE'</span>, {})
708
721
  client.vendor_groups.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'GROUPCODE'</span>)
709
722
  </pre>
710
723
  </div>
711
724
  </div>
712
725
  </div>
713
726
 
714
- <div id="outline-container-orgb2251dc" class="outline-4">
715
- <h4 id="orgb2251dc">Vendor Terms</h4>
716
- <div class="outline-text-4" id="text-orgb2251dc">
727
+ <div id="outline-container-org5231aaa" class="outline-4">
728
+ <h4 id="org5231aaa">Vendor Terms</h4>
729
+ <div class="outline-text-4" id="text-org5231aaa">
717
730
  <div class="org-src-container">
718
731
  <pre class="src src-ruby">client.vendor_terms.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
719
732
  client.vendor_terms.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'TERMSCODE'</span>)
720
733
  client.vendor_terms.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
721
- client.vendor_terms.update(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
734
+ client.vendor_terms.update(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'TERMSCODE'</span>, {})
722
735
  client.vendor_terms.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'TERMSCODE'</span>)
723
736
  </pre>
724
737
  </div>
@@ -726,46 +739,46 @@ client.vendor_terms.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span
726
739
  </div>
727
740
  </div>
728
741
 
729
- <div id="outline-container-orgcce1fbb" class="outline-3">
730
- <h3 id="orgcce1fbb">Invenotry Control (IC)</h3>
731
- <div class="outline-text-3" id="text-orgcce1fbb">
742
+ <div id="outline-container-orgbe44e1e" class="outline-3">
743
+ <h3 id="orgbe44e1e">Invenotry Control (IC)</h3>
744
+ <div class="outline-text-3" id="text-orgbe44e1e">
732
745
  </div>
733
- <div id="outline-container-org7c68eea" class="outline-4">
734
- <h4 id="org7c68eea">Items</h4>
735
- <div class="outline-text-4" id="text-org7c68eea">
746
+ <div id="outline-container-orga6d68d9" class="outline-4">
747
+ <h4 id="orga6d68d9">Items</h4>
748
+ <div class="outline-text-4" id="text-orga6d68d9">
736
749
  <div class="org-src-container">
737
750
  <pre class="src src-ruby">client.items.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
738
751
  client.items.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'ITEMNO'</span>)
739
752
  client.items.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
740
- client.items.update(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
753
+ client.items.update(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'ITEMNO'</span>, {})
741
754
  client.items.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'ITEMNO'</span>)
742
755
  </pre>
743
756
  </div>
744
757
  </div>
745
758
  </div>
746
759
 
747
- <div id="outline-container-orgea7f575" class="outline-4">
748
- <h4 id="orgea7f575">Categories</h4>
749
- <div class="outline-text-4" id="text-orgea7f575">
760
+ <div id="outline-container-orgc83934e" class="outline-4">
761
+ <h4 id="orgc83934e">Categories</h4>
762
+ <div class="outline-text-4" id="text-orgc83934e">
750
763
  <div class="org-src-container">
751
764
  <pre class="src src-ruby">client.categories.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
752
- client.categories.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'CATEGORYCODE'</span>)
765
+ client.categories.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'CATEGORY'</span>)
753
766
  client.categories.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
754
- client.categories.update(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
755
- client.categories.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'CATEGORYCODE'</span>)
767
+ client.categories.update(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'CATEGORY'</span>, {})
768
+ client.categories.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'CATEGORY'</span>)
756
769
  </pre>
757
770
  </div>
758
771
  </div>
759
772
  </div>
760
773
 
761
- <div id="outline-container-org440c768" class="outline-4">
762
- <h4 id="org440c768">Locations</h4>
763
- <div class="outline-text-4" id="text-org440c768">
774
+ <div id="outline-container-org466cade" class="outline-4">
775
+ <h4 id="org466cade">Locations</h4>
776
+ <div class="outline-text-4" id="text-org466cade">
764
777
  <div class="org-src-container">
765
778
  <pre class="src src-ruby">client.locations.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
766
779
  client.locations.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'LOCATION'</span>)
767
780
  client.locations.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
768
- client.locations.update(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
781
+ client.locations.update(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'LOCATION'</span>, {})
769
782
  client.locations.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'LOCATION'</span>)
770
783
  </pre>
771
784
  </div>
@@ -773,13 +786,13 @@ client.locations.delete(<span style="color: #f1fa8c;">'COMPANY'</span>, <span st
773
786
  </div>
774
787
  </div>
775
788
 
776
- <div id="outline-container-orgd76b214" class="outline-3">
777
- <h3 id="orgd76b214">Order Entry (OE)</h3>
778
- <div class="outline-text-3" id="text-orgd76b214">
789
+ <div id="outline-container-orgb1ade6b" class="outline-3">
790
+ <h3 id="orgb1ade6b">Order Entry (OE)</h3>
791
+ <div class="outline-text-3" id="text-orgb1ade6b">
779
792
  </div>
780
- <div id="outline-container-org62bd88f" class="outline-4">
781
- <h4 id="org62bd88f">Sales Orders</h4>
782
- <div class="outline-text-4" id="text-org62bd88f">
793
+ <div id="outline-container-orgfb7e454" class="outline-4">
794
+ <h4 id="orgfb7e454">Sales Orders</h4>
795
+ <div class="outline-text-4" id="text-orgfb7e454">
783
796
  <div class="org-src-container">
784
797
  <pre class="src src-ruby">client.sales_orders.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
785
798
  client.sales_orders.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'ORDERID'</span>)
@@ -797,9 +810,9 @@ Create sales order passing json payload instead of ruby atributes.
797
810
  </div>
798
811
  </div>
799
812
 
800
- <div id="outline-container-org9382b9a" class="outline-4">
801
- <h4 id="org9382b9a">Invoices</h4>
802
- <div class="outline-text-4" id="text-org9382b9a">
813
+ <div id="outline-container-orgd46f9c1" class="outline-4">
814
+ <h4 id="orgd46f9c1">Invoices</h4>
815
+ <div class="outline-text-4" id="text-orgd46f9c1">
803
816
  <div class="org-src-container">
804
817
  <pre class="src src-ruby">client.invoices.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
805
818
  client.invoices.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'INVUNIQ'</span>)
@@ -808,9 +821,9 @@ client.invoices.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span s
808
821
  </div>
809
822
  </div>
810
823
 
811
- <div id="outline-container-orga0f291b" class="outline-4">
812
- <h4 id="orga0f291b">Sales History</h4>
813
- <div class="outline-text-4" id="text-orga0f291b">
824
+ <div id="outline-container-orgfce5f99" class="outline-4">
825
+ <h4 id="orgfce5f99">Sales History</h4>
826
+ <div class="outline-text-4" id="text-orgfce5f99">
814
827
  <div class="org-src-container">
815
828
  <pre class="src src-ruby">client.sales_history.list(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
816
829
  client.sales_history.details(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
@@ -820,9 +833,9 @@ client.sales_history.stats(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
820
833
  </div>
821
834
  </div>
822
835
 
823
- <div id="outline-container-org71b8e95" class="outline-4">
824
- <h4 id="org71b8e95">Credit Notes</h4>
825
- <div class="outline-text-4" id="text-org71b8e95">
836
+ <div id="outline-container-orga1d9486" class="outline-4">
837
+ <h4 id="orga1d9486">Credit Notes</h4>
838
+ <div class="outline-text-4" id="text-orga1d9486">
826
839
  <div class="org-src-container">
827
840
  <pre class="src src-ruby">client.credit_notes.list(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
828
841
  client.credit_notes.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'CNUNIQ'</span>)
@@ -833,13 +846,13 @@ client.credit_notes.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
833
846
  </div>
834
847
  </div>
835
848
 
836
- <div id="outline-container-orge6526fa" class="outline-3">
837
- <h3 id="orge6526fa">Purchase Orders (PO)</h3>
838
- <div class="outline-text-3" id="text-orge6526fa">
849
+ <div id="outline-container-org697354c" class="outline-3">
850
+ <h3 id="org697354c">Purchase Orders (PO)</h3>
851
+ <div class="outline-text-3" id="text-org697354c">
839
852
  </div>
840
- <div id="outline-container-org973ebd4" class="outline-4">
841
- <h4 id="org973ebd4">Purchase Orders</h4>
842
- <div class="outline-text-4" id="text-org973ebd4">
853
+ <div id="outline-container-org3dca9f4" class="outline-4">
854
+ <h4 id="org3dca9f4">Purchase Orders</h4>
855
+ <div class="outline-text-4" id="text-org3dca9f4">
843
856
  <div class="org-src-container">
844
857
  <pre class="src src-ruby">client.purchase_orders.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
845
858
  client.purchase_orders.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'SECUENCEID'</span>)
@@ -849,9 +862,9 @@ client.purchase_orders.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {}
849
862
  </div>
850
863
  </div>
851
864
 
852
- <div id="outline-container-orgb86f2aa" class="outline-4">
853
- <h4 id="orgb86f2aa">Receipts</h4>
854
- <div class="outline-text-4" id="text-orgb86f2aa">
865
+ <div id="outline-container-org3e9f005" class="outline-4">
866
+ <h4 id="org3e9f005">Receipts</h4>
867
+ <div class="outline-text-4" id="text-org3e9f005">
855
868
  <div class="org-src-container">
856
869
  <pre class="src src-ruby">client.receipts.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
857
870
  client.receipts.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'SECUENCEID'</span>)
@@ -861,9 +874,9 @@ client.receipts.create(<span style="color: #f1fa8c;">'COMPANY'</span>, {})
861
874
  </div>
862
875
  </div>
863
876
 
864
- <div id="outline-container-orgc4ccb79" class="outline-4">
865
- <h4 id="orgc4ccb79">Vendor Contract Costs</h4>
866
- <div class="outline-text-4" id="text-orgc4ccb79">
877
+ <div id="outline-container-org139f4eb" class="outline-4">
878
+ <h4 id="org139f4eb">Vendor Contract Costs</h4>
879
+ <div class="outline-text-4" id="text-org139f4eb">
867
880
  <div class="org-src-container">
868
881
  <pre class="src src-ruby">client.vendor_contract_costs.list(<span style="color: #f1fa8c;">'COMPANY'</span>)
869
882
  client.vendor_contract_costs.retreive(<span style="color: #f1fa8c;">'COMPANY'</span>, <span style="color: #f1fa8c;">'ITEMNO'</span>, <span style="color: #f1fa8c;">'VENDCODE'</span>)
@@ -877,17 +890,17 @@ client.vendor_contract_costs.delete(<span style="color: #f1fa8c;">'COMPANY'</spa
877
890
  </div>
878
891
  </div>
879
892
 
880
- <div id="outline-container-orgd9473be" class="outline-2">
881
- <h2 id="orgd9473be">Performance tips</h2>
882
- <div class="outline-text-2" id="text-orgd9473be">
893
+ <div id="outline-container-org18b47f0" class="outline-2">
894
+ <h2 id="org18b47f0">Performance tips</h2>
895
+ <div class="outline-text-2" id="text-org18b47f0">
883
896
  <p>
884
897
  It is possible to adjust the performance of Sage 300 Web API if improvements are required for integration purposes.
885
898
  </p>
886
899
  </div>
887
900
 
888
- <div id="outline-container-orgf8a818f" class="outline-3">
889
- <h3 id="orgf8a818f">Increase page size for requets</h3>
890
- <div class="outline-text-3" id="text-orgf8a818f">
901
+ <div id="outline-container-org9c391a3" class="outline-3">
902
+ <h3 id="org9c391a3">Increase page size for requets</h3>
903
+ <div class="outline-text-3" id="text-org9c391a3">
891
904
  <p>
892
905
  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.
893
906
  </p>
@@ -907,9 +920,9 @@ Increase the value to the required page size. The recommended setting for large
907
920
  </div>
908
921
  </div>
909
922
 
910
- <div id="outline-container-orgbbf1ff3" class="outline-3">
911
- <h3 id="orgbbf1ff3">Change IIS idle time</h3>
912
- <div class="outline-text-3" id="text-orgbbf1ff3">
923
+ <div id="outline-container-orgd5c088a" class="outline-3">
924
+ <h3 id="orgd5c088a">Change IIS idle time</h3>
925
+ <div class="outline-text-3" id="text-orgd5c088a">
913
926
  <p>
914
927
  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.
915
928
  </p>
@@ -928,9 +941,9 @@ To increase the Time-out time and Time-out Action:
928
941
  </div>
929
942
  </div>
930
943
 
931
- <div id="outline-container-orge95b8c1" class="outline-2">
932
- <h2 id="orge95b8c1">Contributing</h2>
933
- <div class="outline-text-2" id="text-orge95b8c1">
944
+ <div id="outline-container-orge1c47bd" class="outline-2">
945
+ <h2 id="orge1c47bd">Contributing</h2>
946
+ <div class="outline-text-2" id="text-orge1c47bd">
934
947
  <p>
935
948
  Everyone is encouraged to help improve this project. Bug reports and pull requests are welcome at <a href="https://github.com/lepepe/sagekit/pulls">https://github.com/lepepe/sagekit/pulls</a>.
936
949
  Feel free to open an <a href="https://github.com/lepepe/sagekit/issues">issue</a> to get feedback on your idea before spending too much time on it.
@@ -938,18 +951,18 @@ Feel free to open an <a href="https://github.com/lepepe/sagekit/issues">issue</a
938
951
  </div>
939
952
  </div>
940
953
 
941
- <div id="outline-container-org9fc6187" class="outline-2">
942
- <h2 id="org9fc6187">License</h2>
943
- <div class="outline-text-2" id="text-org9fc6187">
954
+ <div id="outline-container-org5d9e313" class="outline-2">
955
+ <h2 id="org5d9e313">License</h2>
956
+ <div class="outline-text-2" id="text-org5d9e313">
944
957
  <p>
945
958
  The gem is available as open source under the terms of the <a href="https://opensource.org/licenses/MIT">MIT License</a>.
946
959
  </p>
947
960
  </div>
948
961
  </div>
949
962
 
950
- <div id="outline-container-org41d5974" class="outline-2">
951
- <h2 id="org41d5974"><span class="todo TODO">TODO</span> Sagekit todo list.</h2>
952
- <div class="outline-text-2" id="text-org41d5974">
963
+ <div id="outline-container-org035e16b" class="outline-2">
964
+ <h2 id="org035e16b"><span class="todo TODO">TODO</span> Sagekit todo list.</h2>
965
+ <div class="outline-text-2" id="text-org035e16b">
953
966
  <ul class="org-ul">
954
967
  <li class="off"><code>[&#xa0;]</code> Testing API requests</li>
955
968
  <li class="off"><code>[&#xa0;]</code> Add endpoints for:
@@ -964,7 +977,7 @@ The gem is available as open source under the terms of the <a href="https://open
964
977
  </div>
965
978
  <div id="postamble" class="status">
966
979
  <p class="author">Author: Jose Perez</p>
967
- <p class="date">Created: 2021-10-08 Fri 09:23</p>
980
+ <p class="date">Created: 2021-10-14 Thu 11:37</p>
968
981
  </div>
969
982
  </body>
970
983
  </html>
@@ -0,0 +1,20 @@
1
+ module Sagekit
2
+ class Collection
3
+ attr_reader :data, :total, :per_page
4
+
5
+ def self.from_response(response, type:)
6
+ body = response.body
7
+ new(
8
+ data: body["value"].map{ |attrs| type.new(attrs) },
9
+ total: body.dig("@odata.count"),
10
+ per_page: body["value"].count
11
+ )
12
+ end
13
+
14
+ def initialize(data:, total:, per_page:)
15
+ @data = data
16
+ @total = total
17
+ @per_page = per_page
18
+ end
19
+ end
20
+ end
@@ -40,6 +40,8 @@ module Sagekit
40
40
  raise Error, "#{response.body}"
41
41
  when 404
42
42
  raise Error, "#{response.body}"
43
+ when 409
44
+ raise Error, "#{response.body}"
43
45
  when 429
44
46
  raise Error, "#{response.body}"
45
47
  when 500
@@ -2,7 +2,7 @@ module Sagekit
2
2
  class AccountSetsResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- AccountSet.new get_request("#{company}/AR/ARAccountSets", params: params).body
5
+ Collection.from_response get_request("#{company}/AR/ARAccountSets?$count=true", params: params), type: AccountSet
6
6
  end
7
7
 
8
8
  def retreive(company, id, **params)
@@ -2,15 +2,15 @@ module Sagekit
2
2
  class CategoriesResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- Category.new get_request("#{company}/IC/ICCategories", params: params).body
5
+ Collection.from_response get_request("#{company}/IC/ICCategories?$count=true", params: params), type: Category
6
6
  end
7
7
 
8
8
  def retreive(company, cat_id, **params)
9
- Category.new get_request("#{company}/IC/ICCategories('#{cat_id}')", params: params).body
9
+ Category.new get_request("#{company}/IC/ICCategories('#{cat_id}')", params: params).body
10
10
  end
11
11
 
12
12
  def create(company, **attributes)
13
- Category.new post_request("#{company}/IC/ICCategories", body: attributes).body
13
+ Category.new post_request("#{company}/IC/ICCategories", body: attributes).body
14
14
  end
15
15
 
16
16
  def update(company, cat_id, **attributes)
@@ -2,7 +2,7 @@ module Sagekit
2
2
  class CreditNotesResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- CreditNote.new get_request("#{company}/OE/OECreditDebitNotes", params: params).body
5
+ Collection.from_response get_request("#{company}/OE/OECreditDebitNotes?$count=true", params: params), type: CreditNote
6
6
  end
7
7
 
8
8
  def retreive(company, id, **params)
@@ -2,7 +2,7 @@ module Sagekit
2
2
  class CustomerGroupsResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- Customer.new get_request("#{company}/AR/ARCustomerGroups", params: params).body
5
+ Collection.from_response get_request("#{company}/AR/ARCustomerGroups?$count=true", params: params), type: Customer
6
6
  end
7
7
 
8
8
  def retreive(company, id, **params)
@@ -2,7 +2,7 @@ module Sagekit
2
2
  class CustomersResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- Customer.new get_request("#{company}/AR/ARCustomers", params: params).body
5
+ Collection.from_response get_request("#{company}/AR/ARCustomers?$count=true", params: params), type: Customer
6
6
  end
7
7
 
8
8
  def retreive(company, customer_id, **params)
@@ -2,11 +2,11 @@ module Sagekit
2
2
  class InvoicesResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- Invoice.new get_request("#{company}/OE/OEOrders", params: params).body
5
+ Collection.from_response get_request("#{company}/OE/OEInvoices?$count=true", params: params), type: Invoice
6
6
  end
7
7
 
8
8
  def retreive(invoice_id, **params)
9
- Invoice.new get_request("#{company}/OE/OEOrders(#{order_id})", params: params).body
9
+ Invoice.new get_request("#{company}/OE/OEInvoices(#{invoice_id})", params: params).body
10
10
  end
11
11
  end
12
12
  end
@@ -2,15 +2,15 @@ module Sagekit
2
2
  class ItemsResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- Item.new get_request("#{company}/IC/ICItems", params: params).body
5
+ Collection.from_response get_request("#{company}/IC/ICItems?$count=true", params: params), type: Item
6
6
  end
7
7
 
8
8
  def retreive(company, item_id, **params)
9
- Item.new get_request("#{company}/IC/ICItems('#{item_id}')", params: params).body
9
+ Item.new get_request("#{company}/IC/ICItems('#{item_id}')", params: params).body
10
10
  end
11
11
 
12
12
  def create(company, **attributes)
13
- Item.new post_request("#{company}/IC/ICItems", body: attributes).body
13
+ Item.new post_request("#{company}/IC/ICItems", body: attributes).body
14
14
  end
15
15
 
16
16
  def update(company, item_id, **attributes)
@@ -2,15 +2,15 @@ module Sagekit
2
2
  class LocationsResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- Location.new get_request("#{company}/IC/ICLocations", params: params).body
5
+ Collection.from_response get_request("#{company}/IC/ICLocations?$count=true", params: params), type: Item
6
6
  end
7
7
 
8
8
  def retreive(company, location_id, **params)
9
- Location.new get_request("#{company}/IC/ICLocations('#{locations_id}')", params: params).body
9
+ Location.new get_request("#{company}/IC/ICLocations('#{locations_id}')", params: params).body
10
10
  end
11
11
 
12
12
  def create(company, **attributes)
13
- Location.new post_request("#{company}/IC/ICLocations", body: attributes).body
13
+ Location.new post_request("#{company}/IC/ICLocations", body: attributes).body
14
14
  end
15
15
 
16
16
  def update(company, location_id, **attributes)
@@ -2,7 +2,7 @@ module Sagekit
2
2
  class PurchaseOrdersResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- PurchaseOrder.new get_request("#{company}/PO/POPurchaseOrders", params: params).body
5
+ Collection.from_response get_request("#{company}/PO/POPurchaseOrders?$count=true", params: params), type: Item
6
6
  end
7
7
 
8
8
  def retreive(company, order_id, **params)
@@ -2,7 +2,7 @@ module Sagekit
2
2
  class ReceiptsResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- Receipt.new get_request("#{company}/PO/POReceipts", params: params).body
5
+ Collection.from_response get_request("#{company}/PO/POReceipts?$count=true", params: params), type: Receipt
6
6
  end
7
7
 
8
8
  def retreive(company, receipt_id, **params)
@@ -2,15 +2,15 @@ module Sagekit
2
2
  class SalesHistoryResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- SalesHistory.new get_request("#{company}/OE/OESalesHistory", params: params).body
5
+ Collection.from_response get_request("#{company}/OE/OESalesHistory?$count=true", params: params), type: SalesHistory
6
6
  end
7
7
 
8
8
  def details(company, **params)
9
- SalesHistory.new get_request("#{company}/OE/OESalesHistoryDetails", params: params).body
9
+ Collection.from_response get_request("#{company}/OE/OESalesHistoryDetails?$count=true", params: params), type: SalesHistory
10
10
  end
11
11
 
12
12
  def stats(company, **params)
13
- SalesHistory.new get_request("#{company}/OE/OESalesStatistics", params: params).body
13
+ Collection.from_response get_request("#{company}/OE/OESalesStatistics?$count=true", params: params), type: SalesHistory
14
14
  end
15
15
  end
16
16
  end
@@ -2,7 +2,7 @@ module Sagekit
2
2
  class SalesOrdersResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- SalesOrder.new get_request("#{company}/OE/OEOrders", params: params).body
5
+ Collection.from_response get_request("#{company}/OE/OEOrders?$count=true", params: params), type: Invoice
6
6
  end
7
7
 
8
8
  def retreive(company, order_id, **params)
@@ -2,7 +2,7 @@ module Sagekit
2
2
  class SalesPersonsResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- SalesPerson.new get_request("#{company}/AR/ARSalespersons", params: params).body
5
+ Collection.from_response get_request("#{company}/AR/ARSalespersons?$count=true", params: params), type: SalesPerson
6
6
  end
7
7
 
8
8
  def retreive(company, id, **params)
@@ -25,6 +25,7 @@ module Sagekit
25
25
 
26
26
  def statistics(company, **params)
27
27
  SalesPerson.new get_request("#{company}/AR/ARSalespersonStatistics", params: params).body
28
+ Collection.from_response get_request("#{company}/AR/ARSalespersonStatistics?$count=true", params: params), type: SalesPerson
28
29
  end
29
30
 
30
31
  def filter_stats(company, sales_person, year, period)
@@ -2,7 +2,7 @@ module Sagekit
2
2
  class VendorContractCostsResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- VendorContractCost.new get_request("#{company}/PO/POVendorContractCosts", params: params).body
5
+ Collection.from_response get_request("#{company}/PO/POVendorContractCosts?$count=true", params: params), type: VendorContractCost
6
6
  end
7
7
 
8
8
  def retreive(company, item, vendor, **params)
@@ -2,15 +2,15 @@ module Sagekit
2
2
  class VendorGroupsResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- Vendor.new get_request("#{company}/AP/APVendorGroups", params: params).body
5
+ Collection.from_response get_request("#{company}/AP/APVendorGroups?$count=true", params: params), type: Vendor
6
6
  end
7
7
 
8
8
  def retreive(company, id, **params)
9
- Vendor.new get_request("#{company}/AP/APVendorGroups('#{id}')", params: params).body
9
+ Vendor.new get_request("#{company}/AP/APVendorGroups('#{id}')", params: params).body
10
10
  end
11
11
 
12
12
  def create(company, **attributes)
13
- Vendor.new post_request("#{company}/AP/APVendorGroups", body: attributes).body
13
+ Vendor.new post_request("#{company}/AP/APVendorGroups", body: attributes).body
14
14
  end
15
15
 
16
16
  def update(company, id, **attributes)
@@ -2,7 +2,7 @@ module Sagekit
2
2
  class VendorTermsResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- Vendor.new get_request("#{company}/AP/APTerms", params: params).body
5
+ Collection.from_response get_request("#{company}/AP/APTerms?$count=true", params: params), type: Vendor
6
6
  end
7
7
 
8
8
  def retreive(company, terms_code, **params)
@@ -2,15 +2,15 @@ module Sagekit
2
2
  class VendorsResource < Resource
3
3
 
4
4
  def list(company, **params)
5
- Vendor.new get_request("#{company}/AP/APVendors", params: params).body
5
+ Collection.from_response get_request("#{company}/AP/APVendors?$count=true", params: params), type: Vendor
6
6
  end
7
7
 
8
8
  def retreive(company, vendor_id, **params)
9
- Vendor.new get_request("#{company}/AP/APVendors('#{vendor_id}')", params: params).body
9
+ Vendor.new get_request("#{company}/AP/APVendors('#{vendor_id}')", params: params).body
10
10
  end
11
11
 
12
12
  def create(company, **attributes)
13
- Vendor.new post_request("#{company}/AP/APVendors", body: attributes).body
13
+ Vendor.new post_request("#{company}/AP/APVendors", body: attributes).body
14
14
  end
15
15
 
16
16
  def update(company, vendor_id, **attributes)
@@ -24,7 +24,7 @@ module Sagekit
24
24
  end
25
25
 
26
26
  def statistics(company, **params)
27
- Vendor.new get_request("#{company}/AP/APVendorStatistics", params: params).body
27
+ Collection.from_response get_request("#{company}/AP/APVendorStatistics?$count=true", params: params), type: Vendor
28
28
  end
29
29
  end
30
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sagekit
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/sagekit.rb CHANGED
@@ -4,6 +4,7 @@ require_relative "sagekit/version"
4
4
 
5
5
  module Sagekit
6
6
  autoload :Client, "sagekit/client"
7
+ autoload :Collection, "sagekit/collection"
7
8
  autoload :Error, "sagekit/error"
8
9
  autoload :Object, "sagekit/object"
9
10
  autoload :Resource, "sagekit/resource"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sagekit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Perez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-08 00:00:00.000000000 Z
11
+ date: 2021-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -58,6 +58,7 @@ files:
58
58
  - docs/style.css
59
59
  - lib/sagekit.rb
60
60
  - lib/sagekit/client.rb
61
+ - lib/sagekit/collection.rb
61
62
  - lib/sagekit/error.rb
62
63
  - lib/sagekit/object.rb
63
64
  - lib/sagekit/objects/account_set.rb