<form action="<?= e(url('configuracion/fiscal')) ?>" method="post">
    <?= csrf_field() ?>
    <div class="row g-2">
        <div class="col-md-6">
            <label class="form-label">Regimen fiscal</label>
            <select class="form-select" name="regimen_fiscal">
                <option value="comun" <?= $regimenFiscal === 'comun' ? 'selected' : '' ?>>Comun</option>
                <option value="simplificado" <?= $regimenFiscal === 'simplificado' ? 'selected' : '' ?>>Simplificado</option>
                <option value="gran_contribuyente" <?= $regimenFiscal === 'gran_contribuyente' ? 'selected' : '' ?>>Gran contribuyente</option>
                <option value="persona_natural" <?= $regimenFiscal === 'persona_natural' ? 'selected' : '' ?>>Persona natural</option>
            </select>
        </div>
        <div class="col-md-6">
            <label class="form-label">Ambiente facturacion</label>
            <select class="form-select" name="ambiente_facturacion">
                <option value="pruebas" <?= $ambienteFacturacion === 'pruebas' ? 'selected' : '' ?>>Pruebas</option>
                <option value="produccion" <?= $ambienteFacturacion === 'produccion' ? 'selected' : '' ?>>Produccion</option>
            </select>
        </div>
        <div class="col-md-6">
            <label class="form-label">Prefijo factura</label>
            <input class="form-control" name="prefijo_factura" maxlength="20" value="<?= e((string) old('prefijo_factura', (string) ($fiscalSettings['prefijo_factura'] ?? ''))) ?>">
        </div>
        <div class="col-md-6">
            <label class="form-label">Resolucion DIAN</label>
            <input class="form-control" name="resolucion_dian" maxlength="80" value="<?= e((string) old('resolucion_dian', (string) ($fiscalSettings['resolucion_dian'] ?? ''))) ?>">
        </div>
        <div class="col-12">
            <label class="form-label">Actividad economica</label>
            <input class="form-control" name="actividad_economica" maxlength="120" value="<?= e((string) old('actividad_economica', (string) ($fiscalSettings['actividad_economica'] ?? ''))) ?>">
        </div>
    </div>

    <div class="form-check mt-3">
        <input type="hidden" name="responsable_iva" value="0">
        <input class="form-check-input" type="checkbox" value="1" id="configResponsableIva" name="responsable_iva" <?= $responsableIva ? 'checked' : '' ?>>
        <label class="form-check-label" for="configResponsableIva">
            Responsable de IVA
        </label>
    </div>

    <div class="d-flex flex-wrap gap-2 mt-3">
        <button class="btn btn-primary" type="submit">Guardar configuracion fiscal</button>
    </div>
</form>
