<?php
/**
 * OpenMage
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available at https://opensource.org/license/afl-3-0-php
 *
 * @category    design
 * @package     default_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
 * @copyright   Copyright (c) 2021-2024 The OpenMage Contributors (https://www.openmage.org)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
/** @var Mage_Tax_Block_Adminhtml_Notifications $this */
?>
<?php $messageDetails = $this->helper('tax')->__('Please see <a href="%s">source</a> for more details.', $this->getInfoUrl())
    . $this->helper('tax')->__('Click here to go to <a href="%s">Tax configuration</a> and change your settings.', $this->getManageUrl());
?>
<?php $discountStores = $this->getWebsitesWithWrongDiscountSettings() ?>
<?php if (!Mage::helper('tax')->isWrongDiscountSettingsIgnored() && $discountStores): ?>
<div class="notification-global">
    <strong><?php echo $this->helper('tax')->__('Warning tax discount configuration might result in different discounts than a customer might expect') ?></strong>
    <?php if (is_array($discountStores)): ?><strong><?php echo $this->helper('tax')->__('for store(s)') ?>
    : </strong><?php echo implode(', ', $discountStores) ?><?php endif ?>.
    <?php echo $messageDetails ?>
    <span class="f-right">
        <a href="<?php echo $this->getIgnoreTaxNotificationUrl('discount') ?>"><?php echo $this->helper('tax')->__('Ignore this notification') ?></a>
    </span>
</div>
<?php endif ?>

<?php $priceDisplayStores = $this->getStoresWithWrongDisplaySettings() ?>
<?php if (!Mage::helper('tax')->isWrongDisplaySettingsIgnored() && $priceDisplayStores): ?>
<div class="notification-global">
    <strong><?php echo $this->helper('tax')->__('Warning tax configuration can result in rounding errors') ?></strong>
    <?php if (is_array($priceDisplayStores)): ?><strong><?php echo $this->helper('tax')->__('for store(s)') ?>
    : </strong><?php echo implode(', ', $priceDisplayStores) ?><?php endif ?>.
    <?php echo $messageDetails ?>
    <span class="f-right">
        <a href="<?php echo $this->getIgnoreTaxNotificationUrl('price_display') ?>"><?php echo $this->helper('tax')->__('Ignore this notification') ?></a>
    </span>
</div>
<?php endif ?>

<?php $storesWithConflictingFptTaxConfigurationSettings = $this->getStoresWithConflictingFptTaxConfigurationSettings() ?>
<?php $isDefaultStoreConflictingFptTaxConfigurationSettings = $this->isDefaultStoreWithConflictingFptTaxConfigurationSettings() ?>

<?php if (!Mage::helper('tax')->isConflictingFptTaxConfigurationSettingsIgnored() &&
    ($isDefaultStoreConflictingFptTaxConfigurationSettings || $storesWithConflictingFptTaxConfigurationSettings)
): ?>
<div class="notification-global">
    <strong><?php echo $this->helper('tax')->__('Warning tax configuration can result in unexpected FPT prices on applicable devices') ?></strong>
    <!--        If the default store is fine, but the others aren't, list the ones that have conflicting settings-->
    <?php if (empty($storesWithConflictingFptTaxConfigurationSettings) && !$isDefaultStoreConflictingFptTaxConfigurationSettings): ?>
    <strong><?php echo $this->helper('tax')->__('for store(s)') ?>
        : </strong><?php echo implode(', ', $storesWithConflictingFptTaxConfigurationSettings) ?><?php endif ?>.
        <span class="f-right">
        <a href="<?php echo $this->getIgnoreTaxNotificationUrl('fpt_configuration') ?>"><?php echo $this->helper('tax')->__('Ignore this notification') ?></a>
    </span>
</div>
<?php endif ?>
