This commit is contained in:
2026-08-21 06:34:32 +02:00
parent 06c6eb867f
commit cc62602131
6 changed files with 149 additions and 26 deletions
+2 -2
View File
@@ -57,7 +57,7 @@ export function buildAnnualForecast(data,year,accountId,personId='all',includeTr
if(includeTransfers) for(const item of data.transfers||[]){
const factor=transferFactorForAccount(data,item,personId,accountId); if(!factor||(item.fromAccountId!==accountId&&item.toAccountId!==accountId))continue;
for(let m=0;m<12;m++)if(occursInMonth(item,year,m)){
const amount=Number(item.amount||0)*factor;
const amount=effectiveAmount(item,year,m)*factor;
if(item.toAccountId===accountId){rows[m].transferIn+=amount;rows[m].items.push({...item,kind:'transfer',direction:'in',reportAmount:amount});}
if(item.fromAccountId===accountId){rows[m].transferOut+=amount;rows[m].items.push({...item,kind:'transfer',direction:'out',reportAmount:amount});}
}
@@ -69,7 +69,7 @@ export function buildAnnualForecast(data,year,accountId,personId='all',includeTr
function occurrenceRows(data,year,accountId,personId='all',includeTransfers=true){
const result=[];
const push=(item,kind,monthIndex,direction='',factor=1)=>{
const amount=(kind==='transfer'?Number(item.amount||0):effectiveAmount(item,year,monthIndex))*factor;
const amount=effectiveAmount(item,year,monthIndex)*factor;
result.push({monthIndex,month:MONTHS[monthIndex],kind,direction,name:item.name,person:kind==='transfer'?transferPersonLabel(data,item):personLabel(data,item),category:categoryName(data,item.categoryId),amount});
};
for(const item of data.incomes||[]){const factor=personFactor(item,personId);if(factor&&item.accountId===accountId)for(let m=0;m<12;m++)if(occursInMonth(item,year,m))push(item,'income',m,'',factor);}