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,82 @@
@if ($filter_from_date && $filter_to_date)
<div class="mb-2 text-center fw-bold duration-display">
<strong>{{ __('Duration:') }}</strong>
@if ($duration === 'today')
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
@elseif ($duration === 'yesterday')
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
@else
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
{{ __('to') }}
{{ Carbon\Carbon::parse($filter_to_date)->format('d-m-Y') }}
@endif
</div>
@endif
<div class="responsive-table m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th>{{ __('Date') }}</th>
<th>{{ __('Invoice') }}</th>
<th>{{ __('Party Name') }}</th>
<th>{{ __('Sale Amount') }}</th>
<th>{{ __('Profit') }}</th>
<th>{{ __('Loss') }}</th>
<th class="d-print-none">{{ __('Action') }}</th>
</tr>
</thead>
<tbody>
@foreach ($profits as $profit)
<tr>
<td>{{ ($profits->currentPage() - 1) * $profits->perPage() + $loop->iteration }}</td>
<td>{{ formatted_date($profit->saleDate) }}</td>
<td>{{ $profit->invoiceNumber }}</td>
<td>{{ $profit->party->name ?? '' }}</td>
<td>{{ currency_format($profit->totalAmount, currency: business_currency()) }}</td>
<td>
{{ $profit->lossProfit > 0 ? currency_format($profit->lossProfit, currency: business_currency()) : '' }}
</td>
<td class="text-danger">
{{ $profit->lossProfit < 0 ? currency_format(abs($profit->lossProfit), currency: business_currency()) : '' }}
</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">
<li>
@usercan('loss-profits.read')
<a href="#loss-profit-view" class="loss-profit-view" data-id="{{ $profit->id }}"
data-bs-toggle="modal">
<i class="fal fa-eye"></i>
{{ __('View') }}
</a>
@endusercan
</li>
<input type="hidden" value="{{ route('business.bill-wise-profits.show', ['bill_wise_profit' => ':id']) }}" id="loss-profit-id">
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
@if ($profits->count() > 0)
<tr>
<td class="fw-bold">{{__('Total')}}</td>
<td></td>
<td></td>
<td></td>
<td class="fw-bold">{{ currency_format($profits->sum('totalAmount'), currency: business_currency()) }}</td>
<td class="fw-bold text-success">{{ currency_format($profits->where('lossProfit', '>', 0)->sum('lossProfit'), currency: business_currency()) }}</td>
<td class="fw-bold text-danger">{{ currency_format(abs($profits->where('lossProfit', '<', 0)->sum('lossProfit')), currency: business_currency()) }}</td>
<td></td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $profits->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,42 @@
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th>{{ __('Date') }}</th>
<th>{{ __('Invoice') }}</th>
<th>{{ __('Party Name') }}</th>
<th>{{ __('Sale Amount') }}</th>
<th>{{ __('Profit') }}</th>
<th>{{ __('Loss') }}</th>
</tr>
</thead>
<tbody>
@foreach ($profits as $profit)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ formatted_date($profit->saleDate) }}</td>
<td>{{ $profit->invoiceNumber }}</td>
<td>{{ $profit->party->name ?? '' }}</td>
<td>{{ currency_format($profit->totalAmount, currency: business_currency()) }}</td>
<td>
{{ $profit->lossProfit > 0 ? currency_format($profit->lossProfit, currency: business_currency()) : '' }}
</td>
<td class="text-danger">
{{ $profit->lossProfit < 0 ? currency_format(abs($profit->lossProfit), currency: business_currency()) : '' }}
</td>
</tr>
@endforeach
</tbody>
@if ($profits->count() > 0)
<tr>
<td>{{__('Total')}}</td>
<td></td>
<td></td>
<td></td>
<td>{{ currency_format($profits->sum('totalAmount'), currency: business_currency()) }}</td>
<td>{{ currency_format($profits->where('lossProfit', '>', 0)->sum('lossProfit'), currency: business_currency()) }}</td>
<td>{{ currency_format(abs($profits->where('lossProfit', '<', 0)->sum('lossProfit')), currency: business_currency()) }}</td>
<td></td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,148 @@
@extends('layouts.business.master')
@section('title')
{{ __('Bill Wise Profit & Loss') }}
@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 d-print-none">
<h4>{{ __('Bill Wise Profit & Loss') }}</h4>
</div>
<div class="table-header justify-content-center border-0 d-none d-block d-print-block text-center mb-3">
@include('business::print.header')
<h4 class="mt-2">{{ __('Bill Wise Profit & Loss') }}</h4>
</div>
<div class="loss-profit-container d-print-none">
<div class="row">
<div class="col-lg-2 col-md-6 ">
<div class="loss-card p-3 m-2 text-white">
<p class="stat-title">{{ __('Sales Amount') }}</p>
<p class="stat-value" id="total_sale_amount" >{{ currency_format($total_sale_amount, currency: business_currency()) }}</p>
</div>
</div>
<div class="col-lg-2 col-md-12 ">
<div class=" profit-card p-3 m-2 text-white">
<p class="stat-title">{{ __('Loss') }}</p>
<p class="stat-value" id="total_loss">{{ currency_format($loss, currency: business_currency()) }}</p>
</div>
</div>
<div class="col-lg-2 col-md-6 ">
<div class="sales-card p-3 m-2 text-white">
<p class="stat-title">{{ __('Profit') }}</p>
<p class="stat-value" id="total_profit">{{ currency_format($profit, currency: business_currency()) }}</p>
</div>
</div>
</div>
</div>
<div class="table-top-form p-16-0">
<form action="{{ route('business.bill-wise-profits.index') }}" method="GET" class="report-filter-form d-print-none" table="#bill-wise-profit-data">
<div class="table-top-left d-flex gap-3 margin-l-16">
<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>
<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 class="header-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 class="header-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 class="gpt-up-down-arrow position-relative">
<select name="party_id" class="form-control">
<option value="">{{__('All Customer')}}</option>
<option value="Guest">{{__('Guest')}}</option>
@foreach ($parties as $party)
<option @selected(request('party_id') == $party->id) value="{{ $party->id }}">{{ $party->name }}</option>
@endforeach
</select>
<span></span>
</div>
</div>
</form>
<div class="table-top-btn-group d-print-none p-2">
<ul>
<li>
<a href="{{ route('business.bill-wise-profits.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.bill-wise-profits.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.bill-wise-profits.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</a>
</li>
<li>
<a onclick="window.print()" class="print-window">
<img src="{{ asset('assets/images/logo/printer.svg') }}" alt="">
</a>
</li>
</ul>
</div>
</div>
</div>
<div id="bill-wise-profit-data">
@include('business::bill-wise-profits.datas')
</div>
</div>
</div>
</div>
@endsection
@push('modal')
@include('business::bill-wise-profits.view')
@endpush

View File

@@ -0,0 +1,71 @@
@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="">{{ __('Bill Wise Profit & Loss') }}</h4>
{{-- <p style="text-align: center; margin: 0; padding: 0; font-weight: 400; font-size: 14px;" class="">{{ __('Duration: 14-12-2025 to 24-12-2025') }}</p> --}}
</div>
@endsection
@section('pdf_content')
<table width="100%" cellpadding="6" cellspacing="0" style="border-collapse: collapse; border: 1px solid gainsboro; font-size:12px;">
<thead>
<tr style="background-color: #C52127; color: white;">
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Date') }}</th>
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Invoice') }}</th>
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Party Name') }}</th>
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Sale Amount') }}</th>
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Profit') }}</th>
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Loss') }}</th>
</tr>
</thead>
<tbody>
<tbody>
@foreach ($profits as $profit)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ formatted_date($profit->saleDate) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $profit->invoiceNumber }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $profit->party->name ?? '' }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($profit->totalAmount, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $profit->lossProfit > 0 ? currency_format($profit->lossProfit, currency: business_currency()) : '' }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $profit->lossProfit < 0 ? currency_format(abs($profit->lossProfit), currency: business_currency()) : '' }}
</td>
</tr>
@endforeach
</tbody>
@if ($profits->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; color: white; font-weight: 600;">
{{ currency_format($profits->sum('totalAmount'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($profits->where('lossProfit', '>', 0)->sum('lossProfit'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format(abs($profits->where('lossProfit', '<', 0)->sum('lossProfit')), currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,33 @@
<div class="modal fade p-0" id="loss-profit-view">
<div class="modal-dialog modal-dialog-centered modal-lg">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5">{{ __('Invoice: S01 - Demo User') }}</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body order-form-section">
<div class="costing-list">
<div class="responsive-table min-h-0 m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th class="text-start">{{ __('Item Name') }}</th>
<th class="text-start">{{ __('Batch No') }}</th>
<th class="text-start">{{ __('Quantity') }}</th>
<th class="text-start">{{ __('Purchases') }}</th>
<th class="text-start">{{ __('Sale Price') }}</th>
<th class="text-start">{{ __('Profit') }}</th>
<th class="text-start">{{ __('Loss') }}</th>
</tr>
</thead>
<tbody>
<!-- Data will be dynamically injected here -->
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>