migrate to gtea from bistbucket

This commit is contained in:
2026-03-15 17:08:23 +07:00
commit 129ca2260c
3716 changed files with 566316 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
@foreach ($brands as $brand)
<div class="category-content brand-list"
data-id="{{ $brand->id }}"
data-route="{{ route('business.sales.product-filter') }}">
<img class="category-brand-img " src="{{ asset($brand->icon ?? 'assets/img/icon/no-image.svg') }}" alt="">
<h6 class="brand-name">{{ $brand->brandName }}</h6>
</div>
@endforeach

View File

@@ -0,0 +1,20 @@
<div class="offcanvas offcanvas-end custom-offcanvas" tabindex="-1" id="brand-search-modal" aria-labelledby="offcanvasRightLabel">
<div class="offcanvas-header border-bottom">
<h5 class="offcanvas-title fw-bolder" id="offcanvasRightLabel">{{ __('Brand list') }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="p-3 category-brand-scroll">
<form id="brandSearchForm" method="post" data-route="{{ route('business.sales.brand-filter') }}">
@csrf
<div class="position-relative">
<input class="form-control mr-sm-2 p-2 brand-search" type="search" placeholder="{{ __('Search') }}"
aria-label="Search">
<i class="fas fa-search search-icon"></i>
</div>
</form>
<div class="category-container" id="brand-data">
@include('business::sales.brand-list')
</div>
</div>
</div>

View File

@@ -0,0 +1,79 @@
<div class="modal fade" id="calculatorModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog calculator-dialog" role="document">
<div class="modal-content calculator-content">
<div class="modal-header d-flex align-items-center justify-content-between">
<div class="custom-modal-header">
<button type="button" class="btn-close custom-close-btn calculator-btn" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
</div>
<div class="modal-body">
<div class="container calculator">
<form>
<input readonly id="display" type="text" class="form-control-lg text-right w-100" value="" />
</form>
<div class="d-flex justify-content-between button-row">
<button id="left-parenthesis" type="button" class="operator-group calculator-btn">
&#40;
</button>
<button id="right-parenthesis" type="button" class="operator-group calculator-btn">
&#41;
</button>
<button id="square-root" type="button" class="operator-group calculator-btn">
&#8730;
</button>
<button id="square" type="button" class="operator-group calculator-btn">
&#120;&#178;
</button>
</div>
<div class="d-flex justify-content-between button-row">
<button id="clear" type="button" class="calculator-btn">&#67;</button>
<button id="backspace" type="button" class="calculator-btn">&#9003;</button>
<button id="ans" type="button" class="operand-group calculator-btn">
&#65;&#110;&#115;
</button>
<button id="divide" type="button" class="operator-group calculator-btn">
&#247;
</button>
</div>
<div class="d-flex justify-content-between button-row">
<button id="seven" type="button" class="operand-group calculator-btn">&#55;</button>
<button id="eight" type="button" class="operand-group calculator-btn">&#56;</button>
<button id="nine" type="button" class="operand-group calculator-btn">&#57;</button>
<button id="multiply" type="button" class="operator-group calculator-btn">
&#215;
</button>
</div>
<div class="d-flex justify-content-between button-row">
<button id="four" type="button" class="operand-group calculator-btn">&#52;</button>
<button id="five" type="button" class="operand-group calculator-btn">&#53;</button>
<button id="six" type="button" class="operand-group calculator-btn">&#54;</button>
<button id="subtract" type="button" class="operator-group calculator-btn">
&#8722;
</button>
</div>
<div class="d-flex justify-content-between button-row">
<button id="one" type="button" class="operand-group calculator-btn">&#49;</button>
<button id="two" type="button" class="operand-group calculator-btn">&#50;</button>
<button id="three" type="button" class="operand-group calculator-btn">&#51;</button>
<button id="add" type="button" class="operator-group calculator-btn">&#43;</button>
</div>
<div class="d-flex justify-content-between button-row">
<button id="percentage" type="button" class="operand-group calculator-btn">
&#37;
</button>
<button id="zero" type="button" class="operand-group calculator-btn">&#48;</button>
<button id="decimal" type="button" class="operand-group calculator-btn">&#46;</button>
<button id="equal" type="button" class="calculator-btn">&#61;</button>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,53 @@
@if(isset($cart_contents))
@foreach($cart_contents as $cart)
<tr data-row_id="{{ $cart->rowId }}" data-batch_no="{{ $cart->options->batch_no ?? '' }}"
data-stock_id="{{ $cart->options->stock_id ?? '' }}"
data-update_route="{{ route('business.carts.update', $cart->rowId) }}"
data-destroy_route="{{ route('business.carts.destroy', $cart->rowId) }}">
<td>
<img class="table-img" src="{{ asset($cart->options->product_image ?? 'assets/images/products/box.svg') }}">
</td>
<td>{{ $cart->name }}</td>
<td>{{ $cart->options->product_code }}</td>
<td>{{ $cart->options->batch_no ?? '' }}</td>
<td>{{ $cart->options->product_unit_name }}</td>
<td>
<input class="text-center sales-input cart-price" type="number" step="any" min="0" value="{{ $cart->price }}"
placeholder="0">
</td>
@if ($modules['allow_product_discount'] ?? false)
<td>
<input class="text-center sales-input cart-discount" type="number" step="any" min="0"
value="{{ $cart->options->discount ?? 0 }}" placeholder="0">
</td>
@endif
<td class="cart-vat-percent text-center">
{{ $cart->options->vat_percent ?? 0 }}%
<input type="hidden" class="cart-vat-percent-input" value="{{ $cart->options->vat_percent ?? 0 }}">
</td>
<td class="cart-vat-value text-center">
{{ currency_format(($cart->price * $cart->qty) * ($cart->options->vat_percent ?? 0) / 100, currency: business_currency()) }}
</td>
<td class="large-td">
<div class="d-flex gap-2 align-items-center">
<button class="incre-decre minus-btn">
<i class="fas fa-minus icon"></i>
</button>
<input type="number" step="any" value="{{ $cart->qty }}" class="dynamic-width cart-qty "
placeholder="{{ __('0') }}">
<button class="incre-decre plus-btn">
<i class="fas fa-plus icon"></i>
</button>
</div>
</td>
<td class="cart-subtotal">
{{ currency_format(($cart->price - ($cart->options->discount ?? 0)) * $cart->qty, currency: business_currency()) }}
</td>
<td>
<button class='x-btn remove-btn'>
<img src="{{ asset('assets/images/icons/x.svg') }}" alt="">
</button>
</td>
</tr>
@endforeach
@endif

View File

@@ -0,0 +1,6 @@
@foreach ($categories as $category)
<div class="category-content category-list" data-id="{{ $category->id }}" data-route="{{ route('business.sales.product-filter') }}">
<img class="category-brand-img" src="{{ asset($category->icon ?? 'assets/img/icon/no-image.svg') }}" alt="">
<h6 class="category-name">{{ $category->categoryName }}</h6>
</div>
@endforeach

View File

@@ -0,0 +1,20 @@
<div class="offcanvas offcanvas-end custom-offcanvas" tabindex="-1" id="category-search-modal" aria-labelledby="offcanvasRightLabel">
<div class="offcanvas-header border-bottom">
<h5 class="offcanvas-title fw-bolder" id="offcanvasRightLabel">{{ __('Category List') }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="p-3 category-brand-scroll">
<form id="categorySearchForm" method="post" data-route="{{ route('business.sales.category-filter') }}">
@csrf
<div class="position-relative">
<input class="form-control mr-sm-2 p-2 category-search" type="text" name="search" placeholder="{{ __('Search') }}" aria-label="Search">
<i class="fas fa-search search-icon"></i>
</div>
</form>
<div class="category-container" id="category-data">
@include('business::sales.category-list')
</div>
</div>
</div>

View File

@@ -0,0 +1,319 @@
@extends('layouts.business.master')
@section('title')
{{ __('Pos Sale') }}
@endsection
@php
$modules = product_setting()->modules ?? [];
@endphp
@push('css')
<link rel="stylesheet" href="{{ asset('assets/css/choices.min.css') }}">
<link rel="stylesheet" href="{{ asset('assets/css/calculator.css') }}">
@endpush
@section('main_content')
<div class="container-fluid">
<div class="grid row sales-main-container p-lr">
<div class="sales-container">
<!-- Quick Action Section -->
<div class="quick-act-header">
<div class="d-flex flex-column flex-sm-row justify-content-between align-items-center">
<div class="mb-2 mb-sm-0">
<h4 class='quick-act-title'>{{ __('Quick Action') }}</h4>
</div>
<div class="quick-actions-container">
<a href="{{ route('business.products.index') }}"
class='save-product-btn d-flex align-items-center gap-1'>
<img src="{{ asset('assets/images/icons/product.svg') }}" alt="">
{{ __('Product List') }}
</a>
<a href="{{ route('business.sales.index', ['today' => true]) }}"
class='sales-btn d-flex align-items-center gap-1'>
<img src="{{ asset('assets/images/icons/sales.svg') }}" alt="">
{{ __('Today Sales') }}
</a>
<button data-bs-toggle="modal" data-bs-target="#calculatorModal"
class='calculator-btn d-flex align-items-center gap-1'>
<img src="{{ asset('assets/images/icons/calculator.svg') }}" alt="">
{{ __('Calculator') }}
</button>
<a href="{{ route('business.dashboard.index') }}"
class='dashboard-btn d-flex align-items-center gap-1'>
<img src="{{ asset('assets/images/icons/dashboard.svg') }}" alt="">
{{ __('Dashboard') }}
</a>
</div>
</div>
</div>
<form action="{{ route('business.sales.store') }}" method="post" enctype="multipart/form-data" class="ajaxform">
@csrf
<div class="mt-4 mb-3">
<div class="row g-3">
<!-- First Row -->
<div class="col-12 col-md-6">
<input type="text" name="invoiceNumber" value="{{ $invoice_no }}" class="form-control"
placeholder="{{ __('Invoice no') }}." readonly>
</div>
<!-- Second Row -->
<div class="col-12 col-md-6">
<div class="input-group">
<input type="date" name="saleDate" class="form-control" value="{{ now()->format('Y-m-d') }}">
</div>
</div>
<div class="col-6 ">
<div class=" d-flex align-items-center">
<select required name="party_id" id="party_id" class="form-select customer-select choices-select" aria-label="Select Customer">
<option value="">{{ __('Guest') }}</option>
@foreach ($customers as $customer)
<option value="{{ $customer->id }}" data-type="{{ $customer->type }}" data-phone="{{ $customer->phone }}">
{{ $customer->name }}({{ $customer->type }}{{ $customer->due ? ' ' . currency_format($customer->due, currency: business_currency()) : '' }})
{{ $customer->phone }}
</option>
@endforeach
</select>
<a type="button" href="#customer-create-modal" data-bs-toggle="modal"
class="btn btn-danger square-btn d-flex justify-content-center align-items-center">
<img src="{{ asset('assets/images/icons/plus-square.svg') }}" alt="">
</a>
</div>
</div>
<div class="col-6">
<div class="d-flex align-items-center">
<select required name="warehouse_id" class="form-select choices-select warehouse_id" aria-label="Select Customer">
<option value="">{{ __('Select Warehouse') }}</option>
@foreach ($warehouses as $warehouse)
<option value="{{ $warehouse->id }}">{{ $warehouse->name }}</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
<div class="cart-payment">
<div class="table-responsive">
<table class="table table-bordered text-center">
<thead>
<tr>
<th class="border table-background">{{ __('Image') }}</th>
<th class="border table-background">{{ __('Items') }}</th>
<th class="border table-background">{{ __('Code') }}</th>
<th class="border table-background">{{ __('Batch') }}</th>
<th class="border table-background">{{ __('Unit') }}</th>
<th class="border table-background">{{ __('Sale Price') }}</th>
@if ($modules['allow_product_discount'] ?? false)
<th class="border table-background">{{ __('Discount') }}</th>
@endif
<th class="border table-background">{{ __('Vat %') }}</th>
<th class="border table-background">{{ __('Vat Value') }}</th>
<th class="border table-background">{{ __('Qty') }}</th>
<th class="border table-background">{{ __('Sub Total') }}</th>
<th class="border table-background">{{ __('Action') }}</th>
</tr>
</thead>
<tbody id="cart-list">
@include('business::sales.cart-list')
</tbody>
</table>
</div>
<div class="hr-container">
<hr>
</div>
<!-- Make Payment Section start -->
<div class="grid row py-3 payment-section">
<div class="col-sm-12 col-md-6 col-lg-6">
<div class="amount-info-container">
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Receive Amount') }}</h6>
<input name="receive_amount" type="number" step="any" id="receive_amount"
min="0" class="form-control receive_amount" placeholder="0">
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Change Amount') }}</h6>
<input type="number" step="any" id="change_amount" class="form-control"
placeholder="0" readonly>
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Due Amount') }}</h6>
<input type="number" step="any" id="due_amount" class="form-control" placeholder="0" readonly>
</div>
<div class="row amount-container align-items-start mb-2">
<h6 class="payment-title">{{ __('Payment Type') }}</h6>
@include('business::component.payment_type', ['context' => 'sale', 'payment_types' => $payment_types])
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Note') }}</h6>
<input type="text" name="note" class="form-control" placeholder="{{ __('Type note...') }}">
</div>
</div>
<div class="mt-3">
<button class="save-btn cancel-sale-btn" data-route="{{ route('business.carts.remove-all') }}">{{ __('Cancel') }}</button>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-6">
<div class="payment-container mb-3 amount-info-container">
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6>{{ __('Sub Total') }}</h6>
<h6 class="fw-bold" id="sub_total">
{{ currency_format(0, currency: business_currency()) }}</h6>
</div>
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6>{{ get_business_option('business-settings')['vat_name'] ?? 'Vat' }}</h6>
<h6 class="fw-bold" id="vat_amount_txt">
{{ currency_format(0, currency: business_currency()) }}</h6>
</div>
<div class="row save-amount-container align-items-center mb-2 d-none">
<h6 class="payment-title col-6">{{ get_business_option('business-settings')['vat_name'] ?? 'Vat' }}</h6>
<div class="col-6 w-100 d-flex justify-content-between gap-2">
<div class="d-flex d-flex align-items-center gap-2">
<select name="vat_id" class="form-select vat_select" id='form-ware'>
<option value="">{{ __('Select') }}</option>
@foreach ($vats as $vat)
<option value="{{ $vat->id }}"
data-rate="{{ $vat->rate }}">{{ $vat->name }}
({{ $vat->rate }}%)
</option>
@endforeach
</select>
</div>
<input type="number" step="any" name="vat_amount" id="vat_amount"
min="0" class="form-control right-start-input"
placeholder="{{ __('0') }}" readonly>
</div>
</div>
<div class="row save-amount-container align-items-center mb-2">
<h6 class="payment-title col-6">{{ __('Discount') }}</h6>
<div class="col-6 w-100 d-flex justify-content-between gap-2">
<div class="d-flex d-flex align-items-center gap-2">
<select name="discount_type" class="form-select discount_type"
id='form-ware'>
<option value="flat">{{ __('Flat') }}
({{ business_currency()->symbol }})
</option>
<option value="percent">{{ __('Percent (%)') }}</option>
</select>
</div>
<input type="number" step="any" name="discountAmount"
id="discount_amount" min="0"
class="form-control right-start-input" placeholder="{{ __('0') }}">
</div>
</div>
<div class="mb-2 shopping-crg-grid">
<h6 class="payment-title ">{{ __('Shipping Charge') }}</h6>
<div class="">
<input type="number" step="any" name="shipping_charge" id="shipping_charge" class="form-control right-start-input" placeholder="0">
</div>
</div>
<div class=" d-flex align-items-center justify-content-between fw-bold">
<div class="fw-bold">{{ __('Total Amount') }}</div>
<h6 class='fw-bold' id="total_amount">
{{ currency_format(0, currency: business_currency()) }}</h6>
</div>
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6>{{ __('Rounding(+/-)') }}</h6>
<h6 id="rounding_amount">
{{ currency_format(0, currency: business_currency()) }}</h6>
</div>
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6 class="fw-bold">{{ __('Payable Amount') }}</h6>
<h6 class="fw-bold" id="payable_amount">
{{ currency_format(0, currency: business_currency()) }}</h6>
</div>
</div>
@usercan('sales.create')
<div class="sale-btn-container">
<button class="submit-btn payment-btn">{{ __('Sale') }}</button>
</div>
@endusercan
</div>
</div>
<!-- Make Payment Section end -->
</div>
</form>
</div>
<div class="main-container">
<!-- Products Header -->
<div class="products-header">
<div class="container-fluid p-0">
<div class="row g-2 w-100 align-items-center ">
<div class="w-100">
<!-- Search Input and Add Button -->
<form action="{{ route('business.sales.product-filter') }}" method="post" class="product-filter product-filter-form w-100" table="#products-list">
@csrf
<div class="search-product">
<div class="d-flex">
<input type="text" name="search" id="sale_product_search" class="form-control search-input" placeholder="{{ __('Scan / search by code or name') }}">
<button class="btn-search">
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.75 7.03125H5.625V22.9688H3.75V7.03125ZM13.5938 7.03125H15.4688V22.9688H13.5938V7.03125ZM24.375 7.03125H26.25V22.9688H24.375V7.03125ZM9.375 7.03125H10.3125V22.9688H9.375V7.03125ZM11.25 7.03125H12.1875V22.9688H11.25V7.03125ZM19.6875 7.03125H20.625V22.9688H19.6875V7.03125ZM21.5625 7.03125H22.5V22.9688H21.5625V7.03125ZM7.03125 7.03125H8.4375V22.9688H7.03125V7.03125ZM16.875 7.03125H18.2812V22.9688H16.875V7.03125Z" fill="white"/>
<path d="M1.40625 9.84375C1.28193 9.84375 1.1627 9.79436 1.07479 9.70646C0.986886 9.61855 0.9375 9.49932 0.9375 9.375V4.6875C0.9375 4.56318 0.986886 4.44395 1.07479 4.35604C1.1627 4.26814 1.28193 4.21875 1.40625 4.21875H6.09375C6.21807 4.21875 6.3373 4.26814 6.42521 4.35604C6.51311 4.44395 6.5625 4.56318 6.5625 4.6875C6.5625 4.81182 6.51311 4.93105 6.42521 5.01896C6.3373 5.10686 6.21807 5.15625 6.09375 5.15625H1.875V9.375C1.875 9.49932 1.82561 9.61855 1.73771 9.70646C1.6498 9.79436 1.53057 9.84375 1.40625 9.84375ZM28.5938 9.84375C28.4694 9.84375 28.3502 9.79436 28.2623 9.70646C28.1744 9.61855 28.125 9.49932 28.125 9.375V5.15625H23.9062C23.7819 5.15625 23.6627 5.10686 23.5748 5.01896C23.4869 4.93105 23.4375 4.81182 23.4375 4.6875C23.4375 4.56318 23.4869 4.44395 23.5748 4.35604C23.6627 4.26814 23.7819 4.21875 23.9062 4.21875H28.5938C28.7181 4.21875 28.8373 4.26814 28.9252 4.35604C29.0131 4.44395 29.0625 4.56318 29.0625 4.6875V9.375C29.0625 9.49932 29.0131 9.61855 28.9252 9.70646C28.8373 9.79436 28.7181 9.84375 28.5938 9.84375ZM6.09375 25.7812H1.40625C1.28193 25.7812 1.1627 25.7319 1.07479 25.644C0.986886 25.556 0.9375 25.4368 0.9375 25.3125V20.625C0.9375 20.5007 0.986886 20.3815 1.07479 20.2935C1.1627 20.2056 1.28193 20.1562 1.40625 20.1562C1.53057 20.1562 1.6498 20.2056 1.73771 20.2935C1.82561 20.3815 1.875 20.5007 1.875 20.625V24.8438H6.09375C6.21807 24.8438 6.3373 24.8931 6.42521 24.981C6.51311 25.069 6.5625 25.1882 6.5625 25.3125C6.5625 25.4368 6.51311 25.556 6.42521 25.644C6.3373 25.7319 6.21807 25.7812 6.09375 25.7812ZM28.5938 25.7812H23.9062C23.7819 25.7812 23.6627 25.7319 23.5748 25.644C23.4869 25.556 23.4375 25.4368 23.4375 25.3125C23.4375 25.1882 23.4869 25.069 23.5748 24.981C23.6627 24.8931 23.7819 24.8438 23.9062 24.8438H28.125V20.625C28.125 20.5007 28.1744 20.3815 28.2623 20.2935C28.3502 20.2056 28.4694 20.1562 28.5938 20.1562C28.7181 20.1562 28.8373 20.2056 28.9252 20.2935C29.0131 20.3815 29.0625 20.5007 29.0625 20.625V25.3125C29.0625 25.4368 29.0131 25.556 28.9252 25.644C28.8373 25.7319 28.7181 25.7812 28.5938 25.7812Z" fill="white"/>
<path d="M1.40625 14.0625H28.5938V15.9375H1.40625V14.0625Z" fill="white"/>
</svg>
</button>
</div>
<div class="d-flex align-items-center justify-content-end gap-2 ">
<a data-bs-toggle="offcanvas" data-bs-target="#category-search-modal"
aria-controls="offcanvasRight"
class="btn btn-category w-100">{{ __('Category') }}</a>
<a data-bs-toggle="offcanvas" data-bs-target="#brand-search-modal"
aria-controls="offcanvasRight"
class="btn btn-brand w-100">{{ __('Brand') }}</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="products-container">
<div class="p-3 scroll-card">
<div class="search-product-card products gap-2 @if (count($products) === 1) single-product @endif product-list-container"
id="products-list">
@include('business::sales.product-list')
</div>
</div>
</div>
</div>
</div>
</div>
@php
$rounding_amount_option = sale_rounding();
@endphp
<input type="hidden" id="get_product" value="{{ route('business.products.prices') }}">
<input type="hidden" value="{{ route('business.carts.index') }}" id="get-cart">
<input type="hidden" value="{{ route('business.sales.cart-data') }}" id="get-cart-data">
<input type="hidden" value="{{ route('business.carts.remove-all') }}" id="clear-cart">
<input type="hidden" id="rounding_amount_option" value="{{ $rounding_amount_option }}">
<input type="hidden" id="get-by-category" value="{{ route('business.products.get-by-category') }}">
<input type="hidden" id="cart-store-url" value="{{ route('business.carts.store') }}">
<input type="hidden" id="selectedProductValue" name="selectedProductValue">
<input type="hidden" id="asset_base_url" value="{{ asset('') }}">
<input type="hidden" id="get_stock_prices" value="{{ route('business.products.stocks-prices') }}">
<input type="hidden" id="warehouse_module_exist" value="{{ moduleCheck('WarehouseAddon') ? 1 : 0 }}">
@endsection
@push('modal')
@include('business::sales.calculator')
@include('business::sales.category-search')
@include('business::sales.brand-search')
@include('business::sales.customer-create')
@include('business::sales.stock-list')
@endpush
@push('js')
<script src="{{ asset('assets/js/choices.min.js') }}"></script>
<script src="{{ asset('assets/js/custom/sale.js') . '?v=' . time() }}"></script>
<script src="{{ asset('assets/js/custom/math.min.js') }}"></script>
<script src="{{ asset('assets/js/custom/calculator.js') }}"></script>
@endpush

View File

@@ -0,0 +1,72 @@
<div class="modal fade common-validation-modal" id="customer-create-modal">
<div class="modal-dialog modal-dialog-centered modal-lg">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5">{{ __('Create Customer') }}</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="personal-info">
<form action="{{ route('business.sales.store.customer') }}" method="post" enctype="multipart/form-data"
class="ajaxform_instant_reload">
@csrf
<div class="row">
<div class="col-lg-6 mb-2">
<label>{{ __('Name') }}</label>
<input type="text" name="name" required class="form-control" placeholder="{{ __('Enter Name') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Phone') }}</label>
<input type="number" name="phone" class="form-control" placeholder="{{ __('Enter phone number') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{__('Party Type')}}</label>
<div class="gpt-up-down-arrow position-relative">
<select name="type" class="form-control table-select w-100">
<option value="Retailer">{{ __('Customer') }}</option>
<option value="Dealer">{{ __('Dealer') }}</option>
<option value="Wholesaler">{{ __('Wholesaler') }}</option>
</select>
<span></span>
</div>
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Email') }}</label>
<input type="email" name="email" class="form-control" placeholder="{{ __('Enter Email') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Address') }}</label>
<input type="text" name="address" class="form-control" placeholder="{{ __('Enter Address') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Due') }}</label>
<input type="number" name="due" step="any" class="form-control" placeholder="{{ __('Enter Due') }}">
</div>
<div class="col-lg-12">
<div class="row">
<div class="col-10">
<label class="img-label">{{ __('Image') }}</label>
<input type="file" accept="image/*" name="image" class="form-control file-input-change" data-id="image">
</div>
<div class="col-1 align-self-center mt-3">
<img src="{{ asset('assets/images/icons/upload.png') }}" id="image" class="table-img">
</div>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="button-group text-center mt-5">
<button type="reset" class="theme-btn border-btn m-2">{{ __('Reset') }}</button>
<button class="theme-btn m-2 submit-btn">{{ __('Save') }}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,139 @@
<div class="responsive-table m-0">
<table class="table" id="datatable">
<thead>
<tr>
@usercan('sales.delete')
<th class="w-60">
<div class="d-flex align-items-center gap-3">
<input type="checkbox" class="select-all-delete multi-delete ">
</div>
</th>
@endusercan
<th class="">{{ __('SL') }}.</th>
<th class="text-start">{{ __('Date') }}</th>
@if (auth()->user()->accessToMultiBranch())
<th class="text-start">{{ __('Branch') }}</th>
@endif
<th class="text-start">{{ __('Invoice No') }}</th>
<th class="text-start">{{ __('Party Name') }}</th>
<th class="text-start">{{ __('Total') }}</th>
<th class="text-start">{{ __('Discount') }}</th>
<th class="text-start">{{ __('Paid') }}</th>
<th class="text-start">{{ __('Due') }}</th>
<th>{{ __('Status') }}</th>
<th>{{ __('Action') }}</th>
</tr>
</thead>
<tbody>
@foreach ($sales as $sale)
<tr>
@usercan('sales.delete')
<td class="w-60 checkbox">
@if (!in_array($sale->id, $salesWithReturns))
<input type="checkbox" name="ids[]" class="delete-checkbox-item multi-delete"
value="{{ $sale->id }}">
@endif
</td>
@endusercan
<td>{{ ($sales->currentPage() - 1) * $sales->perPage() + $loop->iteration }}</td>
<td class="text-start">{{ formatted_date($sale->saleDate) }}</td>
@if (auth()->user()->accessToMultiBranch())
<td class="text-start">{{ $sale->branch->name ?? '' }}</td>
@endif
<td class="text-start">{{ $sale->invoiceNumber }}</td>
<td class="text-start">{{ $sale->party->name ?? 'Guest' }}</td>
<td class="text-start">{{ currency_format($sale->totalAmount, currency: business_currency()) }}
</td>
<td class="text-start">{{ currency_format($sale->discountAmount, currency: business_currency()) }}
</td>
<td class="text-start">{{ currency_format($sale->paidAmount, currency: business_currency()) }}</td>
<td class="text-start">{{ currency_format($sale->dueAmount, currency: business_currency()) }}</td>
<td>
@if ($sale->details->sum('quantities') == 0)
<div class="paid-badge">{{ __('Returned') }}</div>
@elseif($sale->dueAmount == 0)
<div class="paid-badge">{{ __('Paid') }}</div>
@elseif($sale->dueAmount > 0 && $sale->dueAmount < $sale->totalAmount)
<div class="unpaid-badge">{{ __('Partial Paid') }}</div>
@else
<div class="unpaid-badge-2">{{ __('Unpaid') }}</div>
@endif
</td>
<td class="d-print-none">
<div class="dropdown table-action">
<button type="button" data-bs-toggle="dropdown">
<i class="far fa-ellipsis-v"></i>
</button>
<ul class="dropdown-menu">
@usercan('sales.read')
<li>
<a target="_blank" href="{{ route('business.sales.invoice', $sale->id) }}">
<img src="{{ asset('assets/images/icons/Invoic.svg') }}" alt="">
{{ __('Invoice') }}
</a>
</li>
@endusercan
@if ($sale->details->sum('quantities') != 0)
@usercan('sale-returns.read')
<li>
<a
href="{{ route('business.sale-returns.create', ['sale_id' => $sale->id]) }}">
<i class="fal fa-undo-alt"></i>
{{ __('Sales Return') }}
</a>
</li>
@endusercan
@endif
<li>
<a href="#" class="view-payment-btn"
data-url="{{ route('business.view-payment', ['type' => 'sale', 'id' => $sale->id]) }}"
data-bs-toggle="modal" data-bs-target="#view-payment-modal">
<svg width="18" height="18" viewBox="0 0 18 18" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
d="M3 13.9844V6.0407C3 3.90019 3 2.82994 3.65901 2.16497C4.31802 1.5 5.37868 1.5 7.5 1.5H10.5C12.6213 1.5 13.6819 1.5 14.341 2.16497C15 2.82994 15 3.90019 15 6.0407V13.9844C15 15.1181 15 15.685 14.6535 15.9081C14.0873 16.2728 13.2121 15.5081 12.7718 15.2305C12.4081 15.0011 12.2263 14.8864 12.0244 14.8798C11.8063 14.8726 11.6212 14.9826 11.2282 15.2305L9.795 16.1343C9.40838 16.3781 9.2151 16.5 9 16.5C8.7849 16.5 8.59162 16.3781 8.205 16.1343L6.77185 15.2305C6.40811 15.0011 6.22624 14.8864 6.0244 14.8798C5.80629 14.8726 5.6212 14.9826 5.22815 15.2305C4.78796 15.5081 3.91265 16.2728 3.34646 15.9081C3 15.685 3 15.1181 3 13.9844Z"
stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round" />
<path d="M12 4.5H6" stroke="#4B5563" stroke-linecap="round"
stroke-linejoin="round" />
<path d="M7.5 7.5H6" stroke="#4B5563" stroke-linecap="round"
stroke-linejoin="round" />
<path
d="M10.875 7.40625C10.2537 7.40625 9.75 7.84695 9.75 8.39063C9.75 8.9343 10.2537 9.375 10.875 9.375C11.4963 9.375 12 9.8157 12 10.3594C12 10.9031 11.4963 11.3438 10.875 11.3438M10.875 7.40625C11.3648 7.40625 11.7815 7.68015 11.936 8.0625M10.875 7.40625V6.75M10.875 11.3438C10.3852 11.3438 9.96847 11.0699 9.81405 10.6875M10.875 11.3438V12"
stroke="#4B5563" stroke-linecap="round" />
</svg>
</i> {{ __('View Payment') }}
</a>
</li>
@if (!in_array($sale->id, $salesWithReturns))
@usercan('sales.update')
<li>
<a href="{{ route('business.sales.edit', $sale->id) }}">
<i class="fal fa-edit"></i>
{{ __('Edit') }}
</a>
</li>
@endusercan
@usercan('sales.delete')
<li>
<a href="{{ route('business.sales.destroy', $sale->id) }}"
class="confirm-action" data-method="DELETE">
<i class="fal fa-trash-alt"></i>
{{ __('Delete') }}
</a>
</li>
@endusercan
@endif
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="mt-3">
{{ $sales->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,38 @@
<div class="modal fade" id="discount-modal">
<div class="modal-dialog modal-dialog-centered modal-md">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5">{{ __('Add Vat') }}</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="personal-info">
<form action="{{ route('business.expense-categories.store') }}" method="post"
enctype="multipart/form-data" class="ajaxform_instant_reload">
@csrf
<div class="row align-items-center">
<div class="col-lg-9">
<label>{{ __('Tax') }}</label>
<input type="text" name="categoryName" required class="form-control" placeholder="{{ __('Amount') }}">
</div>
<div class="col-lg-3">
<div class="pt-4 d-flex align-items-center gap-2">
<button class='disc-btn'>%</button>
<button class='disc-btn'>$</button>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="button-group text-center mt-3">
<button type="reset" class="theme-btn border-btn m-2">{{ __('Cancel') }}</button>
<button class="theme-btn m-2 submit-btn">{{ __('Apply') }}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,307 @@
@extends('layouts.business.master')
@section('title')
{{ __('Inventory Sales') }}
@endsection
@php
$modules = product_setting()->modules ?? [];
@endphp
@section('main_content')
<div class="container-fluid">
<div class="card">
<div class="table-header p-16">
<h4>{{ __('Inventory Sales') }}</h4>
</div>
<div class="order-form-section p-16">
<form action="{{ route('business.sales.update', $sale->id) }}" method="post" enctype="multipart/form-data" class="ajaxform">
@csrf
@method('put')
<div class="row mt-3">
<div class="col-lg-4">
<label>{{ __('Customer') }}</label>
<div class="input-group">
<select name="party_id" class="form-control inventory-customer-select" aria-label="Select Customer">
<option value="">{{ __('Guest') }}</option>
@foreach ($customers as $customer)
<option value="{{ $customer->id }}" data-type="{{ $customer->type }}"
@selected($sale->party_id == $customer->id)>{{ $customer->name }} ({{ $customer->type }}{{ $customer->due ? ' ' . currency_format($customer->due, currency:business_currency()) : '' }})
</option>
@endforeach
</select>
<a type="button" href="#customer-create-modal" data-bs-toggle="modal"
class="btn btn-danger square-btn d-flex justify-content-center align-items-center">
<img src="{{ asset('assets/images/icons/plus.svg') }}" alt=""></a>
</div>
</div>
<div class="col-lg-4">
<label>{{ __('Invoice No') }}.</label>
<input type="text" name="invoiceNumber" value="{{ $sale->invoiceNumber }}" class="form-control" placeholder="{{ __('Invoice no') }}." readonly>
</div>
<div class="col-lg-4">
<label>{{ __('Date') }}</label>
<input type="date" name="saleDate" class="form-control" value="{{ formatted_date($sale->saleDate, 'Y-m-d') }}">
</div>
<div class="col-lg-8">
<label>{{ __('Select Product') }}</label>
<div class="product-dropdown" id="productDropdown">
<div class="product-selected">
<span id="selectedValue">{{ __('Select Product') }}</span><span id="arrow">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 6L8 10L12 6" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
</span>
</div>
<div class="product-dropdown-options" id="dropdownList">
@foreach ($products as $product)
@if (!empty($product->stocks) && $product->stocks->count() > 1)
{{-- when multiple stock --}}
<div class="product-option-item single-product {{ $product->id }}" data-product_id="{{ $product->id }}" data-default_price="{{ $product->productSalePrice }}" data-route="{{ route('business.carts.store') }}" data-product_name="{{ $product->productName }}" data-product_code="{{ $product->productCode }}" data-product_unit_id="{{ $product->unit_id }}" data-product_unit_name="{{ $product->unit->unitName ?? '' }}" data-purchase_price="{{ $product->productPurchasePrice }}" data-product_image="{{ $product->productPicture }}" data-vat_percent="{{ $product->vat->rate ?? 0 }}">
<div class="product-left">
<img src="{{ asset($product->productPicture ?? 'assets/images/products/box.svg') }}" alt="">
<div class="product-text">
<div class="d-flex align-items-center justify-content-between w-100">
<div class="product-title">{{ $product->productName }}</div>
<p>Code : {{ $product->productCode }}</p>
</div>
@foreach ($product->stocks as $stock)
<div class="d-flex align-items-center justify-content-between w-100 multi-items add-batch-item"
data-stock_id="{{ $stock->id }}"
data-product_id="{{ $product->id }}"
data-product_batch_no="{{ $stock->batch_no ?? '' }}"
data-product_expire_date="{{ $stock->expire_date ?? '' }}"
data-product_name="{{ $product->productName }}"
data-product_code="{{ $product->productCode }}"
data-default_price="{{ $stock->productSalePrice }}"
data-product_unit_id="{{ $product->unit_id }}"
data-product_unit_name="{{ $product->unit->unitName ?? '' }}"
data-purchase_price="{{ $product->productPurchasePrice }}"
data-product_image="{{ $product->productPicture }}"
data-route="{{ route('business.carts.store') }}"
data-vat_percent="{{ $product->vat->rate ?? 0 }}">
<div class="product-des">
{{ __('Batch') }}: {{ $stock->batch_no ?? 'N/A' }}
{{ $product->color ? ', Color: ' . $product->color : '' }}
<span class="product-in-stock">{{ __('In Stock') }}: {{ $stock->productStock }}</span>
</div>
<div class="product-price product_price">
{{ currency_format($stock->productSalePrice, currency: business_currency()) }}
</div>
</div>
@endforeach
</div>
</div>
</div>
@else
{{-- when single stock --}}
@php $stock = $product->stocks->first(); @endphp
<div class="product-option-item single-product {{ $product->id }} add-batch-item"
data-stock_id="{{ $stock->id ?? '' }}"
data-product_id="{{ $product->id }}"
data-default_price="{{ $product->productSalePrice }}"
data-product_name="{{ $product->productName }}"
data-product_code="{{ $product->productCode }}"
data-product_unit_id="{{ $product->unit_id }}"
data-product_unit_name="{{ $product->unit->unitName ?? '' }}"
data-purchase_price="{{ $product->productPurchasePrice }}"
data-product_image="{{ $product->productPicture }}"
data-product_batch_no="{{ $stock->batch_no ?? '' }}"
data-product_expire_date="{{ $stock->expire_date ?? '' }}"
data-route="{{ route('business.carts.store') }}"
data-vat_percent="{{ $product->vat->rate ?? 0 }}">
<div class="product-left">
<img src="{{ asset($product->productPicture ?? 'assets/images/products/box.svg') }}" alt="">
<div class="product-text">
<div class="d-flex align-items-center justify-content-between w-100">
<div class="product-title">{{ $product->productName }}</div>
<p>{{ __('Code') }}: {{ $product->productCode }}</p>
</div>
<div class="d-flex align-items-center justify-content-between w-100">
<div class="product-des">
{{ __('Batch') }}: {{ $stock->batch_no ?? 'N/A' }}
{{ $product->color ? ', Color: ' . $product->color : '' }}
<span class="product-in-stock">{{ __('In Stock') }}: {{ $stock->productStock ?? 0 }}</span>
</div>
<div class="product-price product_price">
{{ currency_format($stock->productSalePrice ?? $product->productSalePrice, currency: business_currency()) }}
</div>
</div>
</div>
</div>
</div>
@endif
@endforeach
</div>
</div>
</div>
<div class="col-lg-4">
<label>{{ __('Category') }}</label>
<div class="input-group">
<select name="category_id" id="categorySelect" class="form-control" aria-label="Select Category">
<option value="">{{ __('All') }}</option>
@foreach($categories as $category)
<option value="{{ $category->id }}" @selected($sale->category_id == $category->id)>{{ $category->categoryName }}</option>
@endforeach
</select>
</div>
</div>
<div class="table-responsive mt-4">
<table class="table table-bordered text-center">
<thead>
<tr>
<th class="border p-2 table-background">{{ __('Image') }}</th>
<th class="border p-2 table-background">{{ __('Items') }}</th>
<th class="border p-2 table-background">{{ __('Code') }}</th>
<th class="border p-2 table-background">{{ __('Batch') }}</th>
<th class="border p-2 table-background">{{ __('Unit') }}</th>
<th class="border p-2 table-background">{{ __('Sale Price') }}</th>
@if ($modules['allow_product_discount'] ?? false)
<th class="border p-2 table-background">{{ __('Discount') }}</th>
@endif
<th class="border p-2 table-background">{{ __('Vat %') }}</th>
<th class="border p-2 table-background">{{ __('Vat Value') }}</th>
<th class="border p-2 table-background">{{ __('Qty') }}</th>
<th class="border p-2 table-background">{{ __('Sub Total') }}</th>
<th class="border p-2 table-background">{{ __('Action') }}</th>
</tr>
</thead>
<tbody id="cart-list">
@include('business::sales.cart-list')
</tbody>
</table>
</div>
<div class="col-sm-12 col-md-6 col-lg-6 mt-5">
<div class="amount-info-container inventory-amount-info-container">
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Receive Amount') }}</h6>
<input name="receive_amount" type="number" step="any" id="receive_amount" value="{{ $sale->change_amount + $sale->paidAmount }}" min="0" class="form-control receive_amount" placeholder="0">
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Change Amount') }}</h6>
<input type="number" step="any" id="change_amount" value="{{ $sale->change_amount }}" class="form-control" placeholder="0" readonly>
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Due Amount') }}</h6>
<input type="number" step="any" id="due_amount" class="form-control"
placeholder="0" readonly>
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Payment Type') }}</h6>
@include('business::component.payment_type', [ 'context' => 'sale', 'payment_types' => $payment_types, 'transactions' => $sale->transactions ?? [] ])
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Note') }}</h6>
<input type="text" name="note" value="{{ $sale->meta['note'] ?? '' }}" class="form-control" placeholder="{{ __('Type note...') }}">
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-6 mt-5 sub-total-container">
<div class="payment-container mb-3 amount-info-container inventory-amount-info-container">
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6>{{ __('Sub Total') }}</h6>
<h6 class="fw-bold" id="sub_total">
{{ currency_format(0, currency: business_currency()) }}</h6>
</div>
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6>{{ __('Vat') }}</h6>
<h6 class="fw-bold" id="vat_amount_txt">
{{ currency_format(($sale->vat_amount ?? 0) != 0 ? $sale->vat_amount : (($sale->vat_percent ?? 0) != 0 ? $sale->vat_percent : 0), currency: business_currency()) }}</h6>
</div>
<div class="row save-amount-container align-items-center mb-2 d-none">
<h6 class="payment-title col-6">{{ __('Vat') }}</h6>
<div class="col-6 w-100 d-flex justify-content-between gap-2">
<div class="d-flex d-flex align-items-center gap-2">
<select name="vat_id" class="form-select vat_select" id='form-ware'>
<option value="">{{ __('Select') }}</option>
@foreach($vats as $vat)
<option value="{{ $vat->id }}" data-rate="{{ $vat->rate }}" @selected($sale->vat_id == $vat->id)>{{ $vat->name }} ({{ $vat->rate }}%)</option>
@endforeach
</select>
</div>
<input type="number" step="any" name="vat_amount" id="vat_amount" value="{{ ($sale->vat_amount ?? 0) != 0 ? $sale->vat_amount : (($sale->vat_percent ?? 0) != 0 ? $sale->vat_percent : 0) }}" min="0" class="form-control right-start-input" placeholder="{{ __('0') }}" readonly>
</div>
</div>
<div class="row save-amount-container align-items-center mb-2">
<h6 class="payment-title col-6">{{ __('Discount') }}</h6>
<div class="col-6 w-100 d-flex justify-content-between gap-2">
<div class="d-flex d-flex align-items-center gap-2">
<select name="discount_type" class="form-select discount_type" id='form-ware'>
<option value="flat" @selected($sale->discount_type == 'flat')>{{ __('Flat') }} ({{ business_currency()->symbol }})</option>
<option value="percent" @selected($sale->discount_type == 'percent')>{{ __('Percent (%)') }}</option>
</select>
</div>
<input type="number" step="any" name="discountAmount" value="{{ $sale->discount_type == 'percent' ? $sale->discount_percent : $sale->discountAmount }}" id="discount_amount" min="0" class="right-start-input form-control" placeholder="{{ __('0') }}">
</div>
</div>
<div class="row save-amount-container align-items-center mb-2">
<h6 class="payment-title col-6">{{ __('Shipping Charge') }}</h6>
<div class="col-12 ">
<input type="number" step="any" name="shipping_charge" value="{{ $sale->shipping_charge }}" id="shipping_charge" class="form-control right-start-input" placeholder="0">
</div>
</div>
<div class=" d-flex align-items-center justify-content-between fw-bold">
<div class="fw-bold">{{ __('Total Amount') }}</div>
<h6 class='fw-bold' id="total_amount">
{{ currency_format($sale->actual_total_amount, currency: business_currency()) }}</h6>
</div>
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6>{{ __('Rounding(+/-)') }}</h6>
<h6 id="rounding_amount">
{{ currency_format(abs($sale->rounding_amount), currency: business_currency()) }}</h6>
</div>
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6 class="fw-bold">{{ __('Payable Amount') }}</h6>
<h6 class="fw-bold" id="payable_amount">
{{ currency_format($sale->totalAmount, currency: business_currency()) }}</h6>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="button-group text-center ">
<button data-route="{{ route('business.carts.remove-all') }}"
class="theme-btn border-btn m-2">{{__('Cancel')}}
</button>
<button class="theme-btn m-2 submit-btn">{{__('Submit')}}</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@php
$rounding_amount_option = sale_rounding();
@endphp
<input type="hidden" id="get_product" value="{{ route('business.products.prices') }}">
<input type="hidden" value="{{ route('business.carts.index') }}" id="get-cart">
<input type="hidden" value="{{ route('business.sales.cart-data') }}" id="get-cart-data">
<input type="hidden" value="{{ route('business.carts.remove-all') }}" id="clear-cart">
<input type="hidden" id="rounding_amount_option" value="{{ $rounding_amount_option }}">
<input type="hidden" id="all-products" value="{{ route('business.products.all-product') }}">
<input type="hidden" id="get-by-category" value="{{ route('business.products.get-by-category') }}">
<input type="hidden" id="cart-store-url" value="{{ route('business.carts.store') }}">
<input type="hidden" id="selectedProductValue" name="selectedProductValue">
<input type="hidden" id="asset_base_url" value="{{ asset('') }}">
<input type="hidden" id="get_stock_prices" value="{{ route('business.products.stocks-prices') }}">
@endsection
@push('modal')
@include('business::sales.calculator')
@include('business::sales.customer-create')
@endpush
@push('js')
<script src="{{ asset('assets/js/custom/sale.js') . '?v=' . time() }}"></script>
<script src="{{ asset('assets/js/custom/math.min.js') }}"></script>
<script src="{{ asset('assets/js/custom/calculator.js') }}"></script>
@endpush

View File

@@ -0,0 +1,320 @@
@extends('layouts.business.master')
@section('title')
{{ __('Pos Sale') }}
@endsection
@php
$modules = product_setting()->modules ?? [];
@endphp
@push('css')
<link rel="stylesheet" href="{{ asset('assets/css/calculator.css') }}">
<link rel="stylesheet" href="{{ asset('assets/css/choices.min.css') }}">
@endpush
@section('main_content')
<div class="container-fluid">
<div class="grid row p-lr2 sales-main-container">
<div class="sales-container">
<!-- Quick Action Section -->
<div class="quick-act-header">
<div class="d-flex flex-column flex-sm-row justify-content-between align-items-center">
<div class="mb-2 mb-sm-0">
<h4 class='quick-act-title'>{{ __('Quick Action') }}</h4>
</div>
<div class="quick-actions-container">
<a href="{{ route('business.products.index') }}"
class='save-product-btn d-flex align-items-center gap-1'>
<img src="{{ asset('assets/images/icons/product.svg') }}" alt="">
{{ __('Product List') }}
</a>
<a href="{{ route('business.sales.index', ['today' => true]) }}"
class='sales-btn d-flex align-items-center gap-1'>
<img src="{{ asset('assets/images/icons/sales.svg') }}" alt="">
{{ __('Today Sales') }}
</a>
<button data-bs-toggle="modal" data-bs-target="#calculatorModal"
class='calculator-btn d-flex align-items-center gap-1'>
<img src="{{ asset('assets/images/icons/calculator.svg') }}" alt="">
{{ __('Calculator') }}
</button>
<a href="{{ route('business.dashboard.index') }}"
class='dashboard-btn d-flex align-items-center gap-1'>
<img src="{{ asset('assets/images/icons/dashboard.svg') }}" alt="">
{{ __('Dashboard') }}
</a>
</div>
</div>
</div>
<form action="{{ route('business.sales.update', $sale->id) }}" method="post"
enctype="multipart/form-data"
class="ajaxform">
@csrf
@method('put')
<div class="mt-4 mb-3">
<div class="row g-3">
<!-- First Row -->
<div class="col-12 col-md-6">
<div class="input-group">
<input type="date" name="saleDate" class="form-control" value="{{ formatted_date($sale->saleDate, 'Y-m-d') }}">
</div>
</div>
<div class="col-12 col-md-6">
<input type="text" name="invoiceNumber" value="{{ $sale->invoiceNumber }}" class="form-control" placeholder="{{ __('Invoice no') }}.">
</div>
<div class="col-6 ">
<div class="d-flex align-items-center">
<select name="party_id" class="form-select choices-select customer-select" aria-label="Select Customer">
<option value="">{{ __('Guest') }}</option>
@foreach ($customers as $customer)
<option value="{{ $customer->id }}" data-type="{{ $customer->type }}" @selected($sale->party_id == $customer->id)>
{{ $customer->name }} ({{ $customer->type }} {{ $customer->due ? ' ' . currency_format($customer->due, currency:business_currency()) : '' }})
</option>
@endforeach
</select>
<a href="{{ route('business.parties.create', ['type' => 'Customer']) }}" class="btn btn-danger square-btn d-flex justify-content-center align-items-center" type="button">
<img src="{{ asset('assets/images/icons/plus-square.svg') }}" alt="">
</a>
</div>
</div>
<div class="col-6">
<div class="d-flex align-items-center">
<select required name="warehouse_id" class="form-select choices-select warehouse_id" aria-label="Select Customer">
<option value="">{{ __('Select Warehouse') }}</option>
@foreach ($warehouses as $warehouse)
<option value="{{ $warehouse->id }}">{{ $warehouse->name }}</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
<div class="cart-payment">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th class="border table-background">{{ __('Image') }}</th>
<th class="border table-background">{{ __('Items') }}</th>
<th class="border table-background">{{ __('Code') }}</th>
<th class="border table-background">{{ __('Batch') }}</th>
<th class="border table-background">{{ __('Unit') }}</th>
<th class="border table-background">{{ __('Sale Price') }}</th>
@if ($modules['allow_product_discount'] ?? false)
<th class="border table-background">{{ __('Discount') }}</th>
@endif
<th class="border table-background">{{ __('Vat %') }}</th>
<th class="border table-background">{{ __('Vat Value') }}</th>
<th class="border table-background">{{ __('Qty') }}</th>
<th class="border table-background">{{ __('Sub Total') }}</th>
<th class="border table-background">{{ __('Action') }}</th>
</tr>
</thead>
<tbody class='text-start' id="cart-list">
@include('business::sales.cart-list')
</tbody>
</table>
</div>
<div class="hr-container">
<hr>
</div>
<!-- Make Payment Section start -->
<div class="grid row py-3 payment-section">
<div class="col-sm-12 col-md-6 col-lg-6">
<div class="amount-info-container">
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Receive Amount') }}</h6>
<input name="receive_amount" type="number" step="any" id="receive_amount"
value="{{ $sale->change_amount + $sale->paidAmount }}" min="0"
class="form-control receive_amount"
placeholder="0">
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Change Amount') }}</h6>
<input type="number" step="any" id="change_amount"
value="{{ $sale->change_amount }}" class="form-control"
placeholder="0" readonly>
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Due Amount') }}</h6>
<input type="number" step="any" id="due_amount" class="form-control"
placeholder="0" readonly>
</div>
<div class="row amount-container align-items-start mb-2">
<h6 class="payment-title">{{ __('Payment Type') }}</h6>
@include('business::component.payment_type', [ 'context' => 'sale', 'payment_types' => $payment_types, 'transactions' => $sale->transactions ?? [] ])
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Note') }}</h6>
<input type="text" name="note" value="{{ $sale->meta['note'] ?? '' }}"
class="form-control" placeholder="{{ __('Type note...') }}">
</div>
</div>
<div class="mt-3">
<button class="save-btn cancel-sale-btn"
data-route="{{ route('business.carts.remove-all') }}">{{ __('Cancel') }}</button>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-6">
<div class="payment-container mb-3 amount-info-container">
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6>{{ __('Sub Total') }}</h6>
<h6 class="fw-bold" id="sub_total">
{{ currency_format(0, currency: business_currency()) }}</h6>
</div>
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6>{{ get_business_option('business-settings')['vat_name'] ?? 'Vat' }}</h6>
<h6 class="fw-bold" id="vat_amount_txt">
{{ currency_format(($sale->vat_amount ?? 0) != 0 ? $sale->vat_amount : (($sale->vat_percent ?? 0) != 0 ? $sale->vat_percent : 0), currency: business_currency()) }}</h6>
</div>
<div class="row save-amount-container align-items-center mb-2 d-none">
<h6 class="payment-title col-6">{{ get_business_option('business-settings')['vat_name'] ?? 'Vat' }}</h6>
<div class="col-6 w-100 d-flex justify-content-between gap-2">
<div class="d-flex d-flex align-items-center gap-2">
<select name="vat_id" class="form-select vat_select" id='form-ware'>
<option value="">{{ __('Select') }}</option>
@foreach($vats as $vat)
<option value="{{ $vat->id }}"
data-rate="{{ $vat->rate }}" @selected($sale->vat_id == $vat->id)>{{ $vat->name }}
({{ $vat->rate }}%)
</option>
@endforeach
</select>
</div>
<input type="number" step="any" name="vat_amount" id="vat_amount"
value="{{ ($sale->vat_amount ?? 0) != 0 ? $sale->vat_amount : (($sale->vat_percent ?? 0) != 0 ? $sale->vat_percent : 0) }}"
min="0" class="form-control right-start-input"
placeholder="{{ __('0') }}" readonly>
</div>
</div>
<div class="row save-amount-container align-items-center mb-2">
<h6 class="payment-title col-6">{{ __('Discount') }}</h6>
<div class="col-6 w-100 d-flex justify-content-between gap-2">
<div class="d-flex d-flex align-items-center gap-2">
<select name="discount_type" class="form-select discount_type" id='form-ware'>
<option value="flat" @selected($sale->discount_type == 'flat')>{{ __('Flat') }}
({{ business_currency()->symbol }})
</option>
<option value="percent" @selected($sale->discount_type == 'percent')>{{ __('Percent (%)') }}</option>
</select>
</div>
<input type="number" step="any" name="discountAmount"
value="{{ $sale->discount_type == 'percent' ? $sale->discount_percent : $sale->discountAmount }}"
id="discount_amount" min="0" class="right-start-input form-control"
placeholder="{{ __('0') }}">
</div>
</div>
<div class="shopping-crg-grid mb-2">
<h6 class="payment-title">{{ __('Shipping Charge') }}</h6>
<div class="">
<input type="number" step="any" name="shipping_charge"
value="{{ $sale->shipping_charge }}" id="shipping_charge"
class="form-control right-start-input" placeholder="0">
</div>
</div>
<div class=" d-flex align-items-center justify-content-between fw-bold">
<div class="fw-bold">{{ __('Total Amount') }}</div>
<h6 class='fw-bold' id="total_amount">
{{ currency_format($sale->actual_total_amount, currency: business_currency()) }}</h6>
</div>
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6>{{ __('Rounding(+/-)') }}</h6>
<h6 id="rounding_amount">{{ currency_format(abs($sale->rounding_amount), currency: business_currency()) }}</h6>
</div>
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6 class="fw-bold">{{ __('Payable Amount') }}</h6>
<h6 class="fw-bold" id="payable_amount">{{ currency_format($sale->totalAmount, currency: business_currency()) }}</h6>
</div>
</div>
@usercan('sales.update')
<div class="sale-btn-container-2">
<button class="submit-btn payment-btn">{{ __('Sale') }}</button>
</div>
@endusercan
</div>
</div>
<!-- Make Payment Section end -->
</div>
</form>
</div>
<div class=" main-container">
<!-- Products Header -->
<div class="products-header">
<div class="container-fluid p-0">
<div class="row g-2 w-100 align-items-center search-product">
<div class="w-100">
<!-- Search Input and Add Button -->
<form action="{{ route('business.sales.product-filter') }}" method="post" class="product-filter product-filter-form" table="#products-list">
@csrf
<div class="d-flex">
<input type="text" name="search" class="form-control search-input"
placeholder="{{ __('Search product...') }}">
<button class="btn btn-search">
<i class="far fa-search"></i>
</button>
</div>
</form>
</div>
<div class="w-100 d-flex align-items-center gap-2">
<!-- Category Button -->
<a data-bs-toggle="offcanvas" data-bs-target="#category-search-modal"
aria-controls="offcanvasRight"
class="btn btn-category w-100">{{ __('Category') }}</a>
<!-- Brand Button -->
<a data-bs-toggle="offcanvas" data-bs-target="#brand-search-modal"
aria-controls="offcanvasRight" class="btn btn-brand w-100">{{ __('Brand') }}</a>
</div>
</div>
</div>
</div>
<div class="products-container">
<div class="p-3 scroll-card">
<div class="search-product-card products gap-2 @if (count($products) === 1) single-product @endif product-list-container"
id="products-list">
@include('business::sales.product-list')
</div>
</div>
</div>
</div>
</div>
</div>
@php
$rounding_amount_option = sale_rounding();
@endphp
<input type="hidden" id="get_product" value="{{ route('business.products.prices') }}">
<input type="hidden" value="{{ route('business.carts.index') }}" id="get-cart">
<input type="hidden" value="{{ route('business.sales.cart-data') }}" id="get-cart-data">
<input type="hidden" value="{{ route('business.carts.remove-all') }}" id="clear-cart">
<input type="hidden" id="rounding_amount_option" value="{{ $rounding_amount_option }}">
<input type="hidden" id="get-by-category" value="{{ route('business.products.get-by-category') }}">
<input type="hidden" id="cart-store-url" value="{{ route('business.carts.store') }}">
<input type="hidden" id="selectedProductValue" name="selectedProductValue">
<input type="hidden" id="asset_base_url" value="{{ asset('') }}">
<input type="hidden" id="get_stock_prices" value="{{ route('business.products.stocks-prices') }}">
<input type="hidden" id="warehouse_module_exist" value="{{ moduleCheck('WarehouseAddon') ? 1 : 0 }}">
@endsection
@push('modal')
@include('business::sales.calculator')
@include('business::sales.category-search')
@include('business::sales.brand-search')
@include('business::sales.stock-list')
@endpush
@push('js')
<script src="{{ asset('assets/js/custom/sale.js') . '?v=' . time() }}"></script>
<script src="{{ asset('assets/js/custom/calculator.js') }}"></script>
<script src="{{ asset('assets/js/choices.min.js') }}"></script>
@endpush

View File

@@ -0,0 +1,119 @@
@extends('layouts.business.master')
@section('title')
{{ __('Sales List') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="card">
<div class="card-bodys">
<div class="table-header p-16">
<h4>{{ __('Sales List') }}</h4>
</div>
<div class="table-top-form p-16-0">
<div class="d-flex align-items-center gap-3 flex-wrap">
<div class="d-flex align-items-center gap-3 flex-wrap margin-lr-16">
<form action="{{ route('business.sales.index') }}" method="GET" class="report-filter-form" table="#sales-data">
<div class="table-top-left d-flex gap-3 flex-wrap">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
@if(auth()->user()->accessToMultiBranch())
<div class="table-search position-relative">
<div class="gpt-up-down-arrow position-relative">
<select name="branch_id" class="form-control">
<option value="">{{ __('Select Branch') }}</option>
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected(request('branch_id') == $branch->id) >{{ $branch->name }}</option>
@endforeach
</select>
<span></span>
</div>
</div>
@endif
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D"
stroke-width="1.25" stroke-linecap="round"
stroke-linejoin="round"/>
<path
d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z"
stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
<div class="custom-from-to align-items-center date-filters d-none">
<label>{{ __('From Date') }}</label>
<input type="date" name="from_date" value="{{ request('from_date') ?? now()->format('Y-m-d') }}" class="form-control">
</div>
<div class="custom-from-to align-items-center date-filters d-none">
<label>{{ __('To Date') }}</label>
<input type="date" name="to_date" value="{{ request('to_date') ?? now()->format('Y-m-d') }}" class="form-control">
</div>
<div
class="gpt-up-down-arrow position-relative d-print-none custom-date-filter">
<select name="custom_days" class="form-control custom-days">
<option value="today" {{ request()->get('custom_days') == 'today' ? 'selected' : '' }}>{{ __('Today') }}</option>
<option value="yesterday" {{ request()->get('custom_days') == 'yesterday' ? 'selected' : '' }}>{{ __('Yesterday') }}</option>
<option value="last_seven_days" {{ request()->get('custom_days') == 'last_seven_days' ? 'selected' : '' }}>{{ __('Last 7 Days') }}</option>
<option value="last_thirty_days" {{ request()->get('custom_days') == 'last_thirty_days' ? 'selected' : '' }}>{{ __('Last 30 Days') }}</option>
<option value="current_month" {{ request()->get('custom_days') == 'current_month' ? 'selected' : '' }}>{{ __('Current Month') }}</option>
<option value="last_month" {{ request()->get('custom_days') == 'last_month' ? 'selected' : '' }}>{{ __('Last Month') }}</option>
<option value="current_year" {{ request()->get('custom_days') == 'current_year' ? 'selected' : '' }}>{{ __('Current Year') }}</option>
<option value="custom_date" {{ request()->get('custom_days') == 'custom_date' ? 'selected' : '' }}>{{ __('Custom Date') }}</option>
</select>
<span></span>
<div class="calendar-icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.6667 2.67188H3.33333C2.59695 2.67188 2 3.26883 2 4.00521V13.3385C2 14.0749 2.59695 14.6719 3.33333 14.6719H12.6667C13.403 14.6719 14 14.0749 14 13.3385V4.00521C14 3.26883 13.403 2.67188 12.6667 2.67188Z" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M10.6641 1.32812V3.99479" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5.33594 1.32812V3.99479" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M2 6.67188H14" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="delete-item delete-show d-none">
<div class="delete-item-show">
<p class="fw-bold"><span class="selected-count"></span> {{ __('items show') }}</p>
<button data-bs-toggle="modal" class="trigger-modal" data-bs-target="#multi-delete-modal" data-url="{{ route('business.sales.delete-all') }}">{{ __('Delete') }}</button>
</div>
</div>
<div id="sales-data">
@include('business::sales.datas')
</div>
</div>
</div>
</div>
<input type="hidden" id="payment-delete-route" data-url="{{ route('business.delete.payments', ['type' => ':type', 'id' => ':id']) }}">
@endsection
@push('modal')
@include('business::component.add-payment')
@include('business::component.delete-modal')
@include('business::component.view-payment-modal')
@include('business::component.edit-payment')
@endpush

View File

@@ -0,0 +1,262 @@
@extends('layouts.business.master')
@section('title')
{{ __('Inventory Sales') }}
@endsection
@php
$modules = product_setting()->modules ?? [];
@endphp
@section('main_content')
<div class="container-fluid">
<div class="card">
<div class="table-header p-16">
<h4>{{ __('Inventory Sales') }}</h4>
</div>
<div class="order-form-section p-16">
<form action="{{ route('business.sales.store') }}" method="post" enctype="multipart/form-data"
class="ajaxform">
@csrf
<input type="hidden" name="type" value="inventory">
<div class="row mt-3">
<div class="col-lg-4">
<label>{{ __('Customer') }}</label>
<div class="input-group">
<select name="party_id" class="form-control inventory-customer-select" aria-label="Select Customer">
<option value="">{{ __('Guest') }}</option>
@foreach ($customers as $customer)
<option value="{{ $customer->id }}" data-type="{{ $customer->type }}">
{{ $customer->name }} ({{ $customer->type }}{{ $customer->due ? ' ' . currency_format($customer->due, currency:business_currency()) : '' }})
</option>
@endforeach
</select>
<a type="button" href="#customer-create-modal" data-bs-toggle="modal"
class="btn btn-danger square-btn d-flex justify-content-center align-items-center">
<img src="{{ asset('assets/images/icons/plus.svg') }}" alt=""></a>
</div>
</div>
<div class="col-lg-4">
<label>{{ __('Invoice No') }}.</label>
<input type="text" name="invoiceNumber" value="{{ $invoice_no }}" class="form-control"
placeholder="{{ __('Invoice no') }}." readonly>
</div>
<div class="col-lg-4">
<label>{{ __('Date') }}</label>
<input type="date" name="saleDate" class="form-control"
value="{{ now()->format('Y-m-d') }}">
</div>
<div class="col-lg-8">
<label>{{ __('Select Product') }}</label>
<div class="product-dropdown" id="productDropdown">
<div class="input-group w-100">
<div class="product-selected w-100">
<span id="selectedValue">{{ __('Select Product') }}</span><span id="arrow">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 6L8 10L12 6" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</span>
</div>
<a type="button" href="jsvascript:void(0)" class="btn btn-danger inventory-square-btn square-btn d-flex justify-content-center align-items-center">
<svg class="bar-code-icon" width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.75 7.03125H5.625V22.9688H3.75V7.03125ZM13.5938 7.03125H15.4688V22.9688H13.5938V7.03125ZM24.375 7.03125H26.25V22.9688H24.375V7.03125ZM9.375 7.03125H10.3125V22.9688H9.375V7.03125ZM11.25 7.03125H12.1875V22.9688H11.25V7.03125ZM19.6875 7.03125H20.625V22.9688H19.6875V7.03125ZM21.5625 7.03125H22.5V22.9688H21.5625V7.03125ZM7.03125 7.03125H8.4375V22.9688H7.03125V7.03125ZM16.875 7.03125H18.2812V22.9688H16.875V7.03125Z" fill="white"/>
<path d="M1.40625 9.84375C1.28193 9.84375 1.1627 9.79436 1.07479 9.70646C0.986886 9.61855 0.9375 9.49932 0.9375 9.375V4.6875C0.9375 4.56318 0.986886 4.44395 1.07479 4.35604C1.1627 4.26814 1.28193 4.21875 1.40625 4.21875H6.09375C6.21807 4.21875 6.3373 4.26814 6.42521 4.35604C6.51311 4.44395 6.5625 4.56318 6.5625 4.6875C6.5625 4.81182 6.51311 4.93105 6.42521 5.01896C6.3373 5.10686 6.21807 5.15625 6.09375 5.15625H1.875V9.375C1.875 9.49932 1.82561 9.61855 1.73771 9.70646C1.6498 9.79436 1.53057 9.84375 1.40625 9.84375ZM28.5938 9.84375C28.4694 9.84375 28.3502 9.79436 28.2623 9.70646C28.1744 9.61855 28.125 9.49932 28.125 9.375V5.15625H23.9062C23.7819 5.15625 23.6627 5.10686 23.5748 5.01896C23.4869 4.93105 23.4375 4.81182 23.4375 4.6875C23.4375 4.56318 23.4869 4.44395 23.5748 4.35604C23.6627 4.26814 23.7819 4.21875 23.9062 4.21875H28.5938C28.7181 4.21875 28.8373 4.26814 28.9252 4.35604C29.0131 4.44395 29.0625 4.56318 29.0625 4.6875V9.375C29.0625 9.49932 29.0131 9.61855 28.9252 9.70646C28.8373 9.79436 28.7181 9.84375 28.5938 9.84375ZM6.09375 25.7812H1.40625C1.28193 25.7812 1.1627 25.7319 1.07479 25.644C0.986886 25.556 0.9375 25.4368 0.9375 25.3125V20.625C0.9375 20.5007 0.986886 20.3815 1.07479 20.2935C1.1627 20.2056 1.28193 20.1562 1.40625 20.1562C1.53057 20.1562 1.6498 20.2056 1.73771 20.2935C1.82561 20.3815 1.875 20.5007 1.875 20.625V24.8438H6.09375C6.21807 24.8438 6.3373 24.8931 6.42521 24.981C6.51311 25.069 6.5625 25.1882 6.5625 25.3125C6.5625 25.4368 6.51311 25.556 6.42521 25.644C6.3373 25.7319 6.21807 25.7812 6.09375 25.7812ZM28.5938 25.7812H23.9062C23.7819 25.7812 23.6627 25.7319 23.5748 25.644C23.4869 25.556 23.4375 25.4368 23.4375 25.3125C23.4375 25.1882 23.4869 25.069 23.5748 24.981C23.6627 24.8931 23.7819 24.8438 23.9062 24.8438H28.125V20.625C28.125 20.5007 28.1744 20.3815 28.2623 20.2935C28.3502 20.2056 28.4694 20.1562 28.5938 20.1562C28.7181 20.1562 28.8373 20.2056 28.9252 20.2935C29.0131 20.3815 29.0625 20.5007 29.0625 20.625V25.3125C29.0625 25.4368 29.0131 25.556 28.9252 25.644C28.8373 25.7319 28.7181 25.7812 28.5938 25.7812Z" fill="white"/>
<path d="M1.40625 14.0625H28.5938V15.9375H1.40625V14.0625Z" fill="white"/>
</svg>
</a>
</div>
<div class="dropdown-search hidden" id="searchContainer">
<input type="text" id="productSearch" placeholder="Search product..." />
</div>
<div class="product-dropdown-options" id="dropdownList">
{{-- load dynamically from js --}}
</div>
</div>
</div>
<div class="col-lg-4">
<label>{{ __('Category') }}</label>
<div class="input-group">
<select name="category_id" id="categorySelect" class="form-control" aria-label="Select Category">
<option value="">{{ __('All') }}</option>
@foreach ($categories as $category)
<option value="{{ $category->id }}">{{ $category->categoryName }}</option>
@endforeach
</select>
</div>
</div>
<div class="table-responsive mt-4">
<table class="table table-bordered text-center">
<thead>
<tr>
<th class="border p-2 table-background">{{ __('Image') }}</th>
<th class="border p-2 table-background">{{ __('Items') }}</th>
<th class="border p-2 table-background">{{ __('Code') }}</th>
<th class="border p-2 table-background">{{ __('Batch') }}</th>
<th class="border p-2 table-background">{{ __('Unit') }}</th>
<th class="border p-2 table-background">{{ __('Sale Price') }}</th>
@if ($modules['allow_product_discount'] ?? false)
<th class="border p-2 table-background">{{ __('Discount') }}</th>
@endif
<th class="border p-2 table-background">{{ __('Vat %') }}</th>
<th class="border p-2 table-background">{{ __('Vat Value') }}</th>
<th class="border p-2 table-background">{{ __('Qty') }}</th>
<th class="border p-2 table-background">{{ __('Sub Total') }}</th>
<th class="border p-2 table-background">{{ __('Action') }}</th>
</tr>
</thead>
<tbody id="cart-list">
@include('business::sales.cart-list')
</tbody>
</table>
</div>
<div class="col-sm-12 col-md-6 col-lg-6 mt-5">
<div class="amount-info-container inventory-amount-info-container">
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Receive Amount') }}</h6>
<input name="receive_amount" type="number" step="any" id="receive_amount"
min="0" class="form-control receive_amount" placeholder="0">
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Change Amount') }}</h6>
<input type="number" step="any" id="change_amount" class="form-control"
placeholder="0" readonly>
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Due Amount') }}</h6>
<input type="number" step="any" id="due_amount" class="form-control"
placeholder="0" readonly>
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Payment Type') }}</h6>
@include('business::component.payment_type', ['context' => 'sale', 'payment_types' => $payment_types])
</div>
<div class="row amount-container align-items-center mb-2">
<h6 class="payment-title">{{ __('Note') }}</h6>
<input type="text" name="note" class="form-control"
placeholder="{{ __('Type note...') }}">
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-6 mt-5 sub-total-container">
<div class="payment-container mb-3 amount-info-container inventory-amount-info-container">
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6>{{ __('Sub Total') }}</h6>
<h6 class="fw-bold" id="sub_total">
{{ currency_format(0, currency: business_currency()) }}</h6>
</div>
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6>{{ get_business_option('business-settings')['vat_name'] ?? 'Vat' }}</h6>
<h6 class="fw-bold" id="vat_amount_txt">
{{ currency_format(0, currency: business_currency()) }}</h6>
</div>
<div class="row save-amount-container align-items-center mb-2 d-none">
<h6 class="payment-title col-6">{{ get_business_option('business-settings')['vat_name'] ?? 'Vat' }}</h6>
<div class="col-6 w-100 d-flex justify-content-between gap-2">
<div class="d-flex d-flex align-items-center gap-2">
<select name="vat_id" class="form-select vat_select" id='form-ware'>
<option value="">{{ __('Select') }}</option>
@foreach ($vats as $vat)
<option value="{{ $vat->id }}" data-rate="{{ $vat->rate }}">
{{ $vat->name }}
({{ $vat->rate }}%)
</option>
@endforeach
</select>
</div>
<input type="number" step="any" name="vat_amount" id="vat_amount"
min="0" class="form-control right-start-input"
placeholder="{{ __('0') }}" readonly>
</div>
</div>
<div class="row save-amount-container align-items-center mb-2">
<h6 class="payment-title col-6">{{ __('Discount') }}</h6>
<div class="col-6 w-100 d-flex justify-content-between gap-2">
<div class="d-flex d-flex align-items-center gap-2">
<select name="discount_type" class="form-select discount_type"
id='form-ware'>
<option value="flat">{{ __('Flat') }}
({{ business_currency()->symbol }})</option>
<option value="percent">{{ __('Percent (%)') }}</option>
</select>
</div>
<input type="number" step="any" name="discountAmount" id="discount_amount"
min="0" class="form-control right-start-input"
placeholder="{{ __('0') }}">
</div>
</div>
<div class="shopping-crg-grid mb-2">
<h6 class="payment-title">{{ __('Shipping Charge') }}</h6>
<div class="">
<input type="number" step="any" name="shipping_charge" id="shipping_charge"
class="form-control right-start-input" placeholder="0">
</div>
</div>
<div class=" d-flex align-items-center justify-content-between fw-bold">
<div class="fw-bold">{{ __('Total Amount') }}</div>
<h6 class='fw-bold' id="total_amount">
{{ currency_format(0, currency: business_currency()) }}</h6>
</div>
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6>{{ __('Rounding(+/-)') }}</h6>
<h6 id="rounding_amount">
{{ currency_format(0, currency: business_currency()) }}</h6>
</div>
<div class="mb-2 d-flex align-items-center justify-content-between">
<h6 class="fw-bold">{{ __('Payable Amount') }}</h6>
<h6 class="fw-bold" id="payable_amount">
{{ currency_format(0, currency: business_currency()) }}</h6>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="button-group text-center ">
<button data-route="{{ route('business.carts.remove-all') }}"
class="theme-btn border-btn m-2">{{__('Cancel')}}
</button>
@usercan('inventory.create')
<button class="theme-btn m-2 submit-btn">{{__('Submit')}}</button>
@endusercan
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@php
$rounding_amount_option = sale_rounding();
@endphp
<input type="hidden" id="get_product" value="{{ route('business.products.prices') }}">
<input type="hidden" value="{{ route('business.carts.index') }}" id="get-cart">
<input type="hidden" value="{{ route('business.sales.cart-data') }}" id="get-cart-data">
<input type="hidden" value="{{ route('business.carts.remove-all') }}" id="clear-cart">
<input type="hidden" id="rounding_amount_option" value="{{ $rounding_amount_option }}">
<input type="hidden" id="all-products" value="{{ route('business.products.all-product') }}">
<input type="hidden" id="get-by-category" value="{{ route('business.products.get-by-category') }}">
<input type="hidden" id="cart-store-url" value="{{ route('business.carts.store') }}">
<input type="hidden" id="selectedProductValue" name="selectedProductValue">
<input type="hidden" id="asset_base_url" value="{{ url('/') }}">
<input type="hidden" id="get_stock_prices" value="{{ route('business.products.stocks-prices') }}">
@endsection
@push('modal')
@include('business::sales.calculator')
@include('business::sales.customer-create')
@endpush
@push('js')
<script src="{{ asset('assets/js/custom/sale.js') }}?v={{ time() }}"></script>
<script src="{{ asset('assets/js/custom/math.min.js') }}"></script>
<script src="{{ asset('assets/js/custom/calculator.js') }}"></script>
@endpush

View File

@@ -0,0 +1,13 @@
@extends('layouts.business.blank')
@section('title')
{{ __('Invoice') }}
@endsection
@section('main_content')
@if (invoice_setting() == '3_inch_80mm' && moduleCheck('ThermalPrinterAddon'))
@include('thermalprinteraddon::sales.3_inch_80mm')
@else
@include('business::sales.invoices.a4-size')
@endif
@endsection

View File

@@ -0,0 +1,623 @@
<div class="invoice-container">
<div class="invoice-content p-4">
{{-- Print Header --}}
<div class="row py-2 d-flex align-items-start justify-content-between border-bottom print-container d-print-none">
<div class="col-md-6 d-flex align-items-center p-2">
<span class="Money-Receipt">{{ __('Sales Invoice') }}</span>
</div>
<div class="col-md-6 d-flex justify-content-end align-items-end">
<div class="d-flex gap-2">
<form action="{{ route('business.sales.mail', ['sale_id' => $sale->id]) }}" method="POST"
class="ajaxform_instant_reload ">
@csrf
<button type="submit" class="btn custom-print-btn"><img class="w-10 h-10"
src="{{ asset('assets/img/email.svg') }}"><span class="text-white pl-1">{{ __('Email') }}</span>
</button>
</form>
<a target="blank" class="pdf-btn print-btn" href="{{ route('business.sales.pdf', ['sale_id' => $sale->id]) }}">
<img class="w-10 h-10" src="{{ asset('assets/img/pdf.svg') }}">
{{ __('PDF') }}
</a>
<a class="print-btn-2 print-btn" onclick="window.print()"><img class="w-10 h-10" src="{{ asset('assets/img/print.svg') }}">{{ __('Print') }}</a>
</div>
</div>
</div>
<div class="d-flex justify-content-between align-items-center gap-3 print-logo-container">
{{-- Left Side: Logo and Content --}}
<div class="d-flex align-items-center gap-2 logo pdf-logo">
@if ((get_business_option('business-settings')['show_a4_invoice_logo'] ?? 0) == 1 )
<img class="invoice-logo" src="{{ asset(get_business_option('business-settings')['a4_invoice_logo'] ?? 'assts/images/default.svg') ?? '' }}">
@endif
</div>
{{-- Right Side: Invoice --}}
<div>
<div class="address-container">
@if (($sale->business->meta['show_address'] ?? 0) == 1)
<p> {{__('Address')}} : {{ $sale->branch?->address ?? $sale->business?->address ?? '' }}</p>
@endif
@if (($sale->business->meta['show_phone_number'] ?? 0) == 1)
<p> {{__('Mobile')}} : {{ $sale->branch?->phone ?? $sale->business?->phoneNumber ?? '' }}</p>
@endif
@if (($sale->business->meta['show_email'] ?? 0) == 1)
<p> {{__('Email')}} : {{ $sale->branch?->email ?? $sale->business?->email ?? '' }}</p>
@endif
<p>
@if (($sale->business->meta['show_vat'] ?? 0) == 1)
{{ $sale->business->vat_name }}
@endif
{{ (($sale->business->meta['show_vat'] ?? 0) == 1 && ($sale->business->meta['show_vat'] ?? 0) == 1) ? ':' : '' }}
@if (($sale->business->meta['show_vat'] ?? 0) == 1)
{{ $sale->business->vat_no ?? '' }}
@endif
</p>
</div>
</div>
</div>
<h3 class="right-invoice mb-0 align-self-center white-text">{{ __('INVOICE') }}</h3>
<div class="d-flex align-items-start justify-content-between flex-wrap">
<div>
<table class="table">
<tbody>
<tr class="in-table-row">
<td class="text-start bold-title">{{ __('Customer') }}</td>
<td class="text-start">: {{ $sale->party->name ?? 'Guest' }}</td>
</tr>
<tr class="in-table-row">
<td class="text-start bold-title">{{ __('Address') }}</td>
<td class="text-start">: {{ $sale->party->address ?? '' }}</td>
</tr>
<tr class="in-table-row ">
<td class="text-start bold-title">{{ __('Phone') }}</td>
<td class="text-start">: {{ $sale->party->phone ?? 'Guest' }}</td>
</tr>
<tr class="in-table-row ">
<td class="text-start bold-title">{{ __('Remarks') }}</td>
<td class="text-start">:
{{ $sale->meta['note'] ?? 'N/A' }}
</td>
</tr>
</tbody>
</table>
</div>
<div class="">
<table class="table">
<tbody>
<tr class="in-table-row">
<td class="text-start bold-title">{{ __('Invoice No') }}</td>
<td class="text-start"> : {{ $sale->invoiceNumber ?? '' }}</td>
</tr>
<tr class="in-table-row">
<td class="text-start bold-title">{{ __('Date') }}</td>
<td class="text-start">: {{ formatted_date($sale->saleDate ?? '') }}</td>
</tr>
<tr class="in-table-row">
<td class="text-start bold-title">{{ __('Time') }}</td>
<td class="text-start">: {{ formatted_time($sale->saleDate ?? '') }}</td>
</tr>
<tr class="in-table-row">
<td class="text-start bold-title">{{ __('Sales By') }}</td>
<td class="text-start">: {{ $sale->user->role != 'staff' ? 'Admin' : $sale->user->name }}</td>
</tr>
</tbody>
</table>
</div>
</div>
{{-- Sale Return --}}
@if (!$sale_returns->isEmpty())
{{-- Sales portion--}}
<div class="table-content custom-invoice-table">
<table class="table table-striped mb-1">
<thead>
<tr class="in-table-header">
<th class="head-red text-center white-text">{{ __('SL') }}</th>
<th class="head-red text-start white-text invoice-item">{{ __('Item') }}</th>
<th class="head-black text-center white-text">{{ __('Quantity') }}</th>
@if ($hasWarranty)
<th class="head-black text-center white-text">{{ __('Warranty') }}</th>
@endif
@if ($hasGuarantee)
<th class="head-black text-center white-text">{{ __('Guarantee') }}</th>
@endif
<th class="head-black text-end white-text">{{ __('Unit Price') }}</th>
<th class="head-black text-end white-text">{{ __('Discount') }}</th>
<th class="head-black text-end white-text">{{ __('Vat %') }}</th>
<th class="head-black text-end white-text">{{ __('Vat Value') }}</th>
<th class="head-black text-end white-text">{{ __('Total Price') }}</th>
</tr>
</thead>
@php
$subtotal = 0;
@endphp
<tbody class="in-table-body-container">
@foreach ($sale->details as $detail)
@php
$price = $detail->price ?? 0;
$discount = $detail->discount ?? 0;
$qty = $detail->quantities ?? 0;
$productTotal = ($price - $discount) * $qty;
$subtotal += $productTotal;
$info = $detail->warranty_guarantee_info ?? [];
$vat_percent = $detail->product->vat->rate ?? 0;
$vat_value = ($price * $qty) * ($vat_percent / 100);
@endphp
<tr class="in-table-body">
<td class="text-center">{{ $loop->iteration }}</td>
<td class="text-start">
<div class="invoice-item">
{{ ($detail->product->productName ?? '') . (!empty($detail->stock->batch_no) ? ' (' . $detail->stock->batch_no . ')' : '') }}
</div>
</td>
<td class="text-center">{{ $detail->quantities ?? '' }}</td>
@if ($hasWarranty)
<td class="text-center">
@if (!empty($info['warranty_duration']))
{{ $info['warranty_duration'] }} {{ ucfirst($info['warranty_unit'] ?? '') }}
@endif
</td>
@endif
@if ($hasGuarantee)
<td class="text-center">
@if (!empty($info['guarantee_duration']))
{{ $info['guarantee_duration'] }} {{ ucfirst($info['guarantee_unit'] ?? '') }}
@endif
</td>
@endif
<td class= "text-end">{{ currency_format($detail->price ?? 0, currency: business_currency()) }}</td>
<td class= "text-end">{{ currency_format($discount, currency: business_currency()) }}</td>
<td class="text-end">{{ $vat_percent }}%</td>
<td class="text-end">{{ currency_format($vat_value, currency: business_currency()) }}</td>
<td class="text-end">{{ currency_format($productTotal, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="d-flex align-items-center justify-content-between position-relative">
<div>
<table class="table">
<tbody>
<tr class="in-table-row">
<td class="text-start"></td>
</tr>
<tr class="in-table-row">
<td class="text-start"></td>
</tr>
</tbody>
</table>
</div>
<div>
<table class="table">
<tbody>
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Subtotal') }}</td>
<td class="text-end">:</td>
<td class="text-end">{{ currency_format($subtotal, currency: business_currency()) }}
</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end">{{ get_business_option('business-settings')['vat_name'] ?? 'Vat' }}</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format($sale->vat_amount, currency: business_currency()) }}</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Shipping Charge') }}</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format($sale->shipping_charge, currency: business_currency()) }}
</td>
</tr>
<tr class="in-table-row-bottom border-bottom-dis">
<td class="text-end">{{ __('Discount') }}
@if ($sale->discount_type == 'percent')
({{ $sale->discount_percent }}%)
@endif
</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format($sale->discountAmount + $total_discount, currency: business_currency()) }}
</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Total Amount') }}</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format($subtotal + $sale->vat_amount - ($sale->discountAmount + $total_discount) + $sale->shipping_charge + $sale->rounding_amount, currency: business_currency()) }}
</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Rounding(+/-)') }}</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format(abs($sale->rounding_amount), currency: business_currency()) }}
</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end total-amound white-text ">{{ __('Total Payable') }}</td>
<td class="text-end total-amound white-text ">:</td>
<td class="text-end total-amound white-text ">
{{ currency_format($subtotal + $sale->vat_amount - ($sale->discountAmount + $total_discount) + $sale->shipping_charge, currency: business_currency()) }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
{{-- Return portion--}}
<div class="custom-invoice-table">
<table class="table table-striped mb-1">
<thead>
<tr class="in-table-header">
<th class="head-red text-center white-text">{{ __('SL') }}</th>
<th class="head-red text-start white-text">{{ __('Date') }}</th>
<th class="head-black text-start white-text">{{ __('Returned Item') }}</th>
<th class="head-black text-center white-text">{{ __('Quantity') }}</th>
<th class="head-black text-end white-text">{{ __('Total Amount') }}</th>
</tr>
</thead>
@php
$total_return_amount = 0;
$row_counter = 0;
@endphp
<tbody class="in-table-body-container">
@foreach ($sale_returns as $key => $return)
@foreach ($return->details as $detail)
@php
$total_return_amount += $detail->return_amount ?? 0;
$row_counter ++;
@endphp
<tr class="in-table-body">
<td class="text-center">{{ $row_counter }}</td>
<td class="text-start">{{ formatted_date($return->return_date) }}</td>
<td class="text-start">
<div class="invoice-item">
{{ $detail->saleDetail->product->productName ?? '' }}
{{ $detail->saleDetail?->stock?->batch_no ? '(' . $detail->saleDetail?->stock?->batch_no . ')' : '' }}
</div>
</td>
<td class="text-center">{{ $detail->return_qty ?? 0 }}</td>
<td class="text-end">
{{ currency_format($detail->return_amount ?? 0, currency: business_currency()) }}
</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
</div>
<div class="d-flex align-items-start justify-content-between position-relative bottom-info-container mt-3">
<h2 class="word-amount">{{ amountInWords($total_return_amount) }}</h2>
<div>
<table class="table">
<tbody>
<tr class="in-table-row">
<td class="text-start paid-by pb-2 pt-3">{{ __('Paid by') }} :
{{ $returnTransactionType ?? $sale->paymentType ?? '' }}
</td>
</tr>
<tr class="in-table-row">
<td class="text-start paid-by">
@if ((get_business_option('business-settings')['show_note'] ?? 0 == 1))
{{ get_business_option('business-settings')['note_label'] ?? '' }} :
@endif
@if ((get_business_option('business-settings')['show_note'] ?? 0 == 1))
{{ get_business_option('business-settings')['note'] ?? '' }}
@endif
</td>
</tr>
</tbody>
</table>
@if ($bank_detail->show_in_invoice ?? 0 == 1)
<div class="bank-details-container">
<div class="bank-details-title">
Bank Details
</div>
<div class="back-details-content">
<table class="table mb-2">
<tbody>
<tr class="in-table-row">
<td class="text-start in-table-title">{{ __('Name') }} :</td>
<td class="clone-width">:</td>
<td class="text-start">{{ $bank_detail->name }}</td>
</tr>
<tr class="in-table-row">
<td class="text-start in-table-title">{{ __('Account No') }} :</td>
<td class="clone-width">:</td>
<td class="text-start">{{ $bank_detail->meta['account_number'] ?? '' }}</td>
</tr>
<tr class="in-table-row">
<td class="text-start in-table-title">{{ __('UPI ID') }}</td>
<td class="clone-width">:</td>
<td class="text-start">{{ $bank_detail->meta['upi_id'] ?? '' }}</td>
</tr>
<tr class="in-table-row">
<td class="text-start in-table-title">{{ __('Holders Name') }}</td>
<td class="clone-width">:</td>
<td class="text-start">{{ $bank_detail->meta['account_holder'] ?? '' }}</td>
</tr>
</tbody>
</table>
</div>
</div>
@endif
</div>
<div>
<table class="table">
<tbody>
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Total Return Amount') }}</td>
<td class="text-end">:</td>
<td class="text-end">{{ currency_format($total_return_amount, currency: business_currency()) }}</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end total-amound white-text">{{ __('Payable Amount') }}</td>
<td class="text-end total-amound white-text">:</td>
<td class="text-end total-amound white-text">{{ currency_format($sale->totalAmount, currency: business_currency()) }}</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Paid Amount') }}</td>
<td class="text-end">:</td>
<td class="text-end">{{ currency_format($sale->paidAmount, currency: business_currency()) }}</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Due') }}</td>
<td class="text-end">:</td>
<td class="text-end">{{ currency_format($sale->dueAmount, currency: business_currency()) }}</td>
</tr>
</tbody>
</table>
</div>
</div>
@else
{{-- Sales --}}
<div class="custom-invoice-table">
<table class="table table-striped mb-1">
<thead>
<tr class="in-table-header">
<th class="head-red text-center white-text">{{ __('SL') }}</th>
<th class="head-red text-start white-text invoice-item">{{ __('Item') }}</th>
<th class="head-black text-center white-text">{{ __('Quantity') }}</th>
@if ($hasWarranty)
<th class="head-black text-center white-text">{{ __('Warranty') }}</th>
@endif
@if ($hasGuarantee)
<th class="head-black text-center white-text">{{ __('Guarantee') }}</th>
@endif
<th class="head-black text-end white-text">{{ __('Unit Price') }}</th>
<th class="head-black text-end white-text">{{ __('Discount') }}</th>
<th class="head-black text-end white-text">{{ __('Vat %') }}</th>
<th class="head-black text-end white-text">{{ __('Vat Value') }}</th>
<th class="head-black text-end white-text">{{ __('Total Price') }}</th>
</tr>
</thead>
@php
$subtotal = 0;
@endphp
<tbody class="in-table-body-container">
@foreach ($sale->details as $detail)
@php
$price = $detail->price ?? 0;
$discount = $detail->discount ?? 0;
$qty = $detail->quantities ?? 0;
$productTotal = ($price - $discount) * $qty;
$subtotal += $productTotal;
$info = $detail->warranty_guarantee_info ?? [];
$vat_percent = $detail->product->vat->rate ?? 0;
$vat_value = ($price * $qty) * ($vat_percent / 100);
@endphp
<tr class="in-table-body">
<td class="text-center">{{ $loop->iteration }}</td>
<td class="text-start">
<div class="invoice-item">
{{ ($detail->product->productName ?? '') . (!empty($detail->stock?->batch_no) ? ' (' . $detail->stock?->batch_no . ')' : '') }}
</div>
</td>
<td class="text-center">{{ $detail->quantities ?? '' }}</td>
@if ($hasWarranty)
<td class="text-center">
@if (!empty($info['warranty_duration']))
{{ $info['warranty_duration'] }} {{ ucfirst($info['warranty_unit'] ?? '') }}
@endif
</td>
@endif
@if ($hasGuarantee)
<td class="text-center">
@if (!empty($info['guarantee_duration']))
{{ $info['guarantee_duration'] }} {{ ucfirst($info['guarantee_unit'] ?? '') }}
@endif
</td>
@endif
<td class="text-end">{{ currency_format($detail->price ?? 0, currency: business_currency()) }}</td>
<td class="text-end">{{ currency_format($discount, currency: business_currency()) }}</td>
<td class="text-end">{{ $vat_percent }}%</td>
<td class="text-end">{{ currency_format($vat_value, currency: business_currency()) }}</td>
<td class="text-end">{{ currency_format($productTotal, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="d-flex align-items-start justify-content-between position-relative bottom-info-container mt-3">
<h2 class="word-amount">{{ amountInWords($subtotal) }}</h2>
<div>
<table class="table">
<tbody>
<tr class="in-table-row">
<td class="text-start paid-by pb-2 pt-3">{{ __('Paid by') }} :
{{ $transactionTypes ?? ($sale->payment_type_id ? ($sale->payment_type->name ?? '') : ($sale->paymentType ?? '')) }}
</td>
</tr>
<tr class="in-table-row">
<td class="text-start paid-by">
@if ((get_business_option('business-settings')['show_note'] ?? 0 == 1))
{{ get_business_option('business-settings')['note_label'] ?? '' }} :
@endif
@if ((get_business_option('business-settings')['show_note'] ?? 0 == 1))
{{ get_business_option('business-settings')['note'] ?? '' }}
@endif
</td>
</tr>
</tbody>
</table>
@if ($bank_detail->show_in_invoice ?? 0 == 1)
<div class="bank-details-container">
<div class="bank-details-title">
{{__('Bank Details')}}
</div>
<div class="back-details-content">
<table class="table mb-2">
<tbody>
<tr class="in-table-row">
<td class="text-start in-table-title">{{ __('Name') }}</td>
<td class="clone-width">:</td>
<td class="text-start">{{ $bank_detail->name }}</td>
</tr>
<tr class="in-table-row">
<td class="text-start in-table-title">{{ __('Account No') }}</td>
<td class="clone-width">:</td>
<td class="text-start">{{ $bank_detail->meta['account_number'] ?? '' }}</td>
</tr>
<tr class="in-table-row">
<td class="text-start in-table-title">{{ __('UPI ID') }}</td>
<td class="clone-width">:</td>
<td class="text-start">{{ $bank_detail->meta['upi_id'] ?? '' }}</td>
</tr>
<tr class="in-table-row">
<td class="text-start in-table-title">{{ __('Holders Name') }}</td>
<td class="clone-width">:</td>
<td class="text-start">{{ $bank_detail->meta['account_holder'] ?? '' }}</td>
</tr>
</tbody>
</table>
</div>
</div>
@endif
</div>
<div>
<table class="table">
<tbody>
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Subtotal') }}</td>
<td class="text-end">:</td>
<td class="text-end">{{ currency_format($subtotal, currency: business_currency()) }}
</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end">{{ get_business_option('business-settings')['vat_name'] ?? 'Vat' }}</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format($sale->vat_amount, currency: business_currency()) }}
</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Shipping Charge') }}</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format($sale->shipping_charge, currency: business_currency()) }}
</td>
</tr>
<tr class="in-table-row-bottom border-bottom-dis">
<td class="text-end ">{{ __('Discount') }}
@if ($sale->discount_type == 'percent')
({{ $sale->discount_percent }}%)
@endif
</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format($sale->discountAmount, currency: business_currency()) }}
</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Total Amount') }}</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format($sale->actual_total_amount, currency: business_currency()) }}
</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Rounding(+/-)')}}</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format(abs($sale->rounding_amount), currency: business_currency()) }}
</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end total-amound white-text">{{ __('Payable Amount') }}</td>
<td class="text-end total-amound white-text">:</td>
<td class="text-end total-amound white-text">
{{ currency_format($sale->totalAmount, currency: business_currency()) }}
</td>
</tr>
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Receive Amount') }}</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format($sale->paidAmount + $sale->change_amount, currency: business_currency()) }}
</td>
</tr>
@if($sale->change_amount > 0)
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Change Amount') }}</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format($sale->change_amount, currency: business_currency()) }}
</td>
</tr>
@else
<tr class="in-table-row-bottom">
<td class="text-end">{{ __('Due') }}</td>
<td class="text-end">:</td>
<td class="text-end">
{{ currency_format($sale->dueAmount, currency: business_currency()) }}
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@endif
<div class="pdf-footer">
<div class="in-signature-container d-flex align-items-center justify-content-between my-3 px-2">
<div class="in-signature">
<hr class="in-hr">
<h4>{{ __('Customer Signature') }}</h4>
</div>
<div class="in-signature">
<hr class="in-hr">
<h4>{{ __('Authorized Signature') }}</h4>
</div>
</div>
</div>
@if ((get_business_option('business-settings')['show_warranty'] ?? 0) == 1)
<div class="warranty-container-2">
<p>
@if ((get_business_option('business-settings')['show_warranty'] ?? 0) == 1)
<span>{{ get_business_option('business-settings')['warranty_void_label'] ?? '' }} - </span>
@endif
{{ get_business_option('business-settings')['warranty_void'] ?? '' }}
</p>
</div>
@endif
</div>
</div>

View File

@@ -0,0 +1,606 @@
@extends('layouts.business.pdf.pdf_layout')
@section('pdf_title')
<style>
body {
font-family: sans-serif;
font-size: 12px;
color: #000;
}
.invoice-container {
width: 100%;
padding: 10px;
}
.border-none {
border: 1px solid transparent
}
.top-table {
width: 100%;
border-collapse: collapse;
}
.logo-cell img {
height: 45px;
}
.company-name {
font-size: 20px;
font-weight: bold;
}
.right-info {
text-align: right;
font-size: 12px;
line-height: 1.6;
}
.invoice-badge {
margin: 10px auto 15px auto;
text-align: center;
}
.invoice-badge span {
display: inline-block;
padding: 6px 25px;
background: #c5161d;
color: #fff;
border-radius: 20px;
font-weight: bold;
letter-spacing: 1px;
}
.info-table {
width: 100%;
margin-bottom: 10px;
}
.info-table td {
vertical-align: top;
padding: 2px 4px;
}
.item-table {
width: 100%;
border-collapse: collapse;
margin-top: 10px;
}
.item-table th,
.item-table td {
border: 1px solid #000;
padding: 6px;
font-size: 12px;
}
.item-table th {
background: #f5f5f5;
font-weight: bold;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
.summary-table {
width: 100%;
margin-top: 10px;
}
.summary-table td {
padding: 4px;
font-size: 12px;
}
.summary-right {
width: 40%;
float: right;
}
.return-title {
margin-top: 15px;
font-weight: bold;
}
.footer-table {
width: 100%;
margin-top: 25px;
}
.signature {
width: 40%;
text-align: end;
}
.signature-2 {
text-align: right
}
.signature hr {
margin-bottom: 3px;
}
.warranty-box {
border: 1px solid #000;
padding: 6px;
margin-top: 15px;
font-size: 11px;
}
</style>
@endsection
@section('pdf_title')
<div style="text-align:center; margin-bottom: 10px;">
@include('business::print.header')
<h4 class="mt-2" style="text-align:center;">{{ __('Sales Invoice') }}</h4>
<div class="invoice-badge">
<span>{{ __('Invoice') }}</span>
</div>
</div>
@push('css')
@include('business::pdf.fonts-css')
<style>
body {
font-family: sans-serif;
font-size: 12px;
}
.header-table {
width: 100%;
margin-bottom: 10px;
}
.header-table td {
vertical-align: top;
padding: 2px 5px;
}
.invoice-table,
.return-table,
.summary-table {
width: 100%;
border-collapse: collapse;
margin-bottom: 10px;
}
.invoice-table th,
.invoice-table td,
.return-table th,
.return-table td,
.summary-table td {
border: 1px solid #000;
padding: 4px;
}
.invoice-table th,
.return-table th {
background-color: #f2f2f2;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.signature {
width: 45%;
display: inline-block;
text-align: center;
margin-top: 30px;
}
.signature hr {
margin: 30px 0 5px;
border: none;
border-top: 1px solid #000;
}
.warranty {
border: 1px solid #000;
padding: 5px;
font-size: 11px;
margin-top: 10px;
}
</style>
@endpush
@endsection
@section('pdf_content')
@php
$subtotal = 0;
foreach ($sale->details as $detail) {
$subtotal += ($detail->price - $detail->discount) * $detail->quantities;
}
$total_return_amount = 0;
foreach ($sale_returns as $return) {
foreach ($return->details as $detail) {
$total_return_amount += $detail->return_amount;
}
}
@endphp
<div class="invoice-container">
{{-- Header --}}
<table class="header-table">
<tr>
<td style="width:60%;">
@php
$defaultLogo = public_path('assets/images/default.svg');
$customLogo = public_path(
get_business_option('business-settings')['a4_invoice_logo'] ?? 'assets/images/default.svg',
);
$logoPath = file_exists($customLogo) ? $customLogo : $defaultLogo;
$logoData = base64_encode(file_get_contents($logoPath));
$logoType = pathinfo($logoPath, PATHINFO_EXTENSION);
$src = 'data:image/' . $logoType . ';base64,' . $logoData;
@endphp
@if ((get_business_option('business-settings')['show_a4_invoice_logo'] ?? 0) == 1)
<img style="
width: auto;
height: 54px;
display: block;" src="{{ $src }}">
@endif
</td>
<td style="width:40%; text-align:right;">
@if (($sale->business->meta['show_address'] ?? 0) == 1)
<div>{{ __('Address') }} : {{ $sale->branch?->address ?? ($sale->business?->address ?? '') }}</div>
@endif
@if (($sale->business->meta['show_phone_number'] ?? 0) == 1)
<div>{{ __('Mobile') }} : {{ $sale->branch?->phone ?? ($sale->business?->phoneNumber ?? '') }}</div>
@endif
@if (($sale->business->meta['show_email'] ?? 0) == 1)
<div>{{ __('Email') }} : {{ $sale->branch?->email ?? ($sale->business?->email ?? '') }}</div>
@endif
<div>
@if (($sale->business->meta['show_vat'] ?? 0) == 1)
{{ $sale->business->vat_name }}
@endif
{{ ($sale->business->meta['show_vat'] ?? 0) == 1 && ($sale->business->meta['show_vat'] ?? 0) == 1 ? ':' : '' }}
@if (($sale->business->meta['show_vat'] ?? 0) == 1)
{{ $sale->business->vat_no ?? '' }}
@endif
</div>
</td>
</tr>
</table>
{{-- INVOICE BADGE --}}
<h3
style="
font-size: 20px;
font-weight: 600;
color: white;
background-color: #c52127;
padding: 5px 12px;
border-radius: 30px;
margin: 0;
width: 100px;
display: flex;
align-items: center;
justify-content: center;
margin: auto;
border: 1px solid black;
text-align: center;">
{{ __('INVOICE') }}
</h3>
{{-- Customer & Invoice Info --}}
<table class="header-table">
<tr>
<td style="width:50%; text-align:{{ app()->getLocale() == 'ar' ? 'left' : 'left' }};">
<div>{{ __('Customer') }} : {{ $sale->party->name ?? __('Guest') }}</div>
<div>{{ __('Address') }} : {{ $sale->party->address ?? '' }}</div>
<div>{{ __('Phone') }} : {{ $sale->party->phone ?? __('Guest') }}</div>
<div>{{ __('Remarks') }} : {{ $sale->meta['note'] ?? 'N/A' }}</div>
</td>
<td style="width:50%; text-align:{{ app()->getLocale() == 'ar' ? 'right' : 'right' }};">
<div>{{ __('Invoice No') }} : {{ $sale->invoiceNumber ?? '' }}</div>
<div>{{ __('Date') }} : {{ formatted_date($sale->saleDate ?? '') }}</div>
<div>{{ __('Time') }} : {{ formatted_time($sale->saleDate ?? '') }}</div>
<div>{{ __('Sales By') }} :
{{ $sale->user->role != 'staff' ? __('Admin') : $sale->user->name }}
</div>
</td>
</tr>
</table>
{{-- Sale Items --}}
<table class="invoice-table">
<thead>
<tr>
<th>{{ __('SL') }}</th>
<th>{{ __('Item') }}</th>
<th>{{ __('Quantity') }}</th>
@if ($hasWarranty)
<th>{{ __('Warranty') }}</th>
@endif
@if ($hasGuarantee)
<th>{{ __('Guarantee') }}</th>
@endif
<th>{{ __('Unit Price') }}</th>
<th>{{ __('Discount') }}</th>
<th>{{ __('Total Price') }}</th>
</tr>
</thead>
<tbody>
@foreach ($sale->details as $detail)
@php
$price = $detail->price ?? 0;
$discount = $detail->discount ?? 0;
$qty = $detail->quantities ?? 0;
$productTotal = ($price - $discount) * $qty;
$info = $detail->warranty_guarantee_info ?? [];
@endphp
<tr>
<td class="text-center">{{ $loop->iteration }}</td>
<td class="text-center">
{{ $detail->product->productName ?? '' }}
{{ !empty($detail->stock?->batch_no) ? ' (' . $detail->stock->batch_no . ')' : '' }}
</td>
<td class="text-center">{{ $qty }}</td>
@if ($hasWarranty)
<td class="text-center">{{ $info['warranty_duration'] ?? '' }}
{{ $info['warranty_unit'] ?? '' }}</td>
@endif
@if ($hasGuarantee)
<td class="text-center">{{ $info['guarantee_duration'] ?? '' }}
{{ $info['guarantee_unit'] ?? '' }}</td>
@endif
<td class="text-center">{{ currency_format($price, currency: business_currency()) }}</td>
<td class="text-center">{{ currency_format($discount, currency: business_currency()) }}</td>
<td class="text-center">{{ currency_format($productTotal, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
</table>
<table width="100%" style="margin-top:15px;">
<tr>
<!-- LEFT SIDE -->
<td width="60%" valign="top">
<table width="100%">
<tbody>
<tr>
<td>{{ amountInWords($subtotal) }}</td>
</tr>
<tr>
<td style="padding-bottom:8px;">
@if (get_business_option('business-settings')['show_note'] ?? 0 == 1)
{{ get_business_option('business-settings')['note_label'] ?? '' }} :
@endif
@if (get_business_option('business-settings')['show_note'] ?? 0 == 1)
{{ get_business_option('business-settings')['note'] ?? '' }}
@endif
</td>
</tr>
<tr>
<td style="padding-top:5px; font-weight:bold;">
{{ __('Paid by') }} :
{{ $transactionTypes ??
($due_collect->payment_type_id ? $due_collect->payment_type->name ?? '' : $due_collect->paymentType ?? '') }}
</td>
</tr>
</tbody>
</table>
{{-- BANK DETAILS --}}
@if (($bank_detail->show_in_invoice ?? 0) == 1)
<table width="" style="margin-top:10px; border:1px solid #ccc;" cellspacing="0"
cellpadding="5">
<tr>
<td colspan="2" style="font-weight:bold; background:#f5f5f5;">
{{ __('Bank Details') }}
</td>
</tr>
<tr>
<td width="40%">{{ __('Name') }}</td>
<td width="60%">: {{ $bank_detail->name }}</td>
</tr>
<tr>
<td>{{ __('Account No') }}</td>
<td>: {{ $bank_detail->meta['account_number'] ?? '' }}</td>
</tr>
<tr>
<td>{{ __('UPI ID') }}</td>
<td>: {{ $bank_detail->meta['upi_id'] ?? '' }}</td>
</tr>
<tr>
<td>{{ __('Holders Name') }}</td>
<td>: {{ $bank_detail->meta['account_holder'] ?? '' }}</td>
</tr>
</table>
@endif
</td>
<!-- RIGHT SIDE -->
<td width="40%" valign="top" align="right">
<table width="100%">
<tbody>
<tr>
<td align="right">{{ __('Subtotal') }}</td>
<td align="right">:</td>
<td align="right">{{ currency_format($subtotal, currency: business_currency()) }}</td>
</tr>
<tr>
<td align="right">{{ __('Vat') }}</td>
<td align="right">:</td>
<td align="right">{{ currency_format($sale->vat_amount, currency: business_currency()) }}
</td>
</tr>
<tr>
<td align="right">{{ __('Shipping Charge') }} </td>
<td align="right">:</td>
<td align="right">
{{ currency_format($sale->shipping_charge, currency: business_currency()) }}</td>
</tr>
<tr>
<td align="right">{{ __('Discount') }} </td>
<td align="right">:</td>
<td align="right">
{{ currency_format($sale->discountAmount + $total_discount, currency: business_currency()) }}
</td>
</tr>
<tr>
<td align="right">{{ __('Total Amount') }} </td>
<td align="right">:</td>
<td align="right">
{{ currency_format(
$subtotal +
$sale->vat_amount -
($sale->discountAmount + $total_discount) +
$sale->shipping_charge +
$sale->rounding_amount,
currency: business_currency(),
) }}
</td>
</tr>
<tr>
<td align="right">{{ __('Rounding (+/-)') }} </td>
<td align="right">:</td>
<td align="right">
{{ currency_format(abs($sale->rounding_amount), currency: business_currency()) }}</td>
</tr>
<tr>
<td align="right">{{ __('Total Payable') }} </td>
<td align="right">:</td>
<td align="right">{{ currency_format($sale->totalAmount, currency: business_currency()) }}
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
{{-- Sale Returns --}}
@if (!$sale_returns->isEmpty())
<table style="margin-top: 14px" class="return-table">
<thead>
<tr>
<th>{{ __('SL') }}</th>
<th>{{ __('Date') }}</th>
<th>{{ __('Returned Item') }}</th>
<th>{{ __('Quantity') }}</th>
<th>{{ __('Total Amount') }}</th>
</tr>
</thead>
<tbody>
@php
$total_return_amount = 0;
$row_counter = 0;
@endphp
@foreach ($sale_returns as $return)
@foreach ($return->details as $detail)
@php
$total_return_amount += $detail->return_amount ?? 0;
$row_counter++;
@endphp
<tr>
<td class="text-center">{{ $row_counter }}</td>
<td class="text-center">{{ formatted_date($return->return_date) }}</td>
<td class="text-center">
{{ $detail->saleDetail->product->productName ?? '' }}
{{ $detail->saleDetail?->stock?->batch_no ? '(' . $detail->saleDetail?->stock?->batch_no . ')' : '' }}
</td>
<td class="text-center">{{ $detail->return_qty }}</td>
<td class="text-center">
{{ currency_format($detail->return_amount, currency: business_currency()) }}</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
<table width="100%" style="margin-top:15px;">
<tr>
<td>{{ amountInWords($total_return_amount) }}</td>
</tr>
<tr>
<!-- LEFT SIDE -->
<td width="60%" valign="top">
{{ __('Paid by') }} :
{{ $returnTransactionType ?? ($sale->paymentType ?? '') }}
</td>
<!-- RIGHT SIDE -->
<td width="40%" valign="top" align="right">
<table width="100%">
<tbody>
<tr>
<td align="right">{{ __('Total Return Amount') }}</td>
<td align="right">:</td>
<td align="right">
{{ currency_format($total_return_amount, currency: business_currency()) }}</td>
</tr>
<tr>
<td align="right">{{ __('Payable Amount') }}</td>
<td align="right">:</td>
<td align="right">{{ currency_format($sale->totalAmount, currency: business_currency()) }}
</td>
</tr>
<tr>
<td align="right">{{ __('Paid Amount') }} </td>
<td align="right">:</td>
<td align="right">{{ currency_format($sale->paidAmount, currency: business_currency()) }}
</td>
</tr>
<tr>
<td align="right">{{ __('Due') }} </td>
<td align="right">:</td>
<td align="right">{{ currency_format($sale->dueAmount, currency: business_currency()) }}
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
@endif
{{-- Payment Info & Signature --}}
{{-- SIGNATURE --}}
<table class="footer-table">
<tr>
<td class="signature">
<div class="" style="border-top: 1px solid black">
{{ __('Customer Signature') }}
</div>
</td>
<td></td>
<td class="signature-2">
<div style="border-top: 1px solid black;">
{{ __('Authorized Signature') }}
</div>
</td>
</tr>
</table>
{{-- Warranty Box --}}
@if ((get_business_option('business-settings')['show_warranty'] ?? 0) == 1)
<div class="warranty">
@if ((get_business_option('business-settings')['show_warranty'] ?? 0) == 1)
<strong>{{ get_business_option('business-settings')['warranty_void_label'] ?? '' }} - </strong>
@endif
{{ get_business_option('business-settings')['warranty_void'] ?? '' }}
</div>
@endif
</div>
@endsection

View File

@@ -0,0 +1,29 @@
@forelse ($products as $product)
@php
$firstStock = $product->stocks->first();
$purchasePrice = $firstStock->productPurchasePrice ?? 0;
$salePrice = $product->product_type === 'combo' ? ($product->productSalePrice ?? 0) : ($firstStock->productSalePrice ?? 0);
@endphp
<div class="single-product {{ $product->id }}" data-product_id="{{ $product->id }}"
data-product_type="{{ $product->product_type }}" data-default_price="{{ $salePrice }}"
data-product_code="{{ $product->productCode }}" data-product_unit_id="{{ $product->unit->id ?? null }}"
data-product_unit_name="{{ $product->unit->unitName ?? null }}" data-product_image="{{ $product->productPicture }}"
data-product_name="{{ $product->productName }}" data-purchase_price="{{ $purchasePrice }}"
data-batch_count="{{ $product->stocks->count() }}" data-stocks='@json($product->stocks)'
data-route="{{ route('business.carts.store') }}" data-vat_percent="{{ $product->vat->rate ?? 0 }}">
<div class="pro-img w-100">
<img src="{{ asset($product->productPicture ?? 'assets/images/products/box.svg') }}" alt="">
</div>
<div class="product-con">
<h6 class="pro-title product_name">{{ $product->productName }}</h6>
<p class="pro-category">{{ $product->category->name ?? '' }}</p>
<div class="price">
<h6 class="pro-price product_price">{{ currency_format($salePrice, currency: business_currency()) }}</h6>
</div>
</div>
</div>
@empty
<div class="alert alert-danger not-found mt-1" role="alert">
No product found
</div>
@endforelse

View File

@@ -0,0 +1,14 @@
<div class="modal fade" id="stock-list-modal" tabindex="-1" aria-labelledby="cartViewDetailsModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content p-0 cart-modal-content">
<div class="modal-header border-0">
<h5 class="modal-title fw-bold" id="cartViewDetailsModalLabel">View Details</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{{-- Dynamically added via js --}}
</div>
</div>
</div>
</div>