@extends('layouts.app') @section('title', __('lang_v1.purchase_return')) @section('content')

@lang('lang_v1.purchase_return')

{!! Form::open(['url' => action([\App\Http\Controllers\PurchaseReturnController::class, 'store']), 'method' => 'post', 'id' => 'purchase_return_form' ]) !!} {!! Form::hidden('transaction_id', $purchase->id); !!} @component('components.widget', ['class' => 'box-primary', 'title' => __('lang_v1.parent_purchase')])
@lang('purchase.ref_no'): {{ $purchase->ref_no }}
@lang('messages.date'): {{@format_date($purchase->transaction_date)}}
@lang('purchase.supplier'): {{ $purchase->contact->name }}
@lang('purchase.business_location'): {{ $purchase->location->name }}
@endcomponent @component('components.widget', ['class' => 'box-primary'])
{!! Form::label('ref_no', __('purchase.ref_no').':') !!} {!! Form::text('ref_no', !empty($purchase->return_parent->ref_no) ? $purchase->return_parent->ref_no : null, ['class' => 'form-control']); !!}

@foreach($purchase->purchase_lines as $purchase_line) @php $unit_name = $purchase_line->product->unit->short_name; $check_decimal = 'false'; if($purchase_line->product->unit->allow_decimal == 0){ $check_decimal = 'true'; } if(!empty($purchase_line->sub_unit->base_unit_multiplier)) { $unit_name = $purchase_line->sub_unit->short_name; if($purchase_line->sub_unit->allow_decimal == 0){ $check_decimal = 'true'; } else { $check_decimal = 'false'; } } $qty_available = $purchase_line->quantity - $purchase_line->quantity_sold - $purchase_line->quantity_adjusted; @endphp @endforeach
# @lang('product.product_name') @lang('sale.unit_price') @lang('purchase.purchase_quantity') @lang('lang_v1.quantity_left') @lang('lang_v1.return_quantity') @lang('lang_v1.return_subtotal')
{{ $loop->iteration }} {{ $purchase_line->product->name }} @if( $purchase_line->product->type == 'variable') - {{ $purchase_line->variations->product_variation->name}} - {{ $purchase_line->variations->name}} @endif {{ $purchase_line->purchase_price_inc_tax }} {{ $purchase_line->quantity }} {{$unit_name}} {{ $qty_available }} {{$unit_name}} @php $check_decimal = 'false'; if($purchase_line->product->unit->allow_decimal == 0){ $check_decimal = 'true'; } @endphp product->enable_stock) data-rule-max-value="{{$qty_available}}" data-msg-max-value="@lang('validation.custom-messages.quantity_not_available', ['qty' => $purchase_line->formatted_qty_available, 'unit' => $unit_name ])" @endif >
@lang('lang_v1.total_return_tax'): @if(!empty($purchase->tax))({{$purchase->tax->name}} - {{$purchase->tax->amount}}%)@endif @php $tax_percent = 0; if(!empty($purchase->tax)){ $tax_percent = $purchase->tax->amount; } @endphp {!! Form::hidden('tax_id', $purchase->tax_id); !!} {!! Form::hidden('tax_amount', 0, ['id' => 'tax_amount']); !!} {!! Form::hidden('tax_percent', $tax_percent, ['id' => 'tax_percent']); !!}
@lang('lang_v1.return_total'):   0

@endcomponent {!! Form::close() !!}
@stop @section('javascript') @endsection