<?php $__env->startSection('main'); ?>
    <?php Fun::lang()?>
    <?php
        $stock_request = \App\Model\stock_inventory\ItemRequestModel::
               where('request_to', myBranch()->id)->where('status',0)->count();
        $pos_request = \App\Model\pos\SaleModel::where(function ($q) {
                $q->where('nso007_sales.branch_id', myBranch()->id);
                if (!Auth::user()->can('View Sale Request All Branch')) {
                    $q->where('branch_id', Auth::user()->branch_id);
                    $q->orwhere('user_id', Auth::user()->id);
                }
                })->where('status',0)->count();
          $br = myBranch();
                  $transfer = \App\Model\stock_inventory\TransferStockModel::where(['confirm_status'=>null,'type'=>'item','to_branch'=>$br->id])->count();
          $menu = [
              'dashboard' => [
                  'icon' => 'dashboard',
                      'route' => route('dashboard-branch.index'),
                      'text' => __('administrator.dashboard'),
                      'gate' => '',
              ],
              'pos' => [
                      'route' => '#',
                      'text' => __('administrator.pos'),
                      'gate' => '',
                      'pos' => array(
                          'route' => route('pos.create')."?postype=rldf8e7sdf",
                          'text' => __('administrator.pos'),
                          'gate' => 'POS Retail Create',
                      ),
                      'sale_invoice' => array(
                          'route' => route('sale-invoice'),
                          'text' => __('administrator.sale_invoice'),
                          'gate' => 'Sale Invoice',
                      ),
                      'sale_receipt' => array(
                          'route' => route('sale-receipt'),
                          'text' => __('administrator.sale_receipt'),
                          'gate' => 'Sale Receipt',
                      ),
                      'sale_edited' => array(
                          'route' => route('sale-edited.index'),
                          'text' => __('administrator.sale_edited'),
                          'gate' => 'Sale Edited',
                      ),
                      'sale_history' => array(
                          'route' => route('sale-history.index'),
                          'text' => __('administrator.sale_history'),
                          'gate' => 'Sale History',
                      ),
                      'cash_in_out' => array(
                          'route' => route('cash-in-cash-out.index'),
                          'text' => __('administrator.cash_in_out'),
                          'gate' => '',
                      ),
                        'product_return' => array(
                          'route' => route('product-return.index'),
                          'text' => __('administrator.product_return'),
                          'gate' => '',
                      ),
              ],
              'sale_request' => [
                  'route' => route('sale-request.index'),
                      'text' => __('administrator.sale_request'),
                      'gate' => 'Sale Request List',
                      'label'=>$pos_request
                  ],
              'item_request_order' => [
                      'route' => '#',
                      'text' => __('administrator.item_request_order'),
                      'gate' => '',
                      'label'=>$stock_request,
                      'purchase-order' => array(
                          'route' => route('request-stock.create'),
                          'text' => __('administrator.purchase-order'),
                          'gate' => '',
                      ),
                      'purchase_list' => array(
                          'route' => route('request-stock.index').'?type=purchase_list',
                          'text' => __('administrator.purchase_list'),
                          'gate' => '',
                      ),
                      'request_order' => array(
                          'route' => route('request-stock.index').'?type=request_order',
                          'text' => __('administrator.request_order'),
                          'gate' => '',
                          'label'=>$stock_request
                      ),
                      'stock_in' => array(
                          'route' => route('request-stock.index').'?type=stock_in',
                          'text' => __('administrator.stock_in'),
                          'gate' => '',
                      ),
              ],
              'transfers_stock' => [
                  'route' => route('transfer-stock.index'),
                      'text' => __('administrator.transfers_stock'),
                      'gate' => '',
                      'label'=>$transfer
              ],
               'payments' => [
                      'icon' => 'money',
                      'route' => '#',
                      'text' => __('administrator.payments'),
                      'gate' => '',
                      'sale_payment' => [
                          'route' => route('sale-payment'),
                          'text' => __('administrator.sale_payment'),
                          'gate' => 'Sale Payment List',
                      ],
                      'sale_request_payment' => [
                          'route' => route('seller-request-payment'),
                          'text' => __('administrator.sale_request_payment'),
                          'gate' => 'Sale Request Payment List',
                      ],
                    ],
              'peoples' => [
                  'route' => ('#'),
                      'text' => __('administrator.peoples'),
                      'gate' => '',
                      'user' => array(
                          'route' => route('users.index'),
                          'text' => __('administrator.user'),
                          'gate' => 'users.index',
                      ),
                      'customer' => array(
                          'route' => route('customer.index'),
                          'text' => __('administrator.customer'),
                          'gate' => 'Customer List',
                      ),
                      'driver' => array(
                          'route' => route('driver.index'),
                          'text' => __('administrator.driver'),
                          'gate' => 'Driver List',
                      ),
              ],
              'warehouse' => [
                  'route' => route('warehouse.index'),
                      'text' => __('administrator.warehouse'),
                      'gate' => 'Warehouse List',
              ],
              'report' => [
                  'route' => ('#'),
                      'text' => __('administrator.report'),
                      'gate' => '',
                      'stock_in' => array(
                          'route' => route('report-purchases-detail'),
                          'text' => __('administrator.stock_in'),
                          'gate' => 'Report Sales List',
                      ),
                      'stock_out' => array(
                          'route' => route('report-sale'),
                          'text' => __('administrator.stock_out'),
                          'gate' => '',
                      ),
                      'report_stock' => array(
                          'route' => route('report.stock-item'),
                          'text' => __('administrator.report_stock'),
                          'gate' => 'Report Stock List',
                      ),
                      'report_payment' => array(
                          'route' => route('report-sale-payment','?type=purchase_list'),
                          'text' => __('administrator.report_payment'),
                          'gate' => 'Report Payment List',
                      ),'income' => array(
                          'route' => route('report-income-by-sale'),
                          'text' => __('administrator.income'),
                          'gate' => '',
                      ),
                  ],
              ];
    ?>
    <?php $__env->startComponent('layouts.menu', ['menu' => $menu,'br'=>$br]); ?><?php echo $__env->renderComponent(); ?>
    <div class="main-content">
        <div class="top-header">
            <ol class="breadcrumb">
                <li><a href="<?php echo e(route('app_dashboard')); ?>"><?php echo e(findBranch(Auth::user()->branch_id)->name); ?></a></li>
                <li class="pull-right">
                    $ <input class="check-default-currency" value="2"
                             <?php echo e((Auth::user()->currency_id==2)?'checked':''); ?> type="checkbox">
                </li>
                <li class="pull-right">
                    ៛ <input class="check-default-currency" value="1"
                             <?php echo e((Auth::user()->currency_id==1)?'checked':''); ?> type="checkbox">
                </li>
            </ol>
        </div>
        <?php echo $__env->yieldContent('content'); ?>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
    <?php echo $__env->yieldContent('js'); ?>
    <?php echo $__env->yieldPushContent('script'); ?>



<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/nsowos/public_html/shr-brand/resources/views/layouts/app-branch.blade.php ENDPATH**/ ?>