@if (!empty($item)) @php $class = 'badge-light-primary'; if ($item->status == 'Buyable') { $class = 'badge-light-success'; } elseif ($item->status == 'Not Buyable') { $class = 'badge-light-danger'; } elseif ($item->status == 'Disabled by Seller') { $class = 'badge-light-dark'; } elseif ($item->status == 'Disabled by Takealot') { $class = 'badge badge-warning'; } @endphp @php $remainingTotalDaysCover = 0; $deadCost = 0; $getPricesku = explode('-', $item->sku); $profitCheck = !empty($getPricesku) && !empty($getPricesku[0]) && is_numeric(trim($getPricesku[0])) ? $item->selling_price - (int) trim($getPricesku[0]) : 0; // $profitCheck=0; if (!empty($item->takealotOrders) && isset($item->takealotOrders)) { $sevenDays = \Carbon\Carbon::now()->subDays(7)->toDateString(); $seven = $item->takealotOrders->where('order_date', '>=', $sevenDays)->sum('quantity'); $fifteenDays = \Carbon\Carbon::now()->subDays(15)->toDateString(); $fifteen = $item->takealotOrders->where('order_date', '>=', $fifteenDays)->sum('quantity'); $thirtyDays = \Carbon\Carbon::now()->subDays(30)->toDateString(); $thirty = $item->takealotOrders->where('order_date', '>=', $thirtyDays)->sum('quantity'); $thirtyDayRemainingPieces = $thirty / 30; $totalReturned = $item->takealotOrders->where('sale_status', '=', 'Returned')->sum('quantity'); $thirtydaysCost = is_numeric($thirty) && is_numeric($getPricesku[0]) ? $thirty * $getPricesku[0] : $thirty; $thirtydaysCostReturned = $thirty - $totalReturned; $deadCost = !empty($thirtydaysCost) && !empty($thirtydaysCostReturned) ? $thirtydaysCost / $thirtydaysCostReturned : 0; //Stock Day cover takealot start $salesUnitCpt = $item->takealotOrders->where('dc', '=', 'CPT')->sum('quantity'); $salesUnitJhb = $item->takealotOrders->where('dc', '=', 'JHB')->sum('quantity'); } //Stock Day cover takealot end //stock on dc start // $totalStockDC=0; $stockAtTakealot = json_decode($item->stock_at_takealot); $stockAtTakealotCptName = !empty($stockAtTakealot[0]->warehouse->name) ? $stockAtTakealot[0]->warehouse->name : null; $stockAtTakealotCptQty = !empty($stockAtTakealot[0]->quantity_available) ? $stockAtTakealot[0]->quantity_available : 0; $stockAtTakealotJhbName = !empty($stockAtTakealot[1]->warehouse->name) ? $stockAtTakealot[1]->warehouse->name : null; $stockAtTakealotJhbQty = !empty($stockAtTakealot[1]->quantity_available) ? $stockAtTakealot[1]->quantity_available : 0; $totalStockOnDc = $stockAtTakealotCptQty + $stockAtTakealotJhbQty; // $totalStockDC=(!empty($stockAtTakealot[0]) && !empty($stockAtTakealot[1]) && !empty($stockAtTakealot[0]->quantity_available) && !empty($stockAtTakealot[1]->quantity_available)) ? $stockAtTakealot[0]->quantity_available+$stockAtTakealot[1]->quantity_available : 0; //stock on dc end //stock on takealot start // $totalStock=0; $stockOnWay = json_decode($item->stock_on_way); $stockOnWayCptName = !empty($stockOnWay[0]->warehouse->name) ? $stockOnWay[0]->warehouse->name : null; $stockOnWayCptQty = !empty($stockOnWay[0]->quantity_available) ? $stockOnWay[0]->quantity_available : 0; $stockOnWayJhbName = !empty($stockOnWay[1]->warehouse->name) ? $stockOnWay[1]->warehouse->name : null; $stockOnWayJhbQty = !empty($stockOnWay[1]->quantity_available) ? $stockOnWay[1]->quantity_available : 0; $stockOnWayTotal = $stockOnWayCptQty + $stockOnWayJhbQty; // $totalStock=(!empty($stockOnWay[0]) && !empty($stockOnWay[1]) && !empty($stockOnWay[0]->quantity_available) && !empty($stockOnWay[1]->quantity_available)) ? $stockOnWay[0]->quantity_available+$stockOnWay[1]->quantity_available : 0; //stock on takealot end $totalStockDcOnWay = $totalStockOnDc + $stockOnWayTotal; $remainingTotalDaysCover = !empty($totalStockDcOnWay) && $totalStockDcOnWay > 0 && (!empty($thirtyDayRemainingPieces) && $thirtyDayRemainingPieces > 0) ? $totalStockDcOnWay / $thirtyDayRemainingPieces : 0; @endphp
@if ($item->status == 'Buyable')
{{ !empty($item->rePricing->winner) && $item->rePricing->winner == 1 ? 'Winner' : 'Loser' }}
@endif
  • {{ $item->status }} @php $leadtime_decode = null; $leadtime_qty = null; $leadtime_decode = json_decode($item->leadtime_stock); $leadtime_qty = !empty($leadtime_decode[0]) && !empty($leadtime_decode[0]->quantity_available) ? $leadtime_decode[0]->quantity_available : 0; @endphp @if ($item->leadtime_days != null && !empty($leadtime_qty)) {{ 'My SOH :' }} {{ $leadtime_qty }} @endif @if ($item->stock_at_takealot_total > 0) {{ 'In Stock : ' }} {{ $item->stock_at_takealot_total }} @endif @if ($item->stock_at_takealot_total <= 0 && $item->leadtime_days == null) Out Of Stock @endif @if (!empty($item->rePricing->min_price) && $item->rePricing->min_price == $item->selling_price) Min price reached @endif @if (!empty($item->rePricing->max_price) && $item->rePricing->max_price == $item->selling_price) Max price reached @endif
  • @if (!empty($item->takealotOfferDetails->star_rating))
  • ({{ $item->takealotOfferDetails->star_rating }})
  • @endif @if ($item->other_status == 0)
  • @else @if ($item->other_status == 1)
  • @endif @if ($item->other_status == 2)
  • @endif @if ($item->other_status == 3)
  • @endif @endif
