Calculator Tools Calculator Tools
Create

Wine Cellar Manager

Jun 22, 2025

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">
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display&display=swap" rel="stylesheet" />

<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.

class WineTracker {
constructor() {
this.entries = [];
this.inventory = {};
}

addEntry() {
const item = document.getElementById('item').value.trim();
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 || 0);

if (!item || isNaN(qty) || isNaN(price) || isNaN(cost)) {
alert("Please fill all fields correctly.");
return;
}

const saleTotal = price * qty;
const costTotal = cost * qty;
const profit = saleTotal - costTotal - expenses;

this.entries.push({ item, qty, price, cost, expenses, profit });

if (this.inventory[item]) {
this.inventory[item].qty -= qty;
}

this.showReport();
}

updateInventory() {
const input = document.getElementById('inventoryList').value.trim().split("\n");
this.inventory = {};
input.forEach(line => {
const [name, qty, cost, price] = line.split(",").map(v => v.trim());
if (name && !isNaN(qty)) {
this.inventory[name] = {
qty: parseInt(qty),
cost: parseFloat(cost),
price: parseFloat(price)
};
}
});
alert("Inventory updated!");
}

showReport() {
const report = document.getElementById('report');
let totalSales = 0;
let totalProfit = 0;
let totalExpenses = 0;

this.entries.forEach(e => {
totalSales += e.qty * e.price;
totalProfit += e.profit;
totalExpenses += e.expenses;
});

let inventoryReport = '';
Object.keys(this.inventory).forEach(name => {
const item = this.inventory[name];
inventoryReport += `<li>${name}: ${item.qty} bottles left</li>`;
});

report.innerHTML = `
<p><strong>Total Sales:</strong> ₹${totalSales.toFixed(2)}</p>
<p><strong>Total Profit:</strong> ₹${totalProfit.toFixed(2)}</p>
<p><strong>Total Expenses:</strong> ₹${totalExpenses.toFixed(2)}</p>
<h3>Current Stock:</h3>
<ul>${inventoryReport}</ul>
`;
}
}

const tracker = new WineTracker();

document.addEventListener("DOMContentLoaded", function() {
document.querySelector('button').addEventListener('click', () => tracker.addEntry());
document.querySelectorAll('.inputs input').forEach(input => {
input.addEventListener('keyup', (e) => {
if (e.key === 'Enter') tracker.addEntry();
});
});
document.querySelector('button').nextElementSibling.addEventListener('click', () => tracker.updateInventory());
});

} catch (error) {
throw error;
}
</script>

<style>
/* App CSS Goes Here */
body {
font-family: 'Playfair Display', serif;
background: linear-gradient(to bottom, #2e0c24, #630e2d);
color: #fff;
padding: 20px;
margin: 0;
}

.app {
max-width: 500px;
margin: auto;
background: rgba(255, 255, 255, 0.05);
padding: 20px;
border-radius: 10px;
}

h1 {
text-align: center;
font-size: 2em;
color: #f3d9dc;
}

input, textarea {
width: 100%;
margin: 5px 0;
padding: 10px;
border-radius: 5px;
border: none;
}

button {
width: 100%;
background: #8b1c3f;
color: #fff;
border: none;
padding: 10px;
margin-top: 10px;
border-radius: 5px;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s;
}

button:hover {
background: #a2264d;
}

h2 {
border-bottom: 1px solid #ccc;
padding-bottom: 5px;
margin-top: 20px;
}

#report {
background: rgba(255, 255, 255, 0.1);
padding: 10px;
border-radius: 5px;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<div 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>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>
</div>
</body>
</html>