|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/leadai/leadai.co.in/resources/views/sales/invoice/ |
Upload File : |
@extends('layout')
@section('content')
<style>
input[type="date"]::-webkit-calendar-picker-indicator {
opacity: 0;
pointer-events: none; /* Prevent click interactions */
transition: opacity 0.3s ease; /* Smooth transition */
}
/* Show the calendar picker when input is focused or hovered */
input[type="date"]:focus::-webkit-calendar-picker-indicator,
input[type="date"]:hover::-webkit-calendar-picker-indicator {
opacity: 0;
pointer-events: auto; /* Enable click interactions */
}
.date-label {
text-transform: uppercase !important;
font-weight: bold !important;
letter-spacing: 0.1em !important;
}
input[type="date"] {
text-transform: uppercase !important;
}
input{
height:40px !important;
}
.save-btn-code{
width:100%;
background:white;
position:absolute;
position:fixed;
bottom:0px;
left:250px;
padding:26px;
}
@media only screen and (max-width: 998px)
{
.save-btn-code{
left:0px;
}
}
</style>
<main class="main-content">
<div class="page-header m-0 border-0">
<h3> {{__('message.edit')}} {{__('message.invoice')}}</h3>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ asset('dashboard') }}">{{__('message.dashboard')}}</a></li>
<li class="breadcrumb-item" aria-current="page"><a href="{{ asset('sales') }}">{{__('message.sales')}}</a></li>
<li class="breadcrumb-item active" aria-current="page">{{__('message.add')}}</li>
</ol>
</nav>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="card">
<form action="{{asset('edit-invoice')}}" method="post">
@csrf
<input type="hidden" name="invoice_id" value="{{$invoice->id}}">
<div class="card-body">
<h5>Edit Invoice {{$invoice->invoice_no}}</h5>
</div>
</div>
</div>
</div>
<div class="card pb-5" style="background-color:#f5f5f5;">
<div class="card-body">
<div class="row">
<div class="col-md-9 py-3 pt-5">
<div class="form-group d-flex justify-content-between align-items-center ">
<label for="restaurant_name" class="col-md-4 font-weight-bold">{{__('message.client')}} {{__('message.name')}}</label>
<div class="col-md-8 px-0">
<input type="text" class="form-control" name="client_name" value="{{$sell_details->distributor_details ? $sell_details->distributor_details->name : ''}}">
</div>
</div>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-9">
<h6 class="mb-3">Pending Amount Due : <input type="hidden" value="" name="pending_amount"></h6>
<h6 class="mb-3">GSTIN: Registered - Regular GST <input type="hidden" value="" name="gstin"></h6>
<div class="form-group d-flex justify-content-between align-items-center ">
<label for="place_of_suply" class="col-md-5 font-weight-bold">Place Of Supply</label>
<div class="col-md-7 px-0">
<input type="text" class="form-control" name="place_of_suply" id="place_of_suply">
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<h5>Billing Address</h5>
<p>
<textarea name="billing_address" class="form-control text-left" rows="3">
{{$sell_details->distributor_details ? $sell_details->distributor_details->address : ''}}
</textarea>
</p>
</div>
</div>
<div class="row border-top border-bottom py-3">
<div class="col-md-4">
<div class="form-group mb-4 d-flex justify-content-between align-items-center ">
<label for="invoice_generate_no" class="col-md-5 font-weight-bold">{{__('message.invoice')}}</label>
<div class="col-md-4 px-0">
<input type="text" class="form-control" name="invoice_generate_no" id="invoice_generate_no">
</div>
<div class="col-md-3 px-0">
<input type="number" class="form-control" name="invoice_no" value="{{$invoice->invoice_no}}" id="invoice_no">
</div>
</div>
<div class="form-group d-flex justify-content-between align-items-center ">
<label for="po_no" class="col-md-5 font-weight-bold">PO No.</label>
<div class="col-md-7 px-0">
<input type="text" class="form-control" name="po_no" id="po_no">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group d-flex justify-content-between align-items-center ">
<label for="restaurant_name" class="col-md-5 font-weight-bold">{{__('message.invoice')}} {{__('message.date')}}</label>
<div class="col-md-7 px-0">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="invoice_date">
</div>
</div>
</div>
<div class="form-group d-flex justify-content-between align-items-center ">
<label for="restaurant_name" class="col-md-5 font-weight-bold">PO {{__('message.date')}}</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
</div>
<input type="date" class="form-control date-picker" name="po_date">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group d-flex justify-content-between align-items-center ">
<label for="due_date" class="col-md-5 font-weight-bold">Due {{__('message.date')}}</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
</div>
<input type="date" class="form-control " name="due_date">
</div>
</div>
<div class="form-group d-flex justify-content-between align-items-center ">
<label for="payment_terms" class="col-md-5 font-weight-bold">Payment Terms</label>
<div class="col-md-7 px-0">
<input type="text" class="form-control" name="payment_terms" id="payment_terms">
</div>
</div>
</div>
</div>
@php
$total = 0 ;
$cr_type = 0;
@endphp
<div class="row border-top border-bottom py-3">
<h5 class="px-3">Invoice </h5>
<div class="col-12">
<table class="table border-striped" width="100%">
<thead>
<tr>
<th>Software Key</th>
<th>Description</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Total</th>
</tr>
</thead>
<tbody>
@php
$total = 0 ;
$cr_type = "";
@endphp
@if(isset($sell_details->order))
@foreach($sell_details->order as $value)
@php
$total += $value->licence_details ? $value->licence_details->price : 0 ;
$cr_type = $value->licence_details ? $value->licence_details->currence : ₹;
@endphp
<tr>
<td>{{$value->licence_details ? $value->licence_details->licence_key : ''}}</td>
<td>Software Product Key</td>
<td>1</td>
<td>
@if(isset($value->licence_details))
@if($value->licence_details->currency == "rupee")
₹ {{$value->licence_details->price}}
@else
$ {{$value->licence_details->price}}
@endif
@endif
</td>
<td>
@if(isset($value->licence_details))
@if($value->licence_details->currency == "rupee")
₹ {{$value->licence_details->price}}
@else
$ {{$value->licence_details->price}}
@endif
@endif
</td>
</tr>
@endforeach
@endif
</tbody>
<tfoot>
<tr>
<td colspan="4" class="text-end">Subtotal:</td>
<td>
@if(isset($sell_details->order))
₹ {{$total}}
@endif
</td>
</tr>
<tr>
@if(isset($sell_details->distributor_details))
<td colspan="4" class="text-end">Tax GST ({{$sell_details->distributor_details->gst}}%):</td>
@php
$gst = ($total * $sell_details->distributor_details->gst)/100;
@endphp
<td>₹ {{$gst}}</td>
@endif
</tr>
<tr>
<td colspan="4" class="text-end total">Total:</td>
<td class="total">
@if(isset($sell_details->order))
₹ {{$total+$gst}}
@endif
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="w-full save-btn-code">
<button type="submit" class="btn btn-outline-primary">Save</button>
</div>
</form>
</div>
</main>
@endsection
@push('footer-script')
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.3/html2pdf.bundle.min.js"></script>
<script>
$(document).ready(function(){
//filter company code
$(".filter-company-btn").click(function(){
if($(".filter-form-box").hasClass("d-none"))
{
$(".filter-form-box").removeClass("d-none");
}
else
{
$(".filter-form-box").addClass("d-none");
}
});
//share invoice link btn
$(".share-link-btn").click(function(){
$("#shareModal").modal("show");
});
$(".print-invoice").click(function(){
var element = document.querySelector(".invoice-box");
var opt = {
margin: 0.5,
filename: 'invoice.pdf',
image: { type: 'jpeg', quality: 1 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'a4', orientation: 'landscape' }
};
html2pdf().set(opt).from(element).save();
});
});
</script>
@endpush