2023.12.19.09.12

This commit is contained in:
2023-12-19 09:12:42 +01:00
parent f6f9819058
commit cafc808395
26 changed files with 939 additions and 146 deletions

View File

@@ -0,0 +1,41 @@
details
summary Create new transaction
form(action="/transactions",method="POST")
div.form-group
.text Description
.input
textarea(name="description", cols="30", rows="5") Test
div.form-group.half
.text Date
.input
input(type="date",name="date")
div.form-group.half
.text Time
.input
input(type="time",name="time")
div.form-group.half
.text Type
.input
select(name="type")
option(value="income") Income
option(value="expense",select) Expense
option(value="transfer") Transfer
div.form-group.half
.text Amount
.input
input(type="text",name="amount",required)
div.form-group
.text Account
.input
select(name="account")
each account in accounts
option(value=account.AccountID)=account.Name
div.form-group
.text Category
.input
select(name="category")
each category in categories
option(value=category.CategoryID,title=category.Description)=category.Name
button(type="submit") Add Transaction

View File

@@ -0,0 +1,39 @@
extends ./transactions.pug
block content
form(action="/transactions/addTransaction",method="POST")
div.form-group
.text Description
.input
textarea(name="description", cols="30", rows="5")
div.form-group.half
.text Date
.input
input(type="date",name="date")
div.form-group.half
.text Time
.input
input(type="time",name="time")
div.form-group.half
.text Type
.input
select(name="type")
option(value="income") Income
option(value="expense",select) Expense
option(value="transfer") Transfer
div.form-group.half
.text Account
.input
select(name="account")
each account in accounts
option(value=account.AccountID)=account.Name
div.form-group.half
.text Amount
.input
input(type="number",min="0",step="0.01",name="amount",required)
div.form-group.half
.text Category
.input
select(name="category")
each category in categories
option(value=category.CategoryID,title=category.Description)=category.Name
button(type="submit") Add Transaction

View File

@@ -0,0 +1,40 @@
extends ./transactions.pug
block content
form(action="/transactions/addTransfer",method="POST")
div.form-group
.text Description
.input
textarea(name="description", cols="30", rows="5")
div.form-group.half
.text Date
.input
input(type="date",name="date")
div.form-group.half
.text Time
.input
input(type="time",name="time")
div.form-group.half
.text from Account
.input
select(name="fromAccount")
each account in accounts
option(value=account.AccountID)=account.Name
div.form-group.half
.text to Account
.input
select(name="toAccount")
each account in accounts
option(value=account.AccountID)=account.Name
div.form-group.half
.text Amount
.input
input(type="number",min="0",step="0.01",name="amount",required)
div.form-group.half
.text Category
.input
select(name="category")
each category in categories
option(value=category.CategoryID,title=category.Description)=category.Name
button(type="submit") Add Transaction

View File

@@ -0,0 +1,22 @@
extends ./transactions.pug
block content
table(class=`${cssClass}`)
thead
th ID
th Date
th Description
th Category
th Account
th.right Amount
tbody
each transaction in transactions
tr(class=`${transaction.Type}`)
td=transaction.TransactionID
td=transaction.Date2
td=transaction.Description
td
a(href=`/transactions/cat/${transaction.Category.CategoryID}`)=transaction.Category.Name
td
a(href=`/transactions/acc/${transaction.Account.AccountID}`)=transaction.Account.Name
td(class=`${transaction.Type} amount` )=transaction.Amount

View File

@@ -1,24 +1,11 @@
extends ../layout/base.pug
block nav
a(href="/transactions") Transactions
a(href="/transactions/addTransaction") + Transaction
a(href="/transactions/addTransfer") + Transfer
block headline
h1 Transactions
block content
form(action="/tansactions",method="POST")
table
thead
th ID
th Date
th Description
th Account
th Amount
tbody
each transaction in transactions
tr
td=transaction.TransactionID
td=transaction.Date
td=transaction.Description
td=transaction.Account.Name
td(class=`${transaction.Type} amount` )=transaction.Amount
block content