@extends('admin.layout.master') @section('title',__('accounts.voucher_management')) @section('custom_style') @endsection @section ('content') @php $cashSl=1000; $discountSl=2000; $isBankOrCash=in_array($voucher_type['type'],[2,4])?1:0; $isPaymentOrReceipt=in_array($voucher_type['type'],[3,4])?1:0; //check receipt $parentId=intval($isBankOrCash?getInitDataWithKeyWord('bank')->group_id:getInitDataWithKeyWord('cash')->group_id); if(request()->route()->getName() == 'voucher.voucher_edit'){ // edit $routes = [ 1 => 'voucher.cash_payment_voucher', 2 => 'voucher.bank_payment_voucher', 3 => 'voucher.cash_receive_voucher', 4 => 'voucher.bank_receive_voucher', 5 => 'voucher.journal_voucher', ]; $route = array_key_exists($voucher_type['type'], $routes) ? $routes[$voucher_type['type']] : 'none'; } else{ // create $route = request()->route()->getName(); } $form_settings = collect(productSettings($route)->form_object ?? []); @endphp