

<div class='row'>
  <div class="col-lg-11 col-md-11 col-sm-11">
    <h2>Payment Debit</h2>
      <table class='table table-striped'>
        <tr>
          <td> Payment Reference
          </td>
          <td><input id='reference' type='text' value=''/></td>
        </tr>
        <tr>
          <td> Remark
          </td>
          <td><input id='remark' type="text" value=''/></td>
        </tr>
        <tr>
          <td> Amount
          </td>
          <td><input id='amount' type="text" value=''/></td>
        </tr>
      </table>

    </div>
    <div class="col-lg-1 col-md-1 col-sm-1">
      <button type="button" class="btn btn-primary btn-block" id='back'> Back </button>
      <button type="button" class="btn btn-primary btn-block" id='cash_out'> Cash Out </button>
    </div>
</div>

<script>

$('#cash_out').on('click',function(){
  var reference = $('#reference').val();
  var remark = $('#remark').val();
  var amount = $('#amount').val();
  $.ajax({type: "POST",
    url: "<%= origami_cash_outs_path %>",
    data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount,
    success:function(result){
      window.location.href = '/origami';
    }
  });
})

$('#back').on('click',function(){
    window.location.href = '/origami';
})
</script>
