<template>
    <div>
        <table class="table is-fullwidth is-striped is-bordered">
            <thead>
            <tr>
                <th>Núcleo</th>
                <th v-if="$root.devoluciones"><abbr title="Total sin tomar en cuenta las devoluciones">Total parcial $</abbr></th>
                <th v-if="$root.devoluciones"><abbr title="Devoluciones correspondientes al núcleo">Devoluciones $</abbr></th>
                <th><abbr title="Total a Pagar por el núleo">{{ $root.devoluciones ? 'Total real' : 'Total' }} $</abbr></th>
                <th class="is-1"><abbr title="Pagado">Pagado</abbr></th>
            </tr>
        </thead>
        <tbody>
            <admin-fila-pedido
                v-for="pedido in gdc.pedidos"
                :pedido="pedido" :key="pedido.id">
            </admin-fila-pedido>
        </tbody>
        </table>
        <table class="table is-striped is-bordered">
            <tr>
                <th colspan="2" class="has-background-black has-text-white has-text-centered">TOTALES</th>
            </tr>
            <tr>
                <th>Total a recaudar:</th>
                <td class="has-text-right">$ {{ gdc.total_a_recaudar }}</td>
            </tr>
            <tr>
                <th>Total bonos barriales:</th>
                <td class="has-text-right">$ {{ gdc.total_barrial }}</td>
            </tr>
            <tr v-if="$root.devoluciones">
                <th>Total devoluciones:</th>
                <td class="has-text-right">- $ {{ gdc.total_devoluciones }}</td>
            </tr>
            <tr>
                <th>Cantidad bonos de transporte:</th>
                <td class="has-text-right">{{ gdc.cantidad_transporte }}</td>
            </tr>
            <tr>
                <th>Total bonos de transporte:</th>
                <td class="has-text-right">$ {{ gdc.total_transporte }}</td>
            </tr>
            <tr>
                <th>Total a depositar:</th>
                <td class="has-text-right">$ {{ gdc.total_a_transferir }}</td>
            </tr>
        </table>
    </div>
</template>

<script>
import FilaPedido from "./FilaPedido.vue";
export default {
    components: {
        FilaPedido
    },
    props: {
        gdc: {
            type: Object,
            required: true
        }
    }
}
</script>

<style>

</style>