Commit 97727780 authored by Mahmoud Aglan's avatar Mahmoud Aglan

koko

parent 74b89bf0
...@@ -370,6 +370,64 @@ $__template->section('title'); ?>لوحة التسعير<?php $__template->endSe ...@@ -370,6 +370,64 @@ $__template->section('title'); ?>لوحة التسعير<?php $__template->endSe
</div> </div>
</div> </div>
<!-- Late Payment Penalty Schedule -->
<div class="pricing-section">
<div class="pricing-section-header" onclick="toggleSection(this)">
<div class="pricing-section-icon" style="background:rgba(220,38,38,.1);">⚠️</div>
<div class="pricing-section-title">
<h3>جدول غرامات التأخير عن سداد الاشتراك السنوي</h3>
<p>طبقاً للائحة — الموعد الأقصى للسداد: نهاية سبتمبر من كل عام</p>
</div>
<svg class="pricing-section-chevron" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg>
</div>
<div class="pricing-section-body">
<table style="width:100%;border-collapse:collapse;font-size:14px;">
<thead>
<tr style="background:#FEF2F2;border-bottom:2px solid #FECACA;">
<th style="padding:12px 16px;text-align:right;font-weight:700;color:#991B1B;">الفترة</th>
<th style="padding:12px 16px;text-align:center;font-weight:700;color:#991B1B;">نسبة الغرامة</th>
<th style="padding:12px 16px;text-align:right;font-weight:700;color:#991B1B;">ملاحظات</th>
</tr>
</thead>
<tbody>
<tr style="border-bottom:1px solid #F3F4F6;">
<td style="padding:10px 16px;">من أول أكتوبر حتى نهاية يونيو</td>
<td style="padding:10px 16px;text-align:center;font-weight:700;color:#DC2626;">10%</td>
<td style="padding:10px 16px;color:#6B7280;">من قيمة إجمالي الاشتراك</td>
</tr>
<tr style="border-bottom:1px solid #F3F4F6;background:#FAFAFA;">
<td style="padding:10px 16px;">السنة المالية الأولى</td>
<td style="padding:10px 16px;text-align:center;font-weight:700;color:#DC2626;">50%</td>
<td style="padding:10px 16px;color:#6B7280;">من قيمة إجمالي الاشتراك السنوي</td>
</tr>
<tr style="border-bottom:1px solid #F3F4F6;">
<td style="padding:10px 16px;">السنة المالية الثانية</td>
<td style="padding:10px 16px;text-align:center;font-weight:700;color:#DC2626;">100%</td>
<td style="padding:10px 16px;color:#6B7280;">من قيمة إجمالي الاشتراك السنوي</td>
</tr>
<tr style="border-bottom:1px solid #F3F4F6;background:#FAFAFA;">
<td style="padding:10px 16px;">السنة المالية الثالثة</td>
<td style="padding:10px 16px;text-align:center;font-weight:700;color:#DC2626;">200%</td>
<td style="padding:10px 16px;color:#6B7280;">من قيمة إجمالي الاشتراك السنوي</td>
</tr>
<tr style="border-bottom:1px solid #F3F4F6;">
<td style="padding:10px 16px;">السنة المالية الرابعة</td>
<td style="padding:10px 16px;text-align:center;font-weight:700;color:#DC2626;">300%</td>
<td style="padding:10px 16px;color:#6B7280;">من قيمة إجمالي الاشتراك السنوي</td>
</tr>
<tr style="background:#FEF2F2;">
<td style="padding:10px 16px;font-weight:700;color:#991B1B;">السنة المالية الخامسة</td>
<td style="padding:10px 16px;text-align:center;font-weight:700;color:#991B1B;">إسقاط</td>
<td style="padding:10px 16px;color:#991B1B;">تُسقط العضوية طبقاً للائحة</td>
</tr>
</tbody>
</table>
<div style="margin-top:12px;padding:12px 16px;background:#EFF6FF;border-radius:8px;border:1px solid #BFDBFE;font-size:13px;color:#1E40AF;">
<strong>ملاحظة:</strong> يحق لمجلس الأمناء مد فترة الاشتراك السنوي شهر بدون غرامة.
</div>
</div>
</div>
<!-- Membership Prices Section --> <!-- Membership Prices Section -->
<?php if (!empty($membershipPrices)): ?> <?php if (!empty($membershipPrices)): ?>
<div class="pricing-section"> <div class="pricing-section">
......
...@@ -37,10 +37,9 @@ final class SubscriptionCalculator ...@@ -37,10 +37,9 @@ final class SubscriptionCalculator
$unpaid = bcsub($uy['total'], $uy['paid'], 2); $unpaid = bcsub($uy['total'], $uy['paid'], 2);
if (bccomp($unpaid, '0', 2) <= 0) continue; if (bccomp($unpaid, '0', 2) <= 0) continue;
// Fine percentages: year 1 = 100%, year 2 = 200%, year 3 = 300% $ruleCode = 'LATE_SUB_FINE_YEAR_' . min($yearNum, 5);
$ruleCode = 'LATE_SUB_FINE_YEAR_' . min($yearNum, 3);
$fineData = RuleEngine::get($ruleCode); $fineData = RuleEngine::get($ruleCode);
$finePct = $fineData['percentage_of_subscription'] ?? (string) ($yearNum * 100); $finePct = $fineData['percentage_of_subscription'] ?? '0';
$fineAmount = bcdiv(bcmul($unpaid, $finePct, 4), '100', 2); $fineAmount = bcdiv(bcmul($unpaid, $finePct, 4), '100', 2);
$totalFine = bcadd($totalFine, $fineAmount, 2); $totalFine = bcadd($totalFine, $fineAmount, 2);
......
...@@ -40,10 +40,54 @@ ...@@ -40,10 +40,54 @@
/* ── Screen display: readable layout ── */ /* ── Screen display: readable layout ── */
@media screen { @media screen {
body { max-width: 210mm; margin: 0 auto; padding: 20px; font-size: 14px; background: #f3f4f6; } body { max-width: 210mm; margin: 0 auto; padding: 20px 20px 60px; font-size: 14px; background: #f3f4f6; }
.cover-page, .module-divider, .back-cover { width: 100% !important; height: auto !important; min-height: auto !important; padding: 60px 40px !important; margin-bottom: 24px; border-radius: 12px; }
.toc-page { height: auto !important; min-height: auto !important; padding: 40px !important; margin-bottom: 24px; } /* Kill all page-break rules on screen */
.tutorial-block { margin-bottom: 16px; } .cover-page, .toc-page, .module-divider, .back-cover,
.tutorial-block, .tut-step, .category-header {
page-break-before: auto !important;
page-break-after: auto !important;
page-break-inside: auto !important;
}
/* Cover, dividers, back cover: auto height, visible on screen */
.cover-page, .module-divider, .back-cover {
width: 100% !important;
height: auto !important;
min-height: auto !important;
padding: 60px 40px !important;
margin-bottom: 24px;
border-radius: 12px;
overflow: visible !important;
}
/* TOC */
.toc-page {
height: auto !important;
min-height: auto !important;
padding: 40px !important;
margin-bottom: 24px;
background: #fff;
border-radius: 12px;
}
/* Tutorials: clear visibility */
.tutorial-block {
margin-bottom: 20px;
overflow: visible !important;
background: #fff;
}
.tutorial-block-body {
display: block !important;
overflow: visible !important;
max-height: none !important;
}
.tut-step {
overflow: visible !important;
}
/* Hide fixed footer on screen */
.page-footer { display: none !important; }
} }
/* ── Feature 13: Typography hierarchy ── */ /* ── Feature 13: Typography hierarchy ── */
......
<?php
declare(strict_types=1);
return [
'up' => "
UPDATE business_rules SET current_value_json = '{\"percentage_of_subscription\":\"10.00\"}', name_ar = 'غرامة تأخير أولية (أكتوبر-يونيو)' WHERE rule_code = 'LATE_SUB_FINE_YEAR_1';
UPDATE business_rules SET current_value_json = '{\"percentage_of_subscription\":\"50.00\"}', name_ar = 'غرامة تأخير السنة المالية الأولى' WHERE rule_code = 'LATE_SUB_FINE_YEAR_2';
UPDATE business_rules SET current_value_json = '{\"percentage_of_subscription\":\"100.00\"}', name_ar = 'غرامة تأخير السنة المالية الثانية' WHERE rule_code = 'LATE_SUB_FINE_YEAR_3';
INSERT INTO business_rules (rule_code, category, name_ar, name_en, data_type, current_value_json, parameters_json, is_active, created_at, updated_at) VALUES ('LATE_SUB_FINE_YEAR_4', 'penalty', 'غرامة تأخير السنة المالية الثالثة', 'Late Fine Year 3 (200%)', 'percentage', '{\"percentage_of_subscription\":\"200.00\"}', '{\"percentage_of_subscription\":\"decimal\"}', 1, NOW(), NOW()) ON DUPLICATE KEY UPDATE current_value_json = '{\"percentage_of_subscription\":\"200.00\"}', name_ar = 'غرامة تأخير السنة المالية الثالثة';
INSERT INTO business_rules (rule_code, category, name_ar, name_en, data_type, current_value_json, parameters_json, is_active, created_at, updated_at) VALUES ('LATE_SUB_FINE_YEAR_5', 'penalty', 'غرامة تأخير السنة المالية الرابعة', 'Late Fine Year 4 (300%)', 'percentage', '{\"percentage_of_subscription\":\"300.00\"}', '{\"percentage_of_subscription\":\"decimal\"}', 1, NOW(), NOW()) ON DUPLICATE KEY UPDATE current_value_json = '{\"percentage_of_subscription\":\"300.00\"}', name_ar = 'غرامة تأخير السنة المالية الرابعة'
",
'down' => "
UPDATE business_rules SET current_value_json = '{\"percentage_of_subscription\":\"100.00\"}', name_ar = 'غرامة تأخير سنة أولى' WHERE rule_code = 'LATE_SUB_FINE_YEAR_1';
UPDATE business_rules SET current_value_json = '{\"percentage_of_subscription\":\"200.00\"}', name_ar = 'غرامة تأخير سنة ثانية' WHERE rule_code = 'LATE_SUB_FINE_YEAR_2';
UPDATE business_rules SET current_value_json = '{\"percentage_of_subscription\":\"300.00\"}', name_ar = 'غرامة تأخير سنة ثالثة' WHERE rule_code = 'LATE_SUB_FINE_YEAR_3';
DELETE FROM business_rules WHERE rule_code IN ('LATE_SUB_FINE_YEAR_4', 'LATE_SUB_FINE_YEAR_5')
",
];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment