/**
     * @covers Intacct\Functions\InventoryControl\TransactionItemDetail::writeXml
     *
     */
    public function testParamsOverrides()
    {
        $expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<itemdetail>
    <quantity>15325</quantity>
    <serialno>S2355235</serialno>
    <aisle>55</aisle>
    <row>1</row>
    <bin>12</bin>
</itemdetail>
EOF;
        $xml = new XMLWriter();
        $xml->openMemory();
        $xml->setIndent(true);
        $xml->setIndentString('    ');
        $xml->startDocument();
        $itemDetail = new TransactionItemDetail();
        $itemDetail->setQuantity(15325);
        $itemDetail->setSerialNumber('S2355235');
        $itemDetail->setAisle('55');
        $itemDetail->setRow('1');
        $itemDetail->setBin('12');
        $itemDetail->writeXml($xml);
        $this->assertXmlStringEqualsXmlString($expected, $xml->flush());
    }
    /**
     * @covers Intacct\Functions\OrderEntry\OrderEntryTransactionLineCreate::writeXml
     */
    public function testParamsOverrides()
    {
        $expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<sotransitem>
    <bundlenumber>092304</bundlenumber>
    <itemid>26323</itemid>
    <itemdesc>Item Description</itemdesc>
    <taxable>true</taxable>
    <warehouseid>93294</warehouseid>
    <quantity>2340</quantity>
    <unit>593</unit>
    <discountpercent>10</discountpercent>
    <price>32.35</price>
    <discsurchargememo>None</discsurchargememo>
    <locationid>SF</locationid>
    <departmentid>Receiving</departmentid>
    <memo>Memo</memo>
    <itemdetails>
        <itemdetail>
            <quantity>52</quantity>
            <lotno>3243</lotno>
        </itemdetail>
    </itemdetails>
    <customfields>
        <customfield>
            <customfieldname>customfield1</customfieldname>
            <customfieldvalue>customvalue1</customfieldvalue>
        </customfield>
    </customfields>
    <revrectemplate>template</revrectemplate>
    <revrecstartdate>
        <year>2015</year>
        <month>06</month>
        <day>30</day>
    </revrecstartdate>
    <revrecenddate>
        <year>2015</year>
        <month>07</month>
        <day>31</day>
    </revrecenddate>
    <renewalmacro>Quarterly</renewalmacro>
    <projectid>235</projectid>
    <customerid>23423434</customerid>
    <vendorid>797656</vendorid>
    <employeeid>90295</employeeid>
    <classid>243609</classid>
    <contractid>9062</contractid>
    <fulfillmentstatus>Complete</fulfillmentstatus>
    <taskno>9850</taskno>
    <billingtemplate>3525</billingtemplate>
</sotransitem>
EOF;
        $xml = new XMLWriter();
        $xml->openMemory();
        $xml->setIndent(true);
        $xml->setIndentString('    ');
        $xml->startDocument();
        $entry = new OrderEntryTransactionLineCreate();
        $entry->setBundleNumber('092304');
        $entry->setItemId('26323');
        $entry->setItemDescription('Item Description');
        $entry->setTaxable(true);
        $entry->setWarehouseId('93294');
        $entry->setQuantity(2340);
        $entry->setUnit('593');
        $entry->setDiscountPercent(10.0);
        $entry->setPrice(32.35);
        $entry->setDiscountSurchargeMemo('None');
        $entry->setMemo('Memo');
        $entry->setRevRecTemplate('template');
        $entry->setRevRecStartDate(new DateType('2015-06-30'));
        $entry->setRevRecEndDate(new DateType('2015-07-31'));
        $entry->setRenewalMacro('Quarterly');
        $entry->setFulfillmentStatus('Complete');
        $entry->setTaskNumber('9850');
        $entry->setBillingTemplate('3525');
        $entry->setLocationId('SF');
        $entry->setDepartmentId('Receiving');
        $entry->setProjectId('235');
        $entry->setCustomerId('23423434');
        $entry->setVendorId('797656');
        $entry->setEmployeeId('90295');
        $entry->setClassId('243609');
        $entry->setContractId('9062');
        $itemDetail1 = new TransactionItemDetail();
        $itemDetail1->setQuantity(52);
        $itemDetail1->setLotNumber('3243');
        $entry->setItemDetails([$itemDetail1]);
        $entry->setCustomFields(['customfield1' => 'customvalue1']);
        $entry->writeXml($xml);
        $this->assertXmlStringEqualsXmlString($expected, $xml->flush());
    }
    /**
     * @covers Intacct\Functions\InventoryControl\InventoryTransactionLineCreate::writeXml
     */
    public function testParamsOverrides()
    {
        $expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<ictransitem>
    <itemid>26323</itemid>
    <itemdesc>Item Description</itemdesc>
    <warehouseid>93294</warehouseid>
    <quantity>2340</quantity>
    <unit>593</unit>
    <cost>32.35</cost>
    <locationid>SF</locationid>
    <departmentid>Purchasing</departmentid>
    <itemdetails>
        <itemdetail>
            <quantity>52</quantity>
            <lotno>3243</lotno>
        </itemdetail>
    </itemdetails>
    <customfields>
        <customfield>
            <customfieldname>customfield1</customfieldname>
            <customfieldvalue>customvalue1</customfieldvalue>
        </customfield>
    </customfields>
    <projectid>235</projectid>
    <customerid>23423434</customerid>
    <vendorid>797656</vendorid>
    <employeeid>90295</employeeid>
    <classid>243609</classid>
    <contractid>9062</contractid>
</ictransitem>
EOF;
        $xml = new XMLWriter();
        $xml->openMemory();
        $xml->setIndent(true);
        $xml->setIndentString('    ');
        $xml->startDocument();
        $entry = new InventoryTransactionLineCreate();
        $entry->setItemId('26323');
        $entry->setItemDescription('Item Description');
        $entry->setWarehouseId('93294');
        $entry->setQuantity(2340);
        $entry->setUnit('593');
        $entry->setCost(32.35);
        $entry->setLocationId('SF');
        $entry->setDepartmentId('Purchasing');
        $entry->setProjectId('235');
        $entry->setCustomerId('23423434');
        $entry->setVendorId('797656');
        $entry->setEmployeeId('90295');
        $entry->setClassId('243609');
        $entry->setContractId('9062');
        $itemDetail1 = new TransactionItemDetail();
        $itemDetail1->setQuantity(52);
        $itemDetail1->setLotNumber('3243');
        $entry->setItemDetails([$itemDetail1]);
        $entry->setCustomFields(['customfield1' => 'customvalue1']);
        $entry->writeXml($xml);
        $this->assertXmlStringEqualsXmlString($expected, $xml->flush());
    }