Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When timetracking record added to new or existing invoice, the totalcustomercurr field for the invoice isn't set correctly.
If the invoice is edited and saved again afterward it does set it.
More investigation is needed.
To be honest, I'm not sure what this field is for. I haven't looked that deeply yet but I would have thought it would need some exchange rates.
Comment | File | Size | Author |
---|---|---|---|
#7 | storm--custcurr-07.patch | 967 bytes | juliangb |
#2 | storm--746420-2.patch | 776 bytes | juliangb |
Comments
Comment #1
juliangb CreditAttribution: juliangb commentedI think basically that this field takes the value of the total if left empty, and but is available for someone to manually input the total in another currency if required. I agree it needs a bit of clarification as to exactly which currencies are where.
I'm surprised that it isn't being filled in though, because part of the auto-add function calls
storminvoice_update
, which in turn calls_storminvoice_beforesave
- and there is code in there that should sort it out.Comment #2
juliangb CreditAttribution: juliangb commentedHere is a patch I think will partly solve it.
Sets the totalcustomercurr to be equal to the total. It is the equivalent action of the field being left blank when creating manually.
I think that the way that currencies are handled in Storm do need a bit of work...
tchurch: Assuming the patch passes, any comments to this method?
Comment #3
juliangb CreditAttribution: juliangb commentedRetest against dev.
Comment #4
juliangb CreditAttribution: juliangb commented#2: storm--746420-2.patch queued for re-testing.
Comment #5
tchurch CreditAttribution: tchurch commentedI ran the following test:
1) Clean all timetracking and invoices from database (using drupal to delete nodes).
2) tax1 is set to 17.5%, project set to 10.00 fixed (previous patch would be used).
2) Created timetracking with title "add to new".
3) Created timetracking with title "add to existing".
4) Created new invoice with timetracking "add to new".
Invoice field totalcustomercurr still set to 0. Invoice total is 11.75
5) Added "add to existing" timetracking record to this invoice.
Now field totalcustomercurr is 11.75 and total is 23.50.
6) I edit invoice, remove field totalcustomercurr and save. It then sets this field to the total again (as expected).
I'm not really sure what's happening here, as you said in #1.
On my side, it's not too important at the moment because the customer and website currency is the same, so this field isn't used or printed, I think.
Not sure if anyone else uses this function. If not and it's not causing problems, would it be an idea to reduce the priority to minor?
Comment #6
juliangb CreditAttribution: juliangb commentedAgreed - I don't think many people use this due to the need for the currencies integration to be a bit better.
That said, it'd be nice to get to the bottom of this at somepoint.
Comment #7
juliangb CreditAttribution: juliangb commentedHere's a patch that works for me.
Comment #8
juliangb CreditAttribution: juliangb commentedAs a bug, I'd expect to backport this to 1.x too.
I'll wait a week for comments, but this is RTBC from my point of view, so will commit after that unless problems are found.
Comment #9
juliangb CreditAttribution: juliangb commented#7: storm--custcurr-07.patch queued for re-testing.
Comment #10
juliangb CreditAttribution: juliangb commentedCommitted to 2.x. Retest on 1.x.
Comment #11
juliangb CreditAttribution: juliangb commented#7: storm--custcurr-07.patch queued for re-testing.
Comment #12
juliangb CreditAttribution: juliangb commentedCommitted to 1.x.