{{ __('Bill Abstract') }}

@include('bill.header')

Part 1

@csrf
@php $added_dsr_codes = []; $total_prev_wp_amt = $total_prev_qc_amt = $total_prev_royalty_amt = $prev_total_item_qty = $prev_total_item_amt = 0; $total_current_wp_amt = $total_current_qc_amt = $total_current_royalty_amt = $total_current_item_amt = 0; $prev_items = DB::table('tbl_emb_abstracts') ->select(DB::raw('sum(TotalAmount) as TotalAmount, IsTaxable')) ->where('ProjectIDRef', $row->ProjectID) ->where('BillNo', '<', $bill['BillNo']) ->groupBy('IsTaxable') ->get(); foreach ($prev_items as $items) { if ($items->IsTaxable == "yes") { $total_prev_wp_amt = $items->TotalAmount; } if ($items->IsTaxable == "no") { $total_prev_qc_amt = $items->TotalAmount; } } @endphp @foreach ($abstracts as $k => $abs) @php if ($abs['IsTaxable'] == 'yes') { $total_current_wp_amt += $abs['TotalAmount']; } else { $total_current_qc_amt += $abs['TotalAmount']; } $total_current_item_amt += $total_current_wp_amt + $total_current_qc_amt; if (in_array($abs['DSRItemCodeRef'] . $abs['Year'], $added_dsr_codes)) { $present = true; } else { $added_dsr_codes[] = $abs['DSRItemCodeRef'] . $abs['Year']; // GET PREVIOUS VALUES $prev_dsr_items = DB::table('tbl_emb_abstracts') ->select(DB::raw('sum(TotalAmount) as prev_total_amount, sum(TotalQuantity) as prev_total_quantity')) ->where('ProjectIDRef', $row->ProjectID) ->where('DSRItemCodeRef', $abs['DSRItemCodeRef']) ->where('BillNo', '<', $bill['BillNo']) ->groupBy('DSRItemCodeRef') ->first(); if ($prev_dsr_items) { $prev_total_item_qty = $prev_dsr_items->prev_total_quantity; $prev_total_item_amt = $prev_dsr_items->prev_total_amount; } } @endphp @endforeach
Total as per bill Since previous bill Quantity executed up to date as per measurement book Item of work (Grouped under subheads or sub work of estimate) Rate Unit Payment on the basis of actual measurement up to date Remark (with reason for delay in adjusting payment shown in column 1)
Up to date Since previous bills
{{ $abs['TotalQuantity'] }} Item No {{ $abs['EmbAbstractSequenceNo'] }} :- {{ $abs['ItemOfWork'] }} {{ $abs['Rate'] }} {{ $abs['Unit'] }} {{ number_format($total_current_item_amt, 2) }} {{ number_format($abs['TotalAmount'], 2) }}