Skip to content

Commit 5dd3727

Browse files
committed
2 parents b3176af + eaa5ef5 commit 5dd3727

File tree

9 files changed

+40
-25
lines changed

9 files changed

+40
-25
lines changed

app/Helpers/Cetak.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function getTemplate($jenis, $id)
5858
unset($data['anggaran'], $data['spesifikasi']);
5959
}
6060
if ($jenis === 'spj') {
61-
$templateProcessor->cloneRowAndSetValues('spj_no', Helper::formatSpj(DaftarHonor::where('honor_survei_id', $id)->get(['nama As spj_nama', 'satuan AS spj_satuan','jumlah AS spj_jumlah', 'bruto AS spj_bruto', 'pajak AS spj_pajak','netto AS spj_netto','rekening AS spj_rekening'])));
61+
$templateProcessor->cloneRowAndSetValues('spj_no', Helper::formatSpj(DaftarHonor::where('honor_survei_id', $id)->get(['nama As spj_nama', 'satuan AS spj_satuan', 'jumlah AS spj_jumlah', 'bruto AS spj_bruto', 'pajak AS spj_pajak', 'netto AS spj_netto', 'rekening AS spj_rekening'])));
6262
}
6363
$templateProcessor->setValues($data);
6464

@@ -92,7 +92,7 @@ public static function getModifiedInnerXml($templateProcessor)
9292
}
9393

9494
/**
95-
* Format nilai KAK
95+
* Format nilai KAK.
9696
*
9797
* @param string $id
9898
* @return array
@@ -130,7 +130,7 @@ public static function kak($id)
130130
}
131131

132132
/**
133-
* Format nilai SPJ
133+
* Format nilai SPJ.
134134
*
135135
* @param string $id
136136
* @return array
@@ -145,12 +145,12 @@ public static function spj($id)
145145
'detail' => $data->detail,
146146
'bulan' => Helper::terbilangBulan($data->bulan),
147147
'mak' => $data->mak,
148-
'kegiatan' => Helper::getDetailAnggaran($data->mak ,'kegiatan'),
149-
'kro' => Helper::getDetailAnggaran($data->mak ,'kro'),
150-
'ro' => Helper::getDetailAnggaran($data->mak ,'ro'),
151-
'komponen' => Helper::getDetailAnggaran($data->mak ,'komponen'),
152-
'sub' => Helper::getDetailAnggaran($data->mak ,'sub'),
153-
'akun' => Helper::getDetailAnggaran($data->mak ,'akun'),
148+
'kegiatan' => Helper::getDetailAnggaran($data->mak, 'kegiatan'),
149+
'kro' => Helper::getDetailAnggaran($data->mak, 'kro'),
150+
'ro' => Helper::getDetailAnggaran($data->mak, 'ro'),
151+
'komponen' => Helper::getDetailAnggaran($data->mak, 'komponen'),
152+
'sub' => Helper::getDetailAnggaran($data->mak, 'sub'),
153+
'akun' => Helper::getDetailAnggaran($data->mak, 'akun'),
154154
'satuan' => $data->satuan,
155155
'total_bruto' => Helper::formatUang(DaftarHonor::where('honor_survei_id', $id)->sum('bruto')),
156156
'total_pajak' => Helper::formatUang(DaftarHonor::where('honor_survei_id', $id)->sum('pajak')),

app/Helpers/Helper.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -753,17 +753,26 @@ public static function formatAnggaran($anggaran)
753753
*/
754754
public static function formatSpj($spesifikasi)
755755
{
756-
$spek= json_decode($spesifikasi,true);
756+
$spek = json_decode($spesifikasi, true);
757757
$speks = collect($spek);
758758
$speks->transform(function ($item, $index) {
759759
$item['spj_no'] = $index + 1;
760-
if (isset($item['spj_satuan'])) $item['spj_satuan'] = self::formatUang($item['spj_satuan']);
761-
if (isset($item['spj_bruto'])) $item['spj_bruto'] = self::formatUang($item['spj_bruto']);
762-
if (isset($item['spj_pajak'])) $item['spj_pajak'] = self::formatUang($item['spj_pajak']);
763-
if (isset($item['spj_netto'])) $item['spj_netto'] = self::formatUang($item['spj_netto']);
760+
if (isset($item['spj_satuan'])) {
761+
$item['spj_satuan'] = self::formatUang($item['spj_satuan']);
762+
}
763+
if (isset($item['spj_bruto'])) {
764+
$item['spj_bruto'] = self::formatUang($item['spj_bruto']);
765+
}
766+
if (isset($item['spj_pajak'])) {
767+
$item['spj_pajak'] = self::formatUang($item['spj_pajak']);
768+
}
769+
if (isset($item['spj_netto'])) {
770+
$item['spj_netto'] = self::formatUang($item['spj_netto']);
771+
}
764772

765773
return $item;
766774
})->toArray();
775+
767776
return $speks;
768777
}
769778

