I have a Magento site at Footstools UK | Storage Ottomans | Leather Cubes | FREE Shipping and I have inserted Affiliate Future tracking code on my success page as follows (Merchant ID removed for Privacy):

<!-- Affiliate Future Tracking -->
<?php
$_customerId = Mage::getSingleton('customer/session')->getCustomerId();
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getSingleton('sales/order');
$order->load($lastOrderId);
$_totalData =$order->getData();
$_sub = $_totalData['subtotal'];
?>
<script language="javascript" src="https://scripts.affiliatefuture.com/AFFunctions.js"></script>
<script language="javascript">
var merchantID = REMOVED;
var payoutCodes = ''
var offlineCode = ''
var orderValue = '<?PHP echo $_sub;?>';
var orderRef = '<?PHP echo $lastOrderId;?>'; AFProcessSaleV2(merchantID, orderValue, orderRef, payoutCodes, offlineCode); </script>

The order amount tracks well but the Order ID is incorrect although is does increase by one each time an order is placed. My test transaction produced a Magento Order ID of 100000659 but the Affiliate Future system showed the Order ID as 578.

Any ideas welcome.