@extends('layouts.app') @section('content')
@include('shared.messages')

{{__('texte.contragents_arr.history.show_contragent_history')}}

@foreach($contragentHistory as $history) @if($history->key == 'created_at' && !$history->old_value) @elseif($history->key == 'deleted_at' && !$history->old_value) @else @endif @endforeach
{{ __('texte.contragents_arr.history.contragent_created')}} {{__('texte.contragents_arr.history.by')}} {{$history->userResponsible()->name }} {{__('texte.contragents_arr.history.on')}} {{ date("d.m.Y",strtotime($history->created_at)) }} {{__('texte.contragents_arr.history.at')}} {{ date("H:i",strtotime($history->created_at)) }}
{{ __('texte.contragents_arr.history.contragent_deleted')}} {{ __('texte.contragents_arr.history.by')}} {{ $history->userResponsible()->name }} {{ __('texte.contragents_arr.history.on')}} {{ date("d.m.Y",strtotime($history->created_at)) }} {{ __('texte.contragents_arr.history.at')}} {{ date("H:i",strtotime($history->created_at)) }}
{{ $history->userResponsible()->name }} {{__('texte.contragents_arr.history.changed_field')}} @switch($history->fieldName()) @case('location') {{__('texte.contragents_arr.history.location')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $locations[$history->oldValue()]->name}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()=='nothing' ? '" "' : $locations[$history->newValue()]->name }} @break @case('payment_type') {{__('texte.contragents_arr.history.payment_type')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $history->oldValue()==0 ? __('texte.contragents_arr.history.cash') : __('texte.contragents_arr.history.bank_transfer')}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()==0 ? __('texte.contragents_arr.history.cash') : __('texte.contragents_arr.history.bank_transfer') }} @break @case('time_of_payment') {{__('texte.contragents_arr.history.time_of_payment')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $history->oldValue()==1 ? __('texte.contragents_arr.history.delayed_payment') : __('texte.contragents_arr.history.instant_payment')}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()==1 ? __('texte.contragents_arr.history.delayed_payment') : __('texte.contragents_arr.history.instant_payment') }} @break @case('limit') {{__('texte.contragents_arr.history.limit')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $history->oldValue()}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()}} @break @case('is_client') {{__('texte.contragents_arr.history.is_client')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : __('texte.replies_arr')[$history->oldValue()]}} {{__('texte.contragents_arr.history.to')}} {{ __('texte.replies_arr')[$history->newValue()]}} @break @case('is_supplier') {{__('texte.contragents_arr.history.is_supplier')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : __('texte.replies_arr')[$history->oldValue()]}} {{__('texte.contragents_arr.history.to')}} {{ __('texte.replies_arr')[$history->newValue()]}} @break @case('company_name') {{__('texte.contragents_arr.history.company_name')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $history->oldValue()}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()}} @break @case('address') {{__('texte.contragents_arr.history.address')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $history->oldValue()}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()}} @break @case('mol') {{__('texte.contragents_arr.history.mol')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $history->oldValue()}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()}} @break @case('vat') {{__('texte.contragents_arr.history.bulstat')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $history->oldValue()}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()}} @break @case('bulstat') {{__('texte.contragents_arr.history.eik')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $history->oldValue()}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()}} @break @case('iban') {{__('texte.contragents_arr.history.bank_account')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $history->oldValue()}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()}} @break @case('plus_wrappage') {{__('texte.contragents_arr.history.plus_wrappage')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : __('texte.replies_arr')[$history->oldValue()]}} {{__('texte.contragents_arr.history.to')}} {{ __('texte.replies_arr')[$history->newValue()]}} @break @case('delayed_days') {{__('texte.contragents_arr.history.delayed_days')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $history->oldValue()}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()}} @break @case('expired_days') {{__('texte.contragents_arr.history.expired_days')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $history->oldValue()}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()}} @break @case('is_company') {{__('texte.contragents_arr.history.registration')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : $history->oldValue()==1 ? __('texte.contragents_arr.history.legal_entity') : __('texte.contragents_arr.history.individual')}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue()==1 ? __('texte.contragents_arr.history.legal_entity') : __('texte.contragents_arr.history.individual') }} @break @case('active') {{__('texte.contragents_arr.history.active')}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()=='nothing' ? '" "' : __('texte.replies_arr')[$history->oldValue()]}} {{__('texte.contragents_arr.history.to')}} {{ __('texte.replies_arr')[$history->newValue()]}} @break @default {{$history->fieldName()}} {{__('texte.contragents_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : $history->oldValue()}} {{__('texte.contragents_arr.history.to')}} {{ $history->newValue() }} @break @endswitch {{__('texte.contragents_arr.history.on')}} {{ date("d.m.Y",strtotime($history->created_at)) }} {{__('texte.contragents_arr.history.at')}} {{ date("H:i",strtotime($history->created_at)) }}
@endsection