BambooInvoice Forums

Sending paid notification

 
Total Posts: 48

I’ve modified the pdf.php to show an invoice as paid once it’s closed and I want to auto email it to the clients. I’ve created a modified controller script(attached) that sends out ALL the paid invoices but I need an if statement that will only send out the invoices paid on that day. Anyone got any ideas on that?
Cheers
Felix

Total Posts: 48

I’ve got this just below the section where it checks for future dated invoices.

$nowdate date('Y-m-d'); 
        
$this->db->select(('.$this->db->dbprefix('invoice_payments').'.date_paid') AS paydate1');
        
$paydate 'paydate1';
                if(
$nowdate != $paydate){
                        
return; //dont mail it if not paid today                
                

It fails on the second line getting the date_paid info from the invoice_payments table. Anyone see whats wrong with that line of code. It gives a parsing error in the log and returns nothing.

Total Posts: 48

OK it works grin

Put this in your cron

# m h  dom mon dow   command
44 23 * * * wget http://www.mywebsite.com/bamboodir/index.php/recurPaid
49 23 * * * rm -rf recurPaid 

That should make it run just before midnight and send out any invoices entered as paid on that day.
I’ve included my modded pdf.php that shows paid etc on the pdf files that you create.
Put the pdf.php in your /bamboo_system_files/application/views/invoices
put the recurPaid in /bamboo_system_files/application/controllers
Cheers
Felix

File Attachments
pdf.php.zip  (File Size: 5KB - Downloads: 110)
Total Posts: 16

Great work….

Thank you very much !!!

Total Posts: 48

Heres a slightly updated version if the pdf.php file that will now display partly paid on invoices emailed that are still open but have had a payment made on them.

File Attachments
pdf.zip  (File Size: 3KB - Downloads: 88)