Wine Cellar Manager
About this app
Track your daily wine sales, expenses, inventory, and profit easily.
Wine Cellar Manager 🍷 Wine Cellar Manager Today’s Entry Add Entry 📊 Summary 📦 Inventory Update Inventory
Related apps
Put this on your site
Source
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Wine Cellar Manager</title>
<meta name="description" content="Track your daily wine sales, expenses, inventory, and profit easily.">
<meta name="keywords" content="wine, inventory, sales, profit, business, tracker">
<!-- Libraries -->
<!-- jQuery (3.6.0) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js" crossorigin="anonymous"></script>
<!-- Bootstrap CSS (5.3.3) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" crossorigin="anonymous">
<!-- Bootstrap JS (5.3.3) -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" crossorigin="anonymous"></script>
<!-- Font Awesome (6.6.0) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.6.0/css/fontawesome.min.css" crossorigin="anonymous">
<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.
const tracker = {
entries: [],
addEntry: function() {
const item = document.getElementById("item").value;
const qty = parseInt(document.getElementById("qty").value);
const price = parseFloat(document.getElementById("price").value);
const cost = parseFloat(document.getElementById("cost").value);
const expenses = parseFloat(document.getElementById("expenses").value);
if (!item || isNaN(qty) || isNaN(price) || isNaN(cost) || isNaN(expenses)) {
alert("Please fill in all fields correctly.");
return;
}
const totalSales = qty * price;
const totalCost = qty * cost;
const profit = totalSales - totalCost - expenses;
this.entries.push({ item, qty, price, totalSales, totalCost, expenses, profit });
this.updateReport();
this.clearInputFields();
},
updateReport: function() {
let reportHtml = "<ul class='list-group'>";
let totalProfit = 0;
this.entries.forEach(entry => {
reportHtml += `<li class='list-group-item'>${entry.item} - Sold: ${entry.qty}, Revenue: $${entry.totalSales.toFixed(2)}, Cost: $${entry.totalCost.toFixed(2)}, Expenses: $${entry.expenses.toFixed(2)}, Profit: $${entry.profit.toFixed(2)}</li>`;
totalProfit += entry.profit;
});
reportHtml += `<li class='list-group-item fw-bold'>Total Profit: $${totalProfit.toFixed(2)}</li></ul>`;
document.getElementById("report").innerHTML = reportHtml;
},
updateInventory: function() {
const inventoryInput = document.getElementById("inventoryList").value.split("\n");
const inventory = inventoryInput.map(line => {
const [wine, qty, cost, price] = line.split(",");
return { wine, qty: parseInt(qty), cost: parseFloat(cost), price: parseFloat(price) };
});
const summary = inventory.reduce((acc, item) => {
acc[item.wine] = acc[item.wine] || { qty: 0, cost: 0, price: 0 };
acc[item.wine].qty += item.qty;
acc[item.wine].cost += item.cost;
acc[item.wine].price += item.price;
return acc;
}, {});
console.log(summary);
alert("Inventory updated! Check the console for details.");
},
clearInputFields: function() {
document.getElementById("item").value = '';
document.getElementById("qty").value = '';
document.getElementById("price").value = '';
document.getElementById("cost").value = '';
document.getElementById("expenses").value = '';
}
};
// This will run when the DOM is ready.
document.addEventListener("DOMContentLoaded", function() {
});
} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>
<style>
body {
font-family: 'Playfair Display', serif;
background: linear-gradient(to right, #f8ea9f, #fc1b47);
color: #333;
}
.app {
max-width: 600px;
margin: 2rem auto;
padding: 1.5rem;
background: white;
border-radius: 1rem;
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
h1, h2 {
text-align: center;
color: #813b00;
}
.inputs, .summary, .inventory {
margin: 1rem 0;
}
input, textarea {
margin-bottom: 1rem;
padding: 0.75rem;
border-radius: 0.5rem;
border: 1px solid #ddd;
width: calc(100% - 16px);
}
button {
background-color: #28a745;
color: white;
border: none;
padding: 0.75rem;
width: 100%;
border-radius: 0.5rem;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #218838;
}
</style>
</head>
<body>
<div id="main-container" class="app">
<h1>🍷 Wine Cellar Manager</h1>
<section class="inputs">
<h2>Today’s Entry</h2>
<input id="item" placeholder="Wine Name" />
<input id="qty" type="number" placeholder="Quantity Sold" />
<input id="price" type="number" placeholder="Sale Price per Bottle" />
<input id="cost" type="number" placeholder="Cost per Bottle" />
<input id="expenses" type="number" placeholder="Other Expenses" />
<button onclick="tracker.addEntry()">Add Entry</button>
</section>
<section class="summary">
<h2>📊 Summary</h2>
<div id="report"></div>
</section>
<section class="inventory">
<h2>📦 Inventory</h2>
<textarea id="inventoryList" placeholder="Format: Wine,Qty,Cost,Price" rows="6"></textarea>
<button onclick="tracker.updateInventory()">Update Inventory</button>
</section>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!