<template>
    <div class="row" @keyup.enter="submitForm">
        <div class="col bg-white padding-40 b-rad-lg">
            <loading-component style="height: 50px; top: 0;" key="1" color="success" v-show="$store.getters.isLoading(section)"></loading-component>
            <div class="row" v-show="!$store.getters.isLoading(section)">
                <div class="col text-center">
                    <div class="row m-b-20">
                        <div class="col">
                            <h5 class="all-caps">Update Credit Term Customer</h5>
                            <div class="fs-11">Are you sure you want to update the credit term status for this company to <b>{{ data.is_credit_term === 1 ? 'NO' : 'YES' }}</b>?</div>
                            <p class="fs-11 text-danger" v-if="data.is_credit_term === 0">All existing invoices for storage that have not yet been paid will be waived</p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col p-r-5">
                            <div data-dismiss="modal" class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none">Cancel</div>
                        </div>
                        <div class="col p-l-5">
                            <div class="btn btn-danger w-100 btn-sm" @click="submit(route('api.company.update.creditterm.status', data.id), 'post', section, true, true)">Confirm</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
    import modalFormHandler from '../../../general/mixins/modalFormHandler';
    export default {
        methods: {
            successHandler(response){
                this.$emit('update', response.payload.data);
                this.closeModal();
                this.formHandler();
            },
        },
        mixins: [modalFormHandler]
    }
</script>
