Skip to content

Commit 4a767c3

Browse files
V3.2.0 (#184)
* Fix bug when journal entry amount is 0 A journal entry amount of "0" would always results in a transaction type of "Debit". Add the ability to indicate which journal entry is Debit and which is Credit when journaling an amount of "0". * Allow unsetting email address in vendor Allow clearing a previously-set email address in the Vendor. Previously, once you set an email address, you could never remove an email address. * Write the "start" XML attribute Write the "start" XML attribute when paging through a list. * Allow using record number when updating customer or vendor Previously, the library only supported using the vendor ID or customer ID when updating a vendor or customer. Allow additionally using the record number to update. * Allow using ReadMore for reports Listing stored report data requires using the ReadMore function. Add a report ID to the ReadMore function. * Fix the unit tests After augmenting VendorUpdate, CustomerUpdate, and ReadMore to allow record ID (for the former two) and report ID (for the latter), fix the corresponding unit tests. * Update JournalEntryLineCreate.php Fix bug in setting transaction amount * Fix for issue 168 * added tax entries for bill * updated referenced versions for travis and composer to 8.1 * added description to new methods * updated set description for primaryEmailAddress * bump version 3.1.0 to 4.0.0 * corrected version bump from 4.0.0 to 3.2.0 * updated supported versions of php * remove .travis.yml * updated doxygen related files Co-authored-by: Ben Hardin <[email protected]>
1 parent c1cb79c commit 4a767c3

27 files changed

+617
-176
lines changed

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
## System Requirements
1818

1919
* You must have an active Sage Intacct Web Services Developer license
20-
* PHP >= 7.3
20+
* PHP >= 7.4
2121
* A recent version of cURL >= 7.19.4 compiled with OpenSSL and zlib
2222
* [Composer](composer)
2323

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=7.3",
13+
"php": ">=7.4",
1414
"ext-dom": "*",
1515
"ext-libxml": "*",
1616
"ext-mbstring": "*",

docs/doxygen.conf

Lines changed: 207 additions & 132 deletions
Large diffs are not rendered by default.

docs/layout.xml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<doxygenlayout version="1.0">
2-
<!-- Generated by doxygen 1.9.1 -->
2+
<!-- Generated by doxygen 1.9.4 -->
33
<!-- Navigation index tabs for HTML output -->
44
<navindex>
55
<tab type="mainpage" visible="no" title=""/>
@@ -10,32 +10,35 @@
1010
<tab type="namespacelist" visible="no" title="" intro=""/>
1111
<tab type="namespacemembers" visible="no" title="" intro=""/>
1212
</tab>
13+
<tab type="concepts" visible="no" title="">
14+
</tab>
1315
<tab type="interfaces" visible="yes" title="">
1416
<tab type="interfacelist" visible="yes" title="" intro=""/>
1517
<tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
1618
<tab type="interfacehierarchy" visible="yes" title="" intro=""/>
1719
</tab>
1820
<tab type="classindex" visible="yes" title="Index"/>
21+
<tab type="classlist" visible="yes" title="Classes" intro=""/>
1922
<tab type="classes" visible="no" title="">
2023
<tab type="classlist" visible="yes" title="Classes" intro=""/>
21-
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
24+
<tab type="classindex" visible="no" title=""/>
2225
<tab type="hierarchy" visible="no" title="" intro=""/>
2326
<tab type="classmembers" visible="no" title="" intro=""/>
2427
</tab>
25-
<tab type="structs" visible="yes" title="">
26-
<tab type="structlist" visible="yes" title="" intro=""/>
27-
<tab type="structindex" visible="$ALPHABETICAL_INDEX" title=""/>
28+
<tab type="structs" visible="no" title="">
29+
<tab type="structlist" visible="no" title="" intro=""/>
30+
<tab type="structindex" visible="no" title=""/>
2831
</tab>
29-
<tab type="exceptions" visible="yes" title="">
30-
<tab type="exceptionlist" visible="yes" title="" intro=""/>
31-
<tab type="exceptionindex" visible="$ALPHABETICAL_INDEX" title=""/>
32-
<tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
32+
<tab type="exceptions" visible="no" title="">
33+
<tab type="exceptionlist" visible="no" title="" intro=""/>
34+
<tab type="exceptionindex" visible="no" title=""/>
35+
<tab type="exceptionhierarchy" visible="no" title="" intro=""/>
3336
</tab>
3437
<tab type="files" visible="no" title="">
3538
<tab type="filelist" visible="no" title="" intro=""/>
3639
<tab type="globals" visible="no" title="" intro=""/>
3740
</tab>
38-
<tab type="examples" visible="yes" title="" intro=""/>
41+
<tab type="examples" visible="no" title="" intro=""/>
3942
</navindex>
4043

4144
<!-- Layout definition for a class page -->
@@ -105,6 +108,7 @@
105108
<constantgroups visible="yes" title=""/>
106109
<interfaces visible="yes" title=""/>
107110
<classes visible="yes" title=""/>
111+
<concepts visible="yes" title=""/>
108112
<structs visible="yes" title=""/>
109113
<exceptions visible="yes" title=""/>
110114
<typedefs title=""/>
@@ -128,6 +132,15 @@
128132
<authorsection visible="yes"/>
129133
</namespace>
130134

135+
<!-- Layout definition for a concept page -->
136+
<concept>
137+
<briefdescription visible="yes"/>
138+
<includes visible="$SHOW_HEADERFILE"/>
139+
<definition visible="yes" title=""/>
140+
<detaileddescription title=""/>
141+
<authorsection visible="yes"/>
142+
</concept>
143+
131144
<!-- Layout definition for a file page -->
132145
<file>
133146
<briefdescription visible="yes"/>
@@ -141,6 +154,7 @@
141154
<structs visible="yes" title=""/>
142155
<exceptions visible="yes" title=""/>
143156
<namespaces visible="yes" title=""/>
157+
<concepts visible="yes" title=""/>
144158
<constantgroups visible="yes" title=""/>
145159
<defines title=""/>
146160
<typedefs title=""/>
@@ -174,6 +188,7 @@
174188
<dirs visible="yes" title=""/>
175189
<files visible="yes" title=""/>
176190
<namespaces visible="yes" title=""/>
191+
<concepts visible="yes" title=""/>
177192
<classes visible="yes" title=""/>
178193
<defines title=""/>
179194
<typedefs title=""/>

src/Intacct/AbstractClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function __construct(ClientConfig $config = null)
8686
*
8787
* @return Xml\OnlineResponse
8888
*/
89-
protected function executeOnlineRequest(array $functions, RequestConfig $requestConfig = null)
89+
protected function executeOnlineRequest(array $functions, RequestConfig &$requestConfig = null)
9090
{
9191
if (!$requestConfig) {
9292
$requestConfig = new RequestConfig();

src/Intacct/Functions/AccountsPayable/AbstractBill.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ abstract class AbstractBill extends AbstractFunction
9292
/** @var string */
9393
protected $attachmentsId;
9494

95+
/** @var string */
96+
protected $taxSolutionId;
97+
9598
/** @var AbstractBillLine[] */
9699
protected $lines = [];
97100

@@ -535,6 +538,26 @@ public function setAttachmentsId($attachmentsId)
535538
$this->attachmentsId = $attachmentsId;
536539
}
537540

541+
/**
542+
* Get Tax Solution Id
543+
*
544+
* @return string
545+
*/
546+
public function getTaxSolutionId()
547+
{
548+
return $this->taxSolutionId;
549+
}
550+
551+
/**
552+
* Set Tax Solution Id
553+
*
554+
* @param string $taxSolutionId
555+
*/
556+
public function setTaxSolutionId(string $taxSolutionId)
557+
{
558+
$this->taxSolutionId = $taxSolutionId;
559+
}
560+
538561
/**
539562
* Get bill lines
540563
*

src/Intacct/Functions/AccountsPayable/AbstractBillLine.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ abstract class AbstractBillLine
9494
/** @var string */
9595
protected $warehouseId;
9696

97+
/** @var AbstractBillLineTaxEntries[] */
98+
protected $taxEntry = [];
99+
97100
/**
98101
* Get account label
99102
*
@@ -546,5 +549,21 @@ public function setWarehouseId($warehouseId)
546549
$this->warehouseId = $warehouseId;
547550
}
548551

552+
/**
553+
* @return AbstractBillLineTaxEntries[]
554+
*/
555+
public function getTaxEntry(): array
556+
{
557+
return $this->taxEntry;
558+
}
559+
560+
/**
561+
* @param AbstractBillLineTaxEntries[] $taxEntry
562+
*/
563+
public function setTaxEntry(array $taxEntry): void
564+
{
565+
$this->taxEntry = $taxEntry;
566+
}
567+
549568
abstract public function writeXml(XMLWriter &$xml);
550569
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
3+
/**
4+
* Copyright 2021 Sage Intacct, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
7+
* use this file except in compliance with the License. You may obtain a copy
8+
* of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* or in the "LICENSE" file accompanying this file. This file is distributed on
13+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14+
* express or implied. See the License for the specific language governing
15+
* permissions and limitations under the License.
16+
*/
17+
18+
namespace Intacct\Functions\AccountsPayable;
19+
20+
use Intacct\Functions\AbstractFunction;
21+
use Intacct\Functions\Traits\CustomFieldsTrait;
22+
use Intacct\Xml\XMLWriter;
23+
24+
abstract class AbstractBillLineTaxEntries extends \Intacct\Functions\AbstractFunction
25+
{
26+
27+
use CustomFieldsTrait;
28+
29+
protected $taxId;
30+
protected $taxValue;
31+
32+
/**
33+
* Get Tax Id
34+
*
35+
* @return string
36+
*/
37+
public function getTaxId()
38+
{
39+
return $this->taxId;
40+
}
41+
42+
/**
43+
* Set Tax Id
44+
*
45+
* @param string $taxId
46+
*/
47+
public function setTaxId($taxId): void
48+
{
49+
$this->taxId = $taxId;
50+
}
51+
52+
/**
53+
* Get Tax Value
54+
*
55+
* @return float|string
56+
*/
57+
public function getTaxValue()
58+
{
59+
return $this->taxValue;
60+
}
61+
62+
/**
63+
* Set Tax Value
64+
*
65+
* @param float|string $taxValue
66+
*/
67+
public function setTaxValue($taxValue): void
68+
{
69+
$this->taxValue = $taxValue;
70+
}
71+
72+
abstract public function writeXml(XMLWriter &$xml);
73+
}

src/Intacct/Functions/AccountsPayable/AbstractVendor.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ abstract class AbstractVendor extends AbstractFunction
3535

3636
use CustomFieldsTrait;
3737

38+
/** @var int */
39+
protected $recordNo;
40+
3841
/** @var string */
3942
protected $vendorId;
4043

@@ -232,6 +235,26 @@ abstract class AbstractVendor extends AbstractFunction
232235
/** @var array */
233236
protected $restrictedDepartments = [];
234237

238+
/**
239+
* Get record number
240+
*
241+
* @return int|string
242+
*/
243+
public function getRecordNo()
244+
{
245+
return $this->recordNo;
246+
}
247+
248+
/**
249+
* Set record number
250+
*
251+
* @param int|string $recordNo
252+
*/
253+
public function setRecordNo($recordNo)
254+
{
255+
$this->recordNo = $recordNo;
256+
}
257+
235258
/**
236259
* Get vendor ID
237260
*
@@ -544,12 +567,13 @@ public function getPrimaryEmailAddress()
544567

545568
/**
546569
* Set primary email address
570+
* Also, allows for unsetting of previously set email
547571
*
548572
* @param string $primaryEmailAddress
549573
*/
550574
public function setPrimaryEmailAddress($primaryEmailAddress)
551575
{
552-
if (filter_var($primaryEmailAddress, FILTER_VALIDATE_EMAIL) === false) {
576+
if (!empty($primaryEmailAddress) && filter_var($primaryEmailAddress, FILTER_VALIDATE_EMAIL) === false) {
553577
throw new \InvalidArgumentException('Primary Email Address is not a valid email');
554578
}
555579
$this->primaryEmailAddress = $primaryEmailAddress;

src/Intacct/Functions/AccountsPayable/BillCreate.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function writeXml(XMLWriter &$xml)
8585

8686
$xml->writeElement('nogl', $this->isDoNotPostToGL());
8787
$xml->writeElement('supdocid', $this->getAttachmentsId());
88+
$xml->writeElement('taxsolutionid', $this->getTaxSolutionId());
8889

8990
$this->writeXmlExplicitCustomFields($xml);
9091

src/Intacct/Functions/AccountsPayable/BillLineCreate.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ public function writeXml(XMLWriter &$xml)
6565
$xml->writeElement('warehouseid', $this->getWarehouseId());
6666
$xml->writeElement('billable', $this->isBillable());
6767

68+
// if there are tax entries, lets add them to our xml
69+
if(!empty($this->getTaxEntry())) {
70+
$xml->startElement('taxentries');
71+
foreach ($this->getTaxEntry() as $taxentry) {
72+
$taxentry->writeXml($xml);
73+
}
74+
$xml->endElement(); //taxentries
75+
}
76+
6877
$xml->endElement(); //lineitem
6978
}
7079
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
/**
4+
* Copyright 2021 Sage Intacct, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
7+
* use this file except in compliance with the License. You may obtain a copy
8+
* of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* or in the "LICENSE" file accompanying this file. This file is distributed on
13+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14+
* express or implied. See the License for the specific language governing
15+
* permissions and limitations under the License.
16+
*/
17+
18+
namespace Intacct\Functions\AccountsPayable;
19+
20+
use Intacct\Xml\XMLWriter;
21+
22+
/**
23+
* Create a new accounts payable bill tax entries line record
24+
*/
25+
class BillLineTaxEntriesCreate extends AbstractBillLineTaxEntries
26+
{
27+
28+
public function writeXml(XMLWriter &$xml)
29+
{
30+
$xml->startElement('taxentry');
31+
32+
$xml->writeElement('detailid', $this->getTaxId());
33+
$xml->writeElement('trx_tax', $this->getTaxValue());
34+
35+
$xml->endElement();
36+
}
37+
}

0 commit comments

Comments
 (0)