Compare commits
13 Commits
814e107327
...
e4183621d2
Author | SHA1 | Date | |
---|---|---|---|
e4183621d2 | |||
260bd96c74 | |||
23f57f684e | |||
81b4d4766c | |||
e106adc69e | |||
2b49d47652 | |||
90f803b02f | |||
f56c164356 | |||
d5be958de0 | |||
23a50ec6ec | |||
a56d67e1a1 | |||
71d587aaf7 | |||
a95548e455 |
@ -27,7 +27,7 @@ REDIS_HOST=127.0.0.1
|
|||||||
REDIS_PASSWORD=null
|
REDIS_PASSWORD=null
|
||||||
REDIS_PORT=6379
|
REDIS_PORT=6379
|
||||||
|
|
||||||
MAIL_MAILER=smtp
|
MAIL_DRIVER=smtp
|
||||||
MAIL_HOST=smtp
|
MAIL_HOST=smtp
|
||||||
MAIL_PORT=25
|
MAIL_PORT=25
|
||||||
MAIL_USERNAME=null
|
MAIL_USERNAME=null
|
||||||
|
@ -35,17 +35,15 @@ class InvoiceEmail extends Command
|
|||||||
|
|
||||||
$o = Invoice::findOrFail($this->argument('id'));
|
$o = Invoice::findOrFail($this->argument('id'));
|
||||||
|
|
||||||
$result = Mail::to($o->account->user->email)->send(new \App\Mail\InvoiceEmail($o));
|
Mail::to($o->account->user->email)->send(new \App\Mail\InvoiceEmail($o));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$o->print_status = TRUE;
|
$o->print_status = TRUE;
|
||||||
//$o->reminders = $o->reminders('send');
|
$o->reminders = $o->reminders('send');
|
||||||
$o->save();
|
$o->save();
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
dd($e);
|
dd($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
dump($result->getDebug());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
46
app/Console/Kernel.php
Normal file
46
app/Console/Kernel.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console;
|
||||||
|
|
||||||
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||||
|
|
||||||
|
use App\Jobs\BroadbandTraffic;
|
||||||
|
use App\Models\Supplier;
|
||||||
|
|
||||||
|
class Kernel extends ConsoleKernel
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Artisan commands provided by your application.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $commands = [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the application's command schedule.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function schedule(Schedule $schedule)
|
||||||
|
{
|
||||||
|
// @todo This needs to be more generic and dynamic
|
||||||
|
// Exetel Traffic
|
||||||
|
$schedule->job(new BroadbandTraffic(Supplier::find(1)))->timezone('Australia/Melbourne')->dailyAt('10:00');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the commands for the application.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function commands()
|
||||||
|
{
|
||||||
|
$this->load(__DIR__.'/Commands');
|
||||||
|
|
||||||
|
require base_path('routes/console.php');
|
||||||
|
}
|
||||||
|
}
|
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Clarkeash\Doorman\Exceptions\{ExpiredInviteCode,InvalidInviteCode,NotYourInviteCode};
|
|
||||||
use Clarkeash\Doorman\Facades\Doorman;
|
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
use Barryvdh\Snappy\Facades\SnappyPdf as PDF;
|
use Barryvdh\Snappy\Facades\SnappyPdf as PDF;
|
||||||
|
|
||||||
@ -35,20 +33,10 @@ class InvoiceController extends Controller
|
|||||||
* Render a specific invoice for the user
|
* Render a specific invoice for the user
|
||||||
*
|
*
|
||||||
* @param Invoice $o
|
* @param Invoice $o
|
||||||
* @param string|null $code
|
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function view(Invoice $o,string $code=NULL): View
|
public function view(Invoice $o): View
|
||||||
{
|
{
|
||||||
if ($code) {
|
|
||||||
try {
|
|
||||||
Doorman::redeem($code,$o->account->user->email);
|
|
||||||
|
|
||||||
} catch (ExpiredInviteCode|InvalidInviteCode|NotYourInviteCode $e) {
|
|
||||||
abort(404);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return view('theme.backend.adminlte.invoice.view')
|
return view('theme.backend.adminlte.invoice.view')
|
||||||
->with('o',$o);
|
->with('o',$o);
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Mail;
|
namespace App\Mail;
|
||||||
|
|
||||||
use App\Models\Site;
|
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Mail\Mailable;
|
use Illuminate\Mail\Mailable;
|
||||||
@ -16,7 +15,6 @@ class InvoiceEmail extends Mailable
|
|||||||
use Queueable, SerializesModels;
|
use Queueable, SerializesModels;
|
||||||
|
|
||||||
public $invoice;
|
public $invoice;
|
||||||
public $site;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new message instance.
|
* Create a new message instance.
|
||||||
@ -35,11 +33,10 @@ class InvoiceEmail extends Mailable
|
|||||||
*/
|
*/
|
||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
Config::set('site',Site::findOrFail($this->invoice->site_id));
|
Config::set('site',$this->invoice->site);
|
||||||
$this->site = config('site');
|
|
||||||
|
|
||||||
return $this
|
return $this
|
||||||
->markdown('email.user.invoice',['site'=>config('site')])
|
->markdown('email.user.invoice')
|
||||||
->subject(sprintf( 'Invoice: %s - Total: $%s - Due: %s',
|
->subject(sprintf( 'Invoice: %s - Total: $%s - Due: %s',
|
||||||
$this->invoice->id,
|
$this->invoice->id,
|
||||||
number_format($this->invoice->total,2),
|
number_format($this->invoice->total,2),
|
||||||
|
@ -132,7 +132,7 @@ class Product extends Model implements IDs
|
|||||||
return $this->hasOne(ProductTranslate::class)
|
return $this->hasOne(ProductTranslate::class)
|
||||||
->where('language_id',(Auth::user() && Auth::user()->language_id)
|
->where('language_id',(Auth::user() && Auth::user()->language_id)
|
||||||
? Auth::user()->language_id
|
? Auth::user()->language_id
|
||||||
: config('osb.language_id'));
|
: config('site')->language_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,65 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Invite Table Name
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
'invite_table_name' => 'invites',
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Invite Model Class
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This option allows you to override the default model.
|
|
||||||
| Your model MUST extend the base Invite model.
|
|
||||||
|
|
|
||||||
| Default: Clarkeash\Doorman\Models\Invite::class
|
|
||||||
*/
|
|
||||||
'invite_model' => Clarkeash\Doorman\Models\Invite::class,
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Default Code Generator
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This option controls how the invite codes are generated.
|
|
||||||
| You should adjust this based on your needs.
|
|
||||||
|
|
|
||||||
| Supported: "basic", "uuid"
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
'driver' => env('DOORMAN_DRIVER', 'basic'),
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Driver Configurations
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Here are each of the driver configurations for your application.
|
|
||||||
| You can customize should your application require it.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
'basic' => [
|
|
||||||
'length' => 6,
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| UUID
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| supported versions: 1,3,4,5
|
|
||||||
|
|
|
||||||
| Versions 3 & 5, require 'namespace' and 'name' to be set
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
'uuid' => [
|
|
||||||
'version' => 4,
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
@ -17,7 +17,7 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->integer('site_id')->unsigned();
|
$table->integer('site_id')->unsigned();
|
||||||
$table->boolean('active')->default(true);
|
$table->boolean('active')->default(false);
|
||||||
|
|
||||||
$table->float('amount',10,0);
|
$table->float('amount',10,0);
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ return new class extends Migration
|
|||||||
$table->id();
|
$table->id();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->integer('site_id')->unsigned();
|
$table->integer('site_id')->unsigned();
|
||||||
$table->boolean('active')->default(true);
|
$table->boolean('active')->default(false);
|
||||||
|
|
||||||
$table->float('amount',10,0);
|
$table->float('amount',10,0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user