Kontrol Topup

Topup Monitor

Flash sale WDP, harga modal, dan pricelist lengkap.

<%= new Date().toLocaleDateString('id-ID', { day:'2-digit', month:'short', year:'numeric' }) %>
<% if (typeof success !== 'undefined' && success) { %>
<%= success %>
<% } %> <% if (typeof error !== 'undefined' && error) { %>
<%= error %>
<% } %> <% const wdp = wdpProduct; const wdpModal = wdp ? (wdp.modal_price || 0) : 0; const wdpIsBelow = wdp && wdpModal < wdpThreshold; const weeklyCount = products.filter(p => p.type === 'weekly').length; const thinCount = products.filter(p => { const m = (p.price||0) - (p.modal_price||0); return m < 300 && p.type !== 'weekly'; }).length; %>

Modal WDP (Indonesia)

<%= wdp ? 'Rp ' + wdpModal.toLocaleString('id-ID') : '—' %>
<% if (wdp) { %> <%= wdpIsBelow ? '⚡ Di bawah Rp 27.200 — Flash Sale Otomatis' : '✓ Di atas threshold (Rp 27.200)' %> <% } else { %> Belum ada data, coba Force Sync <% } %>

Flash Sale WDP

<%= flashSale.active ? 'AKTIF' : 'MATI' %>
<%= flashSale.outOfStock ? 'Quota habis' : (flashSale.active ? 'Sisa ' + flashSale.quota + ' kuota' : 'Toggle untuk aktifkan') %>

Total Produk

<%= products.length %>
<%= weeklyCount %> weekly pass • <%= products.length - weeklyCount %> diamond

Margin Tipis

<%= thinCount %>
<%= thinCount > 0 ? 'Produk margin < Rp 300' : 'Semua margin normal' %>
Detail WDP Indonesia
<% if (wdpProduct && wdpProduct.sellerDisrupted) { %> Murah Gangguan <% } %> <% if (wdpStableProduct && wdpStableProduct.sellerDisrupted) { %> Stabil Gangguan <% } %>
⚡ WDP Murah (mlweek) <%= (flashSale.active && wdpProduct && !wdpProduct.hidden) ? 'Flash Sale' : 'Sembunyi' %>
<% if (wdpProduct) { %>
SKUmlweek
Modal Rp <%= (wdpProduct.modal_price || 0).toLocaleString('id-ID') %>
Jual (Flash) Rp <%= (wdpProduct.price||0).toLocaleString('id-ID') %>
Seller <%= wdpProduct.seller_name || 'diamondkudotgg' %> <% if (wdpProduct.sellerDisrupted) { %> (OFF)<% } %>
<% } else { %>

Tidak ada data

<% } %>
⚡ Cadangan (mlweekmrh) <%= (flashSale.active && typeof wdpMrhProduct !== 'undefined' && wdpMrhProduct && !wdpMrhProduct.hidden) ? 'Flash Sale' : 'Sembunyi' %>
<% if (typeof wdpMrhProduct !== 'undefined' && wdpMrhProduct) { %>
SKUmlweekmrh
Modal Rp <%= (wdpMrhProduct.modal_price || 0).toLocaleString('id-ID') %>
Jual (Flash) Rp <%= (wdpMrhProduct.price||0).toLocaleString('id-ID') %>
Seller <%= wdpMrhProduct.seller_name || 'GRIEZSTORE' %> <% if (wdpMrhProduct.sellerDisrupted) { %> (OFF)<% } %>
<% } else { %>

Tidak ada data

<% } %>
🔒 WDP Stabil (mlweekmhl) <%= (wdpStableProduct && !wdpStableProduct.hidden) ? 'Tampil' : 'Sembunyi' %>
<% if (wdpStableProduct) { %>
SKUmlweekmhl
Modal Rp <%= (wdpStableProduct.modal_price||0).toLocaleString('id-ID') %>
Jual (Normal) Rp <%= (wdpStableProduct.price||0).toLocaleString('id-ID') %>
Seller <%= wdpStableProduct.seller_name || 'KiosGame' %> <% if (wdpStableProduct.sellerDisrupted) { %> (OFF)<% } %>
<% } else { %>

Tidak ada data

<% } %>
Debounce Alert State (Firebase) <% if (flashSale.priceState === 'below') { %> below threshold <% } else if (flashSale.priceState === 'above') { %> above threshold <% } else { %> unknown <% } %>
Flash Sale Control
Flash Sale WDP
<%= flashSale.active ? 'Sedang aktif — produk muncul dengan harga promo' : 'Tidak aktif — produk tampil normal' %>
<% if (flashSale.lockedPrice) { %>
🔒 Harga Flash Sale Dibekukan
Tampil di halaman topup — tidak berubah meski modal naik
Rp <%= flashSale.lockedPrice.toLocaleString('id-ID') %>
<% } else { %>
ℹ Belum Ada Harga Bekuan
Dihitung otomatis dari modal saat flash sale pertama diaktifkan
<% } %>
<%= flashSale.outOfStock ? 'Quota Habis' : 'Masih Ada' %>

