Merge pull request #2146 from cuneytsenturk/master

Added Revenue/Payment show page [#mdbaet]
This commit is contained in:
Cüneyt Şentürk
2021-06-27 13:06:52 +03:00
committed by GitHub
53 changed files with 3732 additions and 152 deletions

View File

@ -0,0 +1,56 @@
<?php
namespace App\Listeners\Update\V21;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Models\Common\Company;
use App\Models\Common\EmailTemplate;
use Illuminate\Support\Facades\Artisan;
class Version2118 extends Listener
{
const ALIAS = 'core';
const VERSION = '2.1.18';
/**
* Handle the event.
*
* @param $event
*
* @return void
*/
public function handle(Event $event)
{
if ($this->skipThisUpdate($event)) {
return;
}
$this->updateEmailTemplate();
Artisan::call('migrate', ['--force' => true]);
}
protected function updateCompanies()
{
$company_id = company_id();
$companies = Company::cursor();
foreach ($companies as $company) {
$company->makeCurrent();
EmailTemplate::create([
'company_id' => $company->id,
'alias' => 'revenue_new_customer',
'class' => 'App\Notifications\Sale\Revenue',
'name' => 'settings.email.templates.revenue_new_customer',
'subject' => trans('email_templates.revenue_new_customer.subject'),
'body' => trans('email_templates.revenue_new_customer.body'),
]);
}
company($company_id)->makeCurrent();
}
}