Skip to content

Commit

Permalink
fix: Generate invoice for paid instant charges on subscription termin…
Browse files Browse the repository at this point in the history
…ation

Currently if an invoice with pay in advance charges is terminated, there
are edgecases were paid fees are not invoiced because of a boundaries
issues.

This change ensure all paid fees not already invoiced are included in an
invoice when the subscription is terminating ignoring boundaries.
  • Loading branch information
ancorcruz committed Oct 11, 2024
1 parent ed98903 commit 5d94cd9
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/services/invoices/advance_charges_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def create_group_invoice
invoice.invoice_subscriptions.each do |is|
is.subscription.fees
.where(invoice: nil, payment_status: :succeeded)
.where("CAST(fees.properties->>'timestamp' AS timestamp) <= ?", is.charges_to_datetime)
.update_all(invoice_id: invoice.id) # rubocop:disable Rails/SkipsModelValidations
end

Expand Down

0 comments on commit 5d94cd9

Please sign in to comment.