<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>partner.gruene-seele.bio</title>
    <style>

        /* roboto-300 - latin */
            @font-face {
                font-family: 'Roboto';
                font-style: normal;
                font-weight: 300;
                src: url('fonts/roboto-v20-latin-300.ttf') format('truetype'), /* Safari, Android, iOS */
            }
            /* roboto-regular - latin */
            @font-face {
                font-family: 'Roboto';
                font-style: normal;
                font-weight: 400;
                src: url('fonts/roboto-v20-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
            }
            /* roboto-500 - latin */
            @font-face {
                font-family: 'Roboto';
                font-style: normal;
                font-weight: 500;
                src: url('fonts/roboto-v20-latin-500.ttf') format('truetype'), /* Safari, Android, iOS */
            }
            /* roboto-700 - latin */
            @font-face {
                font-family: 'Roboto';
                font-style: normal;
                font-weight: 700;
                src: url('fonts/roboto-v20-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */
            }
        html {
            width: 100%;
            height: 100%;
        }

        body {
            position: relative;
            width: 100%;
            height: 100%;
            margin: 0 auto;
            padding: 0;
            color: #000;
            background: #fff;
            font-family: 'Roboto', sans-serif;
            font-size: 8pt;
            font-weight: 400 ;
        }
        table {
            border: none;
        }

        strong {
            font-weight: bold !important;
        }

        @page {
            margin: 0px;
        }
        @page {
            margin-top: 0px;
        }


        @page {
            margin: 40mm 0 20mm 0;
        }

        .font-weight-bold {
            font-weight: bold !important;
        }

        #title_box {
            position: absolute;
            top:0mm;
            left: 15mm;
            width: 180mm;
            height: 10mm;
            z-index: 1;
            text-align: left;
        }
            #title_box .title {
                font-size: 15pt;
                line-height: 12pt;
            }
            #title_box .subtitle {
                font-size: 9pt;
                line-height: 9pt;
            }

        #address_box {
            position: absolute;
            top:10mm;
            left: 15mm;
            width: 90mm;
            height: 30mm;
            z-index: 2;
            font-size: 8pt;
            line-height: 9pt;
            letter-spacing: 0.05em;
        }

        #address_delivery_box {
            position: absolute;
            top:10mm;
            left: 105mm;
            width: 90mm;
            height: 30mm;
            z-index: 3;
            font-size: 8pt;
            line-height: 9pt;
            letter-spacing: 0.05em;
        }

   
        #detail_box_left {
            position: absolute;
            top:40mm;
            left: 15mm;
            width: 90mm;
            height: 15mm;
            z-index: 3;
            font-size: 8pt;
        }

        #detail_box_right {
            position: absolute;
            top:40mm;
            left: 105mm;
            width: 90mm;
            height: 15mm;
            z-index: 4;
            font-size: 8pt;
        }

        #detail_box_left table, #detail_box_right table  {
            width: 100%;
            line-height: 9pt;
        }

        #detail_box_left table td {
            text-align: left;
        }

        #detail_box_right table td {
            text-align: left;
        }

        #relatve_box {
            position: relative;
            padding-top: 0mm;
            width: 180mm;
            height: 30mm;
            font-size: 8pt;
            line-height: 8pt;
            display: block;
        }

        #invoice_box {
            position: relative;
            padding-top: 20mm;
            margin-left: 15mm;
            width: 180mm;
            font-size: 8pt;
            z-index: 10;
            line-height: 8pt;
        }

        #invoice_box table {
            width: 100%;
            border-collapse: collapse;
        }


        #invoice_box table tfoot tr  {
            page-break-after: avoid;
        }

        #invoice_box table tr td {
            vertical-align: top;
            padding-top: 2mm;
            padding-bottom: 2mm;
            padding-left: 1.5mm;
            padding-right: 1.5mm;
            border-top: 0.5pt dotted #1a1a18;
        }

        #invoice_box table tfoot tr td {
            border-top: none;
        }

        #invoice_box table tfoot tr.fullline td {
            border-top: 0.3pt solid #575755;
        }

        #invoice_box table tfoot tr.fullline td.no-border {
            border-top: none;
        }

        #invoice_box table tfoot tr td {
            padding-top: 1.2mm;
            padding-bottom: 1.2mm;

        }

        

        #invoice_box table td.small {
            width: 1%;
            white-space: nowrap;
        }

            #invoice_box table tr th {
               line-height: 12pt;
                padding-bottom: 1mm;
                padding-left: 1mm;
                padding-right: 1mm;
                background-color: rgb(212, 212, 212);

            }

            

            #invoice_box table td .title {
                font-size: 10pt;
            }
            #invoice_box table td .description {
                padding-top: 1mm;
                font-size: 9pt;

            }

            #invoice_box table td .price_net {
                padding-top: 1mm;
                font-size: 10pt;
                padding-bottom: 1mm;
            }

            #invoice_box table td .price_tax {
                padding-top: 0.7mm;
                padding-bottom: 0.7mm;
            }

            #invoice_box table td .price_total {
                padding-top: 2mm;
                font-size: 11pt;
            }
            .singel-line-top {
                border-top: 1pt solid #1a1a18;
            }
            .double-line {
                border-bottom: 2.5pt double #1a1a18;
            }
            .dotted-line {
                border-bottom: 0.8pt dotted #1a1a18;
            }

        #footer_box {
            position: relative;
            top:0mm;
            left: 15mm;
            width: 180mm;
            height: 20mm;
            z-index: 6;
            font-size: 8pt;
            line-height: 8pt;
        }

        .text-right {
            text-align: right;
        }
        .text-left {
            text-align: left;
        }
        .text-center {
            text-align: center;
        }
        .img-responsive { width: 100%; height: 100%; }
    </style>
