@extends('layouts.layoutMaster') @section('title', 'Daftar Stock Opname') @section('vendor-style') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.scss', 'resources/assets/vendor/libs/sweetalert2/sweetalert2.scss' ]) @endsection @section('vendor-script') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js', 'resources/assets/vendor/libs/sweetalert2/sweetalert2.js' ]) @endsection @section('content')
Daftar Stock Opname
@foreach($opnames as $opname) @php $totalDifferenceQty = 0; $totalDifferenceValue = 0; foreach ($opname->details as $detail) { $totalDifferenceQty += $detail->difference; // Make sure we have a valid batch with a unit price if ($detail->batch && $detail->batch->unit_price) { $totalDifferenceValue += $detail->difference * $detail->batch->unit_price; } } // Cek apakah ada cash flow transaction $hasCashFlow = false; $hasJournal = false; $cashFlowTransaction = \Modules\Akuntansi\Models\CashFlowTransaction::where('transaction_code', 'LIKE', 'OPN-' . $opname->id . '-%')->first(); if ($cashFlowTransaction) { $hasCashFlow = true; $hasJournal = !empty($cashFlowTransaction->journal_id); } @endphp @endforeach
# No. Referensi Gudang Tanggal Opname Jumlah Item Total Selisih Status Jurnal Aksi
{{$loop->index + 1}} {{ $opname->reference_no }} {{ $opname->warehouse->name }} {{ $opname->opname_date->format('d/m/Y') }} {{ $opname->details->count() }} {{ number_format($totalDifferenceQty, 2) }} unit
Rp {{ number_format($totalDifferenceValue, 0, ',', '.') }}
@if(abs($totalDifferenceValue) < 0.01) Tidak Perlu Jurnal @elseif($hasJournal) Jurnal Dibuat @elseif($hasCashFlow) Cash Flow Dibuat @else Belum Dibuat @endif
@endsection @section('page-script') @vite(['Modules/Stockist/resources/assets/js/stock-opname.js']) @endsection