MMB Travel

Inventory & Invoice System

PT. Mudah Menuju Baitullah • v3.2
Connecting...
Supabase: ...
Google Sheets: ...
MMB
Inventory & Invoice System
v3.2 • 1448H
Supabase: belum terhubung ☁ CLOUD
Belum terhubung ke Google Sheets Auto-sync aktif

Panduan Google Sheets Sync

1
Buat Google Spreadsheet baru

Buka sheets.new → nama: MMB Inventory 1448H

2
Extensions → Apps Script → paste kode ini
const SS=SpreadsheetApp.getActiveSpreadsheet();
function doPost(e){
  try{
    var d=JSON.parse(e.postData.contents);
    if(d.action==='sync_inventory'){
      var sh=SS.getSheetByName('Inventory')||SS.insertSheet('Inventory');
      sh.clearContents();
      sh.appendRow(['ID','Kota','Tanggal','Dur','Flight','Rute','Total','Terbook','Tersedia','Harga','Ket']);
      d.inventory.forEach(r=>sh.appendRow([r.id,r.kota,r.tgl,r.dur,r.flight,r.rute,r.total,r.booked,r.total-r.booked,r.harga,r.ket]));
    }
    if(d.action==='sync_invoices'){
      var si=SS.getSheetByName('Invoices')||SS.insertSheet('Invoices');
      si.clearContents();
      si.appendRow(['No Invoice','Tgl','Agen','PIC','WA','Kota','Tgl Terbang','Dur','Flight','Seat','Harga','Total','DP','Sisa','Status']);
      d.invoices.forEach(r=>si.appendRow([r.no,r.created.split('T')[0],r.agenNama,r.agenPic,r.agenWa,r.kota,r.tgl,r.dur,r.flight,r.seat,r.harga,r.total,r.dp,r.sisa,r.status]));
    }
    return ContentService.createTextOutput(JSON.stringify({ok:true})).setMimeType(ContentService.MimeType.JSON);
  }catch(err){return ContentService.createTextOutput(JSON.stringify({ok:false,error:err.message})).setMimeType(ContentService.MimeType.JSON);}
}
3
Deploy → New deployment → Web app → Anyone → Deploy

Copy URL → paste di bar hijau → Sync.

✈
0
Schedule
★
0
Total Seat
✓
0
Tersedia
✕
0
Terbook
✉
0
Total Invoice
₴
Rp 0
Total Revenue
☑
Rp 0
Total DP Diterima

Tambah Blok Seat

Input jadwal + 4 segmen penerbangan


✈️ Segmen Berangkat 🌙 STPC 1 Malam KL
Leg 1 — Kota Asal → KUL
→
—
= tgl keberangkatan
Leg 2 — KUL → MED
→
—
= tgl keberangkatan
🔄 Segmen Pulang
Leg 3 — JED → KUL (malam STPC di KL)
→
—
hari ke-dur (STPC)
Leg 4 — KUL → Kota Asal (next day, tiba rumah)
→
—
next day (tiba rumah)

Daftar Blok Seat

UPG: 118 jadwal • PKU: 79 jadwal • STPC termasuk dalam program

Open Mapping MH UPG 1448H
UPG
10:20
→
MH846
KUL
13:45
→
MH158
MED
16:50
21:35
JED
01:10
→
MH157
KUL
15:35
→
MH847
UPG
06:00
09:20
STPC IncludedTransit KL 1 malam sudah termasuk dalam program & harga.

RuteMasuk via Madinah (MED)
Keluar via Jeddah (JED)

CatatanLeg 3: tiba KL, menginap STPC
Leg 4: terbang pulang esok hari
KotaTanggalDurFlightRuteHarga/SeatTotalTerbookTersediaStatusAksi

Data Agen

✓ Tersimpan

Pilih Blok Seat

Rute
Tersedia
Harga/Seat
Nominal total DP
🕐Auto 32 hari sebelum keberangkatan

Ringkasan & Penyesuaian Harga

Rp 0
Rp 0
Rp 0
Seat0 seat
Harga/SeatRp 0
SubtotalRp 0
DiskonRp 0
CashbackRp 0
Tax / PPNRp 0
TOTALRp 0
DP / DibayarRp 0
Sisa PembayaranRp 0

Preview Invoice

Termasuk tanggal detail per segmen & STPC

📄

Preview Invoice

Isi form di kiri dan klik Generate Invoice.

Riwayat Invoice

No. InvoiceTanggalAgenFlightSeatTotalDPStatusAksi

Hapus Schedule?

Yakin hapus schedule ini?

Edit Inventory

Edit Total Seat dan Seat Terbook untuk koreksi ketersediaan. Seat Tersedia = Total − Terbook.
—

👤 Kontak Tersimpan

Tambah Kontak Baru
Daftar Kontak (0)
👤

Belum ada kontak.

☁ Setup Supabase (5 menit, gratis)

1
Buat akun Supabase gratis

Buka supabase.com → Sign up → New project → nama: mmb-travel → region: Singapore

2
SQL Editor → paste SQL ini → Run
-- Run di Supabase SQL Editor
create table if not exists inventory (
  id text primary key, kota text, tgl date, dur text default '',
  flight text, rute text default '',
  segments jsonb default '{}', seg_dates jsonb default '{}',
  total integer default 0, booked integer default 0,
  harga bigint default 0, maskapai text default 'Malaysia Airlines (MH)',
  ket text default '', stpc boolean default true, musim text default '1448H',
  created_at timestamptz default now()
);
create table if not exists invoices (
  id text primary key, no text unique not null,
  flight_id text references inventory(id),
  kota text, tgl date, dur text default '',
  flight text, rute text, maskapai text,
  segments jsonb default '{}', seg_dates jsonb default '{}', stpc boolean default true,
  agen_nama text, agen_pic text default '', agen_wa text default '', agen_kota text default '',
  seat integer, harga bigint default 0,
  subtotal bigint default 0, disc bigint default 0, disc_input text default '0',
  disc_type text default 'pct', cb bigint default 0, cb_input text default '0',
  cb_type text default 'pct', tax bigint default 0, tax_input text default '0',
  tax_type text default 'pct', total bigint, dp bigint default 0,
  dp_per_pax bigint default 0, dp_mode text default 'total',
  sisa bigint default 0, notes text default '', due_date date, status text,
  created_at timestamptz default now()
);
alter table inventory enable row level security;
alter table invoices enable row level security;
drop policy if exists "public_all_inventory" on inventory;
drop policy if exists "public_all_invoices" on invoices;
create policy "public_all_inventory" on inventory for all using (true) with check (true);
create policy "public_all_invoices" on invoices for all using (true) with check (true);
3
Project Settings → API → copy URL & anon key

Paste di bar gelap atas → klik Hubungkan. Sistem auto-upload 197 jadwal preset.

4
Deploy ke Netlify

netlify.com → drag & drop file HTML → dapat URL publik → akses dari HP/laptop mana saja.

Gratis selamanya: Supabase free tier — 500MB storage, 2GB bandwidth/bulan. Tidak perlu kartu kredit.

Kelola User

Tambah User Baru
Daftar User (0)