@extends('layout')

@section('content')
<style type="text/css">
.table_td_align_top > tbody > tr > td{
	vertical-align : top;
}
.modal-cetak .form-group{
	margin-bottom: 5px !important;
}
</style>

<div class="page-header page-header-default">
	<div class="breadcrumb-line">
		<ul class="breadcrumb">
			<li><a href="{{ url('hutang') }}"><i class="icon-home2 position-left"></i> Hutang</a></li>
			<li class="active">Daftar Bayar Tagihan</li>
		</ul>
	</div>
</div>

<div class="content">
	<div class="panel panel-flat">
		<div class="panel-heading">
			<h5 class="panel-title">Edit Pembayaran Tagihan</h5>
			<div class="heading-elements">
				<ul class="icons-list">
					<li><a href="{{ url('order_service/daftar_bayar_tagihan/'.$id_orderservice) }}" class="text-warning"><i class="icon-circle-left2 warning"></i> Kembali</a></li>
				</ul>
			</div>
		</div>

		<div class="panel-body">
			<form class="form-horizontal" method="POST" action="{{ url('order_service/pembayaran/update/'.$id_belibayar.'/'.$id_orderservice) }}">{{ csrf_field() }}
				<div class="col-sm-12 col-md-12">
					<div class="row col-sm-6 col-md-6">
						<div class="form-group">
							{{ Form::label("Label CV", "", ['class'=>'control-label col-sm-4']) }}
							<div class="col-sm-8">
								<div class="checkbox">
									<label>
										{{ Form::checkbox("cv", '1', ($order_service->cv==1) ? "true":"false", ['class'=>'styled', 'disabled'=>'disabled']) }}
									</label>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="control-label col-sm-4">Penyedia</label>
						<div class="col-sm-8">
							{{ Form::text("penyedia", $order_service->nama_penyedia, ['class'=>'form-control', 'readonly'=>'']) }}
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-4">Tanggal Input</label>
						<div class="col-sm-8">
							{{ Form::text("tanggal", date_db($order_service->tanggal, true), ['class'=>'form-control', 'readonly'=>'']) }}
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-4">Tanggal Order Service</label>
						<div class="col-sm-8">
							{{ Form::text("tanggal_faktur", date_db($order_service->tanggal_faktur, true), ['class'=>'form-control', 'readonly'=>'']) }}
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-4">No Faktur</label>
						<div class="col-sm-8 col-md-8">
							{{ Form::text("tanggal_faktur", $order_service->no_faktur."".$order_service->sufix_no_faktur, ['class'=>'form-control', 'readonly'=>'']) }}
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-4">Keterangan</label>
						<div class="col-sm-8">
							{{ Form::textarea("keterangan", $order_service->keterangan, ['class'=>'form-control', 'rows'=>6, 'readonly'=>'']) }}
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="alert alert-info">
						<table class="table">
							<tbody>
								<tr style="font-size: 20px;">
									<th width="25%">Pembayaran</th>
									<th class="text-right">{{ "Rp".rupiah2($order_service->total_bayar, 2) }}</th>
								</tr>
								<tr>
									<td>Tagihan</td>
									<td class="text-right">{{ "Rp".rupiah2($order_service->nominal_netto, 2) }}</td>
								</tr>
								<tr style="font-size: 15px;">
									<th class="text-left">Sisa Tagihan</th>
									<th class="text-right">{{ "Rp".rupiah2($order_service->nominal_netto-$order_service->total_bayar, 2) }}</th>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="control-label col-sm-4">Tanggal Bayar</label>
						<div class="col-sm-8">
							{{ Form::text("tanggal_bayar", date_db($akun_bayar->tanggal_bayar, true), ['class'=>'form-control set_datepicker']) }}
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="control-label col-sm-4">No Transaksi</label>
						<div class="col-sm-8">
							{{ Form::text("no_transaksi_bayar", $akun_bayar->no_transaksi_bayar, ['class'=>'form-control']) }}
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="control-label col-sm-4">Akun Bayar</label>
						<div class="col-sm-8">
							{{ Form::select("akun_bayar", $akunBayar, $akun_bayar->id_akun, ["class"=>"form-control set_selected"]) }}
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="control-label col-sm-4">Bayar</label>
						<div class="col-sm-8">
							<input type="number" min="0" step="0.01" class="form-control text-right" name="jum_bayar" id="jum_bayar" value="{{ $akun_bayar->jum_bayar }}" onkeyup="setFormatMoney($(this))" required>
							<span class="help-block text-nominal text-right" id="lbl_bayar" style="font-weight: bold;">Rp {{ rupiah2($akun_bayar->jum_bayar, 2) }}</span>
						</div>
					</div>
				</div>
				<div class="col-sm-12 col-md-12 text-right">
					<a href="{{ url('order_service/daftar_bayar_tagihan/'.$id_orderservice) }}" class="btn btn-md btn-default">Batal</a>
					<button type="submit" class="btn btn-md btn-success">Simpan</button>
				</div>
			</form>
		</div>

	</div>
</div> <!-- end : .content -->

<script type="text/javascript">
	function setFormatMoney(this_) {
		var data = this_.val();
		if(data==""){
			data = 0;
		}
		$("#lbl_bayar").html(accounting.formatMoney(data));
	}
</script>

@endsection