Skip to content

Commit

Permalink
add getVATAmount function (#9)
Browse files Browse the repository at this point in the history
* add getVATAmount function

* CI fix;
Translate fix
  • Loading branch information
k-k-spiilmusic authored and luckyraul committed May 15, 2018
1 parent 558c750 commit 439f978
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
8 changes: 3 additions & 5 deletions Block/Extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,14 @@ public function render(AbstractElement $element)
$email
);
$tender = __('Tender offer can be checked '
. '<a href="https://www.mygento.ru/oferta" target="_blank">here</a>');
. '<a href="%1/oferta" target="_blank">here</a>', $site);

$html .= '<table class="mygento-info" cellspacing="0" cellpading="0">'
. '<tr class="mygento-info-line">';
$html .= '<tr><td>' . __('Support') . ':</td>' .
'<td>' . $url . '.<br/><br/>' . $bugs .
'<br/><br/>' . $emailtext . '</td></tr>';
$html .= '<tr><td>' . __('License') . ':</td><td>' . $tender . '</td></tr>';
$html .= '<tr class="mygento-info-line "><td>'
. '<img src="//www.mygento.ru/img/mygento.svg" width="100" height="100" alt="mygento logo"/>'
. '<img src="//www.mygento.ru/img/mygento.svg" '
. 'width="100" height="100" alt="mygento logo"/>'
. '</td><td>' . $hiretext . '<br/><br/>' . __(
'You can check all providable services on '
. '<a href="%1" target="_blank">our website</a>.',
Expand Down
9 changes: 9 additions & 0 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,13 @@ public function formatToNumber($value)
));
return $value;
}

public function getVATAmount($price, $VATValue)
{
$priceWithoutVat = $price / (1 + $VATValue / 100);

$vatAmount = round($price - $priceWithoutVat, 2);

return $vatAmount;
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mygento/base",
"type": "magento2-module",
"version": "2.2.10",
"version": "2.2.11",
"license": "OSL-3.0",
"homepage": "https://github.com/mygento/base",
"description": "Mygento Base",
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Mygento_Base" setup_version="2.2.10"></module>
<module name="Mygento_Base" setup_version="2.2.11"></module>
</config>
2 changes: 1 addition & 1 deletion i18n/ru_RU.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"License","Лицензирование"
"You can check all providable services on <a href=""%1"" target=""_blank"">our website</a>.","Со списком предоставляемых услуг вы можете ознакомиться <a href=""%1"" target=""_blank"">на нашем сайте</a>."
"You can hire us for any Magento extension customization and development.<br/>Write us to %1","Вы можете нанять нашу команду для любых работ с модулями Magento.<br/>Пишите нам на %1"
"Tender offer can be checked <a href=""https://www.mygento.ru/oferta"" target=""_blank"">here</a>","Ознакомиться с публичной офертой можно <a href=""https://www.mygento.ru/oferta"" target=""_blank"">здесь</a>"
"Tender offer can be checked <a href=""%1/oferta"" target=""_blank"">here</a>","Ознакомиться с публичной офертой можно <a href=""%1/oferta"" target=""_blank"">здесь</a>"
"No usage","Не использовать"
"VAT Free","НДС не облагается"
"VAT18","НДС 18%"
Expand Down

0 comments on commit 439f978

Please sign in to comment.