@php $order = ($record->order) ? $record->order : $record; $currency_id = getDefaultCurrency( 'id' ); $currency_code = getDefaultCurrency( 'code' ); if ( isCustomer() ) { $customer_currency_id = getContactInfo( Auth::id(), 'currency_id' ); if ( ! empty( $customer_currency_id ) ) { $currency_id = $customer_currency_id; } $customer_currency_details = \App\Currency::find( $currency_id ); if ( ! empty( $customer_currency_details ) ) { $currency_code = $customer_currency_details->code; } } @endphp

@lang('custom.payments.order-no'){{$order->id}}

@lang('custom.payments.customer') {{$order->customer->first_name}}

@lang('custom.payments.amount'){{digiCurrency($order->price, $currency_id)}}

@lang('custom.payments.date'){{digiDate($order->created_at)}}

@lang('custom.payments.status') {{ucfirst($order_status)}}

@lang('custom.payments.products')


@php $products = $order->products; if ( ! empty( $products ) ) { $products = json_decode( $products ); } @endphp @if( ! empty( $products ) ) @php $names = $products->product_name; $sub_total = $products->sub_total; $discount_total = $products->total_discount; $tax_total = $products->total_tax; $grand_total = $products->grand_total; @endphp @for( $index = 0; $index < count( $names ); $index++ ) @php $price = $products->product_price[$index] ?? '0'; $quantity = $products->product_qty[$index] ?? '0'; $product_total = $price * $quantity; $discount_value = $products->discount_value[$index] ?? '0'; $tax_value = $products->tax_value[$index] ?? '0'; $product_subtotal = $products->product_subtotal[$index] ?? '0'; $details = ''; $details .= trans('orders::global.orders.price') . digiCurrency( $price ); if( $quantity > 1 ): $details .= "\n\n" . trans('orders::global.orders.total') . digiCurrency( $product_total ) . '('. trans('orders::global.orders.price-only') . 'x' . $quantity . ')'; endif; if( $discount_value > 0 ): $details .= '\n\n'. trans('orders::global.orders.discount') . '-' . digiCurrency( $discount_value ); endif; if( $tax_value > 0 ): $details .= '\n\n' . trans('orders::global.orders.tax') . '+' . digiCurrency( $tax_value ); endif; $details .= ''; @endphp @endfor @endif
@lang('orders::global.orders.product-only') @lang('orders::global.orders.price-only') @lang('orders::global.orders.quantity-only') @lang('orders::global.orders.total-only')
{{ $products->product_name[$index] ?? '' }} {{ digiCurrency( $price ) }} {{ $quantity }}

{{digiCurrency( $product_subtotal )}}

@lang('orders::global.orders.total-tax')
(+){{digiCurrency($tax_total)}}
@lang('orders::global.orders.subtotal')
{{digiCurrency($sub_total)}}
@lang('orders::global.orders.total-discount')
(-){{digiCurrency($discount_total)}}

@lang('orders::global.orders.total')

{{digiCurrency($grand_total)}}