Defend from an order w/o payments when building table

This commit is contained in:
Matt-Yorkley
2020-06-11 12:37:51 +02:00
parent e84e0aebe6
commit e725f33318

View File

@@ -77,7 +77,7 @@ module OpenFoodNetwork
ba.phone, ba.phone,
order.shipping_method.andand.name, order.shipping_method.andand.name,
order.payments.first.andand.payment_method.andand.name, order.payments.first.andand.payment_method.andand.name,
order.payments.first.amount, order.payments.first.andand.amount,
OpenFoodNetwork::UserBalanceCalculator.new(order.email, order.distributor).balance] OpenFoodNetwork::UserBalanceCalculator.new(order.email, order.distributor).balance]
end end
@@ -92,7 +92,7 @@ module OpenFoodNetwork
sa.phone, sa.phone,
order.shipping_method.andand.name, order.shipping_method.andand.name,
order.payments.first.andand.payment_method.andand.name, order.payments.first.andand.payment_method.andand.name,
order.payments.first.amount, order.payments.first.andand.amount,
OpenFoodNetwork::UserBalanceCalculator.new(order.email, order.distributor).balance, OpenFoodNetwork::UserBalanceCalculator.new(order.email, order.distributor).balance,
has_temperature_controlled_items?(order), has_temperature_controlled_items?(order),
order.special_instructions] order.special_instructions]