Table of Contents

Recurrence

Info

Recurring invoices is now part of Simple Invoices 2010.2

Setup

  1. You need mod_rewrite enabled in your apache to make recurring invoice work
  2. You also need access to a cron system - either unix cron or cpanel type cron so that you can schedule the recurrence to run each day

How to

To create the recurrence

  1. Create a new invoice
  2. Go to the recurrence page and create a new recurrence
  3. Select the invoice created in step 1
  4. Select a start date for the recurrence
  5. Select an end date
    1. Note: if there is no end date leave this empty
  6. Enter the recurrence pattern in the 'Recur each' field
    1. ie. 1 month, 4 weeks, or 2 days etc..
  7. If you want the biller to be emailed a copy of the invoice when it recurs select 'Yes' in the 'Email biller after each recurrence' field
  8. The same as above applies to Customers in the 'Email customer after each recurrence' field and click 'Save'
  9. Your recurrence has setup

To run the recurrence

  1. you need to schedule via cron or cpanel cron
  2. add a new cron job that once a day hits the api-cron page within your Simple invoces
    1. ie to do this you need to enter a url like to http://yourserver.com/{simple-invoices-folder}/api-cron
  1. note: mod_rewrite needs to be enabled in your apache config
  2. the cron entry would look something like
  3. #Simple Invoices recurrence - run each day at 1AM
    0 1 * * * wget -q "http://invoice.smarterinvoices.com/api-cron"
    1. if you don't have wget permission just create a new php file, and execute it as cron, file just need to have
      <?php file_get_contents("http://invoice.smarterinvoices.com/api-cron"); ?>

To customise the email body message

  1. Edit the file ./include/class/email/body.php in your Simple Invoices folder and change the text to what you want it to be
  2. Note: there are only 3 variables available 'biller_name', 'customer_name', and 'invoice_name'

Notes

If you have any queries post in the discussions section below or in the forum

Discussion

david, 2010/05/11 11:41

hey Ive upgraded to the latest beta 5, (and ran the db update(which completed fine), where should one be locating the the new 'recurrence page' is a screen print posible? incase im missing something.

Thank you

justin, 2010/05/20 01:32

hey david

you can access the recurrence page from the 'Money' menu

refer this url for example on our demo site:

cheers

justin

Okky Sari, 2010/06/16 06:00

Hi Justin,

I've just upgraded from SI 2010.1 to 2010.2.beta7, hoping to have the recurrence invoice show up. Under 'Money' menu, there is no Recurrence. Is there a config to enable, or did I miss something?

I installed SI on Fedora Core 10 with mod_rewrite Apache. Cron is active.

TIA, Okky

Okky Sari, 2010/06/16 06:06

Never mind.. I got it working. I installed SI from scratch :)

Cheers!

Okky

Alban, 2010/05/24 08:49

Hi Justin,

If I understand the recurrence example you provide, a cron job will create a new invoice when the time for recurring arrives, is that it ? If yes, that is a bit of an issue because that means you don't have forecast information.

Say you have a 1 year support contract with your client, and you bill every quarter. It would be better to have the 4 invoices created in advance, so you can already plan your yearly turnover, and know what you will bill ahead of time.

Or, rather than invoice recurrence, maybe we could just have scheduled payments ? Since we already have partial payments that would be pretty easy no ?

What would be the better approach in your opinion ?

justin, 2010/05/31 04:28

hey alban

yep - the cron job creates the invoices at that time - is mainly for people who do predifend per month things like hosting etc.. $10 per month - each month etc..

re 4 invoices

  • understand what your saying - the only way to do this now is to manually create them
  • will keep this style in mind for future development

cheers

justin

Jose, 2010/06/10 21:25

Alban and Justin,

The idea to create invoices in advance can't legally be done in some countries. The invoice tax must be paid till 90 days after the invoice creation in Europe. You see the problem…

As the cron is like a “clock” reminder, in right moment the right invoice is created and then all is ok.

José

Edgar Durão, 2010/06/10 23:02

Hello,

is there any way of to force a type of invoice to be started. For example, i create an invoice. When the person pays i change it to receipt in order to email him the correct document.

Cron “copies” the document, so if my document is now a receipt it will create a receipt as i want it to create an invoice.

Any suggestions to work around this?

Jacek, 2010/07/29 22:04

problem with recurrence cron: function select_all limits number of recurrence records to 25 per page fixed value =1 so in sql query limit is 0, 25 as far as I can see there is nothing to make it run limit 26,25 and more… How can that be fixed or bypassed? Ur am I totally wrong.

Kevin, 2010/09/09 14:13

Does recurring invoincing integrate with paypal recurring billing? Do the customer gets automatically charged?

Goran, 2010/09/16 15:11

How does one alter the text of the sent e-mail?

Can't find the correct file.

Daniel K, 2010/10/08 07:52

Nice work. My only recommendation would be to eliminate the need to create a cron job at all and use a php pseudo cron method, as wordpress does.

A quick search reveals this

http://www.bitfolge.de/?l=en&s=pseudocron

and this

http://core.trac.wordpress.org/ticket/2425

The first is an implementation of php cron and the second is the wordpress enhancement (done in 2.1 or five years ago)

I think it keeps the SI install simple and easy to do.

  • Bookmark "wiki:recurrence" at del.icio.us
  • Bookmark "wiki:recurrence" at Digg
  • Bookmark "wiki:recurrence" at Reddit
  • Bookmark "wiki:recurrence" at StumbleUpon
  • Bookmark "wiki:recurrence" at Facebook
  • Bookmark "wiki:recurrence" at Twitter
 
 | wiki/recurrence.txt · Last modified: 2011/12/22 12:09 (external edit)