<?xml version="1.0" encoding="UTF-8"?>

<output>
     
    <ticket>
       <line>
         #set ($temp3 = 1)
         #set ($temp8 = 1)
         #foreach ($ticketline0 in $ticket0)
             #set ($temp1 = $ticketline0.getInteger("quantity"))
             #set ($temp5 = ${ticketline0.getString("todaysid")})
             #set ($temp6 = ${ticketline0.getString("endishname")})
             #set ($temp7 = "One Topping")
             #set ($temp9 = "Two Toppings")
             #set ($temp10 = "Three Toppings")

             #if ($temp6 == $temp7 || $temp6 == $temp9 || $temp6 == $temp10)
               #if ($temp8 > 1)
                 <text>P1</text>
               #end
               <text>N</text>
               #set ($temp3 = 1)
               #set ($temp8 = $temp8 + 1)
             #end
             
             #if ($temp3 > 4)
               <text>P1</text>
               <text>N</text>
               #set ($temp3 = 1)
             #end
             
             #set ($temp4 = 40 * $temp3 + 30)
             
             #foreach ($temp2 in [1..$temp1])
             <text>A30,30,0,4,1,1,N,"$temp5"</text>
             <text>A120,30,0,4,1,1,N,"$temp2/$temp1"</text>
             #end
             <text>A20,$temp4,0,4,1,1,N,"$temp6"</text>

             #set ($temp3 = $temp3 + 1)
             
        	#end
        	<text>P1</text>
       </line>
     </ticket>
    </output>