BambooInvoice Forums

HOWTO: Recurring / Automatic invoice generation WORKS!

 
Total Posts: 2324

Hey Paul.

At this stage, this is a “one day I hope to get it in there” feature. For example, how would we handle servers without access to cron? Self-hosted apps are limited in that I don’t get to control the server configuration.

Total Posts: 4

Derek,

Thanks for the fast response.  I will talk to a colleague about this and see if we can come up with anything.

My immediate thought is, if there’s no access to cron, either the feature is unavailable - no difference to now - or, is there a way of sending a calendar event to the administrator when a “recurring invoice date/frequency” is entered, so that even though the Invoice won’t recur automatically, the admin will be reminded to send the next Invoice?
- many of my ‘immediate thoughts’ are discarded just as quickly wink

I realize that there are many permutations to work through.  Do you have a wiki, or somewhere we could set up a shared document, so that those with interest in this could work together with you on creating a specification?

BFN,
Paul

Total Posts: 2324

Sorry Paul, there is no such area.

Total Posts: 4

OK.  I could set up a Google Doc (but then only available to those with Google Accounts) or “Disposable Web page” as low-tech ways to do this.  Alternatively I’d be happy to host or set-up a wiki to help with this, if you think you could/would participate.

Your previous post on 02 January 2009 10:46 AM would be a good starting point with questions we, the BI community, could answer.

As I’ve indicated, I’m not asking for this without being prepared to help, but I’d like to help give this a higher priority in your project if that’s possible.

Paul

Total Posts: 1

Easy way to get around a lack of CRON would be an option to run when the login page is accessed

perhaps with an extra marker to show when the script was last run so it would only run at most once per day,

unless someone were checking in every day it wouldn’t be to the day but it would generate the invoices automatically,

getting into extra features there could be an alert message after login displaying links to invoices that were auto-created using a simple flag whether the invoice had been viewed yet…

easy to get carried away on this

Total Posts: 4
amites - Jan 06, 2010 08:33pm

easy to get carried away on this

Please do - it seems that’s what it needs ;)  I would like to but am in the middle of a couple of large projects.  I did set up a temporary website to work through these ideas but hadn’t had enough time to get it to the stage I’d like to: http://disposablewebpage.com/turn?page=6qmBg9HNqt

I need to do another test installation of BI and play with it some more.

On your idea… that sounds like a feasible ‘back up plan’ to cron, run the script on login.  Perhaps Derek will comment on this.

Total Posts: 3

Hiya:

I know there were a few people asking for more flexibility with days, months etc ... for me days don’t work very well because I want the system to generate an invoice, then I can check against my automatic payments system from credit and debit cards to see if they have paid.  If I set it to 30 days it jumps around the calendar a bit and makes this more difficult.  As I result I’ve mod the mod every so slightly to it would work on months instead of days.

To do this I change these three files to read “months” instead of “days”:

bamboo_system_files/application/views/invoices/edit.php
bamboo_system_files/application/views/invoices/newinvoice.php
bamboo_system_files/application/views/invoices/view.php

and then editted bamboo_system_files/application/controllers/recur.php

CHANGED:  if ($today == date(‘Y-m-d’, strtotime($row_a->dateIssued) + ($recur_interval * 24 * 60 * 60)))

TO:
$BenDI = strtotime($row_a->dateIssued);
if ($today ==  date(‘Y-m-d’, mktime(0,0,0, date(“m”, $BenDI) + $recur_interval, date(“d”, $BenDI), date(“y”, $BenDI))))


and that seems to have done the trick.  I did on Friday and today is Monday and it seems to be all working, but would be lying if I said I did a whole lot of testing.  I’ll let you know if anything goes wrong!

Thanks for the Mod!  It has saved me having to change over to a new system! :-D

-Ben.

Total Posts: 36
bwaymark - Feb 08, 2010 01:18pm

$BenDI = strtotime($row_a->dateIssued);
if ($today ==  date(‘Y-m-d’, mktime(0,0,0, date(“m”, $BenDI) + $recur_interval, date(“d”, $BenDI), date(“y”, $BenDI))))

Theres a problem with this I think. What happens if you create an invoice on 31st of January? Because theres no 31st of February no invoice will get issued that month or any month after. Also Im not sure what mktime will do when it adds the recur_interval of say 1 to the 12th month, will it make it the 13th month?
Cheers
Felix

Total Posts: 36

A follow up from my previous post it appears from what I’ve read if you create an invoice on Jan 31 and its not a leap year the recur event should run on march 3rd. Then because every month has a 3rd day it would then recur every 3rd day of the months. Also from what I’ve read if the month rolls over to 13 mktime will decipher that as January. So I think this will work you just have to be aware of those invoices created after the 28th of a month will end up with a recur day early in the following month starting from the first recur where the number of days in the month is shorter than the creation date. Also set the cron job to run around 3am to avoid daylight savings problems.
Well done.
Cheers
Felix

Total Posts: 3

Hiya Felix:

Thanks for that!  I knew that mktime would roll the 13th month into a new year, but I hadn’t thought about Jan 31 - Feb 28 issue, so thanks (and thanks for looking that up).

Looking at the code breifly, it looks like it wouldn’t be too hard to recreate. 

Another possible solution, which would be a complete departure from this method but would solve the whole “what is people don’t have cron” issue, if to create re-occuring invoices all at once (dating the future ones in the future), so you’d say pass values saying reoccure every x days (or months or years) for y days (or months or years) then it’d create them all at once.  You’d still have to find a way of emailing them, but at least they’d be there.  Just a thought, in case anyone has time ... :-D

-Ben.

Total Posts: 3

Hi there, just to summarize, so far the feature is still a “one day will be here” thing right? just to double check, this web app is becoming more and more trendy.

Please let me know, thanks

Luis

Total Posts: 2324
cordoval - Apr 14, 2010 12:08am

Hi there, just to summarize, so far the feature is still a “one day will be here” thing right? just to double check, this web app is becoming more and more trendy.

I work on Bamboo as I have time. I’m in the fortunate position right now of being overwhelmingly busy with paid work, and Bamboo hasn’t gotten much love from me in the months since I last wrote that.

Yes, its still something I’d like to see some day, but I can offer no assurances as to when that might actually be.

Total Posts: 3

what can you say about the other contributor ATM work?

Total Posts: 2324

I haven’t looked at the work, and I generally advise that if you’re going to hack Bamboo that you carefully document everything you do, as upgrading can become problematic without carefully noting what has changed.

Total Posts: 1

So you are saying at present—this thread is just horribly named?

Meaning there is no easy way for us to enter recurring invoices?

I installed this assuming it would be there since it is so natural a reason to have online billing to begin with.

So no eta on recurring billing?

I love the interface and the app so far—but really—without recurring invoices auto-emailed to clients—I have no real use for this to add-on to my quickbooks desktop experience…

I specifically was looking for a way to auto-generate and email simple invoices to my clients for hosting and retainer services.

Any ideas?