mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
render null shipment when shipment adjustment doesn't exist
This commit is contained in:
@@ -72,7 +72,15 @@ class Invoice
|
||||
|
||||
# contains limited information about the shipment
|
||||
def shipment
|
||||
shipment_adjustment.adjustable
|
||||
shipment_adjustment&.adjustable || null_shipment
|
||||
end
|
||||
|
||||
def null_shipment
|
||||
Struct.new(
|
||||
:amount,
|
||||
:included_tax_total,
|
||||
:additional_tax_total,
|
||||
).new(0, 0, 0)
|
||||
end
|
||||
|
||||
def display_shipment_amount_without_taxes
|
||||
|
||||
Reference in New Issue
Block a user