Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which format we need to while create setLines for Inventory Transaction Create #181

Open
kuldip1 opened this issue Jun 30, 2022 · 2 comments

Comments

@kuldip1
Copy link

kuldip1 commented Jun 30, 2022

Hi

I had just setup this SDK in my system and I start create Inventory and Inventory Transaction Create but when I use to function setLines then it will show me error.

I had create array of lines.

Below is the code for the same

$line_items =  
                array(
                    'itemid' => 'AIX-1234',
                    'warehouseid' => 'Warehouse',
                    'quantity' => 1
            );
    
    $create->setLines($line_items);

It throws me error
Fatal error: Uncaught Error: Call to a member function writeXml() on array in D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\Functions\InventoryControl\InventoryTransactionCreate.php:62 Stack trace: #0 D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\Xml\Request\OperationBlock.php(141): Intacct\Functions\InventoryControl\InventoryTransactionCreate->writeXml(Object(Intacct\Xml\XMLWriter)) #1 D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\Xml\RequestBlock.php(115): Intacct\Xml\Request\OperationBlock->writeXml(Object(Intacct\Xml\XMLWriter)) #2 D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\Xml\RequestHandler.php(144): Intacct\Xml\RequestBlock->writeXml() #3 D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\AbstractClient.php(97): Intacct\Xml\RequestHandler->executeOnline(Array) #4 D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\OnlineClient.php(36): Intacct\AbstractClient->executeOnlineRequest(Array, Object(Intacct\RequestConfig)) #5 D:\Projects\CustomPHP\intacct\crud-inventory.php(47): Intacct\OnlineClient->execute(Object(Intacct\Functions\InventoryControl\InventoryTransactionCreate)) #6 {main} thrown in D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\Functions\InventoryControl\InventoryTransactionCreate.php on line 62

Can you please guide me what we need to pass on setLines function do you have any reference or piece of code then I will check.

@muddy004
Copy link

I have the same question. I've tried different array/objects and the $create = new InvoiceCreate(); class as well without success. The closest I can get is Failed! Response control status failure - XL03000003 XML Parse schema error: Error 1871: Element 'invoiceitems': Missing child element(s). Expected is ( lineitem ).. Line: 1, column: 0.

Any way to get an example of create invoice in the SDK for PHP?

@kuldip1
Copy link
Author

kuldip1 commented Oct 25, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants