@extends('layouts.base_pdf') @section('inner_content')


{{ $po_order_transaction->bill_no }}

Purchase Order PO#: {{ $po_order_transaction->bill_no }}
Ref#: {{ $po_order_transaction->booking->marking }}
Date: {{ $supplier->segments->whereIn('id', [23])->first() ? \Carbon\Carbon::now() : $po_order_transaction->booking->created_at }}

Buyer
Marking#: {{ $po_order_transaction->booking->marking }}
{{ $supplier->name }} {{-- {{ $supplier }} --}}
@php $billingAddress = $supplier->addresses()->where('billing', '=', true)->first(); @endphp {{ $billingAddress->street_one }} {{ $billingAddress->street_two }} {{ $billingAddress->state()->first()->name }} {{ $billingAddress->district()->first()->name }}
Phone: {{ $supplier->contacts()->first()->phone }}
Seller
CIEF Worldwide Sdn Bhd (1134596-M)
No. 72-3, Jalan Jalil 1,
The Earth Bukit Jalil,
57000 Kuala Lumpur
Tel: 03-8082 1252

@php $subtotal = "0"; $displayedSubtotal = 0; @endphp @foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail) @php $exactUnitPrice = bcdiv($transaction_detail->price, $transaction->currency_rate, 5); $itemTotal = bcmul($exactUnitPrice, $transaction_detail->quantity, 5); $displayedItemTotal = bcmul($exactUnitPrice, $transaction_detail->quantity, 2); $displayedSubtotal = bcadd($displayedSubtotal, $displayedItemTotal, 2); @endphp @endforeach @php $voucherDiscount = $voucher_redemption ? bcmul((string)$voucher_redemption->value, "-1", 2) : "0"; $subtotalWithDiscount = bcsub($subtotal, $voucherDiscount, 5); // Use bcsub to subtract $displayedTotal = bcadd(bcadd(bcadd($displayedSubtotal, $transaction->service_charge, 2), $transaction->tax, 2), $voucherDiscount, 2); $expectedTotal = bcadd(bcadd(bcadd($subtotal, $transaction->service_charge, 5), $transaction->tax, 5), $voucherDiscount, 5); $discrepancy = bcsub($displayedTotal, $expectedTotal, 5); $total = bcadd(bcadd(bcadd($subtotal, $transaction->service_charge, 5), $transaction->tax, 5), $voucherDiscount, 5); // Keep precision @endphp @if($voucher_redemption) @endif @if($transaction->tax > 0) @endif
No Stock Code Description Quantity Unit Price (RM) Total Amount
(RM)
{{ $key + 1 }} {{ $transaction_detail->product_code }} {{ $transaction_detail->product_name }} {{ $transaction_detail->quantity }} {{ number_format($exactUnitPrice, 2) }} {{ number_format($itemTotal, 2) }}
Subtotal {{ number_format($subtotal, 2) }}
Service Charges {{ number_format($transaction->service_charge, 2) }}
Voucher ({{ $voucher_redemption->voucher->code }}) -{{ number_format($voucherDiscount, 2) }}
Tax {{ number_format($transaction->tax, 2) }}
Adjustment {{ roundUpPo($discrepancy,2) }}
Total {{ number_format($total, 2) }}
This is generated by computer. No signature required. Page {PAGENO} of {nbpg}
@endsection