@extends('layouts.master') @section('css') @endsection @section('title') Contra @endsection @section('content') @isset($accountingVoucher) @method('put') @else @endisset @csrf @isset($accountingVoucher) Edit Contra @else Add Contra @endisset @if (auth()->user()->staff == null) Branch Select branch @foreach ($branches as $branch) branch_id == $branch->id ? 'selected' : '') : ($branch->name == 'Main Branch' ? 'selected' : '') }}> {{ $branch->name }} @endforeach @endif Voucher Number @isset($accountingVoucher) @if (str_contains($accountingVoucher->voucher_number, '-')) @php $explode = explode('-', $accountingVoucher->voucher_number); $voucherNumber = end($explode); $prefix = array_pop($explode); $prefix = implode('-', $explode); @endphp {{ $prefix }} @else @endif @else @if ($voucherType->prefix != null) {{ $voucherType->prefix }} @else @endif @endisset Voucher Type @isset($accountingVoucher) {{ $accountingVoucher->voucherType->name }} @endisset Voucher Date Cost Center Select Cost Center @foreach ($costCenters as $costCenter) cost_center_id == $costCenter->id ? 'selected' : '') : '' }}> {{ $costCenter->name }} @endforeach Remarks {{ isset($accountingVoucher) ? $accountingVoucher->remarks : '' }} Sl No Particulars Debit Credit Action @isset($accountingVoucher) @foreach ($accountingVoucher->accountingVoucherLedgers as $key => $accountingVoucherLedger) {{ $key + 1 }} dr_or_cr == 'Dr' ? 'selected' : '' }}> By dr_or_cr == 'Cr' ? 'selected' : '' }}> To Select Ledger Account {{ $accountingVoucherLedger->ledger->name }} dr_or_cr == 'Cr' ? 'disabled' : '' }}> dr_or_cr == 'Dr' ? 'disabled' : '' }} > @endforeach @endisset Total {{ isset($accountingVoucher) ? $accountingVoucher->accountingVoucherLedgers->where('dr_or_cr', 'Dr')->sum('amount') : 0.0 }} {{ isset($accountingVoucher) ? $accountingVoucher->accountingVoucherLedgers->where('dr_or_cr', 'Cr')->sum('amount') : 0.0 }} Add Submit @endsection @section('script') @endsection