- Introduced StockMutation model and service to handle stock changes. - Created migration for stock_mutations table. - Implemented stock mutation recording in various services (CuttingService, OrderService, PurchaseService, RestockService, RetailStockService). - Added StockHistoryController to manage stock history views. - Developed frontend components for displaying stock history and actions. - Updated routes to include stock history access with appropriate permissions. - Enhanced ProductVariant and RawMaterialPrice models to support stock mutations. - Added RowHistoryAction button for accessing stock history in product and raw material tables.
36 lines
1.1 KiB
Vue
36 lines
1.1 KiB
Vue
<script setup lang="ts">
|
|
import { Link } from '@inertiajs/vue3';
|
|
import { History } from '@lucide/vue';
|
|
import { Button } from '@/components/ui/button';
|
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
|
|
|
|
defineProps<{
|
|
href?: string;
|
|
tooltip?: string;
|
|
disabled?: boolean;
|
|
}>();
|
|
|
|
const emit = defineEmits<{
|
|
click: [];
|
|
}>();
|
|
</script>
|
|
|
|
<template>
|
|
<Tooltip>
|
|
<TooltipTrigger as-child>
|
|
<Button variant="ghost" size="icon" class="size-8" :disabled="disabled" :as-child="!!href && !disabled"
|
|
@click="!href && !disabled && emit('click')">
|
|
<Link v-if="href && !disabled" :href="href">
|
|
<History class="size-4" />
|
|
<span class="sr-only">{{ tooltip || 'Riwayat Stok' }}</span>
|
|
</Link>
|
|
<template v-else>
|
|
<History class="size-4" />
|
|
<span class="sr-only">{{ tooltip || 'Riwayat Stok' }}</span>
|
|
</template>
|
|
</Button>
|
|
</TooltipTrigger>
|
|
<TooltipContent>{{ tooltip || 'Riwayat Stok' }}</TooltipContent>
|
|
</Tooltip>
|
|
</template>
|