<?php
    $doc = $inv ?? $quote ?? null;
    $selectedCustomerId = old('customer_id', $doc?->customer_id ?? request('customer_id'));
    $placeOfSupply = old('place_of_supply', $doc?->place_of_supply ?? '');
    $taxOn = old('tax_on', $doc?->tax_on ?? 'bill_to');
?>
<?php if($gstEnabled ?? false): ?>
<div class="billing-gst-client-panel mt-3" id="gst-client-panel">
    <div class="row g-3">
        <div class="col-lg-6">
            <div class="billing-gst-client-info card border-0 bg-light" id="gst-client-info">
                <div class="card-body py-3 small">
                    <p class="text-muted mb-2" id="gst-client-placeholder">Select a client to view billing and tax details.</p>
                    <div id="gst-client-details" class="d-none">
                        <p class="mb-1 fw-medium" id="gst-client-billing"></p>
                        <p class="mb-1"><span class="text-muted">GSTIN:</span> <span id="gst-client-gstin">—</span></p>
                        <p class="mb-0"><span class="text-muted">Taxation type:</span> <span id="gst-client-treatment">—</span></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="row g-2">
                <div class="col-md-6">
                    <label class="form-label">Tax selection on</label>
                    <select name="tax_on" id="tax_on" class="form-select form-select-sm">
                        <option value="bill_to" <?php if($taxOn === 'bill_to'): echo 'selected'; endif; ?>>Bill To</option>
                        <option value="ship_to" <?php if($taxOn === 'ship_to'): echo 'selected'; endif; ?>>Ship To</option>
                    </select>
                </div>
                <div class="col-md-6">
                    <label class="form-label">Place of supply</label>
                    <select name="place_of_supply" id="place_of_supply" class="form-select form-select-sm" required>
                        <option value="">Select state</option>
                        <?php $__currentLoopData = $indianStates ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $state): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($state); ?>" <?php if($placeOfSupply === $state): echo 'selected'; endif; ?>><?php echo e($state); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
            </div>
            <p class="small text-muted mt-2 mb-0" id="gst-supply-hint">
                Same state as your company → CGST + SGST. Different state → IGST.
            </p>
        </div>
    </div>
</div>
<?php endif; ?>
<?php /**PATH /Applications/XAMPP/xamppfiles/htdocs/cms/account/billing-system/resources/views/partials/admin/gst-form-fields.blade.php ENDPATH**/ ?>