@extends('layout.app')
@section('title', 'Edit Purchase Voucher')
@push('header_script')
@endpush
@section('content')
{!! Form::open([
'route' => ['purchase-voucher.update', $purchaseVoucher->id],
'onsubmit' => 'BtnSubmit.disabled = true',
'class' => 'needs-validation',
'method' => 'put',
'autocomplete' => 'off',
'files' => true,
]) !!}
{{-- ========================================
SECTION 1: VOUCHER DETAILS
======================================== --}}
{{-- ========================================
PARTY DETAILS CARD
======================================== --}}
{{ $partyDetails ? $partyDetails->party_name : '-' }}
{{ $partyDetails ? $partyDetails->gst_no : '-' }}
{{ $partyDetails ? $partyDetails->mobile_no : '-' }}
{{ $partyDetails ? $partyDetails->address : '-' }}
{{ $partyDetails ? ($partyDetails->city->city_name ?? '') . ' / ' . ($partyDetails->state->state_name ?? '') : '-' }}
{{ $partyDetails ? $partyDetails->register_type : '-' }}
-
{{-- ========================================
INFORMATION PANEL CARD
======================================== --}}
{!! Form::select(
'party_account_ledger_id',
['' => '--Select--'] + $partyLedger,
$purchaseVoucher->party_account_ledger_id,
['class' => 'form-control select2', 'id' => 'party_account_ledger_id', 'required'],
) !!}
Balance:
{{ $errors->first('party_account_ledger_id') }}
@php
$is_party_cash_bank = 'no';
if (
$partyDetails?->accountLedger?->accountGroup?->a_group_name == 'Cash In Hand' ||
$partyDetails?->accountLedger?->accountGroup?->a_group_name == 'Bank Accounts'
) {
$is_party_cash_bank = 'yes';
}
@endphp
@if ($purchaseVoucher->doc)
View Doc
@endif
{{ $errors->first('doc') }}
{{-- ========================================
SECTION 3: SELECTED ITEM DETAILS
======================================== --}}
| Name of Item * |
Qty * |
Unit * |
Rate/Unit * |
Amount * |
Tax Rate (%) |
Tax Amount |
Total Amount * |
|
@php $i = 10; @endphp
@foreach ($purchaseVoucher->voucherDetails as $details)
|
{!! Form::select('product_id[]', ['' => '--Select--'] + $product, $details->product_id, [
'class' => 'form-control select2',
'id' => "product_id_$i",
'required',
]) !!}
|
|
|
|
|
@php
$isGstApplicable = ($details->product && $details->product->gst_applicable == 'yes') ? true : false;
$selectAttributes = [
'class' => 'form-control select2 taxGroupIds',
'id' => 'tax_group_id_' . $i,
'required'
];
if (!$isGstApplicable) {
$selectAttributes['disabled'] = 'disabled';
}
@endphp
{!! Form::select('tax_group_id[]', ['' => '--Select--'] + $taxGroup, $details->tax_group_id, $selectAttributes) !!}
|
|
|
@if (!$loop->first)
@endif
|
@php $i++; @endphp
@endforeach
| Total Amount |
|
|
|
|
|
{{-- Calculation Section --}}
{{ $errors->first('remark') }}
{!! Form::close() !!}
@include('common.modal.common_party')
@include('common.modal.product')
@endsection
@push('footer_script')
{{-- Party modal --}}
{{-- - product modal ---------- --}}
@endpush