Allow voucher adjustment to be created with an amount of 0

Although unlikely, we should still be able to create a voucher amount
with. This can happen if the order.total is for instance.
This commit is contained in:
Gaetan Craig-Riou
2023-04-04 09:53:40 +10:00
committed by Maikel Linke
parent 9789911523
commit 5064bf5383

View File

@@ -94,8 +94,6 @@ class Voucher < ApplicationRecord
def create_adjustment(label, order, mandatory = false, _state = "open", tax_category = nil)
amount = compute_amount(order)
return if amount.zero? && !mandatory
adjustment_attributes = {
amount: amount,
originator: self,