現金端数処理用のPOS Exchange V2領収書メール通知を更新する
ストアがカスタマイズされた通知テンプレートを使用している場合は、領収書に キャッシュ四捨五入が 表示されるように、POS 交換 V2 領収 書メールを送信する通知を手動で更新する必要がある場合があります。
この変更を行うには、Shopifyの通知テンプレートで使用されているコードについて細部まで把握している必要があります。テンプレートが高度にカスタマイズされており、必要な変更を適用する方法が分からない場合は、その変更を行った開発者に連絡するか、デフォルトに戻すをクリックしてテンプレートを元の状態に戻します。デフォルトに戻すと、カスタマイズした内容はすべて削除されますが、デフォルトのテンプレートは最新バージョンのテンプレートになります。
POS Exchange V2の領収書メール通知を更新する
POS交換 V2 領収書通知を更新して、為替取引から発生する正味キャッシュ四捨五入額と、四捨五入された為替合計金額を領収書に表示できます。
手順
管理画面から、[設定] > [通知] に移動します。
[お客様通知] をクリックします。
**[POS]**セクションで、 **POS交換 V2 領収書]**をクリックします。
[コードを編集] をクリックします。
正味キャッシュの丸め量を計算し、それを
exchange_total
に追加するロジックを追加します。<span>Exchange total</span>
を含むコード ブロックを見つけます。- 既存のコード ブロックを、
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>