| | <!DOCTYPE html> |
| | <html lang="en"> |
| | <head> |
| | <meta charset="UTF-8"> |
| | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| | <title>Expense & Invoice Manager | Small Business</title> |
| | <script src="https://cdn.tailwindcss.com"></script> |
| | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> |
| | <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> |
| | <style> |
| | :root { |
| | --primary: #4f46e5; |
| | --primary-light: #6366f1; |
| | --secondary: #10b981; |
| | --danger: #ef4444; |
| | --warning: #f59e0b; |
| | } |
| | |
| | .sidebar { |
| | transition: all 0.3s ease; |
| | } |
| | |
| | @media (max-width: 768px) { |
| | .sidebar { |
| | transform: translateX(-100%); |
| | position: absolute; |
| | z-index: 50; |
| | height: 100vh; |
| | } |
| | .sidebar.active { |
| | transform: translateX(0); |
| | } |
| | } |
| | |
| | .receipt-preview { |
| | max-height: 150px; |
| | object-fit: contain; |
| | } |
| | |
| | .invoice-line-item:last-child { |
| | border-bottom: none; |
| | } |
| | |
| | .currency-toggle.active { |
| | background-color: var(--primary); |
| | color: white; |
| | } |
| | </style> |
| | </head> |
| | <body class="bg-gray-50"> |
| | |
| | <button id="mobileMenuButton" class="md:hidden fixed top-4 left-4 z-50 bg-indigo-600 text-white p-2 rounded-lg shadow-lg"> |
| | <i class="fas fa-bars"></i> |
| | </button> |
| |
|
| | |
| | <div id="sidebar" class="sidebar w-64 bg-white shadow-lg h-screen fixed"> |
| | <div class="p-4 border-b border-gray-200"> |
| | <div class="flex items-center space-x-3"> |
| | <div class="w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center"> |
| | <i class="fas fa-coins text-indigo-600"></i> |
| | </div> |
| | <h1 class="text-xl font-bold text-gray-800">BizTracker</h1> |
| | </div> |
| | </div> |
| | |
| | <div class="p-4"> |
| | <div class="flex items-center space-x-3 mb-6"> |
| | <div class="w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center"> |
| | <span class="text-indigo-600 font-semibold">JD</span> |
| | </div> |
| | <div> |
| | <p class="font-medium text-gray-800">John Doe</p> |
| | <p class="text-xs text-gray-500">Admin</p> |
| | </div> |
| | </div> |
| | |
| | <nav> |
| | <ul class="space-y-1"> |
| | <li> |
| | <a href="#" class="flex items-center space-x-3 p-2 rounded-lg bg-indigo-50 text-indigo-700"> |
| | <i class="fas fa-tachometer-alt w-5 text-center"></i> |
| | <span>Dashboard</span> |
| | </a> |
| | </li> |
| | <li> |
| | <a href="#" class="flex items-center space-x-3 p-2 rounded-lg hover:bg-gray-100 text-gray-700"> |
| | <i class="fas fa-receipt w-5 text-center"></i> |
| | <span>Expenses</span> |
| | </a> |
| | </li> |
| | <li> |
| | <a href="#" class="flex items-center space-x-3 p-2 rounded-lg hover:bg-gray-100 text-gray-700"> |
| | <i class="fas fa-file-invoice-dollar w-5 text-center"></i> |
| | <span>Invoices</span> |
| | </a> |
| | </li> |
| | <li> |
| | <a href="#" class="flex items-center space-x-3 p-2 rounded-lg hover:bg-gray-100 text-gray-700"> |
| | <i class="fas fa-chart-pie w-5 text-center"></i> |
| | <span>Reports</span> |
| | </a> |
| | </li> |
| | <li> |
| | <a href="#" class="flex items-center space-x-3 p-2 rounded-lg hover:bg-gray-100 text-gray-700"> |
| | <i class="fas fa-users w-5 text-center"></i> |
| | <span>Clients</span> |
| | </a> |
| | </li> |
| | <li> |
| | <a href="#" class="flex items-center space-x-3 p-2 rounded-lg hover:bg-gray-100 text-gray-700"> |
| | <i class="fas fa-cog w-5 text-center"></i> |
| | <span>Settings</span> |
| | </a> |
| | </li> |
| | </ul> |
| | </nav> |
| | </div> |
| | |
| | <div class="absolute bottom-0 w-full p-4 border-t border-gray-200"> |
| | <button class="flex items-center space-x-3 p-2 rounded-lg hover:bg-gray-100 text-gray-700 w-full"> |
| | <i class="fas fa-sign-out-alt w-5 text-center"></i> |
| | <span>Logout</span> |
| | </button> |
| | </div> |
| | </div> |
| |
|
| | |
| | <div class="ml-0 md:ml-64 transition-all duration-300"> |
| | |
| | <header class="bg-white shadow-sm p-4"> |
| | <div class="flex justify-between items-center"> |
| | <h1 class="text-2xl font-bold text-gray-800">Dashboard</h1> |
| | |
| | <div class="flex items-center space-x-4"> |
| | <div class="flex bg-gray-100 rounded-lg p-1"> |
| | <button id="usdToggle" class="currency-toggle px-3 py-1 rounded-md active">USD</button> |
| | <button id="tshToggle" class="currency-toggle px-3 py-1 rounded-md">TSh</button> |
| | </div> |
| | |
| | <div class="relative"> |
| | <button id="notificationsButton" class="relative p-2 rounded-full hover:bg-gray-100"> |
| | <i class="fas fa-bell text-gray-600"></i> |
| | <span class="absolute top-0 right-0 w-2 h-2 bg-red-500 rounded-full"></span> |
| | </button> |
| | <div id="notificationsDropdown" class="hidden absolute right-0 mt-2 w-72 bg-white rounded-lg shadow-lg z-10 border border-gray-200"> |
| | <div class="p-3 border-b border-gray-200"> |
| | <h3 class="font-medium">Notifications</h3> |
| | </div> |
| | <div class="max-h-60 overflow-y-auto"> |
| | <a href="#" class="block p-3 hover:bg-gray-50 border-b border-gray-100"> |
| | <div class="flex items-start"> |
| | <div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-3"> |
| | <i class="fas fa-file-invoice-dollar text-blue-500"></i> |
| | </div> |
| | <div> |
| | <p class="text-sm">Invoice #1023 is due in 2 days</p> |
| | <p class="text-xs text-gray-500">Client: ABC Corp</p> |
| | </div> |
| | </div> |
| | </a> |
| | <a href="#" class="block p-3 hover:bg-gray-50 border-b border-gray-100"> |
| | <div class="flex items-start"> |
| | <div class="w-8 h-8 rounded-full bg-green-100 flex items-center justify-center mr-3"> |
| | <i class="fas fa-check-circle text-green-500"></i> |
| | </div> |
| | <div> |
| | <p class="text-sm">Expense approved</p> |
| | <p class="text-xs text-gray-500">Office supplies - $45.00</p> |
| | </div> |
| | </div> |
| | </a> |
| | <a href="#" class="block p-3 hover:bg-gray-50"> |
| | <div class="flex items-start"> |
| | <div class="w-8 h-8 rounded-full bg-yellow-100 flex items-center justify-center mr-3"> |
| | <i class="fas fa-exclamation-triangle text-yellow-500"></i> |
| | </div> |
| | <div> |
| | <p class="text-sm">Invoice #1018 is overdue</p> |
| | <p class="text-xs text-gray-500">Client: XYZ Ltd</p> |
| | </div> |
| | </div> |
| | </a> |
| | </div> |
| | <div class="p-3 border-t border-gray-200 text-center"> |
| | <a href="#" class="text-sm text-indigo-600 hover:underline">View all notifications</a> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| | </header> |
| |
|
| | |
| | <main class="p-4"> |
| | |
| | <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6"> |
| | <div class="bg-white rounded-lg shadow p-4"> |
| | <div class="flex justify-between items-start"> |
| | <div> |
| | <p class="text-sm text-gray-500">Total Expenses</p> |
| | <h3 class="text-2xl font-bold" id="totalExpenses">$2,450.00</h3> |
| | </div> |
| | <div class="p-2 rounded-lg bg-indigo-100 text-indigo-600"> |
| | <i class="fas fa-receipt"></i> |
| | </div> |
| | </div> |
| | <p class="text-xs text-gray-500 mt-2">+12% from last month</p> |
| | </div> |
| | |
| | <div class="bg-white rounded-lg shadow p-4"> |
| | <div class="flex justify-between items-start"> |
| | <div> |
| | <p class="text-sm text-gray-500">Total Invoices</p> |
| | <h3 class="text-2xl font-bold" id="totalInvoices">$5,780.00</h3> |
| | </div> |
| | <div class="p-2 rounded-lg bg-green-100 text-green-600"> |
| | <i class="fas fa-file-invoice-dollar"></i> |
| | </div> |
| | </div> |
| | <p class="text-xs text-gray-500 mt-2">3 unpaid invoices</p> |
| | </div> |
| | |
| | <div class="bg-white rounded-lg shadow p-4"> |
| | <div class="flex justify-between items-start"> |
| | <div> |
| | <p class="text-sm text-gray-500">USD Balance</p> |
| | <h3 class="text-2xl font-bold">$3,330.00</h3> |
| | </div> |
| | <div class="p-2 rounded-lg bg-blue-100 text-blue-600"> |
| | <i class="fas fa-dollar-sign"></i> |
| | </div> |
| | </div> |
| | <p class="text-xs text-gray-500 mt-2">Equivalent to TSh 7,728,000</p> |
| | </div> |
| | |
| | <div class="bg-white rounded-lg shadow p-4"> |
| | <div class="flex justify-between items-start"> |
| | <div> |
| | <p class="text-sm text-gray-500">TSh Balance</p> |
| | <h3 class="text-2xl font-bold">TSh 1,250,000</h3> |
| | </div> |
| | <div class="p-2 rounded-lg bg-yellow-100 text-yellow-600"> |
| | <i class="fas fa-money-bill-wave"></i> |
| | </div> |
| | </div> |
| | <p class="text-xs text-gray-500 mt-2">Equivalent to $540.00</p> |
| | </div> |
| | </div> |
| |
|
| | |
| | <div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6"> |
| | |
| | <div class="bg-white rounded-lg shadow p-4"> |
| | <div class="flex justify-between items-center mb-4"> |
| | <h2 class="font-medium">Expenses by Category</h2> |
| | <select class="text-sm border border-gray-200 rounded px-2 py-1"> |
| | <option>This Month</option> |
| | <option>Last Month</option> |
| | <option>This Quarter</option> |
| | <option>This Year</option> |
| | </select> |
| | </div> |
| | <div class="h-64"> |
| | <canvas id="expenseChart"></canvas> |
| | </div> |
| | </div> |
| | |
| | |
| | <div class="bg-white rounded-lg shadow p-4"> |
| | <div class="flex justify-between items-center mb-4"> |
| | <h2 class="font-medium">Invoice Status</h2> |
| | <select class="text-sm border border-gray-200 rounded px-2 py-1"> |
| | <option>All Time</option> |
| | <option>This Year</option> |
| | <option>This Quarter</option> |
| | </select> |
| | </div> |
| | <div class="h-64"> |
| | <canvas id="invoiceChart"></canvas> |
| | </div> |
| | </div> |
| | </div> |
| |
|
| | |
| | <div class="grid grid-cols-1 lg:grid-cols-3 gap-6"> |
| | |
| | <div class="bg-white rounded-lg shadow p-4"> |
| | <div class="flex justify-between items-center mb-4"> |
| | <h2 class="font-medium">Recent Expenses</h2> |
| | <button class="text-sm text-indigo-600 hover:underline">View All</button> |
| | </div> |
| | |
| | <div class="space-y-4"> |
| | <div class="flex items-start"> |
| | <div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center mr-3"> |
| | <i class="fas fa-plane text-purple-500"></i> |
| | </div> |
| | <div class="flex-1"> |
| | <div class="flex justify-between"> |
| | <h3 class="font-medium">Business Travel</h3> |
| | <span class="font-medium">$450.00</span> |
| | </div> |
| | <p class="text-sm text-gray-500">Delta Airlines • 12 Jun 2023</p> |
| | </div> |
| | </div> |
| | |
| | <div class="flex items-start"> |
| | <div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center mr-3"> |
| | <i class="fas fa-laptop text-blue-500"></i> |
| | </div> |
| | <div class="flex-1"> |
| | <div class="flex justify-between"> |
| | <h3 class="font-medium">Office Equipment</h3> |
| | <span class="font-medium">$1,200.00</span> |
| | </div> |
| | <p class="text-sm text-gray-500">Tech Solutions • 10 Jun 2023</p> |
| | </div> |
| | </div> |
| | |
| | <div class="flex items-start"> |
| | <div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center mr-3"> |
| | <i class="fas fa-utensils text-green-500"></i> |
| | </div> |
| | <div class="flex-1"> |
| | <div class="flex justify-between"> |
| | <h3 class="font-medium">Client Meeting</h3> |
| | <span class="font-medium">TSh 120,000</span> |
| | </div> |
| | <p class="text-sm text-gray-500">Serengeti Restaurant • 8 Jun 2023</p> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | <button class="mt-4 w-full py-2 border border-dashed border-gray-300 rounded-lg text-sm text-gray-500 hover:bg-gray-50"> |
| | <i class="fas fa-plus mr-1"></i> Add Expense |
| | </button> |
| | </div> |
| | |
| | |
| | <div class="bg-white rounded-lg shadow p-4"> |
| | <div class="flex justify-between items-center mb-4"> |
| | <h2 class="font-medium">Recent Invoices</h2> |
| | <button class="text-sm text-indigo-600 hover:underline">View All</button> |
| | </div> |
| | |
| | <div class="space-y-4"> |
| | <div class="border-b border-gray-100 pb-4"> |
| | <div class="flex justify-between items-start"> |
| | <div> |
| | <h3 class="font-medium">#1023 - ABC Corp</h3> |
| | <p class="text-sm text-gray-500">Due 15 Jun 2023</p> |
| | </div> |
| | <span class="font-medium">$1,800.00</span> |
| | </div> |
| | <div class="mt-2 flex justify-between items-center"> |
| | <span class="px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded-full">Sent</span> |
| | <button class="text-xs text-indigo-600 hover:underline">View</button> |
| | </div> |
| | </div> |
| | |
| | <div class="border-b border-gray-100 pb-4"> |
| | <div class="flex justify-between items-start"> |
| | <div> |
| | <h3 class="font-medium">#1022 - XYZ Ltd</h3> |
| | <p class="text-sm text-gray-500">Due 5 Jun 2023</p> |
| | </div> |
| | <span class="font-medium">TSh 2,500,000</span> |
| | </div> |
| | <div class="mt-2 flex justify-between items-center"> |
| | <span class="px-2 py-1 bg-yellow-100 text-yellow-800 text-xs rounded-full">Overdue</span> |
| | <button class="text-xs text-indigo-600 hover:underline">View</button> |
| | </div> |
| | </div> |
| | |
| | <div class="pb-2"> |
| | <div class="flex justify-between items-start"> |
| | <div> |
| | <h3 class="font-medium">#1021 - Global Tech</h3> |
| | <p class="text-sm text-gray-500">Paid 1 Jun 2023</p> |
| | </div> |
| | <span class="font-medium">$2,480.00</span> |
| | </div> |
| | <div class="mt-2 flex justify-between items-center"> |
| | <span class="px-2 py-1 bg-green-100 text-green-800 text-xs rounded-full">Paid</span> |
| | <button class="text-xs text-indigo-600 hover:underline">View</button> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | <button class="mt-4 w-full py-2 border border-dashed border-gray-300 rounded-lg text-sm text-gray-500 hover:bg-gray-50"> |
| | <i class="fas fa-plus mr-1"></i> Create Invoice |
| | </button> |
| | </div> |
| | |
| | |
| | <div class="bg-white rounded-lg shadow p-4"> |
| | <h2 class="font-medium mb-4">Quick Actions</h2> |
| | |
| | <div class="grid grid-cols-2 gap-3"> |
| | <button class="flex flex-col items-center justify-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50"> |
| | <div class="w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center mb-2 text-indigo-600"> |
| | <i class="fas fa-receipt"></i> |
| | </div> |
| | <span class="text-sm">Add Expense</span> |
| | </button> |
| | |
| | <button class="flex flex-col items-center justify-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50"> |
| | <div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center mb-2 text-green-600"> |
| | <i class="fas fa-file-invoice-dollar"></i> |
| | </div> |
| | <span class="text-sm">Create Invoice</span> |
| | </button> |
| | |
| | <button class="flex flex-col items-center justify-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50"> |
| | <div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center mb-2 text-blue-600"> |
| | <i class="fas fa-user-plus"></i> |
| | </div> |
| | <span class="text-sm">Add Client</span> |
| | </button> |
| | |
| | <button class="flex flex-col items-center justify-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50"> |
| | <div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center mb-2 text-purple-600"> |
| | <i class="fas fa-file-export"></i> |
| | </div> |
| | <span class="text-sm">Export Data</span> |
| | </button> |
| | |
| | <button class="flex flex-col items-center justify-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50"> |
| | <div class="w-10 h-10 rounded-full bg-yellow-100 flex items-center justify-center mb-2 text-yellow-600"> |
| | <i class="fas fa-exchange-alt"></i> |
| | </div> |
| | <span class="text-sm">Currency Exchange</span> |
| | </button> |
| | |
| | <button class="flex flex-col items-center justify-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50"> |
| | <div class="w-10 h-10 rounded-full bg-red-100 flex items-center justify-center mb-2 text-red-600"> |
| | <i class="fas fa-envelope"></i> |
| | </div> |
| | <span class="text-sm">Send Reminders</span> |
| | </button> |
| | </div> |
| | </div> |
| | </div> |
| |
|
| | |
| | <div id="expenseModal" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4"> |
| | <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] overflow-y-auto"> |
| | <div class="p-4 border-b border-gray-200 flex justify-between items-center"> |
| | <h3 class="text-lg font-medium">Add New Expense</h3> |
| | <button id="closeExpenseModal" class="text-gray-500 hover:text-gray-700"> |
| | <i class="fas fa-times"></i> |
| | </button> |
| | </div> |
| | |
| | <div class="p-4"> |
| | <form> |
| | <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"> |
| | <div> |
| | <label class="block text-sm font-medium text-gray-700 mb-1">Date</label> |
| | <input type="date" class="w-full border border-gray-300 rounded-md px-3 py-2"> |
| | </div> |
| | |
| | <div> |
| | <label class="block text-sm font-medium text-gray-700 mb-1">Vendor</label> |
| | <input type="text" placeholder="Vendor name" class="w-full border border-gray-300 rounded-md px-3 py-2"> |
| | </div> |
| | |
| | <div> |
| | <label class="block text-sm font-medium text-gray-700 mb-1">Category</label> |
| | <select class="w-full border border-gray-300 rounded-md px-3 py-2"> |
| | <option value="">Select category</option> |
| | <option>Travel</option> |
| | <option>Office Supplies</option> |
| | <option>Meals</option> |
| | <option>Equipment</option> |
| | <option>Utilities</option> |
| | <option>Other</option> |
| | </select> |
| | </div> |
| | |
| | <div> |
| | <label class="block text-sm font-medium text-gray-700 mb-1">Project/Tag</label> |
| | <input type="text" placeholder="Optional project or tag" class="w-full border border-gray-300 rounded-md px-3 py-2"> |
| | </div> |
| | |
| | <div> |
| | <label class="block text-sm font-medium text-gray-700 mb-1">Amount</label> |
| | <div class="flex"> |
| | <select class="border border-gray-300 rounded-l-md px-3 py-2 bg-gray-100"> |
| | <option>USD</option> |
| | <option>TSh</option> |
| | </select> |
| | <input type="number" placeholder="0.00" class="flex-1 border border-gray-300 rounded-r-md px-3 py-2 border-l-0"> |
| | </div> |
| | </div> |
| | |
| | <div> |
| | <label class="block text-sm font-medium text-gray-700 mb-1">Payment Method</label> |
| | <select class="w-full border border-gray-300 rounded-md px-3 py-2"> |
| | <option>Cash</option> |
| | <option>Credit Card</option> |
| | <option>Bank Transfer</option> |
| | <option>Mobile Payment</option> |
| | </select> |
| | </div> |
| | </div> |
| | |
| | <div class="mb-4"> |
| | <label class="block text-sm font-medium text-gray-700 mb-1">Description</label> |
| | <textarea rows="3" placeholder="Add any details about this expense" class="w-full border border-gray-300 rounded-md px-3 py-2"></textarea> |
| | </div> |
| | |
| | <div class="mb-6"> |
| | <label class="block text-sm font-medium text-gray-700 mb-1">Receipt</label> |
| | <div class="flex items-center justify-center w-full"> |
| | <label for="receiptUpload" class="flex flex-col items-center justify-center w-full h-32 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 hover:bg-gray-100"> |
| | <div class="flex flex-col items-center justify-center pt-5 pb-6"> |
| | <i class="fas fa-cloud-upload-alt text-gray-400 mb-2 text-2xl"></i> |
| | <p class="mb-2 text-sm text-gray-500">Click to upload or drag and drop</p> |
| | <p class="text-xs text-gray-500">PNG, JPG, PDF (MAX. 5MB)</p> |
| | </div> |
| | <input id="receiptUpload" type="file" class="hidden" /> |
| | </label> |
| | </div> |
| | <div id="receiptPreview" class="mt-2 hidden"> |
| | <img id="previewImage" src="#" alt="Receipt preview" class="receipt-preview mx-auto"> |
| | <button id="removeReceipt" class="mt-2 text-sm text-red-600 hover:underline">Remove receipt</button> |
| | </div> |
| | </div> |
| | |
| | <div class="flex justify-end space-x-3"> |
| | <button type="button" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50">Cancel</button> |
| | <button type="submit" class="px-4 py-2 bg-indigo-600 rounded-md text-sm font-medium text-white hover:bg-indigo-700">Save Expense</button> |
| | </div> |
| | </form> |
| | </div> |
| | </div> |
| | </div> |
| | </main> |
| | </div> |
| |
|
| | <script> |
| | |
| | document.getElementById('mobileMenuButton').addEventListener('click', function() { |
| | document.getElementById('sidebar').classList.toggle('active'); |
| | }); |
| | |
| | |
| | document.getElementById('notificationsButton').addEventListener('click', function(e) { |
| | e.stopPropagation(); |
| | document.getElementById('notificationsDropdown').classList.toggle('hidden'); |
| | }); |
| | |
| | |
| | document.addEventListener('click', function() { |
| | document.getElementById('notificationsDropdown').classList.add('hidden'); |
| | }); |
| | |
| | |
| | document.getElementById('usdToggle').addEventListener('click', function() { |
| | document.getElementById('usdToggle').classList.add('active'); |
| | document.getElementById('tshToggle').classList.remove('active'); |
| | document.getElementById('totalExpenses').textContent = '$2,450.00'; |
| | document.getElementById('totalInvoices').textContent = '$5,780.00'; |
| | }); |
| | |
| | document.getElementById('tshToggle').addEventListener('click', function() { |
| | document.getElementById('tshToggle').classList.add('active'); |
| | document.getElementById('usdToggle').classList.remove('active'); |
| | document.getElementById('totalExpenses').textContent = 'TSh 5,684,000'; |
| | document.getElementById('totalInvoices').textContent = 'TSh 13,410,400'; |
| | }); |
| | |
| | |
| | document.getElementById('receiptUpload').addEventListener('change', function(e) { |
| | const file = e.target.files[0]; |
| | if (file) { |
| | const reader = new FileReader(); |
| | reader.onload = function(event) { |
| | document.getElementById('previewImage').src = event.target.result; |
| | document.getElementById('receiptPreview').classList.remove('hidden'); |
| | }; |
| | reader.readAsDataURL(file); |
| | } |
| | }); |
| | |
| | document.getElementById('removeReceipt').addEventListener('click', function() { |
| | document.getElementById('receiptUpload').value = ''; |
| | document.getElementById('receiptPreview').classList.add('hidden'); |
| | }); |
| | |
| | |
| | document.querySelectorAll('button').forEach(button => { |
| | if (button.textContent.includes('Add Expense')) { |
| | button.addEventListener('click', function() { |
| | document.getElementById('expenseModal').classList.remove('hidden'); |
| | }); |
| | } |
| | }); |
| | |
| | document.getElementById('closeExpenseModal').addEventListener('click', function() { |
| | document.getElementById('expenseModal').classList.add('hidden'); |
| | }); |
| | |
| | |
| | document.getElementById('expenseModal').addEventListener('click', function(e) { |
| | if (e.target === this) { |
| | this.classList.add('hidden'); |
| | } |
| | }); |
| | |
| | |
| | document.addEventListener('DOMContentLoaded', function() { |
| | |
| | const expenseCtx = document.getElementById('expenseChart').getContext('2d'); |
| | const expenseChart = new Chart(expenseCtx, { |
| | type: 'doughnut', |
| | data: { |
| | labels: ['Travel', 'Office Supplies', 'Meals', 'Equipment', 'Utilities'], |
| | datasets: [{ |
| | data: [650, 1200, 350, 1800, 250], |
| | backgroundColor: [ |
| | '#6366f1', |
| | '#10b981', |
| | '#f59e0b', |
| | '#8b5cf6', |
| | '#3b82f6' |
| | ], |
| | borderWidth: 0 |
| | }] |
| | }, |
| | options: { |
| | responsive: true, |
| | maintainAspectRatio: false, |
| | plugins: { |
| | legend: { |
| | position: 'right' |
| | } |
| | } |
| | } |
| | }); |
| | |
| | |
| | const invoiceCtx = document.getElementById('invoiceChart').getContext('2d'); |
| | const invoiceChart = new Chart(invoiceCtx, { |
| | type: 'bar', |
| | data: { |
| | labels: ['Draft', 'Sent', 'Paid', 'Overdue'], |
| | datasets: [{ |
| | label: 'USD', |
| | data: [1200, 2800, 4500, 800], |
| | backgroundColor: '#4f46e5' |
| | }, { |
| | label: 'TSh', |
| | data: [0, 2500000, 3800000, 1200000], |
| | backgroundColor: '#10b981' |
| | }] |
| | }, |
| | options: { |
| | responsive: true, |
| | maintainAspectRatio: false, |
| | scales: { |
| | x: { |
| | stacked: false |
| | }, |
| | y: { |
| | stacked: false, |
| | ticks: { |
| | callback: function(value) { |
| | if (value >= 1000000) { |
| | return 'TSh ' + (value / 1000000) + 'M'; |
| | } else if (value >= 1000) { |
| | return '$' + (value / 1000) + 'K'; |
| | } |
| | return value; |
| | } |
| | } |
| | } |
| | }, |
| | plugins: { |
| | tooltip: { |
| | callbacks: { |
| | label: function(context) { |
| | let label = context.dataset.label || ''; |
| | if (label) { |
| | label += ': '; |
| | } |
| | if (context.dataset.label === 'USD') { |
| | label += '$' + context.raw.toLocaleString(); |
| | } else { |
| | label += 'TSh ' + context.raw.toLocaleString(); |
| | } |
| | return label; |
| | } |
| | } |
| | } |
| | } |
| | } |
| | }); |
| | }); |
| | </script> |
| | <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=damani14/expense" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> |
| | </html> |