{% include "macros/style.html.twig" %} {% set channel = lote.channel %} {% include "macros/header.html.twig" %}
Resumo de utilização Lote(s): {% for l in lotes %} {{ l.code~' ' }} {% endfor %}
Data: {{ lote.createdAt | date('d/m/Y') }}
Forncedor: {{ lote.parceiro.nome }}
{% for loteI in lotes %} {% set total = 0 %} {% set totalcompra = 0 %} {% set totalvenda = 0 %} {#{ dump(lote) }#} {% for p in loteI.orderitems %} {% if p.order.state == 'fulfilled' %} {#{ dump(p.unitPrice) }#} {% set total = total + p.quantity %} {% set totalcompra = totalcompra + p.quantity*loteI.price %} {% set totalvenda = totalvenda + p.quantity*p.unitPrice %} {% endif %} {% endfor %}
Un Produto Pedido CFOP Data Cliente Comp Vend Tot comp Tot vend Usado
Kg {{ loteI.variant.name }} {{ p.order.number }} {{ p.order.cfop }} {{ p.order.orderDate|date('d/m/Y') }} {{ p.order.cliente.nome|default('') }} {{ (loteI.price/100)|number_format(2,',','.') }} {{ (p.unitPrice/100)|number_format(2,',','.') }} {{ (loteI.price*p.quantity/100)|number_format(2,',','.') }} {{ (p.unitPrice*p.quantity/100)|number_format(2,',','.') }} {{ p.quantity }}
Quantidade total: {{ loteI.onhand }} Quantidade usada: {{ total }} Saldo: {{ loteI.onhand-total }}
Total de compra: R$ {{ (totalcompra/100)|number_format(2,',','.') }} Total de venda: R$ {{ (totalvenda/100)|number_format(2,',','.') }} Saldo: R$ {{ ((totalvenda-totalcompra)/100)|number_format(2,',','.') }}
Total {{ total }}
{% endfor %}