Fixes from live
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user