diff --git a/.npm/_logs/2025-08-19T16_34_13_318Z-debug-0.log b/.npm/_logs/2025-08-19T16_34_13_318Z-debug-0.log new file mode 100644 index 0000000..95fb1b3 --- /dev/null +++ b/.npm/_logs/2025-08-19T16_34_13_318Z-debug-0.log @@ -0,0 +1,17 @@ +0 verbose cli /usr/bin/node /usr/bin/npm +1 info using npm@10.8.2 +2 info using node@v18.20.8 +3 silly config load:file:/usr/lib/node_modules/npm/npmrc +4 silly config load:file:/var/www/.npmrc +5 silly config load:file:/usr/etc/npmrc +6 verbose title npm run build +7 verbose argv "run" "build" +8 verbose logfile logs-max:10 dir:/var/www/.npm/_logs/2025-08-19T16_34_13_318Z- +9 verbose logfile /var/www/.npm/_logs/2025-08-19T16_34_13_318Z-debug-0.log +10 silly logfile done cleaning log files +11 verbose cwd /var/www +12 verbose os Linux 6.6.87.2-microsoft-standard-WSL2 +13 verbose node v18.20.8 +14 verbose npm v10.8.2 +15 verbose exit 0 +16 info ok diff --git a/.npm/_logs/2025-08-19T16_41_22_490Z-debug-0.log b/.npm/_logs/2025-08-19T16_41_22_490Z-debug-0.log new file mode 100644 index 0000000..022d13f --- /dev/null +++ b/.npm/_logs/2025-08-19T16_41_22_490Z-debug-0.log @@ -0,0 +1,17 @@ +0 verbose cli /usr/bin/node /usr/bin/npm +1 info using npm@10.8.2 +2 info using node@v18.20.8 +3 silly config load:file:/usr/lib/node_modules/npm/npmrc +4 silly config load:file:/var/www/.npmrc +5 silly config load:file:/usr/etc/npmrc +6 verbose title npm run build +7 verbose argv "run" "build" +8 verbose logfile logs-max:10 dir:/var/www/.npm/_logs/2025-08-19T16_41_22_490Z- +9 verbose logfile /var/www/.npm/_logs/2025-08-19T16_41_22_490Z-debug-0.log +10 silly logfile done cleaning log files +11 verbose cwd /var/www +12 verbose os Linux 6.6.87.2-microsoft-standard-WSL2 +13 verbose node v18.20.8 +14 verbose npm v10.8.2 +15 verbose exit 0 +16 info ok diff --git a/app/Http/Controllers/Api/LackOfPotentialController.php b/app/Http/Controllers/Api/LackOfPotentialController.php index fa49b4f..663a476 100644 --- a/app/Http/Controllers/Api/LackOfPotentialController.php +++ b/app/Http/Controllers/Api/LackOfPotentialController.php @@ -8,6 +8,7 @@ use App\Models\Customer; use App\Models\SpatialPlanning; use Illuminate\Http\Request; use App\Models\TourismBasedKBLI; +use App\Models\Tax; class LackOfPotentialController extends Controller { @@ -20,6 +21,11 @@ class LackOfPotentialController extends Controller $total_tata_ruang_usaha = SpatialPlanning::where('building_function','like', '%usaha%')->count(); $total_tata_ruang_non_usaha = SpatialPlanning::where('building_function','not like', '%usaha%')->count(); $data_report_tourism = TourismBasedKBLI::all(); + $data_pajak_reklame = Tax::where('tax_code','Reklame')->count(); + $data_pajak_restoran = Tax::where('tax_code','Restoran')->count(); + $data_pajak_hiburan = Tax::where('tax_code','Hiburan')->count(); + $data_pajak_hotel = Tax::where('tax_code','Hotel')->count(); + $data_pajak_parkir = Tax::where('tax_code','Parkir')->count(); return response()->json([ 'total_reklame' => $total_reklame, @@ -28,6 +34,11 @@ class LackOfPotentialController extends Controller 'total_tata_ruang_usaha' => $total_tata_ruang_usaha, 'total_tata_ruang_non_usaha' => $total_tata_ruang_non_usaha, 'data_report' => $data_report_tourism, + 'data_pajak_reklame' => $data_pajak_reklame, + 'data_pajak_restoran' => $data_pajak_restoran, + 'data_pajak_hiburan' => $data_pajak_hiburan, + 'data_pajak_hotel' => $data_pajak_hotel, + 'data_pajak_parkir' => $data_pajak_parkir, ], 200); }catch(\Exception $e){ return response()->json([ diff --git a/app/Http/Controllers/Api/RequestAssignmentController.php b/app/Http/Controllers/Api/RequestAssignmentController.php index 1456430..7a774a0 100644 --- a/app/Http/Controllers/Api/RequestAssignmentController.php +++ b/app/Http/Controllers/Api/RequestAssignmentController.php @@ -126,10 +126,10 @@ class RequestAssignmentController extends Controller ->whereIn("status", PbgTaskStatus::getNonVerified()) // Additional condition: unit IS NULL OR unit <= 1 ->where(function ($q3) { - $q3->whereDoesntHave('pbg_task_detail', function ($q4) { + $q3->whereDoesntHave('pbg_task_details', function ($q4) { $q4->where('unit', '>', 1); }) - ->orWhereDoesntHave('pbg_task_detail'); + ->orWhereDoesntHave('pbg_task_details'); }); }); break; @@ -152,7 +152,7 @@ class RequestAssignmentController extends Controller }) ->orWhereNull('function_type'); }) - ->whereHas('pbg_task_detail', function ($q4) { + ->whereHas('pbg_task_details', function ($q4) { $q4->where('unit', '>', 1); }); }); @@ -204,10 +204,10 @@ class RequestAssignmentController extends Controller ->whereIn("status", PbgTaskStatus::getNonVerified()) // Additional condition: unit IS NULL OR unit <= 1 ->where(function ($q3) { - $q3->whereDoesntHave('pbg_task_detail', function ($q4) { + $q3->whereDoesntHave('pbg_task_details', function ($q4) { $q4->where('unit', '>', 1); }) - ->orWhereDoesntHave('pbg_task_detail'); + ->orWhereDoesntHave('pbg_task_details'); }); }) ->whereExists(function ($query) { @@ -232,10 +232,10 @@ class RequestAssignmentController extends Controller ->whereIn("status", PbgTaskStatus::getNonVerified()) // Additional condition: unit IS NULL OR unit <= 1 ->where(function ($q3) { - $q3->whereDoesntHave('pbg_task_detail', function ($q4) { + $q3->whereDoesntHave('pbg_task_details', function ($q4) { $q4->where('unit', '>', 1); }) - ->orWhereDoesntHave('pbg_task_detail'); + ->orWhereDoesntHave('pbg_task_details'); }); }) ->whereExists(function ($query) { @@ -265,7 +265,7 @@ class RequestAssignmentController extends Controller }) ->orWhereNull('function_type'); }) - ->whereHas('pbg_task_detail', function ($q4) { + ->whereHas('pbg_task_details', function ($q4) { $q4->where('unit', '>', 1); }); }); @@ -299,7 +299,7 @@ class RequestAssignmentController extends Controller }) ->orWhereNull('function_type'); }) - ->whereHas('pbg_task_detail', function ($q4) { + ->whereHas('pbg_task_details', function ($q4) { $q4->where('unit', '>', 1); }); }); @@ -333,7 +333,7 @@ class RequestAssignmentController extends Controller }) ->orWhereNull('function_type'); }) - ->whereHas('pbg_task_detail', function ($q4) { + ->whereHas('pbg_task_details', function ($q4) { $q4->where('unit', '>', 1); }); }); @@ -370,7 +370,7 @@ class RequestAssignmentController extends Controller }); // If search term exists, also find UUIDs from name_building search - $namesBuildingUuids = DB::table('pbg_task_detail') + $namesBuildingUuids = DB::table('pbg_task_details') ->where('name_building', 'LIKE', "%$search%") ->pluck('pbg_task_uid') ->toArray(); @@ -528,7 +528,7 @@ class RequestAssignmentController extends Controller }) ->orWhereNull('function_type'); }) - ->whereHas('pbg_task_detail', function ($q4) { + ->whereHas('pbg_task_details', function ($q4) { $q4->where('unit', '>', 1); }); }); @@ -552,10 +552,10 @@ class RequestAssignmentController extends Controller ->whereIn("status", PbgTaskStatus::getNonVerified()) // Additional condition: unit IS NULL OR unit <= 1 ->where(function ($q3) { - $q3->whereDoesntHave('pbg_task_detail', function ($q4) { + $q3->whereDoesntHave('pbg_task_details', function ($q4) { $q4->where('unit', '>', 1); }) - ->orWhereDoesntHave('pbg_task_detail'); + ->orWhereDoesntHave('pbg_task_details'); }); }) ->where('is_valid', true) diff --git a/resources/js/dashboards/potentials/inside_system.js b/resources/js/dashboards/potentials/inside_system.js index 887e2c3..dda3276 100644 --- a/resources/js/dashboards/potentials/inside_system.js +++ b/resources/js/dashboards/potentials/inside_system.js @@ -4,42 +4,89 @@ import InitDatePicker from "../../utils/InitDatePicker.js"; class DashboardPotentialInsideSystem { async init() { - new InitDatePicker( - "#datepicker-lack-of-potential", - this.handleChangedDate.bind(this) - ).init(); - this.bigTotalLackPotential = 0; - this.totalPotensi = await this.getDataTotalPotensi("latest"); - this.totalTargetPAD = await this.getDataSettings("TARGET_PAD"); - this.allCountData = await this.getValueDashboard(); - this.reklameCount = this.allCountData.total_reklame ?? 0; - this.pdamCount = this.allCountData.total_pdam ?? 0; - this.tataRuangCount = this.allCountData.total_tata_ruang ?? 0; - this.tataRuangUsahaCount = - this.allCountData.total_tata_ruang_usaha ?? 0; - this.tataRuangNonUsahaCount = - this.allCountData.total_tata_ruang_non_usaha ?? 0; + try { + // Initialize date picker + new InitDatePicker( + "#datepicker-lack-of-potential", + this.handleChangedDate.bind(this) + ).init(); - let dataReportTourism = this.allCountData.data_report; + // Initialize default values + this.bigTotalLackPotential = 0; - this.totalVilla = dataReportTourism - .filter((item) => item.kbli_title.toLowerCase() === "vila") - .reduce((sum, item) => sum + item.total_records, 0); - this.totalRestoran = dataReportTourism - .filter((item) => item.kbli_title.toLowerCase() === "restoran") - .reduce((sum, item) => sum + item.total_records, 0); - this.totalPariwisata = dataReportTourism.reduce( - (sum, item) => sum + item.total_records, - 0 - ); + // Fetch data with error handling + this.totalPotensi = (await this.getDataTotalPotensi("latest")) || { + total: 0, + }; + this.totalTargetPAD = + (await this.getDataSettings("TARGET_PAD")) || 0; + this.allCountData = (await this.getValueDashboard()) || {}; - this.bigTargetPAD = new Big(this.totalTargetPAD ?? 0); - this.bigTotalPotensi = new Big(this.totalPotensi.total ?? 0); - this.bigTotalLackPotential = this.bigTargetPAD.minus( - this.bigTotalPotensi - ); - this.initChartKekuranganPotensi(); - this.initDataValueDashboard(); + // Set counts with safe fallbacks + this.pdamCount = this.allCountData.total_pdam ?? 0; + this.tataRuangCount = this.allCountData.total_tata_ruang ?? 0; + this.pajakReklameCount = this.allCountData.data_pajak_reklame ?? 0; + this.surveyLapanganCount = this.allCountData.total_reklame ?? 0; + this.reklameCount = + this.pajakReklameCount + this.surveyLapanganCount; + this.pajakRestoranCount = + this.allCountData.data_pajak_restoran ?? 0; + this.pajakHiburanCount = this.allCountData.data_pajak_hiburan ?? 0; + this.pajakHotelCount = this.allCountData.data_pajak_hotel ?? 0; + this.pajakParkirCount = this.allCountData.data_pajak_parkir ?? 0; + this.tataRuangUsahaCount = + this.allCountData.total_tata_ruang_usaha ?? 0; + this.tataRuangNonUsahaCount = + this.allCountData.total_tata_ruang_non_usaha ?? 0; + + // Handle tourism data safely + let dataReportTourism = this.allCountData.data_report || []; + + this.totalVilla = dataReportTourism + .filter( + (item) => + item.kbli_title && + item.kbli_title.toLowerCase() === "vila" + ) + .reduce((sum, item) => sum + (item.total_records || 0), 0); + this.totalRestoran = dataReportTourism + .filter( + (item) => + item.kbli_title && + item.kbli_title.toLowerCase() === "restoran" + ) + .reduce((sum, item) => sum + (item.total_records || 0), 0); + this.totalPariwisata = dataReportTourism.reduce( + (sum, item) => sum + (item.total_records || 0), + 0 + ); + + // Calculate big numbers + this.bigTargetPAD = new Big(this.totalTargetPAD ?? 0); + this.bigTotalPotensi = new Big(this.totalPotensi.total ?? 0); + this.bigTotalLackPotential = this.bigTargetPAD.minus( + this.bigTotalPotensi + ); + + // Initialize charts and data + this.initChartKekuranganPotensi(); + this.initDataValueDashboard(); + } catch (error) { + console.error("Error initializing dashboard:", error); + // Set safe fallback values + this.reklameCount = 0; + this.pdamCount = 0; + this.tataRuangCount = 0; + this.tataRuangUsahaCount = 0; + this.tataRuangNonUsahaCount = 0; + this.totalVilla = 0; + this.totalRestoran = 0; + this.totalPariwisata = 0; + this.bigTotalLackPotential = new Big(0); + + // Still try to initialize the dashboard with safe values + this.initDataValueDashboard(); + } } async handleChangedDate(filterDate) { const totalPotensi = await this.getDataTotalPotensi(filterDate); @@ -53,7 +100,7 @@ class DashboardPotentialInsideSystem { async getDataTotalPotensi(filterDate) { try { const response = await fetch( - `${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterDate}&type=leader`, + `${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterDate}&type=simbg`, { credentials: "include", headers: { @@ -134,40 +181,71 @@ class DashboardPotentialInsideSystem { } } initChartKekuranganPotensi() { - document - .querySelectorAll(".document-count.chart-lack-of-potential") - .forEach((element) => { + // Helper function to safely update elements with class selector + const safeUpdateElements = (selector, callback) => { + try { + const elements = document.querySelectorAll(selector); + if (elements.length > 0) { + elements.forEach(callback); + } else { + console.warn( + `No elements found with selector '${selector}'` + ); + } + } catch (error) { + console.error( + `Error updating elements with selector '${selector}':`, + error + ); + } + }; + + safeUpdateElements( + ".document-count.chart-lack-of-potential", + (element) => { element.innerText = ``; - }); - document - .querySelectorAll(".document-total.chart-lack-of-potential") - .forEach((element) => { + } + ); + + safeUpdateElements( + ".document-total.chart-lack-of-potential", + (element) => { element.innerText = `Rp.${addThousandSeparators( this.bigTotalLackPotential.toString() )}`; - }); - document - .querySelectorAll(".small-percentage.chart-lack-of-potential") - .forEach((element) => { + } + ); + + safeUpdateElements( + ".small-percentage.chart-lack-of-potential", + (element) => { element.innerText = ``; - }); + } + ); } initDataValueDashboard() { - document.getElementById("reklame-count").innerText = this.reklameCount; - document.getElementById("pdam-count").innerText = this.pdamCount; - document.getElementById("pbb-bangunan-count").innerText = - this.tataRuangCount; - document.getElementById("tata-ruang-count").innerText = - this.tataRuangCount; - document.getElementById("tata-ruang-usaha-count").innerText = - this.tataRuangUsahaCount; - document.getElementById("tata-ruang-non-usaha-count").innerText = - this.tataRuangNonUsahaCount; - document.getElementById("restoran-count").innerText = - this.totalRestoran; - document.getElementById("villa-count").innerText = this.totalVilla; - document.getElementById("pariwisata-count").innerText = - this.totalPariwisata; + // Helper function to safely set element text + const safeSetText = (elementId, value) => { + const element = document.getElementById(elementId); + if (element) { + element.innerText = value; + } else { + console.warn(`Element with id '${elementId}' not found`); + } + }; + + safeSetText("reklame-count", this.reklameCount); + safeSetText("survey-lapangan-count", this.surveyLapanganCount); + safeSetText("pajak-reklame-count", this.pajakReklameCount); + safeSetText("restoran-count", this.pajakRestoranCount); + safeSetText("hiburan-count", this.pajakHiburanCount); + safeSetText("hotel-count", this.pajakHotelCount); + safeSetText("parkir-count", this.pajakParkirCount); + safeSetText("pdam-count", this.pdamCount); + safeSetText("tata-ruang-count", this.tataRuangCount); + safeSetText("tata-ruang-usaha-count", this.tataRuangUsahaCount); + safeSetText("tata-ruang-non-usaha-count", this.tataRuangNonUsahaCount); + safeSetText("pariwisata-count", this.totalPariwisata); } } document.addEventListener("DOMContentLoaded", async function (e) { @@ -187,6 +265,12 @@ function resizeDashboard() { "lack-of-potential-fixed-container" ); + // Check if required elements exist + if (!targetElement || !dashboardElement) { + console.warn("Required elements for dashboard resize not found"); + return; + } + let targetWidth = targetElement.offsetWidth; let dashboardWidth = 1400; @@ -200,7 +284,9 @@ function resizeDashboard() { dashboardElement.style.transform = `scale(${scaleFactor})`; // Ensure horizontal scrolling is allowed if necessary - document.body.style.overflowX = "auto"; + if (document.body) { + document.body.style.overflowX = "auto"; + } } window.addEventListener("load", resizeDashboard); diff --git a/resources/js/dashboards/potentials/outside_system.js b/resources/js/dashboards/potentials/outside_system.js index d4257c1..7d585cf 100644 --- a/resources/js/dashboards/potentials/outside_system.js +++ b/resources/js/dashboards/potentials/outside_system.js @@ -21,7 +21,7 @@ class DashboardPotentialOutsideSystem { async getBigDataResume(filterDate) { try { const response = await fetch( - `${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterDate}&type=leader`, + `${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterDate}&type=simbg`, { credentials: "include", headers: { diff --git a/resources/scss/components/_custom_circle.scss b/resources/scss/components/_custom_circle.scss index 8a8502e..5821a0a 100644 --- a/resources/scss/components/_custom_circle.scss +++ b/resources/scss/components/_custom_circle.scss @@ -19,6 +19,16 @@ height: 150px; } + &.very-large { + width: 250px; + height: 250px; + } + + &.medium { + width: 200px; + height: 200px; + } + &.small { width: 95px; height: 95px; diff --git a/resources/views/dashboards/bigdata.blade.php b/resources/views/dashboards/bigdata.blade.php index 62ee6c2..a6c8ed2 100644 --- a/resources/views/dashboards/bigdata.blade.php +++ b/resources/views/dashboards/bigdata.blade.php @@ -91,14 +91,14 @@
-
- @@ -114,21 +114,21 @@
-
-
- @@ -204,7 +204,7 @@ @component('components.circle',[ 'document_title' => 'Pembayaran Realisasi PBG', - 'document_color' => '#8cc540', + 'document_color' => '#0a0099', 'document_type' => 'Berkas', 'document_id' => 'chart-payment-pbg-task', 'visible_small_circle' => false, diff --git a/resources/views/dashboards/potentials/inside_system.blade.php b/resources/views/dashboards/potentials/inside_system.blade.php index 841d962..cae5dd5 100644 --- a/resources/views/dashboards/potentials/inside_system.blade.php +++ b/resources/views/dashboards/potentials/inside_system.blade.php @@ -19,123 +19,185 @@
-
-
- + @component('components.circle', [ + 'document_title' => 'Kekurangan Potensi', + 'document_color' => '#ff5757', + 'document_type' => '', + 'document_id' => 'chart-lack-of-potential', + 'visible_small_circle' => false, + 'style' => 'margin-left:180px;top:50px;' + ]) + @endcomponent + +
+ -
- -
- -
- -
-
-
- - + -
- -
-
-
-
- - - -
- -
-
-
-
-
- + - - - - -
-
-
-
-
- -
- @component('components.circle', [ - 'document_title' => 'Kekurangan Potensi', - 'document_color' => '#ff5757', - 'document_type' => '', - 'document_id' => 'chart-lack-of-potential', - 'visible_small_circle' => false, - 'style' => 'margin-left:180px;top:-20px;' - ]) - @endcomponent - + +
+ + {{-- tim wasdal gabungan --}} +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + {{-- tata ruang --}} +
+
- -
-
-
- - -
- - - -
-
-
-
-
- - - - -
- - - -
- - +
+
+ +
+
+ +
+ + {{-- reklame --}} +
+ +
+
+ +
+
+ +
+ + {{-- bapenda --}} +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + {{-- disbudpar --}} +
+ +
+
+ +
@endsection @section('scripts') -@vite(['resources/js/dashboards/potentials/inside_system.js']) + @endsection