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

  <divider style="="/>
  <text align="center">{{.tin}}</text>
  <text align="center">{{.businessName}}</text>
  <text align="center">{{.locationName}}</text>
  <text align="center">{{.address}}</text>
  <text if="district" align="center">{{.district}}</text>
  <divider style="-"/>

  <feed lines="1"/>
  <text align="center" bold="true">{{.title}}</text>
  <feed lines="1"/>

  <!-- Date range (periodic-only) -->
  <text if="startDateStr" align="center">{{.startDateStr}} - {{.endDateStr}}</text>
  <divider style="-"/>

  <line if="uid">
    <text width="50%">ЈИД</text>
    <text width="50%">{{.uid}}</text>
  </line>
  <line if="dateTime">
    <text width="50%">ПФР време</text>
    <text width="50%">{{.dateTime}}</text>
  </line>
  <divider style="-"/>

  <feed lines="1"/>
  <text align="center" bold="true">УКУПАН ПРОМЕТ</text>
  <feed lines="1"/>
  <divider style="-"/>

  <text align="center">= Уплаћено =</text>
  <group each=".total.payments">
    <text>{{printf "%-32s%s" .label (fmtAmount .amount)}}</text>
  </group>
  <divider style="-"/>
  <text>{{printf "%-32s%s" "Укупно уплаћено" (fmtAmount .total.totalPaid)}}</text>

  <text align="center">= Стопе пореза =</text>
  <text>{{printf "%-20s%-14s%s" "Стопа" "Укупно" "Порез"}}</text>
  <divider style="-"/>
  <group each=".total.taxRates">
    <text>{{printf "%-20s%-14s%s" .label (fmtAmount .turnover) (fmtAmount .tax)}}</text>
  </group>
  <divider style="-"/>
  <text>{{printf "%-32s%s" "Укупан износ пореза" (fmtAmount .total.totalTax)}}</text>

  <group if="hasPerTxType">
    <feed lines="1"/>
    <divider style="="/>
    <feed lines="1"/>
    <text align="center" bold="true">ПРОМЕТ ПО ВРСТИ ТРАНСАКЦИЈЕ</text>
    <feed lines="1"/>
    <divider style="="/>
    <group each=".perTransactionType">
      <feed lines="1"/>
      <text align="center" bold="true">{{.label}}</text>
      <divider style="-"/>
      <text align="center">= Уплаћено =</text>
      <group each=".summary.payments">
        <text>{{printf "%-32s%s" .label (fmtAmount .amount)}}</text>
      </group>
      <divider style="-"/>
      <text>{{printf "%-32s%s" "Укупно уплаћено" (fmtAmount .summary.totalPaid)}}</text>
      <text align="center">= Стопе пореза =</text>
      <group each=".summary.taxRates">
        <text>{{printf "%-20s%-14s%s" .label (fmtAmount .turnover) (fmtAmount .tax)}}</text>
      </group>
      <divider style="-"/>
      <text>{{printf "%-32s%s" "Укупан износ пореза" (fmtAmount .summary.totalTax)}}</text>
    </group>
  </group>

  <feed lines="1"/>
  <text align="center" bold="true">= ОВО НИЈЕ ФИСКАЛНИ РАЧУН =</text>
  <feed lines="1"/>
  <text align="center">www.harmonypos.io</text>
  <feed lines="2"/>
</receipt>
