@extends('layouts.order-master') @section('css') @endsection @section('title') Order @endsection @section('content')
@isset($order)
@method('put') @else @endisset @csrf
@isset($order) Edit Order @else Add Order @endisset
@if ($nextOrderId != null) Next @endif @if ($previousOrderId != null) Previous @endif
{{-- --}}
{{--
--}} {{--
--}}
Report
Price Slab Unit Price (Inc Tax)
Purchase
Price(Excl Tax)
Purchase
Price(Incl Tax)
Gst (%) Cess (%)
Add Items
@if (Auth::user()->company_profile->show_item_code_in_sales) @endif @if (Auth::user()->company_profile->discount_on_total == 1) @endif @if (Auth::user()->company_profile->show_item_description) @endif @php $tabIndex = 0; $i = 0; @endphp @isset($orderItems) @if (count($orderItems) > 0) @foreach ($orderItems as $key => $orderItem) @php $key = $key + 1; @endphp @if (Auth::user()->company_profile->show_item_code_in_sales) @endif @if (Auth::user()->company_profile->discount_on_total == 1) @php $i = 1; $total = $orderItem->price_inc_tax * $orderItem->quantity; $totalDiscount = round( ($orderItem->disc_percentage * $total) / 100, 3, ); @endphp @endif @if (Auth::user()->company_profile->show_item_description) @endif @php $tabIndex = $tabIndex + 5 + $i; @endphp @endforeach @endif @endisset @if (Auth::user()->company_profile->show_item_code_in_sales) @endif @if (Auth::user()->company_profile->discount_on_total == 1) @endif
#Item CodeItem MRP Qty Unit Price Price(Inc GST) Gross ValueDisc AmtDisc% Taxable Value Tax TotalDescriptionRemarks
{{ $key }}
{{-- @if (($orderItem->stock_availability != null && $orderItem->stock_availability != 0) || $orderItem->status_remarks != null) --}} {{-- @if ($orderItem->stock_availability == 'NS') --}} {{-- Stock Availability : {{ $orderItem->stock_availability }} @else --}} @if ($orderItem->stock_availability != null && $orderItem->stock_availability != 0) Stock Shortage : {{ $orderItem->stock_availability }}
@endif @if ($orderItem->status_remarks != null) Stock Remarks : {{ $orderItem->status_remarks }}

@endif {{-- @endif --}} {{-- @endif --}} @php $stockledger = \App\Models\StockLedger::select( 'stock_item_id', DB::raw('SUM(inwards) as total_inwards'), DB::raw('SUM(outwards) as total_outwards'), )->where( 'stock_item_id', $orderItem->stock_item_id, ); $stockledger = $stockledger->where( 'stock_location_id', $order->stock_location_id, ); $stockledger = $stockledger ->groupBy('stock_item_id') ->first(); $inwards = 0; $outwards = 0; if ($stockledger) { $inwards = $stockledger->total_inwards; $outwards = $stockledger->total_outwards; } $stock_availability = $inwards - $outwards; $order_base_qty = \App\Models\OrderItem::select( DB::raw('SUM(base_qty) as base_qty'), ) ->where( 'stock_item_id', $orderItem->stock_item_id, ) ->groupBy('stock_item_id') ->whereHas('order', function ($q) use ( $order, ) { $q->where( 'business_key', Auth::user()->business_key, ) ->where( 'order_code', '<', $order->order_code, ) ->where( 'status', '!=', 'Cancelled', ) ->whereNull( 'accounting_voucher_id', ); }) ->first()->base_qty ?? 0; $stock_availability = $stock_availability - $order_base_qty; @endphp @if ($stock_availability < 0) Available Stock:{{ $stock_availability }} @endif
0 {{ isset($orderItems) ? $orderItems->sum('total') : '0.00' }}
Discount :
Freight/Etc :
Round Off :
{{ isset($order) ? $order->round_off : '0.00' }}
Grand Total :
{{ isset($order) ? $order->amount : '0.00' }}
@if (Auth::user()->company_profile->show_previous_price_history == 1)
@if (Auth::user()->company_profile->save_and_print == 0) @endif @if (Auth::user()->company_profile->save_and_print == 1) @endif
Voucher Date Voucher no Qty UnitPrice Price(Inc GST) Dis %Dis AmtLanding Cost(Inc)Total Batch
@endif
@if (Auth::user()->company_profile->save_and_print == 1) @endif
* Stock is based on the base unit of the item
{{-- variant search modal --}} {{-- Price History Modal --}} {{-- Print Modal --}}
@endsection @section('script') @endsection