update perbaikan pos, return, dan report profit nlost
All checks were successful
All checks were successful
This commit is contained in:
@@ -20,23 +20,7 @@ class="bulk_cart_upload_form">
|
||||
<div class="bulk-upload-container w-100">
|
||||
<div class="d-flex justify-content-between align-items-center w-100">
|
||||
<div class="bulk-input w-100">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-lg-12">
|
||||
<div class="custom-upload-wrapper">
|
||||
<div class="custom-file-box">
|
||||
<div class="custom-file-content">
|
||||
<svg width="30" height="30" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 5V19M5 12H19" stroke="#4B5563" stroke-width="2.0" stroke-linecap="round"/>
|
||||
</svg>
|
||||
<span class="custom-upload-text">{{ __('Add File') }}</span>
|
||||
</div>
|
||||
|
||||
<p class="preview-file d-none"></p>
|
||||
<input type="file" name="file" class="preview-file-input" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input class="form-control" type="file" name="file" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-center gap-2 flex-wrap">
|
||||
@@ -48,9 +32,9 @@ class="bulk_cart_upload_form">
|
||||
<div class="instruction-header">
|
||||
<h5>{{__('Instructions') }}</h5>
|
||||
<div class="mt-3">
|
||||
<h6><strong>{{__('Note') }}: </strong>{{__('Please follow the instructions below to upload your file.')}}</h6>
|
||||
<h6><strong>{{__('Note') }}: </strong>{{__(' Please follow the instructions below to upload your file.')}}</h6>
|
||||
<ul>
|
||||
<li><b>{{__('1.')}}</b>{{__('Download the sample file first and add all your purchases data to it.')}}</li>
|
||||
<li><b>{{__('1.')}}</b>{{__(' Download the sample file first and add all your purchases data to it.')}}</li>
|
||||
<li><b>{{__('2.')}}</b> <span class="text-danger">*</span> {{__('Indicates a required field. If you do not provide the required fields, the system will ignore except product information.')}}</li>
|
||||
<li><b>{{__('3.')}}</b> {{__('After adding all your purchases, please save the file and then upload the updated version.')}}</li>
|
||||
</ul>
|
||||
|
||||
@@ -19,23 +19,7 @@
|
||||
<div class="bulk-upload-container w-100">
|
||||
<div class="d-flex justify-content-between align-items-center w-100">
|
||||
<div class="bulk-input w-100">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-lg-12">
|
||||
<div class="custom-upload-wrapper">
|
||||
<div class="custom-file-box">
|
||||
<div class="custom-file-content">
|
||||
<svg width="30" height="30" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 5V19M5 12H19" stroke="#4B5563" stroke-width="2.0" stroke-linecap="round"/>
|
||||
</svg>
|
||||
<span class="custom-upload-text">{{ __('Add File') }}</span>
|
||||
</div>
|
||||
|
||||
<p class="preview-file d-none"></p>
|
||||
<input type="file" name="file" class="preview-file-input" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input class="form-control w-100" type="file" name="file" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-center gap-2 flex-wrap">
|
||||
|
||||
@@ -2,14 +2,8 @@
|
||||
@php
|
||||
$modules = product_setting()->modules ?? [];
|
||||
@endphp
|
||||
<tr
|
||||
data-row_id="{{ $cart->rowId }}"
|
||||
data-product_id="{{ $cart->id }}"
|
||||
data-has_serial="{{ $cart->options->has_serial ?? 0 }}"
|
||||
data-serials='@json($cart->options->serial_numbers ?? [])'
|
||||
data-update_route="{{ route('business.carts.update', $cart->rowId) }}"
|
||||
data-destroy_route="{{ route('business.carts.destroy', $cart->rowId) }}">
|
||||
<td class='text-start'>
|
||||
<tr data-row_id="{{ $cart->rowId }}" data-update_route="{{ route('business.carts.update', $cart->rowId) }}" data-destroy_route="{{ route('business.carts.destroy', $cart->rowId) }}">
|
||||
<td class='text-start '>
|
||||
<img class="table-img" src="{{ asset($cart->options->product_image ?? 'assets/images/products/box.svg') }}">
|
||||
</td>
|
||||
<td class='text-start'>{{ $cart->name }}</td>
|
||||
@@ -23,9 +17,9 @@
|
||||
@if (is_module_enabled($modules, 'show_product_expire_date'))
|
||||
<td>
|
||||
@if (isset($modules['expire_date_type']) && ($modules['expire_date_type'] == 'dmy' || is_null($modules['expire_date_type'])))
|
||||
<input type="month" name="expire_date" value="{{ date('Y-m', strtotime($cart->options->expire_date ?? '')) }}" class="form-control expire_date">
|
||||
@else
|
||||
<input type="date" name="expire_date" value="{{ date('Y-m-d', strtotime($cart->options->expire_date ?? '')) }}" class="form-control expire_date">
|
||||
@else
|
||||
<input type="month" name="expire_date" value="{{ date('Y-m', strtotime($cart->options->expire_date ?? '')) }}" class="form-control expire_date">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@@ -34,27 +28,13 @@
|
||||
<input type="number" step="any" value="{{ $cart->price }}" class="custom-number-input price" placeholder="{{ __('0') }}">
|
||||
</td>
|
||||
@endusercan
|
||||
@if (moduleCheck('SerialCodeAddon'))
|
||||
<td class="serial-cell serial-option">
|
||||
<button type="button" class="serial-cell-button" @if(($cart->options->has_serial ?? 0) != 1) disabled @endif data-bs-toggle="modal" data-bs-target="#serialModal">
|
||||
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4 7H18" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round"/>
|
||||
<path d="M23 7H23.0105" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M23 14H23.0105" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M23 21H23.0105" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M4 14H18" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round"/>
|
||||
<path d="M4 21H18" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
</td>
|
||||
@endif
|
||||
<td class='text-start'>
|
||||
<div class="d-flex align-items-center justify-content-center gap-2">
|
||||
<button class="incre-decre minus-btn" @if(($cart->options->has_serial ?? 0) == 1) disabled @endif>
|
||||
<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" @if(($cart->options->has_serial ?? 0) == 1) disabled readonly @endif>
|
||||
<button class="incre-decre plus-btn" @if(($cart->options->has_serial ?? 0) == 1) disabled @endif>
|
||||
<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>
|
||||
|
||||
@@ -97,9 +97,6 @@
|
||||
@usercan('purchases.price')
|
||||
<th class="border table-background">{{ __('Purchase Price') }}</th>
|
||||
@endusercan
|
||||
@if (moduleCheck('SerialCodeAddon'))
|
||||
<th class="border table-background serial-option">{{ __('Serial') }}</th>
|
||||
@endif
|
||||
<th class="border table-background">{{ __('Qty') }}</th>
|
||||
<th class="border table-background">{{ __('Sub Total') }}</th>
|
||||
<th class="border table-background">{{ __('Action') }}</th>
|
||||
@@ -150,23 +147,6 @@
|
||||
<h6 class="fw-bold" id="sub_total">
|
||||
{{ currency_format(0, currency: business_currency()) }}</h6>
|
||||
</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="row save-amount-container align-items-center mb-2">
|
||||
<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">
|
||||
@@ -186,6 +166,23 @@ 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="">
|
||||
@@ -246,7 +243,7 @@ class="btn btn-category w-100">{{ __('Category') }}</a>
|
||||
</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">
|
||||
<div class="search-product-card products gap-2 @if (count($products) === 1) single-product @endif product-list-container" id="products-list">
|
||||
@include('business::purchases.product-list')
|
||||
</div>
|
||||
</div>
|
||||
@@ -255,30 +252,25 @@ class="btn btn-category w-100">{{ __('Category') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('business::purchases.product-modal')
|
||||
|
||||
<input type="hidden" id="get_product" value="{{ route('business.products.prices') }}">
|
||||
<input type="hidden" id="purchase-cart" value="{{ route('business.purchases.cart') }}">
|
||||
<input type="hidden" id="clear-cart" value="{{ route('business.carts.remove-all') }}">
|
||||
<input type="hidden" id="get-product-variants" value="{{ route('business.products.variants') }}">
|
||||
<input type="hidden" id="has-serial-code-addon" value="{{ moduleCheck('SerialCodeAddon') }}">
|
||||
<input type="hidden" id="check-serial-exist" value="{{ route('business.products.check-serial') }}">
|
||||
<input type="hidden" id="profit_option" value="{{ $profit_option }}">
|
||||
|
||||
@endsection
|
||||
|
||||
@push('modal')
|
||||
@if (moduleCheck('SerialCodeAddon'))
|
||||
@include('serialcodeaddon::serial-code-modal')
|
||||
@endif
|
||||
@include('business::purchases.calculator')
|
||||
@include('business::purchases.category-search')
|
||||
@include('business::purchases.brand-search')
|
||||
@include('business::purchases.supplier-create')
|
||||
@include('business::purchases.bulk-upload.index')
|
||||
@include('business::purchases.product-modal')
|
||||
@endpush
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/custom/purchase.js') }}?v={{ time() }}"></script>
|
||||
<script src="{{ asset('assets/js/custom/purchase.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/custom/math.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/custom/calculator.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/choices.min.js') }}"></script>
|
||||
|
||||
@@ -65,57 +65,19 @@
|
||||
<i class="far fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
@usercan('purchases.read')
|
||||
<li>
|
||||
<a target="_blank" href="{{ route('business.purchases.invoice', $purchase->id) }}">
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.66602 12.4331V5.37211C2.66602 3.46944 2.66602 2.5181 3.2518 1.92702C3.83759 1.33594 4.7804 1.33594 6.66602 1.33594H9.33268C11.2183 1.33594 12.1611 1.33594 12.7469 1.92702C13.3327 2.5181 13.3327 3.46944 13.3327 5.37211V12.4331C13.3327 13.4409 13.3327 13.9448 13.0247 14.1431C12.5214 14.4673 11.7434 13.7875 11.3521 13.5408C11.0287 13.3369 10.8671 13.2349 10.6877 13.2291C10.4938 13.2227 10.3293 13.3205 9.97995 13.5408L8.70602 14.3442C8.36235 14.5609 8.19055 14.6693 7.99935 14.6693C7.80815 14.6693 7.63635 14.5609 7.29268 14.3442L6.01877 13.5408C5.69545 13.3369 5.53379 13.2349 5.35437 13.2291C5.1605 13.2227 4.99597 13.3205 4.6466 13.5408C4.25532 13.7875 3.47726 14.4673 2.97398 14.1431C2.66602 13.9448 2.66602 13.4409 2.66602 12.4331Z" stroke="#4B5563" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M10.6673 4H5.33398" stroke="#4B5563" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M6.66732 6.66406H5.33398" stroke="#4B5563" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9.66602 6.58333C9.11375 6.58333 8.66602 6.97507 8.66602 7.45833C8.66602 7.9416 9.11375 8.33333 9.66602 8.33333C10.2183 8.33333 10.666 8.72507 10.666 9.20833C10.666 9.6916 10.2183 10.0833 9.66602 10.0833M9.66602 6.58333C10.1014 6.58333 10.4718 6.8268 10.6091 7.16667M9.66602 6.58333V6M9.66602 10.0833C9.23062 10.0833 8.86022 9.83987 8.72295 9.5M9.66602 10.0833V10.6667" stroke="#4B5563" stroke-width="1.25" stroke-linecap="round"/>
|
||||
</svg>
|
||||
<img src="{{ asset('assets/images/icons/Invoic.svg') }}" alt="">
|
||||
{{ __('Invoice') }}
|
||||
</a>
|
||||
</li>
|
||||
@endusercan
|
||||
|
||||
@usercan('purchases.read')
|
||||
@php
|
||||
$useTaxInvoice = moduleCheck('TaxInvoiceAddon') && invoice_setting($purchase->business_id) == 'standard_a4';
|
||||
@endphp
|
||||
|
||||
@if($useTaxInvoice)
|
||||
<li>
|
||||
<a target="_blank" href="{{ route('business.purchases.tax.invoice', $purchase->id) }}">
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_40008374_151568)">
|
||||
<path d="M15.012 1.5C14.177 1.5 13.5 3.51472 13.5 6H15.012C15.7407 6 16.105 6 16.3306 5.74841C16.5562 5.49682 16.5169 5.1655 16.4384 4.50286C16.2311 2.75357 15.6707 1.5 15.012 1.5Z" stroke="#4D4D4D" stroke-width="1.25"/>
|
||||
<path d="M13.5 6.0407V13.9844C13.5 15.1181 13.5 15.685 13.1535 15.9081C12.5873 16.2728 11.7121 15.5081 11.2718 15.2305C10.9081 15.0011 10.7263 14.8864 10.5244 14.8798C10.3063 14.8726 10.1212 14.9826 9.72817 15.2305L8.295 16.1343C7.90838 16.3781 7.7151 16.5 7.5 16.5C7.28491 16.5 7.09159 16.3781 6.705 16.1343L5.27185 15.2305C4.90811 15.0011 4.72624 14.8864 4.5244 14.8798C4.30629 14.8726 4.1212 14.9826 3.72815 15.2305C3.28796 15.5081 2.41265 16.2728 1.84646 15.9081C1.5 15.685 1.5 15.1181 1.5 13.9844V6.0407C1.5 3.90019 1.5 2.82994 2.15901 2.16497C2.81802 1.5 3.87868 1.5 6 1.5H15" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M7.5 6C6.67157 6 6 6.50368 6 7.125C6 7.7463 6.67157 8.25 7.5 8.25C8.32845 8.25 9 8.7537 9 9.375C9 9.9963 8.32845 10.5 7.5 10.5M7.5 6C8.1531 6 8.7087 6.31305 8.91465 6.75M7.5 6V5.25M7.5 10.5C6.84689 10.5 6.29127 10.1869 6.08535 9.75M7.5 10.5V11.25" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_40008374_151568">
|
||||
<rect width="18" height="18" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
{{ __('Tax Invoice') }}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@endusercan
|
||||
|
||||
@usercan('purchase-returns.read')
|
||||
<li>
|
||||
<a
|
||||
href="{{ route('business.purchase-returns.create', ['purchase_id' => $purchase->id]) }}">
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.25 9.75V6H15.75V9.75C15.75 12.5784 15.75 13.9927 14.8713 14.8713C13.9927 15.75 12.5784 15.75 9.75 15.75H8.25C5.42157 15.75 4.00736 15.75 3.12868 14.8713C2.25 13.9927 2.25 12.5784 2.25 9.75Z" stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M2.25 6L2.89904 4.55769C3.40241 3.4391 3.65408 2.87981 4.16423 2.5649C4.67438 2.25 5.32875 2.25 6.6375 2.25H11.3625C12.6712 2.25 13.3256 2.25 13.8358 2.5649C14.3459 2.87981 14.5976 3.4391 15.1009 4.55769L15.75 6" stroke="#4B5563" stroke-linecap="round"/>
|
||||
<path d="M9 6V2.25" stroke="#4B5563" stroke-linecap="round"/>
|
||||
<path d="M6.375 10.125H10.5C11.3284 10.125 12 10.7966 12 11.625C12 12.4534 11.3284 13.125 10.5 13.125H9.75M7.5 8.625L6 10.125L7.5 11.625" stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
<i class="fal fa-undo-alt"></i>
|
||||
{{ __('Purchase Return') }}
|
||||
</a>
|
||||
</li>
|
||||
@@ -147,13 +109,19 @@
|
||||
data-url="{{ route('business.view-payment', ['type' => 'purchase', 'id' => $purchase->id]) }}"
|
||||
class="view-payment-btn" 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 4H6" stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M11 7H6" stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9 10H6" stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<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>
|
||||
|
||||
{{ __('View Payment') }}
|
||||
</a>
|
||||
</li>
|
||||
@@ -161,10 +129,7 @@ class="view-payment-btn" data-bs-toggle="modal"
|
||||
@usercan('purchases.read')
|
||||
<li>
|
||||
<a href="{{ route('business.purchases.edit', $purchase->id) }}">
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.1606 3.73679L13.2119 2.68547C13.7925 2.10484 14.7339 2.10484 15.3145 2.68547C15.8951 3.2661 15.8951 4.20748 15.3145 4.78811L14.2632 5.83943M12.1606 3.73679L8.23515 7.66222C7.4512 8.4462 7.05919 8.83815 6.79228 9.31582C6.52535 9.7935 6.2568 10.9214 6 12C7.07857 11.7432 8.2065 11.4746 8.68418 11.2077C9.16185 10.9408 9.5538 10.5488 10.3378 9.76485L14.2632 5.83943M12.1606 3.73679L14.2632 5.83943" stroke="#4B5563" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M15.75 9C15.75 12.1819 15.75 13.773 14.7615 14.7615C13.773 15.75 12.1819 15.75 9 15.75C5.81802 15.75 4.22703 15.75 3.23851 14.7615C2.25 13.773 2.25 12.1819 2.25 9C2.25 5.81802 2.25 4.22703 3.23851 3.23851C4.22703 2.25 5.81802 2.25 9 2.25" stroke="#4B5563" stroke-width="1.2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
<i class="fal fa-edit"></i>
|
||||
{{ __('Edit') }}
|
||||
</a>
|
||||
</li>
|
||||
@@ -173,12 +138,7 @@ class="view-payment-btn" data-bs-toggle="modal"
|
||||
<li>
|
||||
<a href="{{ route('business.purchases.destroy', $purchase->id) }}"
|
||||
class="confirm-action" data-method="DELETE">
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.625 4.125L14.1602 11.6438C14.0414 13.5648 13.9821 14.5253 13.5006 15.2159C13.2625 15.5573 12.956 15.8455 12.6005 16.062C11.8816 16.5 10.9192 16.5 8.99452 16.5C7.06734 16.5 6.10372 16.5 5.38429 16.0612C5.0286 15.8443 4.722 15.5556 4.48401 15.2136C4.00266 14.5219 3.94459 13.5601 3.82846 11.6364L3.375 4.125" stroke="#4B5563" stroke-width="1.2" stroke-linecap="round"/>
|
||||
<path d="M6.75 8.79688H11.25" stroke="#4B5563" stroke-width="1.2" stroke-linecap="round"/>
|
||||
<path d="M7.875 11.7422H10.125" stroke="#4B5563" stroke-width="1.2" stroke-linecap="round"/>
|
||||
<path d="M2.25 4.125H15.75M12.0416 4.125L11.5297 3.0688C11.1896 2.3672 11.0195 2.01639 10.7261 1.79761C10.6611 1.74908 10.5922 1.7059 10.5201 1.66852C10.1953 1.5 9.80542 1.5 9.02572 1.5C8.22645 1.5 7.82685 1.5 7.49662 1.67559C7.42343 1.71451 7.35359 1.75943 7.28783 1.80988C6.99109 2.03753 6.82533 2.40116 6.49381 3.12844L6.03955 4.125" stroke="#4B5563" stroke-width="1.2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
<i class="fal fa-trash-alt"></i>
|
||||
{{ __('Delete') }}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -98,9 +98,6 @@ class='dashboard-btn d-flex align-items-center gap-1'>
|
||||
@usercan('purchases.price')
|
||||
<th class="border table-background">{{ __('Purchase Price') }}</th>
|
||||
@endusercan
|
||||
@if (moduleCheck('SerialCodeAddon'))
|
||||
<th class="border table-background serial-option">{{ __('Serial') }}</th>
|
||||
@endif
|
||||
<th class="border table-background">{{ __('Qty') }}</th>
|
||||
<th class="border table-background">{{ __('Sub Total') }}</th>
|
||||
<th class="border table-background">{{ __('Action') }}</th>
|
||||
@@ -153,23 +150,6 @@ class="form-control receive_amount"
|
||||
<h6>{{ __('Sub Total') }}</h6>
|
||||
<h6 class="fw-bold" id="sub_total">{{ currency_format(0) }}</h6>
|
||||
</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($purchase->discount_type == 'flat')>{{ __('Flat') }}
|
||||
({{ business_currency()->symbol }})
|
||||
</option>
|
||||
<option value="percent" @selected($purchase->discount_type == 'percent')>{{ __('Percent (%)') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="number" step="any" name="discountAmount"
|
||||
value="{{ $purchase->discount_type == 'percent' ? $purchase->discount_percent : $purchase->discountAmount }}"
|
||||
id="discount_amount" min="0" class="form-control right-start-input" placeholder="{{ __('0') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row save-amount-container align-items-center mb-2">
|
||||
<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">
|
||||
@@ -189,6 +169,23 @@ class="form-control receive_amount"
|
||||
</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($purchase->discount_type == 'flat')>{{ __('Flat') }}
|
||||
({{ business_currency()->symbol }})
|
||||
</option>
|
||||
<option value="percent" @selected($purchase->discount_type == 'percent')>{{ __('Percent (%)') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="number" step="any" name="discountAmount"
|
||||
value="{{ $purchase->discount_type == 'percent' ? $purchase->discount_percent : $purchase->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="">{{ __('Shipping Charge') }}</h6>
|
||||
<div class="">
|
||||
@@ -256,30 +253,22 @@ class="btn btn-category w-100">{{ __('Category') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('business::purchases.product-modal')
|
||||
|
||||
<input type="hidden" id="get_product" value="{{ route('business.products.prices') }}">
|
||||
<input type="hidden" value="{{ route('business.purchases.cart') }}" id="purchase-cart">
|
||||
<input type="hidden" value="{{ route('business.carts.remove-all') }}" id="clear-cart">
|
||||
<input type="hidden" id="get-product-variants" value="{{ route('business.products.variants') }}">
|
||||
<input type="hidden" id="has-serial-code-addon" value="{{ moduleCheck('SerialCodeAddon') }}">
|
||||
<input type="hidden" id="check-serial-exist" value="{{ route('business.products.check-serial') }}">
|
||||
<input type="hidden" id="profit_option" value="{{ $profit_option }}">
|
||||
|
||||
@endsection
|
||||
|
||||
@push('modal')
|
||||
@if (moduleCheck('SerialCodeAddon'))
|
||||
@include('serialcodeaddon::serial-code-modal')
|
||||
@endif
|
||||
@include('business::purchases.calculator')
|
||||
@include('business::purchases.category-search')
|
||||
@include('business::purchases.brand-search')
|
||||
@include('business::purchases.product-modal')
|
||||
@include('business::purchases.supplier-create')
|
||||
@include('business::purchases.bulk-upload.index')
|
||||
@endpush
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/custom/purchase.js') }}?v={{ time() }}"></script>
|
||||
<script src="{{ asset('assets/js/custom/purchase.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/custom/math.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/custom/calculator.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/choices.min.js') }}"></script>
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
{{ __('Purchase List') }}
|
||||
@endsection
|
||||
|
||||
@php
|
||||
$modules = product_setting()->modules ?? [];
|
||||
@endphp
|
||||
|
||||
@section('main_content')
|
||||
<div class="erp-table-section">
|
||||
<div class="container-fluid">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
@section('main_content')
|
||||
|
||||
@if (invoice_setting($purchase->business_id) == '3_inch_80mm' && moduleCheck('ThermalPrinterAddon'))
|
||||
@if (invoice_setting() == '3_inch_80mm' && moduleCheck('ThermalPrinterAddon'))
|
||||
@include('thermalprinteraddon::purchases.3_inch_80mm')
|
||||
@else
|
||||
@include('business::purchases.invoices.a4-size')
|
||||
|
||||
@@ -1,46 +1,33 @@
|
||||
@php
|
||||
$isBusinessRoute = request()->routeIs('business.purchases.*');
|
||||
$business_id = $purchase->business_id;
|
||||
$vat_amount = $purchase->vat_amount;
|
||||
@endphp
|
||||
<div class="invoice-container">
|
||||
<div class="invoice-content p-4 position-relative">
|
||||
<div class="row d-print-none py-2 d-flex align-items-start justify-content-between border-bottom print-container">
|
||||
|
||||
<div class="col-md-3 d-flex align-items-center p-2">
|
||||
<div class="col-md-6 d-flex align-items-center p-2">
|
||||
<span class="Money-Receipt">{{ __('Purchase Invoice') }}</span>
|
||||
</div>
|
||||
|
||||
@if($isBusinessRoute)
|
||||
<div class="col-md-9 d-flex justify-content-start justify-content-md-end align-items-end">
|
||||
<div class="d-flex gap-2 flex-wrap ">
|
||||
<a href="javascript:void(0)" class="pdf-btn print-btn share-btn" data-bs-toggle="modal" data-bs-target="#shareModalDues">
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7.8303 3.75H6.96224C4.50701 3.75 3.27939 3.75 2.51665 4.48223C1.75391 5.21447 1.75391 6.39298 1.75391 8.75V12.0833C1.75391 14.4403 1.75391 15.6188 2.51665 16.3511C3.27939 17.0833 4.50701 17.0833 6.96224 17.0833H10.4678C12.923 17.0833 14.1506 17.0833 14.9133 16.3511C15.4075 15.8767 15.5815 15.2149 15.6428 14.1667" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M13.4723 5.83073V3.20869C13.4723 3.04597 13.6097 2.91406 13.7792 2.91406C13.8605 2.91406 13.9386 2.9451 13.9962 3.00035L17.9396 6.7861C18.1362 6.97475 18.2465 7.23061 18.2465 7.4974C18.2465 7.76418 18.1362 8.02005 17.9396 8.20869L13.9962 11.9944C13.9386 12.0497 13.8605 12.0807 13.7792 12.0807C13.6097 12.0807 13.4723 11.9488 13.4723 11.7861V9.16406H10.9298C7.39583 9.16406 6.09375 12.0807 6.09375 12.0807V9.9974C6.09375 7.69621 8.03696 5.83073 10.434 5.83073H13.4723Z" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
|
||||
{{__('Share')}}
|
||||
</a>
|
||||
|
||||
<form action="{{ route('business.purchases.mail', ['purchase_id' => $purchase->id]) }}" method="POST" class="ajaxform_instant_reload">
|
||||
<div class="col-md-6 d-flex justify-content-end align-items-end">
|
||||
<div class="d-flex gap-2 ">
|
||||
<form action="{{ route('business.purchases.mail', ['purchase_id' => $purchase->id]) }}" method="POST"
|
||||
class="ajaxform_instant_reload">
|
||||
@csrf
|
||||
<button type="submit" class="btn custom-print-btn submit-btn"><img class="w-10 h-10" src="{{ asset('assets/img/email.svg') }}"><span class="pl-1">{{__('Email')}}</span> </button>
|
||||
<button type="submit" class="btn custom-print-btn"><img class="w-10 h-10"
|
||||
src="{{ asset('assets/img/email.svg') }}"><span class="pl-1">{{__('Email')}}</span> </button>
|
||||
</form>
|
||||
<a target="_blank" href="{{ route('business.purchases.pdf', ['purchase_id' => $purchase->id]) }}" class="pdf-btn print-btn">
|
||||
<a target="blank" href="{{ route('business.purchases.pdf', ['purchase_id' => $purchase->id]) }}"
|
||||
class="pdf-btn print-btn">
|
||||
<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>
|
||||
{{__('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>
|
||||
@endif
|
||||
</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">
|
||||
@if ((get_business_option('business-settings', $business_id)['show_a4_invoice_logo'] ?? 0) == 1 )
|
||||
<img class="invoice-logo" src="{{ Storage::url(get_business_option('business-settings', $business_id)['a4_invoice_logo'] ?? 'assets/images/default.svg') ?? '' }}">
|
||||
@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'] ?? 'assets/images/default.svg') ?? '' }}">
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@@ -109,9 +96,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- PURCHASE + RETURN --}}
|
||||
@if (!$purchase_returns->isEmpty())
|
||||
{{-- purchases portion --}}
|
||||
{{-- purchases --}}
|
||||
<div class="custom-invoice-table">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
@@ -121,48 +107,34 @@
|
||||
<th class="head-black text-center">{{ __('Quantity') }}</th>
|
||||
@usercan('purchases.price')
|
||||
<th class="head-black text-end">{{ __('Unit Price') }}</th>
|
||||
<th class="head-black text-end">{{ __('Price (exc.)') }}</th>
|
||||
@endusercan
|
||||
<th class="head-black text-end">{{ __('Total Price') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@php
|
||||
$subtotal = 0;
|
||||
$total_product_vat = 0;
|
||||
@endphp
|
||||
<tbody class="in-table-body-container">
|
||||
@foreach ($purchase->details as $detail)
|
||||
@php
|
||||
$productTotal = ($detail->productPurchasePrice ?? 0) * ($detail->quantities ?? 0);
|
||||
$exclusive_price = ($detail->price_without_tax && $detail->price_without_tax > 0) ? $detail->price_without_tax : ($detail->productPurchasePrice ?? 0);
|
||||
$qty = $detail->quantities ?? 0;
|
||||
|
||||
$product_vat = $productTotal - ($exclusive_price * $qty ?? 1);
|
||||
$total_product_vat += $product_vat;
|
||||
$subtotal += $exclusive_price * ($qty ?? 1);
|
||||
$subtotal += $productTotal;
|
||||
@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 . ')' : '') }}
|
||||
@if(moduleCheck('SerialCodeAddon') && ($detail->product->has_serial ?? 0) == 1)
|
||||
<p>{{__('Serial')}}:{{ is_array($detail->serial_numbers) ? implode(', ', $detail->serial_numbers) : $detail->serial_numbers }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">{{ $detail->quantities ?? '' }}</td>
|
||||
@usercan('purchases.price')
|
||||
<td class="text-end">
|
||||
{{ currency_format($detail->productPurchasePrice ?? 0, currency: business_currency($business_id)) }}
|
||||
</td>
|
||||
<td class="text-end">
|
||||
{{ currency_format($exclusive_price ?? 0, currency: business_currency($business_id)) }}
|
||||
{{ currency_format($detail->productPurchasePrice ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
@endusercan
|
||||
<td class="text-end">
|
||||
{{ currency_format($productTotal, currency: business_currency($business_id)) }}</td>
|
||||
{{ currency_format($productTotal, currency: business_currency()) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@@ -187,21 +159,20 @@
|
||||
<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($business_id)) }}
|
||||
<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', $business_id)['vat_name'] ?? 'Vat' }}</td>
|
||||
<td class="text-end">: </td>
|
||||
<td class="text-end">{{ get_business_option('business-settings')['vat_name'] ?? 'Vat' }}</td>
|
||||
<td class="text-end">:</td>
|
||||
<td class="text-end">
|
||||
{{ currency_format($vat_amount + $total_product_vat, currency: business_currency($business_id)) }}
|
||||
</td>
|
||||
{{ currency_format($purchase->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($purchase->shipping_charge, currency: business_currency($business_id)) }}
|
||||
{{ currency_format($purchase->shipping_charge, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="in-table-row-bottom border-bottom-dis">
|
||||
@@ -212,14 +183,14 @@
|
||||
</td>
|
||||
<td class="text-end">:</td>
|
||||
<td class="text-end">
|
||||
{{ currency_format($purchase->discountAmount + $total_discount, currency: business_currency($business_id)) }}
|
||||
{{ currency_format($purchase->discountAmount + $total_discount, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="in-table-row-bottom">
|
||||
<td class="text-end total-amound">{{ __('Total Amount') }}</td>
|
||||
<td class="text-end total-amound">:</td>
|
||||
<td class="text-end total-amound">
|
||||
{{ currency_format($subtotal + $total_product_vat + $vat_amount - ($purchase->discountAmount + $total_discount) + $purchase->shipping_charge, currency: business_currency($business_id)) }}
|
||||
{{ currency_format($subtotal + $purchase->vat_amount - ($purchase->discountAmount + $total_discount) + $purchase->shipping_charge, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -227,7 +198,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- purchase Return portion --}}
|
||||
{{-- purchase Return --}}
|
||||
<div class="custom-invoice-table">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
@@ -248,19 +219,16 @@
|
||||
@endphp
|
||||
<tr class="in-table-body">
|
||||
<td class="text-center">{{ $loop->iteration }}</td>
|
||||
<td class="text-start">{{ formatted_datetime($return->return_date) }}</td>
|
||||
<td class="text-start">{{ formatted_date($return->return_date) }}</td>
|
||||
<td class="text-start">
|
||||
<div class="invoice-item">
|
||||
{{ $detail->purchaseDetail->product->productName ?? '' }}
|
||||
{{ $detail->purchaseDetail?->stock?->batch_no ? '(' . $detail->purchaseDetail?->stock?->batch_no . ')' : '' }}
|
||||
@if(moduleCheck('SerialCodeAddon') && ($detail->purchaseDetail->product->has_serial ?? 0) == 1)
|
||||
<p>{{__('Serial')}}: {{ is_array($detail->serial_numbers) ? implode(', ', $detail->serial_numbers) : $detail->serial_numbers }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">{{ $detail->return_qty ?? 0 }}</td>
|
||||
<td class="text-end">
|
||||
{{ currency_format($detail->return_amount ?? 0, currency: business_currency($business_id)) }}
|
||||
{{ currency_format($detail->return_amount ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@@ -269,7 +237,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<div class="d-flex align-items-start justify-content-between position-relative bottom-info-container">
|
||||
<h2 class="word-amount">{{ amountInWords($total_return_amount, business_id: $business_id) }}</h2>
|
||||
<h2 class="word-amount">{{ amountInWords($total_return_amount) }}</h2>
|
||||
<div>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
@@ -281,10 +249,10 @@
|
||||
{{ $returnTransactionType ?? $purchase->paymentType ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
@if ((get_business_option('business-settings', $business_id)['show_note'] ?? 0) == 1)
|
||||
@if ((get_business_option('business-settings')['show_note'] ?? 0) == 1)
|
||||
<tr class="in-table-row">
|
||||
<td class="text-start">
|
||||
{{ get_business_option('business-settings', $business_id)['note'] ?? '' }}
|
||||
{{ get_business_option('business-settings')['note'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@@ -293,7 +261,7 @@
|
||||
@if ($bank_detail->show_in_invoice ?? 0 == 1)
|
||||
<div class="bank-details-container">
|
||||
<div class="bank-details-title">
|
||||
{{__('Bank Details')}}
|
||||
Bank Details
|
||||
</div>
|
||||
<div class="back-details-content">
|
||||
<table class="table mb-2">
|
||||
@@ -333,33 +301,32 @@
|
||||
<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($business_id)) }}</td>
|
||||
{{ currency_format($total_return_amount, currency: business_currency()) }}</td>
|
||||
</tr>
|
||||
<tr class="in-table-row-bottom">
|
||||
<td class="text-end total-amound">{{ __('Payable Amount') }}</td>
|
||||
<td class="text-end total-amound">:</td>
|
||||
<td class="text-end total-amound">
|
||||
{{ currency_format($purchase->totalAmount, currency: business_currency($business_id)) }}</td>
|
||||
{{ currency_format($purchase->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($purchase->paidAmount, currency: business_currency($business_id)) }}</td>
|
||||
{{ currency_format($purchase->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($purchase->dueAmount, currency: business_currency($business_id)) }}</td>
|
||||
{{ currency_format($purchase->dueAmount, currency: business_currency()) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- ONLY PURCHASE --}}
|
||||
@else
|
||||
{{-- purchases --}}
|
||||
<div class="custom-invoice-table">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
@@ -369,54 +336,39 @@
|
||||
<th class="head-black text-center">{{ __('Quantity') }}</th>
|
||||
@usercan('purchases.price')
|
||||
<th class="head-black text-end">{{ __('Unit Price') }}</th>
|
||||
<th class="head-black text-end">{{ __('Price (exc.)') }}</th>
|
||||
@endusercan
|
||||
<th class="head-black text-end">{{ __('Total Price') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@php
|
||||
$subtotal = 0;
|
||||
$total_product_vat = 0;
|
||||
@endphp
|
||||
@php $subtotal = 0; @endphp
|
||||
<tbody class="in-table-body-container">
|
||||
@foreach ($purchase->details as $detail)
|
||||
@php
|
||||
$productTotal = ($detail->productPurchasePrice ?? 0) * ($detail->quantities ?? 0);
|
||||
$exclusive_price = ($detail->price_without_tax && $detail->price_without_tax > 0) ? $detail->price_without_tax : ($detail->productPurchasePrice ?? 0);
|
||||
$qty = $detail->quantities ?? 0;
|
||||
|
||||
$product_vat = $productTotal - ($exclusive_price * $qty ?? 1);
|
||||
$total_product_vat += $product_vat;
|
||||
$subtotal += $exclusive_price * ($qty ?? 1);
|
||||
$subtotal += $productTotal;
|
||||
@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 . ')' : '') }}
|
||||
@if(moduleCheck('SerialCodeAddon') && ($detail->product->has_serial ?? 0) == 1)
|
||||
<p>{{__('Serial')}}: {{ is_array($detail->serial_numbers) ? implode(', ', $detail->serial_numbers) : $detail->serial_numbers }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">{{ $detail->quantities ?? '' }}</td>
|
||||
@usercan('purchases.price')
|
||||
<td class="text-end">
|
||||
{{ currency_format($detail->productPurchasePrice ?? 0, currency: business_currency($business_id)) }}
|
||||
</td>
|
||||
<td class="text-end">
|
||||
{{ currency_format($exclusive_price ?? 0, currency: business_currency($business_id)) }}
|
||||
{{ currency_format($detail->productPurchasePrice ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
@endusercan
|
||||
<td class="text-end">
|
||||
{{ currency_format($productTotal, currency: business_currency($business_id)) }}</td>
|
||||
{{ 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">
|
||||
<h2 class="word-amount">{{ amountInWords($purchase->totalAmount, business_id: $business_id) }}</h2>
|
||||
<h2 class="word-amount">{{ amountInWords($subtotal) }}</h2>
|
||||
<div>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
@@ -428,10 +380,10 @@
|
||||
{{ $transactionTypes ?? ($purchase->payment_type_id ? ($purchase->payment_type->name ?? '') : ($purchase->paymentType ?? '')) }}
|
||||
</td>
|
||||
</tr>
|
||||
@if ((get_business_option('business-settings', $business_id)['show_note'] ?? 0) == 1)
|
||||
@if ((get_business_option('business-settings')['show_note'] ?? 0) == 1)
|
||||
<tr class="in-table-row">
|
||||
<td class="text-start">
|
||||
{{ get_business_option('business-settings', $business_id)['note'] ?? '' }}
|
||||
{{ get_business_option('business-settings')['note'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@@ -480,21 +432,21 @@
|
||||
<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($business_id)) }}
|
||||
<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', $business_id)['vat_name'] ?? 'Vat' }}</td>
|
||||
<td class="text-end">{{ get_business_option('business-settings')['vat_name'] ?? 'Vat' }}</td>
|
||||
<td class="text-end">:</td>
|
||||
<td class="text-end">
|
||||
{{ currency_format($vat_amount + $total_product_vat, currency: business_currency($business_id)) }}
|
||||
{{ currency_format($purchase->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($purchase->shipping_charge, currency: business_currency($business_id)) }}
|
||||
{{ currency_format($purchase->shipping_charge, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="in-table-row-bottom border-bottom-dis" >
|
||||
@@ -505,20 +457,20 @@
|
||||
</td>
|
||||
<td class="text-end">:</td>
|
||||
<td class="text-end">
|
||||
{{ currency_format($purchase->discountAmount, currency: business_currency($business_id)) }}
|
||||
{{ currency_format($purchase->discountAmount, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="in-table-row-bottom">
|
||||
<td class="text-end total-amound">{{ __('Total Amount') }}</td>
|
||||
<td class="text-end total-amound">:</td>
|
||||
<td class="text-end total-amound">
|
||||
{{ currency_format($purchase->totalAmount, currency: business_currency($business_id)) }}</td>
|
||||
{{ currency_format($purchase->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($purchase->paidAmount + $purchase->change_amount, currency: business_currency($business_id)) }}
|
||||
{{ currency_format($purchase->paidAmount + $purchase->change_amount, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
@if($purchase->change_amount > 0)
|
||||
@@ -526,7 +478,7 @@
|
||||
<td class="text-end">{{ __('Change Amount') }}</td>
|
||||
<td class="text-end">:</td>
|
||||
<td class="text-end">
|
||||
{{ currency_format($purchase->change_amount, currency: business_currency($business_id)) }}
|
||||
{{ currency_format($purchase->change_amount, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
@else
|
||||
@@ -534,7 +486,7 @@
|
||||
<td class="text-end">{{ __('Due') }}</td>
|
||||
<td class="text-end">:</td>
|
||||
<td class="text-end">
|
||||
{{ currency_format($purchase->dueAmount, currency: business_currency($business_id)) }}
|
||||
{{ currency_format($purchase->dueAmount, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@@ -556,26 +508,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if ((get_business_option('business-settings', $business_id)['show_warranty'] ?? 0) == 1)
|
||||
@if ((get_business_option('business-settings')['show_warranty'] ?? 0) == 1)
|
||||
<div class="warranty-container-2">
|
||||
<p>
|
||||
@if ((get_business_option('business-settings', $business_id)['show_warranty'] ?? 0) == 1)
|
||||
<span>{{ get_business_option('business-settings', $business_id)['warranty_void_label'] ?? '' }} - </span>
|
||||
@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', $business_id)['warranty_void'] ?? '' }}
|
||||
{{ get_business_option('business-settings')['warranty_void'] ?? '' }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
<h4 class="tax-powered pt-3 pb-0">{{ get_option('general')['admin_footer_text'] ?? '' }}: {{ get_option('general')['admin_footer_link_text'] ?? '' }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@php
|
||||
$shareUrl = $purchase->unique_id ? route('purchase.invoice.unique', $purchase->unique_id) : ($purchase->party?->phone ? route('purchase.invoice', ['purchase_id' => $purchase->id, 'phone' => $purchase->party?->phone]) : '');
|
||||
$facebook = $shareUrl ? 'https://www.facebook.com/sharer/sharer.php?u=' . urlencode($shareUrl) : '';
|
||||
$twitter = $shareUrl ? 'https://twitter.com/intent/tweet?url=' . urlencode($shareUrl) : '';
|
||||
$whatsapp = $shareUrl ? 'https://wa.me/?text=' . urlencode($shareUrl) : '';
|
||||
@endphp
|
||||
|
||||
@include('business::component.share-modal', ['copy' => $shareUrl, 'facebook' => $facebook, 'twitter' => $twitter, 'whatsapp' => $whatsapp])
|
||||
@@ -132,7 +132,7 @@
|
||||
@endsection
|
||||
|
||||
@section('pdf_content')
|
||||
<div class="invoice-container" dir="{{ app()->getLocale() == 'ar' ? 'rtl' : 'ltr' }}">
|
||||
<div class="invoice-container">
|
||||
|
||||
{{-- HEADER --}}
|
||||
<table class="top-table">
|
||||
@@ -198,13 +198,13 @@
|
||||
{{-- SUPPLIER / PURCHASE INFO --}}
|
||||
<table class="info-table">
|
||||
<tr>
|
||||
<td width="50%" style="text-align:{{ app()->getLocale() == 'ar' ? 'right' : 'left' }};">
|
||||
<td width="50%" style="text-align:{{ app()->getLocale() == 'ar' ? 'left' : 'left' }};">
|
||||
<strong>{{ __('Supplier Name') }}</strong> : {{ $purchase->party->name }}<br>
|
||||
<strong>{{ __('Mobile') }}</strong> : {{ $purchase->party->phone }}<br>
|
||||
<strong>{{ __('Address') }}</strong> : {{ $purchase->party->address }}
|
||||
</td>
|
||||
|
||||
<td width="50%" style="text-align:{{ app()->getLocale() == 'ar' ? 'left' : 'right' }};">
|
||||
<td width="50%" style="text-align:{{ app()->getLocale() == 'ar' ? 'right' : 'right' }};">
|
||||
<strong>{{ __('Invoice') }}</strong> : {{ $purchase->invoiceNumber }}<br>
|
||||
<strong>{{ __('Date') }}</strong> : {{ formatted_date($purchase->purchaseDate) }}<br>
|
||||
<strong>{{ __('Purchases By') }}</strong> :
|
||||
|
||||
@@ -1,28 +1,20 @@
|
||||
@foreach($products as $product)
|
||||
@php
|
||||
$firstStock = $product->stocks->first();
|
||||
$price_without_tax = $product->product_type === 'combo' ? ($product->price_without_tax ?? 0): ($firstStock->exclusive_price ?? 0);
|
||||
$inclusive_price = $firstStock->productPurchasePrice ?? 0;
|
||||
@endphp
|
||||
<div id="single-product" class="single-product {{ $product->id }}"
|
||||
data-product_id="{{ $product->id }}"
|
||||
data-product_type="{{ $product->product_type }}"
|
||||
data-has_serial="{{ $product->has_serial }}"
|
||||
data-product_type="{{ $product->product_type }}" {{-- newly added. this logic apply when product-modal opeb --}}
|
||||
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-brand="{{ $product->brand->brandName ?? '' }}"
|
||||
data-stock="{{ $product->stocks_sum_product_stock ?? 0 }}"
|
||||
data-purchase_price="{{ $inclusive_price }}"
|
||||
data-purchase_price="{{ $firstStock->productPurchasePrice ?? 0 }}"
|
||||
data-sales_price="{{ $firstStock->productSalePrice ?? 0 }}"
|
||||
data-whole_sale_price="{{ $firstStock->productWholeSalePrice ?? 0 }}"
|
||||
data-dealer_price="{{ $firstStock->productDealerPrice ?? 0 }}"
|
||||
data-price_without_tax="{{ $price_without_tax }}"
|
||||
data-profit_percent="{{ $firstStock->profit_percent ?? 0 }}"
|
||||
data-batch_no="{{ $firstStock->batch_no ?? null }}"
|
||||
data-expire_date="{{ $firstStock->expire_date ?? null }}"
|
||||
data-vat_rate="{{ $product->vat->rate ?? null }}"
|
||||
>
|
||||
<div class="pro-img">
|
||||
<img class='w-100 rounded' src="{{ asset($product->productPicture ?? 'assets/images/products/box.svg') }}" alt="">
|
||||
@@ -32,7 +24,7 @@
|
||||
<p class="pro-category">{{ $product->category->categoryName ?? '' }}</p>
|
||||
@usercan('purchases.price')
|
||||
<div class="price">
|
||||
<h6 class="pro-price product_price">{{ currency_format($inclusive_price ?? 0, currency: business_currency()) }}</h6>
|
||||
<h6 class="pro-price product_price">{{ currency_format($firstStock->productPurchasePrice ?? 0, currency: business_currency()) }}</h6>
|
||||
</div>
|
||||
@endusercan
|
||||
</div>
|
||||
|
||||
@@ -45,10 +45,6 @@
|
||||
<input type="number" step="any" name="amount" id="purchase_price" required class="form-control" placeholder="{{ __('Enter Purchase Price') }}">
|
||||
</div>
|
||||
@endusercan
|
||||
<div class="col-lg-6 mb-2">
|
||||
<label>{{ __('Profit Percent') }}</label>
|
||||
<input type="number" step="any" name="profit_percent" id="profit_percent" required class="form-control" placeholder="{{ __('Enter Profit Percent') }}">
|
||||
</div>
|
||||
<div class="col-lg-6 mb-2">
|
||||
<label>{{ __('Sales Price') }}</label>
|
||||
<input type="number" step="any" name="amount" id="sales_price" required class="form-control" placeholder="{{ __('Enter Sales Price') }}">
|
||||
|
||||
@@ -35,22 +35,14 @@ class="ajaxform_instant_reload">
|
||||
<label>{{ __('Due') }}</label>
|
||||
<input type="number" name="due" step="any" class="form-control" placeholder="{{ __('Enter Due') }}">
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<label class="img-label">{{ __('Image') }}</label>
|
||||
<div class="custom-upload-wrapper">
|
||||
<div class="custom-image-box">
|
||||
<div class="custom-image-content">
|
||||
<svg width="30" height="30" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18.3327 7.5026V12.5026C18.3327 14.8596 18.3327 16.0381 17.6004 16.7704C16.8682 17.5026 15.6897 17.5026 13.3327 17.5026H6.66602C4.309 17.5026 3.13048 17.5026 2.39825 16.7704C1.66602 16.0381 1.66602 14.8596 1.66602 12.5026V9.21404C1.66602 8.39729 1.66602 7.98892 1.76053 7.65502C1.99698 6.81974 2.64982 6.1669 3.48509 5.93046C3.819 5.83594 4.22736 5.83594 5.04409 5.83594C5.34907 5.83594 5.50157 5.83594 5.64361 5.81118C5.99556 5.74983 6.31847 5.577 6.56476 5.3182C6.66415 5.21375 6.91352 4.8397 7.08268 4.58594C7.413 4.09048 7.57815 3.84275 7.80393 3.67233C7.94181 3.56826 8.09502 3.48627 8.25809 3.42927C8.52512 3.33594 8.82287 3.33594 9.41837 3.33594H10.8327" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M13.3327 11.2474C13.3327 13.0883 11.8403 14.5807 9.99937 14.5807C8.1584 14.5807 6.66602 13.0883 6.66602 11.2474C6.66602 9.40641 8.1584 7.91406 9.99937 7.91406C11.8403 7.91406 13.3327 9.40641 13.3327 11.2474Z" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M13.334 4.58333H17.5007M15.4173 6.66667V2.5" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
<span class="custom-upload-text">{{ __('Add Image') }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Preview image -->
|
||||
<img class="preview-image d-none" id="image" src="" alt="Preview">
|
||||
<input type="file" name="image" class="preview-image-input" data-id="#image" accept="image/*">
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user