<template>
    <tr>
        <td>{{ pedido.nombre }}</td>
        <td v-if="$root.devoluciones" class="has-text-right" >{{ this.$limpiarInt(pedido.total) }}</td>
        <td v-if="$root.devoluciones" class="has-text-right" ><abbr :title="pedido.devoluciones_notas">-{{ pedido.devoluciones_total }}</abbr></td>
        <td class="has-text-right" >{{ $root.devoluciones ? pedido.total_menos_devoluciones : pedido.total }}</td>
        <td>
            <pedidos-admin-switch-aprobacion
                :pedido="pedido">
            </pedidos-admin-switch-aprobacion>
        </td>
    </tr>
</template>

<script>
import SwitchAprobacion from "./SwitchAprobacion.vue";
export default {
    components: {
        SwitchAprobacion
    },
    props: {
        pedido: Object
    },
    mounted() {
        Event.$on('sync-aprobacion', (unPedido) => {
            if (this.pedido.id === unPedido.id) {
                this.pedido = unPedido
            }
        })
    }
}
</script>

<style scoped>

</style>