Petrol Pump Accounting In Excel Sheet Download 🔥 Fast

// 3. Stock Management Table html += `<h3 style="margin:25px 0 5px 0; color:#1e4a2f;">📦 Stock Summary (Liters / Units)</h3>`; html += `<table id="stockTable"><thead><tr><th>Product</th><th>Opening (Ltr)</th><th>Received (Ltr)</th><th>Sold (Ltr)</th><th>Closing (Ltr)</th><th>Unit Price (₹)</th><th>Stock Value (₹)</th><th></th></tr></thead><tbody>`; for (let i = 0; i < stockData.length; i++) let st = stockData[i]; let stockValue = (st.closing * st.unitPrice).toFixed(2); html += `<tr data-type="stock" data-index="$i"> <td style="background:#faf3e0;">$st.product</td> <td><input type="number" step="0.01" class="stock-opening" value="$st.opening" data-idx="$i"></td> <td><input type="number" step="0.01" class="stock-received" value="$st.received" data-idx="$i"></td> <td><input type="number" step="0.01" class="stock-sold" value="$st.sold" data-idx="$i"></td> <td class="stock-closing">$st.closing.toFixed(2)</td> <td><input type="number" step="0.01" class="stock-price" value="$st.unitPrice" data-idx="$i"></td> <td class="stock-value">$stockValue</td> <td><button class="delRowBtn" data-type="stock" data-idx="$i" style="background:#b33;">🗑️</button></td> </tr>`; html += `<tr><td colspan="7"><button id="addStockRowBtn" style="background:#3c8c40;">+ Add Stock Product</button></td><td></td></tr>`; html += `</tbody></table>`;

// Build HTML with three sections let html = `<style>td input border:1px solid #ddd; border-radius:6px; padding:6px; text-align:center; td vertical-align: middle; </style>`;

function stockChangeHandler(e) 0; stockData[idx].opening = opening; stockData[idx].received = received; stockData[idx].sold = sold; stockData[idx].unitPrice = price; recomputeStock(); // update closing and value cells const closingCell = document.querySelector(`tr[data-type='stock'][data-index='$idx'] .stock-closing`); if (closingCell) closingCell.innerText = stockData[idx].closing.toFixed(2); const valueCell = document.querySelector(`tr[data-type='stock'][data-index='$idx'] .stock-value`); if (valueCell) valueCell.innerText = (stockData[idx].closing * stockData[idx].unitPrice).toFixed(2); // Also update sales rate and sales liters (if product matches) for consistency const prodName = stockData[idx].product; const salesIdx = salesData.findIndex(s => s.product === prodName); if (salesIdx !== -1) salesData[salesIdx].liters = sold; salesData[salesIdx].rate = price; salesData[salesIdx].amount = sold * price; // update sales table display if needed, but renderTables would be heavy. We directly modify DOM: const salesRow = document.querySelector(`tr[data-type='sales'][data-index='$salesIdx']`); if (salesRow) const litInput = salesRow.querySelector('.sales-lit'); const rateInput = salesRow.querySelector('.sales-rate'); if (litInput) litInput.value = sold; if (rateInput) rateInput.value = price; const amtSpan = salesRow.querySelector('.sales-amount'); if (amtSpan) amtSpan.innerText = (sold * price).toFixed(2); updateCards();

function expenseChangeHandler(e) const idx = parseInt(e.target.getAttribute('data-idx')); if (!isNaN(idx)) let newAmt = parseFloat(e.target.value) petrol pump accounting in excel sheet download

// Helper: recompute amounts for sales (liters * rate) function recomputeSales() for (let i = 0; i < salesData.length; i++) salesData[i].amount = salesData[i].liters * salesData[i].rate;

// Recompute stock closing & stock value function recomputeStock() for (let i = 0; i < stockData.length; i++) let s = stockData[i]; s.closing = s.opening + s.received - s.sold;

function getTotalExpenses() return expensesData.reduce((sum, exp) => sum + exp.amount, 0); // Actually to give an integrated feel, we

// Get total sales sum function getTotalSales() return salesData.reduce((sum, item) => sum + item.amount, 0);

function resetDemo() salesData = [ product: "Petrol (MS)", liters: 1250, rate: 102.50, amount: 128125 , product: "Diesel (HSD)", liters: 980, rate: 94.80, amount: 92904 , product: "Premium Petrol", liters: 320, rate: 115.00, amount: 36800 , product: "Engine Oil (Lube)", liters: 45, rate: 850, amount: 38250 ]; expensesData = [ date: "01-Apr-2026", category: "Electricity", amount: 5500 , date: "05-Apr-2026", category: "Staff Salary", amount: 28500 , date: "10-Apr-2026", category: "Maintenance", amount: 3200 , date: "15-Apr-2026", category: "Misc", amount: 1750 ]; stockData = [ product: "Petrol (MS)", opening: 5200, received: 8000, sold: 1250, closing: 11950, unitPrice: 102.50 , product: "Diesel (HSD)", opening: 4300, received: 7000, sold: 980, closing: 10320, unitPrice: 94.80 , product: "Premium Petrol", opening: 1100, received: 2000, sold: 320, closing: 2780, unitPrice: 115.00 , product: "Engine Oil (Lube)", opening: 180, received: 120, sold: 45, closing: 255, unitPrice: 850.00 ]; recomputeSales(); recomputeStock(); renderTables();

// Render full editable Excel-style tables function renderTables() const container = document.getElementById("excelTableContainer"); if (!container) return; h3 style="margin:25px 0 5px 0

let stockData = [ product: "Petrol (MS)", opening: 5200, received: 8000, sold: 1250, closing: 11950, unitPrice: 102.50 , product: "Diesel (HSD)", opening: 4300, received: 7000, sold: 980, closing: 10320, unitPrice: 94.80 , product: "Premium Petrol", opening: 1100, received: 2000, sold: 320, closing: 2780, unitPrice: 115.00 , product: "Engine Oil (Lube)", opening: 180, received: 120, sold: 45, closing: 255, unitPrice: 850.00 ];

<script> // ---------- DATA MODEL (Mimicking excel rows) ---------- // We'll maintain two sections: Sales Register, Expenses Register, Stock Register // For simplicity, we use separate tables but inside one downloadable sheet. // Actually to give an integrated feel, we create 3 mini tables inside main container.