app/Helpers/Policy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function orEqual($expr1, $expr2, $strict = true)
7070

7171
public function orNotEqual($expr1, $expr2, $strict = true)
7272
{
73-
$this->allowed = $this->allowed ?? false || $strict ? $expr1 !== $expr2 : $expr1 != $expr2;
73+
$this->allowed = $this->allowed ?? false || $strict ? $expr1 !== $expr2 : $expr1 != $expr2;
7474

7575
return $this;
7676
}

app/Nova/DaftarHonor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,10 @@ public function actions(NovaRequest $request)
115115
{
116116
$actions = [];
117117
if (Policy::make()->allowedFor('koordinator')->get()) {
118-
$actions []=
118+
$actions [] =
119119
EditRekening::make()->standalone();
120120
}
121+
121122
return $actions;
122123
}
123124

app/Nova/HonorSurvei.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,17 +262,18 @@ public function actions(NovaRequest $request)
262262
{
263263
$actions = [];
264264
if (Policy::make()->allowedFor('koordinator')->get()) {
265-
$actions[]=
265+
$actions[] =
266266
ImportDaftarHonor::make()->onlyOnDetail()->confirmButtonText('Import')
267267
->canSee(function ($request) {
268268
if ($request instanceof ActionRequest) {
269269
return true;
270270
}
271+
271272
return $this->resource instanceof Model && $this->resource->bulan !== null;
272273
});
273-
}
274+
}
274275
if (Policy::make()->allowedFor('koordinator,ppk,bendahara,ppspm')->get()) {
275-
$actions[]=
276+
$actions[] =
276277
Download::make('spj', 'Unduh SPJ')
277278
->showInline()
278279
->showOnDetail()
@@ -282,11 +283,11 @@ public function actions(NovaRequest $request)
282283
if ($request instanceof ActionRequest) {
283284
return true;
284285
}
286+
285287
return $this->resource instanceof Model && $this->resource->bulan !== null;
286288
});
287-
}
289+
}
288290

289291
return $actions;
290-
291292
}
292293
}

app/Nova/KerangkaAcuan.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,14 @@ public function actions(NovaRequest $request)
135135
{
136136
$actions = [];
137137
if (Policy::make()->allowedFor('all')->get()) {
138-
$actions[]=
138+
$actions[] =
139139
Download::make('kak', 'Unduh KAK')
140140
->showInline()
141141
->showOnDetail()
142142
->confirmButtonText('Unduh')
143143
->exceptOnIndex();
144144
}
145+
145146
return $actions;
146147
}
147148

app/Nova/KodeArsip.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,10 @@ public function actions(NovaRequest $request)
104104
{
105105
$actions = [];
106106
if (Policy::make()->allowedFor('admin')->get()) {
107-
$actions []=
107+
$actions [] =
108108
ImportKodeArsip::make()->standalone();
109109
}
110+
110111
return $actions;
111112
}
112113
}

app/Nova/MataAnggaran.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,10 @@ public function actions(NovaRequest $request)
9999
{
100100
$actions = [];
101101
if (Policy::make()->allowedFor('admin')->get()) {
102-
$actions []=
102+
$actions [] =
103103
ImportMataAnggaran::make()->standalone();
104104
}
105+
105106
return $actions;
106107
}
107108
}

app/Nova/Mitra.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ public function actions(NovaRequest $request)
106106
{
107107
$actions = [];
108108
if (Policy::make()->allowedFor('admin')->get()) {
109-
$actions []=
109+
$actions [] =
110110
ImportMitra::make()->standalone();
111111
}
112+
112113
return $actions;
113114
}
114115
}

0 commit comments

Comments
 (0)