Files
kulakpos_web/Modules/Business/resources/views/stocks/pdf.blade.php
eko54r 05fd3230b8
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 5m14s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
Build, Push and Deploy / deploy-staging (push) Successful in 41s
Build, Push and Deploy / deploy-production (push) Has been skipped
update marketing
2026-05-14 11:55:22 +07:00

91 lines
5.1 KiB
PHP

@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