release v2.0.0 #4

Merged
crimsen merged 481 commits from develop into master 2024-01-18 15:15:08 +00:00
4 changed files with 31 additions and 32 deletions
Showing only changes of commit 9b273c2501 - Show all commits

View File

@ -3,7 +3,7 @@
<q-page padding> <q-page padding>
<q-card> <q-card>
<q-card-section> <q-card-section>
<q-table :data="rows" row-key="userid" :columns="columns" /> <q-table :rows="rows" row-key="userid" :columns="columns" />
</q-card-section> </q-card-section>
</q-card> </q-card>
</q-page> </q-page>
@ -32,28 +32,28 @@ export default defineComponent({
field: 'userid', field: 'userid',
required: true, required: true,
align: 'left', align: 'left',
sortable: true, sortable: true
}, },
{ {
name: 'credit', name: 'credit',
label: 'Haben', label: 'Haben',
field: 'credit', field: 'credit',
format: (val: number) => val.toFixed(2), format: (val: number) => val.toFixed(2)
}, },
{ {
name: 'debit', name: 'debit',
label: 'Soll', label: 'Soll',
field: 'debit', field: 'debit',
format: (val: number) => val.toFixed(2), format: (val: number) => val.toFixed(2)
}, },
{ {
name: 'balance', name: 'balance',
label: 'Kontostand', label: 'Kontostand',
format: (_: undefined, row: { debit: number; credit: number }) => format: (_: undefined, row: { debit: number; credit: number }) =>
(row.credit - row.debit).toFixed(2), (row.credit - row.debit).toFixed(2)
}, }
]; ];
return { rows, columns }; return { rows, columns };
}, }
}); });
</script> </script>

View File

@ -10,7 +10,7 @@
<q-table <q-table
v-model:pagination="pagination" v-model:pagination="pagination"
title="Buchungen" title="Buchungen"
:data="data" :rows="data"
:columns="columns" :columns="columns"
row-key="id" row-key="id"
:loading="loading" :loading="loading"
@ -50,7 +50,7 @@ export default defineComponent({
void userStore.getUsers().then(() => void userStore.getUsers().then(() =>
onRequest({ onRequest({
pagination: pagination.value, pagination: pagination.value,
filter: undefined, filter: undefined
}) })
); );
}); });
@ -63,7 +63,7 @@ export default defineComponent({
descending: false, descending: false,
page: 1, page: 1,
rowsPerPage: 3, rowsPerPage: 3,
rowsNumber: 10, rowsNumber: 10
}); });
interface PaginationInterface { interface PaginationInterface {
@ -87,7 +87,7 @@ export default defineComponent({
offset: startRow, offset: startRow,
limit: fetchCount, limit: fetchCount,
showCancelled: showCancelled.value, showCancelled: showCancelled.value,
showReversals: false, showReversals: false
}); });
// clear out existing data and add new // clear out existing data and add new
data.value.splice(0, data.value.length, ...result.transactions); data.value.splice(0, data.value.length, ...result.transactions);
@ -112,7 +112,7 @@ export default defineComponent({
field: 'time', field: 'time',
required: true, required: true,
sortable: true, sortable: true,
format: (val: Date) => formatDateTime(new Date(val), true, true, true), format: (val: Date) => formatDateTime(new Date(val), true, true, true)
}, },
{ {
name: 'type', name: 'type',
@ -126,7 +126,7 @@ export default defineComponent({
else return 'Gesendet an X'; else return 'Gesendet an X';
} }
} }
}, }
}, },
{ {
name: 'text', name: 'text',
@ -140,13 +140,13 @@ export default defineComponent({
else return 'Gesendet an X'; else return 'Gesendet an X';
} }
} }
}, }
}, },
{ {
name: 'amount', name: 'amount',
label: 'Betrag', label: 'Betrag',
field: 'amount', field: 'amount',
format: (val: number) => `${val.toFixed(2)}`, format: (val: number) => `${val.toFixed(2)}`
}, },
{ {
name: 'author_id', name: 'author_id',
@ -156,11 +156,11 @@ export default defineComponent({
const user = userStore.users.filter((x) => x.userid == val); const user = userStore.users.filter((x) => x.userid == val);
if (user.length > 0) return user[0].display_name; if (user.length > 0) return user[0].display_name;
else return val; else return val;
}, }
}, }
]; ];
return { data, pagination, onRequest, loading, balance, columns, showCancelled }; return { data, pagination, onRequest, loading, balance, columns, showCancelled };
}, }
}); });
</script> </script>

View File

@ -16,7 +16,7 @@
</q-dialog> </q-dialog>
<q-page padding> <q-page padding>
<q-table title="Getränkearten" :data="rows" :row-key="(row) => row.id" :columns="columns"> <q-table title="Getränkearten" :rows="rows" :row-key="(row) => row.id" :columns="columns">
<template #top-right> <template #top-right>
<q-input <q-input
v-model="newDrinkType" v-model="newDrinkType"
@ -63,7 +63,6 @@ export default defineComponent({
console.log(store); console.log(store);
void store.getDrinkTypes(); void store.getDrinkTypes();
}); });
const rows = computed(() => store.drinkTypes); const rows = computed(() => store.drinkTypes);
const columns = [ const columns = [
{ {
@ -71,14 +70,14 @@ export default defineComponent({
label: 'Getränkeart', label: 'Getränkeart',
field: 'name', field: 'name',
align: 'left', align: 'left',
sortable: true, sortable: true
}, },
{ {
name: 'actions', name: 'actions',
label: 'Aktionen', label: 'Aktionen',
field: 'actions', field: 'actions',
align: 'right', align: 'right'
}, }
]; ];
async function addType() { async function addType() {
@ -95,7 +94,7 @@ export default defineComponent({
try { try {
await store.changeDrinkTypeName({ await store.changeDrinkTypeName({
id: actualDrinkType.value.id, id: actualDrinkType.value.id,
name: newDrinkTypeName.value, name: newDrinkTypeName.value
}); });
} catch (e) {} } catch (e) {}
discardChanges(); discardChanges();
@ -122,9 +121,9 @@ export default defineComponent({
actualDrinkType, actualDrinkType,
newDrinkTypeName, newDrinkTypeName,
discardChanges, discardChanges,
saveChanges, saveChanges
}; };
}, }
}); });
</script> </script>

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<q-table title="Getränke" :columns="columns" :data="drinks" row-key="name"> <q-table title="Getränke" :columns="columns" :rows="drinks" row-key="name">
<template #body-cell-prices="{ row: { prices } }"> <template #body-cell-prices="{ row: { prices } }">
<q-td> <q-td>
<div v-for="price in prices" :key="price.id" class="row"> <div v-for="price in prices" :key="price.id" class="row">
@ -34,7 +34,7 @@ export default defineComponent({
}, },
setCurrency(price: number) { setCurrency(price: number) {
return `${price.toFixed(2)}`; return `${price.toFixed(2)}`;
}, }
}, },
setup() { setup() {
const store = usePricelistStore(); const store = usePricelistStore();
@ -47,15 +47,15 @@ export default defineComponent({
{ {
name: 'name', name: 'name',
label: 'Getränk', label: 'Getränk',
field: 'name', field: 'name'
}, },
{ {
name: 'prices', name: 'prices',
label: 'Preise', label: 'Preise',
field: 'prices', field: 'prices'
}, }
]; ];
return { columns, drinks }; return { columns, drinks };
}, }
}); });
</script> </script>