anchor.diff:  				INNER JOIN tblproductcats ON prodCatID=pcatID
   				WHERE 1
   				<cfif len(args.reportDate)>AND DATE(ehTimeStamp) = '#args.reportDate#' </cfif>
  -				<cfif StructKeyExists(args,"accountID")>
  -					AND eiParent IN (#args.aIDs#)
  -				</cfif>
  +				<cfif StructKeyExists(args,"accountID")>AND eiParent IN (#args.aIDs#)</cfif>
   			</cfquery>
  -			<!---<cfdump var="#loc.QTrans#" label="QTrans" expand="false">--->
  -			<cfset loc.result.QTrans = loc.QTrans>
  -			<cfset loc.net = 0>
  -			<cfset loc.vat = 0>
  -			<cfset loc.profit = 0>
  -			<cfset loc.cr = 0>
  -			<cfset loc.dr = 0>
  +			<!---<cfdump var="#loc.QTrans#" label="QTrans" expand="false">
  +			<cfset loc.result.QTrans = loc.QTrans>--->
  +			<cfset loc.grandNet = 0>
  +			<cfset loc.grandVAT = 0>
  +			<cfset loc.grandCR = 0>
  +			<cfset loc.grandDR = 0>
  +			<cfset loc.grandTrade = 0>
  +			<cfset loc.grandRetail = 0>
  +			<cfset loc.grandProfit = 0>
   			<cfset loc.tran = 0>
   			<cfoutput>
   			<table class="tableList">
   				<tr>
  -					<th align="left" colspan="18"><input type="text" id="quicksearch" value="" placeholder="Search list"></th>
  +					<th align="left" colspan="15"><input type="text" id="quicksearch" value="" placeholder="Search list"></th>
  +					<th align="right">Net</th>
  +					<th align="right">Gross</th>
  +					<th></th>
   				</tr>
   				<tr>
   					<th>Tran</th>
  
positive.code: 										<cfset loc.tran.itemClass = loc.data.itemClass>
  										<cfset loc.tran.unitTrade = loc.data.unitTrade>
  										<cfset loc.tran.price = loc.data.unitprice>
  										<cfset loc.tran.prop = Round((loc.tran.price / loc.dealRec.groupRetail) * 100) / 100>
  										<cfif loc.i gte loc.count>
  											<cfset loc.tran.prop = 1 - loc.totProp> <!--- make total of proportions add up to 1.00 --->
  										</cfif>
  
negative.code: 	<cffunction name="ShowTrans" access="public" returntype="void">
  		<cfargument name="args" type="struct" required="yes">
  		<cfset var loc = {}>
  		<cftry>
  			<cfset loc.total.retail = 0>
  			<cfset loc.total.gross = 0>
  			<cfset loc.total.net = 0>
  			<cfset loc.total.vat = 0>
  			<cfset loc.total.disc = 0>
  			<cfset loc.total.cash = 0>
  			<table class="tableList">
  				<tr>
  					<td>title</td>
  					<td width="50">ProdID</td>
  					<td>CASH</td>
  					<td align="right" width="50">retail</td>
  					<td align="right" width="50">gross</td>
  					<td align="right" width="50">net</td>
  					<td align="right" width="50">vat</td>
  					<td align="right" width="50">rate</td>
  					<td align="right" width="50">disc</td>
  				</tr>
  				<cfoutput>
  				<cfloop array="#args.trans#" index="loc.tran">
  					<cfset loc.disc = 0>
  					<cfset loc.prodID = 1>
  					<cfset loc.pubID = 1>
  					<cfset loc.account = 1>
  					<cfset loc.payID = 1>
  					<cfset loc.retail = 0>
  					<cfset loc.total.cash += (loc.tran.gross * loc.tran.cashOnly)>
  					<cfswitch expression="#loc.tran.itemClass#">
  						<cfcase value="SHOP|MAGS" delimiters="|">
  							<cfset loc.prodKey = "#loc.tran.prodID#-#loc.tran.price#">
  							<cfif StructKeyExists(args.shopItems,loc.prodKey)>
  								<cfset loc.data = StructFind(args.shopItems,loc.prodKey)>
  							<cfelse>
  								<cfset loc.data = StructFind(args.shopItems,loc.tran.prodID)>
  							</cfif>
  							<cfset loc.total.retail += loc.data.unitPrice>
  							<cfset loc.tran.itemType = "sale">
  							<cfset loc.disc = loc.data.unitPrice + loc.tran.gross>
  							<cfset loc.retail = loc.data.unitPrice>
  							<cfset loc.prodID = loc.tran.prodID>
  							<tr>
  								<td>#loc.data.title#</td>
  								<td align="right">#loc.tran.prodID#</td>
  								<td>#loc.tran.cashOnly#</td>
  								<td align="right">#loc.data.unitPrice#</td>
  								<td align="right">#loc.tran.gross#</td>
  								<td align="right">#loc.tran.net#</td>
  								<td align="right">#loc.tran.vat#</td>
  								<td align="right">#loc.tran.vrate#%</td>
  								<td align="right">#loc.disc#</td>
  							</tr>
  						</cfcase>
  						<cfcase value="paystation|NEWS|LOTTERY|SRV|SCRATCHCARD|LPRIZE|SPRIZE" delimiters="|">
  							<cfset loc.total.retail -= loc.tran.gross>
  							<cfset loc.tran.itemType = "item">
  							<cfset loc.prodID = loc.tran.prodID>
  							<cfset loc.retail = loc.tran.gross>
  							<tr>
  								<td>#loc.tran.itemClass#</td>
  								<td align="right">#loc.tran.prodID#</td>
  								<td>#loc.tran.cashOnly#</td>
  								<td align="right">#DecimalFormat(loc.tran.gross)#</td>
  								<td align="right">#DecimalFormat(loc.tran.gross)#</td>
  								<td align="right">#DecimalFormat(loc.tran.net)#</td>
  								<td align="right">#DecimalFormat(loc.tran.vat)#</td>
  								<td align="right">#DecimalFormat(loc.tran.vrate)#%</td>
  								<td align="right"></td>
  							</tr>
  						</cfcase>
  						<cfcase value="ACCPAY">
  							<cfset loc.total.retail += loc.tran.gross>
  							<cfset loc.tran.itemType = "item">
  							<cfset loc.account = loc.tran.account>
  							<cfset loc.retail = loc.tran.gross>
  							<tr>
  								<td>#loc.tran.itemClass#</td>
  								<td>?</td>
  								<td>#loc.tran.cashOnly#</td>
  								<td align="right">#DecimalFormat(loc.tran.gross)#</td>
  								<td align="right">#DecimalFormat(loc.tran.gross)#</td>
  								<td align="right">#DecimalFormat(loc.tran.net)#</td>
  								<td align="right">#DecimalFormat(loc.tran.vat)#</td>
  								<td align="right">#DecimalFormat(loc.tran.vrate)#%</td>
  								<td align="right"></td>
  							</tr>
  						</cfcase>
  						<cfcase value="MEDIA">
  							<cfset loc.pubKey = "#loc.tran.pubID#-#loc.tran.price#">
  							<cfif StructKeyExists(args.mediaItems,loc.pubKey)>
  								<cfset loc.data = StructFind(args.mediaItems,loc.pubKey)>
  							<cfelse>
  								<cfset loc.data = StructFind(args.mediaItems,loc.tran.pubID)>
  							</cfif>
  							<cfset loc.total.retail += loc.data.unitPrice>
  							<cfset loc.disc = loc.data.unitPrice + loc.tran.gross>
  							<cfset loc.retail = loc.data.unitPrice>
  							<cfset loc.tran.itemType = "sale">
  							<cfset loc.pubID = loc.tran.pubID>
  							<tr>
  								<td>#loc.data.title#</td>
  								<td align="right">#loc.tran.pubID#</td>
  								<td>#loc.tran.cashOnly#</td>
  								<td align="right">#loc.data.unitPrice#</td>
  								<td align="right">#DecimalFormat(loc.tran.gross)#</td>
  								<td align="right">#DecimalFormat(loc.tran.net)#</td>
  								<td align="right">#DecimalFormat(loc.tran.vat)#</td>
  								<td align="right">#DecimalFormat(loc.tran.vrate)#%</td>
  								<td align="right">#DecimalFormat(loc.disc)#</td>
  							</tr>
  						</cfcase>
  						<cfcase value="CASHINDW|CARDINDW|CHQINDW|CPN|Healthy|ACCINDW|WASTEACC" delimiters="|">
  							<cfset loc.tran.itemType = "pay">
  							<cfset loc.payID = loc.tran.payID>
  							<cfset loc.retail = loc.tran.gross>
  							<tr>
  								<td>#loc.tran.itemClass#</td>
  								<td></td>
  								<td>#loc.tran.cashOnly#</td>
  								<td></td>
  								<td align="right">#DecimalFormat(loc.tran.gross)#</td>
  								<td align="right">#DecimalFormat(loc.tran.net)#</td>
  								<td align="right">#DecimalFormat(loc.tran.vat)#</td>
  								<td align="right"></td>
  								<td align="right"></td>
  							</tr>
  						</cfcase>
  					</cfswitch>
  					<cfset loc.total.gross -= loc.tran.gross>
  					<cfset loc.total.net -= loc.tran.net>
  					<cfset loc.total.vat -= loc.tran.vat>
  					<cfset loc.total.disc += loc.disc>
  				</cfloop>
  				<tr>
  					<th>Totals</th>
  					<th></th>
  					<th>#loc.total.cash#</th>
  					<th align="right">#loc.total.retail#</th>
  					<th align="right">#DecimalFormat(loc.total.gross)#</th>
  					<th align="right">#DecimalFormat(loc.total.net)#</th>
  					<th align="right">#DecimalFormat(loc.total.vat)#</th>
  					<th align="right"></th>
  					<th align="right">#DecimalFormat(loc.total.disc)#</th>
  				</tr>
  				</cfoutput>
  			</table>
  			<cfcatch type="any">
  				<cfdump var="#cfcatch#" label="ShowTrans" expand="yes" format="html"
  					output="#application.site.dir_logs#epos\err-#DateFormat(Now(),'yyyymmdd')#-#TimeFormat(Now(),'HHMMSS')#.htm">
  			</cfcatch>
  		</cftry>
  	</cffunction>
  
  	<cffunction name="WriteTransaction" access="public" returntype="struct">
  