</head>
<body>
    <div id="relatve_box">

        <div id="title_box">
            <div class="title">Lieferschein</div>
        </div>

        <div id="address_box">
            <strong>Rechnungsadresse</strong><br>
            @if($shopping_order->shopping_user->billing_company)
                {{ $shopping_order->shopping_user->billing_company }}<br>
            @else
                @if($shopping_order->payment_for !== 7)
                Firma <br>
                @endif
            @endif
                {{ \App\Services\HTMLHelper::getSalutationLang($shopping_order->shopping_user->billing_salutation) }}
                {{ $shopping_order->shopping_user->billing_firstname }} {{ $shopping_order->shopping_user->billing_lastname }}<br>
                {{ $shopping_order->shopping_user->billing_address }}<br>
            @if($shopping_order->shopping_user->billing_address_2)
                {{ $shopping_order->shopping_user->billing_address_2 }}<br>
            @endif
                {{ $shopping_order->shopping_user->billing_zipcode }} {{ $shopping_order->shopping_user->billing_city }}<br>
            @if($shopping_order->shopping_user->billing_country)
            {{ $shopping_order->shopping_user->billing_country->getLocated() }}
            @endif
        </div>

        <div id="address_delivery_box">
            <strong>Lieferadresse</strong><br>
            @if($shopping_order->shopping_user->same_as_billing)

            {{__('email.checkout_mail_same_address')}}
            @else

                @if($shopping_order->shopping_user->shipping_company)
                    {{ $shopping_order->shopping_user->shipping_company }}<br>
                @else
                    @if($shopping_order->payment_for !== 7)
                    Firma <br>
                    @endif
                @endif
                {{ \App\Services\HTMLHelper::getSalutationLang($shopping_order->shopping_user->shipping_salutation) }}
                {{ $shopping_order->shopping_user->shipping_firstname }} {{ $shopping_order->shopping_user->shipping_lastname }}<br>
                {{ $shopping_order->shopping_user->shipping_address }}<br>
                @if($shopping_order->shopping_user->shipping_address_2)
                    {{ $shopping_order->shopping_user->shipping_address_2 }}<br>
                @endif
                {{ $shopping_order->shopping_user->shipping_zipcode }} {{ $shopping_order->shopping_user->shipping_city }}<br>
                @if($shopping_order->shopping_user->shipping_country)
                {{ $shopping_order->shopping_user->shipping_country->getLocated() }}
                @endif
            @endif
        </div>
        <div id="detail_box_left">
            <table>
                <tr>
                    <td>
                        {{ __('Rechnungsnummer') }}: {{ $invoice_number }}
                    </td>
                </tr>
                <tr>
                    <td>
                        {{ __('Bestellnummer') }}: {{ $shopping_order->getLastShoppingPayment('reference') }}
                    </td>
                </tr>
            </table>
        </div>
        <div id="detail_box_right">
            <table>
                <tr>
                    <td>
                        {{ __('Datum') }}: {{ $invoice_date }}
                    </td>
                </tr>
                <tr>
                    <td>
                        {{ __(' Umsatzsteuer-ID') }}: DE296797691
                    </td>
                </tr>
            </table>
        </div>
   
    </div>
    <div id="invoice_box">
        <table>
            <thead>
            <tr>
                <th class="text-left" style="width: auto">Etikett</th>
                <th class="text-left" style="width: auto">Bezeichnung</th>
                <th class="text-right" style="width: 2cm">Anzahl</th>
            </tr>
            </thead>
            <tbody>
            @if($delivery_items)
                @foreach($delivery_items as $shopping_order_item)
                @php($varinations = "")
                <tr class="item">
                    <td class="small text-left">
                        @if(isset($shopping_order_item->labels) && is_array($shopping_order_item->labels))
                            @foreach($shopping_order_item->labels as $product_image)
                                <div style="width: {{ $product_image->varinat['size'] }}cm; height: {{ $product_image->varinat['size'] }}cm;">
                                    <img src="{{ $product_image->getBaseImagePath() }}" class="img-responsive">
                                </div>
                                {{ $product_image->varinat['size'] }}cm / {{ $product_image->varinat['vol'] }}ml
                                @php($varinations .= "<br>Tiegel: ".$product_image->varinat['name'])
                            @endforeach
                        @endif
                    </td>
                    <td class="small text-left">
                        <strong>
                        {{ $shopping_order_item->product->getWhiteLableName() }}
                        </strong>
                        {!! $varinations !!}
                    </td>
                    <td class="text-right small">      
                        <strong>                          
                        {{ $shopping_order_item->qty }}
                        </strong>
                    </td>
                </tr>
                @endforeach
            @endif
            </tbody>
            <tfoot>
                    <tr class="fullline">
                        <td class="text-right" colspan="2">
                            Gesamt:
                        </td>
                        <td class="text-right">
                            {{ $shopping_order->getItemsCount() }} 
                        </td>
                    </tr>
            </tfoot>

        </table>
    </div>

</body>
</html>