@php $data_information = $resell_marketplace->item()->whereNull('parent_id')->get()->map(function($row) { return [ 'total_buying_price' => json_decode($row->total_data_information, true)['total_buying_price'], 'total_selling_price' => $row->total_selling_price, ]; })->pipe(function($row) { return collect([ 'grandtotal_buying_price' => $row->sum('total_buying_price'), 'grandtotal_selling_price' => $row->sum('total_selling_price'), ]); }); @endphp
Price Difference
Rp. {{ number_format($data_information['grandtotal_selling_price'] - $data_information['grandtotal_buying_price']) }}
Adjustable Difference
Rp. {{ number_format($data_information['grandtotal_selling_price'] - $data_information['grandtotal_buying_price']) }}
Cost Added
@php if($resell_marketplace->cost_all) { $cost_data = json_decode($resell_marketplace->cost_all, true); $first_row = $cost_data[0]; } @endphp @if($resell_marketplace->cost_all)
@foreach($cost_data as $no => $row) @if($no > 0)
@if($resell_marketplace->status != 'completed')
@endif
@endif @endforeach
@else
@endif
@if($resell_marketplace->status != 'completed')
@endif