Use below script in SQL.CloseCash to print open items
Administrator Menu > Maintenance > Resources
Copy paste below code in SQL.CloseCash:
SELECT TICKETS.TICKETID, CONVERT(ExtractValue(CAST(TICKETLINES.ATTRIBUTES AS binary), "//entry[@key="product.name"]") USING utf8) AS PRODUCT, UNITS, FORMAT(PRICE,2) FROM TICKETLINES JOIN RECEIPTS ON TICKETLINES.TICKET = RECEIPTS.ID AND RECEIPTS.MONEY=? JOIN TICKETS ON TICKETS.ID = TICKETLINES.TICKET WHERE TICKETLINES.PRODUCT IS NULL GROUP BY RECEIPTS.ID ORDER BY RECEIPTS.DATENEW;
Save
Copy paste below code in Close Cash reports:
<line></line> <line> <text align ="center" length="48">OPEN ITEMS</text> </line> <line> <text length="10">Receipt</text> <text length="23">Product</text> <text length="5">Units</text> <text align="right" length="10">Price</text> </line> <line> <text>------------------------------------------------</text> </line> #foreach ($line in $payments.getSQLResult().get(0)) <line> <text length="10">${line.printValue(0)}</text> <text length="23">${line.printValue(1)}</text> <text length="5">${line.printValue(2)}</text> <text align ="right" length="10">${line.printValue(3)}</text> </line> #end <line> <text>------------------------------------------------</text> </line>
Save
Leave a Reply