EXcco's picture
The receipt should look exactly as the official banco do Brasil bank receipt looks - Initial Deployment
35a8e95 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PIX BANK Receipt Generator</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://unpkg.com/[email protected]/dist/aos.css" rel="stylesheet">
<script src="https://unpkg.com/[email protected]/dist/aos.js"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<style>
.receipt-container {
background: #f5f5f5;
border: 1px solid #ccc;
border-radius: 0;
box-shadow: none;
transition: all 0.3s ease;
}
.receipt-paper {
background: white;
border-radius: 0;
box-shadow: none;
position: relative;
overflow: hidden;
font-family: 'Arial', sans-serif;
font-size: 11px;
line-height: 1.1;
color: #000;
padding: 15px;
border: 1px solid #999;
}
.bank-header {
text-align: center;
border-bottom: 2px solid #0066b3;
padding-bottom: 8px;
margin-bottom: 10px;
}
.bank-logo-container {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 5px;
gap: 8px;
}
.bank-logo {
height: 25px;
width: auto;
}
.bank-name {
font-weight: bold;
font-size: 14px;
color: #0066b3;
text-transform: uppercase;
}
.receipt-title {
font-size: 12px;
font-weight: bold;
color: #333;
}
.transaction-details {
margin-bottom: 10px;
}
.detail-row {
display: flex;
margin-bottom: 3px;
padding: 1px 0;
}
.detail-label {
font-weight: bold;
min-width: 140px;
color: #333;
}
.detail-value {
flex: 1;
color: #555;
}
.separator {
border-top: 1px dotted #999;
margin: 6px 0;
}
.section-title {
font-weight: bold;
color: #0066b3;
margin: 8px 0 4px 0;
font-size: 11px;
text-transform: uppercase;
}
.authentication-code {
background: #f0f0f0;
border: 1px solid #ddd;
padding: 5px;
margin: 10px 0;
text-align: center;
font-size: 9px;
}
.auth-code-label {
font-weight: bold;
margin-bottom: 2px;
color: #333;
}
.auth-code-value {
font-family: 'Courier New', monospace;
font-size: 8px;
letter-spacing: 0.5px;
color: #666;
}
.footer {
text-align: center;
font-size: 9px;
margin-top: 12px;
border-top: 1px solid #ddd;
padding-top: 8px;
color: #666;
}
.print-button {
background: #0066b3;
border: none;
border-radius: 2px;
transition: all 0.3s ease;
}
.print-button:hover {
background: #004c8c;
transform: none;
box-shadow: none;
}
.form-input:focus {
box-shadow: 0 0 0 2px rgba(0, 102, 179, 0.3);
border-color: #0066b3;
}
.status-completed {
color: #008000;
font-weight: bold;
}
.amount-value {
font-weight: bold;
color: #000;
}
@media print {
body * {
visibility: hidden;
}
.receipt-container, .receipt-container * {
visibility: visible;
}
.receipt-container {
position: absolute;
left: 0;
top: 0;
width: 100%;
border: none;
background: white;
}
.no-print {
display: none !important;
}
}
</style>
</head>
<body class="bg-gray-50 min-h-screen font-sans">
<div class="container mx-auto px-4 py-8">
<!-- Header -->
<header class="text-center mb-8" data-aos="fade-down">
<h1 class="text-3xl md:text-4xl font-bold text-gray-800 mb-2">
<i data-feather="credit-card" class="inline-block mr-2"></i>
PIX BANK Receipt Generator
</h1>
<p class="text-gray-600">Create professional PIX transaction receipts instantly</p>
</header>
<!-- Main Content -->
<div class="grid md:grid-cols-2 gap-8 max-w-6xl mx-auto">
<!-- Input Form -->
<div class="receipt-container p-6 no-print" data-aos="fade-right">
<h2 class="text-xl font-semibold text-gray-800 mb-6 flex items-center">
<i data-feather="edit-3" class="mr-2"></i>
Transaction Details
</h2>
<form id="receiptForm" class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Sender Name</label>
<input type="text" id="senderName" class="form-input w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Enter sender's name">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Receiver Name</label>
<input type="text" id="receiverName" class="form-input w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Enter receiver's name">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Amount (BRL)</label>
<input type="number" id="amount" class="form-input w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="0.00" step="0.01" min="0">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Transaction Date</label>
<input type="datetime-local" id="transactionDate" class="form-input w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Transaction ID</label>
<input type="text" id="transactionId" class="form-input w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="e.g., PIX123456789">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">PIX Payment Method</label>
<select id="pixMethod" class="form-input w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="cpf">CPF/CNPJ Key</option>
<option value="email">Email Key</option>
<option value="phone">Phone Key</option>
<option value="random">Random Key</option>
<option value="qr">QR Code Payment</option>
</select>
</div>
<div id="pixKeyField" class="hidden">
<label class="block text-sm font-medium text-gray-700 mb-1">PIX Key</label>
<input type="text" id="pixKey" class="form-input w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Enter PIX key">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Description (Optional)</label>
<textarea id="description" class="form-input w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" rows="2" placeholder="Transaction purpose..."></textarea>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Recipient Email (for notification)</label>
<input type="email" id="recipientEmail" class="form-input w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="[email protected]">
</div>
<button type="button" onclick="generateReceiptAndNotify()" class="print-button w-full py-3 px-6 text-white font-semibold rounded-lg flex items-center justify-center">
<i data-feather="file-text" class="mr-2"></i>
Generate Receipt & Send Notification
</button>
</form>
</div>
<!-- Receipt Preview -->
<div class="receipt-container p-4" data-aos="fade-left">
<div class="receipt-paper p-4">
<!-- Bank Header -->
<div class="bank-header">
<div style="display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 4px;">
<img src="https://static.photos/finance/120x40/1" alt="Banco do Brasil" style="height: 25px;">
<div class="bank-name">BANCO DO BRASIL</div>
</div>
<div>COMPROVANTE DE TRANSFERÊNCIA PIX</div>
</div>
<!-- Transaction Details -->
<div class="transaction-details">
<div class="section-title">DADOS DA TRANSFERÊNCIA</div>
<div class="detail-row">
<span class="detail-label">Identificador:</span>
<span id="previewId" class="detail-value">PIX000000000</span>
</div>
<div class="detail-row">
<span class="detail-label">Data/Hora:</span>
<span id="previewDate" class="detail-value">DD/MM/AAAA HH:MM:SS</span>
</div>
<div class="separator"></div>
<div class="section-title">PARTICIPANTES</div>
<div class="detail-row">
<span class="detail-label">Origem:</span>
<span id="previewSender" class="detail-value">NOME DO REMETENTE</span>
</div>
<div class="detail-row">
<span class="detail-label">Destino:</span>
<span id="previewReceiver" class="detail-value">NOME DO DESTINATÁRIO</span>
</div>
<div class="separator"></div>
<div class="section-title">VALORES</div>
<div class="detail-row">
<span class="detail-label">Valor:</span>
<span id="previewAmount" class="detail-value amount-value">R$ 0,00</span>
</div>
<div class="separator"></div>
<div class="section-title">INFORMAÇÕES DA OPERAÇÃO</div>
<div class="detail-row">
<span class="detail-label">Tipo:</span>
<span class="detail-value">PIX - Transferência</span>
</div>
<div class="detail-row">
<span class="detail-label">Situação:</span>
<span class="detail-value status-completed">CONCLUÍDO</span>
</div>
<div class="detail-row">
<span class="detail-label">Método:</span>
<span id="previewPixMethod" class="detail-value">Chave CPF/CNPJ</span>
</div>
<div id="pixKeyRow" class="detail-row hidden">
<span class="detail-label">Chave:</span>
<span id="previewPixKey" class="detail-value">-</span>
</div>
<div class="detail-row">
<span class="detail-label">Descrição:</span>
<span id="previewDescription" class="detail-value">-</span>
</div>
</div>
<!-- Authentication Code -->
<div class="authentication-code">
<div class="auth-code-label">CÓDIGO DE AUTENTICAÇÃO</div>
<div class="auth-code-value">BRPIX2024123456789ABCDEF</div>
</div>
<!-- Footer -->
<div class="footer">
<div>Este comprovante não substitui o extrato bancário</div>
<div>Transação realizada via Sistema PIX - Banco Central do Brasil</div>
<div>Data de impressão: <span id="printDate"></span></div>
</div>
</div>
<!-- Print Button -->
<button onclick="printReceipt()" class="print-button w-full mt-6 py-3 px-6 text-white font-semibold rounded-lg flex items-center justify-center no-print">
<i data-feather="printer" class="mr-2"></i>
Print Receipt
</button>
</div>
</div>
<!-- Info Section -->
<div class="max-w-4xl mx-auto mt-12 text-center" data-aos="fade-up">
<div class="bg-blue-50 border border-blue-200 rounded-lg p-6">
<i data-feather="info" class="text-blue-600 text-2xl mb-3"></i>
<h3 class="text-lg font-semibold text-blue-800 mb-2">About PIX Transactions</h3>
<p class="text-blue-700">PIX is Brazil's instant payment system, allowing transfers 24/7 with immediate settlement. This receipt generator creates professional documentation for your PIX transactions.</p>
</div>
</div>
</div>
<script>
// Initialize AOS and Feather Icons
AOS.init({
duration: 800,
once: true
});
feather.replace();
// Set default transaction date to current date/time
document.getElementById('transactionDate').value = new Date().toISOString().slice(0, 16);
// PIX Method selection handler
document.getElementById('pixMethod').addEventListener('change', function() {
const keyField = document.getElementById('pixKeyField');
const keyInput = document.getElementById('pixKey');
if (this.value === 'qr') {
keyField.classList.add('hidden');
keyInput.required = false;
} else {
keyField.classList.remove('hidden');
keyInput.required = true;
// Set placeholder based on method
const placeholders = {
'cpf': 'Enter CPF/CNPJ (e.g., 123.456.789-00)',
'email': 'Enter email address',
'phone': 'Enter phone number (e.g., +55 11 99999-9999)',
'random': 'Enter random key'
};
keyInput.placeholder = placeholders[this.value] || 'Enter PIX key';
}
});
// Generate random transaction ID if empty
document.getElementById('transactionId').addEventListener('blur', function() {
if (!this.value) {
this.value = 'PIX' + Math.random().toString(36).substr(2, 9).toUpperCase();
}
});
// Generate receipt function
function generateReceipt() {
const sender = document.getElementById('senderName').value || 'Sender Name';
const receiver = document.getElementById('receiverName').value || 'Receiver Name';
const amount = document.getElementById('amount').value || '0.00';
const date = document.getElementById('transactionDate').value;
const transactionId = document.getElementById('transactionId').value || 'PIX000000000';
const pixMethod = document.getElementById('pixMethod').value;
const pixKey = document.getElementById('pixKey').value;
const description = document.getElementById('description').value || 'No description provided';
// Format date
const formattedDate = new Date(date).toLocaleString('pt-BR', {
day: '2-digit',
month: '2-digit',
year: 'numeric',
hour: '2-digit',
minute: '2-digit'
});
// Format amount
const formattedAmount = new Intl.NumberFormat('pt-BR', {
style: 'currency',
currency: 'BRL'
}).format(amount);
// Update PIX method display
const methodNames = {
'cpf': 'Chave CPF/CNPJ',
'email': 'Chave Email',
'phone': 'Chave Telefone',
'random': 'Chave Aleatória',
'qr': 'QR Code'
};
// Update preview
document.getElementById('previewSender').textContent = sender;
document.getElementById('previewReceiver').textContent = receiver;
document.getElementById('previewAmount').textContent = formattedAmount;
document.getElementById('previewDate').textContent = formattedDate;
document.getElementById('previewId').textContent = transactionId;
document.getElementById('previewPixMethod').textContent = methodNames[pixMethod];
document.getElementById('previewDescription').textContent = description;
// Show/hide PIX key based on method
const pixKeyRow = document.getElementById('pixKeyRow');
const previewPixKey = document.getElementById('previewPixKey');
if (pixMethod !== 'qr' && pixKey) {
pixKeyRow.classList.remove('hidden');
previewPixKey.textContent = pixKey;
} else {
pixKeyRow.classList.add('hidden');
}
// Show success animation
const receiptPaper = document.querySelector('.receipt-paper');
receiptPaper.style.transform = 'scale(1.02)';
setTimeout(() => {
receiptPaper.style.transform = 'scale(1)';
}, 300);
}
// Print receipt function
function printReceipt() {
window.print();
}
// Set print date
const currentDate = new Date().toLocaleDateString('pt-BR');
document.getElementById('printDate').textContent = currentDate;
// Auto-generate receipt on form changes (exclude email field)
const formInputs = document.querySelectorAll('#receiptForm input:not(#recipientEmail), #receiptForm textarea');
formInputs.forEach(input => {
input.addEventListener('input', generateReceipt);
});
// Initial generation
generateReceipt();
// Update print date on print
function printReceipt() {
document.getElementById('printDate').textContent = new Date().toLocaleDateString('pt-BR');
setTimeout(() => {
window.print();
}, 100);
}
// Generate receipt and send email notification
function generateReceiptAndNotify() {
generateReceipt();
const recipientEmail = document.getElementById('recipientEmail').value;
const amount = document.getElementById('amount').value || '0.00';
const sender = document.getElementById('senderName').value || 'Sender';
if (recipientEmail) {
// Show sending notification
const button = document.querySelector('.print-button');
const originalText = button.innerHTML;
button.innerHTML = '<i data-feather="send" class="mr-2"></i>Sending Notification...';
button.disabled = true;
feather.replace();
// Simulate email sending (in a real implementation, this would call a backend API)
setTimeout(() => {
// Show success message
showNotification('Email notification sent successfully!', 'success');
// Reset button
button.innerHTML = originalText;
button.disabled = false;
feather.replace();
}, 2000);
} else {
showNotification('Please enter recipient email for notification', 'warning');
}
}
// Notification function
function showNotification(message, type = 'info') {
// Remove any existing notification
const existingNotification = document.querySelector('.notification-toast');
if (existingNotification) {
existingNotification.remove();
}
// Create notification
const notification = document.createElement('div');
notification.className = `notification-toast fixed top-4 right-4 z-50 px-6 py-3 rounded-lg shadow-lg text-white font-semibold ${
type === 'success' ? 'bg-green-600' :
type === 'warning' ? 'bg-yellow-600' :
'bg-blue-600'
}`;
notification.innerHTML = `
<div class="flex items-center">
<i data-feather="${type === 'success' ? 'check-circle' : type === 'warning' ? 'alert-circle' : 'info'}" class="mr-2"></i>
${message}
</div>
`;
document.body.appendChild(notification);
feather.replace();
// Auto remove after 3 seconds
setTimeout(() => {
notification.remove();
}, 3000);
}
</script>
</body>
</html>