extends ../PaperTemplateLayout.pug

block head
  style
    if (isRtl)
      include ../../css/modules/payment-rtl.css
    else
      include ../../css/modules/payment.css

block content
 div.payment
  div.payment__header
    div.paper
      h1.title #{__("payment.paper.payment_receipt")}
      if paymentReceive.paymentReceiveNo
       span.paymentNumber #{paymentReceive.paymentReceiveNo}

    div.organization
      h3.title #{organizationName}
      if organizationEmail
       span.email #{organizationEmail}

  div.payment__received-amount
    div.label #{__('payment.paper.amount_received')}
    div.amount #{paymentReceive.formattedAmount}

  div.payment__meta
   div.payment__meta-item.payment__meta-item--billed-to
    span.label #{__("payment.paper.billed_to")}
    span.value #{paymentReceive.customer.displayName}

   div.payment__meta-item.payment__meta-item--payment-date
    span.label #{__("payment.paper.payment_date")}
    span.value #{paymentReceive.formattedPaymentDate}

  div.payment__table
   table 
    thead 
     tr
       th.item #{__("payment.paper.invoice_number")}
       th.date #{__("payment.paper.invoice_date")}
       th.invoiceAmount #{__("payment.paper.invoice_amount")}
       th.paymentAmount #{__("payment.paper.payment_amount")}
    tbody
      each entry in paymentReceive.entries
       tr
        td.item=entry.invoice.invoiceNo
        td.date=entry.invoice.invoiceDateFormatted
        td.invoiceAmount=entry.invoice.totalFormatted
        td.paymentAmount=entry.invoice.paymentAmountFormatted

  div.payment__table-after
    div.payment__table-total
      table
        tbody
          tr.payment-amount
            td #{__('payment.paper.payment_amount')}
            td #{paymentReceive.formattedAmount}
          tr.blanace-due
            td #{__('payment.paper.balance_due')}
            td #{paymentReceive.customer.closingBalance}

  div.payment__footer
    if paymentReceive.statement
     div.payment__notes
      h3 #{__("payment.paper.statement")}
      p #{paymentReceive.statement}