Gold Investment Tracker
Add / Edit Gold Holding
Current Gold Holdings
| Description | Purchase Date | Qty | Unit | Price/Unit | Cost Basis | Current Value | Valuation Date | Gain/Loss ($) | Gain/Loss (%) | Holding Period | Actions |
|---|
Update Current Market Gold Prices
Enter the current spot prices for gold. Clicking "Apply Market Prices" will recalculate the value of your holdings listed in Ounces or Grams. Items listed as 'Units/Pieces' must be valued individually by editing them.
Portfolio Summary
Total Holdings
0
Total Cost Basis
$0.00
Total Current Value
$0.00
Total Unrealized Gain/Loss
$0.00
Total Items: ${summaryTotalItems.textContent}
Total Cost Basis: ${summaryTotalCostBasis.textContent}
Total Current Value: ${summaryTotalCurrentValue.textContent}
Total Unrealized Gain/Loss: ${summaryTotalGainLoss.textContent}
`; let marketPricesHtml = `Current Market Prices Used for Ounces/Grams (if applicable)
Price per Ounce: ${currentGoldPrices.pricePerOunce ? formatCurrency(currentGoldPrices.pricePerOunce) : 'N/A'}
Price per Gram: ${currentGoldPrices.pricePerGram ? formatCurrency(currentGoldPrices.pricePerGram) : 'N/A'}
Market Valuation Date: ${currentGoldPrices.valuationDate ? formatDateForDisplay(currentGoldPrices.valuationDate) : 'N/A'}
`; let itemsHtml = `Gold Holdings
| Description | Purchase Date | Qty | Unit | Price/Unit | Cost Basis | Current Value | Val. Date | Gain/Loss ($) | Gain/Loss (%) | Holding Period |
|---|---|---|---|---|---|---|---|---|---|---|
| ${h.description} | ${formatDateForDisplay(h.purchaseDate)} | ${h.quantity} | ${h.unit.charAt(0).toUpperCase() + h.unit.slice(1)} | ${formatCurrency(h.purchasePricePerUnit)} | ${formatCurrency(costBasis)} | ${formatCurrency(currentVal)} | ${formatDateForDisplay(valDateForDisplay)} | ${formatCurrency(gainLossAmount)} | ${formatPercentage(gainLossPercent)} | ${calculateHoldingPeriod(h.purchaseDate, valDateForDisplay)} |
Gold Investment Portfolio Report
${summaryHtml} ${(currentGoldPrices.pricePerOunce || currentGoldPrices.pricePerGram) ? marketPricesHtml : ''} ${itemsHtml}Generated: ${new Date().toLocaleString()}
`; const printWindow = window.open('', '_blank'); if(printWindow) { printWindow.document.write(pdfContent); printWindow.document.close(); printWindow.focus(); setTimeout(() => printWindow.print(), 250); } else { alert('Could not open print window. Check pop-up settings.'); } }); // Initial Load loadData(); // This will also call renderHoldings -> renderSummary and toggleItemSpecificValueFields switchTab('gitManageHoldingsTab'); // Ensure first tab is active });