diff --git a/app/Repositories/Migration/PaymentMigrationRepository.php b/app/Repositories/Migration/PaymentMigrationRepository.php index 32c253e14..a93c6ea45 100644 --- a/app/Repositories/Migration/PaymentMigrationRepository.php +++ b/app/Repositories/Migration/PaymentMigrationRepository.php @@ -202,6 +202,9 @@ class PaymentMigrationRepository extends BaseRepository */ private function processExchangeRates($data, $payment) { + if($payment->exchange_rate != 1) + return $payment; + $client = Client::where('id', $data['client_id'])->withTrashed()->first(); $client_currency = $client->getSetting('currency_id'); diff --git a/app/Services/Invoice/ApplyPaymentAmount.php b/app/Services/Invoice/ApplyPaymentAmount.php index ee6a0f657..51ec79959 100644 --- a/app/Services/Invoice/ApplyPaymentAmount.php +++ b/app/Services/Invoice/ApplyPaymentAmount.php @@ -111,6 +111,9 @@ class ApplyPaymentAmount extends AbstractService private function setExchangeRate(Payment $payment) { + if($payment->exchange_rate != 1) + return; + $client_currency = $payment->client->getSetting('currency_id'); $company_currency = $payment->client->company->settings->currency_id; diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index 281cea3eb..a38464c89 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -79,6 +79,9 @@ class InvoiceService public function setExchangeRate() { + if($this->invoice->exchange_rate != 0) + return $this; + $client_currency = $this->invoice->client->getSetting('currency_id'); $company_currency = $this->invoice->company->settings->currency_id; diff --git a/app/Services/Invoice/MarkPaid.php b/app/Services/Invoice/MarkPaid.php index 026892f49..205c5cee5 100644 --- a/app/Services/Invoice/MarkPaid.php +++ b/app/Services/Invoice/MarkPaid.php @@ -116,6 +116,9 @@ class MarkPaid extends AbstractService private function setExchangeRate(Payment $payment) { + if($payment->exchange_rate != 1) + return; + $client_currency = $payment->client->getSetting('currency_id'); $company_currency = $payment->client->company->settings->currency_id;