

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">الفاتوره</a></li>
            <li><a href="electronicinvoice.php">الفاتوه الالكترونيه  </a></li>
            <li class="active">عرض  التفاصيل</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">تفاصيل الفاتوره الالكترونيه
                <a href="{$youtubes[164]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>
            </div>
            <hr/>
           

            <h1 style="text-align: center;">الفاتوره</h1>
            <table class="table table-bordered border-primary" >
                <thead>
                    <tr>
                        <th scope="col">رقم الفاتوره </th>
                        <th scope="col">تاريخ الفاتوره </th>
                        <th scope="col">اجمالى الفاتوره </th>
                        <th scope="col">صادر ام وارد</th> 
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td> {$datas->internalID}</td>
                        <td> {$datas->dateTimeIssued}</td>
                        <td> {$datas->totalSalesAmount}</td>
                        <td> {if $datas->issuer->id eq $ebillsetting->eTaxNum} صادر {else} وارد{/if}</td>
                    </tr>
                </tbody>
            </table>
            <hr/>
            <h1 style="text-align: center;">بيانات العميل</h1>
            <table class="table table-bordered border-primary" >
                <thead>
                    <tr>
                        <th scope="col">الاسم</th>
                        <th scope="col">الرقم الضريبى</th>
                        <th scope="col">النوع فى الضرائب</th>
                        <th scope="col">العنوان</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>{$datas->receiver->name}</td>
                        <td>{$datas->receiver->id}</td>
                        <td>{$datas->receiver->type}</td>
                        <td>{$datas->receiver->address->governate} , 
                        {$datas->receiver->address->regionCity} , 
                        {$datas->receiver->address->street} , 
                        {$datas->receiver->address->buildingNumber}</td>
                    </tr>
                </tbody>
            </table>
            <hr/>
            <h1 style="text-align: center;">المنتجات</h1>
            <table class="table table-bordered border-primary" >
                <thead>
                    <tr>
                        <th scope="col">الرقم الداخلى</th>
                        <th scope="col">الاسم</th>
                        <th scope="col">الكود</th>
                        <th scope="col">الوحده</th>
                        <th scope="col">الكميه</th>
                        <th scope="col">السعر</th>
                        <th scope="col">الاجمالى</th>
                    </tr>
                </thead>
                <tbody>
                   {foreach $datas->invoiceLines as $invoiceLine}
                    <tr>
                       <td>{$invoiceLine->internalCode}</td>
                       <td>{$invoiceLine->description}</td>
                       <td>{$invoiceLine->itemType} - {$invoiceLine->itemCode}</td>
                       <td>{$invoiceLine->unitType}</td>
                       <td>{$invoiceLine->quantity}</td>
                       <td>{$invoiceLine->unitValue->amountEGP}</td>
                       <td>{$invoiceLine->total}</td>
                    </tr>
                    {/foreach}
                </tbody>
            </table>
           
        </div>
    </div>
</div>
{literal}
<script type="text/javascript">


    $(document).ready(function () {
        fetch_data();
        function fetch_data(fromdate = '', todate = '', data1 = '', data2 = '', data3 = '')
        {
            var dataTable = $('#getajaxdata').DataTable({
                "processing": true,
                "serverSide": true,
                "lengthMenu": [[20, 40, 60, 80, 100, -1], [20, 40, 60, 80, 100, "All"]],
                dom: 'Bfrtip',
                buttons: [
                    {
                        extend: 'copyHtml5',
                        exportOptions: {
                            columns: [0, 1, 2, 3, 4, 5, 6, 7]
                        }
                    },
                    {
                        extend: 'csvHtml5',
                        exportOptions: {
                            columns: [0, 1, 2, 3, 4, 5, 6, 7]
                        }
                    },
                    {
                        extend: 'print',
                        exportOptions: {
                            columns: [0, 1, 2, 3, 4, 5, 6, 7]
                        }
                    },
                    {
                        extend: 'excelHtml5',
                        exportOptions: {
                            columns: [0, 1, 2, 3, 4, 5, 6, 7]
                        }
                    },
                    {
                        extend: 'pdfHtml5',
                        exportOptions: {
                            columns: [0, 1, 2, 3, 4, 5, 6, 7]
                        }
                    },
                    'colvis'
                ],
                "dom": "<'row' <'col-md-12'B>><'row'<'col-md-6 col-sm-12'l><'col-md-6 col-sm-12'f>r><'table-scrollable't><'row'<'col-md-5 col-sm-12'i><'col-md-7 col-sm-12'p>>",
                "order": [[1, "asc"]],
                "displayLength": 10,
                "ajax": {
                    url: 'electronicinvoice.php?do=showajax',
                    type: "POST",
                    data: {
                        fromdate: fromdate,
                        todate: todate,
                        data1: data1,
                        data2: data2,
                        data3: data3,
                    }
                },

            });
        }


        $('.searchdata').change(function () {
            var fromdate = $('#fromdate').val();
            var todate = $('#todate').val();
            var data1 = $('#select2supplier').val();
            var data2 = $('#select2client').val();
            var data3 = $('#select2code').val();
            $('#getajaxdata').DataTable().destroy();
            fetch_data(fromdate, todate, data1, data2, data3);

        });


      

    });







</script>
{/literal}
