#!/bin/bash
# read-report.sh - Read MT5 HTML report directly from Wine Desktop
ACCOUNT=${1:-104125640}
REPORT_FILE="${HOME}/mt5-docker/config/.wine/drive_c/users/abc/Desktop/ReportHistory-${ACCOUNT}.html"
if [ ! -f "${REPORT_FILE}" ]; then
echo "❌ Report not found: ${REPORT_FILE}"
echo ""
echo "Available reports:"
ls ${HOME}/mt5-docker/config/.wine/drive_c/users/abc/Desktop/ReportHistory-*.html 2>/dev/null || echo " None"
exit 1
fi
echo "=== Reading MT5 Report ==="
echo "File: $(basename "${REPORT_FILE}")"
echo "Modified: $(stat -c %y "${REPORT_FILE}" | cut -d'.' -f1)"
echo ""
# Parse using Python
python3 "$(dirname "$0")/parse-html-report.py" "${REPORT_FILE}"
echo ""
echo "📁 Browser Access:"
echo " file://${REPORT_FILE}"