feat(MemberOrder): add budget field to MemberOrder and MemberOrderHistory models
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 41s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 41s
- Introduced a new budget field in both MemberOrder and MemberOrderHistory models to track budget amounts. - Updated memberOrderService to handle budget in serialization and normalization processes. - Enhanced OrdersPanel component to include budget input and display in the UI. - Added German localization for the new budget term to ensure consistency across languages.
This commit is contained in:
@@ -40,6 +40,10 @@
|
||||
<span>{{ $t('orders.paid') }}</span>
|
||||
<input v-model="newOrder.paidAmount" type="number" min="0" step="0.01">
|
||||
</label>
|
||||
<label>
|
||||
<span>{{ $t('orders.budget') }}</span>
|
||||
<input v-model="newOrder.budget" type="number" min="0" step="0.01">
|
||||
</label>
|
||||
<label>
|
||||
<span>{{ $t('orders.status') }}</span>
|
||||
<select v-model="newOrder.status">
|
||||
@@ -75,6 +79,7 @@
|
||||
<th>{{ $t('orders.statusDate') }}</th>
|
||||
<th>{{ $t('orders.cost') }}</th>
|
||||
<th>{{ $t('orders.paid') }}</th>
|
||||
<th>{{ $t('orders.budget') }}</th>
|
||||
<th>{{ $t('orders.open') }}</th>
|
||||
<th>{{ $t('orders.history') }}</th>
|
||||
<th>{{ $t('common.save') }}</th>
|
||||
@@ -102,6 +107,9 @@
|
||||
<td>
|
||||
<input v-model="order.draftPaidAmount" type="number" min="0" step="0.01" class="orders-inline-input orders-inline-input-number">
|
||||
</td>
|
||||
<td>
|
||||
<input v-model="order.draftBudget" type="number" min="0" step="0.01" class="orders-inline-input orders-inline-input-number">
|
||||
</td>
|
||||
<td>{{ formatCurrency(calculateOpenAmount(order)) }}</td>
|
||||
<td>
|
||||
<details class="orders-history-details">
|
||||
@@ -110,7 +118,7 @@
|
||||
<div v-for="entry in order.historyEntries || []" :key="entry.id" class="orders-history-entry">
|
||||
<strong>{{ statusLabel(entry.status) }}</strong>
|
||||
<span>{{ formatDateTime(entry.changedAt) }}</span>
|
||||
<span>{{ formatCurrency(entry.cost) }} / {{ formatCurrency(entry.paidAmount) }}</span>
|
||||
<span>{{ formatCurrency(entry.cost) }} / {{ formatCurrency(entry.paidAmount) }} / {{ formatCurrency(entry.budget) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
@@ -181,7 +189,8 @@ export default {
|
||||
item: '',
|
||||
status: 'requested',
|
||||
cost: '',
|
||||
paidAmount: ''
|
||||
paidAmount: '',
|
||||
budget: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -251,7 +260,8 @@ export default {
|
||||
draftItem: order.item || '',
|
||||
draftStatus: order.status || 'requested',
|
||||
draftCost: String(normalizeAmount(order.cost)),
|
||||
draftPaidAmount: String(normalizeAmount(order.paidAmount))
|
||||
draftPaidAmount: String(normalizeAmount(order.paidAmount)),
|
||||
draftBudget: String(normalizeAmount(order.budget))
|
||||
};
|
||||
},
|
||||
async loadOrders() {
|
||||
@@ -285,7 +295,8 @@ export default {
|
||||
item: this.newOrder.item.trim(),
|
||||
status: this.newOrder.status,
|
||||
cost: normalizeAmount(this.newOrder.cost),
|
||||
paidAmount: normalizeAmount(this.newOrder.paidAmount)
|
||||
paidAmount: normalizeAmount(this.newOrder.paidAmount),
|
||||
budget: normalizeAmount(this.newOrder.budget)
|
||||
});
|
||||
if (response.data?.order) {
|
||||
this.orders.unshift(this.hydrateOrder(response.data.order));
|
||||
@@ -293,7 +304,8 @@ export default {
|
||||
item: '',
|
||||
status: 'requested',
|
||||
cost: '',
|
||||
paidAmount: ''
|
||||
paidAmount: '',
|
||||
budget: ''
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -306,7 +318,8 @@ export default {
|
||||
return order.draftItem !== (order.item || '')
|
||||
|| order.draftStatus !== order.status
|
||||
|| normalizeAmount(order.draftCost) !== normalizeAmount(order.cost)
|
||||
|| normalizeAmount(order.draftPaidAmount) !== normalizeAmount(order.paidAmount);
|
||||
|| normalizeAmount(order.draftPaidAmount) !== normalizeAmount(order.paidAmount)
|
||||
|| normalizeAmount(order.draftBudget) !== normalizeAmount(order.budget);
|
||||
},
|
||||
async saveOrder(order) {
|
||||
this.savingOrderIds.push(order.id);
|
||||
@@ -316,7 +329,8 @@ export default {
|
||||
item: order.draftItem,
|
||||
status: order.draftStatus,
|
||||
cost: normalizeAmount(order.draftCost),
|
||||
paidAmount: normalizeAmount(order.draftPaidAmount)
|
||||
paidAmount: normalizeAmount(order.draftPaidAmount),
|
||||
budget: normalizeAmount(order.draftBudget)
|
||||
});
|
||||
if (response.data?.order) {
|
||||
const updated = this.hydrateOrder(response.data.order);
|
||||
|
||||
@@ -457,6 +457,7 @@
|
||||
"statusHandedOver": "Artikel ausgehändigt",
|
||||
"cost": "Kosten",
|
||||
"paid": "Bezahlt",
|
||||
"budget": "Budget",
|
||||
"open": "Noch offen",
|
||||
"history": "Verlauf",
|
||||
"orderDate": "Erfasst am",
|
||||
|
||||
Reference in New Issue
Block a user