Export excel, adjust anggaran
This commit is contained in:
@@ -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!"
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user