<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Marketing Investment Management System</title>
<!-- Tailwind CSS via CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Chart.js -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- Font Awesome for Icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" />
<style>
body {
font-family: 'Inter', sans-serif;
background-color: #f8fafc;
}
.sidebar-link.active {
@apply bg-blue-50 border-r-2 border-blue-500 text-blue-700;
}
.tab-button.active {
@apply border-b-2 border-blue-500 text-blue-700 font-medium;
}
.chart-container {
position: relative;
height: 300px;
width: 100%;
}
.modal {
display: none;
position: fixed;
z-index: 50;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0,0,0,0.4);
}
.tooltip {
position: relative;
display: inline-block;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 200px;
background-color: #374151;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 8px;
position: absolute;
z-index: 100;
bottom: 125%;
left: 50%;
margin-left: -100px;
opacity: 0;
transition: opacity 0.3s;
font-size: 0.875rem;
}
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
@media print {
.no-print, .no-print * {
display: none !important;
}
.print-only {
display: block !important;
}
}
</style>
</head>
<body class="bg-gray-50 text-gray-800">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="w-64 bg-white shadow-lg flex flex-col no-print">
<div class="p-6 border-b border-gray-200">
<h1 class="text-xl font-bold text-blue-700">Marketing Investment</h1>
<p class="text-sm text-gray-500">Management System</p>
</div>
<nav class="flex-1 p-4 space-y-2">
<a href="#" data-page="dashboard" class="sidebar-link active block px-4 py-3 rounded-lg text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition">
<i class="fas fa-tachometer-alt mr-3"></i> Dashboard
</a>
<a href="#" data-page="investments" class="sidebar-link block px-4 py-3 rounded-lg text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition">
<i class="fas fa-coins mr-3"></i> Investments
</a>
<a href="#" data-page="invoices" class="sidebar-link block px-4 py-3 rounded-lg text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition">
<i class="fas fa-file-invoice-dollar mr-3"></i> Invoice Processing
</a>
<a href="#" data-page="internal-orders" class="sidebar-link block px-4 py-3 rounded-lg text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition">
<i class="fas fa-tasks mr-3"></i> Internal Orders
</a>
<a href="#" data-page="budget" class="sidebar-link block px-4 py-3 rounded-lg text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition">
<i class="fas fa-chart-pie mr-3"></i> Budget Management
</a>
<a href="#" data-page="admin" class="sidebar-link block px-4 py-3 rounded-lg text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition">
<i class="fas fa-cogs mr-3"></i> Admin & Reference
</a>
</nav>
<div class="p-4 border-t border-gray-200 text-sm text-gray-500">
<p>Version 1.0</p>
<p class="mt-1">User: <strong>Manager</strong></p>
</div>
</div>
<!-- Main Content -->
<div class="flex-1 flex flex-col overflow-hidden">
<!-- Header -->
<header class="bg-white shadow-sm p-4 border-b flex justify-between items-center no-print">
<div class="flex items-center space-x-4">
<button id="sidebar-toggle" class="lg:hidden text-gray-600">
<i class="fas fa-bars"></i>
</button>
<nav class="text-sm text-gray-500 print-only hidden">
<span id="breadcrumb">Dashboard</span>
</nav>
</div>
<div class="flex items-center space-x-4">
<div class="relative">
<input type="text" placeholder="Search..." class="pl-10 pr-4 py-2 border rounded-lg w-64 focus:outline-none focus:ring-2 focus:ring-blue-500" />
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
<button class="text-gray-600 hover:text-gray-800">
<i class="far fa-bell"></i>
</button>
<div class="w-8 h-8 bg-blue-600 rounded-full flex items-center justify-center text-white text-sm font-medium">
M
</div>
</div>
</header>
<!-- Page Content -->
<main id="main-content" class="flex-1 overflow-y-auto p-6 bg-gray-50">
<!-- Dashboard -->
<div id="dashboard" class="page-content">
<div class="mb-6">
<h2 class="text-2xl font-semibold text-gray-800">Dashboard</h2>
<p class="text-gray-600 mt-1">Welcome back, Marketing Manager</p>
</div>
<!-- KPI Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
<div class="bg-white p-6 rounded-lg shadow hover:shadow-md transition">
<div class="flex items-center">
<div class="p-3 rounded-full bg-blue-100 text-blue-600">
<i class="fas fa-coins text-xl"></i>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-600">Total Investments</p>
<p class="text-2xl font-bold text-gray-800">$22,816.50</p>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow hover:shadow-md transition">
<div class="flex items-center">
<div class="p-3 rounded-full bg-green-100 text-green-600">
<i class="fas fa-percentage text-xl"></i>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-600">Budget Utilization</p>
<p class="text-2xl font-bold text-gray-800">68%</p>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow hover:shadow-md transition">
<div class="flex items-center">
<div class="p-3 rounded-full bg-yellow-100 text-yellow-600">
<i class="fas fa-clock text-xl"></i>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-600">Pending Invoices</p>
<p class="text-2xl font-bold text-gray-800">3</p>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow hover:shadow-md transition">
<div class="flex items-center">
<div class="p-3 rounded-full bg-purple-100 text-purple-600">
<i class="fas fa-chart-line text-xl"></i>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-600">YTD Spending</p>
<p class="text-2xl font-bold text-gray-800">$143,000</p>
</div>
</div>
</div>
</div>
<!-- Charts -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8">
<!-- Monthly Trends -->
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="text-lg font-semibold mb-4">Monthly Investment Trends</h3>
<div class="chart-container">
<canvas id="monthlyChart"></canvas>
</div>
</div>
<!-- Budget vs Actual -->
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="text-lg font-semibold mb-4">Budget vs Actual Spending</h3>
<div class="chart-container">
<canvas id="budgetChart"></canvas>
</div>
</div>
</div>
<!-- Recent Activity & Quick Actions -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<!-- Recent Activity -->
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="text-lg font-semibold mb-4">Recent Activity</h3>
<div class="space-y-4">
<div class="flex items-center">
<div class="w-2 h-2 bg-green-500 rounded-full mr-3"></div>
<div class="flex-1">
<p class="text-sm font-medium">Invoice approved: #377117394</p>
<p class="text-xs text-gray-500">26 Feb 2025</p>
</div>
</div>
<div class="flex items-center">
<div class="w-2 h-2 bg-blue-500 rounded-full mr-3"></div>
<div class="flex-1">
<p class="text-sm font-medium">Investment created: Chicco Pacifier</p>
<p class="text-xs text-gray-500">1 Feb 2025</p>
</div>
</div>
<div class="flex items-center">
<div class="w-2 h-2 bg-purple-500 rounded-full mr-3"></div>
<div class="flex-1">
<p class="text-sm font-medium">Posted to SAP: #50C/3530</p>
<p class="text-xs text-gray-500">1 Apr 2025</p>
</div>
</div>
</div>
</div>
<!-- Quick Actions -->
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="text-lg font-semibold mb-4">Quick Actions</h3>
<div class="grid grid-cols-2 gap-4">
<button id="add-investment-btn" class="bg-blue-600 text-white py-3 rounded-lg hover:bg-blue-700 transition flex flex-col items-center">
<i class="fas fa-plus-circle text-xl mb-1"></i>
<span class="text-sm">Add Investment</span>
</button>
<button id="process-invoices-btn" class="bg-green-600 text-white py-3 rounded-lg hover:bg-green-700 transition flex flex-col items-center">
<i class="fas fa-file-invoice-dollar text-xl mb-1"></i>
<span class="text-sm">Process Invoices</span>
</button>
<button class="bg-purple-600 text-white py-3 rounded-lg hover:bg-purple-700 transition flex flex-col items-center">
<i class="fas fa-chart-bar text-xl mb-1"></i>
<span class="text-sm">View Reports</span>
</button>
<button class="bg-gray-600 text-white py-3 rounded-lg hover:bg-gray-700 transition flex flex-col items-center">
<i class="fas fa-sync-alt text-xl mb-1"></i>
<span class="text-sm">Reconcile SAP</span>
</button>
</div>
</div>
</div>
</div>
<!-- Investments -->
<div id="investments" class="page-content hidden">
<div class="mb-6">
<h2 class="text-2xl font-semibold text-gray-800">Investments Management</h2>
<p class="text-gray-600 mt-1">Manage marketing investments and campaign funding</p>
</div>
<!-- Filters and Actions -->
<div class="bg-white p-4 rounded-lg shadow mb-6">
<div class="flex flex-wrap gap-4 mb-4">
<div class="flex-1 min-w-48">
<label class="block text-sm font-medium text-gray-700 mb-1">Date Range</label>
<input type="date" class="border rounded-lg px-3 py-2 w-full text-sm" />
</div>
<div class="flex-1 min-w-48">
<label class="block text-sm font-medium text-gray-700 mb-1">Business Unit</label>
<select class="border rounded-lg px-3 py-2 w-full text-sm">
<option>All</option>
<option>Baby Care</option>
<option>Marketing</option>
</select>
</div>
<div class="flex-1 min-w-48">
<label class="block text-sm font-medium text-gray-700 mb-1">Brand</label>
<select class="border rounded-lg px-3 py-2 w-full text-sm">
<option>All</option>
<option>Chicco</option>
</select>
</div>
<div class="flex-1 min-w-48">
<label class="block text-sm font-medium text-gray-700 mb-1">Status</label>
<select class="border rounded-lg px-3 py-2 w-full text-sm">
<option>All</option>
<option>Accrual</option>
<option>Posted</option>
</select>
</div>
</div>
<div class="flex justify-between">
<button id="filter-btn" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition text-sm">
<i class="fas fa-filter mr-2"></i> Apply Filters
</button>
<button id="new-investment-btn" class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition text-sm">
<i class="fas fa-plus mr-2"></i> Add Investment
</button>
</div>
</div>
<!-- Investment Table -->
<div class="bg-white rounded-lg shadow overflow-hidden">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100">Description</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100">Amount</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100">Campaign Period</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100">PO</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100">Status</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody id="investment-table-body" class="bg-white divide-y divide-gray-200">
<!-- Filled by JS -->
</tbody>
</table>
</div>
<div class="px-6 py-3 bg-gray-50 flex justify-between items-center text-sm">
<div>Showing 1 to 2 of 2 entries</div>
<div class="flex space-x-1">
<button class="px-3 py-1 border rounded hover:bg-gray-100 disabled:opacity-50">Previous</button>
<button class="px-3 py-1 border rounded hover:bg-gray-100 bg-blue-50 text-blue-700">1</button>
<button class="px-3 py-1 border rounded hover:bg-gray-100 disabled:opacity-50">Next</button>
</div>
</div>
</div>
</div>
<!-- Invoices -->
<div id="invoices" class="page-content hidden">
<div class="mb-6">
<h2 class="text-2xl font-semibold text-gray-800">Invoice Processing</h2>
<p class="text-gray-600 mt-1">Review and process marketing invoices</p>
</div>
<div class="bg-white p-4 rounded-lg shadow mb-6">
<div class="flex flex-wrap gap-4 mb-4">
<div class="flex-1 min-w-48">
<label class="block text-sm font-medium text-gray-700 mb-1">Status</label>
<select class="border rounded-lg px-3 py-2 w-full text-sm">
<option>All</option>
<option>Pending</option>
<option>Approved</option>
<option>Posted to SAP</option>
</select>
</div>
<div class="flex-1 min-w-48">
<label class="block text-sm font-medium text-gray-700 mb-1">Supplier</label>
<input type="text" placeholder="Search supplier..." class="border rounded-lg px-3 py-2 w-full text-sm" />
</div>
<div class="flex-1 min-w-48">
<label class="block text-sm font-medium text-gray-700 mb-1">Date</label>
<input type="date" class="border rounded-lg px-3 py-2 w-full text-sm" />
</div>
</div>
<div class="flex justify-between">
<button class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition text-sm">
<i class="fas fa-search mr-2"></i> Search
</button>
<div class="space-x-2">
<button class="bg-gray-600 text-white px-4 py-2 rounded-lg hover:bg-gray-700 transition text-sm">
<i class="fas fa-file-import mr-2"></i> Import XML
</button>
<button class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition text-sm">
<i class="fas fa-upload mr-2"></i> Process Batch
</button>
</div>
</div>
</div>
<!-- Invoice Table -->
<div class="bg-white rounded-lg shadow overflow-hidden">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Invoice #</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Supplier</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody id="invoice-table-body">
<!-- Filled by JS -->
</tbody>
</table>
</div>
</div>
</div>
<!-- Internal Orders -->
<div id="internal-orders" class="page-content hidden">
<div class="mb-6">
<h2 class="text-2xl font-semibold text-gray-800">Internal Orders</h2>
<p class="text-gray-600 mt-1">Manage internal order codes for cost tracking</p>
</div>
<!-- Import Section -->
<div class="bg-white p-6 rounded-lg shadow mb-6">
<h3 class="text-lg font-medium mb-4">Bulk Import</h3>
<div class="border-2 border-dashed border-gray-300 rounded-lg p-8 text-center">
<i class="fas fa-file-csv text-4xl text-gray-400 mb-3"></i>
<p class="text-gray-600 mb-2">Drag & drop CSV file here</p>
<p class="text-sm text-gray-500 mb-4">or click to browse</p>
<input type="file" id="csv-upload" accept=".csv" class="hidden" />
<button onclick="document.getElementById('csv-upload').click()" class="bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition">
Choose File
</button>
</div>
<div id="validation-results" class="mt-4 hidden">
<h4 class="font-medium text-gray-700 mb-2">Validation Results</h4>
<div class="bg-green-50 border border-green-200 rounded p-3 text-sm text-green-700">
<i class="fas fa-check-circle mr-2"></i> 15 records validated successfully
</div>
</div>
</div>
<!-- Orders Table -->
<div class="bg-white rounded-lg shadow">
<div class="p-4 border-b flex justify-between items-center">
<h3 class="text-lg font-medium">Internal Orders List</h3>
<button class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition text-sm">
<i class="fas fa-plus mr-2"></i> Add Order
</button>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Order Code</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Description</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Business Unit</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">IO-001</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">Digital Marketing Campaign</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">Marketing</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
<button class="text-blue-600 hover:text-blue-800 mr-3"><i class="fas fa-edit"></i></button>
<button class="text-red-600 hover:text-red-800"><i class="fas fa-trash"></i></button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">IO-002</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">Product Launch Event</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">Baby Care</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
<button class="text-blue-600 hover:text-blue-800 mr-3"><i class="fas fa-edit"></i></button>
<button class="text-red-600 hover:text-red-800"><i class="fas fa-trash"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Budget Management -->
<div id="budget" class="page-content hidden">
<div class="mb-6">
<h2 class="text-2xl font-semibold text-gray-800">Budget Management</h2>
<p class="text-gray-600 mt-1">Track budget allocation and actual spending</p>
</div>
<!-- Budget Overview -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8">
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="text-lg font-medium mb-4">Annual Budget Overview</h3>
<div class="space-y-4">
<div>
<div class="flex justify-between text-sm mb-1">
<span>Budget: $600,000</span>
<span>Actual: $143,000</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2.5">
<div class="bg-blue-600 h-2.5 rounded-full" style="width: 24%"></div>
</div>
<p class="text-xs text-gray-500 mt-1">24% utilized</p>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="text-lg font-medium mb-4">By Business Unit</h3>
<div class="space-y-3">
<div>
<div class="flex justify-between text-sm">
<span>Baby Care</span>
<span>$42,000 / $200,000</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2.5 mt-1">
<div class="bg-green-500 h-2.5 rounded-full" style="width: 21%"></div>
</div>
</div>
<div>
<div class="flex justify-between text-sm">
<span>Marketing</span>
<span>$101,000 / $400,000</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2.5 mt-1">
<div class="bg-yellow-500 h-2.5 rounded-full" style="width: 25%"></div>
</div>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="text-lg font-medium mb-4">By Quarter</h3>
<div class="space-y-3">
<div>
<div class="flex justify-between text-sm">
<span>Q1</span>
<span>$143,000 / $150,000</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2.5 mt-1">
<div class="bg-green-500 h-2.5 rounded-full" style="width: 95%"></div>
</div>
</div>
<div>
<div class="flex justify-between text-sm">
<span>Q2</span>
<span>$0 / $150,000</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2.5 mt-1">
<div class="bg-gray-400 h-2.5 rounded-full" style="width: 0%"></div>
</div>
</div>
</div>
</div>
</div>
<!-- Variance Analysis -->
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="text-lg font-medium mb-4">Variance Analysis</h3>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Category</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Budget</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actual</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Variance</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm">Digital Advertising</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">$50,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">$45,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-600">-$5,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
<span class="px-2 py-1 text-xs rounded-full bg-green-100 text-green-700">Under Budget</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm">Events & Promotions</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">$30,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">$38,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-red-600">+$8,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
<span class="px-2 py-1 text-xs rounded-full bg-red-100 text-red-700">Over Budget</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm">Content Creation</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">$25,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">$20,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-600">-$5,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
<span class="px-2 py-1 text-xs rounded-full bg-green-100 text-green-700">Under Budget</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Admin / Reference Data -->
<div id="admin" class="page-content hidden">
<div class="mb-6">
<h2 class="text-2xl font-semibold text-gray-800">Admin & Reference Data</h2>
<p class="text-gray-600 mt-1">Manage system reference data</p>
</div>
<!-- Tabs -->
<div class="bg-white rounded-t-lg shadow mb-0">
<div class="border-b border-gray-200">
<nav class="flex space-x-8 px-6">
<button class="tab-button active py-4 px-1 border-b-2 font-medium text-sm">Business Units</button>
<button class="tab-button py-4 px-1 font-medium text-sm">Brands</button>
<button class="tab-button py-4 px-1 font-medium text-sm">Lines</button>
<button class="tab-button py-4 px-1 font-medium text-sm">Channels</button>
<button class="tab-button py-4 px-1 font-medium text-sm">ARCA Accounts</button>
</nav>
</div>
</div>
<div class="bg-white rounded-b-lg shadow">
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-medium">Business Units</h3>
<button class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition text-sm">
<i class="fas fa-plus mr-2"></i> Add Business Unit
</button>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Code</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Description</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">BC</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">Baby Care</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">Infant and child products</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
<button class="text-blue-600 hover:text-blue-800 mr-3"><i class="fas fa-edit"></i></button>
<button class="text-red-600 hover:text-red-800"><i class="fas fa-trash"></i></button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">MKT</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">Marketing</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">Corporate marketing activities</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
<button class="text-blue-600 hover:text-blue-800 mr-3"><i class="fas fa-edit"></i></button>
<button class="text-red-600 hover:text-red-800"><i class="fas fa-trash"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
<!-- Modals -->
<!-- Add/Edit Investment Modal -->
<div id="investment-modal" class="modal">
<div class="relative bg-white rounded-lg shadow-lg max-w-2xl w-full mx-4 my-8">
<div class="p-6">
<div class="flex justify-between items-center mb-6">
<h3 class="text-lg font-semibold">Add Investment</h3>
<button onclick="closeModal('investment-modal')" class="text-gray-400 hover:text-gray-600">
<i class="fas fa-times"></i>
</button>
</div>
<form id="investment-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">Description *</label>
<input type="text" required class="border rounded-lg px-3 py-2 w-full" placeholder="Campaign description" />
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Amount *</label>
<input type="number" required step="0.01" class="border rounded-lg px-3 py-2 w-full" placeholder="0.00" />
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Campaign Start *</label>
<input type="date" required class="border rounded-lg px-3 py-2 w-full" />
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Campaign End *</label>
<input type="date" required class="border rounded-lg px-3 py-2 w-full" />
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Purchase Order</label>
<input type="text" class="border rounded-lg px-3 py-2 w-full" placeholder="PO-XXXX-XXX" />
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Status *</label>
<select required class="border rounded-lg px-3 py-2 w-full">
<option>Accrual</option>
<option>Posted</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Business Unit *</label>
<select required class="border rounded-lg px-3 py-2 w-full">
<option>Baby Care</option>
<option>Marketing</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Brand *</label>
<select required class="border rounded-lg px-3 py-2 w-full">
<option>Chicco</option>
</select>
</div>
</div>
<div class="flex justify-end space-x-3 mt-6">
<button type="button" onclick="closeModal('investment-modal')" class="px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50">Cancel</button>
<button type="submit" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700">Save Investment</button>
</div>
</form>
</div>
</div>
</div>
<!-- Invoice Details Modal -->
<div id="invoice-modal" class="modal">
<div class="relative bg-white rounded-lg shadow-lg max-w-3xl w-full mx-4 my-8">
<div class="p-6">
<div class="flex justify-between items-center mb-6">
<h3 class="text-lg font-semibold">Invoice Details</h3>
<button onclick="closeModal('invoice-modal')" class="text-gray-400 hover:text-gray-600">
<i class="fas fa-times"></i>
</button>
</div>
<div class="grid grid-cols-2 gap-6 mb-6">
<div>
<h4 class="font-medium text-gray-700 mb-2">Invoice Information</h4>
<div class="space-y-2 text-sm">
<div class="flex justify-between">
<span class="text-gray-600">Invoice Number:</span>
<span>377117394</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Supplier:</span>
<span>24 DE JULHO RELACOES PUBLICAS</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Amount:</span>
<span>$18,296.25</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Date:</span>
<span>Feb 26, 2025</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Status:</span>
<span class="px-2 py-1 text-xs rounded-full bg-green-100 text-green-700">Approved</span>
</div>
</div>
</div>
<div>
<h4 class="font-medium text-gray-700 mb-2">Related Investment</h4>
<div class="space-y-2 text-sm">
<div class="flex justify-between">
<span class="text-gray-600">Description:</span>
<span>Chicco Pacifier Campaign 2025</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">PO Number:</span>
<span>PO-2025-001</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Campaign Period:</span>
<span>Feb 1 - Apr 30, 2025</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Business Unit:</span>
<span>Baby Care</span>
</div>
</div>
</div>
</div>
<div class="border-t pt-4">
<h4 class="font-medium text-gray-700 mb-3">Raw XML Data</h4>
<pre class="bg-gray-100 p-4 rounded text-xs overflow-auto max-h-40">
{
"invoice": {
"number": "377117394",
"supplier": "24 DE JULHO RELACOES PUBLICAS",
"amount": 18296.25,
"currency": "EUR",
"date": "2025-02-26",
"tax": 21,
"lines": [
{
"description": "Publicidade e Promoção",
"quantity": 1,
"unitPrice": 15122.52,
"total": 15122.52
}
]
}
}</pre>
</div>
<div class="flex justify-end space-x-3 mt-6">
<button class="text-blue-600 hover:text-blue-800 text-sm flex items-center">
<i class="fas fa-file-pdf mr-2"></i> View PDF
</button>
<button class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 text-sm">
<i class="fas fa-check mr-2"></i> Mark as Posted to SAP
</button>
</div>
</div>
</div>
</div>
<!-- Confirmation Modal -->
<div id="confirm-modal" class="modal">
<div class="relative bg-white rounded-lg shadow-lg max-w-md w-full mx-4 my-8">
<div class="p-6">
<div class="flex justify-center mb-4">
<div class="w-12 h-12 rounded-full bg-red-100 flex items-center justify-center">
<i class="fas fa-exclamation-triangle text-red-600"></i>
</div>
</div>
<h3 class="text-lg font-semibold text-center mb-2">Confirm Deletion</h3>
<p class="text-gray-600 text-center mb-6">Are you sure you want to delete this investment? This action cannot be undone.</p>
<div class="flex justify-end space-x-3">
<button onclick="closeModal('confirm-modal')" class="px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50">Cancel</button>
<button class="bg-red-600 text-white px-4 py-2 rounded-lg hover:bg-red-700">Delete</button>
</div>
</div>
</div>
</div>
<!-- Success Toast -->
<div id="toast-success" class="fixed bottom-4 right-4 bg-green-600 text-white px-6 py-3 rounded-lg shadow-lg flex items-center hidden z-50">
<i class="fas fa-check-circle mr-2"></i>
<span>Investment saved successfully!</span>
</div>
<!-- Script -->
<script>
// Sample Data
const sampleInvestments = [
{
id: 1,
description: "Chicco Pacifier Campaign 2025",
amount: 18296.25,
campaignStart: "2025-02-01",
campaignEnd: "2025-04-30",
purchaseOrder: "PO-2025-001",
status: "Accrual",
businessUnit: "Baby Care",
brand: "Chicco"
},
{
id: 2,
description: "Digital Marketing - Instagram Ads",
amount: 4520.25,
campaignStart: "2025-03-01",
campaignEnd: "2025-03-31",
purchaseOrder: "502501265",
status: "Posted",
businessUnit: "Marketing",
brand: "Chicco"
}
];
const sampleInvoices = [
{
id: 1,
invoiceNumber: "377117394",
supplier: "24 DE JULHO RELACOES PUBLICAS",
amount: 18296.25,
invoiceDate: "2025-02-26",
status: "Approved",
pdfLink: "e0dd9ccdd2a686eb5092badf1d750b6c.pdf"
},
{
id: 2,
invoiceNumber: "50C/3530",
supplier: "SCHEMA MAQUETAS E DESIGN LDA",
amount: 4520.25,
invoiceDate: "2025-04-01",
status: "Posted to SAP",
pdfLink: "0b3aa7768129e119f94897340d81b544.pdf"
}
];
const budgetData = [
{ month: "Jan", budget: 50000, actual: 45000 },
{ month: "Feb", budget: 55000, actual: 52000 },
{ month: "Mar", budget: 60000, actual: 48000 },
{ month: "Apr", budget: 52000, actual: 38000 }
];
// Navigation
document.querySelectorAll('[data-page]').forEach(link => {
link.addEventListener('click', (e) => {
e.preventDefault();
const page = e.target.closest('[data-page]').dataset.page;
showPage(page);
document.querySelector('.sidebar-link.active').classList.remove('active');
e.target.closest('[data-page]').classList.add('active');
document.getElementById('breadcrumb').textContent =
page.charAt(0).toUpperCase() + page.slice(1).replace('-', ' ');
});
});
function showPage(pageId) {
document.querySelectorAll('.page-content').forEach(page => {
page.classList.add('hidden');
});
document.getElementById(pageId).classList.remove('hidden');
}
// Modals
function openModal(id) {
document.getElementById(id).style.display = 'block';
}
function closeModal(id) {
document.getElementById(id).style.display = 'none';
}
// Close modals when clicking outside
window.onclick = function(event) {
const modals = document.getElementsByClassName('modal');
for (let i = 0; i < modals.length; i++) {
if (event.target == modals[i]) {
modals[i].style.display = "none";
}
}
}
// Populate tables
function populateInvestmentTable() {
const tbody = document.getElementById('investment-table-body');
tbody.innerHTML = '';
sampleInvestments.forEach(inv => {
const tr = document.createElement('tr');
tr.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">${inv.description}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">$${inv.amount.toFixed(2)}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">${formatDate(inv.campaignStart)} - ${formatDate(inv.campaignEnd)}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">${inv.purchaseOrder}</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full ${inv.status === 'Posted' ? 'bg-green-100 text-green-700' : 'bg-yellow-100 text-yellow-700'}">${inv.status}</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
<button onclick="openModal('investment-modal')" class="text-blue-600 hover:text-blue-800 mr-3" title="Edit"><i class="fas fa-edit"></i></button>
<button onclick="openModal('confirm-modal')" class="text-red-600 hover:text-red-800" title="Delete"><i class="fas fa-trash"></i></button>
<div class="tooltip inline-block ml-2">
<i class="fas fa-flag text-orange-500 cursor-help"></i>
<span class="tooltiptext">Flag for Deletion</span>
</div>
</td>
`;
tbody.appendChild(tr);
});
}
function populateInvoiceTable() {
const tbody = document.getElementById('invoice-table-body');
tbody.innerHTML = '';
sampleInvoices.forEach(inv => {
const tr = document.createElement('tr');
tr.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">${inv.invoiceNumber}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">${inv.supplier}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">$${inv.amount.toFixed(2)}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">${formatDate(inv.invoiceDate)}</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full
${inv.status === 'Approved' ? 'bg-green-100 text-green-700' :
inv.status === 'Posted to SAP' ? 'bg-blue-100 text-blue-700' :
'bg-yellow-100 text-yellow-700'}">${inv.status}</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
<button onclick="openModal('invoice-modal')" class="text-blue-600 hover:text-blue-800 mr-3" title="View PDF"><i class="fas fa-file-pdf"></i></button>
<button class="text-green-600 hover:text-green-800" title="Mark as Posted"><i class="fas fa-check"></i></button>
</td>
`;
tbody.appendChild(tr);
});
}
function formatDate(dateStr) {
const options = { year: 'numeric', month: 'short', day: 'numeric' };
return new Date(dateStr).toLocaleDateString(undefined, options);
}
// Charts
let monthlyChart, budgetChart;
function initCharts() {
// Monthly Trends Chart
const ctx1 = document.getElementById('monthlyChart').getContext('2d');
monthlyChart = new Chart(ctx1, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
datasets: [{
label: 'Investment Amount',
data: [45000, 52000, 48000, 38000, 0, 0],
borderColor: '#2563eb',
backgroundColor: 'rgba(37, 99, 235, 0.1)',
tension: 0.3,
fill: true
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'top',
}
},
scales: {
y: {
beginAtZero: true,
ticks: {
callback: function(value) {
return '$' + value.toLocaleString();
}
}
}
}
}
});
// Budget vs Actual Chart
const ctx2 = document.getElementById('budgetChart').getContext('2d');
budgetChart = new Chart(ctx2, {
type: 'bar',
data: {
labels: budgetData.map(d => d.month),
datasets: [
{
label: 'Budget',
data: budgetData.map(d => d.budget),
backgroundColor: 'rgba(75, 85, 99, 0.6)',
borderColor: 'rgba(75, 85, 99, 1)',
borderWidth: 1
},
{
label: 'Actual',
data: budgetData.map(d => d.actual),
backgroundColor: 'rgba(37, 99, 235, 0.6)',
borderColor: 'rgba(37, 99, 235, 1)',
borderWidth: 1
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'top',
}
},
scales: {
y: {
beginAtZero: true,
ticks: {
callback: function(value) {
return '$' + value.toLocaleString();
}
}
}
}
}
});
}
// Form Submissions
document.getElementById('investment-form').addEventListener('submit', function(e) {
e.preventDefault();
closeModal('investment-modal');
showToast('Investment saved successfully!');
});
function showToast(message) {
const toast = document.getElementById('toast-success');
toast.querySelector('span').textContent = message;
toast.classList.remove('hidden');
setTimeout(() => {
toast.classList.add('hidden');
}, 3000);
}
// Tab functionality
document.querySelectorAll('.tab-button').forEach(tab => {
tab.addEventListener('click', () => {
document.querySelectorAll('.tab-button').forEach(t => t.classList.remove('active'));
tab.classList.add('active');
});
});
// Button triggers
document.getElementById('add-investment-btn').addEventListener('click', () => {
openModal('investment-modal');
});
document.getElementById('new-investment-btn').addEventListener('click', () => {
openModal('investment-modal');
});
document.getElementById('process-invoices-btn').addEventListener('click', () => {
showPage('invoices');
document.querySelector('[data-page="invoices"]').classList.add('active');
document.querySelector('[data-page="dashboard"]').classList.remove('active');
});
// Initialize
document.addEventListener('DOMContentLoaded', function() {
populateInvestmentTable();
populateInvoiceTable();
initCharts();
// Set up CSV upload validation
document.getElementById('csv-upload').addEventListener('change', function(e) {
if (e.target.files.length > 0) {
document.getElementById('validation-results').classList.remove('hidden');
}
});
});
</script>
</body>
</html>