acc / index.html
alkhteebosama's picture
شاشة سند صرف - Initial Deployment
11d7ce3 verified
Raw History Blame Contribute Delete
16.4 kB
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>سند صرف</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');
body {
font-family: 'Tajawal', sans-serif;
}
.receipt {
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
border-radius: 10px;
overflow: hidden;
}
.receipt-header {
background: linear-gradient(135deg, #4f46e5, #7c3aed);
}
.receipt-footer {
background: linear-gradient(135deg, #4f46e5, #7c3aed);
}
.signature-line {
border-top: 1px dashed #4b5563;
width: 70%;
margin: 0 auto;
}
@media print {
.no-print {
display: none !important;
}
body {
background: none;
margin: 0;
padding: 0;
}
.receipt {
box-shadow: none;
border-radius: 0;
}
}
</style>
</head>
<body class="bg-gray-100 p-4 md:p-8">
<div class="max-w-4xl mx-auto">
<!-- Header -->
<div class="flex justify-between items-center mb-6 no-print">
<h1 class="text-2xl font-bold text-gray-800">سند صرف</h1>
<div class="flex space-x-2 space-x-reverse">
<button onclick="window.print()" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center">
<i class="fas fa-print ml-2"></i>
طباعة
</button>
<button onclick="generateNewVoucher()" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center">
<i class="fas fa-plus ml-2"></i>
جديد
</button>
</div>
</div>
<!-- Receipt -->
<div class="receipt bg-white">
<!-- Receipt Header -->
<div class="receipt-header text-white p-6 text-center">
<h1 class="text-2xl md:text-3xl font-bold mb-2">شركة الأفق الجديد</h1>
<p class="text-blue-100">سند صرف نقدية</p>
</div>
<!-- Receipt Info -->
<div class="p-6">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
<div class="bg-gray-50 p-4 rounded-lg">
<p class="text-gray-500 text-sm">رقم السند</p>
<p class="font-bold text-lg" id="voucher-number">PR-2023-001</p>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<p class="text-gray-500 text-sm">التاريخ</p>
<p class="font-bold text-lg" id="voucher-date">15/10/2023</p>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<p class="text-gray-500 text-sm">المبلغ الإجمالي</p>
<p class="font-bold text-lg text-green-600" id="total-amount">1,250.00 ر.س</p>
</div>
</div>
<!-- From/To -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<div class="border border-gray-200 p-4 rounded-lg">
<p class="text-gray-500 text-sm mb-2">صرف إلى</p>
<p class="font-bold" id="paid-to">محمد أحمد</p>
<p class="text-gray-600" id="paid-to-details">موظف - قسم المبيعات</p>
</div>
<div class="border border-gray-200 p-4 rounded-lg">
<p class="text-gray-500 text-sm mb-2">صرف من</p>
<p class="font-bold" id="paid-from">الخزينة الرئيسية</p>
<p class="text-gray-600" id="paid-from-details">الفرع الرئيسي - الرياض</p>
</div>
</div>
<!-- Payment Details -->
<div class="mb-6">
<h3 class="text-lg font-bold mb-4 border-b pb-2">تفاصيل الصرف</h3>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الوصف</th>
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">المبلغ</th>
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">ملاحظات</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="payment-items">
<tr>
<td class="px-4 py-3">راتب شهر أكتوبر</td>
<td class="px-4 py-3">1,000.00 ر.س</td>
<td class="px-4 py-3 text-gray-500">-</td>
</tr>
<tr>
<td class="px-4 py-3">بدل مواصلات</td>
<td class="px-4 py-3">150.00 ر.س</td>
<td class="px-4 py-3 text-gray-500">تنقلات شهر أكتوبر</td>
</tr>
<tr>
<td class="px-4 py-3">بدل إقامة</td>
<td class="px-4 py-3">100.00 ر.س</td>
<td class="px-4 py-3 text-gray-500">-</td>
</tr>
</tbody>
<tfoot>
<tr class="bg-gray-50">
<td class="px-4 py-3 font-bold">الإجمالي</td>
<td class="px-4 py-3 font-bold text-green-600">1,250.00 ر.س</td>
<td class="px-4 py-3"></td>
</tr>
</tfoot>
</table>
</div>
</div>
<!-- Payment Method -->
<div class="mb-6">
<h3 class="text-lg font-bold mb-4 border-b pb-2">طريقة الدفع</h3>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="border border-gray-200 p-4 rounded-lg">
<p class="text-gray-500 text-sm mb-2">طريقة الدفع</p>
<p class="font-bold" id="payment-method">نقداً</p>
</div>
<div class="border border-gray-200 p-4 rounded-lg">
<p class="text-gray-500 text-sm mb-2">رقم المرجع</p>
<p class="font-bold" id="payment-reference">CASH-1023</p>
</div>
<div class="border border-gray-200 p-4 rounded-lg">
<p class="text-gray-500 text-sm mb-2">حالة السند</p>
<p class="font-bold text-green-600" id="payment-status">مكتمل</p>
</div>
</div>
</div>
<!-- Notes -->
<div class="mb-6">
<h3 class="text-lg font-bold mb-4 border-b pb-2">ملاحظات</h3>
<p class="text-gray-700" id="payment-notes">تم الصرف وفقاً للسياسات المالية المعتمدة في الشركة.</p>
</div>
<!-- Signatures -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mt-8">
<div class="text-center">
<div class="signature-line mb-2"></div>
<p class="text-gray-600">توقيع المستلم</p>
</div>
<div class="text-center">
<div class="signature-line mb-2"></div>
<p class="text-gray-600">توقيع المحاسب</p>
</div>
<div class="text-center">
<div class="signature-line mb-2"></div>
<p class="text-gray-600">توقيع المدير</p>
</div>
</div>
</div>
<!-- Receipt Footer -->
<div class="receipt-footer text-white p-4 text-center text-sm">
<p>شكراً لتعاملكم مع شركة الأفق الجديد | هاتف: 0111234567 | البريد الإلكتروني: info@alofouq.com</p>
</div>
</div>
</div>
<script>
// Generate random voucher data
function generateRandomVoucher() {
const names = ["محمد أحمد", "علي حسن", "أحمد خالد", "سامي عبدالله", "خالد محمد"];
const descriptions = ["راتب شهر", "بدل مواصلات", "بدل إقامة", "مكافأة أداء", "سلفة"];
const months = ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"];
const methods = ["نقداً", "شيك", "حوالة بنكية"];
const statuses = ["مكتمل", "معلق", "ملغى"];
// Random date in the past 30 days
const date = new Date();
date.setDate(date.getDate() - Math.floor(Math.random() * 30));
const formattedDate = `${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()}`;
// Random voucher number
const voucherNumber = `PR-${date.getFullYear()}-${Math.floor(100 + Math.random() * 900)}`;
// Random items (1-5 items)
const itemCount = Math.floor(1 + Math.random() * 5);
let items = [];
let total = 0;
for (let i = 0; i < itemCount; i++) {
const amount = Math.floor(50 + Math.random() * 1000);
const descIndex = Math.floor(Math.random() * descriptions.length);
const monthIndex = Math.floor(Math.random() * months.length);
items.push({
description: `${descriptions[descIndex]} ${descIndex === 0 ? months[monthIndex] : ''}`,
amount: amount.toFixed(2),
notes: Math.random() > 0.7 ? "ملاحظات إضافية" : "-"
});
total += amount;
}
return {
voucherNumber: voucherNumber,
date: formattedDate,
paidTo: names[Math.floor(Math.random() * names.length)],
paidToDetails: "موظف - قسم " + ["المبيعات", "التسويق", "المالية", "التقنية", "الموارد البشرية"][Math.floor(Math.random() * 5)],
paidFrom: ["الخزينة الرئيسية", "البنك الأهلي", "البنك السعودي الفرنسي"][Math.floor(Math.random() * 3)],
paidFromDetails: "الفرع " + ["الرئيسي", "الشرقي", "الغربي"][Math.floor(Math.random() * 3)] + " - الرياض",
items: items,
totalAmount: total.toFixed(2),
paymentMethod: methods[Math.floor(Math.random() * methods.length)],
paymentReference: `REF-${Math.floor(1000 + Math.random() * 9000)}`,
paymentStatus: statuses[Math.floor(Math.random() * statuses.length)],
notes: Math.random() > 0.5 ? "تم الصرف وفقاً للسياسات المالية المعتمدة في الشركة." : "لا توجد ملاحظات إضافية."
};
}
// Update the voucher with new data
function updateVoucher(data) {
document.getElementById('voucher-number').textContent = data.voucherNumber;
document.getElementById('voucher-date').textContent = data.date;
document.getElementById('paid-to').textContent = data.paidTo;
document.getElementById('paid-to-details').textContent = data.paidToDetails;
document.getElementById('paid-from').textContent = data.paidFrom;
document.getElementById('paid-from-details').textContent = data.paidFromDetails;
document.getElementById('total-amount').textContent = data.totalAmount + ' ر.س';
document.getElementById('payment-method').textContent = data.paymentMethod;
document.getElementById('payment-reference').textContent = data.paymentReference;
document.getElementById('payment-status').textContent = data.paymentStatus;
document.getElementById('payment-status').className = 'font-bold ' +
(data.paymentStatus === 'مكتمل' ? 'text-green-600' :
data.paymentStatus === 'معلق' ? 'text-yellow-600' : 'text-red-600');
document.getElementById('payment-notes').textContent = data.notes;
// Update items table
const itemsTable = document.getElementById('payment-items');
itemsTable.innerHTML = '';
data.items.forEach(item => {
const row = document.createElement('tr');
row.innerHTML = `
<td class="px-4 py-3">${item.description}</td>
<td class="px-4 py-3">${item.amount} ر.س</td>
<td class="px-4 py-3 text-gray-500">${item.notes}</td>
`;
itemsTable.appendChild(row);
});
// Update total in footer
const totalRow = document.querySelector('tfoot tr');
totalRow.innerHTML = `
<td class="px-4 py-3 font-bold">الإجمالي</td>
<td class="px-4 py-3 font-bold text-green-600">${data.totalAmount} ر.س</td>
<td class="px-4 py-3"></td>
`;
}
// Generate new voucher
function generateNewVoucher() {
const newVoucher = generateRandomVoucher();
updateVoucher(newVoucher);
}
// Initialize with random data
document.addEventListener('DOMContentLoaded', function() {
const initialVoucher = generateRandomVoucher();
updateVoucher(initialVoucher);
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=alkhteebosama/acc" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>