News on accounting, taxes and business | Mytax.lt
Pereiti prie turinio
Accounting requirements in Lithuania in 2026
Accounting requirements in Lithuania are strictly regulated and mandatory for every business entity – from the smallest self-employed activity to the largest public limited company. Whether you run a startup […]
Accounting and Compliance
Small partnership (MB) accounting in 2026: simple and correct
Accounting for a small partnership is one of those areas where mistakes are costly – not only in money, but […]
How to grant your accountant the necessary rights in the ‘Mano VMI’ system. Video
In this video, we show how UAB Mytax.lt clients can grant authorization to their accountant in the Vertimas į anglų […]
How to grant representation rights at the Registry. Video
In this video we show how UAB Mytax.lt clients can authorise their accountant at the State Enterprise Register Centre. The […]
Show more articles
expand_more
Join the digital commerce professionals who receive our weekly review of tax law, financial technology and business growth strategies.
No spam. Only accurate, relevant financial information.
', 'text/html');
Array.prototype.forEach.call(d.querySelectorAll('script,style,noscript'), rm);
return (d.body.textContent || '').replace(/\s+/g, ' ').trim();
}
/* Same shape as the server-rendered cards: first 20 words + [...] */
function excerpt(s) {
if (!s) return '';
var clean = s.replace(/\s*\[?(…|\.\.\.)\]?\s*$/, '');
var words = clean.split(' ');
if (words.length > WORDS) return words.slice(0, WORDS).join(' ') + ' […]';
return clean === s ? s : clean + ' […]';
}
function imgUrl(media) {
if (!media) return '';
var sizes = media.media_details && media.media_details.sizes, order = ['large', 'medium_large', 'full'];
for (var i = 0; i < order.length; i++) {
if (sizes && sizes[order[i]] && sizes[order[i]].source_url) return sizes[order[i]].source_url;
}
return media.source_url || '';
}
/* Reduce a REST post to the few fields a card needs. */
function record(p) {
var emb = p._embedded || {}, cats = [];
(emb['wp:term'] || []).forEach(function (group) {
group.forEach(function (t) { if (t.taxonomy === 'category') cats.push({ id: t.id, name: text(t.name) }); });
});
return {
id: p.id,
date: (p.date || '').slice(0, 10),
link: p.link,
title: text(p.title && p.title.rendered),
excerpt: excerpt(text(p.excerpt && p.excerpt.rendered)),
img: imgUrl(emb['wp:featuredmedia'] && emb['wp:featuredmedia'][0]),
cats: cats
};
}
/*
* All posts are fetched once per browser session and filtered in memory, because every REST call is slow.
* base: posts as soon as they arrive; full: the same posts once missing excerpts are filled from the content.
*/
function fetchAll() {
try {
var cached = JSON.parse(sessionStorage.getItem(STORE));
if (cached && cached.length) return { base: Promise.resolve(cached), full: Promise.resolve(cached) };
} catch (err) {}
var out = [];
function page(n) {
return fetch(API + '&_embed=wp:featuredmedia,wp:term&_fields=id,date,link,title,excerpt,_links,_embedded&page=' + n).then(function (r) {
if (!r.ok) throw new Error(r.status);
var pages = parseInt(r.headers.get('X-WP-TotalPages'), 10) || 1;
return r.json().then(function (rows) {
rows.forEach(function (p) { out.push(record(p)); });
return n < pages ? page(n + 1) : out;
});
});
}
var base = page(1);
var full = base.then(function (rows) {
var need = rows.filter(function (r) { return !r.excerpt; }).map(function (r) { return r.id; }).slice(0, 100);
if (!need.length) return rows;
return fetch(API + '&include=' + need.join(',') + '&_fields=id,content')
.then(function (r) { return r.json(); })
.then(function (list) {
var map = {};
list.forEach(function (p) { map[p.id] = excerpt(text(p.content && p.content.rendered)); });
rows.forEach(function (r) { if (!r.excerpt && map[r.id]) r.excerpt = map[r.id]; });
return rows;
})
.catch(function () { return rows; });
}).then(function (rows) {
try { sessionStorage.setItem(STORE, JSON.stringify(rows)); } catch (err) {}
return rows;
});
return { base: base, full: full };
}
function put(el, s) {
if (!el) return;
(el.querySelector('p') || el.querySelector('span') || el).textContent = s;
}
function init() {
if (!CATS || !window.fetch) return;
var first = document.querySelector('[data-loop-source="' + LOOP + '"]');
if (!first) return;
var grid = first.parentElement, tpl = first.cloneNode(true), items = [];
FILTERS.forEach(function (f) {
f.cat = f.key ? CATS[f.key] : 0;
var el = document.querySelector('.' + f.cls);
if (el) items.push({ f: f, el: el, wrap: el.closest('.et_pb_module') || el });
});
var heroEl = document.querySelector('[data-loop-source="' + HERO + '"]');
var hero = heroEl ? heroEl.getAttribute('data-post-id') : '';
var style = document.createElement('style');
style.textContent = CSS;
document.head.appendChild(style);
if (items.length) items[0].wrap.parentElement.classList.add('mtx-nf');
/* Replace the old "load more" button so its category-unaware handler is dropped. */
var oldMore = document.querySelector('.vu3ef55w'), more = null, moreWrap = null;
if (oldMore) {
more = oldMore.cloneNode(true);
oldMore.parentNode.replaceChild(more, oldMore);
moreWrap = more.closest('.et_pb_group') || more;
}
var state = { cat: 0, shown: grid.children.length, seq: 0 };
var data = fetchAll();
function list(rows, cat) {
return rows.filter(function (r) {
return String(r.id) !== hero && (!cat || r.cats.some(function (c) { return c.id === cat; }));
});
}
function setActive(cat) {
items.forEach(function (it) {
var on = it.f.cat === cat;
it.el.classList.toggle('mtx-nf-btn--active', on);
it.el.setAttribute('aria-pressed', on ? 'true' : 'false');
});
}
function setCounts(map) {
items.forEach(function (it) {
if (it.f.cat) it.wrap.classList.toggle('mtx-nf-hidden', !(map[it.f.cat] > 0));
});
}
function card(r, cat) {
var c = tpl.cloneNode(true);
c.setAttribute('data-post-id', String(r.id));
c.setAttribute('data-loop-index', String(grid.children.length));
var img = c.querySelector('img');
Array.prototype.forEach.call(c.querySelectorAll('picture source'), rm);
if (img) {
['srcset', 'sizes', 'data-lazy-src', 'data-lazy-srcset', 'data-lazy-sizes', 'data-src', 'data-srcset'].forEach(function (a) { img.removeAttribute(a); });
img.alt = r.title;
if (r.img) { img.src = r.img; } else { img.removeAttribute('src'); img.style.visibility = 'hidden'; }
}
var term = r.cats.filter(function (t) { return t.id === cat; })[0] || r.cats[0];
var body = c.children[1], meta = body && body.children[0];
put(meta && meta.children[0], term ? term.name : '');
put(meta && meta.children[1], r.date);
put(body && body.children[1], r.title);
put(body && body.children[2], r.excerpt);
Array.prototype.forEach.call(c.querySelectorAll('a'), function (a) { a.href = r.link; });
Array.prototype.forEach.call(c.querySelectorAll('.et_clickable'), function (el) {
el.addEventListener('click', function (e) { e.stopPropagation(); window.location.href = r.link; });
});
return c;
}
function show(cat, replace) {
var seq = ++state.seq;
grid.classList.add('mtx-nf-loading');
return data.full.then(function (rows) {
if (seq !== state.seq) return;
var all = list(rows, cat), from = replace ? 0 : state.shown;
if (replace) grid.innerHTML = '';
all.slice(from, from + PER).forEach(function (r) { grid.appendChild(card(r, cat)); });
state.cat = cat;
state.shown = Math.min(from + PER, all.length);
if (!all.length) {
var none = document.createElement('p');
none.className = 'mtx-nf-empty';
none.textContent = EMPTY;
grid.appendChild(none);
}
if (moreWrap) moreWrap.classList.toggle('mtx-nf-hidden', state.shown >= all.length);
}).catch(function () {
if (seq === state.seq) setActive(state.cat);
}).then(function () {
if (seq === state.seq) grid.classList.remove('mtx-nf-loading');
});
}
items.forEach(function (it) {
it.el.classList.add('mtx-nf-btn');
if (it.f.href) it.el.setAttribute('href', it.f.href);
if (it.el.tagName === 'A') it.el.setAttribute('role', 'button');
it.el.addEventListener('click', function (e) {
e.preventDefault();
if (it.f.cat === state.cat) return;
setActive(it.f.cat);
try { history.replaceState(null, '', it.f.key ? '#' + HASH + it.f.key : location.pathname + location.search); } catch (err) {}
show(it.f.cat, true);
});
});
if (more) more.addEventListener('click', function () { show(state.cat, false); });
/* Category buttons stay hidden until we know the category has posts. */
var known = null;
try { known = JSON.parse(localStorage.getItem(COUNTS)); } catch (err) {}
setCounts(known || SEED);
data.base.then(function (rows) {
var map = {};
rows.forEach(function (r) { r.cats.forEach(function (c) { map[c.id] = (map[c.id] || 0) + 1; }); });
setCounts(map);
try { localStorage.setItem(COUNTS, JSON.stringify(map)); } catch (err) {}
if (moreWrap && !state.cat) moreWrap.classList.toggle('mtx-nf-hidden', state.shown >= list(rows, 0).length);
}).catch(function () {});
function fromHash() {
var wanted = (location.hash.match(new RegExp('^#' + HASH + '(.+)$')) || [])[1];
var it = items.filter(function (i) { return i.f.key && i.f.key === wanted; })[0];
return it ? it.f.cat : 0;
}
var start = fromHash();
setActive(start);
if (start) show(start, true);
/* Follow in-page links to a category, e.g. /naujienos/#kategorija-verslas. */
window.addEventListener('hashchange', function () {
if (location.hash && location.hash.indexOf('#' + HASH) !== 0) return;
var cat = fromHash();
if (cat === state.cat) return;
setActive(cat);
show(cat, true);
});
}
/* The snippet sits in the footer, so the grid is normally already parsed: start right away instead of waiting for slower scripts. */
if (document.readyState !== 'loading' || document.querySelector('[data-loop-source="' + LOOP + '"]')) {
init();
} else {
document.addEventListener('DOMContentLoaded', init);
}
})();