Skip to content

Commit 3151469

Browse files
committed
Finance Tracker
1 parent 5d7b508 commit 3151469

2 files changed

Lines changed: 0 additions & 53 deletions

File tree

Projects/Finance Tracker/index.html

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<link rel="stylesheet" href="styles.css">
8-
<<<<<<< HEAD
9-
10-
=======
11-
12-
>>>>>>> a548c639afa0f1ac1cdb441c63180145b7acef31
138

149
<title>Personal Finance Tracker</title>
1510
</head>
@@ -66,7 +61,6 @@ <h2>Transaction History</h2>
6661
<p id="noTransactionMessage">No transactions yet.</p>
6762
</section>
6863
<section id="bottom"></section>
69-
<<<<<<< HEAD
7064

7165
</main>
7266

@@ -75,13 +69,3 @@ <h2>Transaction History</h2>
7569
</body>
7670

7771
</html>
78-
=======
79-
80-
</main>
81-
82-
<script src="index.js"></script>
83-
84-
</body>
85-
86-
</html>
87-
>>>>>>> a548c639afa0f1ac1cdb441c63180145b7acef31

Projects/Finance Tracker/index.js

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ function updateBalance() {
2525
const balance = transactions.reduce((acc, transaction) => {
2626
return transaction.type === "income" ? acc + transaction.amount : acc - transaction.amount;
2727
}, 0);
28-
<<<<<<< HEAD
2928

3029
totalIncome = transactions.reduce((acc, transaction) => {
3130
return transaction.type === "income" ? acc + transaction.amount : acc;
@@ -35,17 +34,6 @@ function updateBalance() {
3534
return transaction.type === "expense" ? acc + transaction.amount : acc;
3635
}, 0);
3736

38-
=======
39-
40-
totalIncome = transactions.reduce((acc, transaction) => {
41-
return transaction.type === "income" ? acc + transaction.amount : acc;
42-
}, 0);
43-
44-
totalExpense = transactions.reduce((acc, transaction) => {
45-
return transaction.type === "expense" ? acc + transaction.amount : acc;
46-
}, 0);
47-
48-
>>>>>>> a548c639afa0f1ac1cdb441c63180145b7acef31
4937
balanceAmount.textContent = balance.toFixed(2);
5038
incomeAmount.textContent = totalIncome.toFixed(2);
5139
expenseAmount.textContent = totalExpense.toFixed(2);
@@ -65,13 +53,8 @@ function addTransaction(event) {
6553
amount,
6654
type
6755
};
68-
<<<<<<< HEAD
6956

7057

71-
=======
72-
73-
74-
>>>>>>> a548c639afa0f1ac1cdb441c63180145b7acef31
7558
transactions.push(transaction);
7659
if(type==="income"){
7760
totalIncome+=amount;
@@ -101,11 +84,6 @@ function deleteTransaction(index) {
10184
updateTransactions();
10285
updateBalance();
10386
saveTransactions();
104-
<<<<<<< HEAD
105-
106-
=======
107-
108-
>>>>>>> a548c639afa0f1ac1cdb441c63180145b7acef31
10987
}
11088

11189
// Function to save transactions to Local Storage
@@ -159,33 +137,18 @@ function editTransaction(index) {
159137
amount: updatedAmount,
160138
type: updatedType
161139
};
162-
<<<<<<< HEAD
163-
164-
=======
165-
166-
>>>>>>> a548c639afa0f1ac1cdb441c63180145b7acef31
167140
if (transaction.type === "income") {
168141
totalIncome -= transaction.amount;
169142
totalIncome += updatedAmount;
170143
} else if (transaction.type === "expense") {
171144
totalExpense -= transaction.amount;
172145
totalExpense += updatedAmount;
173146
}
174-
<<<<<<< HEAD
175-
176-
=======
177-
178-
>>>>>>> a548c639afa0f1ac1cdb441c63180145b7acef31
179147
transactions[index] = updatedTransaction;
180148
alert(`Transaction "${updatedTransaction.description}" updated successfully!`);
181149
updateTransactions();
182150
updateBalance();
183151
saveTransactions();
184-
<<<<<<< HEAD
185-
186-
=======
187-
188-
>>>>>>> a548c639afa0f1ac1cdb441c63180145b7acef31
189152
} else {
190153
alert("Invalid input! Please try again.");
191154
}

0 commit comments

Comments
 (0)