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

@lang('lang_v1.sell_return')

{!! Form::hidden('location_id', $sell->location->id, ['id' => 'location_id', 'data-receipt_printer_type' => $sell->location->receipt_printer_type ]); !!} {!! Form::open(['url' => action('SellReturnController@store'), 'method' => 'post', 'id' => 'sell_return_form' ]) !!} {!! Form::hidden('transaction_id', $sell->id); !!}

@lang('lang_v1.parent_sale')

@lang('sale.invoice_no'): {{ $sell->invoice_no }}
@lang('messages.date'): {{@format_date($sell->transaction_date)}}
@lang('contact.customer'): {{ $sell->contact->name }}
@lang('purchase.business_location'): {{ $sell->location->name }}
{!! Form::label('invoice_no', __('sale.invoice_no').':') !!} {!! Form::text('invoice_no', !empty($sell->return_parent->invoice_no) ? $sell->return_parent->invoice_no : null, ['class' => 'form-control']); !!}
{!! Form::label('transaction_date', __('messages.date') . ':*') !!}
@php $transaction_date = !empty($sell->return_parent->transaction_date) ? $sell->return_parent->transaction_date : 'now'; @endphp {!! Form::text('transaction_date', @format_date($transaction_date), ['class' => 'form-control', 'readonly', 'required']); !!}
@foreach($sell->sell_lines as $sell_line) @php $check_decimal = 'false'; if($sell_line->product->unit->allow_decimal == 0){ $check_decimal = 'true'; } $unit_name = $sell_line->product->unit->short_name; if(!empty($sell_line->sub_unit)) { $unit_name = $sell_line->sub_unit->short_name; if($sell_line->sub_unit->allow_decimal == 0){ $check_decimal = 'true'; } else { $check_decimal = 'false'; } } @endphp @endforeach
# @lang('product.product_name') @lang('sale.unit_price') @lang('lang_v1.sell_quantity') @lang('lang_v1.return_quantity') @lang('lang_v1.return_subtotal')
{{ $loop->iteration }} {{ $sell_line->product->name }} @if( $sell_line->product->type == 'variable') - {{ $sell_line->variations->product_variation->name}} - {{ $sell_line->variations->name}} @endif {{ $sell_line->unit_price_inc_tax }} {{ $sell_line->formatted_qty }} {{$unit_name}}
@php $discount_type = !empty($sell->return_parent->discount_type) ? $sell->return_parent->discount_type : $sell->discount_type; $discount_amount = !empty($sell->return_parent->discount_amount) ? $sell->return_parent->discount_amount : $sell->discount_amount; @endphp
{!! Form::label('discount_type', __( 'purchase.discount_type' ) . ':') !!} {!! Form::select('discount_type', [ '' => __('lang_v1.none'), 'fixed' => __( 'lang_v1.fixed' ), 'percentage' => __( 'lang_v1.percentage' )], $discount_type, ['class' => 'form-control']); !!}
{!! Form::label('discount_amount', __( 'purchase.discount_amount' ) . ':') !!} {!! Form::text('discount_amount', @num_format($discount_amount), ['class' => 'form-control input_number']); !!}
@php $tax_percent = 0; if(!empty($sell->tax)){ $tax_percent = $sell->tax->amount; } @endphp {!! Form::hidden('tax_id', $sell->tax_id); !!} {!! Form::hidden('tax_amount', 0, ['id' => 'tax_amount']); !!} {!! Form::hidden('tax_percent', $tax_percent, ['id' => 'tax_percent']); !!}
@lang('lang_v1.total_return_discount'):  (-)
@lang('lang_v1.total_return_tax') - @if(!empty($sell->tax))({{$sell->tax->name}} - {{$sell->tax->amount}}%)@endif :  (+)
@lang('lang_v1.return_total'):   0

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