<?php
$this->load->view('includes/header.php');
?>
<script type="text/javascript">
//Date picker
	$(function() {
		$( "#txt_postdate" ).datepicker({
			changeMonth: true,
			changeYear: true
		});
		$( "#txt_postdate" ).datepicker( "option", "dateFormat", "dd.mm.yy" );	
	});

</script>
<?php
if ( ! empty($prev))
	{
?>
<?php
	
echo '<font class="title">'.$menu_path.'</font>';
echo '<br>';
			/* Display system message */
			$this->fungsi->disp_sys_msg();
			echo validation_errors('<p class="field_error">', '</p>');
?>
<form name="form1" method="post" action="<?php echo $form_action ?>">
  <table width="100%" border="0" cellspacing="1" cellpadding="1">
    <tr>
      <td>Acc. Doc. No</td>
      <td>:</td>
      <td><?php echo $txt_gl; ?>
      <input type="hidden" name="txt_gl" id="txt_gl" value="<?php echo $this->fungsi_sap->fm_convert_vendor($txt_gl); ?>" /></td>
    </tr>
    <tr>
      <td>Fiscal Period</td>
      <td>:</td>
      <td><?php echo $txt_fis; ?>
      <input type="hidden" name="txt_fis" id="txt_fis" value="<?php echo $txt_fis; ?>" /></td>
    </tr>
    <tr>
      <td width="14%">Fiscal Year</td>
      <td width="1%">:</td>
      <td width="85%"><?php echo $txt_year; ?>
      <input type="hidden" name="txt_year" id="txt_year" value="<?php echo $txt_year; ?>" /></td>
    </tr>
    <tr>
      <td>Reason For Reversal</td>
      <td>:</td>
      <td><?php echo $txt_reason; ?>
        <input type="hidden" name="txt_reason" id="txt_reason" value="<?php echo $txt_reason; ?>" />      </tr>
    <tr>
      <td>Posting Date</td>
      <td>:</td>
      <td><?php echo $txt_postdate; ?>
      <input type="hidden" name="txt_postdate" id="txt_postdate" value="<?php echo $txt_postdate; ?>" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>No. CPV</td>
      <td>:</td>
      <td><?php echo $txt_cpvno; ?>
      <input type="hidden" name="txt_nocpv" id="txt_nocpv" value="<?php echo $txt_cpvno; ?>" />
      <input type="hidden" name="txt_cpv" id="txt_cpv" value="<?php echo $txt_cpv; ?>" />
      <input type="hidden" name="txt_cpv_year" id="txt_cpv_year" value="<?php echo $txt_cpv_year; ?>" />
      <input type="hidden" name="txt_idcab" id="txt_idcab" value="<?php echo $txt_idcab; ?>" />
      <input type="hidden" name="txt_cpv_pctyp" id="txt_cpv_pctyp" value="<?php echo txt_cpv_pctyp; ?>" />
      <input type="hidden" name="txt_cpv_pctrans" id="txt_cpv_pctrans" value="<?php echo txt_cpv_pctrans; ?>" /></td>
    </tr>
    <tr>
      <td>No. CPDU</td>
      <td>:</td>
      <td><?php echo $txt_cpdu; ?></td>
    </tr>
    <tr>
      <td>Amount</td>
      <td>:</td>
      <td><?php echo $this->fungsi->format_idr($txt_amount); ?>
      <input type="hidden" name="txt_amount" id="txt_amount" value="<?php echo $txt_amount; ?>" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Cancel Reason</td>
      <td>:</td>
      <td><?php echo $txt_cancel; ?>
      <input type="hidden" name="txt_cancel" id="txt_cancel"  value="<?php echo $txt_cancel; ?>"/>
      <input type="hidden" name="txt_obj" id="txt_obj"  value="<?php echo $txt_obj; ?>"/></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input type="button" name="button3" onclick="goBack()" id="button3" value="Back" class="button" />
        <input type="submit" name="button2" id="button2" value="Submit" class="button" /></td>
    </tr>
  </table>
</form>
<?php
	}
else
{
echo '<font class="title">'.$menu_path.'</font>';
echo '<br>';
			/* Display system message */
			$this->fungsi->disp_sys_msg();
			echo validation_errors('<p class="field_error">', '</p>');
?>
<form name="form1" method="post" action="<?php echo $form_action ?>">
  <table width="100%" border="0" cellspacing="1" cellpadding="1">
    <tr>
      <td>Acc. Doc. No</td>
      <td>:</td>
      <td><input name="txt_gl" type="text" id="txt_gl" value="<?php echo set_value('txt_gl', isset($default['txt_gl']) ? $default['txt_gl'] : ''); ?>" size="10" maxlength="10" />
        <font class="required">*</font></td>
    </tr>
    <tr>
      <td>Fiscal Period</td>
      <td>:</td>
      <td><input name="txt_fis" type="text" id="txt_fis" value="<?php echo set_value('txt_fis', isset($default['txt_fis']) ? $default['txt_fis'] : ''); ?>" size="2" maxlength="2" />
        <font class="required">*</font></td>
    </tr>
    <tr>
      <td width="14%">Fiscal Year</td>
      <td width="1%">:</td>
      <td width="85%"><label for="txt_year4">
        <input name="txt_year" type="text" id="txt_year4" value="<?php echo set_value('txt_year', isset($default['txt_year']) ? $default['txt_year'] : ''); ?>" size="4" maxlength="4" />
        <font class="required">*</font></label></td>
    </tr>
    <tr>
      <td>Reason For Reversal</td>
      <td>:</td>
      <td><label for="select5"></label>
        <select name="cb_reason" id="cb_reason">
          <option value="01">01 - Reversal in current period</option>
          <option value="02">02 - Reversal in closed period</option>
          <option value="03">03 - Actual reversal in current period </option>
          <option value="04">04 - Actual reversal in closed period </option>
          <option value="05">05 - Accrual/deferral posting</option>
        </select></td>
    </tr>
    <tr>
      <td>Posting Date</td>
      <td>:</td>
      <td><input name="txt_postdate" type="text" id="txt_postdate" size="10" value="<?php echo date('d.m.Y'); ?>"  maxlength="10" />
        <font class="required">*</font></td>
    </tr>
    <tr>
      <td>Cancel Reason</td>
      <td>:</td>
      <td><font class="required">
        <textarea name="txt_cancel" cols="50" rows="5" id="txt_cancel"><?php echo set_value('txt_cancel', isset($default['txt_cancel']) ? $default['txt_cancel'] : ''); ?></textarea>
        <font class="required">*</font></font></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input type="submit" name="button" id="button" value="Preview" class="button" /></td>
    </tr>
  </table>
</form>
<?php
}
if ( ! empty($link))
	{
		echo '<p id="bottom_link">';
		foreach($link as $links)
		{
			echo $links . ' ';
		}
		echo '</p>';
	}
$this->load->view('includes/footer.php');
	?>
