ultimatepos/resources/views/home/index.blade.php

1179 lines
67 KiB
PHP

@extends('layouts.app')
@section('title', __('home.home'))
@section('content')
<div class="md-dashboard">
<div class="md-page-header">
<div class="md-page-header__main">
<p class="md-page-header__eyebrow">{{ __('home.home') }}</p>
<h1 class="md-page-header__title">
{{ __('home.welcome_message', ['name' => Session::get('user.first_name')]) }}
</h1>
</div>
@if (auth()->user()->can('dashboard.data') && !empty($is_admin) && $is_admin)
<div class="md-page-header__actions">
@if (count($all_locations) > 1)
{!! Form::select('dashboard_location', $all_locations, null, [
'class' => 'form-control select2',
'placeholder' => __('lang_v1.select_location'),
'id' => 'dashboard_location',
]) !!}
@endif
<button type="button" id="dashboard_date_filter">
<svg aria-hidden="true" class="tw-size-5" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z" />
<path d="M16 3v4" />
<path d="M8 3v4" />
<path d="M4 11h16" />
</svg>
<span>{{ __('messages.filter_by_date') }}</span>
<svg aria-hidden="true" class="tw-size-4" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M6 9l6 6l6 -6" />
</svg>
</button>
</div>
@endif
</div>
@if (auth()->user()->can('dashboard.data') && !empty($is_admin) && $is_admin)
<div class="md-stat-grid">
@include('home.partials.stat_card', [
'color' => 'primary',
'value_class' => 'total_sell',
'label' => __('home.total_sell'),
'icon' => '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"/><path d="M17 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"/><path d="M17 17h-11v-14h-2"/><path d="M6 5l14 1l-1 7h-13"/></svg>',
])
@include('home.partials.stat_card', [
'color' => 'success',
'value_class' => 'net',
'label' => __('lang_v1.net') . ' <i class="fa fa-info-circle text-info hover-q no-print" aria-hidden="true" data-container="body" data-toggle="popover" data-placement="auto bottom" data-content="' . e(__('lang_v1.net_home_tooltip')) . '" data-html="true" data-trigger="hover"></i>',
'icon' => '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2"/><path d="M14.8 8a2 2 0 0 0 -1.8 -1h-2a2 2 0 1 0 0 4h2a2 2 0 1 1 0 4h-2a2 2 0 0 1 -1.8 -1"/><path d="M12 6v10"/></svg>',
])
@include('home.partials.stat_card', [
'color' => 'warning',
'value_class' => 'invoice_due',
'label' => __('home.invoice_due'),
'icon' => '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M9 7l1 0"/><path d="M9 13l6 0"/><path d="M13 17l2 0"/></svg>',
])
@include('home.partials.stat_card', [
'color' => 'danger',
'value_class' => 'total_sell_return',
'label' => __('lang_v1.total_sell_return') . ' <i class="fa fa-info-circle text-info hover-q no-print" aria-hidden="true" data-container="body" data-toggle="popover" data-placement="auto bottom" id="total_srp" data-value="' . __('lang_v1.total_sell_return') . '-' . __('lang_v1.total_sell_return_paid') . '" data-content="" data-html="true" data-trigger="hover"></i>',
'icon' => '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M21 7l-18 0"/><path d="M18 10l3 -3l-3 -3"/><path d="M6 20l-3 -3l3 -3"/><path d="M3 17l18 0"/></svg>',
])
@include('home.partials.stat_card', [
'color' => 'info',
'value_class' => 'total_purchase',
'label' => __('home.total_purchase'),
'icon' => '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 3v12"/><path d="M16 11l-4 4l-4 -4"/><path d="M3 12a9 9 0 0 0 18 0"/></svg>',
])
@include('home.partials.stat_card', [
'color' => 'warning',
'value_class' => 'purchase_due',
'label' => __('home.purchase_due'),
'icon' => '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 9v4"/><path d="M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z"/><path d="M12 16h.01"/></svg>',
])
@include('home.partials.stat_card', [
'color' => 'danger',
'value_class' => 'total_purchase_return',
'label' => __('lang_v1.total_purchase_return') . ' <i class="fa fa-info-circle text-info hover-q no-print" aria-hidden="true" data-container="body" data-toggle="popover" data-placement="auto bottom" id="total_prp" data-value="' . __('lang_v1.total_purchase_return') . '-' . __('lang_v1.total_purchase_return_paid') . '" data-content="" data-html="true" data-trigger="hover"></i>',
'icon' => '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2"/><path d="M15 14v-2a2 2 0 0 0 -2 -2h-4l2 -2m0 4l-2 -2"/></svg>',
])
@include('home.partials.stat_card', [
'color' => 'success',
'value_class' => 'total_expense',
'label' => __('lang_v1.expense'),
'icon' => '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2"/><path d="M14.8 8a2 2 0 0 0 -1.8 -1h-2a2 2 0 1 0 0 4h2a2 2 0 1 1 0 4h-2a2 2 0 0 1 -1.8 -1"/><path d="M12 6v10"/></svg>',
])
</div>
@endif
@if (auth()->user()->can('dashboard.data'))
<div class="md-dashboard-grid">
@if (auth()->user()->can('sell.view') || auth()->user()->can('direct_sell.view'))
@if (!empty($all_locations))
<div class="md-panel md-panel--wide">
<div class="md-panel__header">
<div class="md-panel__title-wrap">
<div class="md-panel__icon">
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M6 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path>
<path d="M17 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path>
<path d="M17 17h-11v-14h-2"></path>
<path d="M6 5l14 1l-1 7h-13"></path>
</svg>
</div>
<h3 class="md-panel__title">
{{ __('home.sells_last_30_days') }}
</h3>
</div>
</div>
<div class="md-panel__body">
<div class="md-panel__chart">
{!! $sells_chart_1->container() !!}
</div>
</div>
</div>
@endif
{{-- @if (!empty($widgets['after_sales_last_30_days']))
@foreach ($widgets['after_sales_last_30_days'] as $widget)
{!! $widget !!}
@endforeach
@endif --}}
@if (!empty($all_locations))
<div class="md-panel md-panel--wide">
<div class="md-panel__header">
<div class="md-panel__title-wrap">
<div class="md-panel__icon">
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M6 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path>
<path d="M17 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path>
<path d="M17 17h-11v-14h-2"></path>
<path d="M6 5l14 1l-1 7h-13"></path>
</svg>
</div>
<h3 class="md-panel__title">
{{ __('home.sells_current_fy') }}
</h3>
</div>
</div>
<div class="md-panel__body">
<div class="md-panel__chart">
{!! $sells_chart_2->container() !!}
</div>
</div>
</div>
@endif
@endif
{{-- @if (!empty($widgets['after_sales_current_fy']))
@foreach ($widgets['after_sales_current_fy'] as $widget)
{!! $widget !!}
@endforeach
@endif --}}
@if (auth()->user()->can('sell.view') || auth()->user()->can('direct_sell.view'))
<div
class="md-panel">
<div class="md-panel__body">
<div class="md-panel__header">
<div class="md-panel__title-wrap">
<div
class="md-panel__icon">
<svg aria-hidden="true" class="tw-text-yellow-500 tw-size-5 tw-shrink-0"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 9v4"></path>
<path
d="M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z">
</path>
<path d="M12 16h.01"></path>
</svg>
</div>
<div class="tw-flex tw-items-center tw-flex-1 tw-min-w-0 tw-gap-1">
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
<h3 class="md-panel__title">
{{ __('lang_v1.sales_payment_dues') }}
@show_tooltip(__('lang_v1.tooltip_sales_payment_dues'))
</h3>
</div>
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
{!! Form::select('sales_payment_dues_location', $all_locations, null, [
'class' => 'form-control select2',
'placeholder' => __('lang_v1.select_location'),
'id' => 'sales_payment_dues_location',
]) !!}
</div>
</div>
</div>
</div>
<div class="tw-flow-root tw-mt-5 tw-border-gray-200">
<div class="tw--mx-4 tw--my-2 tw-overflow-x-auto sm:tw--mx-5">
<div class="tw-inline-block tw-min-w-full tw-py-2 tw-align-middle sm:tw-px-5">
<table class="table table-bordered table-striped" id="sales_payment_dues_table"
style="width: 100%;">
<thead>
<tr>
<th>@lang('contact.customer')</th>
<th>@lang('sale.invoice_no')</th>
<th>@lang('home.due_amount')</th>
<th>@lang('messages.action')</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
@endif
@can('purchase.view')
<div
class="md-panel">
<div class="md-panel__body">
<div class="md-panel__header">
<div class="md-panel__title-wrap">
<div
class="md-panel__icon">
<svg aria-hidden="true" class="tw-text-yellow-500 tw-size-5 tw-shrink-0"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 9v4"></path>
<path
d="M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z">
</path>
<path d="M12 16h.01"></path>
</svg>
</div>
<div class="tw-flex tw-items-center tw-flex-1 tw-min-w-0 tw-gap-1">
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
<h3 class="md-panel__title">
{{ __('lang_v1.purchase_payment_dues') }}
@show_tooltip(__('tooltip.payment_dues'))
</h3>
</div>
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
@if (count($all_locations) > 1)
{!! Form::select('purchase_payment_dues_location', $all_locations, null, [
'class' => 'form-control select2 ',
'placeholder' => __('lang_v1.select_location'),
'id' => 'purchase_payment_dues_location',
]) !!}
@endif
</div>
</div>
</div>
</div>
<div class="tw-flow-root tw-mt-5 tw-border-gray-200">
<div class="tw--mx-4 tw--my-2 tw-overflow-x-auto sm:tw--mx-5">
<div class="tw-inline-block tw-min-w-full tw-py-2 tw-align-middle sm:tw-px-5">
<table class="table table-bordered table-striped" id="purchase_payment_dues_table"
style="width: 100%;">
<thead>
<tr>
<th>@lang('purchase.supplier')</th>
<th>@lang('purchase.ref_no')</th>
<th>@lang('home.due_amount')</th>
<th>@lang('messages.action')</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
@endcan
@can('stock_report.view')
<div
class="md-panel md-panel--wide">
<div class="md-panel__body">
<div class="md-panel__header">
<div class="md-panel__title-wrap">
<div
class="md-panel__icon">
<svg aria-hidden="true" class="tw-text-yellow-500 tw-size-5 tw-shrink-0"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"></path>
<path d="M12 8v4"></path>
<path d="M12 16h.01"></path>
</svg>
</div>
<div class="tw-flex tw-items-center tw-flex-1 tw-min-w-0 tw-gap-1">
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
<h3 class="md-panel__title">
{{ __('home.product_stock_alert') }}
@show_tooltip(__('tooltip.product_stock_alert'))
</h3>
</div>
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
@if (count($all_locations) > 1)
{!! Form::select('stock_alert_location', $all_locations, null, [
'class' => 'form-control select2',
'placeholder' => __('lang_v1.select_location'),
'id' => 'stock_alert_location',
]) !!}
@endif
</div>
</div>
</div>
</div>
<div class="tw-flow-root tw-mt-5 tw-border-gray-200">
<div class="tw--mx-4 tw--my-2 tw-overflow-x-auto sm:tw--mx-5">
<div class="tw-inline-block tw-min-w-full tw-py-2 tw-align-middle sm:tw-px-5">
<table class="table table-bordered table-striped" id="stock_alert_table"
style="width: 100%;">
<thead>
<tr>
<th>@lang('sale.product')</th>
<th>@lang('business.location')</th>
<th>@lang('report.current_stock')</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
@if (session('business.enable_product_expiry') == 1)
<div
class="md-panel">
<div class="md-panel__body">
<div class="md-panel__header">
<div class="md-panel__title-wrap">
<div
class="md-panel__icon">
<svg aria-hidden="true" class="tw-text-yellow-500 tw-size-5 tw-shrink-0"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 9v4"></path>
<path
d="M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z">
</path>
<path d="M12 16h.01"></path>
</svg>
</div>
<div class="tw-flex tw-items-center tw-flex-1 tw-min-w-0 tw-gap-1">
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
<h3 class="md-panel__title">
{{ __('home.stock_expiry_alert') }}
@show_tooltip(
__('tooltip.stock_expiry_alert', [
'days'
=>session('business.stock_expiry_alert_days', 30) ]) )
</h3>
</div>
</div>
</div>
</div>
<div class="tw-flow-root tw-mt-5 tw-border-gray-200">
<div class="tw--mx-4 tw--my-2 tw-overflow-x-auto sm:tw--mx-5">
<div class="tw-inline-block tw-min-w-full tw-py-2 tw-align-middle sm:tw-px-5">
<input type="hidden" id="stock_expiry_alert_days"
value="{{ \Carbon::now()->addDays(session('business.stock_expiry_alert_days', 30))->format('Y-m-d') }}">
<table class="table table-bordered table-striped" id="stock_expiry_alert_table">
<thead>
<tr>
<th>@lang('business.product')</th>
<th>@lang('business.location')</th>
<th>@lang('report.stock_left')</th>
<th>@lang('product.expires_in')</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
@endif
@endcan
@if (auth()->user()->can('so.view_all') || auth()->user()->can('so.view_own'))
<div
class="md-panel md-panel--wide">
<div class="md-panel__body">
<div class="md-panel__header">
<div class="md-panel__title-wrap">
<div
class="md-panel__icon">
<svg aria-hidden="true" class="tw-text-yellow-500 tw-size-5 tw-shrink-0"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"></path>
<path d="M12 8v4"></path>
<path d="M12 16h.01"></path>
</svg>
</div>
<div class="tw-flex tw-items-center tw-flex-1 tw-min-w-0 tw-gap-1">
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
<h3 class="md-panel__title">
{{ __('lang_v1.sales_order') }}
</h3>
</div>
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
@if (count($all_locations) > 1)
{!! Form::select('so_location', $all_locations, null, [
'class' => 'form-control select2',
'placeholder' => __('lang_v1.select_location'),
'id' => 'so_location',
]) !!}
@endif
</div>
</div>
</div>
</div>
<div class="tw-flow-root tw-mt-5 tw-border-gray-200">
<div class="tw--mx-4 tw--my-2 tw-overflow-x-auto sm:tw--mx-5">
<div class="tw-inline-block tw-min-w-full tw-py-2 tw-align-middle sm:tw-px-5">
<table class="table table-bordered table-striped ajax_view"
id="sales_order_table">
<thead>
<tr>
<th>@lang('messages.action')</th>
<th>@lang('messages.date')</th>
<th>@lang('restaurant.order_no')</th>
<th>@lang('sale.customer_name')</th>
<th>@lang('lang_v1.contact_no')</th>
<th>@lang('sale.location')</th>
<th>@lang('sale.status')</th>
<th>@lang('lang_v1.shipping_status')</th>
<th>@lang('lang_v1.quantity_remaining')</th>
<th>@lang('lang_v1.added_by')</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
@endif
@if (
!empty($common_settings['enable_purchase_requisition']) &&
(auth()->user()->can('purchase_requisition.view_all') || auth()->user()->can('purchase_requisition.view_own')))
<div
class="md-panel md-panel--wide">
<div class="md-panel__body">
<div class="md-panel__header">
<div class="md-panel__title-wrap">
<div
class="md-panel__icon">
<svg aria-hidden="true" class="tw-text-yellow-500 tw-size-5 tw-shrink-0"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M10 10v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-4"></path>
<path d="M9 6h6"></path>
<path d="M10 6v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2"></path>
<circle cx="12" cy="16" r="2"></circle>
<path d="M5 20h14a2 2 0 0 0 2 -2v-10"></path>
<path d="M15 16v4"></path>
<path d="M9 20v-4"></path>
</svg>
</div>
<div class="tw-flex tw-items-center tw-flex-1 tw-min-w-0 tw-gap-1">
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
<h3 class="md-panel__title">
@lang('lang_v1.purchase_requisition')
</h3>
</div>
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
@if (count($all_locations) > 1)
@if (count($all_locations) > 1)
{!! Form::select('pr_location', $all_locations, null, [
'class' => 'form-control select2',
'placeholder' => __('lang_v1.select_location'),
'id' => 'pr_location',
]) !!}
@endif
@endif
</div>
</div>
</div>
</div>
<div class="tw-flow-root tw-mt-5 tw-border-gray-200">
<div class="tw--mx-4 tw--my-2 tw-overflow-x-auto sm:tw--mx-5">
<div class="tw-inline-block tw-min-w-full tw-py-2 tw-align-middle sm:tw-px-5">
<table class="table table-bordered table-striped ajax_view"
id="purchase_requisition_table" style="width: 100%;">
<thead>
<tr>
<th>@lang('messages.action')</th>
<th>@lang('messages.date')</th>
<th>@lang('purchase.ref_no')</th>
<th>@lang('purchase.location')</th>
<th>@lang('sale.status')</th>
<th>@lang('lang_v1.required_by_date')</th>
<th>@lang('lang_v1.added_by')</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
@endif
@if (
!empty($common_settings['enable_purchase_order']) &&
(auth()->user()->can('purchase_order.view_all') || auth()->user()->can('purchase_order.view_own')))
<div
class="md-panel md-panel--wide">
<div class="md-panel__body">
<div class="md-panel__header">
<div class="md-panel__title-wrap">
<div
class="md-panel__icon">
<svg aria-hidden="true" class="tw-text-yellow-500 tw-size-5 tw-shrink-0"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<rect x="4" y="4" width="16" height="16" rx="2" />
<line x1="4" y1="10" x2="20" y2="10" />
<line x1="12" y1="4" x2="12" y2="20" />
<line x1="12" y1="10" x2="16" y2="10" />
</svg>
</div>
<div class="tw-flex tw-items-center tw-flex-1 tw-min-w-0 tw-gap-1">
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
<h3 class="md-panel__title">
@lang('lang_v1.purchase_order')
</h3>
</div>
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
@if (count($all_locations) > 1)
{!! Form::select('po_location', $all_locations, null, [
'class' => 'form-control select2',
'placeholder' => __('lang_v1.select_location'),
'id' => 'po_location',
]) !!}
@endif
</div>
</div>
</div>
</div>
<div class="tw-flow-root tw-mt-5 tw-border-gray-200">
<div class="tw--mx-4 tw--my-2 tw-overflow-x-auto sm:tw--mx-5">
<div class="tw-inline-block tw-min-w-full tw-py-2 tw-align-middle sm:tw-px-5">
<table class="table table-bordered table-striped ajax_view"
id="purchase_order_table" style="width: 100%;">
<thead>
<tr>
<th>@lang('messages.action')</th>
<th>@lang('messages.date')</th>
<th>@lang('purchase.ref_no')</th>
<th>@lang('purchase.location')</th>
<th>@lang('purchase.supplier')</th>
<th>@lang('sale.status')</th>
<th>@lang('lang_v1.quantity_remaining')</th>
<th>@lang('lang_v1.added_by')</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
@endif
@if (auth()->user()->can('access_pending_shipments_only') ||
auth()->user()->can('access_shipping') ||
auth()->user()->can('access_own_shipping'))
<div
class="md-panel md-panel--wide">
<div class="md-panel__body">
<div class="md-panel__header">
<div class="md-panel__title-wrap">
<div
class="md-panel__icon">
<svg aria-hidden="true" class="tw-text-yellow-500 tw-size-5 tw-shrink-0"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M7 17m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path>
<path d="M17 17m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path>
<path d="M5 17h-2v-4m-1 -8h11v12m-4 0h6m4 0h2v-6h-8m0 -5h5l3 5"></path>
<path d="M3 9l4 0"></path>
</svg>
</div>
<div class="tw-flex tw-items-center tw-flex-1 tw-min-w-0 tw-gap-1">
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
<h3 class="md-panel__title">
@lang('lang_v1.pending_shipments')
</h3>
</div>
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
@if (count($all_locations) > 1)
{!! Form::select('pending_shipments_location', $all_locations, null, [
'class' => 'form-control select2 ',
'placeholder' => __('lang_v1.select_location'),
'id' => 'pending_shipments_location',
]) !!}
@endif
</div>
</div>
</div>
</div>
<div class="tw-flow-root tw-mt-5 tw-border-gray-200">
<div class="tw--mx-4 tw--my-2 tw-overflow-x-auto sm:tw--mx-5">
<div class="tw-inline-block tw-min-w-full tw-py-2 tw-align-middle sm:tw-px-5">
<table class="table table-bordered table-striped ajax_view" id="shipments_table">
<thead>
<tr>
<th>@lang('messages.action')</th>
<th>@lang('messages.date')</th>
<th>@lang('sale.invoice_no')</th>
<th>@lang('sale.customer_name')</th>
<th>@lang('lang_v1.contact_no')</th>
<th>@lang('sale.location')</th>
<th>@lang('lang_v1.shipping_status')</th>
@if (!empty($custom_labels['shipping']['custom_field_1']))
<th>
{{ $custom_labels['shipping']['custom_field_1'] }}
</th>
@endif
@if (!empty($custom_labels['shipping']['custom_field_2']))
<th>
{{ $custom_labels['shipping']['custom_field_2'] }}
</th>
@endif
@if (!empty($custom_labels['shipping']['custom_field_3']))
<th>
{{ $custom_labels['shipping']['custom_field_3'] }}
</th>
@endif
@if (!empty($custom_labels['shipping']['custom_field_4']))
<th>
{{ $custom_labels['shipping']['custom_field_4'] }}
</th>
@endif
@if (!empty($custom_labels['shipping']['custom_field_5']))
<th>
{{ $custom_labels['shipping']['custom_field_5'] }}
</th>
@endif
<th>@lang('sale.payment_status')</th>
<th>@lang('restaurant.service_staff')</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
@endif
@if (auth()->user()->can('account.access') && config('constants.show_payments_recovered_today') == true)
<div
class="md-panel md-panel--wide">
<div class="md-panel__body">
<div class="md-panel__header">
<div class="md-panel__title-wrap">
<div
class="md-panel__icon">
<svg aria-hidden="true" class="tw-text-yellow-500 tw-size-5 tw-shrink-0"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 9v4"></path>
<path
d="M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z">
</path>
<path d="M12 16h.01"></path>
</svg>
</div>
<div class="tw-flex tw-items-center tw-flex-1 tw-min-w-0 tw-gap-1">
<div class="tw-w-full sm:tw-w-1/2 md:tw-w-1/2">
<h3 class="md-panel__title">
@lang('lang_v1.payment_recovered_today')
</h3>
</div>
</div>
</div>
</div>
<div class="tw-flow-root tw-mt-5 tw-border-gray-200">
<div class="tw--mx-4 tw--my-2 tw-overflow-x-auto sm:tw--mx-5">
<div class="tw-inline-block tw-min-w-full tw-py-2 tw-align-middle sm:tw-px-5">
<table class="table table-bordered table-striped" id="cash_flow_table">
<thead>
<tr>
<th>@lang('messages.date')</th>
<th>@lang('account.account')</th>
<th>@lang('lang_v1.description')</th>
<th>@lang('lang_v1.payment_method')</th>
<th>@lang('lang_v1.payment_details')</th>
<th>@lang('account.credit')</th>
<th>@lang('lang_v1.account_balance')
@show_tooltip(__('lang_v1.account_balance_tooltip'))</th>
<th>@lang('lang_v1.total_balance')
@show_tooltip(__('lang_v1.total_balance_tooltip'))</th>
</tr>
</thead>
<tfoot>
<tr class="bg-gray font-17 footer-total text-center">
<td colspan="5"><strong>@lang('sale.total'):</strong></td>
<td class="footer_total_credit"></td>
<td colspan="2"></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
@endif
{{-- @if (!empty($widgets['after_dashboard_reports']))
@foreach ($widgets['after_dashboard_reports'] as $widget)
{!! $widget !!}
@endforeach
@endif --}}
</div>
@endif
</div>
@endsection
<div class="modal fade payment_modal" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
</div>
<div class="modal fade edit_pso_status_modal" tabindex="-1" role="dialog"></div>
<div class="modal fade edit_payment_modal" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
</div>
@section('css')
<style>
.select2-container {
width: 100% !important;
}
</style>
@endsection
@section('javascript')
<script src="{{ asset('js/home.js?v=' . $asset_v) }}"></script>
<script src="{{ asset('js/payment.js?v=' . $asset_v) }}"></script>
@includeIf('sales_order.common_js')
@includeIf('purchase_order.common_js')
@if (!empty($all_locations))
{!! $sells_chart_1->script() !!}
{!! $sells_chart_2->script() !!}
@endif
<script type="text/javascript">
$(document).ready(function() {
sales_order_table = $('#sales_order_table').DataTable({
processing: true,
serverSide: true,
fixedHeader:false,
scrollY: "75vh",
scrollX: true,
scrollCollapse: true,
aaSorting: [
[1, 'desc']
],
"ajax": {
"url": '{{ action([\App\Http\Controllers\SellController::class, 'index']) }}?sale_type=sales_order',
"data": function(d) {
d.for_dashboard_sales_order = true;
if ($('#so_location').length > 0) {
d.location_id = $('#so_location').val();
}
}
},
columnDefs: [{
"targets": 7,
"orderable": false,
"searchable": false
}],
columns: [{
data: 'action',
name: 'action'
},
{
data: 'transaction_date',
name: 'transaction_date'
},
{
data: 'invoice_no',
name: 'invoice_no'
},
{
data: 'conatct_name',
name: 'conatct_name'
},
{
data: 'mobile',
name: 'contacts.mobile'
},
{
data: 'business_location',
name: 'bl.name'
},
{
data: 'status',
name: 'status'
},
{
data: 'shipping_status',
name: 'shipping_status'
},
{
data: 'so_qty_remaining',
name: 'so_qty_remaining',
"searchable": false
},
{
data: 'added_by',
name: 'u.first_name'
},
]
});
@if (auth()->user()->can('account.access') && config('constants.show_payments_recovered_today') == true)
// Cash Flow Table
cash_flow_table = $('#cash_flow_table').DataTable({
processing: true,
serverSide: true,
fixedHeader:false,
"ajax": {
"url": "{{ action([\App\Http\Controllers\AccountController::class, 'cashFlow']) }}",
"data": function(d) {
d.type = 'credit';
d.only_payment_recovered = true;
}
},
"ordering": false,
"searching": false,
columns: [{
data: 'operation_date',
name: 'operation_date'
},
{
data: 'account_name',
name: 'account_name'
},
{
data: 'sub_type',
name: 'sub_type'
},
{
data: 'method',
name: 'TP.method'
},
{
data: 'payment_details',
name: 'payment_details',
searchable: false
},
{
data: 'credit',
name: 'amount'
},
{
data: 'balance',
name: 'balance'
},
{
data: 'total_balance',
name: 'total_balance'
},
],
"fnDrawCallback": function(oSettings) {
__currency_convert_recursively($('#cash_flow_table'));
},
"footerCallback": function(row, data, start, end, display) {
var footer_total_credit = 0;
for (var r in data) {
footer_total_credit += $(data[r].credit).data('orig-value') ? parseFloat($(
data[r].credit).data('orig-value')) : 0;
}
$('.footer_total_credit').html(__currency_trans_from_en(footer_total_credit));
}
});
@endif
$('#so_location').change(function() {
sales_order_table.ajax.reload();
});
@if (!empty($common_settings['enable_purchase_order']))
//Purchase table
purchase_order_table = $('#purchase_order_table').DataTable({
processing: true,
serverSide: true,
fixedHeader:false,
aaSorting: [
[1, 'desc']
],
scrollY: "75vh",
scrollX: true,
scrollCollapse: true,
ajax: {
url: '{{ action([\App\Http\Controllers\PurchaseOrderController::class, 'index']) }}',
data: function(d) {
d.from_dashboard = true;
if ($('#po_location').length > 0) {
d.location_id = $('#po_location').val();
}
},
},
columns: [{
data: 'action',
name: 'action',
orderable: false,
searchable: false
},
{
data: 'transaction_date',
name: 'transaction_date'
},
{
data: 'ref_no',
name: 'ref_no'
},
{
data: 'location_name',
name: 'BS.name'
},
{
data: 'name',
name: 'contacts.name'
},
{
data: 'status',
name: 'transactions.status'
},
{
data: 'po_qty_remaining',
name: 'po_qty_remaining',
"searchable": false
},
{
data: 'added_by',
name: 'u.first_name'
}
]
})
$('#po_location').change(function() {
purchase_order_table.ajax.reload();
});
@endif
@if (!empty($common_settings['enable_purchase_requisition']))
//Purchase table
purchase_requisition_table = $('#purchase_requisition_table').DataTable({
processing: true,
serverSide: true,
fixedHeader:false,
aaSorting: [
[1, 'desc']
],
scrollY: "75vh",
scrollX: true,
scrollCollapse: true,
ajax: {
url: '{{ action([\App\Http\Controllers\PurchaseRequisitionController::class, 'index']) }}',
data: function(d) {
d.from_dashboard = true;
if ($('#pr_location').length > 0) {
d.location_id = $('#pr_location').val();
}
},
},
columns: [{
data: 'action',
name: 'action',
orderable: false,
searchable: false
},
{
data: 'transaction_date',
name: 'transaction_date'
},
{
data: 'ref_no',
name: 'ref_no'
},
{
data: 'location_name',
name: 'BS.name'
},
{
data: 'status',
name: 'status'
},
{
data: 'delivery_date',
name: 'delivery_date'
},
{
data: 'added_by',
name: 'u.first_name'
},
]
})
$('#pr_location').change(function() {
purchase_requisition_table.ajax.reload();
});
$(document).on('click', 'a.delete-purchase-requisition', function(e) {
e.preventDefault();
swal({
title: LANG.sure,
icon: 'warning',
buttons: true,
dangerMode: true,
}).then(willDelete => {
if (willDelete) {
var href = $(this).attr('href');
$.ajax({
method: 'DELETE',
url: href,
dataType: 'json',
success: function(result) {
if (result.success == true) {
toastr.success(result.msg);
purchase_requisition_table.ajax.reload();
} else {
toastr.error(result.msg);
}
},
});
}
});
});
@endif
sell_table = $('#shipments_table').DataTable({
processing: true,
serverSide: true,
fixedHeader:false,
aaSorting: [
[1, 'desc']
],
scrollY: "75vh",
scrollX: true,
scrollCollapse: true,
"ajax": {
"url": '{{ action([\App\Http\Controllers\SellController::class, 'index']) }}',
"data": function(d) {
d.only_pending_shipments = true;
if ($('#pending_shipments_location').length > 0) {
d.location_id = $('#pending_shipments_location').val();
}
}
},
columns: [{
data: 'action',
name: 'action',
searchable: false,
orderable: false
},
{
data: 'transaction_date',
name: 'transaction_date'
},
{
data: 'invoice_no',
name: 'invoice_no'
},
{
data: 'conatct_name',
name: 'conatct_name'
},
{
data: 'mobile',
name: 'contacts.mobile'
},
{
data: 'business_location',
name: 'bl.name'
},
{
data: 'shipping_status',
name: 'shipping_status'
},
@if (!empty($custom_labels['shipping']['custom_field_1']))
{
data: 'shipping_custom_field_1',
name: 'shipping_custom_field_1'
},
@endif
@if (!empty($custom_labels['shipping']['custom_field_2']))
{
data: 'shipping_custom_field_2',
name: 'shipping_custom_field_2'
},
@endif
@if (!empty($custom_labels['shipping']['custom_field_3']))
{
data: 'shipping_custom_field_3',
name: 'shipping_custom_field_3'
},
@endif
@if (!empty($custom_labels['shipping']['custom_field_4']))
{
data: 'shipping_custom_field_4',
name: 'shipping_custom_field_4'
},
@endif
@if (!empty($custom_labels['shipping']['custom_field_5']))
{
data: 'shipping_custom_field_5',
name: 'shipping_custom_field_5'
},
@endif {
data: 'payment_status',
name: 'payment_status'
},
{
data: 'waiter',
name: 'ss.first_name',
@if (empty($is_service_staff_enabled))
visible: false
@endif
}
],
"fnDrawCallback": function(oSettings) {
__currency_convert_recursively($('#sell_table'));
},
createdRow: function(row, data, dataIndex) {
$(row).find('td:eq(4)').attr('class', 'clickable_td');
}
});
$('#pending_shipments_location').change(function() {
sell_table.ajax.reload();
});
});
</script>
@endsection