Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Migrate invoices names with invalid amounts #27

Draft
wants to merge 2 commits into
base: fix/invoices-date-parsing
Choose a base branch
from

Conversation

taratatach
Copy link
Collaborator

Coopcycle can display orders amounts in French numeric format using
a comma instead of a dot as decimals separator as is expected by
Javascript numbers processing functions (e.g. toFixed and
parseFloat).
Since we were not replacing the commas with dots, this resulted in
invoices being downloaded with the wrong amount and filename (since it
contains the invoice amount).

Now that we've fixed the amount parsing we need to migrate the
invoices filenames using shouldReplaceName.

@taratatach taratatach requested a review from LucsT January 2, 2021 17:32
@taratatach taratatach self-assigned this Jan 2, 2021
  Coopcycle can display orders amounts in French numeric format using
  a comma instead of a dot as decimals separator as is expected by
  Javascript numbers processing functions (e.g. `toFixed` and
  `parseFloat`).
  Since we were not replacing the commas with dots, this resulted in
  invoices being downloaded with the wrong amount and filename (since it
  contains the invoice amount).

  Now that we've fixed the amount parsing we need to migrate the
  invoices filenames using `shouldReplaceName`.
Problèmes à régler :
  - les attributs des entries passées à saveFiles ou saveBills ne sont pas sauvegardés dans CouchDB !!!
  - cela inclut vendorRef qui ne peut alors être utilisé lors de la déduplication a posteriori
  - il faut pour cela préciser l’option fileIdAttributes: ['vendorRef'] dès le début
@taratatach taratatach force-pushed the fix/old-invoices-names-with-invalid-amount branch from 2131c9b to e6a9b94 Compare January 2, 2021 17:34
@LucsT
Copy link
Contributor

LucsT commented Jan 4, 2021

Seems a good strategy to me, if generating invalid filename is robust.

Is there a problem with it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants