<?php ($asset = $asset ?? null); ?>

<div style="display:grid; grid-template-columns: repeat(2, 1fr); gap:16px;">
    <div class="form-group">
        <label class="form-label" for="asset_code">Asset Code</label>
        <input class="input" type="text" id="asset_code" name="asset_code" value="<?php echo e(old('asset_code', $asset?->asset_code)); ?>" required>
    </div>
    <div class="form-group">
        <label class="form-label" for="name">Name</label>
        <input class="input" type="text" id="name" name="name" value="<?php echo e(old('name', $asset?->name)); ?>" required>
    </div>
    <div class="form-group">
        <label class="form-label" for="category">Category</label>
        <input class="input" type="text" id="category" name="category" value="<?php echo e(old('category', $asset?->category)); ?>" placeholder="e.g. Buildings, Vehicles">
    </div>
    <div class="form-group">
        <label class="form-label" for="purchase_date">Purchase Date</label>
        <input class="input" type="date" id="purchase_date" name="purchase_date" value="<?php echo e(old('purchase_date', optional($asset?->purchase_date)->format('Y-m-d'))); ?>">
    </div>
    <div class="form-group">
        <label class="form-label" for="purchase_cost">Purchase Cost</label>
        <input class="input" type="number" step="0.01" min="0" id="purchase_cost" name="purchase_cost" value="<?php echo e(old('purchase_cost', $asset?->purchase_cost ?? 0)); ?>" required>
    </div>
    <div class="form-group">
        <label class="form-label" for="salvage_value">Salvage Value</label>
        <input class="input" type="number" step="0.01" min="0" id="salvage_value" name="salvage_value" value="<?php echo e(old('salvage_value', $asset?->salvage_value ?? 0)); ?>">
    </div>
    <div class="form-group">
        <label class="form-label" for="useful_life_months">Useful Life (months)</label>
        <input class="input" type="number" min="1" id="useful_life_months" name="useful_life_months" value="<?php echo e(old('useful_life_months', $asset?->useful_life_months)); ?>">
    </div>
    <div class="form-group">
        <label class="form-label" for="depreciation_method">Depreciation Method</label>
        <input class="input" type="text" id="depreciation_method" name="depreciation_method" value="<?php echo e(old('depreciation_method', $asset?->depreciation_method ?? 'straight_line')); ?>">
    </div>
    <div class="form-group">
        <label class="form-label" for="asset_account_id">Asset Account</label>
        <select class="input" id="asset_account_id" name="asset_account_id">
            <option value="">Select account</option>
            <?php $__currentLoopData = $assetAccounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $account): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($account->id); ?>" <?php if(old('asset_account_id', $asset?->asset_account_id) == $account->id): echo 'selected'; endif; ?>>
                    <?php echo e($account->code); ?> — <?php echo e($account->name); ?>

                </option>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
    </div>
    <div class="form-group">
        <label class="form-label" for="depreciation_account_id">Depreciation Account</label>
        <select class="input" id="depreciation_account_id" name="depreciation_account_id">
            <option value="">Select account</option>
            <?php $__currentLoopData = $depreciationAccounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $account): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($account->id); ?>" <?php if(old('depreciation_account_id', $asset?->depreciation_account_id) == $account->id): echo 'selected'; endif; ?>>
                    <?php echo e($account->code); ?> — <?php echo e($account->name); ?>

                </option>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
    </div>
    <div class="form-group">
        <label class="form-label" for="location">Location</label>
        <input class="input" type="text" id="location" name="location" value="<?php echo e(old('location', $asset?->location)); ?>">
    </div>
    <div class="form-group">
        <label class="form-label" for="serial_number">Serial Number</label>
        <input class="input" type="text" id="serial_number" name="serial_number" value="<?php echo e(old('serial_number', $asset?->serial_number)); ?>">
    </div>
    <div class="form-group">
        <label class="form-label" for="status">Status</label>
        <input class="input" type="text" id="status" name="status" value="<?php echo e(old('status', $asset?->status ?? 'active')); ?>">
    </div>
    <div class="form-group" style="grid-column: span 2;">
        <label class="form-label" for="notes">Notes</label>
        <textarea class="input" id="notes" name="notes" rows="3"><?php echo e(old('notes', $asset?->notes)); ?></textarea>
    </div>
</div>
<?php /**PATH C:\laragon\www\southend\resources\views\admin\fixed-assets\_form.blade.php ENDPATH**/ ?>