diff --git a/src/Components/LoggedIn/Content/Tariffs/DataGridElement/index.tsx b/src/Components/LoggedIn/Content/Tariffs/DataGridElement/index.tsx index 60e23e8..990349f 100644 --- a/src/Components/LoggedIn/Content/Tariffs/DataGridElement/index.tsx +++ b/src/Components/LoggedIn/Content/Tariffs/DataGridElement/index.tsx @@ -541,12 +541,8 @@ const DataGridElement: React.FC = ({ openModal }) => { if( discountsActiveArray.length >= 0 && checkboxStates == 1 && selectedPromocode < 0 ) { discountsActiveArray.forEach( (activeDiscount) => { discountsArray.forEach( (discount, i) => { - if( item.tariffs ) { - item.tariffs.forEach( (t) => { - if( t.time ) { percents = percents + discountTime( t.time ); } - if( t.points ) { percents = percents + discountCapacity( t.time ); } - }); - } + if( tariff.time ) { percents = percents + discountTime( tariff.time ); } + if( tariff.points ) { percents = percents + discountCapacity( tariff.time ); } }); }); } @@ -555,12 +551,8 @@ const DataGridElement: React.FC = ({ openModal }) => { if( discountsActiveArray.length >= 0 && checkboxStates == 1 && selectedPromocode < 0 ) { discountsActiveArray.forEach( (activeDiscount) => { discountsArray.forEach( (discount, i) => { - if( item.tariffs ) { - item.tariffs.forEach( (t) => { - if( t.time && t.points ) { - percents = percents + discountProduct( t.time, t.points ); - } - }); + if( tariff.time && tariff.points ) { + percents = percents + discountProduct( tariff.time, tariff.points ); } }); });