

<?php $__env->startSection('content'); ?>

<!-- Content wrapper scroll start -->
<div class="content-wrapper-scroll">

<!-- Content wrapper start -->
<div class="content-wrapper">
<?php if(empty(session()->get('discount')) || null): ?>
<?php if(!empty($cartItems)): ?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
HELLO <?php echo e(@strtoupper(auth()->user()->name)); ?>! YOU DID NOT COMPLETE YOUR LAST TRANSACTION. COMPLETE INVOICE OR <a href="<?php echo e(route('deleteDump')); ?>">REGENRATE CREATE NEW INVOICE</a>
    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<?php else: ?>
<?php endif; ?>
<?php endif; ?>

<div style="padding:15px" class="card">
 <!-- Field wrapper start -->
 <div class="field-wrapper">
            <div class="input-group">
                <input class="form-control" placeholder="Click Here, Scan Bar Code Or search by Item Code" type="text" autofocus autocomplete="off" id="barcode" onchange="getBarcode()">
                <span class="input-group-text">
                    <button class="btn btn-primary btn-sm" type="button" onClick="autofocusBarcode()">
                        <span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span>
                        Enable Scan
                    </button>
                </span>
            </div>
            <div class="field-placeholder">Scan Barcode</div>
        </div>
        <!-- Field wrapper end -->
<form id="newinvoice">
    <?php echo csrf_field(); ?>
<!-- Row start -->
<div class="row gutters">
    
    <div class="col-xl-12 col-lg-12 col-md-12 col-sm-4 col-12">
        <div class="form-section-header">New Invoice <span style="float:right" class="badge bg-info"><?php echo e(auth()->user()->branch); ?></span></div>

    </div>
    <div class="col-xl-4 col-lg-4 col-md-4 col-sm-4 col-12">
        
     <!-- Field wrapper start -->
     <div class="field-wrapper">
            <select name="invoice_product_name" class="select-single js-states" title="Select Product Category"  id="ddlViewBy" data-live-search="true">
            <option selected disabled>Select Item</option>
                    <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($product->FinalProductionID); ?>" 
                            <?php
                                if (empty($product->activated_branches)) {
                                    echo '';
                                }else {
                                    echo in_array(auth()->user()->branch, json_decode($product->activated_branches)) == true ? 'disabled' : '';
                                }
                             ?>>
                             [<?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo @strtoupper($product->UnitPrice); ?>]  <?php echo @strtoupper($product->Name); ?>

                            </option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
            <div class="field-placeholder">Product Name</div>
        </div>
        <!-- Field wrapper end -->
        
    </div>
    <div class="col-xl-4 col-lg-4 col-md-4 col-sm-4 col-12">
        
        <!-- Field wrapper start -->
        <div class="field-wrapper">
            <div class="input-group">
                <input class="form-control" type="text" value="1" id="quantity" name="invoice_quantity" onKeyUp="calculateTotal()">
                <span class="input-group-text">
                <i class="fa fa-calculator" aria-hidden="true"></i>
                </span>
            </div>
            <div class="field-placeholder">Quantity</div>
        </div>
        <!-- Field wrapper end -->

    </div>
    
    <div class="col-xl-4 col-lg-4 col-md-4 col-sm-4 col-12">
        
        <!-- Field wrapper start -->
        <div class="field-wrapper">
            <div class="input-group">
                <select name="status" onchange="getValue()" id="getStatus" class="select-single js-states" title="Select Product Category">
                    <option value="General">General</option>
                    <option value="On The House" id="On The House">On The House</option>
                </select>
            </div>
            <div class="field-placeholder">Order Type</div>
        </div>
        <!-- Field wrapper end -->

    </div>
    
    <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">

    <input type="text" value="" readonly name="category" id="category" hidden>

    </div>
    <?php if(auth()->user()->sales_person_category == "Delivery"): ?>
    <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
        <button class="btn btn-outline-primary rounded-pill stripes-btn"><i class="icon-shopping-cart1" aria-hidden="true"></i> Add to Cart</button> 
    </div>
    <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12" style="float:right">
     <button class="btn btn-outline-primary rounded-pill stripes-btn" type="button"><i class="fa fa-motorcycle" aria-hidden="true"></i> Add Delivery</button>
    </div>
    <?php else: ?>
    <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
    <button class="btn btn-outline-primary rounded-pill stripes-btn" ><i class="icon-shopping-cart1" aria-hidden="true"></i> Add to Cart</button> 
    </div>
    <?php endif; ?>
    
