@extends('layouts.master') @section('css') @endsection @section('title') معاينة طباعة الفاتورة @stop @section('content')

{{Nameen}}

{{describtionen}}

ST: {{STen}} | Tax: {{Taxen}}

logo

{{Namear}}

{{describtionar}}

{{STar}} | {{Taxar}}

Sales Returns - مرتجع مبيعات
Credit Note - إشعار دائن
اسم العميل {{$data['invoiceData']->customer->name}}
الرقم الضريبي {{$data['invoiceData']->customer->tax_no}}
العنوان {{$data['invoiceData']->customer->address}}
رقم الفاتورة الأصلية {{ $data['invoiceData']->id}}
رقم الإشعار {{$data['invoiceData']->NOTICE_Number}}
تاريخ الإشعار {{ $data['salesData'][0]->created_at ?? now() }}
@php $total_before_discount = 0; $discount_total = 0; $avtSale = App\Models\Avt::find(1)->AVT; @endphp @foreach ($data['salesData'] as $index => $product) @php $row_subtotal = round($product->return_Unit_Price * $product->return_quantity, 2); $row_discount = round(($product->discountvalue + $product->discountoninvoice), 2); $total_before_discount += $row_subtotal; $discount_total += $row_discount; @endphp @endforeach
# كود المنتج اسم الصنف السعر الكمية الاجمالي الخصم الصافي
{{ $index + 1 }} {{$product->productData->Product_Code}} {{ $product->productData->product_name}} {{ number_format($product->return_Unit_Price, 2) }} {{ $product->return_quantity}} {{ number_format($row_subtotal, 2) }} {{ number_format($product->discountvalue, 2) }} {{ number_format($row_subtotal - $product->discountvalue, 2) }}
@php $sub_total_after_discount = $total_before_discount - $discount_total; $final_net_total = round($sub_total_after_discount * (1 + $avtSale), 2); $tax_val = round($final_net_total - $sub_total_after_discount, 2); // منطق الـ QR Code $sellerName = sallerQrCode; $taxNumber = TaxQrCode; $dt = date('Y-m-d\TH:i:s', strtotime($data['salesData'][0]->created_at ?? now())); function tlv($tag, $value) { return pack("C", $tag) . pack("C", strlen($value)) . $value; } $tobase = tlv(1, $sellerName) . tlv(2, $taxNumber) . tlv(3, $dt) . tlv(4, number_format($final_net_total, 2, '.', '')) . tlv(5, number_format($tax_val, 2, '.', '')); for($i=6; $i<=9; $i++) { $tobase .= tlv($i, ""); } $dataforQRcode = base64_encode($tobase); @endphp
{!! QrCode::size(120)->generate($dataforQRcode) !!}
الإجمالي (قبل الخصم) {{ number_format($total_before_discount, 2) }}
إجمالي الخصم {{ number_format($discount_total, 2) }}
الصافي (قبل الضريبة) {{ number_format($sub_total_after_discount, 2) }}
ضريبة القيمة المضافة ({{$avtSale * 100}}%) {{ number_format($tax_val, 2) }}
الإجمالي النهائي {{ number_format($final_net_total, 2) }}
@if(Auth()->user()->branchs_id == 1)

{{addressar}}

{{addressen}}

@endif
@endsection @section('js') @endsection