Closed clrncmcnlsn closed 5 years ago
The i
status is for in progress
.
Generally, nothing should stay in that status. Something in that status generally indicates you have an error in your PHP or SQL. Did you check your PHP error log?
It turned out that there was some typo in the query statement which has already been fixed.
function _quickbooks_invoice_add_request($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale){
$con = mysqli_connect(--OMMITTED--);
if(mysqli_connect_errno())
{
echo 'Failed to connect: '.mysqli_connect_error();
}
$sales = mysqli_fetch_assoc(mysqli_query($con, 'SELECT qty_sold, sales_price from sales where id = ' . $ID ));
$customer = mysqli_fetch_assoc(mysqli_query($con, 'SELECT company from accounts where id in(select account_id from customers where id in(select customer_id from sales where id = '. (int) $ID .'))'));
$species = mysqli_fetch_assoc(mysqli_query($con, 'SELECT name from species where id in (select species_id from sales_species where sales_id =' . $ID . ')'));
$xml = '<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="2.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<InvoiceAddRq requestID="'. $requestID .'">
<InvoiceAdd>
<CustomerRef>
<FullName>'. $customer['company'] .'</FullName>
</CustomerRef>
<TemplateRef>
<FullName>Intuit Service Invoice</FullName>
</TemplateRef>
<InvoiceLineAdd>
<ItemRef>
<FullName>'. $species['name'] .'</FullName>
</ItemRef>
<Quantity>'. $sales['qty_sold'] .'</Quantity>
<Rate>'. $sales['sales_price'] .'</Rate>
</InvoiceLineAdd>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>
</QBXML>';
}
I tested the queries separately which returned correct results, but I still get the blank getLastError()
. PHP logs didn't show any errors.
It's the return $xml
statement that was missing!
:finnadie:
Inside our
quickbooks_queue
table are some data that have q statuses that change to i when updated via theWeb Connector
app.What does the status i mean? The
msg
column changes fromNULL
to a blank. As shown on the image above,getLastError()
is also blank.QWCLog.txt
ends with this message: