Fixes from live

This commit is contained in:
Deon George
2014-05-20 21:49:52 +10:00
parent a329cc3179
commit cbd10347a5
12 changed files with 26 additions and 28 deletions

View File

@@ -38,23 +38,25 @@ class Task_Invoice_Email extends Minion_Task {
if (++$max_count > $max)
break;
if (Invoice::instance($io)->render('email','all')) {
// Log the emailling
$imo = $io->invoice_memo;
$imo->invoice_id = $io->id;
$imo->type = 'email';
$imo->memo = 'Invoice Emailed.';
$imo->save();
// Log the emailling
$imo = $io->invoice_memo;
$imo->invoice_id = $io->id;
$imo->type = 'email';
$io->print_status = 1;
$io->set_remind($key,time(),($params['force']=='again' ? TRUE : FALSE));
$io->save();
if (Invoice::instance($io)->render('email','all')) {
$imo->memo = 'Invoice Emailed.';
array_push($action,(string)$io);
} else {
throw new Kohana_Exception('Unable to send invoice :io',array(':io'=>$io->id));
$imo->memo = 'Invoice Send Failed.';
}
$imo->save();
$io->print_status = 1;
$io->set_remind($key,time(),($params['force']=='again' ? TRUE : FALSE));
$io->save();
}
return _('Invoiced emailed: ').join('|',$action);