Adds entry date to expense entries
Adds a date field to expense entries for better tracking and reporting. This allows users to specify the date of the expense transaction, providing more accurate financial records.
This commit is contained in:
parent
b529a72d9e
commit
c7bc0c7904
4 changed files with 14 additions and 1 deletions
|
|
@ -94,6 +94,7 @@ class ExpenseEntry(BaseModel):
|
||||||
user_wallet: str
|
user_wallet: str
|
||||||
reference: Optional[str] = None
|
reference: Optional[str] = None
|
||||||
currency: Optional[str] = None # If None, amount is in satoshis. Otherwise, fiat currency code (EUR, USD, etc.)
|
currency: Optional[str] = None # If None, amount is in satoshis. Otherwise, fiat currency code (EUR, USD, etc.)
|
||||||
|
entry_date: Optional[datetime] = None # Date of the expense transaction
|
||||||
|
|
||||||
|
|
||||||
class ReceivableEntry(BaseModel):
|
class ReceivableEntry(BaseModel):
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ window.app = Vue.createApp({
|
||||||
isEquity: false,
|
isEquity: false,
|
||||||
reference: '',
|
reference: '',
|
||||||
currency: 'EUR',
|
currency: 'EUR',
|
||||||
|
date: new Date().toISOString().split('T')[0], // YYYY-MM-DD format
|
||||||
loading: false
|
loading: false
|
||||||
},
|
},
|
||||||
payDialog: {
|
payDialog: {
|
||||||
|
|
@ -472,7 +473,8 @@ window.app = Vue.createApp({
|
||||||
is_equity: this.expenseDialog.isEquity,
|
is_equity: this.expenseDialog.isEquity,
|
||||||
user_wallet: this.g.user.wallets[0].id,
|
user_wallet: this.g.user.wallets[0].id,
|
||||||
reference: this.expenseDialog.reference || null,
|
reference: this.expenseDialog.reference || null,
|
||||||
currency: this.expenseDialog.currency || null
|
currency: this.expenseDialog.currency || null,
|
||||||
|
entry_date: this.expenseDialog.date ? `${this.expenseDialog.date}T00:00:00` : null
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
|
|
@ -974,6 +976,7 @@ window.app = Vue.createApp({
|
||||||
this.expenseDialog.isEquity = false
|
this.expenseDialog.isEquity = false
|
||||||
this.expenseDialog.reference = ''
|
this.expenseDialog.reference = ''
|
||||||
this.expenseDialog.currency = 'EUR'
|
this.expenseDialog.currency = 'EUR'
|
||||||
|
this.expenseDialog.date = new Date().toISOString().split('T')[0]
|
||||||
},
|
},
|
||||||
resetReceivableDialog() {
|
resetReceivableDialog() {
|
||||||
this.receivableDialog.selectedUser = ''
|
this.receivableDialog.selectedUser = ''
|
||||||
|
|
|
||||||
|
|
@ -677,6 +677,14 @@
|
||||||
placeholder="e.g., Groceries for the house"
|
placeholder="e.g., Groceries for the house"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
|
||||||
|
<q-input
|
||||||
|
filled
|
||||||
|
dense
|
||||||
|
v-model="expenseDialog.date"
|
||||||
|
type="date"
|
||||||
|
label="Date *"
|
||||||
|
></q-input>
|
||||||
|
|
||||||
<q-select
|
<q-select
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
|
|
|
||||||
|
|
@ -312,6 +312,7 @@ async def api_create_expense_entry(
|
||||||
entry_data = CreateJournalEntry(
|
entry_data = CreateJournalEntry(
|
||||||
description=data.description + description_suffix,
|
description=data.description + description_suffix,
|
||||||
reference=data.reference,
|
reference=data.reference,
|
||||||
|
entry_date=data.entry_date,
|
||||||
flag=JournalEntryFlag.PENDING, # Expenses require admin approval
|
flag=JournalEntryFlag.PENDING, # Expenses require admin approval
|
||||||
meta=entry_meta,
|
meta=entry_meta,
|
||||||
lines=[
|
lines=[
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue