Export excel, adjust anggaran

This commit is contained in:
Pusdatin BPKD Jkt
2022-11-17 11:08:28 +07:00
parent 16afa0b405
commit d65cfe6991
10 changed files with 204 additions and 121 deletions
@@ -0,0 +1,48 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Session;
use Illuminate\Support\Facades\DB;
class PengaturanController extends Controller
{
public function __construct(){
$this->siteTitle = "Pengaturan";
parent::__construct();
}
public function index()
{
$this->setIconTitle("fa fa-cog");
return view('admin.pengaturan.index');
}
public function rekonAnggaran()
{
try{
DB::beginTransaction();
DB::raw(
"UPDATE BELANJA_REALISASI t1
SET t1.JUMLAH_ANGGARAN = (
SELECT V_ANGG_TAPD FROM VW_DPA_RSK t2
WHERE t1.KODE_RSK = t2.I_ID
) WHERE t1.TAHUN_ANGGARAN = ".getTA()
);
DB::commit();
return response()->json([
"success" => true,
"message" => "Data anggaran berhasil disesuaikan!"
]);
}catch(Throwable $e){
DB::rollBack();
return response()->json([
"success" => false,
"message" => "Data anggaran gagal disesuaikan!"
]);
}
}
}