@extends('layouts/fams_layout') @section('title', '| Sales') @section('content')
@if (session('saleUpdate'))
× Info! {{ session('saleUpdate') }}
@endif @if (session('saleDelete'))
× Info! {{ session('saleDelete') }}
@endif

SALES LIST

@foreach($sales as $sale) @php $productName = DB::table('fams_product')->where('id',$sale->productId)->value('name'); $productCode = DB::table('fams_product')->where('id',$sale->productId)->value('productCode'); $productTotalCost = (float) $sale->productTotalCost + (float) $sale->productAdditionalCharge; @endphp @endforeach
SL# Sales Date Sales ID Product Name Product ID Cost Price Accumulated Dep. Sale Amount
Profit & Loss
Profit Loss
Action
{{++$no}} {{(date('d-m-Y', strtotime($sale->createdDate)))}} {{$sale->saleId}}{{$productName}} {{$prefix.$productCode}} {{$productTotalCost}} {{$sale->depGenerated}} {{$sale->amount}} {{$sale->profitAmount}} {{$sale->lossAmount}} @php $saleDate = date('d-m-Y', strtotime($sale->createdDate)); $accDep = DB::table('fams_depreciation_details')->where('productId',$sale->productId)->sum('amount'); $branchName = DB::table('gnr_branch')->where('id',$sale->branchId)->value('name'); $saleByBranchName = DB::table('gnr_branch')->where('id',$sale->saleByBranchId)->value('name'); @endphp    
{{-- View Modal --}} {{-- End View Modal --}} {{-- Edit Modal --}} {{-- End Edit Modal --}} {{-- Delete Modal --}} {{-- End Delete Modal --}} @include('dataTableScript') @endsection