From 5064bf5383cbc954de60f3a8e41363df6f73adaa Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 4 Apr 2023 09:53:40 +1000 Subject: [PATCH] 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. --- app/models/voucher.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/models/voucher.rb b/app/models/voucher.rb index 99707fd5e0..6522305857 100644 --- a/app/models/voucher.rb +++ b/app/models/voucher.rb @@ -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,