Fix invoice generation and other minor cosmetic items
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
@@ -23,16 +24,6 @@ class InvoiceEmail extends Command
|
||||
*/
|
||||
protected $description = 'Email Invoices to be client';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
@@ -41,6 +32,7 @@ class InvoiceEmail extends Command
|
||||
public function handle()
|
||||
{
|
||||
$o = Invoice::findOrFail($this->argument('id'));
|
||||
Config::set('site',$o->account->site);
|
||||
|
||||
Mail::to($o->account->user->email)->send(new \App\Mail\InvoiceEmail($o));
|
||||
|
||||
|
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Account;
|
||||
use App\Models\Invoice;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
use App\Models\{Account,Invoice};
|
||||
|
||||
class InvoiceGenerate extends Command
|
||||
{
|
||||
@@ -23,16 +23,6 @@ class InvoiceGenerate extends Command
|
||||
*/
|
||||
protected $description = 'Generate Invoices to be Sent';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
@@ -46,6 +36,8 @@ class InvoiceGenerate extends Command
|
||||
$accounts = Account::active()->get();
|
||||
|
||||
foreach ($accounts as $o) {
|
||||
Config::set('site',$o->site);
|
||||
|
||||
$io = new Invoice;
|
||||
$io->account_id = $o->id;
|
||||
|
||||
|
Reference in New Issue
Block a user