Silakan pilih bahasa dokumentasi terlebih dahulu.
Please choose the documentation language first.
Receipt Simulation — ManA Social Cafe adalah aplikasi simulasi kasir sederhana yang dibuat berdasarkan hasil identifikasi data dari struk transaksi ManA Social Cafe. Project ini dibuat untuk memenuhi tugas mata kuliah Basis Data, khususnya pada proses membaca data dari struk, menentukan entitas dan atribut, merancang ERD, mentransformasikan ERD ke relasi tabel, lalu mengimplementasikannya ke dalam database MySQL.
Selain itu, project ini juga digunakan untuk mempelajari bagaimana sistem kasir bekerja secara sederhana, mulai dari memilih menu, menyimpan transaksi, menghitung total pembayaran, sampai menampilkan output struk.
Project ini bukan sistem kasir produksi. Fokus utama project ini adalah pembelajaran konsep basis data dan simulasi alur transaksi kasir.
Repository: https://github.com/aqmalazza/ReceiptSimulation-ManASoscialCafe.git
.
├── assets/
│ ├── app-preview.png
│ ├── ERD.png
│ └── Table Relationship.png
│
├── database/
│ ├── 00_reset.sql
│ ├── 01_schema.sql
│ ├── 02_seed.sql
│ ├── 03_queries.sql
│ ├── 99_full_setup.sql
│ ├── mana_social_cafe.sql
│ └── README_DATABASE.md
│
└── apps/
├── app.py
├── config.py
├── database.py
├── formatters.py
├── receipt.py
├── repositories.py
├── requirements.txt
├── README.md
└── ui/
├── __init__.py
├── main_window.py
└── widgets.py
Database terdiri dari 9 tabel:
cabangmejapegawaipelangganmenutransaksidetail_transaksibiaya_tambahanpembayaran
Tabel detail_transaksi digunakan sebagai tabel penghubung antara transaksi dan menu, karena satu transaksi dapat memiliki banyak menu dan satu menu dapat muncul pada banyak transaksi.
- Python
- Tkinter
- MySQL
- mysql-connector-python
- phpMyAdmin / Laragon / XAMPP
git clone https://github.com/aqmalazza/ReceiptSimulation-ManASoscialCafe.git
cd ReceiptSimulation-ManASoscialCafePastikan MySQL sudah berjalan menggunakan Laragon, XAMPP, atau MySQL Server.
Jika menggunakan Laragon:
Laragon → Start All
Jika menggunakan XAMPP:
XAMPP Control Panel → Start Apache dan MySQL
Buka phpMyAdmin melalui browser:
http://localhost/phpmyadmin
Masuk ke phpMyAdmin, lalu buka menu Import.
Pilih file berikut:
database/99_full_setup.sql
Klik Go untuk menjalankan import.
File 99_full_setup.sql akan membuat database mana_social_cafe, membuat tabel, primary key, foreign key, relasi, dan data awal yang dibutuhkan aplikasi.
Setelah import berhasil, pastikan terdapat database:
mana_social_cafe
Di dalam database tersebut harus terdapat 9 tabel:
biaya_tambahan
cabang
detail_transaksi
meja
menu
pegawai
pelanggan
pembayaran
transaksi
Jika ingin menjalankan file SQL secara bertahap, gunakan urutan berikut:
1. database/00_reset.sql
2. database/01_schema.sql
3. database/02_seed.sql
4. database/03_queries.sql
Keterangan file:
| File | Fungsi |
|---|---|
00_reset.sql |
Menghapus database lama jika ingin memulai dari awal. |
01_schema.sql |
Membuat struktur database, tabel, primary key, foreign key, dan constraint. |
02_seed.sql |
Mengisi data awal seperti cabang, meja, pegawai, pelanggan default, dan menu. |
03_queries.sql |
Berisi query untuk mengecek data dan relasi database. |
99_full_setup.sql |
File gabungan untuk setup database secara lengkap. |
cd ReceiptSimulation/appspip install -r requirements.txtJika menggunakan Windows dan perintah pip tidak dikenali, gunakan:
py -m pip install -r requirements.txtBuka file:
apps/config.py
Pastikan konfigurasi database sesuai dengan komputer yang digunakan.
Default konfigurasi:
DB_CONFIG = {
"host": "localhost",
"user": "root",
"password": "",
"database": "mana_social_cafe",
"port": 3306,
}Jika MySQL menggunakan password, isi bagian password.
Contoh:
"password": "password_mysql"Masih di dalam folder apps, jalankan:
python app.pyAtau di Windows:
py app.pyJika database dan dependency sudah benar, aplikasi ManA Social Cafe akan terbuka.
- Pilih cabang.
- Pilih meja.
- Pilih pegawai atau kasir.
- Isi nama pelanggan jika ada.
- Kosongkan nama pelanggan jika pelanggan tidak ingin menyebutkan nama.
- Pilih menu.
- Masukkan jumlah pesanan.
- Tambahkan catatan item jika diperlukan.
- Klik Tambah ke Keranjang.
- Masukkan nominal pembayaran.
- Klik Simpan Transaksi & Cetak Struk.
Setelah transaksi tersimpan, output struk akan muncul pada panel kanan aplikasi.
Aplikasi memiliki fitur pencarian struk lama. Transaksi dapat dicari berdasarkan:
- ID transaksi,
- nomor pesanan,
- nama pelanggan,
- atau nomor meja.
Fitur ini digunakan ketika pelanggan meminta struk kembali setelah transaksi sebelumnya sudah tersimpan.
Struk yang tampil di aplikasi adalah preview digital yang dibuat dari data transaksi di database. Data transaksi disimpan ke MySQL, lalu aplikasi mengambil kembali data tersebut melalui relasi antar tabel dan menyusunnya menjadi format struk.
Alurnya adalah:
Data transaksi disimpan ke MySQL
↓
Aplikasi mengambil data dari tabel yang saling berelasi
↓
Data disusun menjadi format struk
↓
Struk tampil pada aplikasi
↓
Struk dapat dikirim ke printer
↓
Printer mencetak struk ke kertas
MySQL tidak mencetak struk secara langsung. MySQL hanya menyimpan data transaksi. Proses pencetakan dilakukan oleh aplikasi melalui printer yang terhubung ke komputer.
Dalam penggunaan nyata, output struk dapat dicetak menggunakan printer biasa atau printer thermal kasir. Jika printer thermal sudah terpasang di Windows, aplikasi dapat dikembangkan dengan tombol Cetak Struk untuk mengirim teks struk ke printer tersebut. Dengan alur ini, output struk digital pada aplikasi dapat menjadi kertas struk yang diterima oleh pelanggan.
- Database harus diimport terlebih dahulu sebelum aplikasi dijalankan.
- Data menu, meja, cabang, dan pegawai diambil dari MySQL.
- Menu dengan status
tidak tersediatetap tampil, tetapi tidak dapat dimasukkan ke keranjang. - Nama pelanggan boleh dikosongkan.
- Informasi WiFi, password, dan Instagram disimpan di
config.py, bukan di database. - Transaksi baru tersimpan pada tabel
transaksi,detail_transaksi,biaya_tambahan, danpembayaran.
Receipt Simulation — ManA Social Cafe is a simple cashier simulation application created from the data identification process of a ManA Social Cafe transaction receipt. This project was developed to fulfill a Database course assignment, especially in identifying data from a receipt, defining entities and attributes, designing an ERD, transforming the ERD into relational tables, and implementing the database in MySQL.
This project is also used to understand how a simple cashier system works, starting from selecting menu items, saving transactions, calculating payment totals, and displaying receipt output.
This is not a production cashier system. The main focus of this project is to learn database concepts and simulate a basic cashier transaction flow.
Repository: https://github.com/aqmalazza/ReceiptSimulation-ManASoscialCafe.git
.
├── assets/
│ ├── app-preview.png
│ ├── ERD.png
│ └── Table Relationship.png
│
├── database/
│ ├── 00_reset.sql
│ ├── 01_schema.sql
│ ├── 02_seed.sql
│ ├── 03_queries.sql
│ ├── 99_full_setup.sql
│ ├── mana_social_cafe.sql
│ └── README_DATABASE.md
│
└── apps/
├── app.py
├── config.py
├── database.py
├── formatters.py
├── receipt.py
├── repositories.py
├── requirements.txt
├── README.md
└── ui/
├── __init__.py
├── main_window.py
└── widgets.py
The database consists of 9 tables:
cabangmejapegawaipelangganmenutransaksidetail_transaksibiaya_tambahanpembayaran
The detail_transaksi table is used as a bridge table between transaksi and menu, because one transaction can contain many menu items and one menu item can appear in many transactions.
- Python
- Tkinter
- MySQL
- mysql-connector-python
- phpMyAdmin / Laragon / XAMPP
git clone https://github.com/aqmalazza/ReceiptSimulation-ManASoscialCafe.git
cd ReceiptSimulation-ManASoscialCafeMake sure MySQL is running using Laragon, XAMPP, or MySQL Server.
If using Laragon:
Laragon → Start All
If using XAMPP:
XAMPP Control Panel → Start Apache and MySQL
Open phpMyAdmin in the browser:
http://localhost/phpmyadmin
Open phpMyAdmin, then go to the Import menu.
Choose this file:
database/99_full_setup.sql
Click Go to run the import process.
The 99_full_setup.sql file will create the mana_social_cafe database, tables, primary keys, foreign keys, relationships, and the initial data required by the application.
After the import process is complete, make sure the following database exists:
mana_social_cafe
It should contain 9 tables:
biaya_tambahan
cabang
detail_transaksi
meja
menu
pegawai
pelanggan
pembayaran
transaksi
To run the SQL files step by step, use this order:
1. database/00_reset.sql
2. database/01_schema.sql
3. database/02_seed.sql
4. database/03_queries.sql
File explanation:
| File | Description |
|---|---|
00_reset.sql |
Deletes the existing database if you want to start from zero. |
01_schema.sql |
Creates the database structure, tables, primary keys, foreign keys, and constraints. |
02_seed.sql |
Inserts initial data such as branch, tables, cashier, default customer, and menu. |
03_queries.sql |
Contains queries for checking data and database relationships. |
99_full_setup.sql |
Complete setup file for database installation. |
cd ReceiptSimulation/appspip install -r requirements.txtIf pip is not recognized on Windows, use:
py -m pip install -r requirements.txtOpen:
apps/config.py
Make sure the database configuration matches your local MySQL setup.
Default configuration:
DB_CONFIG = {
"host": "localhost",
"user": "root",
"password": "",
"database": "mana_social_cafe",
"port": 3306,
}If your MySQL uses a password, update the password value.
Example:
"password": "your_mysql_password"From inside the apps folder, run:
python app.pyOr on Windows:
py app.pyIf the database and dependencies are configured correctly, the ManA Social Cafe application will open.
- Select the branch.
- Select the table number.
- Select the cashier or employee.
- Enter the customer name if available.
- Leave the customer name empty if the customer does not want to provide a name.
- Select a menu item.
- Enter the quantity.
- Add an item note if needed.
- Click Tambah ke Keranjang.
- Enter the payment amount.
- Click Simpan Transaksi & Cetak Struk.
After the transaction is saved, the receipt output will appear on the right side of the application.
The application provides a feature to search previous receipts. Transactions can be searched by:
- transaction ID,
- order number,
- customer name,
- or table number.
This feature is used when a customer asks for a receipt again after a transaction has already been saved.
The receipt shown in the application is a digital preview generated from transaction data stored in the database. The transaction data is saved to MySQL, then retrieved by the application through table relationships and formatted into a receipt layout.
The process is:
Transaction data is saved to MySQL
↓
The application retrieves data from related tables
↓
The data is formatted into a receipt
↓
The receipt appears in the application
↓
The receipt can be sent to a printer
↓
The printer prints the receipt on paper
MySQL does not print the receipt directly. MySQL only stores transaction data. The printing process is handled by the application through a printer connected to the computer.
In real use, the receipt output can be printed using a regular printer or a thermal receipt printer. If a thermal printer is already installed in Windows, the application can be extended with a Print Receipt button to send the receipt text to the printer. Through this flow, the digital receipt output in the application can become a printed receipt received by the customer.
- The database must be imported before running the application.
- Menu, table, branch, and cashier data are loaded from MySQL.
- Menu items with
tidak tersediastatus are displayed but cannot be added to the cart. - Customer name can be left empty.
- WiFi, password, and Instagram information are stored in
config.py, not in the database. - New transactions are saved to
transaksi,detail_transaksi,biaya_tambahan, andpembayaran.


