/
home
/
sjslayjy
/
public_html
/
olddevlok
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('title','Generate Invoice'); ?> <?php $__env->startSection('content'); ?> <div class="main-content"> <div class="main-content-inner"> <div class="breadcrumbs ace-save-state" id="breadcrumbs"> <ul class="breadcrumb"> <li> <i class="ace-icon fa fa-home home-icon"></i> <a href="#">Home</a> </li> <li><a href="<?php echo e('/user/generated-invoices'); ?>">Generated Invoices</a></li> <li class="active">Generate Invoice</li> </ul> </div> <div class="page-content"> <div class="page-header"> <h1> Generate Invoice </h1> </div><!-- /.page-header --> <form action="<?php echo e(url('/user/generated-invoice')); ?>" method="post" role="form" id="generateInvoiceForm" enctype="multipart/form-data"> <?php echo e(csrf_field()); ?> <div class="container"> <div class="row"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">Invoice Generation Form</h3> </div> <div class="panel-body"> <div class="col-md-4"> <div class="form-group"> <label for="invoice_type_id">Invoice Type</label> <select class="form-control select2" name="invoice_type_id" id="invoice_type_id"> <option value="">Select Invoice Type</option> <?php $__currentLoopData = $invoice_types; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invoice_type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($invoice_type->id); ?>"><?php echo e($invoice_type->invoice_type); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <?php if($errors->has('invoice_type_id')): ?> <span class="label label-danger"><?php echo e($errors->first('invoice_type_id')); ?></span> <?php endif; ?> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="company_id">Company</label> <select class="form-control select2" name="company_id" id="company_id"> <?php $__currentLoopData = $companies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $company): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($company->id); ?>"<?php echo $company->id == $acting_company?"selected":""; ?>><?php echo e($company->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <?php if($errors->has('company_id')): ?> <span class="label label-danger"><?php echo e($errors->first('company_id')); ?></span> <?php endif; ?> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="invoice_date">Invoice Date</label> <input type="text" name="invoice_date" id="invoice_date" class="form-control date-picker" readonly=""> <?php if($errors->has('invoice_date')): ?> <span class="label label-danger"><?php echo e($errors->first('invoice_date')); ?></span> <?php endif; ?> </div> </div> <div class="clearfix"></div> <div class="col-md-4"> <div class="form-group"> <label for="retailer_id">Retailer</label> <select class="form-control select2" name="retailer_id" id="retailer_id"> <option value="">Select Retailer</option> <?php $__currentLoopData = $retailers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $retailer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($retailer->id); ?>"><?php echo e($retailer->name." (".$retailer->address.")"); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <?php if($errors->has('retailer_id')): ?> <span class="label label-danger"><?php echo e($errors->first('retailer_id')); ?></span> <?php endif; ?> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="eway_bill_no">e-Way Bill Number</label> <input type="text" name="eway_bill_no" id="eway_bill_no" class="form-control"> <?php if($errors->has('eway_bill_no')): ?> <span class="label label-danger"><?php echo e($errors->first('eway_bill_no')); ?></span> <?php endif; ?> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="invoice_remark">Invoice Remark</label> <input type="text" name="invoice_remark" id="invoice_remark" class="form-control"> </div> </div> <div class="clearfix"></div> <div class="col-md-4"> <div class="form-group"> <label for="dispatched_through">Dispatched Through</label> <input type="text" name="dispatched_through" id="dispatched_through" class="form-control" placeholder="Enter Dispatched Through"> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="destination">Destination</label> <input type="text" name="destination" id="destination" class="form-control" placeholder="Enter Destination"> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="terms_of_delivery">Terms of Delivery</label> <input type="text" name="terms_of_delivery" id="terms_of_delivery" class="form-control"> </div> </div> <div class="clearfix"></div> <div class="col-md-12"> <div class="table table-responsive" style="max-height: 300px;"> <table class="table table-condensed" id="product_details_table"> <thead> <!-- <th>#</th> --> <th>Description of Goods</th> <th>HSN/SAC</th> <th>Quantity</th> <th>Rate</th> <th>Per</th> <th>Amount</th> <th></th> </thead> <tbody> <tr id="row_1"> <!-- <td>1</td> --> <td> <select class="form-control select2" name="product_id[]" id="product_id_1" onchange="getHsnCodeAndType(1)"> <option value="">Select Product</option> <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($product->id); ?>"><?php echo e($product->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </td> <td> <input type="text" class="form-control" name="product_hsn[]" id="product_hsn_1" readonly=""> </td> <td> <input type="text" class="form-control" name="quantity[]" id="quantity_1" placeholder="Enter Quantity" oninput="this.value = this.value.replace(/[^0-9]/g,'')" onkeyup="showProductTotalAmount(1)"> </td> <td> <input type="text" class="form-control" name="product_rate[]" id="product_rate_1" placeholder="Enter Product Rate" onkeyup="showProductTotalAmount(1)" oninput="this.value = this.value.replace(/[^0-9.]/g,'')"> </td> <td> <select class="form-control select2" name="product_unit[]" id="product_unit_1"> <option value="">Select Unit</option> <?php $__currentLoopData = $units; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $unit): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo $unit->id; ?>"><?php echo $unit->unit; ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </td> <td> <input type="text" class="form-control" name="product_total_amount[]" id="product_total_amount_1" readonly=""> </td> <td></td> </tr> </tbody> </table> </div> </div> <div class="col-md-12"> <input type="button" class="btn btn-success" value="Add More Product" onclick="addMoreRow()"> </div> <div class="pull-right"> <a href="<?php echo e(URL('/user/generate-invoice')); ?>" class="btn btn-default" >Reset</a> <button type="submit" id="saveInvoiceDetails" name="saveGenerateInvoiceForm" class="btn btn-primary">Generate Invoice</button> </div> </div> </div> </div> </div> </form> </div> </div><!-- /.page-content --> </div><!-- /.main-content --> <?php $__env->startSection('script'); ?> <?php echo e(Html::script("assets/js/ace-elements.min.js")); ?> <?php echo e(Html::script("assets/js/ace.min.js")); ?> <?php echo e(Html::script("assets/js/bootstrap-datepicker.min.js")); ?> <script type="text/javascript"> $(document).ready(function() { $('.date-picker').datepicker({ format: 'dd/mm/yyyy', endDate: '+0d', autoclose: true }); }); function addMoreRow() { var length = $("#product_details_table tr").length; var count = length + 1; var newRow = `<tr id="row_`+count+`"> <td> <select class="form-control select2" name="product_id[]" id="product_id_`+count+`" onchange="getHsnCodeAndType(`+count+`)"> <option value="">Select Product</option> <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($product->id); ?>"><?php echo e($product->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </td> <td> <input type="text" class="form-control" name="product_hsn[]" id="product_hsn_`+count+`" readonly=""> </td> <td> <input type="text" class="form-control" name="quantity[]" id="quantity_`+count+`" placeholder="Enter Quantity" oninput="this.value = this.value.replace(/[^0-9]/g,'')" onkeyup="showProductTotalAmount(`+count+`)"> </td> <td> <input type="text" class="form-control" name="product_rate[]" id="product_rate_`+count+`" placeholder="Enter Product Rate" onkeyup="showProductTotalAmount(`+count+`)"> </td> <td> <select class="form-control select2" name="product_unit[]" id="product_unit_`+count+`"> <option value="">Select Unit</option> <?php $__currentLoopData = $units; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $unit): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo $unit->id; ?>"><?php echo $unit->unit; ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </td> <td> <input type="text" class="form-control" name="product_total_amount[]" id="product_total_amount_`+count+`" readonly=""> </td> <td><a href="javascript:void()" title="Delete Row" onclick="deleteRow(`+count+`)"><i class="fa fa-trash fa-2x" style="color:red;"></i></a></td> </tr>`; $('#product_details_table').append(newRow); $('.select2').select2(); } function deleteRow(count) { $('#row_'+count).remove(); } function getHsnCodeAndType(count) { var product_id = $("#product_id_"+count).val(); if (product_id == "") { } else { $(".loading-bg").show(); $.ajax({ url: '<?php echo e(url("get-hsn-code-by-product")); ?>/'+product_id, type: 'GET', success:function(data){ $(".loading-bg").hide(); console.log(data); if (data.flag) { $("#product_hsn_"+count).val(data.product_hsn_code.hsn_code); } else { alert(data.message); return false; } } }); } } function showProductTotalAmount(count) { var product_quantity = $("#quantity_"+count).val(); var product_price = $("#product_rate_"+count).val(); if (product_quantity == "") { $("#product_total_amount_"+count).val(''); } else if (product_price == "") { $("#product_total_amount_"+count).val(''); } else { total_amount = parseFloat(product_quantity)*parseFloat(product_price); $("#product_total_amount_"+count).val(total_amount); } } </script> <?php $__env->stopSection(); ?> <?php $__env->stopSection(); ?> <?php echo $__env->make('dashboard.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/pmmsanvp/public_html/srt/resources/views/dashboard/invoice/generate-invoice.blade.php ENDPATH**/ ?>