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 I add a timetracking to an invoice, it doesn't fill in the duration unit nor the rate for the item description. It is calculating the total correctly, though.
I've attached an image showing what it generates.
Comment | File | Size | Author |
---|---|---|---|
#17 | Selection_599-storm-2.0.png | 77.94 KB | Francewhoa |
#18 | Selection_600-storm-2.0-beta1.png | 70.19 KB | Francewhoa |
#16 | Selection_597.png | 84.65 KB | Francewhoa |
#16 | Selection_598.png | 37.17 KB | Francewhoa |
#14 | storm-invoice-labels.patch | 3 KB | juliangb |
Comments
Comment #1
juliangb CreditAttribution: juliangb commentedWhich price mode are you using on the organization and project?
Comment #2
Francewhoadavad, have you tried the steps at http://drupal.org/node/854056 ?
Comment #3
davad CreditAttribution: davad commented#1 I'm using the hourly price mode for both organization and project.
#2 I'm sorry, I don't see how that link helps. I've been using storm as a timetracker/invoice generator for some time now. After the latest time I upgraded the storm modules, I now have this problem when I add timetrackings to an invoice. For some reason it doesn't pull the duration unit or the rate for my hourly timetrackings.
Comment #4
juliangb CreditAttribution: juliangb commentedDo you remember which version you updated from?
If we can narrow down when this worked for you, and when it didn't, it will help us figure out if there is a specific change that stopped this from working.
Comment #5
davad CreditAttribution: davad commentedLooks like I upgraded from 6x-2.0 to 6.x-2.1 on December 27, 2012.
Comment #6
juliangb CreditAttribution: juliangb commentedThat's odd - there weren't many changes between then.
(Do you remember whether it was working in 2.0?)
Is there any chance that you could try reproducing the problem on the demo site at http://live.d6-storm.gotpantheon.com/storm ? That way, if the problem exists there, I can see all of the settings and debug more easily.
Comment #7
juliangb CreditAttribution: juliangb commentedI've now reproduced this error.
Note, I also get a PHP error, which may be related:
warning: Invalid argument supplied for foreach() in /[path]/modules/storm/storminvoice/storminvoice.module on line 754.
http://drupal-6-storm-project-management.beta-web.co.uk/node/4
Comment #8
juliangb CreditAttribution: juliangb commentedAnother link, that reproduces the problem more closely to the original screenshot.
http://drupal-6-storm-project-management.beta-web.co.uk/node/6
Comment #9
juliangb CreditAttribution: juliangb commentedI think I've spotted what is going on...
Just noting here to capture the info.
- In storminvoice.module (lines 1022 onwards), the text string is prepared
- It uses elements of $node, which will be the timetracking
- Whereas, the node that the info comes from is actually the project.
Needs to be changed to use the correct element of the "rate array", where this information is stored.
Comment #10
davad CreditAttribution: davad commentedGlad to hear it's reproducible :)
How is it supposed to grab the rate info? I've noticed that there are a couple places that you can set the rate (under organization, project, and task I think). Is it supposed to check each in turn or are some of those rates meant to capture other information?
Comment #11
juliangb CreditAttribution: juliangb commentedThe logic is actually quite clever (I didn't design it, so can say that!)
For a timetracking, it will first try to capture the information from a ticket, then move up the hierarchy through to task, project, and finally organization.
This means that you could set a default method for an organization, then override for a particular project or task.
Comment #12
davad CreditAttribution: davad commentedAnything I can do to help? If I don't get a response, I'll probably try to dig into the code from the notes from #9.
Comment #13
juliangb CreditAttribution: juliangb commentedSorry for the delay - lots to do on Storm at the moment and had been working on the rename.
I will try to post one soon.
Comment #14
juliangb CreditAttribution: juliangb commentedHere's an initial patch.
It will probably fail the testbot - this is expected at the moment.
It also needs significant manual testing.
Comment #15
juliangb CreditAttribution: juliangb commentedNote, from my testing, this doesn't get rid of the PHP warning, but I think it fixes the invoice item description.
Comment #16
FrancewhoaI tested patch in #14. Thx :) Bug is fix for rate, but bug is still present for hours.
Steps to reproduce bug
* Set Organization "Price mode" to "Hourly" $101
* Set Project "Price mode" to "Hourly" $102
* Set Task "Price mode" to "Hourly" $103
* Create ticket set "Price mode" to "Not Applicable"
* Add timetracking 1h
* Add timetracking to a new invoice. Storm will display the rate, the hours read 0h. Expected result is Hours should read 1h.
Notes
* Possible source of the bug. If you edit the ticket, set the "Duration" field to 2h, then add timetracking to a new invoice the invoice will display 2h. If you go back to edit the invoice set "Duration" to 0h and the "Price mode" to "Not applicable". Then add timetracking to a new invoice the invoice will display 0h. But it should display the rate set in the organization, or project, or task. In other words the hourly rate should be read in the following order: ticket > task > project > organization. If no hourly rate set in those then storm should display the usual message "Error whilst finding a rate from ticket, task, project and organization. Consider setting the pricemode and price for your client organizations to avoid this error."
* I also see the following error message but I ignored it as it's not yet fixed
warning: Invalid argument supplied for foreach() in [***]/storm/storminvoice/storminvoice.module on line 754.
Tested with
* Fresh D6.27
* Fresh Storm 6.x-2.x_2013-Feb-9
* Hourly rate under organization, project, task, ticket
* Tested by creating a ticket then create a timetracking item
Comment #17
FrancewhoaConfirming same bug is present in Storm 6.x-2.0 Last updated: February 19, 2012 - 03:35
Steps to reproduce: Find above comment #16
Tested with Drupal 6.28
Comment #18
FrancewhoaHope this helps to narrow down the source :)
Confirming same bug is present in Storm 6.x-2.0-beta1 Last updated: January 21, 2012 - 06:55
Steps to reproduce: Find above comment #16
Tested with Drupal 6.28
Comment #19
FrancewhoaGood news :)
Confirming bug is not present in Storm 6.x-1.37 Last updated: January 3, 2012 - 11:35
Tested with Drupal 6.27
Tests show that bug was introduced in Storm 6.x-2.0-beta1 Last updated: January 21, 2012 - 06:55
List of all changes in 6.x-2.0-beta1
Changes related to invoice only
- Feature #902962 by kfritsche: Added views support for storm icon and invoice status
- Feature #1178694 by juliangb | asb: Add currency to invoice node display.
- Bug fix by kfritsche: Fixed cannot paginate through expenses, invoiced and timetrackings without filtering date
- Task #1153672 by kfritsche: Added Views dateAPI support for expenses, invoices, tickets and timetrackings
- Feature #1018304 by jalama: Added Token support for Storm invoice.
Comment #20
juliangb CreditAttribution: juliangb commentedThanks for the testing Francois!
I'll take another look at this.