File: /home/artinside/www/sabbry/themes/admin/widgets/order/invoice.php
<?php $v->layout("_admin");
$v->start("css");
?>
<link href="<?= url("admin-assets/css/invoice-print.css")?>" rel="stylesheet" media="print">
<?php
$v->end();
?>
<section class="wrapper">
<!-- invoice start-->
<section>
<div class="card card-primary">
<!--<div class="card-heading navyblue"> INVOICE</div>-->
<div class="card-body">
<div class="row invoice-list">
<div class="col-md-12 text-center corporate-id">
<img src="<?= theme("assets/images/logo.svg")?>" alt="<?= CONF_SITE_NAME ?>" width="190px" class="margin-bottom-20">
</div>
<div class="col-lg-4 col-sm-4">
<h4>Dados do Cliente</h4>
<p>
<b><?= $order->user()->fullName() ?></b><br>
CPF: <?= $order->user()->document ?><br>
<?= $order->user()->email ?><br>
<?= $order->user()->phone ?><br>
Pagarme id: <?= $order->user()->integration_pagarme ?><br>
</p>
</div>
<div class="col-lg-4 col-sm-4">
<h4>Entrega</h4>
<p>
<?= $order->street ?>, <?= $order->number ?> <?= $order->complement ? " - ".$order->complement : ""?><br>
<?= $order->city ?><br>
Cep: <?= $order->zipcode ?><br>
Entrega: <b><?= $order->shipment_type ?></b><br>
Rastreio: <b><?= $order->shipment_code ? $order->shipment_code : "NA" ?></b><br>
</p>
</div>
<div class="col-lg-4 col-sm-4">
<h4>Dados do Pedido</h4>
<ul class="unstyled">
<li>Número Pedido: <strong>[#<?= order_id($order->id) ?>]</strong></li>
<li>Data Pedido: <?= date_fmt($order->created_at)?></li>
<li>Nº de Parcelas: <b><?= $order->installments ?>x</b></li>
<li><span class="badge badge-pill label-mini white-text" style="background-color: <?= status($order->status)->color?>"><?= status($order->status)->text?></span></li>
</ul>
</div>
</div>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>#</th>
<th class="hidden-phone">Produto</th>
<th class="">Unit.</th>
<th class="">Qtd</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<?php foreach ($orderItems as $item):?>
<tr>
<td><img src="<?=image($item->product()->cover, 30, 30)?>" class="rounded"> </td>
<td class="hidden-phone"><?= $item->product_name ?></td>
<td class="">R$ <?= preco_real($item->price) ?></td>
<td class=""><?= $item->quantity ?></td>
<td>R$ <?= preco_real($item->price*$item->quantity) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="row justify-content-end">
<div class="col-lg-4 invoice-block ">
<ul class="unstyled amounts">
<li><strong>Subtotal :</strong> R$ <?= preco_real($order->products_price)?></li>
<li><strong>Frete :</strong> R$ <?= preco_real($order->shipment_price)?></li>
<li><strong>Total :</strong> <b>R$ <?= preco_real($order->products_price+$order->shipment_price)?></b></li>
</ul>
</div>
</div>
<div class="text-center invoice-btn j_actions">
<?php if($order->status == "paid" AND $order->shipment_code == "Aguardando Entrega"): ?>
<button class="btn btn-success" data-toggle="modal" data-target="#exampleModalCenter" data-order="<?= order_id($order->id)?>" data-id="<?= $order->id ?>" id="j_shipment_code"><i class="fal fa-truck"></i> Informar Entrega</button>
<?php endif; ?>
<a class="btn btn-info text-light" onclick="javascript:window.print();"><i class="fal fa-print"></i> Print </a>
</div>
</div>
</div>
</section>
<!-- invoice end-->
</section>
<?php
$v->start("scripts");
?>
<script>
$(".j_actions").on("click","#j_shipment_code", function (e) {
e.preventDefault();
var id = $(this).data("id");
var formatedId = $(this).data("order");
$("#form_order_id").val(id);
$(".j_order_id_number").html("Pedido Número: <b>[#"+formatedId+"]</b>");
})
</script>
<?php
$v->end();
$v->insert("views/modals/shipment-code");
?>