Merge pull request #4877 from turbo124/v5-develop

Gmail Reply TO
This commit is contained in:
David Bomba 2021-02-11 22:38:23 +11:00 committed by GitHub
commit 7c2cc7d86f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 8 deletions

View File

@ -303,14 +303,14 @@ class CheckData extends Command
$total_invoice_payments += ($total_amount - $total_refund);
}
//10/02/21
// foreach ($client->payments as $payment) {
// $credit_total_applied += $payment->paymentables->where('paymentable_type', App\Models\Credit::class)->sum(DB::raw('amount'));
// }
// 10/02/21
foreach ($client->payments as $payment) {
$credit_total_applied += $payment->paymentables->where('paymentable_type', App\Models\Credit::class)->sum(DB::raw('amount'));
}
// if ($credit_total_applied < 0) {
// $total_invoice_payments += $credit_total_applied;
// }
if ($credit_total_applied < 0) {
$total_invoice_payments += $credit_total_applied;
}
if (round($total_invoice_payments, 2) != round($client->paid_to_date, 2)) {

View File

@ -148,6 +148,7 @@ class CompanySettings extends BaseSettings
public $gmail_sending_user_id = '0'; //@implemented
public $reply_to_email = ''; //@TODO
public $reply_to_name = ''; //@TODO
public $bcc_email = ''; //@TODO
public $pdf_email_attachment = false; //@implemented
public $ubl_email_attachment = false; //@implemented
@ -261,6 +262,7 @@ class CompanySettings extends BaseSettings
public $hide_empty_columns_on_pdf = false;
public static $casts = [
'reply_to_name' => 'string',
'hide_empty_columns_on_pdf' => 'bool',
'enable_reminder_endless' => 'bool',
'use_credits_payment' => 'string',

View File

@ -5,6 +5,7 @@ namespace App\Helpers\Mail;
use Illuminate\Mail\MailManager;
use App\CustomMailDriver\CustomTransport;
use Dacastro4\LaravelGmail\Services\Message\Mail;
use Illuminate\Support\Facades\Config;
class GmailTransportManager extends MailManager
@ -12,7 +13,8 @@ class GmailTransportManager extends MailManager
protected function createGmailTransport()
{
$token = $this->app['config']->get('services.gmail.token', []);
//$token = $this->app['config']->get('services.gmail.token', []);
$token =Config::get('services.gmail.token');
$mail = new Mail;
return new GmailTransport($mail, $token);

View File

@ -86,6 +86,9 @@ class BaseMailerJob implements ShouldQueue
Config::set('mail.from.name', $user->present()->name());
(new MailServiceProvider(app()))->register();
nlog("after registering mail service provider");
nlog(Config::set('services.gmail.token'));
}
public function logMailError($errors, $recipient_object)