@if (!empty($editSkuItem) && decrypt($editSkuItem) == $item->id)
@else @endif Dead Cost: {{ !empty($deadCost) && isset($deadCost) ? round($deadCost) : 0 }}
@php // dd($item->rePricing->winning_price); @endphp
@if (!empty($item->rePricing))
Price Range:R{{ $item->rePricing->min_price }} - R{{ $item->rePricing->max_price }}
@endif
Your Price:R{{ $item->selling_price }}
Wining Price:{{ !empty($item->rePricing->winning_price) ? 'R' . $item->rePricing->winning_price : 'N/A' }}
Sellers:{{ !empty($item->takealotOfferDetails->total_sellers) ? $item->takealotOfferDetails->total_sellers : 0 }}
@if (!empty($item->rePricing->winner_account_name))
Winner:{{ $item->rePricing->winner_account_name }}
@endif @if ( !empty($item->rePricing->stock_status) && $item->takealotShops->takealot_account_name != $item->rePricing->winner_account_name)
Winner Stock:{{ $item->rePricing->stock_status == 'Ship 5 to 7 work Days' ? 'Leadtime' : $item->rePricing->stock_status }}
@endif @if (Auth::user()->id == 1)
Re-Checked At:{{ !empty($item->rePricing->updated_at) ? timeAgo($item->rePricing->updated_at) : 'N/A' }}
@endif @if (Auth::user()->id == 1)
Re-Price At:{{ !empty($item->rePricing->price_updated_at) ? timeAgo($item->rePricing->price_updated_at) : 'N/A' }}
@endif @if (!empty($item->rePricing->id)) @endif
R{{ $item->selling_price }}
{{ $item->title }} By {{ !empty($item->takealotOfferDetails->takealotBrands) ? $item->takealotOfferDetails->takealotBrands->name : 'None' }}
Day Cover:{{ round($remainingTotalDaysCover) }}
Current Selling Price:{{ $item->selling_price }}
Cost:{{ !empty($getPricesku) && !empty($getPricesku[0]) ? $getPricesku[0] : null }}
Profit:{{ !empty($getPricesku) && !empty($getPricesku[0]) && is_numeric($getPricesku[0]) ? $item->selling_price - (int) trim($getPricesku[0]) : null }}
Sales / Stock
{{--
--}} {{--
--}}
Stock on the Way
{{ !empty($stockOnWayJhbName) ? $stockOnWayJhbName . ':' . $stockOnWayJhbQty : 'JHB:0' }}{{ !empty($stockOnWayCptName) ? $stockOnWayCptName . ':' . $stockOnWayCptQty : 'CPT:0' }}
Unit Sold 30 Days
{{ !empty($salesUnitJhb) ? 'JHB:' . $salesUnitJhb : 'JHB:0' }}{{ !empty($salesUnitCpt) ? 'CPT:' . $salesUnitCpt : 'CPT:0' }}
@php //get sales % $percentageJhb = !empty($salesUnitCpt && $salesUnitCpt > 0) && (!empty($salesUnitJhb) && $salesUnitJhb > 0) ? ($salesUnitJhb / ($salesUnitJhb + $salesUnitCpt)) * 100 : (!empty($salesUnitJhb) && $salesUnitJhb > 0 ? 100 : 0); $percentageCpt = !empty($salesUnitCpt) && $salesUnitCpt > 0 && (!empty($salesUnitJhb) && $salesUnitJhb > 0) ? ($salesUnitCpt / ($salesUnitCpt + $salesUnitJhb)) * 100 : (!empty($salesUnitCpt) && $salesUnitCpt > 0 ? 100 : 0); @endphp
Sales % 30 Days
JHB {{ !empty($percentageJhb) ? round($percentageJhb) : 0 }}% CPT {{ !empty($percentageCpt) ? round($percentageCpt) : 0 }}%
@php $sevenDays = \Carbon\Carbon::today()->subDays(7); $totalSales = $item->takealotOrders->where('order_date', '>=', $sevenDays)->sum('quantity'); @endphp
7 Days Sales * 2
Units: {{ $totalSales * 2 }}
Total Sales
Last 7 Days Sale : {{ $seven }}
Last 15 Days Sale : {{ $fifteen }}
Last 30 Days Sale : {{ $thirty }}
30 Days Returned : {{ $totalReturned }}
@php //stock on takealot start // $totalStock=0; $stockAtTakealot = json_decode($item->stock_at_takealot); $stockAtTakealotCptName = !empty($stockAtTakealot[0]->warehouse->name) ? $stockAtTakealot[0]->warehouse->name : null; $stockAtTakealotCptQty = !empty($stockAtTakealot[0]->quantity_available) ? $stockAtTakealot[0]->quantity_available : 0; $stockAtTakealotJhbName = !empty($stockAtTakealot[1]->warehouse->name) ? $stockAtTakealot[1]->warehouse->name : null; $stockAtTakealotJhbQty = !empty($stockAtTakealot[1]->quantity_available) ? $stockAtTakealot[1]->quantity_available : 0; // $totalStock=(!empty($stockAtTakealot[0]) && !empty($stockAtTakealot[1]) && !empty($stockAtTakealot[0]->quantity_available) && !empty($stockAtTakealot[1]->quantity_available)) ? $stockAtTakealot[0]->quantity_available+$stockAtTakealot[1]->quantity_available : 0; //stock on takealot end @endphp @php //Stock Day cover takealot start $stockCover = json_decode($item->stock_cover); $stockCoverCptName = !empty($stockCover[0]->warehouse_id) && $stockCover[0]->warehouse_id == 1 ? 'CPT' : null; $stockCoverCptDays = !empty($stockCover[0]->stock_cover_days) ? $stockCover[0]->stock_cover_days : 0; $stockCoverJhbName = !empty($stockCover[1]->warehouse_id) && $stockCover[1]->warehouse_id == 3 ? 'JHB' : null; $stockCoverJhbDays = !empty($stockCover[1]->stock_cover_days) ? $stockCover[1]->stock_cover_days : 0; //Stock Day cover takealot end @endphp
Stock on DC
{{ !empty($stockAtTakealotJhbName) ? $stockAtTakealotJhbName . ':' . $stockAtTakealotJhbQty : 'JHB:0' }}{{ !empty($stockAtTakealotCptName) ? $stockAtTakealotCptName . ':' . $stockAtTakealotCptQty : 'CPT:0' }}
Stock Day cover
{{ !empty($stockCoverJhbName) ? $stockCoverJhbName . ':' . $stockCoverJhbDays : 'JHB:0' }}{{ !empty($stockCoverCptName) ? $stockCoverCptName . ':' . $stockCoverCptDays : 'CPT:0' }}
@php //Stock Day cover takealot start $stockCover = json_decode($item->stock_cover); $stockCoverCptName = !empty($stockCover[0]->warehouse_id) && $stockCover[0]->warehouse_id == 1 ? 'CPT' : null; $stockCoverCptDays = !empty($stockCover[0]->stock_cover_days) ? $stockCover[0]->stock_cover_days : 0; $stockCoverJhbName = !empty($stockCover[1]->warehouse_id) && $stockCover[1]->warehouse_id == 3 ? 'JHB' : null; $stockCoverJhbDays = !empty($stockCover[1]->stock_cover_days) ? $stockCover[1]->stock_cover_days : 0; //Stock Day cover takealot end @endphp
@php $percentageJhb = round($percentageJhb); //53% $percentageCpt = round($percentageCpt); //47% $totalSendUnit = $totalSales * 2; //492 $sendJhb = $totalSendUnit * ($percentageJhb / 100) - ($stockOnWayJhbQty + $stockAtTakealotJhbQty); $sendCpt = $totalSendUnit * ($percentageCpt / 100) - ($stockOnWayCptQty + $stockAtTakealotCptQty); $sendNewTotal = $sendJhb + $sendCpt; @endphp Send Stock
JHB: {{ !empty($sendJhb) ? round($sendJhb) : 0 }}CPT: {{ !empty($sendCpt) ? round($sendCpt) : 0 }}
Total: {{ round($sendNewTotal) }}
{{--
--}} {{--
--}}
@endif