
<?php $__env->startSection('styles'); ?>
<style>
    body{overflow-x:hidden;}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<?php $__env->startSection('content'); ?>
    <div class="row" id="basic-table">
        <div class="col-12">
            <div class="card">
                <div class="card-header mt-2">
                    <h5 class="card-title">Generar Nota de Cr&eacute;dito</h5>
                </div>
                <div class="card-body">
                    <form id="form_save_credit_note" class="form form-vertical">
                        <?php echo csrf_field(); ?>
                        <div class="row">
                            <div class="col-12 col-md-3 mb-3">
                                <label class="form-label" for="idtipo_comprobante">Tipo Comprobante</label>
                                <input type="hidden" name="idfactura_anular" value="<?php echo e($idfactura_anular); ?>">
                                <select class="form-control" id="idtipo_comprobante"
                                    name="idtipo_comprobante" disabled>
                                    <?php $__currentLoopData = $type_documents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type_document): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($type_document->id); ?>"><?php echo e($type_document->descripcion); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>

                            <div class="col-12 col-md-2 mb-3">
                                <label class="form-label" for="serie">Serie</label>
                                <input type="text" id="serie" class="form-control text-uppercase"
                                    name="serie" value="<?php echo e($serie->serie); ?>" />
                            </div>

                            <div class="col-12 col-md-2 mb-3">
                                <label class="form-label" for="correlativo">N&uacute;mero</label>
                                <input type="text" id="correlativo" class="form-control text-uppercase"
                                    name="correlativo" value="<?php echo e($serie->correlativo); ?>" />
                            </div>

                            <div class="col-md-1"></div>

                            <div class="col-12 col-md-2 mb-3">
                                <label class="form-label" for="fecha_emision">Fecha de emisión</label>
                                <input type="date" id="fecha_emision" class="form-control"
                                    name="fecha_emision" value="<?php echo e(date('Y-m-d')); ?>">
                            </div>

                            <div class="col-12 col-md-2 mb-3">
                                <label class="form-label" for="fecha_vencimiento">Fecha de vencimiento</label>
                                <input type="date" id="fecha_vencimiento" class="form-control"
                                    name="fecha_vencimiento" value="<?php echo e(date('Y-m-d')); ?>">
                            </div>

                            <div class="col-12 col-md-7 mb-3">
                                <div class="form-group">
                                    <label class="form-label" for="dni_ruc">Motivo / Sustentación</label>
                                    <input type="text" id="motivo" class="form-control text-uppercase" name="motivo" value="Anulacion de la operacion">
                                    <div class="invalid-feedback">El campo no debe quedar vacío</div>
                                </div>
                            </div>

                            <div class="col-md-1"></div>

                            <div class="col-12 col-md-4 mb-3">
                                <label class="form-label" for="tipo_nc">Tipo nota de crédito</label>
                                <select class="form-control" id="tipo_nc" name="tipo_nc">
                                    <?php $__currentLoopData = $type_credit_notes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type_credit_note): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($type_credit_note->id); ?>"> <?php echo e($type_credit_note->descripcion); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>

                            <div class="col-12 col-md-7 mb-3">
                                <div class="form-group">
                                    <label class="form-label" for="cliente">Cliente</label>
                                    <input type="text" id="cliente" class="form-control" name="cliente" value="<?php echo e($factura->cliente); ?>">
                                </div>
                            </div>

                            <div class="col-md-1"></div>

                            <div class="col-12 col-md-2 mb-3">
                                <div class="form-group">
                                    <label class="form-label" for="tipo_cambio">Tipo de cambio</label>
                                    <input type="text" id="tipo_cambio" class="form-control"
                                        name="tipo_cambio" value="0.00" readonly>
                                </div>
                            </div>

                            <div class="col-12 col-md-2 mb-3">
                                <div class="form-group">
                                    <label class="form-label" for="modo_pago">Pago:</label>
                                    <select class="form-control" id="modo_pago" name="modo_pago">
                                        <?php $__currentLoopData = $modo_pagos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $modo_pago): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if($factura->modo_pago == $modo_pago->id): ?>
                                                <option value="<?php echo e($modo_pago->id); ?>" selected><?php echo e($modo_pago->descripcion); ?></option>
                                            <?php else: ?>
                                                <option value="<?php echo e($modo_pago->id); ?>"><?php echo e($modo_pago->descripcion); ?></option>
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            </div>
                        </div>

                        <div class="row invoice-add mt-3">
                            <div class="col-md-12">
                                <div class="table-responsive-sm">
                                    <table class="table table-sm">
                                        <thead>
                                            <tr>
                                                <th width="8%" class="text-center">#</th>
                                                <th class="">Descripción</th>
                                                <th class="text-center">Und.</th>
                                                <th class="text-center" width="13%">&nbsp;&nbsp;&nbsp;Cantidad&nbsp;&nbsp;&nbsp;</th>
                                                <th class="text-center" width="14%">Precio Unitario</th>
                                                <th class="text-center" width="10%">Total</th>
                                            </tr>
                                        </thead>
                                        <tbody id="tbody_sale_notes">
                                            <?php $__currentLoopData = $detalle; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <td class="text-center"><?php echo e($i + 1); ?></td>
                                                <td><?php echo e($product["producto"]); ?></td>
                                                <td class="text-center"><?php echo e($product["unidad"]); ?></td>
                                                <td class="text-center"><?php echo e($product["cantidad"]); ?></td>
                                                <td class="text-center"><?php echo e($product["precio_unitario"]); ?></td>
                                                <td class="text-center"><?php echo e(number_format(($product["precio_unitario"] * $product["cantidad"]), 2, ".", "")); ?></td>
                                            </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <div class="col-md-12 d-flex justify-content-end -0 p-sm-4">
                                <div id="wrapper_totals" class="invoice-calculations">
                                    <div class="d-flex justify-content-between mb-2">
                                            <span class="w-px-100">OP. Gravadas:</span>
                                            <span class="fw-medium">S/<?php echo e(number_format(($factura['exonerada'] + $factura['gravada'] + $factura['inafecta']), 2, ".", "")); ?></span>
                                        </div>
                                        <div class="d-flex justify-content-between mb-2">
                                            <span class="w-px-100">IGV:</span>
                                            <span class="fw-medium">S/<?php echo e(number_format($factura['igv'], 2, ".", "")); ?></span>
                                        </div>
                                        <hr>
                                        <div class="d-flex justify-content-between">
                                            <span class="w-px-100">Total:</span>
                                            <span class="fw-medium">S/<?php echo e(number_format($factura['total'], 2, ".", "")); ?></span>
                                    </div>
                                </div>
                            </div>

                            <div class="col-12">
                                <div class="col-12 text-end">
                                    <a href="<?php echo e(route('admin.billings')); ?>" class="btn btn-secondary">Cancelar</a>
                                    <button type="button" class="btn btn-primary btn-save">
                                        <span class="text-save">Guardar </span>
                                        <span class="spinner-border spinner-border-sm text-saving d-none" role="status"
                                            aria-hidden="true"></span>
                                        <span class="ml-25 align-middle text-saving d-none">Guardando...</span>
                                    </button>
                                </div>
                            </div>


                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<?php echo $__env->make('admin.credit_notes.js-create', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.template', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\mytems2.0\ventas\resources\views/admin/credit_notes/create.blade.php ENDPATH**/ ?>