diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 0e0b70570af3..3e81d97c8ab1 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -124,7 +124,7 @@ class Handler extends ExceptionHandler } }); - if ($this->validException($exception)) { + if ($this->validException($exception) && auth()->guard('contact')->user()->company->account->report_errors) { app('sentry')->captureException($exception); } } diff --git a/app/Services/Client/ClientService.php b/app/Services/Client/ClientService.php index b6440543eeb6..2f2152429f4f 100644 --- a/app/Services/Client/ClientService.php +++ b/app/Services/Client/ClientService.php @@ -28,21 +28,21 @@ class ClientService public function updateBalance(float $amount) { - $this->client->increment('balance', $amount); + $this->client->balance += $amount; return $this; } public function updatePaidToDate(float $amount) { - $this->client->increment('paid_to_date', $amount); + $this->client->paid_to_date += $amount; return $this; } public function adjustCreditBalance(float $amount) { - $this->client->increment('credit_balance', $amount); + $this->client->credit_balance += $amount; return $this; } diff --git a/app/Services/Credit/CreditService.php b/app/Services/Credit/CreditService.php index 600684c4b403..ea7cec68ee58 100644 --- a/app/Services/Credit/CreditService.php +++ b/app/Services/Credit/CreditService.php @@ -167,25 +167,22 @@ class CreditService public function adjustBalance($adjustment) { - // $this->credit->balance += $adjustment; - $this->credit->increment('balance', $adjustment); - + $this->credit->balance += $adjustment; + return $this; } public function updatePaidToDate($adjustment) { - // $this->credit->paid_to_date += $adjustment; - $this->credit->increment('paid_to_date', $adjustment); - + $this->credit->paid_to_date += $adjustment; + return $this; } public function updateBalance($adjustment) { - // $this->credit->balance -= $adjustment; - $this->credit->decrement('balance', $adjustment); - + $this->credit->balance -= $adjustment; + return $this; } diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index 59366cb5d86a..d611f5a7da6f 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -403,8 +403,8 @@ class InvoiceService /*Update the partial amount of a invoice*/ public function updatePartial($amount) { - // $this->invoice->partial += $amount; - $this->invoice->increment('partial', $amount); + $this->invoice->partial += $amount; + // $this->invoice->increment('partial', $amount); return $this; }