Logo
@php $location = App\BusinessLocation::find($transaction->location_id); function delete_all_between($beginning, $end, $string) { $beginningPos = strpos($string, $beginning); $endPos = strpos($string, $end); if ($beginningPos === false || $endPos === false) { return $string; } $textToDelete = substr($string, $beginningPos, ($endPos + strlen($end)) - $beginningPos); return delete_all_between($beginning, $end, str_replace($textToDelete, '', $string)); // recursion to ensure all occurrences are replaced } $method = $transaction->payment_lines()->first(); @endphp
{{$location->landmark}}
{{$location->city}}
{{$location->country}}
TEL : {{$location->mobile ?? '0114294426'}}
--------------------------------------
@if(isset($transaction->old_invoice)) @endif
User :{{auth()->user()->first_name ?? ''}}   Salesman :{{$transaction->sales_person->first_name ?? ''}}
Dispatch Method : {{$transaction->dispatch_method ?? '' }}   Bill No : {{$transaction->invoice_no}}
Sale Return# {{$transaction->old_invoice}}
Date : {{date('Y-m-d')}}  
Payment Method : {{ isset($method) && $method->method ? ucwords(str_replace('_', ' ', $method->method)) : ''}}  
--------------------------------------
@php $total = 0; $sum = 0; $oldInvoice = App\Transaction::orderBy('id', 'DESC')->where('type', 'sell_return')->where('invoice_no', $transaction->old_invoice)->first(); @endphp @if(isset($oldInvoice)) @php $lines = $oldInvoice->purchase_lines; @endphp @foreach($lines as $key => $sell_line) @php $product = $sell_line->product; if($sell_line->line_discount_type == 'percentage') { $discount = ($sell_line->line_discount_amount/100) * ($sell_line->quantity*$sell_line->purchase_price_inc_tax); } else { $discount = $sell_line->line_discount_amount; } $price = ($sell_line->quantity*$sell_line->purchase_price_inc_tax) - $discount; $total = $total + $price; @endphp @endforeach @endif @forelse($transaction->sell_lines as $line) @php if($line->line_discount_type == 'percentage') { $discounts = ($line->line_discount_amount/100) * ($line->quantity*$line->unit_price_inc_tax); } else { $discounts = $line->line_discount_amount; } $prices = ($line->quantity*$line->unit_price_inc_tax) - $discounts; $sum = $sum + $prices; @endphp @empty @endforelse
Itemcode Qty Dis Amount
{{$product->name}} (Exchange) {{$sell_line->quantity}} {{@num_format($discount)}} {{@num_format($price)}}
{{ delete_all_between("(", ")", $line->product->name) }} {{$line->quantity}} {{ @num_format($line->get_discount_amount() * $line->quantity) }} {{ @num_format($prices) }}
 
@if(isset($oldInvoice)) @else @endif
Subtotal{{@num_format($sum - $total)}}{{@num_format($sum)}}
Shipping Charges {{$receipt_details->shipping_charges ?? 0.00}}
Loyalty ({{$receipt_details->loyality ?? 0.00}})
Gift Voucher ({{$receipt_details->gift_voucher ?? 0.00}})
Discount ({{$receipt_details->discount ?? 0.00}})
Exchange Point ({{$transaction->return_point ?? 0.00}})
Tax {{$receipt_details->tax ?? 0.00}}
Total {{$receipt_details->total}}
Balance {{@num_format($transaction->final_total - $transaction->payment_lines->sum('amount'))}}
Total Quantity {{$transaction->sell_lines->sum('quantity')}}
Change Return {{$transaction->change > 0 ? @num_format($transaction->change) : 0.00}}
@php $contact = App\Contact::find($transaction->contact_id); $points = 0; if($contact->is_loyalty == 1 && isset($contact->customer_group_id)) { $loyalty = App\Loyalty::where('customer_id', $contact->customer_group_id)->where('status', 1)->first(); if(isset($loyalty) && isset($loyalty->points) && isset($loyalty->amount) && $loyalty->points > 0) { $points = ($transaction->final_total / $loyalty->amount) * $loyalty->points; } } if($contact->is_loyalty == 1 && !isset($contact->customer_group_id)) { $loyalty = App\Loyalty::where('customer_name', 'Default')->where('status', 1)->first(); if(isset($loyalty) && isset($loyalty->points) && isset($loyalty->amount) && $loyalty->points > 0) { $points = ($transaction->final_total / $loyalty->amount) * $loyalty->points; } } @endphp
Total Points : {{$contact->points ?? 0 }}
Earn Points : {{$points ?? 0 }}
CUSTOMER CODE : {{$transaction->contact->mobile ?? '' }}
CUSTOMER NAME : {{$transaction->contact->name ?? '' }}
--------------------------------------
HAPPINESS is a PERFUME
that you cannot have for YOURSELF,
without pouring a few drop on OTHERS
------------
THANK YOU, COME AGAIN!
------------
No Refund,
Exchange possible within 7 days
along with receipt.
No exchange and No refund for the discounted items
--------------------------------------
System By www.apssoft.co (71 1234 876)