@foreach ($actions as $key => $value) @switch($key) @case('select') @break @case('approve') @if(!$data->approved) @endif @break @case('completed') @if( $status == 'organized' && date('Y-m-d', strtotime($data->end_date)) <= date('Y-m-d', strtotime(now())) ) @can('quick-report-work') @endcan @endif @break @case('need_new_work') @if( $status == 'organized' && date('Y-m-d', strtotime($data->end_date)) <= date('Y-m-d', strtotime(now())) ) @endif @break @case('paid_locally') @if($data->final_payment_method == 'cash_locally' && ($data->status == 'completed' || $data->status == 'materials_received') && $data->remaining_amount >= 1.00 && (isset($data->paid_locally) && $data->paid_locally == null)) @endif @break @case('didnt_paid_locally') @if($data->final_payment_method == 'cash_locally' && ($data->status == 'completed' || $data->status == 'materials_received') && $data->remaining_amount >= 1.00 && (isset($data->paid_locally) && $data->paid_locally== null)) @endif @break @case('received') @if($data->notReceivedCheck() && auth()->user()->can('approve')) @endif @break @case('delete') @break @case('delete_payment') @if (($data->invoice_type == 'acknowledgment_receipt' && !$data->received) || $data->invoice_type != 'acknowledgment_receipt') @if (!in_array($data->invoice_type, ['deposit', 'withdraw', 'bank_deposit', 'bank_withdraw', 'cash_voucher', 'wire_transfer_voucher'])) @endif @endif @case('delete_house_cashier_payment') @if (request()->is('house_cashier_payment*') && $data->billingo_invoice_id == null && in_array($data->invoice_type, ['deposit', 'withdraw', 'bank_deposit', 'bank_withdraw'])) @if( (in_array($data->invoice_type, ['deposit', 'withdraw']) && auth()->user()->can('delete-house_cashier')) || (in_array($data->invoice_type, ['bank_deposit', 'bank_withdraw']) && auth()->user()->can('delete-bank_house_cashier'))) @endif @endif @break @case('edit') @break @case('supplier_contact_edit') @break @case('edit_payment') @if (($data->invoice_type == 'acknowledgment_receipt' && !$data->received) || $data->invoice_type != 'acknowledgment_receipt') @if ($data->billingo_invoice_id == null && !in_array($data->invoice_type, ['deposit', 'withdraw', 'bank_deposit', 'bank_withdraw', 'cash_voucher', 'wire_transfer_voucher'])) @endif @endif @case('edit_house_cashier_payment') @if (request()->is('house_cashier_payment*') && $data->billingo_invoice_id == null && in_array($data->invoice_type, ['deposit', 'withdraw', 'bank_deposit', 'bank_withdraw'])) @if( (in_array($data->invoice_type, ['deposit', 'withdraw']) && auth()->user()->can('edit-house_cashier')) || (in_array($data->invoice_type, ['bank_deposit', 'bank_withdraw']) && auth()->user()->can('edit-bank_house_cashier'))) @endif @endif {{-- @endif --}} @break @case('upload') @if( $status == 'organized' && date('Y-m-d', strtotime($data->end_date)) <= date('Y-m-d', strtotime(now())) ) @endif @break @case('file_delete') {{-- str_replace('App\Models\\', '', $data->target_type) --}} @if( App\Models\Document::types()[$data->type]['actions']['delete'] ) @endif @break @case('details') @break @case('supplier_offer') @break @case('supplier_order') @break @case('offer') @break @case('block') @break @case('offer_payment') @break @case('order') @break @case('survey') @break @case('work') @break @case('work_edit') @break @case('vehicle_workers_edit') @break @case('vehicle_work_workers_edit') @break @case('work_vehicles_edit') @break @case('work_vehicle_workers_edit') @break @case('select_client') @break @case('select_offer') @break @case('space')
@break @case('test_email') @if($data->method == 'email') @endif @break {{-- @case('create_supplier_contact') @break --}} @endswitch @endforeach