reverd payment email send button

This commit is contained in:
Cüneyt Şentürk 2021-06-30 23:53:31 +03:00
parent 7fdc1d9762
commit 1a0642f6a6
4 changed files with 1 additions and 63 deletions

View File

@ -1,56 +0,0 @@
<?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 Version21199 extends Listener
{
const ALIAS = 'core';
const VERSION = '2.1.19';
/**
* Handle the event.
*
* @param $event
*
* @return void
*/
public function handle(Event $event)
{
if ($this->skipThisUpdate($event)) {
return;
}
$this->updateEmailTemplate();
Artisan::call('cache:clear');
}
protected function updateEmailTemplate()
{
$company_id = company_id();
$companies = Company::cursor();
foreach ($companies as $company) {
$company->makeCurrent();
EmailTemplate::create([
'company_id' => $company->id,
'alias' => 'payment_new_vendor',
'class' => 'App\Notifications\Purchase\Payment',
'name' => 'settings.email.templates.payment_new_vendor',
'subject' => trans('email_templates.payment_new_vendor.subject'),
'body' => trans('email_templates.payment_new_vendor.body'),
]);
}
company($company_id)->makeCurrent();
}
}

View File

@ -35,7 +35,6 @@ class Event extends Provider
'App\Listeners\Update\V21\Version2116', 'App\Listeners\Update\V21\Version2116',
'App\Listeners\Update\V21\Version2117', 'App\Listeners\Update\V21\Version2117',
'App\Listeners\Update\V21\Version2118', 'App\Listeners\Update\V21\Version2118',
'App\Listeners\Update\V21\Version2119',
], ],
'Illuminate\Auth\Events\Login' => [ 'Illuminate\Auth\Events\Login' => [
'App\Listeners\Auth\Login', 'App\Listeners\Auth\Login',

View File

@ -77,11 +77,6 @@ class EmailTemplates extends Seeder
'class' => 'App\Notifications\Sale\Revenue', 'class' => 'App\Notifications\Sale\Revenue',
'name' => 'settings.email.templates.revenue_new_customer', 'name' => 'settings.email.templates.revenue_new_customer',
], ],
[
'alias' => 'payment_new_vendor',
'class' => 'App\Notifications\Purchase\Payment',
'name' => 'settings.email.templates.payment_new_vendor',
],
]; ];
foreach ($templates as $template) { foreach ($templates as $template) {

View File

@ -3,7 +3,7 @@
@section('title', trans('payments.payment_made')) @section('title', trans('payments.payment_made'))
@section('new_button') @section('new_button')
<x-transactions.show.top-buttons type="expense" :transaction="$payment" hide-button-share /> <x-transactions.show.top-buttons type="expense" :transaction="$payment" hide-button-share hide-button-email />
@endsection @endsection
@section('content') @section('content')