Evaluasi Tengah Semester PBKK.

Nama : Muhammad Ilham Bayhaqi
NRP : 05111840000069
- Sebutkan aplikasi POS yang biasa dipakai di masyarakat
- Fitur apa saja yang ada di dalam aplikasi tersebut, buatlah screenshotnya dan jelaskan!
Berikut ini merupakan contoh aplikasi POS yang
ada di Indonesia
Dari beberapa aplikasi yang telah ditulis diatas,
kita akan coba untuk membahas fitur-fitur apa saja sih yang ada
di aplikasi tersebut. Kali ini kita coba ambil fitur yang ada pada Moka. Moka menawarkan berbagai fitur yang
cukup
banyak sebagai berikut.
- Manajemen Pesanan
Ini merupakan fitur umum yang ditawarkan oleh
Moka dimana kasir dapat mengelola
pesanan yang dibuat oleh kustomer.
- Pembayaran Digital
Disini, Moka menawarkan banyak metode
pembayaran yang ada yaitu bisa berupa cash,
dengan e-wallet (OVO, GoPay, Dana, LinkAja, dan lainnya) serta juga melalui Electonic Data Capture dari
berbagai bank.
- Manajemen Meja
Fitur ini merupakan fitur yang dapat mengatur
meja yang akan digunakan hingga
bisa juga untuk mengatur waiting list dari pelanggan yang datang.
- Laporan Penjualan Harian
Beralih ke bagian administratif, Moka menawawrkan
membuat laporan penjulan hingga
diagram dari laporan tersebut.
- Laporan Stok Barang
Terdapat juga laporan untuk database pemasok, dan
juga keterdiaan stok.
- Perhitungan Pajak
Moka juga memiliki fitur untuk melakukan
perhitungan pajak dan juga persentase
uang tip bagi karyawan.
- Dasbor
Dasbor digunakan untuk melakukan pengamatan
agar dapat menganalisis aktivitas
usaha.
- Maanjemen Banyak Cabang
Fitur yang menarik pada Moka adalah fitur ini.
Dengan fitur ini, apabila usaha
yang dimiliki terdiri dari banyak cabang tetap bisa terpantau dalam satu dasbor.
- Survey Pelanggan
Fitur ini digunakan untuk mengumpulkan
testimoni dari pelanggan sehingga dapat
melakukan perbaikan pada usaha yang ada saat ini.
- Manajemen Karyawan
Manajemen Karyawan merupakan fitur keamanan
dengan dapat mengatur PIN untuk
karyawan-karyawan.
- Sif Karyawan
Fitur ini berguna untuk mengatur pembagian
tugas dari tiap karyawan sehingga
terekam siapa saja yang sedang bertugas ketika dibutuhkan.
- Diskon dan Promosi
Beralih ke bagian promosi, Moka menawarkan
fitur untuk pemberian diskon dan
reward untuk pelanggan.
- CRM Pro
Fitur ini merupakan fitur yang digunakan untuk
mengirimkan info menarik yang
mungkin dibutuhkan pelanggan melalui SMS atau email.
- Program Loyalitas
Dengan fitur ini, pelanggan dapat
dikategorikan berdasarkan loyalitasnya untuk
mendapatkan reward tanpa kartu anggota.
Kelompok
Sitti Chofifah - 05111840000039
Muhammad Ilham Bayhaqi - 05111840000069
- Buat rancangan UI dan navigasi aplikasi POS mu sendiri?
Namun dalam implementasinya ternyata ada beberapa perubahan dari rancangan awal yang kami buat. Sehingga
hasil akhi dari desain program yang kami buat sebagai berikut.
- Dengan menggunakan framework .NET implementasikan aplikasi POS yang dirancang.
Pertama kita lakukan koneksi ke database dengan membuat AppDBContext sebagai berikut
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.EntityFrameworkCore; | |
namespace PosApp | |
{ | |
class AppDbContext : DbContext | |
{ | |
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
{ | |
// Connection String | |
optionsBuilder.UseSqlServer(@"Data Source=LAPTOP-44JS3657;Initial Catalog=PosAppDB;Integrated Security=True"); | |
} | |
public DbSet<Product> Products { get; set; } | |
public DbSet<Category> Categories { get; set; } | |
} | |
} |
Kemudian kita buat model untuk item yang ada yaitu pada kelas Product dan Category. Setelah dilakukan
migrasi dan update database maka akan terbentuk tabel dari model tersebut.
Untuk kelas pendukung lainnya ada kelas Order yang menampung data item yang telah di order kemudian juga
ada kelas Invoice sebagai data untuk pembayaran.
Pada MainWindow menangani untuk menampilkan item menu yang ada kemudian juga menangani untuk order yang
dilakukan serta perhitungan Invoice. Untuk kode sumber kelas ini sebagai berikut.
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
using System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.Collections.Specialized; | |
using System.ComponentModel; | |
using System.Diagnostics; | |
using System.Globalization; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
using System.Windows.Documents; | |
using System.Windows.Input; | |
using System.Windows.Media; | |
using System.Windows.Media.Imaging; | |
using System.Windows.Navigation; | |
using System.Windows.Shapes; | |
namespace PosApp | |
{ | |
/// <summary> | |
/// Interaction logic for MainWindow.xaml | |
/// </summary> | |
public partial class MainWindow : Window, INotifyPropertyChanged, INotifyCollectionChanged | |
{ | |
Invoice invoice = new(); | |
private ObservableCollection<Product> myproducts = new(); | |
private ObservableCollection<Order> myorder = new(); | |
public string BaseDir = Directory.GetCurrentDirectory(); | |
public event PropertyChangedEventHandler PropertyChanged; | |
public event NotifyCollectionChangedEventHandler CollectionChanged; | |
int menuId = 1; | |
public MainWindow() | |
{ | |
InitializeComponent(); | |
DataContext = invoice; | |
myproducts = GetProducts(); | |
using (AppDbContext db = new()) | |
{ | |
ListViewCategory.ItemsSource = db.Categories.ToList(); | |
} | |
ListViewProducts.ItemsSource = myproducts; | |
ListViewOrder.ItemsSource = myorder; | |
tbDate.Text = invoice.Date; | |
calcInvoice(); | |
} | |
private ObservableCollection<Product> GetProducts() | |
{ | |
AppDbContext db = new(); | |
foreach (Product p in db.Products.Where(x => x.Category == menuId).ToList()) | |
{ | |
p.Image = BaseDir + "/Assets/" + p.Image; | |
myproducts.Add(p); | |
} | |
return myproducts; | |
} | |
private void Btn_Product_Click(object sender, RoutedEventArgs e) | |
{ | |
Button btn = sender as Button; | |
Product selectedProduct = btn.DataContext as Product; | |
bool canInsert = !myorder.Any(i => i.Product.Id == selectedProduct.Id); | |
Order order = new(selectedProduct); | |
if(canInsert) myorder.Add(order); | |
calcInvoice(); | |
} | |
private void BtnMin_Click(object sender, RoutedEventArgs e) | |
{ | |
Button btn = sender as Button; | |
Order selectedOrder = btn.DataContext as Order; | |
if (selectedOrder.Quantity > 1) | |
{ | |
selectedOrder.Quantity -= 1; | |
selectedOrder.Subtotal = selectedOrder.CalcSubtotal(); | |
} | |
calcInvoice(); | |
} | |
private void BtnPlus_Click(object sender, RoutedEventArgs e) | |
{ | |
Button btn = sender as Button; | |
Order selectedOrder = btn.DataContext as Order; | |
if (selectedOrder.Quantity < 99) | |
{ | |
selectedOrder.Quantity += 1; | |
selectedOrder.Subtotal = selectedOrder.CalcSubtotal(); | |
} | |
calcInvoice(); | |
} | |
private void BtnRemoveOrder_Click(object sender, RoutedEventArgs e) | |
{ | |
Button btn = sender as Button; | |
Order selectedOrder = btn.DataContext as Order; | |
myorder.Remove(myorder.Where(i => i.Product.Equals(selectedOrder.Product)).Single()); | |
calcInvoice(); | |
} | |
private void calcInvoice() | |
{ | |
float total = 0; | |
foreach(Order order in myorder){ | |
total += order.Subtotal; | |
} | |
invoice.Total = total; | |
invoice.Tax = 0.1f * total; | |
invoice.TotalTax = invoice.Total + invoice.Tax; | |
//Debug.WriteLine(invoice.TotalTax.ToString()); | |
} | |
private void btnReset_Click(object sender, RoutedEventArgs e) | |
{ | |
int count = myorder.Count; | |
for (int i=0; i < count; i++) | |
{ | |
myorder.RemoveAt(0); | |
} | |
calcInvoice(); | |
} | |
private void btnPayment_Click(object sender, RoutedEventArgs e) | |
{ | |
PaymentWindow paymentWindow = new(myorder.ToList()); | |
paymentWindow.Show(); | |
} | |
private void btnCategory_Click(object sender, RoutedEventArgs e) | |
{ | |
Button btn = sender as Button; | |
Category selectedCategory = btn.DataContext as Category; | |
menuId = selectedCategory.Id; | |
int count = myproducts.Count; | |
for (int i = 0; i < count; i++) | |
{ | |
myproducts.RemoveAt(0); | |
} | |
ObservableCollection<Product> temp = GetProducts(); | |
} | |
} | |
} |
Kemudian untuk menangani pembayaran diletakkan pada kelas PaymentWindow yang mana sebagai berikut.
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
using System.Windows.Documents; | |
using System.Windows.Input; | |
using System.Windows.Media; | |
using System.Windows.Media.Imaging; | |
using System.Windows.Shapes; | |
namespace PosApp | |
{ | |
/// <summary> | |
/// Interaction logic for PaymentWindow.xaml | |
/// </summary> | |
public partial class PaymentWindow : Window | |
{ | |
List<Order> myorder = new(); | |
Invoice invoice = new(); | |
float amount = 0; | |
float change = -1; | |
public PaymentWindow(List<Order> order) | |
{ | |
InitializeComponent(); | |
myorder = order; | |
calcInvoice(); | |
TbTotal.Text = invoice.TotalTax.ToString("C2"); | |
} | |
private void btnCash_Click(object sender, RoutedEventArgs e) | |
{ | |
if (String.IsNullOrEmpty(TbAmount.Text)){ | |
MessageBox.Show("Amount Empty"); | |
} else | |
{ | |
amount = float.Parse(TbAmount.Text); | |
change = amount - invoice.TotalTax; | |
if (change < 0) MessageBox.Show("Invalid Amound"); | |
else TbChange.Text= change.ToString("C2"); | |
} | |
} | |
private void calcInvoice() | |
{ | |
float total = 0; | |
foreach (Order order in myorder) | |
{ | |
total += order.Subtotal; | |
} | |
invoice.Total = total; | |
invoice.Tax = 0.1f * total; | |
invoice.TotalTax = invoice.Total + invoice.Tax; | |
} | |
private void btnPrint_Click(object sender, RoutedEventArgs e) | |
{ | |
if(change > 1) | |
{ | |
InvoiceWindow printInvoice = new(myorder, invoice.Total, invoice.Tax, invoice.TotalTax, TbAmount.Text, TbChange.Text); | |
// myorder, invoice.Total, invoice.Tax, invoice.TotalTax ,TbAmount.Text, TbChange.Text | |
printInvoice.Show(); | |
//printInvoice.Close(); | |
} else | |
{ | |
MessageBox.Show("You have to pay before print reciept"); | |
} | |
} | |
} | |
} |
Kemudian untuk pencetakan invoice ditangani oleh kelas InvoiceWindow.xaml.cs
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
using System.Windows.Documents; | |
using System.Windows.Input; | |
using System.Windows.Media; | |
using System.Windows.Media.Imaging; | |
using System.Windows.Shapes; | |
namespace PosApp | |
{ | |
/// <summary> | |
/// Interaction logic for InvoiceWindow.xaml | |
/// </summary> | |
public partial class InvoiceWindow : Window | |
{ | |
public InvoiceWindow(List<Order> order, float subtotal, float tax, float total, string amount, string charge) | |
{ | |
InitializeComponent(); | |
ListViewInvoice.ItemsSource = order; | |
tbDate.Text = new Invoice().Date; | |
tbSubtotal.Text = subtotal.ToString("C"); | |
tbTax.Text = tax.ToString("C"); | |
tbTotal.Text = total.ToString("C"); | |
tbAmount.Text = float.Parse(amount).ToString("C"); | |
tbChange.Text = charge; | |
this.IsEnabled = false; | |
PrintDialog printDialog = new(); | |
if (printDialog.ShowDialog() == true) | |
{ | |
printDialog.PrintVisual(print, "Invoice"); | |
} | |
} | |
} | |
} |
Untuk kode sumber lengkap bisa dilihat di sini
- Buat tutorial pembuatan aplikasi beserta demo penggunaannya di Youtube , kemudian dokumentasikan/ embedded di blog.
Dokumentasi dari pembuatan aplikasi ini bisa dilihat pada video dibawah ini.
Komentar
Posting Komentar