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
5 changes: 2 additions & 3 deletions app/Helpers/Cetak.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Cetak
* @param string $filename
* @return string
*/
public static function cetak($jenis, $models, $filename, $template_id,)
public static function cetak($jenis, $models, $filename, $template_id)
{
$index = 0;
$mainXml = '';
Expand All @@ -48,7 +48,7 @@ public static function cetak($jenis, $models, $filename, $template_id,)
* Ambil TemplateProsessor.
*
* @param string $jenis kak|spj|sk|st|dpr|spd|bon
* @param $id
* @param $id
* @return TemplateProcessor
*/
public static function getTemplate(string $jenis, $id, $template_id)
Expand Down Expand Up @@ -180,6 +180,5 @@ public static function validate($jenis, $model_id)
'Perkiraan jumlah penggunaan anggaran tidak sama dengan total nilai barang/jasa'
);
}

}
}
1 change: 0 additions & 1 deletion app/Helpers/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,6 @@ public static function setOptionTemplate($jenis)
return self::setOptions(Template::cache()->get('all')->where('jenis', $jenis), 'id', 'nama');
}


public static function setOptionPengelola($role, $tanggal, $unitKerjaId = null)
{
return self::setOptions(self::getUsersByPengelola($role, $tanggal, $unitKerjaId), 'id', 'name');
Expand Down
2 changes: 1 addition & 1 deletion app/Imports/DaftarHonorImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMultipleSheets;

class DaftarHonorImport implements ToCollection, WithMultipleSheets, WithHeadingRow
class DaftarHonorImport implements ToCollection, WithMultipleSheets, WithHeadingRow
{
protected $id;

Expand Down
2 changes: 1 addition & 1 deletion app/Imports/KodeArsipsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function collection(Collection $rows)
'tata_naskah_id' => $this->tata_naskah_id,
],
[
'detail' => $row['detail'],
'detail' => $row['detail'],
'kode' => $row['kode'],
'group' => $row['group'],
'updated_at' => now(),
Expand Down
26 changes: 13 additions & 13 deletions app/Imports/MataAnggaransImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
use Maatwebsite\Excel\Imports\HeadingRowFormatter;

HeadingRowFormatter::default('none');
class MataAnggaransImport implements ToCollection, WithHeadingRow

class MataAnggaransImport implements ToCollection, WithHeadingRow
{
protected $satker;
protected $wilayah;
Expand All @@ -34,17 +33,18 @@ public function collection(Collection $rows)
$replaces['.'.$this->wilayah] = '';
$anggaran = explode('||', $row['Kode'])[0];
$mak = strtr($anggaran, $replaces);
if ($mak)
KamusAnggaran::updateOrCreate(
[
'mak' => $mak,
'dipa_id' => $this->dipa_id,
],
[
'detail' => $row['Program/ Kegiatan/ KRO/ RO/ Komponen'],
'updated_at' => now(),
]
);
if ($mak) {
KamusAnggaran::updateOrCreate(
[
'mak' => $mak,
'dipa_id' => $this->dipa_id,
],
[
'detail' => $row['Program/ Kegiatan/ KRO/ RO/ Komponen'],
'updated_at' => now(),
]
);
}
if (strlen($mak) == 37) {
MataAnggaran::updateOrCreate(
[
Expand Down
35 changes: 16 additions & 19 deletions app/Imports/MitrasImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class MitrasImport implements ToCollection, WithHeadingRow
{
protected $kepka_mitra_id;


public function __construct($kepka_mitra_id)
{
$this->kepka_mitra_id = $kepka_mitra_id;
Expand All @@ -23,24 +22,22 @@ public function __construct($kepka_mitra_id)
public function collection(Collection $rows)
{
foreach ($rows as $row) {
if ($row['Status Seleksi (1=Terpilih, 2=Tidak Terpilih)'] == 1)
Mitra::updateOrCreate(
[
'nik' => $row['NIK'],
'kepka_mitra_id' => $this->kepka_mitra_id,
],
[

'nama' => $row['Nama'],
'email' => $row['Email'],
'alamat' => $row['Alamat Detail'],
'tanggal_lahir' => Carbon::createFromFormat('d/m/Y',$row['Tanggal Lahir (dd/mm/yyyy)']),
'npwp' => $row['NPWP'],
]
);



if ($row['Status Seleksi (1=Terpilih, 2=Tidak Terpilih)'] == 1) {
Mitra::updateOrCreate(
[
'nik' => $row['NIK'],
'kepka_mitra_id' => $this->kepka_mitra_id,
],
[

'nama' => $row['Nama'],
'email' => $row['Email'],
'alamat' => $row['Alamat Detail'],
'tanggal_lahir' => Carbon::createFromFormat('d/m/Y', $row['Tanggal Lahir (dd/mm/yyyy)']),
'npwp' => $row['NPWP'],
]
);
}
}
}
}
1 change: 0 additions & 1 deletion app/Models/Mitra.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ public static function cacheEntities(): array
}),
];
}

}
2 changes: 0 additions & 2 deletions app/Nova/Actions/ImportMitra.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

namespace App\Nova\Actions;

use App\Helpers\Helper;
use App\Imports\MitrasImport;
use App\Models\Mitra;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Storage;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Fields\ActionFields;
use Laravel\Nova\Fields\File;
Expand Down
2 changes: 1 addition & 1 deletion app/Nova/AnggaranKerangkaAcuan.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function fields(NovaRequest $request)
}),

