Hey guys,
first my thanks for this great module!
I´m developing a module, which gives a user the possibilty to define recurrings on an expense (in step 2 this should also work for any "recurrable" item such as invoice etc...).
The user may define an interval (daily, monthly, weekly), a starting date and an ending date. Depending on interval and the dates the module creates an expense node automatically, the expensedate set up by the defined reurring. For that the module hooks into the expense-process via form_alter and nodeapi. It overrides the given theme-function so there are no hacks! btw. the logical code of the theme-functions should be roll out to seperate functions so other modules may call them.
Is the any interest by the maintainers to commit such a module (called stormrecurring) into the storm-project? Otherwise I would like to contribute that module. Your choice :-)
greetz alex
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | stormrecurring.txt | 12.38 KB | kasalla |
| #4 | stormrecurring.txt | 11.71 KB | kasalla |
| #2 | stormrecurring.tgz | 3.13 KB | kasalla |
Comments
Comment #1
Magnity commentedWould you be able to post the code?
I'd need to have a look at how it works, and how general it is etc.
Thanks!
Comment #2
kasalla commentedHere is the first version of that module. It works for me, although I didn´t test it very much.
@all non-maintainers: This module is neither stable nor ready to use until the storm-team commits it in any way. If you still want to use, do it on your own risk. If Magnity likes it, your very welcome to test :-)
Comment #3
Magnity commentedOK, a few comments. I've had a brief read through, but haven't tested anything yet.
It will speed me along the way if you'd be able to post a quick overview of how it works too.
.info file:
- Lines 9 onwards: These aren't necessary. They'll be added automatically for any modules hosted on drupal.org
.admin.inc file:
- I like the way you've prepared for the future in setting up admin settings functions, but in the other storm modules these are all in the .module files - might be simplest to follow suit, then you won't need the .admin.inc file.
General:
- Drupal coding standards like indentations to be 2 spaces. Makes it easier to read.
- There are a few spelling errors through it as well I think - not a problem for a module to use for yourself, but its the sort of thing that'd be good to fix if releasing.
I think if this is to be committed to Storm, it would be as a feature within Storm Expense rather than a separate module.
I'll test in more detail in due course.
Btw - if you could post raw text files on the issue, I can provide much better reviews (courtesy of dreditor)...
Comment #4
kasalla commentedOk,
about this module:
This module gives user the ability to define recurring dates for expenses. He can define a beginning date and an ending date and an interval in which the recurring expense shall take place. On submitting the expense node the module checks the dates and the intervall and creates new expence nodes (flagged as a recurring expense ) directly. It calculates the time period between the defined dates and, depending on the interval, creates as many nodes as the result of the calculation is. The new expende node(s) is internally flagged as a recurring, so no recurrings for this node can be defined. Also the title of the node is custimized to "nodetitle (#number_recurring: date)".
Further the user may delete the created nodes by checking the appropriate delete-checkbox.
All recurring expenses are listed at the original expense node.
Example: If you have a recurring expense like your office rent, you may define a recurring like >>monthly, from 01/01/2010, to 01/01/2011<<. This would create 12 new expense nodes, each with an expensedate of each month in the year 2010.
I customized the .info-file, deleted the admin.inc (put func in .module-file), put spaces between dots (is this what you meant?) and reviewed spelling. I´m not a native speaker, so if I missed some corrections please forgive me :-)
I would let this module be a module, because there are some other storm-types, like incoive, which may have recurring items. With some customization you could use this code to rule them all. Otherwise the functionality needs to be included into every single sub-module. But in the end, again, it´s your choice :-)
Attached the textfile. I did some additional theming stuff.
PS: Is the attached file ok?
Comment #5
Magnity commentedBy spaces, I mean this:
instead of this:
Anyway, to confirm, I'll test soon.
Still doubtful about the functionality being in its own module. There are ways to avoid duplicating code, but there are already lots of modules that come with the Storm project, and so I don't think another will help a new user thinking about which ones to install.
@all: Feel free also to test / comment on this functionality - disclaimer as per #2 that it is work in progress!
Comment #6
kasalla commentedok, so when it´s stable it might go to stormexpense.
Wait a second with testing, there were several issues, which I didnt discover on my debug-system but on test-system.... grrr...
One of them: the expensedate is saved as a ten digit timestamp to db. My hook replaces/inserts a nine digit one, which leads to a wrong date format. I´m still checking :-)
Comment #7
kasalla commentedI´m still checking the timestamp thing. But there were other critical issues, which are solved/postponed.
- The creation of recurring expenses on a new node doesn´t work. If a expense is existing, it´s fine. If not, a lot of php errors occured (didn´t copy them). some relating to cck...For now i disabled defining recurrings on new nodes. -> "hidden/postponed".
- One deletion of a expense the recurrings were not deleted too. -> fixed
Comment #8
alberto56 commentedHi,
I was about to create a module to deal with recurring storm expenses, and stumbled upon this post.
Perhaps it might be a good idea to use the cron system to create new expenses as they are need rather than create them all at the same time. If you create, say, twelve monthly expense nodes for the coming year, you still will have to redo the operation a year later if your recurring expense is renewed; on the other hand, if the recurring expense is cancelled before twelve occurences, then you have to delete them all.
Thanks for your work!
Albert.
Comment #9
Magnity commentedYes, I think using the cron system would be better. The module attached above may work for people if they want it, but for committing I think we need to rework it a bit.
Comment #10
kasalla commentedHey guys,
sorry for the late response. I´m really busy...
Apart form changing to cron (and some issues i´ll fix), what else needs to be changed for a commiting?
cheers Alex
Comment #11
Magnity commentedFor committing, I'll also need it in patch format. Instead of being stormrecurring, having the functionality added in to the existing Storm modules.
Can't guarantee there won't be a few other things - but if you post a patch and mark needs review, we'll have a look.
Comment #12
kasalla commentedNever did a functionality as a patch. ok, i will have a look, how it works...
Comment #13
Magnity commentedInstructions on how to patch Storm: http://drupal.org/node/253481/cvs-instructions/DRUPAL-6--1
Comment #14
JoshuaM commentedIt's a pity this feature request died out. I was hoping it was pursued to allow recurring schedules for all Storm modules. I am looking for a way to create recurring tasks... Each recurring task will be a different billable amount.
Comment #15
asb commented@JoshuaM: I'd need the same feature for recurring (maintenance) tasks; in my use case, I'd not core too much about expenses/billing, but would like to get rid of copying/pasting the same tasks all over again.
Comment #16
juliangb commentedChanging status & version (6.x-1.x branch is now bug fixes only).