<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/datepicker.min.css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/datepicker3.min.css" />
<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/bootstrap-datepicker.min.js"></script>

<h3 class="text-center">Reversar pago</h3>

<?php $this->widget('bootstrap.widgets.TbAlert', [
    'block' => true,
    'fade' => true,
    'closeText' => '&times;',
    'alerts' => [
        'error' => ['block' => true, 'fade' => true, 'Text' => '&times;'],
    ],
]); ?>

<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', [
    'id' => 'datos-txt-integrado-form',
    'enableAjaxValidation' => false,
    'htmlOptions' => ['onsubmit' => 'activar_barra()'],
    'type' => 'horizontal',
]); ?>
    <p class="help-block">Los campos con <span class="required">*</span> son obligatorios.</p>
    <br>
    <?php if ($model->validacionFechaComprobante()): ?>
    <?= $form->textFieldRow($model, 'fecha_comprobante', ['class' => 'input-small datepicker', 'readOnly' => 'readOnly']); ?>
    <?php endif; ?>

    <?php echo $form->textAreaRow($model, 'observacion', ['rows' => 6, 'cols' => 50, 'class' => 'span8']); ?>
    <div class="form-actions">
        <?php $this->widget('bootstrap.widgets.TbButton', [
            'buttonType' => 'submit',
            'type' => 'primary',
            'label' => 'Guardar',
        ]); ?>
    </div>
<?php $this->endWidget(); ?>

<?= $this->renderPartial('application.modules.aportes.views.datosTxtIntegrado.barra_carga', ['titulo' => 'Reversando retiro parcial.']); ?>

<script type="text/javascript">
var dateString = '<?= $model->getFechaComprobante() ?>';
let date = new Date(dateString);
date.setDate(date.getDate() + 1);

$(document).ready(function () {
    $('.datepicker').datepicker({
        format: "dd-mm-yyyy",
        startDate: date,
        todayBtn: "linked",
        forceParse: false,
        daysOfWeekDisabled: "0,6",
        orientation: "top auto",
        toggleActive: true,
        language:'es',
        autoclose: true
    });
});
</script>
