Skip to content

Commit

Permalink
update state machine
Browse files Browse the repository at this point in the history
  • Loading branch information
olegphenomenon committed Feb 27, 2023
1 parent d28afca commit 06d34e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/invoice_state_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def mark_as_cancel
end

def mark_as_unpaid
return push_error if invoice.paid? && invoice.payment_orders.last.payment_reference? || invoice.cancelled?
return push_error if invoice.paid? && invoice.payment_orders&.last&.payment_reference? || invoice.cancelled?
return true unless invoice.paid?

invoice.cancel_manualy
Expand Down

0 comments on commit 06d34e3

Please sign in to comment.