Reset Harga akan menghapus harga bekuan. Saat flash sale diaktifkan kembali, harga dihitung ulang dari modal saat itu.

Pricelist Produk Topup (<%= products.length %> produk)
WDP Indonesia Malaysia Margin tipis
Alur Kalkulasi Harga: Modal Supplier + Margin Bersih = Sebelum QRIS (Before) ➔ Gross-Up +0.7% QRIS = Harga Jual Final (After)
💡 Ubah nominal margin (Rupiah) lalu klik simpan . Setelah mengubah, wajib klik Force Sync di kanan atas halaman untuk menerapkan harga jual baru ke publik. Kosongkan input dan simpan untuk kembali ke default sistem.
<% function getDefaultNetMargin(p) { if (p.net_margin !== undefined) return p.net_margin; const sku = p.sku || ''; const modal = p.modal_price || 0; if (['mlweek', 'mlweekmrh', 'mlweekmhl', 'mymlweek', 'ml5'].includes(sku)) return 0; const multiMatch = sku.match(/^(?:mlweek|mymlweek)(\d+)$/); if (multiMatch) { const i = parseInt(multiMatch[1], 10); return 500 + (100 * i); } if (modal < 5000) return 150; if (modal < 15000) return 300; if (modal < 30000) return 500; if (modal < 100000) return 800; return 1200; } products.forEach((p, idx) => { const modal = p.modal_price || 0; const jual = p.price || 0; const isCustomMargin = marginConfig && marginConfig[p.sku] !== undefined; const customMarginValue = isCustomMargin ? parseInt(marginConfig[p.sku]) : null; const defaultNetMargin = getDefaultNetMargin(p); const targetNetMargin = isCustomMargin ? customMarginValue : defaultNetMargin; // Before QRIS (Modal + Margin) const baseBeforeQris = modal + targetNetMargin; // Fee QRIS 0.7% (Selisih dari harga jual) const qrisFeeAmount = jual - baseBeforeQris; const isMalaysia = (p.sku || '').includes('mymly') || String(p.label||'').toLowerCase().includes('malaysia') || (p.sku||'').startsWith('my'); const isWdpIndo = p.sku === 'mlweek' || p.sku === 'mlweekmrh' || p.sku === 'mlweekmhl'; const isWeekly = p.type === 'weekly'; const isThin = targetNetMargin < 300 && !isWeekly; const isFlash = p.isFlashSale === true; const isDisrupted = p.sellerDisrupted === true; let rowClass = ''; if (isDisrupted) rowClass = 'row-thin'; // background kemerahan tipis untuk gangguan else if (isWdpIndo) rowClass = 'row-wdp-indo'; else if (isMalaysia) rowClass = 'row-malaysia'; else if (isThin) rowClass = 'row-thin'; const region = isMalaysia ? 'malaysia' : 'indo'; %> <% }) %>
# Nama Produk SKU Modal Margin Bersih Sebelum QRIS (Before) Fee QRIS (0.7%) Harga Jual (After) Tipe Seller
<%= idx+1 %>
<%= p.label || p.id %> <% if (p.sku === 'mlweek') { %> WDP Utama<% } %> <% if (p.sku === 'mlweekmrh') { %> WDP Cadangan<% } %> <% if (p.sku === 'mlweekmhl') { %> WDP Stabil<% } %> <% if (isFlash) { %> Flash<% } %> <% if (p.hidden === true) { %> Hidden <% } else { %> Public <% } %>
<%= p.sku %> Rp <%= modal.toLocaleString('id-ID') %>
Rp <%= baseBeforeQris.toLocaleString('id-ID') %> <% if (isFlash || qrisFeeAmount <= 0) { %> 0% Rp 0 <% } else { %> +Rp <%= qrisFeeAmount.toLocaleString('id-ID') %> <% } %> Rp <%= jual.toLocaleString('id-ID') %> <%= p.type || 'diamond' %> <% if (isDisrupted) { %> Gangguan <% } else { %> <%= p.seller_name || 'Digiflazz' %> <% } %>