@extends('layouts.app') @section('title', __('sale.edit_sale')) @section('content')

@lang('sale.edit_sale') (@lang('sale.invoice_no'): #{{$transaction->invoice_no}})

{!! Form::open(['url' => action('SellPosController@update', ['id' => $transaction->id ]), 'method' => 'put', 'id' => 'edit_sell_form' ]) !!} {!! Form::hidden('location_id', $transaction->location_id, ['id' => 'location_id', 'data-receipt_printer_type' => !empty($location_printer_type) ? $location_printer_type : 'browser']); !!}
{!! Form::label('contact_id', __('contact.customer') . ':*') !!}
{!! Form::select('contact_id', [], null, ['class' => 'form-control mousetrap', 'id' => 'customer_id', 'placeholder' => 'Enter Customer name / phone', 'required']); !!}
@if(!empty($commission_agent))
{!! Form::label('commission_agent', __('lang_v1.commission_agent') . ':') !!} {!! Form::select('commission_agent', $commission_agent, $transaction->commission_agent, ['class' => 'form-control select2']); !!}
@endif
{!! Form::label('transaction_date', __('sale.sale_date') . ':*') !!}
{!! Form::text('transaction_date', @format_date($transaction->transaction_date), ['class' => 'form-control', 'readonly', 'required']); !!}
@php if($transaction->status == 'draft' && $transaction->is_quotation == 1){ $status = 'quotation'; } else { $status = $transaction->status; } @endphp
{!! Form::label('status', __('sale.status') . ':*') !!} {!! Form::select('status', ['final' => __('sale.final'), 'draft' => __('sale.draft'), 'quotation' => __('lang_v1.quotation')], $status, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select'), 'required']); !!}
{!! Form::text('search_product', null, ['class' => 'form-control mousetrap', 'id' => 'search_product', 'placeholder' => __('lang_v1.search_product_placeholder'), 'autofocus' => true, ]); !!}
@php $hide_tax = ''; if( session()->get('business.enable_inline_tax') == 0){ $hide_tax = 'hide'; } @endphp
@foreach($sell_details as $sell_line) @include('sale_pos.product_row', ['product' => $sell_line, 'row_count' => $loop->index, 'tax_dropdown' => $taxes]) @endforeach
@lang('sale.product') @lang('sale.qty') @lang('sale.unit_price') @lang('sale.tax') @lang('sale.price_inc_tax') @lang('sale.subtotal')
@lang('sale.total'): 0
{!! Form::label('discount_type', __('sale.discount_type') . ':*' ) !!}
{!! Form::select('discount_type', ['fixed' => __('lang_v1.fixed'), 'percentage' => __('lang_v1.percentage')], $transaction->discount_type , ['class' => 'form-control','placeholder' => __('messages.please_select'), 'required', 'data-default' => 'percentage']); !!}
{!! Form::label('discount_amount', __('sale.discount_amount') . ':*' ) !!}
{!! Form::text('discount_amount', @num_format($transaction->discount_amount), ['class' => 'form-control input_number', 'data-default' => $business_details->default_sales_discount]); !!}

@lang( 'sale.discount_amount' ):(-) 0
{!! Form::label('tax_rate_id', __('sale.order_tax') . ':*' ) !!}
{!! Form::select('tax_rate_id', $taxes['tax_rates'], $transaction->tax_id, ['placeholder' => __('messages.please_select'), 'class' => 'form-control', 'data-default'=> $business_details->default_sales_tax], $taxes['attributes']); !!}
@lang( 'sale.order_tax' ):(+) {{$transaction->tax_amount}}
@lang('sale.total_payable'): 0
{!! Form::label('sell_note',__('sale.sell_note') . ':') !!} {!! Form::textarea('sale_note', $transaction->additional_notes, ['class' => 'form-control', 'rows' => 3]); !!}
{!! Form::close() !!}
@stop @section('javascript') @endsection