title | issue |
---|---|
Handling tax-free dependent values |
NEXT-14599 |
- Deprecated
taxFree
fromShopware/Core/System/Country/CountryEntity
, use$customerTax->getEnabled()
instead. - Deprecated
companyTaxFree
fromShopware/Core/System/Country/CountryEntity
, use$companyTax->getEnabled()
instead. - Added two new properties
customerTax
,companyTax
toShopware/Core/System/Country/CountryEntity
. - Added two new fields
customerTax
,companyTax
toShopware/Core/System/Country/CountryDefinition
. - Added two new columns
customer_tax
andcompany_tax
tocountry
table. - Added
TaxFreeConfigField
toShopware/Core/Framework/DataAbstractionLayer/Field
which storescustomer_tax
andcompany_tax
incountry
. - Added
TaxFreeConfig
toShopware/Core/Framework/DataAbstractionLayer
which will be decoded by the correspondingTaxFreeConfigField
. - Added
TaxFreeConfigFieldSerializer
toShopware/Core/Framework/DataAbstractionLayer/FieldSerializer
.
Deprecated taxFree
and companyTaxFree
in Shopware/Core/System/Country/CountryEntity
, use customerTax
and companyTax
instead.
$countryRepository->create([
[
'id' => Uuid::randomHex(),
'taxFree' => true,
'companyTaxFree' => true,
...
]
],
$context
);
$countryRepository->create([
[
'id' => Uuid::randomHex(),
'customerTax' => [
'enabled' => true, // enabled is taxFree value in old version
'currencyId' => $currencyId,
'amount' => 0,
],
'companyTax' => [
'enabled' => true, // enabled is companyTaxFree value in old version
'currencyId' => $currencyId,
'amount' => 0,
],
...
]
],
$context
);
- To get tax-free
$country->getTaxFree();
$country->getCompanyTaxFree();
- To set tax-free
$country->setTaxFree($isTaxFree);
$country->setCompanyTaxFree($isTaxFree);
- To get tax-free
$country->getCustomerTax()->getEnabled(); // enabled is taxFree value in old version
$country->getCompanyTax()->getEnabled(); // enabled is companyTaxFree value in old version
- To set tax-free
// TaxFreeConfig::__construct(bool $enabled, string $currencyId, float $amount);
$country->setCusotmerTax(new TaxFreeConfig($isTaxFree, $currencyId, $amount));
$country->setCompanyTax(new TaxFreeConfig($isTaxFree, $currencyId, $amount));