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
13 changes: 6 additions & 7 deletions app/Helpers/Cetak.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Support\Facades\Storage;
use PhpOffice\PhpWord\TemplateProcessor;


class Cetak
{
/**
Expand All @@ -20,9 +19,10 @@ public static function cetak($jenis, $id)
{
$templateProcessor = new TemplateProcessor(Storage::path('template/Template_permintaan.docx'));
$templateProcessor->setValues(call_user_func('App\Helpers\Cetak::'.$jenis, $id));
if ($jenis === 'kak') $templateProcessor->cloneRowAndSetValues('spek_no', Helper::formatSpek($data->spesifikasi));
if ($jenis === 'kak') {
$templateProcessor->cloneRowAndSetValues('spek_no', Helper::formatSpek($data->spesifikasi));
}
$templateProcessor->saveAs(Storage::path('public/permintaan/KAK'.explode('/', $no)[0].'.docx'));

}

/**
Expand All @@ -34,8 +34,8 @@ public static function cetak($jenis, $id)
public static function kak($id)
{
$data = KerangkaAcuan::find($id);
return [

return [
'nomor' => $data->nomor,
'tanggal' => Helper::terbilangTanggal($data->tanggal),
'rincian' => $data->rincian,
Expand All @@ -61,7 +61,6 @@ public static function kak($id)
'nipppk' => $data->nipppk,
'terbilang_pagu' => Helper::terbilang((int) $data->jumlah, 'uw', ' rupiah'),
'terbilang_perkiraan' => Helper::terbilang((int) $data->perkiraan, 'uw', ' rupiah'),
];
];
}

}
3 changes: 2 additions & 1 deletion app/Helpers/Inspiring.php
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,8 @@ public static function show()
{
$data['topic'] = Arr::random(array_keys(static::$quotes));
$data = array_merge($data, Arr::random(static::$quotes[$data['topic']]['quotes']));
return

return
Cache::remember('quotes', Carbon::now()->endOfDay(), function () use ($data) {
return $data['quote'].' ('.$data['author'].')';
});
Expand Down
2 changes: 1 addition & 1 deletion app/Nova/Dipa.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function label()
* @var array
*/
public static $search = [
'nomor','tahun'
'nomor', 'tahun',
];

/**
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/2024_09_02_201858_create_dipas_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public function up(): void
{
Schema::create('dipas', function (Blueprint $table) {
$table->id();
$table->string('tahun',4)->unique()->nullable();
$table->string('nomor',40)->nullable();
$table->string('tahun', 4)->unique()->nullable();
$table->string('nomor', 40)->nullable();
$table->date('tanggal')->nullable();
$table->timestamps();
});
Expand Down