update marketing
All checks were successful
All checks were successful
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
<table class="table" id="datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('SL') }}.</th>
|
||||
<th class="text-start d-print-none">{{ __('SL') }}.</th>
|
||||
<th class="text-start">{{ __('Product') }}</th>
|
||||
<th class="text-start">{{ __('Code') }}</th>
|
||||
<th class="text-start d-print-none">{{ __('HSN Code') }}</th>
|
||||
<th class="text-start">{{ __('Category') }}</th>
|
||||
@usercan('stocks.price')
|
||||
<th class="text-start">{{ __('Cost') }}</th>
|
||||
@@ -24,8 +25,7 @@
|
||||
});
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ ($products->currentPage() - 1) * $products->perPage() + $loop->iteration }}</td>
|
||||
|
||||
<td class="text-start d-print-none">{{ ($products->currentPage() - 1) * $products->perPage() + $loop->iteration }}</td>
|
||||
<td class="text-start">
|
||||
@php
|
||||
$stocks = $product->stocks->map(function ($batch) use ($product) {
|
||||
@@ -36,6 +36,7 @@
|
||||
'productSalePrice' => $batch->productSalePrice ?? 0,
|
||||
'productDealerPrice' => $batch->productDealerPrice ?? 0,
|
||||
'productPurchasePrice' => $batch->productPurchasePrice ?? 0,
|
||||
'exclusive_price' => $batch->exclusive_price ?? 0,
|
||||
'productWholeSalePrice' => $batch->productWholeSalePrice ?? 0,
|
||||
'warehouse' => $batch->warehouse?->name ?? ($product->warehouse?->name ?? ''),
|
||||
'rack' => $product->rack?->name ?? '',
|
||||
@@ -48,8 +49,8 @@
|
||||
{{ $product->productName }}
|
||||
</a>
|
||||
</td>
|
||||
|
||||
<td class="text-start">{{ $product->productCode }}</td>
|
||||
<td class="text-start d-print-none">{{ $product->hsn_code }}</td>
|
||||
<td class="text-start">{{ $product->category->categoryName ?? '' }}</td>
|
||||
@usercan('stocks.price')
|
||||
<td class="text-start">
|
||||
@@ -67,13 +68,21 @@
|
||||
@endforeach
|
||||
|
||||
@if ($products->count() > 0)
|
||||
<tr>
|
||||
<td colspan="{{ auth()->user()->can('stocks.price') || !auth()->user()->visibility ? 7 : 6 }}"
|
||||
class="text-end">
|
||||
<strong>{{ __('Total Stock Value:') }}</strong>
|
||||
<tr class="table-footer">
|
||||
<td class="text-start">{{ __('Total') }}</td>
|
||||
<td></td>
|
||||
<td class="d-print-none"></td>
|
||||
<td class="d-print-none"></td>
|
||||
<td></td>
|
||||
@usercan('stocks.price')
|
||||
<td></td>
|
||||
@endusercan
|
||||
<td class="text-start">
|
||||
{{ $total_stock_qty }}
|
||||
</td>
|
||||
<td></td>
|
||||
<td class="text-end">
|
||||
<strong>{{ currency_format($total_stock_value, currency: business_currency()) }}</strong>
|
||||
{{ currency_format($total_stock_value, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@@ -4,8 +4,11 @@
|
||||
<th>{{ __('SL') }}.</th>
|
||||
<th>{{ __('Product') }}</th>
|
||||
<th>{{ __('Code') }}</th>
|
||||
<th>{{ __('HSN Code') }}</th>
|
||||
<th>{{ __('Category') }}</th>
|
||||
<th>{{ __('Cost') }}</th>
|
||||
@usercan('stocks.price')
|
||||
<th>{{ __('Cost') }}</th>
|
||||
@endusercan
|
||||
<th>{{ __('Qty') }}</th>
|
||||
<th>{{ __('Sale') }}</th>
|
||||
<th>{{ __('Stock Value') }}</th>
|
||||
@@ -23,10 +26,11 @@
|
||||
<tr>
|
||||
<td>{{ $loop->index + 1 }}</td>
|
||||
<td>{{ $product->productName }}</td>
|
||||
<td class="text-start">{{ $product->productCode }}</td>
|
||||
<td class="text-start">{{ $product->category->categoryName ?? '' }}</td>
|
||||
<td>{{ $product->productCode }}</td>
|
||||
<td>{{ $product->hsn_code }}</td>
|
||||
<td>{{ $product->category->categoryName ?? '' }}</td>
|
||||
@usercan('stocks.price')
|
||||
<td class="text-start">
|
||||
<td>
|
||||
{{ currency_format(optional($firstStock)->productPurchasePrice, currency: business_currency()) }}
|
||||
</td>
|
||||
@endusercan
|
||||
@@ -40,4 +44,23 @@
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@if ($products->count() > 0)
|
||||
<tr class="table-footer">
|
||||
<td class="text-start">{{ __('Total') }}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
@usercan('stocks.price')
|
||||
<td></td>
|
||||
@endusercan
|
||||
<td class="text-start">
|
||||
{{ $total_stock_qty }}
|
||||
</td>
|
||||
<td></td>
|
||||
<td class="text-end">
|
||||
{{ currency_format($total_stock_value, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
<div class="d-flex align-items-center justify-content-center gap-3">
|
||||
<div class="profit-card p-3 text-white">
|
||||
<p class="stat-title">{{ __('Total Quantity') }}</p>
|
||||
<p class="stat-value">{{ $total_qty }}</p>
|
||||
<p class="stat-value" id="total_stock_qty">{{ $total_stock_qty }}</p>
|
||||
</div>
|
||||
|
||||
<div class="loss-card p-3 text-white">
|
||||
<p class="stat-title">{{ __('Total Stock Value') }}</p>
|
||||
<p class="stat-value">{{ currency_format($total_stock_value, currency : business_currency()) }}</p>
|
||||
<p class="stat-value" id="total_stock_value">{{ currency_format($total_stock_value, currency : business_currency()) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -36,7 +36,7 @@
|
||||
</div>
|
||||
|
||||
<div class="table-top-form p-16">
|
||||
<form action="{{ route('business.stocks.index') }}" method="GET" class="filter-form" table="#stock-data">
|
||||
<form action="{{ route('business.stocks.index') }}" method="GET" class="report-filter-form" table="#stock-data">
|
||||
|
||||
@if(request('alert_qty'))
|
||||
<input type="hidden" name="alert_qty" value="{{ request('alert_qty') }}">
|
||||
@@ -67,17 +67,17 @@
|
||||
<div class="table-top-btn-group d-print-none">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ route('business.stocks.csv', ['alert_qty' => request('alert_qty')]) }}">
|
||||
<a class="export-btn" href="{{ route('business.stocks.csv') }}">
|
||||
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('business.stocks.excel', ['alert_qty' => request('alert_qty')]) }}">
|
||||
<a class="export-btn" href="{{ route('business.stocks.excel') }}">
|
||||
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a target="blank" href="{{ route('business.stock-reports.pdf', ['alert_qty' => request('alert_qty')]) }}">
|
||||
<a class="export-btn" target="_blank" href="{{ route('business.stocks.pdf') }}">
|
||||
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
|
||||
</a>
|
||||
</li>
|
||||
|
||||
90
Modules/Business/resources/views/stocks/pdf.blade.php
Normal file
90
Modules/Business/resources/views/stocks/pdf.blade.php
Normal file
@@ -0,0 +1,90 @@
|
||||
@extends('layouts.business.pdf.pdf_layout')
|
||||
|
||||
@section('pdf_title')
|
||||
<div class="table-header justify-content-center border-0 d-none d-block d-print-block text-center">
|
||||
@include('business::print.header')
|
||||
<h4 style="text-align: center; margin: 0; padding: 0; font-size: 16px;" class="">{{ __('Stock List') }}</h4>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('pdf_content')
|
||||
<table width="100%" cellpadding="6" cellspacing="0"
|
||||
style="border-collapse: collapse; border: 1px solid gainsboro; font-size:12px;"
|
||||
id="datatable">
|
||||
<thead>
|
||||
<tr style="background-color: #C52127; color: white;">
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Product') }}</th>
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Code') }}</th>
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Hsn Code') }}</th>
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Category') }}</th>
|
||||
@usercan('stocks.price')
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Cost') }}</th>
|
||||
@endusercan
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Qty') }}</th>
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Sale') }}</th>
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Stock Value') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($products as $product)
|
||||
@php
|
||||
$total_stock = $product->stocks->sum('productStock');
|
||||
$firstStock = $product->stocks->first();
|
||||
$total_value = $product->stocks->sum(function ($stock) {
|
||||
return $stock->productPurchasePrice * $stock->productStock;
|
||||
});
|
||||
@endphp
|
||||
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ $product->productName }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ $product->productCode }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ $product->hsn_code }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ $product->category?->categoryName }}
|
||||
</td>
|
||||
@usercan('stocks.price')
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ currency_format(optional($firstStock)->productPurchasePrice, currency: business_currency()) }}
|
||||
</td>
|
||||
@endusercan
|
||||
<td class="{{ $total_stock <= $product->alert_qty ? 'text-danger' : 'text-success' }}" style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ $total_stock }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ currency_format(optional($firstStock)->productSalePrice, currency: business_currency()) }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ currency_format($total_value, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@if ($products->count() > 0)
|
||||
<tfoot>
|
||||
<tr style="background-color:#C52127; color:#FFFFFF; font-weight:bold;">
|
||||
<td style="border:1px solid gainsboro; text-align:center; color: white">
|
||||
{{ __('Total') }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
||||
@usercan('stocks.price')
|
||||
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
||||
@endusercan
|
||||
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
||||
{{ $total_stock_qty }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
||||
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
||||
{{ currency_format($total_stock_value, currency: business_currency()) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@endif
|
||||
</table>
|
||||
@endsection
|
||||
@@ -14,7 +14,8 @@
|
||||
<th>{{ __('Batch') }}</th>
|
||||
<th>{{ __('Stock') }}</th>
|
||||
@usercan('stocks.price')
|
||||
<th>{{ __('Purchase Price') }}</th>
|
||||
<th>{{ __('Purchase Price (Inc. tax)') }}</th>
|
||||
<th>{{ __('Purchase Price (Exc. tax)') }}</th>
|
||||
@endusercan
|
||||
<th>{{ __('MRP') }}</th>
|
||||
<th>{{ __('WholeSale Price') }}</th>
|
||||
|
||||
Reference in New Issue
Block a user