mirror of
https://github.com/jcreek/bank-statement-analyser.git
synced 2026-07-12 18:33:46 +00:00
Ignores transactions that already exist on import
This commit is contained in:
@@ -23,13 +23,15 @@ If you wish to contribute other bank statement csv formats or features then plea
|
||||
|
||||
1. ~~Set up adding statement lines and displaying them~~
|
||||
2. ~~Set up adding and saving statement lines with localstorage, and reloading from localstorage~~
|
||||
3. Set up importing a csv file (bank statement) to the data structure, adding each line
|
||||
4. Modify that to ignore any entries that already exist upon import
|
||||
3. ~~Set up importing a csv file (bank statement) to the data structure, adding each line ignoring different accounts~~
|
||||
4. ~~Modify that to ignore any entries that already exist upon import~~
|
||||
5. Set up a system to enable selecting a tag from the preset tags for each line when importing
|
||||
6. Modify that to enable creating a new tag and saving that to localstorage
|
||||
|
||||
### Things for later versions
|
||||
|
||||
- Sort transactions by date order
|
||||
- Be able to handle separate accounts, and split transactions into these
|
||||
- Be able to set rules to auto apply these, or manually set them for each item on a statement when adding it in
|
||||
- Be able to summarise (with graphs) expenditure and savings for any selected time period
|
||||
- Be able to expand the above summaries for more detailed information
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<form @submit="importCSV">
|
||||
<textarea v-model="csv" name="csv" placeholder="Add statement csv..."></textarea>
|
||||
<input type="submit" value="Submit" class="btn">
|
||||
<input type="submit" value="Import CSV" class="btn">
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
@@ -46,7 +46,6 @@ export default {
|
||||
}
|
||||
|
||||
result.forEach (function(transaction) {
|
||||
alert(JSON.stringify(transaction["Date"]));
|
||||
const newTransaction = {
|
||||
id: uuid.v4(),
|
||||
date: transaction["Date"],
|
||||
|
||||
+9
-1
@@ -63,8 +63,16 @@ export default {
|
||||
localStorage.setItem("transactionStorage", JSON.stringify(this.transactions));
|
||||
},
|
||||
addTransaction(newTransaction) {
|
||||
this.transactions.push(newTransaction);
|
||||
// Determine whether this transaction already exists
|
||||
const found = this.transactions.some(transaction => transaction.date === newTransaction.date && transaction.transactionTypeDescription === newTransaction.transactionTypeDescription && transaction.description === newTransaction.description && transaction.isExpenditure === newTransaction.isExpenditure && transaction.amount === newTransaction.amount && transaction.balance === newTransaction.balance);
|
||||
if (found) {
|
||||
alert('found duplicate transaction, not adding it - ' + newTransaction.date + ' :: ' + newTransaction.description);
|
||||
}
|
||||
else {
|
||||
this.transactions.push(newTransaction);
|
||||
this.saveTransactions();
|
||||
}
|
||||
|
||||
},
|
||||
saveTransactions() {
|
||||
localStorage.setItem("lastname", "Smith");
|
||||
|
||||
Reference in New Issue
Block a user