Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions app/Helpers/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ public static function terbilangHari($tanggal)
/**
* Mengubah bulan ke nama bulan.
*
* @param Int $bulan
* @param int $bulan
* @return string
*/
public static function terbilangBulan($bulan)
Expand All @@ -655,7 +655,7 @@ public static function formatRupiah($angka)
}

/**
* Upper case nama tanpa gelar
* Upper case nama tanpa gelar.
*
* @param string $nama
* @return string
Expand All @@ -667,7 +667,6 @@ public static function upperNamaTanpaGelar($nama)
return strtoupper($hasil);
}


/**
* Mengubah angka ke format uang.
*
Expand All @@ -690,7 +689,7 @@ public static function formatUang($angka)
*/
public static function jangkaWaktuHariKalender($awal, $akhir)
{
$selisih = ($awal->diff($akhir))->format('%a') + 1;
$selisih = $awal->diff($akhir)->format('%a') + 1;

return $selisih.' ( '.self::terbilang($selisih).') Hari Kalender';
}
Expand All @@ -707,12 +706,16 @@ public static function formatSpek($spesifikasi)
$spek = collect($spesifikasi);
$spek->transform(function ($item, $index) {
$item['spek_no'] = $index + 1;
if (isset($item['spek_harga'])) $item['spek_harga'] = self::formatRupiah($item['spek_harga']);
if (isset($item['spek_nilai'])) $item['spek_nilai'] = self::formatRupiah($item['spek_nilai']);
if (isset($item['spek_harga'])) {
$item['spek_harga'] = self::formatRupiah($item['spek_harga']);
}
if (isset($item['spek_nilai'])) {
$item['spek_nilai'] = self::formatRupiah($item['spek_nilai']);
}

return $item;
})->toArray();

return $spek;
}


}
2 changes: 1 addition & 1 deletion app/Models/NaskahKeluar.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected static function booted(): void
$naskah->tahun = Carbon::createFromFormat('Y-m-d', $naskah->tanggal->format('Y-m-d'))->year;
}
});
static::creating(function (NaskahKeluar $naskah) {
static::creating(function (NaskahKeluar $naskah) {
$naskah->unit_kerja_id = Auth::user()->unit_kerja_id;
});
}
Expand Down
1 change: 0 additions & 1 deletion app/Nova/NaskahKeluar.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use App\Helpers\Helper;
use App\Models\JenisNaskah;
use App\Models\KodeArsip;
use Carbon\Carbon;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Fields\File;
use Laravel\Nova\Fields\FormData;
Expand Down
1 change: 0 additions & 1 deletion app/Nova/NaskahMasuk.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Helpers\Helper;
use App\Models\JenisNaskah;
use Carbon\Carbon;
use Illuminate\Support\Facades\Storage;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Fields\File;
Expand Down