@php $hide_tax = ''; if( session()->get('business.enable_inline_tax') == 0){ $hide_tax = 'hide'; } $currency_precision = session('business.currency_precision', 2); $quantity_precision = session('business.quantity_precision', 2); @endphp
| # | @lang( 'product.product_name' ) | @if(empty($is_purchase_order)) @lang( 'purchase.purchase_quantity' ) @else @lang( 'lang_v1.order_quantity' ) @endif | @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' ) | @if(empty($is_purchase_order))@lang( 'purchase.unit_selling_price') (@lang('product.inc_of_tax')) | @if(session('business.enable_lot_number'))@lang('lang_v1.lot_number') | @lang('lang_v1.batch_manufacturer') | @endif @if(session('business.enable_product_expiry'))@lang('product.mfg_date') / @lang('product.exp_date') | @endif @endif @if(session('business.enable_damage_loss_tracking'))@lang('purchase.damage_loss') | @endif|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
{{ $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 |
@if(!empty($purchase_line->purchase_order_line_id) && !empty($common_settings['enable_purchase_order']))
{!! Form::hidden('purchases[' . $loop->index . '][purchase_order_line_id]', $purchase_line->purchase_order_line_id ); !!}
@endif
@if(!empty($purchase_line->purchase_requisition_line_id) && !empty($common_settings['enable_purchase_requisition']))
{!! Form::hidden('purchases[' . $loop->index . '][purchase_requisition_line_id]', $purchase_line->purchase_requisition_line_id ); !!}
@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';
}
$max_quantity = 0;
$max_quantity_base = 0;
// This line's own quantity/quantity_damaged/quantity_lost
// were already divided by its saved unit's multiplier for
// display (changePurchaseLineUnit()), but the related PO
// line's fields are always raw base-unit - convert this
// line's figures back to base units before combining them,
// to avoid mixing units in the same subtraction.
$_multiplier = (!empty($purchase_line->sub_unit_id) && !empty($purchase_line->sub_unit))
? ($purchase_line->sub_unit->base_unit_multiplier ?: 1)
: 1;
if(!empty($purchase_line->purchase_order_line_id) && !empty($common_settings['enable_purchase_order'])){
$max_quantity_base = $purchase_line->purchase_order_line->quantity
- $purchase_line->purchase_order_line->po_quantity_purchased
- $purchase_line->purchase_order_line->po_quantity_damaged
- $purchase_line->purchase_order_line->po_quantity_lost
+ ($purchase_line->quantity * $_multiplier)
+ ($purchase_line->quantity_damaged * $_multiplier)
+ ($purchase_line->quantity_lost * $_multiplier);
$max_quantity = $max_quantity_base / $_multiplier;
}
@endphp
@if(!empty($purchase_line->sub_units_options))
@else {{ $purchase_line->product->unit->short_name }} @endif @if(!empty($purchase_line->product->second_unit)) @lang('lang_v1.quantity_in_second_unit', ['unit' => $purchase_line->product->second_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)}} | @if(empty($is_purchase_order))@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 | @if(session('business.enable_lot_number')){!! Form::text('purchases[' . $loop->index . '][lot_number]', $purchase_line->lot_number, ['class' => 'form-control input-sm']); !!} | @php // Editing an existing batch: keep whatever manufacturer it was // received against, falling back to the product's primary. $row_manufacturers = $purchase_line->product ? $purchase_line->product->selectableManufacturers() : collect(); $batch_manufacturer_id = $purchase_line->manufacturer_id ?: ($purchase_line->product->manufacturer_id ?? null); @endphp
@if($row_manufacturers->isNotEmpty())
{!! Form::select('purchases[' . $loop->index . '][manufacturer_id]', $row_manufacturers, $batch_manufacturer_id, ['class' => 'form-control input-sm', 'placeholder' => __('messages.please_select')]); !!}
@else
@lang('product.not_applicable')
@endif
|
@endif
@if(session('business.enable_product_expiry'))
@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
@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
|
@endif
@endif
@if(session('business.enable_damage_loss_tracking'))
@php
$damage_loss_badge_parts = [];
if (!empty($purchase_line->quantity_damaged)) {
$damage_loss_badge_parts[] = number_format($purchase_line->quantity_damaged, session('business.quantity_precision', 2), session('currency')['decimal_separator'], session('currency')['thousand_separator']) . ' ' . __('purchase.quantity_damaged');
}
if (!empty($purchase_line->quantity_lost)) {
$damage_loss_badge_parts[] = number_format($purchase_line->quantity_lost, session('business.quantity_precision', 2), session('currency')['decimal_separator'], session('currency')['thousand_separator']) . ' ' . __('purchase.quantity_lost');
}
@endphp
{{ implode(', ', $damage_loss_badge_parts) }} {!! Form::hidden('purchases[' . $loop->index . '][quantity_damaged]', @format_quantity($purchase_line->quantity_damaged), ['class' => 'damage_loss_qty_damaged']); !!} {!! Form::hidden('purchases[' . $loop->index . '][quantity_lost]', @format_quantity($purchase_line->quantity_lost), ['class' => 'damage_loss_qty_lost']); !!} {!! Form::hidden('purchases[' . $loop->index . '][damage_loss_reason]', $purchase_line->damage_loss_reason, ['class' => 'damage_loss_reason_hidden']); !!} {!! Form::hidden('purchases[' . $loop->index . '][damage_loss_note]', $purchase_line->damage_loss_note, ['class' => 'damage_loss_note_hidden']); !!} {!! Form::hidden('purchases[' . $loop->index . '][usable_qty]', 0, ['class' => 'damage_loss_usable_qty']); !!} |
@endif