Skip to content

Commit

Permalink
OXDEV-5817 Fix vat value message and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TitaKoleva committed May 13, 2024
1 parent 2c1a144 commit f104c7e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/Integration/Shop/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,40 +245,43 @@ public function testSaveVatInStoreDateE()
$oUser->delete('userId');
$oUser->setId('userId');
$oUser->assign([
'oxustid' => 'IdNumber',
'oevattbe_vatinenterdate' => '2014-12-12 12:12:12',
'oxustid' => 'IdNumber'
]);
$oUser->save();

$oUser = oxNew(User::class);
$oUser->load('userId');
$vatInDate = $oUser->getOeVATTBEVatInStoreDate();

$oUser->assign([
'oxustid' => ''
]);
$oUser->save();

$oUser = oxNew(User::class);
$oUser->load('userId');
$this->assertSame('2014-12-12 12:12:12', $oUser->getOeVATTBEVatInStoreDate());
$this->assertSame($vatInDate, $oUser->getOeVATTBEVatInStoreDate());
}

/**
* On User info change:
* f) old data VAT IN is set, date set - after VAT IN updated - date not changed
* f) old data VAT IN is set, date set - after VAT IN updated - date is changed
*/
public function testSaveVatInStoreDateF()
{
$oUser = oxNew(User::class);
$oUser->delete('userId');
$oUser->setId('userId');
$oUser->assign([
'oxustid' => 'IdNumber',
'oevattbe_vatinenterdate' => '2014-12-12 12:12:12',
'oxustid' => 'IdNumber'
]);
$oUser->save();

$oUser = oxNew(User::class);
$oUser->load('userId');
$vatInDate = $oUser->getOeVATTBEVatInStoreDate();
sleep(1);

$oUser->assign([
'oxustid' => 'IdNumber2'
]);
Expand All @@ -287,6 +290,6 @@ public function testSaveVatInStoreDateF()
$oUser = oxNew(User::class);
$oUser->load('userId');

$this->assertSame('2014-12-12 12:12:12', $oUser->getOeVATTBEVatInStoreDate());
$this->assertNotSame($vatInDate, $oUser->getOeVATTBEVatInStoreDate());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% extends 'page/checkout/inc/summary_sidebar.html.twig' %}

{% block checkout_basketcontents_nodiscountproductvats %}
{% for key, VATitem in oxcmp_basket.getProductVats(false) %}
<div class="list-group-item d-flex justify-content-between align-items-center">
{{ translate({ ident: "VAT_PLUS_PERCENT_AMOUNT", args: [key] }) }}
<span>{{ format_price(VATitem, { currency: currency }) }}</span>
</div>
{% endfor %}
{% endblock %}

{% block checkout_basketcontents_productvats %}
{% for key, VATitem in oxcmp_basket.getProductVats(false) %}
<div class="list-group-item d-flex justify-content-between align-items-center">
{{ translate({ ident: "VAT_PLUS_PERCENT_AMOUNT", args: [key] }) }}
<span>{{ format_price(VATitem, { currency: currency }) }}</span>
</div>
{% endfor %}
{% endblock %}

0 comments on commit f104c7e

Please sign in to comment.