accodeing / fortnox-api

Gem that abstracts Fortnox's F3 API
GNU Lesser General Public License v3.0
9 stars 8 forks source link

Allow delivered_quantity to be negative #148

Closed mbirman closed 6 years ago

mbirman commented 6 years ago

Hi,

Many thanks for the gem, it's really useful.

I updated delivered_quantity attribute of the DocumentRow so it can be negative as well as over 9000.

Here is a real world example of why this is needed. When working with Systembolaget, we sometimes receive claims on goods that were sent by mistake, damaged during shipment etc. We have to include the claim sum on the next invoice, it looks like an invoice row with negative quantity. Fortnox allows it from the web version, and I believe it shouldn't be prohibited by the API wrapper.

Please review the changes and let me know if you have any questions or objections.

Cheers 🖖

ehannes commented 6 years ago

Hi @mbirman! This is (soon was) a know problem and on our TODO list, so many thanks for your contribution! We'll take a look at it.

Great to hear you are using our gem. It is currently under heavy development. Would you like to join our slack?

ehannes commented 6 years ago

@d-Pixie Rubocop is complaining: Example has too many lines [6/5], but in this case it's not much to do (mostly because of the long 9_999_999_999_999.9). Maybe we should just accept this and add an exception in CC? (I don't have the privileges, so it's up to you :smile_cat:)

d-Pixie commented 6 years ago

Welcome and thanks for the contribution. Fortnox documentation on exactly what is allowed is sometimes missing or unclear. We are happy to correct it though 😉

d-Pixie commented 6 years ago

@ehannes Agreed, not even real lines 😁 Added exception with won't fix.

d-Pixie commented 6 years ago

@mbirman I will release a new version of the gem with this change tomorrow. Look for version 0.6.2 😊

mbirman commented 6 years ago

Wow guys, you're fast 👍

@ehannes yes, I'd love to! Do you need my email or something?

ehannes commented 6 years ago

Concerns #95