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

  <!-- Optional restaurant Wi-Fi block -->
  <group if="isRestaurant">
    <text>Wifi:</text>
    <text>Wifi Password:</text>
    <divider style="-"/>
  </group>

  <!-- Cashier / table / guest -->
  <text>{{printf "%-12s%s" "Kasir:" .cashier}}</text>
  <group if="isRestaurant">
    <text if="unitName">{{printf "%-12s%s" "Sto:" .unitName}}</text>
  </group>
  <text if="guest">{{printf "%-12s%s" "Gost:" .guest}}</text>
  <text>{{printf "%-12s%s" "Vreme:" .dateStr}}</text>
  <divider style="-"/>
  <feed lines="1"/>

  <!-- Items header -->
  <text>{{printf "%-6s%-24s%s" "Kol" "Artikal" "Iznos"}}</text>
  <divider style="-"/>

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

  <!-- Total -->
  <divider style="-"/>
  <text>{{printf "%-30s%s" "UKUPNO:" (fmtAmount .total)}}</text>
  <feed lines="1"/>

  <!-- Trailer -->
  <text align="center" bold="true">{{if eq .branchType "restaurant"}}OVO JE KOPIJA ZA SANK!!{{else if eq .branchType "retail"}}OVO JE KOPIJA ZA KASIRA!!{{else}}OVO JE KOPIJA ZA SANK!!{{end}}</text>
  <feed lines="3"/>
</receipt>
