@extends('layouts.admin', ['title' => 'گزارش موجودی آپشن کالاهای انبار']) @section('content')

گزارش موجودی آپشن کالای انبار {{ $store_id == 0 ? ' - همه انبارها' : '' }} بازگشت


@if(count($data_hashs)==0) @else @php $rowIndex = 0; @endphp @foreach($data_hashs as $data_hashs_item) @php $data_options = \App\Models\StoreDataItem::where('ids_hash', $data_hashs_item->ids_hash)->where('product_id', $pid)->first(); $rowIndex++;; $number = 0; $price = 0; $data_calc =null; if($store_id== 0) $data_calc = \App\Models\StoreDataItem::where('withraw_parent_id', null)->where('product_id', $pid)->where('ids_hash', $data_hashs_item->ids_hash)->get(); else $data_calc = \App\Models\StoreDataItem::where('withraw_parent_id', null)->whereIn('store_data_id', \App\Models\StoreData::where('store_id', $store_id)->get()->pluck('id'))->where('product_id', $pid)->where('ids_hash', $data_hashs_item->ids_hash)->get(); foreach($data_calc as $data_calc_item) { $number_once = $data_calc_item->number - \App\Models\StoreDataItem::where('withraw_parent_id', $data_calc_item->id )->whereIn('status_id', [1, 3])->sum('number'); $amountUU = $data_calc_item->price; foreach($data_calc_item->Options()->get() as $storeDataItem_item_option) { $amountUU += $storeDataItem_item_option->price; } $price += $number_once * $amountUU ; $number += $number_once; } echo $price; //$number = ($item->number - \App\Models\StoreDataItem::where('withraw_parent_id', $item->store_data_item_id // )->whereIn('status_id', [1, 3])->sum('number') ); @endphp @if($number!=0) @endif @endforeach
ردیف کالا قیمت واحد (تومان) موجودی جمع کل (تومان)
{{ $rowIndex }} {{ $data_options->Product->title }} @foreach($data_options->Options as $item2) | {{ $item2->ProductsOption->group }}: {{ $item2->ProductsOption->title }} @endforeach @foreach($obj->getUnitPriceAndNumberWithOptionHash($store_id,$pid, $data_options->ids_hash) as $itemPrice => $itemNum) @if($itemNum!=0) {{ number_format($itemPrice , 0, '', ',') }}
@endif @endforeach
@foreach($obj->getUnitPriceAndNumberWithOptionHash($store_id,$pid, $data_options->ids_hash) as $key => $itemNum) @if($itemNum!=0) {{ $itemNum }}
@endif @endforeach
{{ number_format($price , 0, '', ',') }}
@endif
@stop