{% set cp = doc.company %} {% set isNota = doc.tipoDoc in ['07', '08'] %} {% set isAnticipo = doc.totalAnticipos is defined and doc.totalAnticipos > 0 %} {% set name = doc.tipoDoc|catalog('01') %}
{% if doc.tipoDoc == '08' %}
{{ cp.razonSocial }}
Almacen: {{ cp.address.direccion }}
E-mail: ventas@dubaumetalindustria.com
Telefono: 937 063 014
{{ params.user.header|raw }}
{{ name }}
R.U.C.: {{ cp.ruc }}
{{ doc.serie }}-{{ doc.correlativo }}

{% else %}
{{ cp.razonSocial }}
Almacen: {{ cp.address.direccion }}
{{ name }} ELECTRONICA
R.U.C.: {{ cp.ruc }}
{{ doc.serie }}-{{ doc.correlativo }}
{% endif %}
{% set cl = doc.client %}
Razon Social: {{ cl.rznSocial }}
Direccion: {% if cl.address %}{{ cl.address.direccion }}{% endif %}
Fecha Emision: {{ doc.fechaEmision|date('d/m/Y') }} {% if doc.fechaEmision|date('H:i:s') != '00:00:00' %} {{ doc.fechaEmision|date('H:i:s') }} {% endif %} {% if doc.fecVencimiento is defined and doc.fecVencimiento %}

Fecha Vencimiento: {{ doc.fecVencimiento|date('d/m/Y') }} {% endif %}
{% if isNota %} Documento Ref.: {{ doc.numDocfectado }} {% endif %}
{{ cl.tipoDoc|catalog('06') }}: {{ cl.numDoc }}
{% if isNota %} Tipo Doc. Ref.: {{ doc.tipDocAfectado|catalog('01') }} {% else %} Guias: {% if doc.guias %} {% for guia in doc.guias %} {{ guia.nroDoc }}   {% endfor %} {% endif %} {% endif %}
Tipo Moneda: {{ doc.tipoMoneda|catalog('021') }}

{% set moneda = doc.tipoMoneda|catalog('02') %} {% if doc.tipoDoc == '08' %} {% else %} {% endif %} {% for det in doc.details %} {% if doc.tipoDoc == '08' %} {% else %} {% endif %} {% if loop.last %} {% endif %} {% endfor %}
Cantidad Codigo Descripcion Valor Unitario Valor Total Codigo Descripcion Und. Cant. P.U. s/ IGV Sub Total
{{ det.cantidad|n_format }} {{ det.unidad }} {{ det.codProducto }} {{ det.descripcion }}
{{ moneda }} {{ det.mtoValorUnitario|n_format }} {{ moneda }} {{ det.mtoValorVenta|n_format }} {{ loop.index }} {{ det.codProducto }} {{ det.descripcion }}
{{ det.unidad }} {{ det.cantidad|n_format }} {{ moneda }} {{ det.mtoValorUnitario}} {{ moneda }} {{ det.mtoValorVenta|n_format }}


{% if doc.tipoDoc == '08' %} IMPORTE EN LETRAS: {{ legend(doc.legends, '1000') }} {% else %} SON: {{ legend(doc.legends, '1000') }} {% endif %}
{% if isAnticipo %}

Anticipo
{% for atp in doc.anticipos %} {% endfor %}
Nro. Doc. Total
{{ atp.nroDocRel }} {{ moneda }} {{ atp.total|n_format }}
{% endif %}

{% if isAnticipo %} {% endif %} {% if doc.mtoOperGravadas %} {% endif %} {% if doc.perception and doc.perception.mto %} {% set perc = doc.perception %} {% set soles = 'PEN'|catalog('02') %} {% endif %}
Total Anticipo : {{ moneda }} {{ doc.totalAnticipos|n_format }}
SUB TOTAL : {{ moneda }} {{ doc.mtoOperGravadas|n_format }}
I.G.V - 18% {% if params.user.numIGV is defined %} {{ params.user.numIGV }}%{% endif %} : {{ moneda }} {{ doc.mtoIGV|n_format }}
TOTAL : {{ moneda }} {{ doc.mtoImpVenta|n_format }}
Percepción : {{ soles }} {{ perc.mto|n_format }}
Total a Pagar : {{ soles }} {{ perc.mtoTotal|n_format }}
{% if doc.tipoDoc != '15' %}

Informacion Adicional
{% if not isNota %} {% endif %} {% if isNota %} {% endif %} {% if params.user.extras is defined %} {% for item in params.user.extras %} {% if loop.index % 4 == 0 and loop.index < params.user.extras|length %}
{% endif %} {% endfor %} {% endif %}
LEYENDA :

{% for leg in doc.legends %} {% if leg.code != '1000' %} {{ leg.value }}
{% endif %} {% endfor %}

GUIA :

{% for guia in doc.guias %} {{ guia.nroDoc }} {% endfor %}

MOTIVO DE EMISION : {{ doc.desMotivo }}
{{ item.name|upper }} : {{ item.value }}
{% if isAnticipo %}

Anticipo
{% for atp in doc.anticipos %} {% endfor %}
Nro. Doc. Total
{{ atp.nroDocRel }} {{ moneda }} {{ atp.total|n_format }}
{% endif %}
{% endif %}

{% if max_items is defined and doc.details|length > max_items %}
{% endif %}