<?xml version="1.0" encoding="UTF-8"?>
<!--
Posics Saleculator - Billing System.
Copyright (C) 2009 Posics
This file is part of Posics Saleculator.
-->
<output>
<sql><![CDATA[
SELECT TICKETS.TICKETID, RECEIPTS.DATENEW,
SUM((TICKETLINES.PRICE + TICKETLINES.PRICE * TAXES.RATE) * TICKETLINES.UNITS),
SUM((TICKETLINES.PRICE * TAXES.RATE) * TICKETLINES.UNITS)
FROM RECEIPTS
JOIN TICKETS ON RECEIPTS.ID = TICKETS.ID AND (TICKETS.TICKETTYPE=0 OR TICKETS.TICKETTYPE=1)
JOIN TICKETLINES ON TICKETLINES.TICKET = RECEIPTS.ID
JOIN TAXES ON TICKETLINES.TAXID = TAXES.ID
WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate
GROUP BY TICKETS.TICKETID, RECEIPTS.DATENEW
ORDER BY RECEIPTS.DATENEW
]]></sql>
<ticket>
<image>Printer.Ticket.Logo</image>
<line></line>
<line size="1">
<text align ="center" length="48" bold="true">Sales Log</text>
</line>
<line></line>
<line>
<text length="12">Start Date:</text>
<text length="36">$startDate</text>
</line>
<line>
<text length="12">End Date:</text>
<text length="36">$endDate</text>
</line>
<line>
</line>
<line>
<text align ="left" length="5">#</text>
<text align ="left" length="20">Date</text>
<text align ="right" length="13">Total</text>
<text align ="right" length="10">Tax</text>
</line>
<line>
<text>------------------------------------------------</text>
</line>
#foreach ($line in $posreport.getResult())
<line>
<text align ="left" length="5">${line.printValue(0)}</text>
<text align ="left" length="20">${line.printDate(1)}</text>
<text align ="right" length="13">${line.printCurrency(2)}</text>
<text align ="right" length="10">${line.printCurrency(3)}</text>
</line>
#end
<line>
<text>------------------------------------------------</text>
</line>
<line>
<text align ="left" length="5">Total</text>
<text align ="left" length="20"></text>
<text align ="right" bold="true" length="13">$posreport.printTotal(2)</text>
<text align ="right" bold="true" length="10">$posreport.printTotal(3)</text>
</line>
</ticket>
</output>
Leave a Reply