@extends('layouts.app') @section('title', __('lang_v1.import_sales')) @section('content')

@lang('lang_v1.import_sales')

@if (session('notification') || !empty($notification))
@if(!empty($notification['msg'])) {{$notification['msg']}} @elseif(session('notification.msg')) {{ session('notification.msg') }} @endif
@endif
@component('components.widget') {!! Form::open(['url' => action([\App\Http\Controllers\ImportSalesController::class, 'preview']), 'method' => 'post', 'enctype' => 'multipart/form-data' ]) !!}
{!! Form::label('name', __( 'product.file_to_import' ) . ':') !!} {!! Form::file('sales', ['required' => 'required']); !!}

{!! Form::close() !!} @endcomponent
@component('components.widget', ['title' => __('lang_v1.instructions')])
1. @lang('lang_v1.upload_data_in_excel_format')
2. @lang('lang_v1.choose_location_and_group_by')
3. @lang('lang_v1.map_columns_with_respective_sales_fields')
4. @foreach($import_fields as $key => $value) @endforeach
@lang('lang_v1.importable_fields') @lang('lang_v1.instructions')
{{$value['label']}} {{$value['instruction'] ?? ''}}
@endcomponent
@component('components.widget', ['title' => __('lang_v1.imports')]) @can('sell.delete') @endcan @foreach($imported_sales_array as $key => $value) @can('sell.delete') @endcan @endforeach
@lang('lang_v1.import_batch') @lang('lang_v1.import_time') @lang('business.created_by') @lang('lang_v1.invoices')@lang('messages.action')
{{$key}} {{@format_datetime($value['import_time'])}} {{$value['created_by']}} {{implode(', ', $value['invoices'])}}

(@lang('sale.total'): {{count($value['invoices'])}})

@lang('lang_v1.revert_import')
@endcomponent
@stop @section('javascript') @endsection