Skip to content

Instantly share code, notes, and snippets.

@philiplambok
Last active May 24, 2022 13:56
Show Gist options
  • Save philiplambok/5f78390d442c6f4ea0835570105dd4ff to your computer and use it in GitHub Desktop.
Save philiplambok/5f78390d442c6f4ea0835570105dd4ff to your computer and use it in GitHub Desktop.
Update the legacy invoice to enable manual transfer
# find the service
mekari_pay_addons_service = Service.find_by(name: "Jurnal Pay")
# find the related invoices
invoices = Invoice.where(service: service, status: %i[unpaid, expired], enable_manual_transfer: false)
# enable manual transfer for all the related invoices
invoices.update_all(enable_manual_transfer: true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment