<?xml version="1.0" encoding="UTF-8"?>
<receipt>
  <feed lines="1"/>

  <!-- Header -->
  <text align="center" bold="true">USER SALES REPORT</text>
  <feed lines="1"/>
  <divider style="-"/>

  <!-- User / date -->
  <text>{{printf "%-12s%s" "User:" .user.fullName}}</text>
  <text>{{printf "%-12s%s" "Date:" .dateStr}}</text>
  <divider style="-"/>

  <!-- Items header -->
  <text align="center">{{printf "%-24s%-12s%s" "Article" "Qty" "Total"}}</text>
  <divider style="-"/>

  <!-- Items -->
  <group each=".items">
    <text>{{printf "%-24s%-12s%s" .name (fmtQty .qty) (fmtAmount .total)}}</text>
  </group>

  <!-- Totals -->
  <divider style="-"/>
  <text align="right">{{printf "GRAND TOTAL: %s" (fmtAmount .grandTotal)}}</text>
  <divider style="="/>
  <text align="center">{{printf "Total Items Sold: %d" .itemCount}}</text>
  <feed lines="3"/>
</receipt>
