Update tambah tombol Penyesuaian perubahan AKB Perubahan

This commit is contained in:
Pusdatin BPKD Jkt
2023-11-10 09:53:59 +07:00
parent 7810ed5495
commit 6dfb23e282
7 changed files with 173 additions and 8 deletions
+3 -2
View File
@@ -10,7 +10,8 @@ use Illuminate\Support\Facades\Auth;
class AkbPendapatan extends Eloquent
{
use HasFactory;
protected $connection = 'oracle';
protected $connection = 'Samasa';
protected $table = 'SAMASA.AKB_PENDAPATAN';
protected $guarded = [];
public $timestamps = false;
}
+49
View File
@@ -0,0 +1,49 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
use Illuminate\Support\Facades\DB;
class AkbSpb23 extends Eloquent
{
use HasFactory;
protected $connection = 'mysql';
public function getAkbPendapatan()
{
$sqlstr = "select
D.tahun,
D.unitkerja_id,
D.komisi as unitkerja_komisi,
D.kode_wilayah as unitkerja_wilayah,
D.kode as Unitkerja_Kode,
D.kode_permen as Unitkerja_kodepermen,
D.nama as Unitkerja_nama,
C.rekening_id as rek_id,
C.kode as rek_kode,
C.nama as rek_nama,
B.nilai,
coalesce(A.bulan1, 0) as bulan1,
coalesce(A.bulan2, 0) as bulan2,
coalesce(A.bulan3, 0) as bulan3,
coalesce(A.bulan4, 0) as bulan4,
coalesce(A.bulan5, 0) as bulan5,
coalesce(A.bulan6, 0) as bulan6,
coalesce(A.bulan7, 0) as bulan7,
coalesce(A.bulan8, 0) as bulan8,
coalesce(A.bulan9, 0) as bulan9,
coalesce(A.bulan10, 0) as bulan10,
coalesce(A.bulan11, 0) as bulan11,
coalesce(A.bulan12, 0) as bulan12
from next_pendapatan B
left join next_pendapatan_proyeksi A on A.pendapatan_id = B.pendapatan_id
join hist2_rekening C on B.rekening_id = C.rekening_id and C.tahun = ".getTA()."
join hist_unitkerja D on B.unitkerja_id = D.unitkerja_id and D.tahun = ".getTA()."
ORDER BY C.kode";
return DB::connection("mysql")->select(DB::raw($sqlstr));
}
}