Currency::make('Perkiraan Digunakan ', 'perkiraan')
->rules('required','gt:1')
->rules('required', 'gt:1')
->min(1)
->step(1),

Expand Down
2 changes: 1 addition & 1 deletion app/Nova/JenisKontrak.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function fields(NovaRequest $request)
Text::make('Jenis Kontrak', 'jenis')
->rules('required'),
Currency::make('Batas maksimal (SBML)', 'sbml')
->rules('required','gt:1')
->rules('required', 'gt:1')
->step(1)
->min(1),
];
Expand Down
3 changes: 1 addition & 2 deletions app/Nova/KerangkaAcuan.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public function utamaFields()

];
}

/**
* Fields Pengadaan Kerangka Acuan.
*
Expand Down Expand Up @@ -283,6 +284,4 @@ public function pengelolaFields()

];
}


}
13 changes: 6 additions & 7 deletions app/Nova/Mitra.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use App\Helpers\Helper;
use App\Helpers\Policy;
use App\Nova\Actions\AddHasManyModel;
use App\Nova\Actions\ImportMitra;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
use Laravel\Nova\Fields\Date;
Expand Down Expand Up @@ -120,18 +119,18 @@ public function actions(NovaRequest $request)
{
$actions = [];
if (Policy::make()->allowedFor('admin')->get()) {
$actions [] =
$actions [] =
AddHasManyModel::make('Mitra', 'KepkaMitra', $request->viaResourceId)
->confirmButtonText('Tambah')
->size('7xl')
->standalone()
->addFields($this->fields($request));
->confirmButtonText('Tambah')
->size('7xl')
->standalone()
->addFields($this->fields($request));
}

return $actions;
}

/**
/**
* Return the location to redirect the user after update.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
Expand Down
4 changes: 2 additions & 2 deletions app/Nova/SpesifikasiKerangkaAcuan.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function fields(NovaRequest $request)
Text::make('Rincian')
->rules('required'),
Number::make('Volume')
->rules('required','gt:0')->min(0),
->rules('required', 'gt:0')->min(0),
Text::make('Satuan')
->rules('required'),
Currency::make('Harga Satuan')
Expand All @@ -64,7 +64,7 @@ public function fields(NovaRequest $request)
->step(1),
Currency::make('Total', 'total_harga')
->dependsOn(['volume', 'harga_satuan'], function (Currency $field, NovaRequest $request, FormData $formData) {
return $field->default((float) $formData->harga_satuan * (float)$formData->volume);
return $field->default((float) $formData->harga_satuan * (float) $formData->volume);
})
->min(1)
->onlyOnIndex(),
Expand Down
1 change: 0 additions & 1 deletion app/Policies/KepkaMitraPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,4 @@ public function addMitra(): bool
->allowedFor('admin')
->get();
}

}
6 changes: 3 additions & 3 deletions database/migrations/2024_08_14_143646_create_mitras_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public function up(): void
$table->string('nik');
$table->string('nama');
$table->string('alamat')->nullable();
$table->string('rekening',80)->nullable();
$table->string('npwp',40)->nullable();
$table->string('email',80)->nullable();
$table->string('rekening', 80)->nullable();
$table->string('npwp', 40)->nullable();
$table->string('email', 80)->nullable();
$table->date('tanggal_lahir')->nullable();
$table->bigInteger('kepka_mitra_id')->nullable()->unsigned();
$table->timestamps();
Expand Down