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.

#7 storm--custcurr-07.patch967 bytesjuliangb
PASSED: [[SimpleTest]]: [MySQL] 260 pass(es). View
#2 storm--746420-2.patch776 bytesjuliangb
PASSED: [[SimpleTest]]: [MySQL] 58 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


juliangb’s picture

I 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.

juliangb’s picture

Status: Active » Needs review
776 bytes
PASSED: [[SimpleTest]]: [MySQL] 58 pass(es). View

Here 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?

juliangb’s picture

Version: 6.x-1.31 » 6.x-1.x-dev

Retest against dev.

juliangb’s picture

#2: storm--746420-2.patch queued for re-testing.

tchurch’s picture

Status: Needs review » Needs work

I 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?

juliangb’s picture

Priority: Normal » Minor

Agreed - 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.

juliangb’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Needs work » Needs review
967 bytes
PASSED: [[SimpleTest]]: [MySQL] 260 pass(es). View

Here's a patch that works for me.

juliangb’s picture

As 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.

juliangb’s picture

#7: storm--custcurr-07.patch queued for re-testing.

juliangb’s picture

Title: field totalcustomercurr for invoice not set correctly when adding timetracking record to invoice » field totalcustomercurr for invoice not set correctly when adding timetracking record to invoice
Version: 6.x-2.x-dev » 6.x-1.x-dev

Committed to 2.x. Retest on 1.x.

juliangb’s picture

#7: storm--custcurr-07.patch queued for re-testing.

juliangb’s picture

Status: Needs review » Fixed

Committed to 1.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.