Detail Laporan Fix (Month, Week , Table Number)

This commit is contained in:
Bluwww 2025-12-14 11:04:43 +07:00
parent 43b50ce022
commit a2c374242f

15
main.py
View File

@ -751,7 +751,8 @@ def report_get_weekly_summary(week_start=None, method_filter=None):
'total_transaksi': summary['total_count'],
'total_pendapatan': summary['total_income'],
'rata_rata': summary['avg_per_transaction'],
'metode_breakdown': summary['metode_breakdown']
'metode_breakdown': summary['metode_breakdown'],
'details': summary['payments']
}
@ -784,7 +785,8 @@ def report_get_monthly_summary(year=None, month=None, method_filter=None):
'total_transaksi': summary['total_count'],
'total_pendapatan': summary['total_income'],
'rata_rata': summary['avg_per_transaction'],
'metode_breakdown': summary['metode_breakdown']
'metode_breakdown': summary['metode_breakdown'],
'details': summary['payments']
}
@ -3653,10 +3655,17 @@ class App:
# Populate tree dari payment details
for payment in report_data.get('details', []):
pid, tid, metode, jumlah, status, tanggal = payment
nomor_meja = "-"
trx_data = transaksi_get(tid) # Ambil data transaksi berdasarkan ID
if trx_data:
# trx_data = (tid, uid, meja, total, status, ...)
nomor_meja = trx_data[2] # Index 2 adalah nomor meja
# ----------------------------------
self.report_tree.insert("", tk.END, values=(
tid,
format_datetime(tanggal),
"-", # meja (not available in payment data)
nomor_meja, # <--- Ganti "-" dengan variabel nomor_meja
format_currency(jumlah),
metode.upper() if metode else "-",
status