Skip to content

Commit

Permalink
chore: fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Jun 25, 2023
1 parent f4ea577 commit d34ab46
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
21 changes: 12 additions & 9 deletions packages/loot-core/src/mocks/budget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async function fillPrimaryChecking(handlers, account, payees, groups) {
);
let currentDay = monthUtils.currentDay();
for (let month of months) {
let date = monthUtils.addDays(month, '12');
let date = monthUtils.addDays(month, 12);
if (monthUtils.isBefore(date, currentDay)) {
transactions.push({
amount: -10000,
Expand All @@ -152,7 +152,7 @@ async function fillPrimaryChecking(handlers, account, payees, groups) {
});
}

date = monthUtils.addDays(month, '18');
date = monthUtils.addDays(month, 18);
if (monthUtils.isBefore(date, currentDay)) {
transactions.push({
amount: -9000,
Expand All @@ -163,7 +163,7 @@ async function fillPrimaryChecking(handlers, account, payees, groups) {
});
}

date = monthUtils.addDays(month, '2');
date = monthUtils.addDays(month, 2);
if (monthUtils.isBefore(date, currentDay)) {
transactions.push({
amount: -120000,
Expand All @@ -174,7 +174,7 @@ async function fillPrimaryChecking(handlers, account, payees, groups) {
});
}

date = monthUtils.addDays(month, '20');
date = monthUtils.addDays(month, 20);
if (monthUtils.isBefore(date, currentDay)) {
transactions.push({
amount: -6000,
Expand All @@ -186,7 +186,7 @@ async function fillPrimaryChecking(handlers, account, payees, groups) {
});
}

date = monthUtils.addDays(month, '23');
date = monthUtils.addDays(month, 23);
if (monthUtils.isBefore(date, currentDay)) {
transactions.push({
amount: -7500,
Expand Down Expand Up @@ -454,10 +454,10 @@ async function createBudget(accounts, payees, groups) {
}

function setBudgetIfSpent(month, cat) {
let spent = sheet.getCellValue(
let spent: number = sheet.getCellValue(
monthUtils.sheetForMonth(month),
`sum-amount-${cat.id}`,
);
) as number;

if (spent < 0) {
setBudget(month, cat, -spent);
Expand Down Expand Up @@ -515,7 +515,10 @@ async function createBudget(accounts, payees, groups) {
month <= monthUtils.currentMonth()
) {
let sheetName = monthUtils.sheetForMonth(month);
let toBudget = sheet.getCellValue(sheetName, 'to-budget');
let toBudget: number = sheet.getCellValue(
sheetName,
'to-budget',
) as number;
let available = toBudget - prevSaved;

if (available - 403000 > 0) {
Expand All @@ -534,7 +537,7 @@ async function createBudget(accounts, payees, groups) {
await sheet.waitOnSpreadsheet();

let sheetName = monthUtils.sheetForMonth(monthUtils.currentMonth());
let toBudget = sheet.getCellValue(sheetName, 'to-budget');
let toBudget: number = sheet.getCellValue(sheetName, 'to-budget') as number;
if (toBudget < 0) {
await addTransactions(primaryAccount.id, [
{
Expand Down
1 change: 1 addition & 0 deletions packages/loot-core/src/server/prefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Preferences = {
'notifications.schedules'?: boolean;
'notifications.repair-splits'?: boolean;
dummyTestPrefs?: boolean;
isCached?: boolean;
};

let prefs: Preferences = null;
Expand Down

0 comments on commit d34ab46

Please sign in to comment.