File size: 16,386 Bytes
11d7ce3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<!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>