This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const groupByFromArray = (data: any[]) => { | |
| const grouped = {}; | |
| // Iterasi setiap objek dalam JSON array menggunakan for...of | |
| for (const obj of data) { | |
| // Iterasi setiap key-value dalam objek | |
| for (const [key, value] of Object.entries(obj)) { | |
| if (!grouped[key]) { | |
| grouped[key] = new Set(); // Gunakan Set untuk memastikan nilai unik | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // cabang-service/index.js | |
| const express = require('express'); | |
| const mysql = require('mysql2/promise'); | |
| const app = express(); | |
| app.use(express.json()); | |
| const db = mysql.createPool({ | |
| host: 'localhost', | |
| user: 'root', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { headerRatioPenJualanRollanKGan } from '@/app/http/laporan/reordering/ratio-penjualan-rollan-kgan/ratio-penjualan-rollan-kgan.header'; | |
| import ExcelJS from 'exceljs'; | |
| import * as fs from 'fs'; | |
| // Define types for columns and data | |
| interface Column { | |
| header: string; | |
| key: string; | |
| width: number; | |
| type?: string; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const formatToCaption = (value: string) => { | |
| return value | |
| .replace('OpenB_', '(') | |
| .replace('_CloseB', ')') | |
| .replace('_PeR', '/') | |
| .replace('_DaSh', ' -') | |
| .split('_') | |
| .map((word) => { |