QuickBooks/Callbacks/SQL/Callbacks.php
public static function InvoiceDeriveRequest($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale, $config = array())
	{
		// Try to fetch it from the database
		$Driver = QuickBooks_Driver_Singleton::getInstance();
		
		if (!empty($extra['TxnID']))
		{
			$xml = '';
			$xml .= '<?xml version="1.0" encoding="utf-8"?>
				<?qbxml version="' . $version . '"?>
				<QBXML>
					<QBXMLMsgsRq onError="' . QUICKBOOKS_SERVER_SQL_ON_ERROR . '">
						<InvoiceQueryRq requestID="' . $requestID . '">
							<TxnID>' . $extra['TxnID'] . '</TxnID>
						</InvoiceQueryRq>
					</QBXMLMsgsRq>
				</QBXML>';
				
			return $xml;
		}
		else if ($arr = $Driver->get(QUICKBOOKS_DRIVER_SQL_PREFIX_SQL . 'invoice', array( QUICKBOOKS_DRIVER_SQL_FIELD_ID => $ID )))
		{
			$xml = '';
			$xml .= '<?xml version="1.0" encoding="utf-8"?>
				<?qbxml version="' . $version . '"?>
				<QBXML>
					<QBXMLMsgsRq onError="' . QUICKBOOKS_SERVER_SQL_ON_ERROR . '">
						<InvoiceQueryRq requestID="' . $requestID . '">
							<TxnID>' . $arr['TxnID'] . '</TxnID>
						</InvoiceQueryRq>
					</QBXMLMsgsRq>
				</QBXML>';
				
			return $xml;
		}
		
		$err = '' . __METHOD__ . ' called without a proper $extra array: ' . print_r($extra, true);
		return '';		// Error occured
	}
public static function InvoiceDeriveRequest($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale, $config = array())
	{
		// Try to fetch it from the database
		$Driver = QuickBooks_Driver_Singleton::getInstance();
		
		if (!empty($extra['TxnID']))
		{
			$xml = '';
			$xml .= '<?xml version="1.0" encoding="utf-8"?>
				<?qbxml version="' . $version . '"?>
				<QBXML>
					<QBXMLMsgsRq onError="' . QUICKBOOKS_SERVER_SQL_ON_ERROR . '">
						<InvoiceQueryRq requestID="' . $requestID . '">
							<TxnID>' . $extra['TxnID'] . '</TxnID>
						</InvoiceQueryRq>
					</QBXMLMsgsRq>
				</QBXML>';
				
			return $xml;
		}
		else if ($arr = $Driver->get(QUICKBOOKS_DRIVER_SQL_PREFIX_SQL . 'invoice', array( QUICKBOOKS_DRIVER_SQL_FIELD_ID => $ID )))
		{
			$xml = '';
			$xml .= '<?xml version="1.0" encoding="utf-8"?>
				<?qbxml version="' . $version . '"?>
				<QBXML>
					<QBXMLMsgsRq onError="' . QUICKBOOKS_SERVER_SQL_ON_ERROR . '">
						<InvoiceQueryRq requestID="' . $requestID . '">
							<TxnID>' . $arr['TxnID'] . '</TxnID>
						</InvoiceQueryRq>
					</QBXMLMsgsRq>
				</QBXML>';
				
			return $xml;
		}
		
		$err = '' . __METHOD__ . ' called without a proper $extra array: ' . print_r($extra, true);
		return '';		// Error occured
	}
Fetch derived fields for a customer (Balance, TotalBalance, etc.)