针对现金舍入更新 POS 打印收据

如果您的商店使用通过代码编辑器自定义的 POS 收据,您可能需要手动更新您的 POS 打印收据,以确保收据上显示现金舍入。若您使用的是收据可视化编辑器,现金舍入调整金额和调整后的总额会自动打印在您的收据上,您无需更新收据。

这些更改要求您熟悉收据模板中的 Liquid 代码。如果您的模板已高度自定义,而您不确定如何应用必要的更改,请联系进行更改的开发人员。收据代码编辑器不支持将模板重置为默认值。如需恢复为默认模板,请迁移至收据可视化编辑器。

更新 POS 打印收据

您可以更新 POS 打印收据,以便在收据中显示支付和退款交易的现金舍入调整总金额以及舍入后的总金额。

开始操作前,请打开收据代码编辑器。具体的打开步骤取决于您的所有 POS 地点是否有资格使用该代码编辑器。

步骤:

  1. 在收据代码编辑器的 transactions.liquid 模板中,找到包含 <section class='totals'> 的代码块。
  2. 在此部分的末尾(即在代码打印 receipt.total 之后),如果订单中存在现金舍入,请添加 order.total_cash_rounding_adjustment 和 order.total_adjusted_amount Liquid 变量,POS 客户端将把它们分别设置为现金舍入调整总金额和舍入后的总金额。
{% if order.total_cash_rounding_adjustment %}
    {% comment %} order.total_cash_rounding_adjustment is a string, converting for safety edited {% endcomment %}
    {% assign rounding = order.total_cash_rounding_adjustment | plus: 0 | abs %}
    {% if rounding > 0 %}
      <div class='rounding-row-top-border'></div>
      <div class='totals-container'>
        <p class='totals-text'>{{ 'receipt.cash_rounding' | t | capitalize }}</p>
        <p>{{ order.total_cash_rounding_adjustment | money | escape }}</p>
      </div>
      <div class='totals-container'>
        <p class='totals-bold-text'>{{ 'receipt.adjusted_total' | t | capitalize }}</p>
        <p class='price'>{{ order.total_adjusted_amount | money | escape }}</p>
      </div>
    {% endif %}
  {% endif %}