refactor: remove unused expense components and streamline expense deletion logic for improved code clarity
This commit is contained in:
parent
802c4e36c0
commit
f08ba25686
@ -122,9 +122,6 @@ public function update(Expense $expense, array $validated): void
|
||||
|
||||
public function delete(Expense $expense): void
|
||||
{
|
||||
$amount = $expense->amount;
|
||||
$description = $expense->description;
|
||||
|
||||
DB::transaction(function () use ($expense): void {
|
||||
if ($expense->cashTransaction) {
|
||||
$this->cashService->deleteReferencedTransaction($expense->cashTransaction);
|
||||
|
||||
@ -2,8 +2,6 @@
|
||||
import { Head } from '@inertiajs/vue3';
|
||||
import { Plus } from '@lucide/vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { createColumns } from '@/components/admin/finance/expenses/columns';
|
||||
import ExpenseFormModal from '@/components/admin/finance/expenses/ExpenseFormModal.vue';
|
||||
import { DataTable } from '@/components/data-table';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
@ -12,6 +10,8 @@ import { useDataTableQuery, useDataTableQuerySync } from '@/composables/useDataT
|
||||
import AdminLayout from '@/layouts/AdminLayout.vue';
|
||||
import type { DataTableSort } from '@/types/data-table';
|
||||
import type { ExpenseListItem, PaginatedExpenses } from '@/types/expense';
|
||||
import ExpenseFormModal from './form/ExpenseFormModal.vue';
|
||||
import { createColumns } from './table/columns';
|
||||
|
||||
const props = defineProps<{
|
||||
expenses: PaginatedExpenses;
|
||||
|
||||
@ -142,7 +142,7 @@ function submit() {
|
||||
<FieldError :errors="formErrors(form, 'amount')" />
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel for="expense-description" required>Keterangan</FieldLabel>
|
||||
<!-- <FieldLabel for="expense-description" required>Keterangan</FieldLabel> -->
|
||||
<Textarea id="expense-description" v-model="form.description"
|
||||
placeholder="Contoh: Pembelian perlengkapan toko" rows="3"
|
||||
:maxlength="FIELD_LIMITS.description" />
|
||||
@ -1,9 +1,9 @@
|
||||
import type { ColumnDef } from '@tanstack/vue-table';
|
||||
import { h } from 'vue';
|
||||
import DataTableActions from '@/components/admin/finance/expenses/data-table-actions.vue';
|
||||
import { DataTableColumnHeader } from '@/components/data-table';
|
||||
import MediaThumbnailCell from '@/components/media/MediaThumbnailCell.vue';
|
||||
import type { ExpenseListItem } from '@/types/expense';
|
||||
import DataTableActions from './data-table-actions.vue';
|
||||
|
||||
export function createColumns(onEdit: (expense: ExpenseListItem) => void): ColumnDef<ExpenseListItem>[] {
|
||||
return [
|
||||
Loading…
Reference in New Issue
Block a user