<?php
/*------------------------------------------------------------------------
# com_finances - Expense Manager for Joomla
# ------------------------------------------------------------------------
# author        Germinal Camps
# copyright       Copyright (C) 2015 joomlathat.com. All Rights Reserved.
# @license        http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites:       http://www.joomlathat.com
# Technical Support:  Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/

//no direct access
defined('_JEXEC') or die('Restricted access.');
?>

<!-- Modal -->
<div  class="modal fade invoice-manager"
      id="detailsModal"
      tabindex="-1"
      role="dialog"
      aria-labelledby="detailsModalLabel">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-body">

        <div id="invoice-paper" class="invoice-paper-modal" >
          <invoicepreview
                          v-show="current_action == 'preview'"
                          v-if="!isSplitView()"
                          :invoice="current_invoice"
                          >
          </invoicepreview>
        </div>
        <invoiceform  v-if="!isSplitView()"
                      v-show="current_action == 'edit'"
                      :invoice="current_invoice"
                      >
        </invoiceform>
      </div>
      <div class="modal-footer" v-show="current_action == 'preview'">

        <?php echo $this->loadTemplate('buttonbar'); ?>

      </div>
      <div class="modal-footer" v-show="current_action == 'edit'">
        <button type="button"
                class="btn btn-link btn_no_underline pull-left maindeletebutton"
                id="deletebutton_modal"
                data-loading-text="<?php echo JText::_('DELETING_INVOICE'); ?>"
                @click.prevent="delete_invoice()">
          <span class="dlt-item"><?php echo JText::_('DELETE_INVOICE');?></span></button>
        <button type="button"
                class="btn btn-primary pull-right"
                id="savebutton_modal"
                data-loading-text="<?php echo JText::_('SAVING'); ?>"
                @click.prevent="saveInvoice()"><?php echo JText::_('SAVE_INVOICE'); ?></button>
        <button type="button"
                class="btn btn-default pull-right"
                id="closebutton_modal"
                data-dismiss="modal"
                aria-hidden="true"><?php echo JText::_('CLOSE'); ?></button>
      </div>
    </div>
  </div>
</div>
