-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add history, multiple memo lines, etc...
- Loading branch information
Dan Safee
committed
Jun 22, 2024
1 parent
50abca6
commit a7cc6e0
Showing
8 changed files
with
150 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { ref, computed } from 'vue' | ||
import { defineStore } from 'pinia' | ||
|
||
export const useAppStore = defineStore('useAppStore', () => { | ||
const check = ref(null) | ||
|
||
return { check } | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function formatMoney (number: string) { | ||
var numberFloat: float = parseFloat(number) | ||
return numberFloat.toLocaleString('en-US', {style: 'decimal', minimumFractionDigits: 2, maximumFractionDigits: 2}) | ||
} | ||
|
||
export { formatMoney } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<template> | ||
<div class="about"> | ||
<h1>History</h1> | ||
<div v-if="history.length === 0"> | ||
<p>No history yet</p> | ||
</div> | ||
<div v-else> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Check #</th> | ||
<th>Amount</th> | ||
<th>Payee</th> | ||
<th>Account</th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr v-for="(item, index) in history" :key="item.id"> | ||
<td>{{ item.checkNumber }}</td> | ||
<td>${{ formatMoney(item.amount) }}</td> | ||
<td>{{ item.payTo }}</td> | ||
<td>{{ item.bankAccountNumber }}</td> | ||
<td> | ||
<button class="btn btn-outline-danger" @click="deleteItem(index)" style="margin-right: 10px">Delete</button> | ||
<button class="btn btn-outline-primary" @click="viewItem(index)">View</button> | ||
</td> | ||
|
||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style> | ||
</style> | ||
|
||
<script setup> | ||
import {formatMoney} from '../utilities.ts' | ||
import { ref, onMounted} from 'vue' | ||
import { useAppStore } from '../stores/app.ts' | ||
import { useRouter } from 'vue-router' | ||
const state = useAppStore() | ||
const router = useRouter() | ||
const history = ref([]) | ||
const loadHistory = () => { | ||
history.value = JSON.parse(localStorage.getItem('checkList') || '[]') | ||
} | ||
const deleteItem = (index) => { | ||
history.value.splice(index, 1) | ||
localStorage.setItem('checkList', JSON.stringify(history.value)) | ||
} | ||
const viewItem = (index) => { | ||
const item = history.value[index] | ||
state.check = item | ||
router.push('/') | ||
} | ||
onMounted(() => { | ||
loadHistory() | ||
}) | ||
</script> |
This file was deleted.
Oops, something went wrong.