@php $hide_tax = ''; if( session()->get('business.enable_inline_tax') == 0){ $hide_tax = 'hide'; } $currency_precision = config('constants.currency_precision', 2); $quantity_precision = config('constants.quantity_precision', 2); @endphp
@if(session('business.enable_lot_number')) @endif @if(session('business.enable_product_expiry')) @endif @foreach($purchase->purchase_lines as $purchase_line) @if(session('business.enable_lot_number')) @endif @if(session('business.enable_product_expiry')) @endif @endforeach
# @lang( 'product.product_name' ) @lang( 'purchase.purchase_quantity' ) @lang( 'lang_v1.unit_cost_before_discount' ) @lang( 'lang_v1.discount_percent' ) @lang( 'purchase.unit_cost_before_tax' ) @lang( 'purchase.subtotal_before_tax' ) @lang( 'purchase.product_tax' ) @lang( 'purchase.net_cost' ) @lang( 'purchase.line_total' ) @lang( 'lang_v1.profit_margin' ) @lang( 'purchase.unit_selling_price') (@lang('product.inc_of_tax')) @lang('lang_v1.lot_number') @lang('product.mfg_date') / @lang('product.exp_date')
{{ $purchase_line->product->name }} ({{$purchase_line->variations->sub_sku}}) @if( $purchase_line->product->type == 'variable')
({{ $purchase_line->variations->product_variation->name}} : {{ $purchase_line->variations->name}}) @endif
{!! Form::hidden('purchases[' . $loop->index . '][product_id]', $purchase_line->product_id ); !!} {!! Form::hidden('purchases[' . $loop->index . '][variation_id]', $purchase_line->variation_id ); !!} {!! Form::hidden('purchases[' . $loop->index . '][purchase_line_id]', $purchase_line->id); !!} @php $check_decimal = 'false'; if($purchase_line->product->unit->allow_decimal == 0){ $check_decimal = 'true'; } @endphp {!! Form::text('purchases[' . $loop->index . '][quantity]', number_format($purchase_line->quantity, $quantity_precision, $currency_details->decimal_separator, $currency_details->thousand_separator), ['class' => 'form-control input-sm purchase_quantity input_number mousetrap', 'required', 'data-rule-abs_digit' => $check_decimal, 'data-msg-abs_digit' => __('lang_v1.decimal_value_not_allowed')]); !!} @if(!empty($purchase_line->sub_units_options))
@else {{ $purchase_line->product->unit->short_name }} @endif
{!! Form::text('purchases[' . $loop->index . '][pp_without_discount]', number_format($purchase_line->pp_without_discount/$purchase->exchange_rate, $currency_precision, $currency_details->decimal_separator, $currency_details->thousand_separator), ['class' => 'form-control input-sm purchase_unit_cost_without_discount input_number', 'required']); !!} {!! Form::text('purchases[' . $loop->index . '][discount_percent]', number_format($purchase_line->discount_percent, $currency_precision, $currency_details->decimal_separator, $currency_details->thousand_separator), ['class' => 'form-control input-sm inline_discounts input_number', 'required']); !!} % {!! Form::text('purchases[' . $loop->index . '][purchase_price]', number_format($purchase_line->purchase_price/$purchase->exchange_rate, $currency_precision, $currency_details->decimal_separator, $currency_details->thousand_separator), ['class' => 'form-control input-sm purchase_unit_cost input_number', 'required']); !!} {{number_format($purchase_line->quantity * $purchase_line->purchase_price/$purchase->exchange_rate, $currency_precision, $currency_details->decimal_separator, $currency_details->thousand_separator)}}
{{number_format($purchase_line->item_tax/$purchase->exchange_rate, $currency_precision, $currency_details->decimal_separator, $currency_details->thousand_separator)}} {!! Form::hidden('purchases[' . $loop->index . '][item_tax]', number_format($purchase_line->item_tax/$purchase->exchange_rate, $currency_precision, $currency_details->decimal_separator, $currency_details->thousand_separator), ['class' => 'purchase_product_unit_tax']); !!}
{!! Form::text('purchases[' . $loop->index . '][purchase_price_inc_tax]', number_format($purchase_line->purchase_price_inc_tax/$purchase->exchange_rate, $currency_precision, $currency_details->decimal_separator, $currency_details->thousand_separator), ['class' => 'form-control input-sm purchase_unit_cost_after_tax input_number', 'required']); !!} {{number_format($purchase_line->purchase_price_inc_tax * $purchase_line->quantity/$purchase->exchange_rate, $currency_precision, $currency_details->decimal_separator, $currency_details->thousand_separator)}} @php $pp = $purchase_line->purchase_price_inc_tax; $sp = $purchase_line->variations->sell_price_inc_tax; if(!empty($purchase_line->sub_unit->base_unit_multiplier)) { $sp = $sp * $purchase_line->sub_unit->base_unit_multiplier; } if($pp == 0){ $profit_percent = 100; } else { $profit_percent = (($sp - $pp) * 100 / $pp); } @endphp {!! Form::text('purchases[' . $loop->index . '][profit_percent]', number_format($profit_percent, $currency_precision, $currency_details->decimal_separator, $currency_details->thousand_separator), ['class' => 'form-control input-sm input_number profit_percent', 'required']); !!} @if(session('business.enable_editing_product_from_purchase')) {!! Form::text('purchases[' . $loop->index . '][default_sell_price]', number_format($sp, $currency_precision, $currency_details->decimal_separator, $currency_details->thousand_separator), ['class' => 'form-control input-sm input_number default_sell_price', 'required']); !!} @else {{number_format($sp, $currency_precision, $currency_details->decimal_separator, $currency_details->thousand_separator)}} @endif {!! Form::text('purchases[' . $loop->index . '][lot_number]', $purchase_line->lot_number, ['class' => 'form-control input-sm']); !!} @php $expiry_period_type = !empty($purchase_line->product->expiry_period_type) ? $purchase_line->product->expiry_period_type : 'month'; @endphp @if(!empty($expiry_period_type)) @if(session('business.expiry_type') == 'add_manufacturing') @php $hide_mfg = false; @endphp @else @php $hide_mfg = true; @endphp @endif @lang('product.mfg_date'): @php $mfg_date = null; $exp_date = null; if(!empty($purchase_line->mfg_date)){ $mfg_date = $purchase_line->mfg_date; } if(!empty($purchase_line->exp_date)){ $exp_date = $purchase_line->exp_date; } @endphp
{!! Form::text('purchases[' . $loop->index . '][mfg_date]', !empty($mfg_date) ? @format_date($mfg_date) : null, ['class' => 'form-control input-sm expiry_datepicker mfg_date', 'readonly']); !!}
@lang('product.exp_date'):
{!! Form::text('purchases[' . $loop->index . '][exp_date]', !empty($exp_date) ? @format_date($exp_date) : null, ['class' => 'form-control input-sm expiry_datepicker exp_date', 'readonly']); !!}
@else
@lang('product.not_applicable')
@endif