mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 08:04:40 -04:00
Do not set exchange rate if already set
This commit is contained in:
parent
08802963cb
commit
8fbab48019
@ -202,6 +202,9 @@ class PaymentMigrationRepository extends BaseRepository
|
|||||||
*/
|
*/
|
||||||
private function processExchangeRates($data, $payment)
|
private function processExchangeRates($data, $payment)
|
||||||
{
|
{
|
||||||
|
if($payment->exchange_rate != 1)
|
||||||
|
return $payment;
|
||||||
|
|
||||||
$client = Client::where('id', $data['client_id'])->withTrashed()->first();
|
$client = Client::where('id', $data['client_id'])->withTrashed()->first();
|
||||||
|
|
||||||
$client_currency = $client->getSetting('currency_id');
|
$client_currency = $client->getSetting('currency_id');
|
||||||
|
@ -111,6 +111,9 @@ class ApplyPaymentAmount extends AbstractService
|
|||||||
private function setExchangeRate(Payment $payment)
|
private function setExchangeRate(Payment $payment)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if($payment->exchange_rate != 1)
|
||||||
|
return;
|
||||||
|
|
||||||
$client_currency = $payment->client->getSetting('currency_id');
|
$client_currency = $payment->client->getSetting('currency_id');
|
||||||
$company_currency = $payment->client->company->settings->currency_id;
|
$company_currency = $payment->client->company->settings->currency_id;
|
||||||
|
|
||||||
|
@ -79,6 +79,9 @@ class InvoiceService
|
|||||||
public function setExchangeRate()
|
public function setExchangeRate()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if($this->invoice->exchange_rate != 0)
|
||||||
|
return $this;
|
||||||
|
|
||||||
$client_currency = $this->invoice->client->getSetting('currency_id');
|
$client_currency = $this->invoice->client->getSetting('currency_id');
|
||||||
$company_currency = $this->invoice->company->settings->currency_id;
|
$company_currency = $this->invoice->company->settings->currency_id;
|
||||||
|
|
||||||
|
@ -116,6 +116,9 @@ class MarkPaid extends AbstractService
|
|||||||
private function setExchangeRate(Payment $payment)
|
private function setExchangeRate(Payment $payment)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if($payment->exchange_rate != 1)
|
||||||
|
return;
|
||||||
|
|
||||||
$client_currency = $payment->client->getSetting('currency_id');
|
$client_currency = $payment->client->getSetting('currency_id');
|
||||||
$company_currency = $payment->client->company->settings->currency_id;
|
$company_currency = $payment->client->company->settings->currency_id;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user