From ca499f9111581a3eb5f02dc12c80b4407b2bc497 Mon Sep 17 00:00:00 2001 From: ajikamaludin Date: Wed, 5 Apr 2023 06:18:51 +0700 Subject: [PATCH] bit fix --- app/Http/Controllers/DocumentController.php | 4 ++-- resources/js/Pages/Document/Detail.jsx | 24 +++++++++++---------- resources/views/exports/documents.blade.php | 4 ++++ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/app/Http/Controllers/DocumentController.php b/app/Http/Controllers/DocumentController.php index 67b31eb..f724b8f 100644 --- a/app/Http/Controllers/DocumentController.php +++ b/app/Http/Controllers/DocumentController.php @@ -243,9 +243,9 @@ class DocumentController extends Controller 'penerbit' => $document->publisher, 'tipe' => $document->type == Document::TYPE_TETAP ? 'Tetap' : 'Tidak Tetap', 'tanggal terbit' => $document->publish_date->format('d-m-Y'), - 'tanggal jatuh tempo' => $document->due_date->format('d-m-Y'), + 'tanggal jatuh tempo' => $document->due_date?->format('d-m-Y'), 'keterangan' => $document->description, - 'file' => asset('documents/'.$document->document), + 'file' => $document->document != null ? asset('documents/'.$document->document) : null, 'status' => $document->status == Document::STATUS_YES ? 'Ya' : 'Tidak', 'catatan' => $document->due_status, ]); diff --git a/resources/js/Pages/Document/Detail.jsx b/resources/js/Pages/Document/Detail.jsx index 345cbe8..f4a6447 100644 --- a/resources/js/Pages/Document/Detail.jsx +++ b/resources/js/Pages/Document/Detail.jsx @@ -140,17 +140,19 @@ export default function FormDocument(props) { readOnly={true} /> -
- - -
+ {doc.due_date !== null && ( +
+ + +
+ )}
{{ $collec["tanggal jatuh tempo"] }} {{ $collec["keterangan"] }} + @if($collec["file"] != null) Download + @else + Belum ada file + @endif {{ $collec["status"] }} {{ $collec["catatan"] }}