</div>
<!-- Row end -->
</form>
</div>

<div id="tabler">
<?php if(empty($checkseesion)): ?>
    <!-- Card start -->
    <div class="card">
        <div class="card-body">
            <div class="alert alert-primary alert-dismissible fade show" role="alert">
                    No Item added to cart. Kindly select Item and add to cart or use Barcode
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
            
        </div>
    </div>
    <!-- Card end -->
    <?php else: ?>  
                         
<table class="table table-bordered table-striped table-sm">
    <thead>
        <tr>
            <th colspan="7" class="pt-3 pb-3">Invoice Details</th>
        </tr>
        <tr>
            <th width="45%">Product</th>
            <th width="25%">Category</th>
            <th width="50%">Quantity</th>
            <th>Price</th>
            <th>Amount (Net)</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
    <?php $__currentLoopData = $cartItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $cart): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <tr class="trhidden<?php echo e($cart['id']); ?>">
            <td><select class="form-control"><option><?php echo @strtoupper($cart['invoice_product_name']); ?></option></select></td>
           <td><input type="text" value="<?php echo e(@strtoupper($cart['item_category'])); ?>" class="form-control" readonly></td>
            <td>
                <div class="input-group">
                    <div class="d-flex mb-4" style="max-width: 300px">
                            <button class="btn btn-light btn-sm" id="<?php echo e($cart['id']); ?>" onclick="decrease(id)">
                            <i class="icon-minus"></i>
                            </button>
        
                            <div class="form-outline">
                            <input min="1" readonly type="number" id="qty<?php echo e($cart['id']); ?>" id="qty<?php echo e($cart['id']); ?>" value="<?php echo e($cart['invoice_quantity']); ?>" name="quantity"  class="form-control" />
                            </div>
        
                            <button class="btn btn-light btn-sm" id="<?php echo e($cart['id']); ?>" onclick="increase(id)">
                            <i class="icon-plus1"></i>
                            </button>
                    </div>
                    <!-- Quantity -->
                </div>
            </td>
            <td>
                <!-- Field wrapper start -->
                <div class="field-wrapper m-0">
                    <input type="text" readonly class="form-control" value="<?php echo number_format($cart['invoice_unit_price'], 2); ?>" id="ItemPrice<?php echo e($cart['id']); ?>">
                </div>
                <!-- Field wrapper end -->
            </td>
            <td>
                <!-- Field wrapper start -->
                <div class="field-wrapper m-0">
                    <input type="text" id="demo<?php echo e($cart['id']); ?>" readonly class="form-control" value="<?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($cart['invoice_unit_price'] * $cart['invoice_quantity'], 2); ?>">
                </div>
                <!-- Field wrapper end -->
            </td>
            
            <td>
                <div class="table-actions">
                    <button class="btn btn-light" id="<?php echo e($cart['id']); ?>" onClick="DeleteItem(this.id)">
                        <i class="icon-trash-2"></i>
                    </button>
                </div>
            </td>
        </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <tr>
            <td colspan="6">
                <div class="row gutters justify-content-end">
                    <div class="col-auto">
                        <label class="col-form-label">Discount % / <?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?> of Total Amount</label>
                    </div>
                    <div class="col-auto" style="max-width: 90px;">
                        <!-- Discount Button trigger modal -->
                        <button type="button" class="btn btn-primary mb-2" data-bs-toggle="modal" data-bs-target="#exampleModalSmall">
                            % Add Discount
                        </button>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="4">&nbsp;</td>
            <td colspan="2">
                <p class="m-0">Subtotal</p>
                <p class="m-0">Discount</p>
                <p class="m-0">VAT</p>
                <h5 class="mt-2">Total Amount</h5>
            </td>
            <td>
            <div id="subtotals">
                <p class="m-0"><?php echo number_format(empty($checkseesion) ? 0 : $totalCart, 2); ?></p>
                <p class="m-0" id="discounting">
                    <?php
                        if (empty(session()->get('discount'))) {
                            echo empty($app->currency) ? "GHS" : $app->currency . "0.00";
                        }else {
                           if (session()->get('discount')['type'] == "Cash") {
                            echo empty($app->currency) ? "GHS" : $app->currency . session()->get('discount')['discount'];
                           }elseif (session()->get('discount')['type']== "Percentage") {
                            echo  session()->get('discount')['discount'] . "%";
                          }
                        }

                    ?>
                </p>
                <p class="m-0"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?>0.00</p>
                <?php if(empty(session()->get('discount'))): ?>
                <h5 class="mt-2" id="tcost"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format(empty($checkseesion) ? 0 : $totalCart, 2); ?></h5>
                <?php else: ?>
                <?php if(session()->get('discount')['type'] == "Percentage"): ?>
                <h5 class="mt-2" id="tcost"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?> <?php echo number_format($totalCart * ((100 - session()->get('discount')['discount']))/100, 2); ?></h5>
                <?php else: ?>
                <h5 class="mt-2" id="tcost"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?> <?php echo number_format($totalCart - session()->get('discount')['discount'], 2); ?></h5>
                <?php endif; ?>
                <?php endif; ?>
                </div>
            </td>
        </tr>
    </tbody>
