<div>
    <div class="document-no">
        <h2 style="padding-top: 3mm">ORÇAMENTO N.º 16010001</h2>
        <p>Data Documento: <?php echo $budget->date->format('d / m / Y'); ?></p>
        <p>Preparado por: Paulo Costa</p>
    </div>
    <div class="address-box">
        Ex.mo(s) Senhor(es):<br/>
        <b class="text-uppercase"><?php echo $budget->customer->name; ?></b><br>
        <span class="text-uppercase">
            <?php echo $budget->customer->address; ?>

            <br/>
            <?php echo $budget->customer->zip_code; ?> <?php echo $budget->customer->city; ?>

        </span>
        <br/>
        <div class="contacts">
            E-MAIL: <?php echo $budget->customer->email; ?>

            <br/>
            TELEF: <?php echo $budget->customer->phone; ?>

        </div>
        <div class="tax">
            Contrib. n.º <?php echo $budget->customer->tax; ?>

        </div>
    </div>
</div>

<div>
    <p class="text-right pagination">Página {PAGENO} de {nbpg}</p>
    <div class="document-alert">
        <h2><b><u>Este Documento não serve de Fatura</u></b></h2>
    </div>

</div>
<div class="budget-items-box">
    <table class="table">
        <thead>
            <tr class="table-header">
                <th>Descrição</th>
                <th class="text-right" style="width: 15mm">Quantidade</th>
                <th class="text-right" style="width: 25mm">Pr. Unitário</th>
                <th class="text-right" style="width: 25mm">Pr. Liquido</th>
                </div>
        </thead>
        <tbody>
            <?php foreach($budget->lines as $line): ?>
            <tr>
                <td><?php echo $line->description; ?></td>
                <td class="text-right"><?php echo $line->qtt; ?></td>
                <td class="text-right"><?php echo money($line->price); ?> €</td>
                <td class="text-right"><?php echo money($line->subtotal); ?> €</td>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
</div>

<div>
    <div class="document-conditions">
        <p>
            <b>Condições gerais:</b><br/>
        <?php if($budget->geral_conditions): ?> 
        <?php echo nl2br($budget->geral_conditions); ?><br/>
        <?php endif; ?>
        Documento válido por <u><?php echo $budget->validity; ?> dias</u>.
        </p>
        
        <?php if($budget->payment_conditions): ?>
        <p>
            <b>Condições de pagamento:</b>
            <br/>
            <?php echo nl2br($budget->payment_conditions); ?>

        </p>
        <?php endif; ?>
        
        
    </div>
    <div class="document-totals">
        <table class="table">
            <tbody>
                <tr>
                    <th class="text-right">Total Liquído</th>
                    <td class="text-right"><?php echo money($budget->price); ?> €</td>
                </tr>
                <tr>
                    <th class="text-right">IVA (23%)</th>
                    <td class="text-right"><?php echo money($budget->vat); ?> €</td>
                </tr>
                <tr>
                    <th class="text-right"><h1 style="margin: 0; padding: 0">TOTAL</h1></th>
                    <td class="text-right"><h1 style="margin: 0; padding: 0"><?php echo money($budget->total); ?> €</h1></td>
                </tr>
            </tbody>
        </table>
    </div>
</div>