buhanka-finance-app 1.45.0 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.html +25 -3
- package/package.json +1 -1
package/index.html
CHANGED
|
@@ -286,7 +286,7 @@ tr.subtotal>td:first-child{color:var(--accent);box-shadow:inset 3px 0 0 var(--ac
|
|
|
286
286
|
|
|
287
287
|
<script>
|
|
288
288
|
/* ============================================================ БУХАНКА · Финансы v2 ============================================================ */
|
|
289
|
-
const APP_VERSION='7.
|
|
289
|
+
const APP_VERSION='7.8';
|
|
290
290
|
const SCHEMA=8; /* версия структуры данных; растёт при доработках */
|
|
291
291
|
const STORE_KEY='buhanka_finance_v9';/* НЕ МЕНЯТЬ НИКОГДА — иначе данные «слетят» при обновлении файла */
|
|
292
292
|
const LEGACY_KEYS=['buhanka_finance_v8','buhanka_finance_v7','buhanka_finance_v6','buhanka_finance_v5'];
|
|
@@ -1948,9 +1948,19 @@ function keyRateModal(id){ const ed=id?ST.keyRates.find(k=>k.id===id):null;
|
|
|
1948
1948
|
function keyRateDel(id){ ST.keyRates=ST.keyRates.filter(k=>k.id!==id); if(!ST.keyRates.length)ST.keyRates=[{id:uid(),date:'2026-01-01',rate:16}]; save(); closeModal(); render(); }
|
|
1949
1949
|
|
|
1950
1950
|
/* ---------- Операции ---------- */
|
|
1951
|
-
function opsFilter(){
|
|
1951
|
+
function opsFilter(){ const f=ST.ui.opsF||(ST.ui.opsF={type:'',point:'',cat:'',acc:'',q:'',size:50,page:1});
|
|
1952
|
+
if(f.from===undefined)f.from=''; if(f.to===undefined)f.to=''; return f; }
|
|
1952
1953
|
function opsFSet(k,v){ const f=opsFilter(); f[k]=v; if(k!=='page')f.page=1; save(); render(); }
|
|
1953
|
-
function opsFReset(){ ST.ui.opsF={type:'',point:'',cat:'',acc:'',q:'',size:50,page:1}; save(); render(); }
|
|
1954
|
+
function opsFReset(){ ST.ui.opsF={type:'',point:'',cat:'',acc:'',q:'',from:'',to:'',size:50,page:1}; save(); render(); }
|
|
1955
|
+
/* быстрые диапазоны дат внутри выбранного периода */
|
|
1956
|
+
function opsFDays(n){ const f=opsFilter(); const mm=periodMonths(ST.ui.period);
|
|
1957
|
+
const last=MONTHS.indexOf(mm[mm.length-1]);
|
|
1958
|
+
const today=new Date(); const inPeriod=(today.getFullYear()===YEAR&&mm.includes(MONTHS[today.getMonth()]));
|
|
1959
|
+
const end=inPeriod? today : new Date(YEAR,last,daysInMonth(last));
|
|
1960
|
+
const st=new Date(end.getTime()-(n-1)*86400000);
|
|
1961
|
+
const iso=d=>`${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,'0')}-${String(d.getDate()).padStart(2,'0')}`;
|
|
1962
|
+
f.from=iso(st); f.to=iso(end); f.page=1; save(); render(); }
|
|
1963
|
+
function opsFDatesClear(){ const f=opsFilter(); f.from=''; f.to=''; f.page=1; save(); render(); }
|
|
1954
1964
|
function renderOps(C){
|
|
1955
1965
|
const P=ST.ui.period, mm=periodMonths(P), lk=!isAggregate(P)&&isLocked(primaryMonth());
|
|
1956
1966
|
document.getElementById('pageSub').textContent=`${P}`;
|
|
@@ -1961,6 +1971,7 @@ function renderOps(C){
|
|
|
1961
1971
|
const ops=base.filter(o=>
|
|
1962
1972
|
(!f.type||o.type===f.type) && (!f.point||o.point===f.point) &&
|
|
1963
1973
|
(!f.cat||o.category===f.cat) && (!f.acc||o.account===f.acc) &&
|
|
1974
|
+
(!f.from||(o.date||'')>=f.from) && (!f.to||(o.date||'')<=f.to) &&
|
|
1964
1975
|
(!q||((o.note||o.comment||'')+' '+o.category+' '+(o.account||'')).toLowerCase().includes(q)))
|
|
1965
1976
|
.sort((a,b)=>a.date<b.date?1:a.date>b.date?-1:0);
|
|
1966
1977
|
|
|
@@ -1986,10 +1997,21 @@ function renderOps(C){
|
|
|
1986
1997
|
<label class="f"><span>Точка</span>${sel(f.point,['Общий',...ST.points],'point')}</label>
|
|
1987
1998
|
<label class="f"><span>Статья</span>${sel(f.cat,allCats,'cat')}</label>
|
|
1988
1999
|
<label class="f"><span>Счёт</span>${sel(f.acc,ST.accounts.map(a=>a.name),'acc')}</label>
|
|
2000
|
+
<label class="f"><span>С даты</span><input type="date" value="${esc(f.from||'')}" onchange="opsFSet('from',this.value)" style="min-width:140px"></label>
|
|
2001
|
+
<label class="f"><span>По дату</span><input type="date" value="${esc(f.to||'')}" onchange="opsFSet('to',this.value)" style="min-width:140px"></label>
|
|
1989
2002
|
<label class="f" style="flex:1;min-width:170px"><span>Поиск</span><input value="${esc(f.q||'')}" placeholder="заметка, статья, счёт" oninput="if(event.key!=='Enter')null" onchange="opsFSet('q',this.value)"></label>
|
|
1990
2003
|
<label class="f"><span>Показывать</span><select onchange="opsFSet('size',this.value)">${
|
|
1991
2004
|
['25','50','100','200','all'].map(v=>`<option value="${v}" ${String(f.size)===v?'selected':''}>${v==='all'?'все':v}</option>`).join('')}</select></label>
|
|
1992
2005
|
<button class="ghost mini" onclick="opsFReset()">Сбросить</button>
|
|
2006
|
+
</div>
|
|
2007
|
+
<div class="row" style="gap:6px;margin-top:10px;flex-wrap:wrap;align-items:center">
|
|
2008
|
+
<span class="muted small" style="margin-right:4px">Быстро:</span>
|
|
2009
|
+
<button class="ghost mini" onclick="opsFDays(1)">сегодня</button>
|
|
2010
|
+
<button class="ghost mini" onclick="opsFDays(7)">7 дней</button>
|
|
2011
|
+
<button class="ghost mini" onclick="opsFDays(14)">14 дней</button>
|
|
2012
|
+
<button class="ghost mini" onclick="opsFDays(30)">30 дней</button>
|
|
2013
|
+
${(f.from||f.to)?`<span class="tag lock">${f.from?f.from.split('-').reverse().join('.'):'…'} → ${f.to?f.to.split('-').reverse().join('.'):'…'}</span>
|
|
2014
|
+
<button class="ghost mini" onclick="opsFDatesClear()">Снять даты</button>`:''}
|
|
1993
2015
|
</div></div></div>`;
|
|
1994
2016
|
|
|
1995
2017
|
const size = f.size==='all' ? ops.length||1 : Number(f.size)||50;
|