main
Ilham Wara Nugroho 2026-08-14 15:44:18 +07:00
parent 1b496f5794
commit 508f59a7c3
5 changed files with 12 additions and 5 deletions

View File

@ -189,7 +189,12 @@ class FormController implements HasMiddleware
try {
$form = ActivityForm::where('agency_id',$instansi)->first();
$form = ActivityForm::where('sector',$sector)
->where('form_code',$code)
->where('agency_id',$instansi)
->where('inventory_year',$inventoryYear)
->first();
// dd($form);
if(!@$form){
$Saveform = new ActivityForm;

View File

@ -12,7 +12,8 @@ class DashboardService
{
$gwpData = $this->getActiveGwpRecords()->keyBy('ghg_code');
$years = activityYearRange($inventoryYear, false, 10);
// $years = activityYearRange($inventoryYear, false, 10);
$years = activityYearRange($inventoryYear, false, 1);
$crfData = ActivityCrf::with(['ws.form', 'sektor'])
->where('inventory_year', $inventoryYear)

View File

@ -162,7 +162,8 @@ class SigdCrudService
if ($form) {
$query = ActivityFormDetail::where('form_id', $form->id)
->where('activity_year', $activityYear)
// ->where('activity_year', $activityYear)
->where('activity_year', $inventoryYear)
->rowActive();
if ($activityCodes !== null) {

View File

@ -11,13 +11,13 @@
<div class="col-md-4">
<div class="form-group d-flex justify-content-center align-items-center gap-1">
<div class="">
<label for="instansi">Instansi:</label>
<label for="instansi">Instansi: {{ $instansi }}</label>
</div>
<div class="input-group">
<select name="instansi" id="instansi" class="form-control">
<option value="" selected>-- Pilih Instansi --</option>
@if ($scope === \App\Enums\LingkupAksesData::ALL->value)
<option value="none" @if ($instansi === null || $instansi == 'none') selected @endif>DATA
<option value="none" @if ($instansi == 'none') selected @endif>DATA
KONSOLIDASI</option>
@if ($agencies->isNotEmpty())
<option value="all" @if ($instansi === 'all') selected @endif>SELURUH DATA DARI PRODUSEN</option>