Pos receipt show mode of payment

need to show mode of payment on my receipts in pos

Here you go. Complete format which we use. FYI this is for VAT inclusive items print. You may have to customer some lines.

<style>
  .print-format table,
  .print-format tr,
  .print-format td,
  .print-format div,
  .print-format p {
    font-family: arial;
    line-height: 100%;
    vertical-align: middle;
  }
  @media screen {
    .print-format {
      width: 4in;
      padding: 0.15in;
      min-height: 5in;
    }
  }
</style>

<p class="text-center">
 <b class="text-center" style="margin-bottom: -5px !important;">INVOICE<br /></p>
  <h4 class="text-center" style="margin-bottom: -5px !important; margin-top: -5px !important;">Eagle Hills COMPANY</h4><br />
<p class="text-center" style="margin-top: -10px !important;">
  Address,<br />
  Address<br />
  Address,<br />
  Address<br />
  Phone No.: <br />
  VAT ID: XXXXX</b>
</p>
<p>
  <b>{{ __("Bill No.") }}:</b> {{ offline_pos_name }}<br />
  <b>{{ __("Customer")  }}:</b> {{ customer_name }}<br />
   <b>{{ __("Date") }}:</b> {{
  frappe.datetime.str_to_user(posting_date) }} : {{ posting_time }}<br />
</p>

<table
  class="table table-condensed cart no-border"
  style="margin-top: 0px !important;"
>
  <thead>
    <tr style="font-size:10px">
      <th width="40%">{{ __("Item") }}</th>
      <th width="15%" class="text-right">{{ __("Qty") }}</th>
      <th width="15%" class="text-right">{{ __("Net Total") }}</th>
      <th width="15%" class="text-right">{{ __("VAT Amt") }}</th>
      <th width="15%" class="text-right">{{ __("Total") }}</th>
    </tr>
  </thead>
  <tbody>
    {% for item in items %}
    <tr>
      <td style="font-size:9px">
     <b>   {{ item.item_name }}
      </td>
      <td class="text-right" style="font-size:9px">
        {{ item.qty }}<br />
        @BHD {{ item.rate }}
      </td>
      <td class="text-right" style="font-size:9px">
        {{ format_currency (item.amount) }}
      </td>
      <td class="text-right" style="font-size:9px">{{  format_currency (item.qty * item.rate * (item.item_tax_rate ? (JSON.parse(item.item_tax_rate)[`VAT - LP`] || 0) : 0)/100) }}</td>
      <td class="text-right" style="font-size:9px">
   {{ format_currency ( (item.rate * item.qty) + (item.qty * item.rate * (item.item_tax_rate ? (JSON.parse(item.item_tax_rate)[`VAT - LP`] || 0) : 0)/100), currency, 3) }} </b>
      </td>
    </tr>
    {% endfor %}
  </tbody>
</table>


<table class="table table-condensed no-border">
  <tbody>
{% if discount_amount %}
<tr>
      <td class="text-right" style="width: 60%; margin-bottom: -5px !important; margin-top: -5px !important;"><b>{{ __("Net Total") }}</b></td>
      <td class="text-right"><b>{{ format_currency(total, currency) }}</b></td>
    </tr>
    <tr>
      <td class="text-right" style="width: 40%; margin-bottom: -5px !important; margin-top: -5px !important;">{{ __("Discount") }}</td>
      <td class="text-right">
        {{ format_currency(discount_amount, currency) }}
      </td>
    </tr>
    {% endif %}

    <tr>
      <td class="text-right" style="width: 60%; margin-bottom: -5px !important; margin-top: -5px !important;"><b>{{ __("Net Total") }}</b></td>
      <td class="text-right"><b>{{ format_currency(net_total, currency) }}</b></td>
    </tr>
    <tr>
      <td class="text-right" style="width: 60%; margin-bottom: -5px !important; margin-top: -5px !important;"><b>{{ __("VAT") }}</b></td>
      <td class="text-right"><b>{{ format_currency(base_total_taxes_and_charges, currency) }}</b></td>
      </tr>
    <tr>
      <td class="text-right" style="width: 60%; margin-bottom: -5px !important; margin-top: -5px !important;"><b>{{ __("Grand Total") }}</b></td>
      <td class="text-right"><b>{{ format_currency(grand_total, currency) }}</b></td>
    </tr>
    <tr>
      <td class="text-right" style="width: 60%; margin-bottom: -5px !important; margin-top: -5px !important;"><b>{{ __("Paid Amount") }}</b></td>
      <td class="text-right"><b>{{ format_currency(paid_amount, currency) }}</b></td>
    </tr>
    <tr>
      <td class="text-right" style="width: 60%; margin-bottom: -5px !important; margin-top: -5px !important;"><b>{{ __("Change Amount") }}</b></td>
      <td class="text-right"><b>{{ format_currency(change_amount, currency) }}</b></td>
    </tr>
    <tr>
      <td class="text-right" style="width: 60%; margin-bottom: -5px !important; margin-top: -5px !important;"><b>{{ __("Payment") }}</b></td>
      <td class="text-right"></td>
    </tr>
    {% var combined_mops = ['Machine 1 ', 'Machine 2', 'Machine 3']; %}
    {% payments.filter(({ mode_of_payment, amount }) => !combined_mops.includes(mode_of_payment) && amount !== 0).forEach(payment => { %}
    <tr>
      <td class="text-right" style="width: 65%; border: none;">{{ __(payment.mode_of_payment) }}</td>
      <td class="text-right" style="border: none;">{{ format_currency(payment.amount , currency)}}</td>
    </tr>
    {% }) %}
    {% var card_amount = payments.filter(({ mode_of_payment }) => combined_mops.includes(mode_of_payment)).map(({ amount }) => amount).reduce((a, x) => a + flt(x), 0); %}
    {% if card_amount %}
    <tr>
      <td class="text-right" style="width: 65%; border: none; margin-bottom: -5px !important; margin-top: -5px !important;">{{ __("Card") }}</td>
      <td class="text-right" style="border: none;">{{ format_currency(card_amount , currency)}}</td>
    </tr>
    {% endif %}
    
  </tbody>
</table>

<p class="text-center" style="margin-top: -30px !important;">
  <img src="{{ pos_name_barcode_uri }}" /><br />
  <b>{{ __("Terms & Conditions Apply.") }}
  <br />
  !!!Payments are NON-REFUNDABLE. Enjoy & Be Safe!!!</b>
</p>

Cheers

3 Likes

@Muzzy have tried your code but would not allow me to save, getting some errors on the code.

Has the code syntax changed on the latest ERPnext version? what version of ERPnext you were using?

I am using ERPnext v13.13.0, please share the latest code that would work on the latest version, thanks.

Please be specific about the code. Can’t assist without knowing nature of the code. Why don’t you share the error code and your print format.