現金取引の端数調整に対応するため、POS 交換 V2 領収書のメール通知を更新する

ストアで カスタマイズされた通知テンプレートを使用している場合は、領収書に 現金取引の端数調整が確実に表示されるように、POS 交換 V2 領収書のメール通知を手動で更新する必要がある場合があります。

これらの変更には、Shopify の通知テンプレートで使用されているコードに関する知識が必要です。テンプレートが高度にカスタマイズされていて、必要な変更を適用する方法がわからない場合は、変更を行った開発者にお問い合わせいただくか、[デフォルトに戻す] をクリックしてテンプレートを元の状態に復元してください。デフォルトに戻すと、すべてのカスタマイズが削除されますが、デフォルトのテンプレートを使用することで、最新のテンプレートバージョンを確実に利用できます。

POS 交換 V2 領収書のメール通知を更新する

POS 交換 V2 領収書の通知を更新して、交換取引から生じる正味の現金取引の端数調整額を、領収書の端数処理済み交換合計金額とともに表示できます。

手順:

  1. Shopify 管理画面から、[設定] > [通知] に移動します。

  2. [お客様への通知] をクリックします。

  3. [POS] セクションで、[POS 交換 V2 領収書] をクリックします。

  4. [コードを編集] をクリックします。

  5. 正味の現金取引の端数調整額を計算し、それを exchange_total に追加するロジックを追加します。

    1. <span>Exchange total</span> を含むコードブロックを見つけます。
    2. 既存のコードブロックを、net_exchange_rounding を計算して exchange_total に追加する次のコードブロックに置き換えます。
<table class="row subtotal-table">
  <div class="subtotal-table--total subtotal-table--total-no-border">
    <tr class="subtotal-line">
      <td class="subtotal-line__title">
        <p>
          <span>Exchange total</span>
        </p>
      </td>
      <td class="subtotal-line__value">
        <strong>{% if exchange_total < 0 %}-{% endif %}{{ exchange_total | abs | money_with_currency }}</strong>
      </td>
    </tr>
  </div>
  {% assign net_exchange_rounding = 0 %}
  {% for transaction in transactions %}
    {% if transaction.status == "success" %}
      {% if transaction.kind == "sale" or transaction.kind == "capture"  %}
        {% if transaction.amount_rounding != nil %}
          {% assign net_exchange_rounding = net_exchange_rounding | plus: transaction.amount_rounding %}
        {% endif %}
      {% elsif transaction.kind == "refund" or transaction.kind == "change" %}
        {% if transaction.amount_rounding != nil %}
          {% assign net_exchange_rounding = net_exchange_rounding | minus: transaction.amount_rounding %}
        {% endif %}
      {% endif %}
    {% endif %}
  {% endfor %}
  {% if net_exchange_rounding != 0 %}
    <table class="row subtotal-table subtotal-table--total">
      <div class="subtotal-line__value-small">
        <tr class="subtotal-line">
          <td class="subtotal-line__title">
            <p> <span>Cash rounding</span> </p>
          </td>
          <td class="subtotal-line__value">
            <strong>{% if net_exchange_rounding < 0 %}-{% endif %} {{ net_exchange_rounding | abs | money }}</strong>
          </td>
        </tr>
      </div>
    </table>
    <table class="row subtotal-table subtotal-table--total">
      {% assign rounded_exchange_total = exchange_total | plus: net_exchange_rounding %}
      {% if rounded_exchange_total > 0 %}
        <tr class="subtotal-line">
          <td class="subtotal-line__title">
            <p> <span>Paid</span> </p>
          </td>
          <td class="subtotal-line__value">
            <strong>{{ rounded_exchange_total | money_with_currency }}</strong>
          </td>
        </tr>
      {% elsif rounded_exchange_total < 0 %}
        <tr class="subtotal-line">
        <td class="subtotal-line__title">
          <p> <span>Refund</span> </p>
        </td>
        <td class="subtotal-line__value">
          <strong>-{{ rounded_exchange_total | abs | money_with_currency }}</strong>
        </td>
      </tr>
      {% else %}
        <tr class="subtotal-line">
          <td class="subtotal-line__title">
            <p> <span>Adjusted exchange total</span> </p>
          </td>
          <td class="subtotal-line__value">
            <strong>{{ rounded_exchange_total | money_with_currency }}</strong>
          </td>
        </tr>
      {% endif %}
    </table>
  {% endif %}
</table>