</table>
<?php endif; ?>
</div>

<!-- Row start -->
<div class="row gutters">

<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
    <div class="form-actions-footer">
    
        <div class="text-end">
            <!-- Discount Button trigger modal -->
            <button type="button"  class="btn btn-outline-success ms-1" data-bs-toggle="modal" data-bs-target="#exampleModalSmallceleb">
            <i class="icon-gift"></i> Gift Cards
            </button>
            <a href="#" class="btn btn-outline-secondary ms-1" data-bs-toggle="modal" data-bs-target="#staticBackdropTingging">Accept Payment</a>
            <a href="#" onclick="confirmCreateNew()" class="btn btn-outline-dark ms-1"> <i class="icon-pause1"></i> New Invoice</a>
             <button class="btn btn-outline-primary ms-1" onclick="saveDraft()"><i class="icon-drafts"></i> Save Draft</button>
            <a href="#" onclick="confirmInvoice()" class="btn btn-outline-info ms-1"><i class="icon-receipt"></i> Generate Receipt</a>
        </div>
    </div>
</div>

</div>
<!-- Row end -->

</div>
<!-- Content wrapper end -->



<!-- Modal start -->
<div class="modal fade" id="exampleModalSmall" tabindex="-1" aria-labelledby="exampleModalSmallTitle" aria-hidden="true">
    <div class="modal-dialog modal-center">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalSmallTitle">APPLY COUPON</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body" id="dis">
            <form id="discountAmount">
                <?php echo csrf_field(); ?>
                <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
												
                    <!-- Field wrapper start -->
                    <div class="field-wrapper">
                    <select name="type" class="select-single js-states">
                        <option value="Percentage">PERCENTAGE</option>
                        <option value="Cash">CASH</option>
                    </select>
                        <div class="field-placeholder">Type <span class="text-danger">*</span></div>
                    </div>
                    <!-- Field wrapper end -->

                </div>
                <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
												
                    <!-- Field wrapper start -->
                    <div class="field-wrapper">
                        <input class="form-control" type="number" step="0.01" name="discount" required>
                        <div class="field-placeholder">Amount or % <span class="text-danger">*</span></div>
                    </div>
                    <!-- Field wrapper end -->

                </div>
                
                <button type="submit" class="btn btn-outline-primary">Apply</button>
            </form>
           
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal" id="cancelCoupon">Cancel</button>
            </div>
        </div>
    </div>
</div>
<!-- Modal end -->




<!-- Modal start -->
<div class="modal fade" id="exampleModalSmallceleb" tabindex="-1" aria-labelledby="exampleModalSmallTitle" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalSmallTitle">COUPON CODE & GIFT CARD</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body" id="disinf" >
            
            <form id="discountAmountCoupon">
                <?php echo csrf_field(); ?>
                <input type="text" name="type" value="Percentage" hidden>
                <input  type="text" name="submit_celeb" hidden value="Apply Code">
                <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
												
                    <!-- Field wrapper start -->
                    <div class="field-wrapper">
                        <input class="form-control" placeholder="Coupon Code Or Scan Gift Card" type="text" name="discount_code" autocomplete="off">
                        <div class="field-placeholder">Coupon code<span class="text-danger">*</span></div>
                    </div>
                    <!-- Field wrapper end -->

                </div>
                <input  type="submit" name="submit_celeb" id="" value="Apply Code" class="btn btn-outline-primary">
            </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal" id="cancelgift">Cancel</button>
            </div>
        </div>
    </div>
