I'm creating a Magento application and I'm planing to create sales order invoice by using Magento API.
Here is my pseudo code for my invoice creation. The problem is it creates an invoice but that invoice is always blank (not showing products and quantity)
<?php
$proxy = new SoapClient('http://myurl/api/soap?wsdl');
$sessionId = $proxy->login('apiuser', 'apikey');
// item array with sku and quantity
$invoiceItems = array(
'002' => '1', '003' => '1', '004' => '1', '005' => '1'
);
// Create new invoice
$newInvoiceId = $proxy->call($sessionId, 'sales_order_invoice.create', array($saleorderno, $invoiceItems, 'Invoice Created', true, true));
?>
But when I'm creating an sales order invoice like this (there's no changes in quantity from sales order), it works properly
$newInvoiceId = $proxy->call($sessionId, 'sales_order_invoice.create', array($saleorderno, array(), 'Invoice Created', true, true));
Is there any mistakes with my code? Can any one give some advice for me?