diff --git a/resources/templates/dte/documento/estandar.html.twig b/resources/templates/dte/documento/estandar.html.twig index 4a84bd9..7e2a433 100644 --- a/resources/templates/dte/documento/estandar.html.twig +++ b/resources/templates/dte/documento/estandar.html.twig @@ -1,8 +1,567 @@ + + + -

T{{ dte.Encabezado.IdDoc.TipoDTE }}F{{ dte.Encabezado.IdDoc.Folio }}

- +
+ {# Información del Emisor #} +
+ {# Logotipo #} + {% if dte.logo is not empty %} + Logotipo Emisor + {% endif %} + {# Razón Social del Emisor #} +

+ {{ dte.Encabezado.Emisor.RznSoc|default(dte.Encabezado.Emisor.RznSocEmisor) }} +

+ {# Giro del Emisor #} +

+ {{ dte.Encabezado.Emisor.GiroEmis|default(dte.Encabezado.Emisor.GiroEmisor) }} +

+ {# Dirección del Emisor #} +

+ {{ [dte.Encabezado.Emisor.DirOrigen, dte.Encabezado.Emisor.CmnaOrigen]|filter(v => v is not empty)|join(', ') }} +

+
+ {# Información del DTE #} +
+
+

R.U.T.: {{ dte.Encabezado.Emisor.RUTEmisor }}

+

{{ dte.Encabezado.IdDoc.TipoDTE }}

+

N° {{ dte.Encabezado.IdDoc.Folio }}

+
+ {# Sucursal SII #} +

S.I.I. - {{ dte.Encabezado.Emisor.CmnaOrigen }}

+
+
+
+ {# Información del Receptor #} +
+ + + {# Información del Receptor #} + {% if dte.Encabezado.Receptor.RUTRecep != '66666666-6' %} + + + + + {% endif %} + {# Razón Social #} + {% if dte.Encabezado.Receptor.RznSocRecep is not empty %} + + + + + {% endif %} + {# Giro #} + {% if dte.Encabezado.Receptor.GiroRecep is not empty %} + + + + + {% endif %} + {# Dirección #} + {% if dte.Encabezado.Receptor.DirRecep is not empty %} + + + + + {% endif %} + {# Tipo de Operación #} + {% if dte.Encabezado.IdDoc.IndTraslado is not empty %} + + + + + {% endif %} + {# Traslado #} + {% if dte.Encabezado.Transporte.NombreChofer is not empty %} + + + + + {% endif %} + {# Transporte #} + {% if dte.Encabezado.Transporte.Aduana.CodViaTransp is not empty %} + + + + + {% endif %} + {# País receptor #} + {% if dte.Encabezado.Transporte.Aduana.CodPaisRecep is not empty %} + + + + + {% endif %} + {# Total bultos #} + {% if dte.Encabezado.Transporte.Aduana.TotBultos is not empty %} + + + + + {% endif %} + {# Contacto #} + {% if dte.Encabezado.Receptor.CorreoRecep is not empty or dte.Encabezado.Receptor.Contacto is not empty %} + + + + + {% endif %} + {# Nacionalidad #} + {% if dte.Encabezado.Receptor.Extranjero is not empty %} + + + + + {% endif %} + {# Cód. recep #} + {% if dte.Encabezado.Receptor.CdgIntRecep is not empty %} + + + + + {% endif %} + {# Referencias #} + {% if dte.Referencia is not empty %} + {% for referencia in dte.Referencia %} + + + + + {% endfor %} + {% endif %} + +
R.U.T.:{{ dte.Encabezado.Receptor.RUTRecep }}
Razón Social:{{ dte.Encabezado.Receptor.RznSocRecep }}
Giro:{{ dte.Encabezado.Receptor.GiroRecep }}
Dirección:{{ dte.Encabezado.Receptor.DirRecep }}{% if dte.Encabezado.Receptor.CmnaRecep is not empty %}, {{ dte.Encabezado.Receptor.CmnaRecep }}{% endif %}{% if dte.Encabezado.Receptor.CiudadRecep is not empty %}, {{ dte.Encabezado.Receptor.CiudadRecep }}{% endif %}
Tipo oper.:{{ dte.Encabezado.IdDoc.IndTraslado }}
Traslado: + A {{ dte.Encabezado.Transporte.DirDest }}, {{ dte.Encabezado.Transporte.CmnaDest }} por {{ dte.Encabezado.Transporte.RUTTrans }} en vehículo {{ dte.Encabezado.Transporte.Patente }} con chofer {{ dte.Encabezado.Transporte.Chofer.NombreChofer }} ({{ dte.Encabezado.Transporte.Chofer.RUTChofer }}) +
Traslado: + {{ dte.Encabezado.Transporte.Aduana.CodViaTransp }} +
P. receptor: + {{ dte.Encabezado.Transporte.Aduana.CodPaisRecep }} +
Total bultos:{{ dte.Encabezado.Transporte.Aduana.TotBultos }}
Contacto:{{ dte.Encabezado.Receptor.CorreoRecep }}{{ dte.Encabezado.Receptor.Contacto }}
Nacionalidad: + {{ dte.Encabezado.Receptor.Extranjero.Nacionalidad }} +
Cód. recep.: + {{ dte.Encabezado.Receptor.CdgIntRecep }} +
Referencia: + {{ loop.index }} - {{ referencia.TpoDocRef }}{% if referencia.IndGlobal != 1 %} N°{{ referencia.FolioRef }}{% endif %} del {{ referencia.FchRef }}{% if referencia.RazonRef is not empty %}: {{ referencia.RazonRef }}{% endif %} +
+ +
+
+ {# Fecha de Emisión #} +

{{ dte.Encabezado.IdDoc.FchEmis }}

+ {# Fecha de Vencimiento #} + {% if dte.Encabezado.IdDoc.FchVenc is not empty %} +

Vence el {{ dte.Encabezado.IdDoc.FchVenc }}

+ {% endif %} + {# Período Desde/Hasta #} + {% if dte.Encabezado.IdDoc.PeriodoDesde is not empty and dte.Encabezado.IdDoc.PeriodoHasta is not empty %} +

+ Período del {{ dte.Encabezado.IdDoc.PeriodoDesde }} al {{ dte.Encabezado.IdDoc.PeriodoHasta }} +

+ {% endif %} + {# Fecha de Vencimiento #} + {% if dte.Encabezado.IdDoc.FmaPago is not empty %} +

Venta: {{ dte.Encabezado.IdDoc.FmaPago }}

+ {% endif %} +
+
+
+ + {# Encabezados de la Tabla #} + + + {% set mostrar_codigo = dte.Detalle|filter(detalle => detalle.CdgItem.VlrCodigo is not empty)|length > 0 %} + {% set mostrar_indexe = dte.Detalle|filter(detalle => detalle.IndExe is not empty)|length > 0 %} + {% set mostrar_unidad = dte.Detalle|filter(detalle => detalle.UnmdItem is not empty)|length > 0 %} + {% set mostrar_descuento = dte.Detalle|filter(detalle => detalle.DescuentoMonto is not empty or detalle.DescuentoPct is not empty)|length > 0 %} + {% if mostrar_codigo %} + + {% endif %} + + {% if mostrar_indexe %} + + {% endif %} + + {% if mostrar_unidad %} + + {% endif %} + + {% if mostrar_descuento %} + + {% endif %} + + + + {# Cuerpo de la Tabla #} + + {% set total_monto = 0 %} + {% for detalle in dte.Detalle %} + + {% if mostrar_codigo %} + + {% endif %} + {# Columna Ítem #} + + {% if mostrar_indexe %} + + {% endif %} + {# Columna Cantidad #} + + {# Columna Unidad #} + {% if mostrar_unidad %} + + {% endif %} + {# Columna Precio Unitario #} + + {# Columna Descuento #} + {% if mostrar_descuento %} + + {% endif %} + {# Columna Total Ítem #} + + + {% set total_monto = total_monto + (detalle.MontoItem | default(0)) %} + {% endfor %} + +
CódigoÍtemIECant.UnidadP. UnitarioDescuentoTotal Ítem
+ {{ detalle.CdgItem.VlrCodigo | default('') }} + +
{{ detalle.NmbItem | default('')}}
+ {% if detalle.DscItem is not empty %} +
+ {{ detalle.DscItem | default('') }} +
+ {% endif %} +
+ {% if detalle.IndExe == 1 %} + EX + {% else %} + {{ detalle.IndExe | default('') }} + {% endif %} + + {{ detalle.QtyItem | default('')}} + + {{ detalle.UnmdItem | default('') }} + + {{ detalle.PrcItem | number_format(0, ',', '.') | default('') }} + + {% if detalle.DescuentoPct is not empty %} + {{ detalle.DescuentoPct }}% + {% else %} + {{ detalle.DescuentoMonto | number_format(0, ',', '.') }} + {% endif %} + + {{ detalle.MontoItem | number_format(0, ',', '.') | default('') }} +
+
+ {% if dte.DscRcgGlobal is not empty %} +
+ + + + + + + {# Descuento o Recargo #} + {% for descuento in dte.DscRcgGlobal %} + + + + + {% endfor %} + +
+ Subtotal: + {{ total_monto | number_format(0, ',', '.') }}
+ {{ descuento.TpoMov|trim|upper == "D" ? "Descuento:" : "Recargo:" }} + {{ descuento.ValorDR }}{{ descuento.TpoValor }}
+
+ {% endif %} + {# Observación #} + {% if dte.Encabezado.IdDoc.TermPagoGlosa is not empty %} +
+

+ Observación:{{ dte.Encabezado.IdDoc.TermPagoGlosa }} +

+
+ {% endif %} +
+ {# Contenedor del timbre electrónico #} +
+ {% if dte.timbre is not empty %} + {# Imagen del timbre #} + Timbre Electrónico + {# Texto debajo del timbre #} +

+ Timbre Electrónico SII +

+

Resolución {{ dte.Caratula.FchResol }}

+

Verifique documento: libredte.cl/boletas

+ {% endif %} +
+ {# Montos #} +
+ + + {# Neto #} + {% if dte.Encabezado.Totales.MntNeto is not empty %} + + + + + {% endif %} + {# Monto #} + {% if dte.Encabezado.Totales.TpoMoneda is not empty %} + + + + + {% endif %} + {# Exento #} + {% if dte.Encabezado.Totales.MntExe is not empty %} + + + + + {% endif %} + {# IVA #} + {% if dte.Encabezado.Totales.IVA is not empty %} + + + + + {% endif %} + {# IVA no retenido #} + {% if dte.Encabezado.Totales.IVANoRet is not empty %} + + + + + {% endif %} + {# IVA adicional #} + {% if dte.Encabezado.Totales.ImptoReten is not empty %} + {% for impuesto in dte.Encabezado.Totales.ImptoReten %} + + + + + {% endfor %} + {% endif %} + {# Total #} + + + + + {# No facturable #} + {% if dte.Encabezado.Totales.MontoNF is not empty %} + + + + + {% endif %} + {# Total PESO CL #} + {% if dte.Encabezado.OtraMoneda is not empty %} + {% for moneda in dte.Encabezado.OtraMoneda %} + + + + + {% endfor %} + {% endif %} + {# Monto periodo #} + {% if dte.Encabezado.Totales.MontoPeriodo is not empty %} + + + + + {% endif %} + + +
+ Neto $: + {{ dte.Encabezado.Totales.MntNeto | number_format(0, ',', '.') }}
+ Moneda: + {{ dte.Encabezado.Totales.TpoMoneda }}
+ Exento $: + {{ dte.Encabezado.Totales.MntExe | number_format(0, ',', '.') }}
+ IVA {{ dte.Encabezado.Totales.TasaIVA is not empty ? '(' ~ dte.Encabezado.Totales.TasaIVA ~ '%):' : '$:' }} + {{ dte.Encabezado.Totales.IVA | number_format(0, ',', '.') }}
+ IVA no retenido: + {{ dte.Encabezado.Totales.IVANoRet | number_format(0, ',', '.') }}
+ {{ impuesto.TipoImp }} ({{ impuesto.TasaImp }}%): + {{ impuesto.MontoImp | number_format(0, ',', '.') }}
+ Total $: + {{ dte.Encabezado.Totales.MntTotal | number_format(0, ',', '.') }}
+ No facturable $: + {{ dte.Encabezado.Totales.MontoNF | number_format(0, ',', '.') }}
+ Total {{ moneda.TpoMoneda }}: + {{ moneda.MntTotOtrMnda | number_format(0, ',', '.') }}
+ Monto período $: + {{ dte.Encabezado.Totales.MontoPeriodo | number_format(0, ',', '.') }}
+
+
+ {# Footer #} +