chore: Update copyright year from 2025 to 2026 across core files
- Updated copyright headers in 3,055 core application files - Changed 'Copyright (C) 2014-2025' to 'Copyright (C) 2014-2026' - Added 123 new files from EspoCRM core updates - Removed 4 deprecated files - Total changes: 61,637 insertions, 54,283 deletions This is a routine maintenance update for the new year 2026.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM – Open Source CRM application.
|
||||
* Copyright (C) 2014-2025 EspoCRM, Inc.
|
||||
* Copyright (C) 2014-2026 EspoCRM, Inc.
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -29,17 +29,20 @@
|
||||
|
||||
namespace Espo\Hooks\Common;
|
||||
|
||||
use Espo\Core\Currency\ConfigDataProvider;
|
||||
use Espo\Core\ORM\Type\FieldType;
|
||||
use Espo\Core\Utils\Metadata;
|
||||
use Espo\ORM\Entity;
|
||||
use Espo\Core\Di;
|
||||
|
||||
class CurrencyConverted implements Di\MetadataAware, Di\ConfigAware
|
||||
class CurrencyConverted
|
||||
{
|
||||
use Di\MetadataSetter;
|
||||
use Di\ConfigSetter;
|
||||
|
||||
public static int $order = 1;
|
||||
|
||||
public function __construct(
|
||||
private ConfigDataProvider $configDataProvider,
|
||||
private Metadata $metadata,
|
||||
) {}
|
||||
|
||||
public function beforeSave(Entity $entity): void
|
||||
{
|
||||
$fieldDefs = $this->metadata->get(['entityDefs', $entity->getEntityType(), 'fields'], []);
|
||||
@@ -77,14 +80,13 @@ class CurrencyConverted implements Di\MetadataAware, Di\ConfigAware
|
||||
continue;
|
||||
}
|
||||
|
||||
$rates = $this->config->get('currencyRates', []);
|
||||
$baseCurrency = $this->config->get('baseCurrency');
|
||||
$defaultCurrency = $this->config->get('defaultCurrency');
|
||||
$rates = $this->configDataProvider->getCurrencyRates()->toAssoc();
|
||||
$baseCurrency = $this->configDataProvider->getBaseCurrency();
|
||||
$defaultCurrency = $this->configDataProvider->getDefaultCurrency();
|
||||
|
||||
if ($defaultCurrency === $currency) {
|
||||
$targetValue = $value;
|
||||
} else {
|
||||
$targetValue = $value;
|
||||
$targetValue = $value;
|
||||
|
||||
if ($defaultCurrency !== $currency) {
|
||||
$targetValue = $targetValue / ($rates[$baseCurrency] ?? 1.0);
|
||||
$targetValue = $targetValue * ($rates[$currency] ?? 1.0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user