1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00

Fixes for refund activity notes

This commit is contained in:
David Bomba 2022-10-14 08:24:28 +11:00
parent c26a40f842
commit 8f4a164dca
2 changed files with 6 additions and 4 deletions

View File

@ -79,7 +79,10 @@ class RefundPayment
TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $this->payment->company->db);
SystemLogger::dispatch(['user' => auth()->user() ? auth()->user()->email : '', 'paymentables' => $this->payment->paymentables->makeHidden(['id','payment_id', 'paymentable_id','paymentable_type', 'deleted_at'])->toArray(), 'request' => request() ? request()->all() : []], SystemLog::CATEGORY_LOG, SystemLog::EVENT_USER, SystemLog::TYPE_GENERIC, $this->payment->client, $this->payment->company);
$notes = ctrans('texts.refunded') . " : {$this->total_refund} - " . ctrans('texts.gateway_refund') . " : ";
$notes .= $this->refund_data['gateway_refund'] !== false ? ctrans('texts.yes') : ctrans('texts.no');
$this->createActivity($notes);
return $this->payment;
}
@ -98,8 +101,6 @@ class RefundPayment
$this->payment->refunded += $this->total_refund;
$this->createActivity($this->payment);
if ($response['success'] == false) {
$this->payment->save();
@ -133,7 +134,7 @@ class RefundPayment
$fields->company_id = $this->payment->company_id;
$fields->activity_type_id = Activity::REFUNDED_PAYMENT;
// $fields->credit_id = $this->credit_note->id; // TODO
$fields->notes = json_encode($notes);
$fields->notes = $notes;
if (isset($this->refund_data['invoices'])) {
foreach ($this->refund_data['invoices'] as $invoice) {

View File

@ -43,6 +43,7 @@ return [
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN'),
'verify_peer' => env('MAIL_VERIFY_PEER', true),
],
'ses' => [