Skip to content

Instantly share code, notes, and snippets.

@pythonandchips
Last active September 10, 2019 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pythonandchips/fdf48b8a385b6f2d24e6f6d0d0fb646a to your computer and use it in GitHub Desktop.
Save pythonandchips/fdf48b8a385b6f2d24e6f6d0d0fb646a to your computer and use it in GitHub Desktop.
FCB DI ISSUE FIX
# This updates any bill that had incorrectly calculated vat effects
# when the bill was in foreign currency and was ether ec service or ec goods
# To be ran ater Fix PR is deployed https://github.com/fac/freeagent/pull/19751
def fix_fcb_di
bills = Bill.in_foreign_currency.where(
ec_status: [EcStatus::EC_SERVICES, EcStatus::EC_GOODS]
)
progress_bar = ProgressBar.new(bills.length)
bills.each do |b|
b.update_sales_tax_effects
progress_bar.increment!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment