function postSalesInvoice($salesInvoice, $format) { global $apiId, $apiKey; if ($format == "xml") { return postXml($apiId, $apiKey, "SalesInvoices", $salesInvoice->Guid, $salesInvoice); } else { return postJson($apiId, $apiKey, "SalesInvoices", $salesInvoice->Guid, $salesInvoice); } }
$imagePost = new ImagePost($header, $base64); $response = postJson($url, $auth, $imagePost->getJson()); alert($response); // ------------------------------ if ($response->type != 'success') { $errors = true; break; } // Remove file unlink($path); // ------------------------------ } // ------------------------------ if (!$imageErrors) { // Send scan data $dataPost = new DataPost($header, 'png', $customerId, $typeId, $group); if ($typeId == -2 && isset($_POST['quarterId'])) { // Cover Sheet $dataPost->setQuarter($_POST['quarterId']); } else { if ($typeId >= 0) { // Customer Document $dataPost->setSource($_POST['sourceId']); } } $response = postJson($url, $auth, $dataPost->getJson()); alert($response); // ------------------------------ } $inlineScript .= '<script type="text/javascript">var hideSpinner = true;</script>'; }