update gambar struk

This commit is contained in:
adityaalfarison 2025-10-16 17:06:18 +07:00
parent ecc9385c28
commit bab572e2ca
3 changed files with 12 additions and 14 deletions

View File

@ -75,6 +75,7 @@ class TransaksiController extends Controller
'kasir', 'kasir',
'sales', 'sales',
'itemTransaksi.produk', 'itemTransaksi.produk',
'itemTransaksi.produk.foto',
'itemTransaksi' => function ($query) { 'itemTransaksi' => function ($query) {
$query->orderBy('created_at', 'asc'); $query->orderBy('created_at', 'asc');
} }

Binary file not shown.

View File

@ -73,19 +73,16 @@
<span v-if="item.harga_deal && item.harga_deal > 0">1</span> <span v-if="item.harga_deal && item.harga_deal > 0">1</span>
</td> </td>
<td class="flex items-center gap-2 p-2 border-r border-D" :style="getRowStyle()"> <td class="flex items-center gap-2 p-2 border-r border-D" :style="getRowStyle()">
<template v-if="item.produk?.foto?.[0]?.url"> <img
<img :src="item.produk.foto[0].url" :class="getImageClass()" class="object-cover rounded" /> :src="item.produk?.foto?.[0]?.url || 'https://via.placeholder.com/50x50?text=No+Img'"
</template> :class="getImageClass()"
<template v-else-if="item.produk?.nama"> class="object-cover rounded"
<div :class="getImageClass() + ' bg-gray-200 rounded flex items-center justify-center'"> />
<span class="text-xs text-gray-500">IMG</span>
</div>
</template> <span :class="getTextClass()">{{ item.produk?.nama || '' }}</span>
<template v-else> </td>
<div :class="getImageClass()"></div>
</template>
<span :class="getTextClass()">{{ item.produk?.nama || '' }}</span>
</td>
<td class="border-r border-D"> <td class="border-r border-D">
<span v-if="item.produk?.nama">{{ item.posisi_asal || 'Brankas' }}</span> <span v-if="item.produk?.nama">{{ item.posisi_asal || 'Brankas' }}</span>
</td> </td>
@ -206,7 +203,7 @@ const formatDate = (dateString) => {
const day = String(date.getDate()).padStart(2, '0') const day = String(date.getDate()).padStart(2, '0')
const month = months[date.getMonth()] const month = months[date.getMonth()]
const year = date.getFullYear() const year = date.getFullYear()
return `${dayName}/${day}-${month}-${year}` return `${dayName}, ${day}-${month}-${year}`
} }
const itemsWithMinimal = computed(() => { const itemsWithMinimal = computed(() => {