@extends('Reports.template') @if ($trnType == 'P') @php $reportTitle = 'Purchase Register Report'; @endphp @elseif($trnType == 'PR') @php $reportTitle = 'Purchase Return Register Report'; @endphp @else @php $reportTitle = 'Purchase & Purchase Return Register Report'; @endphp @endif @section('title') {{ __($reportTitle) }} @endsection @section('ExternalCss') @parent @endsection @section('Content') @php if ($trnStatus === 'P') { $trnStatusMessage = 'Partial'; } elseif ($trnStatus === 'T') { $trnStatusMessage = 'Cancelled'; } elseif ($trnStatus === 'C') { $trnStatusMessage = 'Completed'; } else { $trnStatusMessage = 'ALL'; } @endphp @if ($reportType === 'B') @endif @php $oldPhTrnType = ''; $oldPhTrnId = ''; $createdBy = ''; $headerSr = 1; $transactionSr = 1; $datetime = 0; $totalQty = 0; $remark = ''; $totalFreeQty = 0; $totalAmount = 0; $strike = 'noStrike'; $symbol = ''; $summaryBills = 0; $summaryGrossTotal = 0; $summaryDiscount = 0; $summaryNetTaxableAmt = 0; $summaryCgstAmt = 0; $summarySgstAmt = 0; $summaryIgstAmt = 0; $summaryInvoiceAmt = 0; $summarySchAmt = 0; $summaryTcsAmt = 0; $summaryRoundOff = 0; $summaryTotal = 0; @endphp @foreach ($productTransactionData as $key => $productTransaction) @if ($productTransaction->pth_id != $oldPhTrnId || $productTransaction->ph_trn_type != $oldPhTrnType) @if ($totalQty != 0) @if ($reportType === 'B') @endif @endif @php $transactionSr = 1; $totalQty = 0; $remark = ''; $datetime = 0; $totalFreeQty = 0; $totalAmount = 0; $strike = 'noStrike'; $symbol = ''; @endphp @if ($productTransaction->ph_trn_status == 'T') @php $strike = 'strike'; @endphp @elseif($productTransaction->ph_trn_status == 'P') @php $symbol = '*'; @endphp @endif @if ($productTransaction->trn_type == 'P') @php $phGrossTotal = $productTransaction->ph_gross_total; $phDiscountAmt = $productTransaction->ph_discount_amt; $phNetTaxableAmt = $productTransaction->ph_net_taxable_amt; $phCgstAmt = $productTransaction->ph_cgst_amt; $phSgstAmt = $productTransaction->ph_sgst_amt; $phIgstAmt = $productTransaction->ph_igst_amt; $phInvoiceAmt = $productTransaction->ph_invoice_amt; $phSchAmount = $productTransaction->ph_sch_amount; $phTcsAmount = $productTransaction->ph_tcs_amount; $phRoundOff = $productTransaction->ph_round_off; $phTotal = $productTransaction->ph_total; @endphp @else @php $phGrossTotal = -1 * $productTransaction->ph_gross_total; $phDiscountAmt = -1 * $productTransaction->ph_discount_amt; $phNetTaxableAmt = -1 * $productTransaction->ph_net_taxable_amt; $phCgstAmt = -1 * $productTransaction->ph_cgst_amt; $phSgstAmt = -1 * $productTransaction->ph_sgst_amt; $phIgstAmt = -1 * $productTransaction->ph_igst_amt; $phInvoiceAmt = -1 * $productTransaction->ph_invoice_amt; $phSchAmount = -1 * $productTransaction->ph_sch_amount; $phTcsAmount = -1 * $productTransaction->ph_tcs_amount; $phRoundOff = -1 * $productTransaction->ph_round_off; $phTotal = -1 * $productTransaction->ph_total; @endphp @endif @endif @if ($reportType === 'B') @php $refTrnNo = 0; @endphp @if ($productTransaction->trn_type != 'P' && $productTransaction->ref_trn_id != 0) @php $refTrnNo = 'P' . $productTransaction->ref_trn_id; @endphp @endif @endif @php $createdBy = strtoupper($productTransaction->ph_created_by); $totalQty += $productTransaction->quantity; $remark = $productTransaction->ph_remarks; $totalFreeQty += $productTransaction->free_quantity; $totalAmount += $productTransaction->total; $datetime = $productTransaction->created_date; $oldPhTrnType = $productTransaction->ph_trn_type; $oldPhTrnId = $productTransaction->pth_id; @endphp @endforeach @if ($reportType === 'B') @endif @foreach ($productSummary as $key => $summary) @if ($summary->trn_type == 'P') @php $footerHeading = 'Total Purchase Bills :'; @endphp @else @php $footerHeading = 'Total Purchase Return Bills :'; @endphp @endif @php $summaryBills += $summary->Bills; $summaryGrossTotal += $summary->gross_total; $summaryDiscount += $summary->discount; $summaryNetTaxableAmt += $summary->net_taxable_amt; $summaryCgstAmt += $summary->cgst_amt; $summarySgstAmt += $summary->sgst_amt; $summaryIgstAmt += $summary->igst_amt; $summaryInvoiceAmt += $summary->invoice_amt; $summarySchAmt += $summary->sch_amount; $summaryTcsAmt += $summary->tcs_amount; $summaryRoundOff += $summary->round_off; $summaryTotal += $summary->total; @endphp @endforeach @if (!empty($productSummary)) @endif @php $currentTime = \Carbon\Carbon::now(); @endphp
@if ($businessEntityMasterData[0]->logo != null) Pharmacy Logo @endif
{{ $businessEntityMasterData[0]->name }}
{{ $businessEntityMasterData[0]->add1 . ' ' . $businessEntityMasterData[0]->add2 . ' ' . $businessEntityMasterData[0]->city . ' : ' . $businessEntityMasterData[0]->pincode }}
{{ 'Phone : ' . $businessEntityMasterData[0]->tel1 }}
{{ __($reportTitle) . ' ' }} {{__('Store')}} : {{ $storeName }} {{__('Period')}} : {{ \Helper::getDisplayDate($fromDate) }} {{__('TO')}} {{ \Helper::getDisplayDate($toDate) }}
{{__('Vou No')}}  {{__('Vou Date')}} {{__('Supp Bill No')}} {{__('Supp Bill Date')}} {{__('PO No')}} {{__('Credit Bill')}} {{__('Supp Name')}} {{__('Gross')}} {{__('Disc')}} {{__('Net Taxable')}} {{__('CGST')}} {{__('SGST')}} {{__('IGST')}} {{__('Invoice')}}  {{__('Sch Amt')}}  {{__('TCS Amt')}} {{__('R. Off')}} {{__('Net Amount')}}
{{__('Sr')}}  {{__('Name')}} {{__('HSN Code')}} {{__('Mfg')}} {{__('Category')}} {{__('P Unit')}} {{__('S Unit')}} {{__('P Size')}} {{__('Ref No.')}} {{__('Qty')}} {{__('FQty')}}    {{__('Batch')}} {{__('Exp')}} {{__('Sch Amt')}} {{__('MRP')}} {{__('Rate')}} {{__('Disc')}}% {{__('Net Rate')}} {{__('Taxable')}} {{__('GST')}}% {{__('GST')}} {{__('Amount')}}
@if ($remark != '') {{__('Remarks')}} : {{ $remark }} @endif {{__('Total Qty')}} : {{ \Helper::zeroValueToNbspSpace($totalQty) }} {{ \Helper::zeroValueToNbspSpace($totalFreeQty) }}  {{ __('Created By') }}: @if ($createdBy) {{ $createdBy . ' ' . Carbon\Carbon::parse($datetime)->format('d-m-Y h:i:s') }} @endif
{{ $symbol }} {{ $productTransaction->trn_type . "/" . $productTransaction->trn_fyear . "/" . $productTransaction->ph_trn_id }} {{ \Helper::getDisplayDate($productTransaction->ph_trn_date) }} {{ $productTransaction->ph_purchase_bill_no }} {{ \Helper::getDisplayDate($productTransaction->ph_purchase_bill_date) }} @if ($productTransaction->trn_type == 'P' && $productTransaction->purchase_order_no > 0) {{ 'PO' . $productTransaction->purchase_order_no }}@else{{ ' ' }} @endif @if ($productTransaction->is_credit_bill == 'Y') {{ __('Yes') }}@else{{ __('No') }} @endif {{ $productTransaction->supplier_name }} {{ \Helper::customAmountFormat($phGrossTotal) }} {{ \Helper::customAmountFormat($phDiscountAmt) }} {{ \Helper::customAmountFormat($phNetTaxableAmt) }} {{ \Helper::customAmountFormat($phCgstAmt) }} {{ \Helper::customAmountFormat($phSgstAmt) }} {{ \Helper::customAmountFormat($phIgstAmt) }} {{ \Helper::customAmountFormat($phInvoiceAmt) }}  {{ \Helper::customAmountFormat($phSchAmount) }}  {{ \Helper::customAmountFormat($phTcsAmount) }} {{ \Helper::customAmountFormat($phRoundOff) }} {{ \Helper::customAmountFormat($phTotal) }}
{{ $transactionSr++ }} {{ \Helper::zeroValueToNbspSpace($productTransaction->product_name) }} {{ \Helper::zeroValueToNbspSpace($productTransaction->product_hsn_code) }} {{ \Helper::zeroValueToNbspSpace(strtoupper($productTransaction->manufacturer_code)) }} {{ \Helper::zeroValueToNbspSpace($productTransaction->category_abbrev) }} {{ \Helper::zeroValueToDash($productTransaction->unit_abbrev) }} {{ \Helper::zeroValueToDash($productTransaction->suom) }} {{ \Helper::zeroValueToDash($productTransaction->conversion_factor) }} {{ \Helper::zeroValueToNbspSpace($refTrnNo) }} {{ \Helper::zeroValueToNbspSpace($productTransaction->quantity) }} {{ \Helper::zeroValueToNbspSpace($productTransaction->free_quantity) }}  {{ \Helper::zeroValueToNbspSpace($productTransaction->batch_no) }} {{ \Helper::getMonthYearFromDate($productTransaction->batch_exp) }} {{ \Helper::customAmountFormat($productTransaction->sch_amt) }} {{ \Helper::customAmountFormat($productTransaction->mrp) }} {{ \Helper::customAmountFormat($productTransaction->price) }} {{ \Helper::customAmountFormat($productTransaction->discount) }} {{ \Helper::customAmountFormat($productTransaction->net_rate) }} {{ \Helper::customAmountFormat($productTransaction->taxable_amt) }} {{ \Helper::customAmountFormat(floatval($productTransaction->sgst_percentage) + floatval($productTransaction->cgst_percentage) + floatval($productTransaction->igst_percentage)) }} {{ \Helper::customAmountFormat(floatval($productTransaction->sgst_value) + floatval($productTransaction->cgst_value) + floatval($productTransaction->igst_value)) }} {{ \Helper::customAmountFormat($productTransaction->total) }}
@if ($remark != '') {{__('Remarks')}} : {{ $remark }} @endif {{__('Total Qty')}} : {{ \Helper::zeroValueToNbspSpace($totalQty) }} {{ \Helper::zeroValueToNbspSpace($totalFreeQty) }}  {{__('Created By')}}: @if ($createdBy) {{ $createdBy . ' ' . Carbon\Carbon::parse($datetime)->format('d-m-Y h:i:s') }} @endif
{{ __($footerHeading) . ' ' . \Helper::zeroValueToNbspSpace($summary->Bills) }} {{ \Helper::customAmountFormat($summary->gross_total) }} {{ \Helper::customAmountFormat($summary->discount) }} {{ \Helper::customAmountFormat($summary->net_taxable_amt) }} {{ \Helper::customAmountFormat($summary->cgst_amt) }} {{ \Helper::customAmountFormat($summary->sgst_amt) }} {{ \Helper::customAmountFormat($summary->igst_amt) }} {{ \Helper::customAmountFormat($summary->invoice_amt) }} {{ \Helper::customAmountFormat($summary->sch_amount) }} {{ \Helper::customAmountFormat($summary->tcs_amount) }} {{ \Helper::customAmountFormat($summary->round_off) }} {{ \Helper::customAmountFormat($summary->total) }}
{{__('Total Bills')}} : {{ \Helper::zeroValueToNbspSpace($summaryBills) }} {{ \Helper::customAmountFormat($summaryGrossTotal) }} {{ \Helper::customAmountFormat($summaryDiscount) }} {{ \Helper::customAmountFormat($summaryNetTaxableAmt) }} {{ \Helper::customAmountFormat($summaryCgstAmt) }} {{ \Helper::customAmountFormat($summarySgstAmt) }} {{ \Helper::customAmountFormat($summaryIgstAmt) }} {{ \Helper::customAmountFormat($summaryInvoiceAmt) }} {{ \Helper::customAmountFormat($summarySchAmt) }} {{ \Helper::customAmountFormat($summaryTcsAmt) }} {{ \Helper::customAmountFormat($summaryRoundOff) }} {{ \Helper::customAmountFormat($summaryTotal) }}
{{__('Partially save')}} {{ strtoupper(Session::get('userId')) . ' # ' . $currentTime->format('d/m/Y H:i:s ') }}
{{__('Back')}}
@endsection @section('BootstrapModals') @endsection @section('ExternalJs') @endsection