Commit 55d6ac8e authored by DevPilot's avatar DevPilot

fix(procurement): add missing quote response form view

QuoteController@recordResponse rendered
Procurement.Views.quotes.response_form, which was never created — so
/procurement/quotes/{id}/response returned a 500 and vendor prices
could not be recorded at all. Without it the whole tender cycle is
blocked: no quote totals, so no technical gate, no financial
comparison, and no award.

Fields match what storeResponse() reads: quote_item_ids[],
quantities[], unit_prices[], delivery_days[], plus delivery/payment
terms and expiry date.
parent b4200e99
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>تسجيل رد عرض السعر<?php $__template->endSection(); ?>
<?php $__template->section('page_actions'); ?>
<a href="/procurement/quotes" class="btn btn-outline"><i data-lucide="arrow-right" style="width:15px;height:15px;vertical-align:middle;margin-left:4px;"></i> العودة للعروض</a>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<form method="POST" action="/procurement/quotes/<?= (int) $quote['id'] ?>/response">
<?= csrf_field() ?>
<!-- بيانات العرض -->
<div class="card" style="margin-bottom:20px;">
<div style="padding:15px 20px;border-bottom:1px solid #E5E7EB;display:flex;align-items:center;gap:8px;">
<i data-lucide="file-text" style="width:18px;height:18px;color:#0D7377;"></i>
<h3 style="margin:0;color:#0D7377;font-size:15px;">
عرض رقم <code style="font-size:12px;background:#F3F4F6;padding:2px 8px;border-radius:4px;"><?= e($quote['quote_number'] ?? '') ?></code>
— المورد: <?= e($quote['supplier_name'] ?? '—') ?>
</h3>
</div>
<div style="padding:20px;display:grid;grid-template-columns:repeat(3,1fr);gap:15px;">
<div class="form-group">
<label class="form-label">شروط التوريد</label>
<input type="text" name="delivery_terms" class="form-input" value="<?= e($quote['delivery_terms'] ?? '') ?>" placeholder="مثال: التسليم بمخازن النادي">
</div>
<div class="form-group">
<label class="form-label">شروط الدفع</label>
<input type="text" name="payment_terms" class="form-input" value="<?= e($quote['payment_terms'] ?? '') ?>" placeholder="مثال: 50% مقدم">
</div>
<div class="form-group">
<label class="form-label">تاريخ سريان العرض</label>
<input type="date" name="expiry_date" class="form-input" value="<?= e($quote['expiry_date'] ?? '') ?>">
</div>
</div>
</div>
<!-- أصناف العرض -->
<div class="card" style="margin-bottom:20px;">
<div style="padding:15px 20px;border-bottom:1px solid #E5E7EB;">
<h3 style="margin:0;font-size:15px;">أصناف العرض</h3>
</div>
<?php if (!empty($items)): ?>
<div class="table-responsive">
<table class="data-table">
<thead>
<tr>
<th>الصنف</th>
<th>الكمية</th>
<th>سعر الوحدة</th>
<th>مدة التوريد (يوم)</th>
</tr>
</thead>
<tbody>
<?php foreach ($items as $it): ?>
<tr>
<td style="font-weight:600;">
<?= e($it['item_name'] ?? $it['item_description'] ?? '—') ?>
<span style="color:#6B7280;font-size:12px;">(<?= e($it['sku'] ?? '') ?>)</span>
<input type="hidden" name="quote_item_ids[]" value="<?= (int) $it['id'] ?>">
</td>
<td style="max-width:120px;">
<input type="number" name="quantities[]" class="form-input" step="0.001" min="0" value="<?= e($it['quantity'] ?? '0') ?>">
</td>
<td style="max-width:140px;">
<input type="number" name="unit_prices[]" class="form-input" step="0.01" min="0" value="<?= e($it['unit_price'] ?? '0') ?>" style="direction:ltr;text-align:left;">
</td>
<td style="max-width:120px;">
<input type="number" name="delivery_days[]" class="form-input" step="1" min="0" value="<?= e($it['delivery_days'] ?? '') ?>">
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php else: ?>
<div style="padding:30px 20px;text-align:center;color:#6B7280;">لا توجد أصناف في هذا العرض</div>
<?php endif; ?>
</div>
<button type="submit" class="btn btn-primary">حفظ رد العرض</button>
</form>
<script>
document.addEventListener('DOMContentLoaded', function () {
if (typeof lucide !== 'undefined') lucide.createIcons();
});
</script>
<?php $__template->endSection(); ?>
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