</div>
<!-- Modal end -->






    <!-- Modal on the house start -->
    <div class="modal fade" id="onthehouse" tabindex="-1" aria-labelledby="exampleModalSmallTitle" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalSmallTitle">No Charge Form</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                <?php echo $__env->make('inc.onhouse', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
                </div>
            </div>
        </div>
    </div>
    <!-- Modal end -->


     <!-- Tingg Modal -->
     <?php echo $__env->make('tingg.invoice-payment-modal', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

</div>
<!-- Content wrapper scroll end -->



<script type="text/javascript">
    
    $("#newinvoice").on('submit', function(event) {
            event.preventDefault();
            $.ajax({
                type: "post",
                url: "<?php echo e(route('InvoiceDump')); ?>",
                dataType: "json",
                data: $('#newinvoice').serialize(),
                success: function(data){
                    document.getElementById('quantity').value = "1";
                    $("#tabler").load(" #tabler");

                    const Toast = Swal.mixin({
                    toast: true,
                    position: 'top-right',
                    showConfirmButton: false,
                    timer: 3000,
                    timerProgressBar: true,
                    didOpen: (toast) => {
                        toast.addEventListener('mouseenter', Swal.stopTimer)
                        toast.addEventListener('mouseleave', Swal.resumeTimer)
                    }
                    })

                    Toast.fire({
                    icon: 'success',
                    title: 'Item Added to Cart, add new Item'
                    })
                },
                error: function(data){
                    Swal.fire({
                    icon: 'error',
                    title: 'Oops...',
                     text: 'Something went wrong!',
                    footer: '<a href="">Why do I have this issue?</a>'
                    })
                }
            });
        });


        $("#discountAmount").on('submit', function(event) {
            event.preventDefault();
            $.ajax({
                type: "post",
                url: "<?php echo e(route('OrderDiscount')); ?>",
                dataType: "json",
                data: $('#discountAmount').serialize(),
                success: function(data){
                    $("#subtotals").load(" #subtotals");
                    document.getElementById('cancelCoupon').click();
                    const Toast = Swal.mixin({
                    toast: true,
                    position: 'bottom-right',
                    showConfirmButton: false,
                    timer: 3000,
                    timerProgressBar: true,
                    didOpen: (toast) => {
                        toast.addEventListener('mouseenter', Swal.stopTimer)
                        toast.addEventListener('mouseleave', Swal.resumeTimer)
                    }
                    })

                    Toast.fire({
                    icon: 'success',
                    title: 'Discount Applied Successfully'
                    })
                   
                },
                error: function(data){
                    Swal.fire({
                    icon: 'error',
                    title: 'Oops...',
                     text: 'Something went wrong!',
                    footer: '<a href="">Why do I have this issue?</a>'
                    })
                }
            });
        });


        $("#discountAmountCoupon").on('submit', function(event) {
            event.preventDefault();
            $.ajax({
                type: "post",
                url: "<?php echo e(route('OrderDiscount')); ?>",
                dataType: "json",
                data: $('#discountAmountCoupon').serialize(),
                success: function(data){
                    $("#subtotals").load(" #subtotals");
                    document.getElementById('cancelgift').click();
                    const Toast = Swal.mixin({
                    toast: true,
                    position: 'bottom-right',
                    showConfirmButton: false,
                    timer: 3000,
                    timerProgressBar: true,
                    didOpen: (toast) => {
                        toast.addEventListener('mouseenter', Swal.stopTimer)
                        toast.addEventListener('mouseleave', Swal.resumeTimer)
                    }
                    })

                    Toast.fire({
                    icon: 'success',
                    title: 'Discount Applied to Order'
                    })
                },
                error: function(data){
                    Swal.fire({
                    icon: 'error',
                    title: 'Oops...',
                    text: 'Something went wrong! Mismatch Coupon Code or Gift Card',
                    footer: '<a href="">Why do I have this issue?</a>'
                    })
                }
            });
        });

        function calculateTotal() {
            quantity = document.getElementById("quantity").value;
            price = document.getElementById("price").value;
            // document.getElementById("result").innerHTML = num1 * num2;
            document.getElementById("total").value = quantity*price;
        }


        function saveDraft() {

            Swal.fire({
            title: 'Are you sure?',
            text: "This Invoice will be saved as Draft Invoice!",
            icon: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Yes, Save as Draft!'
            }).then((result) => {
            if (result.isConfirmed) {
                const xhttp = new XMLHttpRequest();
                xhttp.onload = function() {
                    $("#tabler").load(" #tabler");
                    Swal.fire(
                        'Saved to Draft!',
                        'This Invoice is Saved as Draft',
                        'success'
                        )
                }
                xhttp.open("GET", "/ceqa-dashboard/generate-draft-invoice");
                xhttp.send();
            }
            })
            
        }


        function DeleteItem(id) {
            // $('.trhidden'+id).hide();
            const xhttp = new XMLHttpRequest();
            xhttp.onload = function() {
                $("#tabler").load(" #tabler");
            }
            xhttp.open("GET", "/ceqafoods/delete-item/"+id);
            xhttp.send();
            
        }

        function increase(id) {
            document.getElementById('qty'+ id).stepUp()
            var quantity = document.getElementById('qty'+ id).value;
            var price = document.getElementById('ItemPrice'+ id).value;
            // var quantity = (++quantity)
            document.getElementById('demo'+ id).value = quantity * price;

            const xhttp = new XMLHttpRequest();
            xhttp.onload = function() {

                $("#subtotals").load(" #subtotals");

            }
            xhttp.open("GET", "/increase-cart/"+id + "/" + quantity);
            xhttp.send();
        }


        function decrease(id) {
            document.getElementById('qty'+ id).stepDown()
            var quantity = document.getElementById('qty'+ id).value;
            var price = document.getElementById('ItemPrice'+ id).value;
            // var quantity = (++quantity)
            document.getElementById('demo'+ id).value = quantity * price;

            const xhttp = new XMLHttpRequest();
            xhttp.onload = function() {

                $("#subtotals").load(" #subtotals");

            }
            xhttp.open("GET", "/decrease-cart/"+id + "/" + quantity);
            xhttp.send();
        }

        function confirmInvoice() {
            Swal.fire({
                title: 'Generate Receipt, Are you sure?',
                text: "You won't be able to revert this!",
                icon: 'warning',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Yes, Save And Print Receipt!'
                }).then((result) => {
                if (result.isConfirmed) {
                    window.location.href = "<?php echo e(route('generateInvoice')); ?>"
                }
                })
        }

        function getPrice() {
            var e = document.getElementById("ddlViewBy");

            const xhttp = new XMLHttpRequest();
            xhttp.onload = function() {
                $da = JSON.parse(this.responseText);
                document.getElementById("price").value = $da.price;
                document.getElementById("category").value = $da.category;
                quantity = document.getElementById("quantity").value;
                price = document.getElementById("price").value;
                document.getElementById("total").value = quantity*price;


            }
            xhttp.open("GET", "/get-product-price/"+e.value);
            xhttp.send();
            
        }

        function confirmCreateNew() {
            Swal.fire({
                title: 'Are you sure?',
                text: "Are you sure you want to void transaction?",
                icon: 'warning',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Yes, create New Invoice!'
                }).then((result) => {
                if (result.isConfirmed) {
                    window.location.href = "<?php echo e(route('deleteDump')); ?>";
                }
                })
        }



        function autofocusBarcode(){
            document.getElementById('barcode').focus();
        }


        function getBarcode(){
            
            var barcode = document.getElementById('barcode').value;
            document.getElementById('barcode').value = "";
            const xhttp = new XMLHttpRequest();
            xhttp.onload = function() {

                if (this.responseText === "empty") {
                    document.getElementById('barcode').value = "";

                    Swal.fire({
                    icon: 'error',
                    title: 'Oops...',
                     text: 'Something went wrong! There May be no matching Item to scanned Product',
                    footer: '<a href="">Why do I have this issue?</a>'
                    })

                }else{
                    
                    $("#tabler").load(" #tabler");

                    const Toast = Swal.mixin({
                    toast: true,
                    position: 'top-right',
                    showConfirmButton: false,
                    timer: 3000,
                    timerProgressBar: true,
                    didOpen: (toast) => {
                        toast.addEventListener('mouseenter', Swal.stopTimer)
                        toast.addEventListener('mouseleave', Swal.resumeTimer)
                    }
                    })

                    Toast.fire({
                    icon: 'success',
                    title: 'Item Added to Cart, add new Item'
                    })
                }
            }
            xhttp.open("GET", "/barcode-search/"+barcode);
            xhttp.send();
        }


        function getValue() {
            var e = document.getElementById("getStatus");
            if (e.value === "On The House") {
                $('#onthehouse').modal('show')
            }else{
                console.log("error")
            }
        }
</script>


<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home2/morttacy/morttsonsposfiles/resources/views/invoice/create-invoice.blade.php ENDPATH**/ ?>