Anons79 Mini Shell

Directory : /home/aplikasiposinfo/public_html/hayyumart.com/resources/views/bayar_pembelian/
Upload File :
Current File : /home/aplikasiposinfo/public_html/hayyumart.com/resources/views/bayar_pembelian/detail.blade.php

@extends('layouts.app')

@section('content')
<div class="main-container">
    <div class="container-fluid">
        <div class="page-breadcrumb">
            <div class="row">
                <div class="col-md-7">
                    <div class="page-breadcrumb-wrap">

                        <div class="page-breadcrumb-info">
                            <h2 class="breadcrumb-titles"><a href="{{ url($url) }}">{{ $title }}</a></h2>
                            <ul class="list-page-breadcrumb">
                                <li><a href="#">{{ $menu }}</a>
                                </li>
                                <li  ><a href="{{ url($url) }}">{{ $title }}</a></li>
                                <li class="active-page" ><a href="{{ url($url) }}">Detail Data {{ $title }}</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="col-md-5">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="box-widget widget-module">
                    <div class="widget-head clearfix">
                        <span class="h-icon"><i class="fa fa-table"></i></span>
                        <h4>Data {{ $title }}</h4>
                        <div class="pull-right" style="padding: 10px;position: relative;z-index: 99;">
							<a href="{{ url($url.'/'.$data->no_hutang) }}/cetak" class="btn  btn-primary mr-2" target="_blank">Cetak</a>
                            <a href="{{ url($url) }}" class="btn  btn-warning ">Kembali</a>
                        </div>
                        
                    </div>
                    <div class="widget-container">
                        <div class="widget-block">
                            <div class="row">
                                <div class="col-md-6">

                                    <form class="form-horizontal" method="post" action="{{ url($url) }}">
                                        @csrf
                                        
                                        <div class="form-group">
                                            <label class="col-md-4 control-label">Kode Pembelian</label>
                                            <div class=" col-md-8">
                                                <input type="text" class="form-control" name="no_pembelian" placeholder="Kode Pembelian" value="{{ $data->pembelian->no_pembelian }}" readonly="" disabled="">
                                                <input type="hidden" name="no_hutang" value="{{ $data->no_hutang }}">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-4 control-label">Nama Supplier</label>
                                            <div class=" col-md-8">
                                                <input type="text" class="form-control" name="nm_supplier" placeholder="Nama Supplier" value="{{ $data->pembelian->supplier->nm_supplier }}" readonly="" disabled="">
                                            </div>
                                        </div>


                                        <div class="form-group">
                                            <label class="col-md-4 control-label">Alamat</label>
                                            <div class=" col-md-8">
                                                <textarea class="form-control" name="alamat" placeholder="Alamat" readonly="" disabled="">{{ $data->pembelian->supplier->alamat }}</textarea>
                                                
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-4 control-label">Telepon</label>
                                            <div class=" col-md-8">
                                                <input type="text" class="form-control phone-mask" name="no_telepon" value="{{ $data->pembelian->supplier->no_telepon }}" readonly="" disabled="">
                                                
                                            </div>
                                        </div>
                                        <?php 
                                            $hutang = $data->sisa_hutang;
                                            foreach($data->BayarPembelian->where('status', 'sukses') as $bp){
                                                $hutang -= $bp->uang_bayar;
                                            }
                                        ?>

                                        @if($hutang > 0)
                                            <div class="form-group">
                                                <label  class="col-md-4 control-label">Tanggal : </label>
                                                <div class=" col-md-8">
                                                    <input type="date" class="form-control" name="tgl_bayar_pembelian" value="{{ date('Y-m-d') }}">
                                                    
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-4 control-label">Sisa Hutang : </label>
                                                <div class=" col-md-8">
                                                    <input type="text" class="form-control" name="hutang" min="0" value="{{ $hutang }}" readonly="" disabled="">
                                                    
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-md-4 control-label">Bayar : </label>
                                                <div class=" col-md-8">
                                                    <input type="text" class="money form-control" name="uang_bayar" min="0" value="0" required="">
                                                    
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-md-4 control-label">&nbsp;</label>
                                                <div class="col-md-8">
                                                    <div class="form-actions">
                                                        <button type="submit" class="btn btn-primary">Bayar</button>
                                                        
                                                    </div>
                                                </div>
                                            </div>
                                        @else
                                        <div class="form-group">
                                            <div class="col-md-4"></div>
                                            <label class="col-md-8 label label-success" style="font-size: 15px;">Sudah Lunas</label>
                                                                                    
                                        </div>
                                        @endif

                                        
                                        
                                    </form>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>    
            </div>
        </div>

        <div class="row">
            <div class="col-md-12">
                <div class="box-widget widget-module">
                    <div class="widget-head clearfix">
                        <span class="h-icon"><i class="fa fa-table"></i></span>
                        <h4>Data Pembayaran</h4>
                        
                        
                    </div>
                    <div class="widget-container">
                        <div class="widget-block">
                            <div class="row">
                                <div class="col-md-12">

                                    <table class="table table-hover table-bordered">
                                      <tr>
                                        <th width="5%">No</th>
                                        <th width="30%">Tanggal</th>
                                        <th>Pembayaran</th>
                                        <th>Status Approve</th>
                                    </tr>
                                    <?php 
                                    $no = 1; 
                                    $subtotal = 0;
                                    ?>
                                    @foreach($data->BayarPembelian as $bp)
                                    
                                    @php
                                    $subtotal += $bp->uang_bayar
                                    @endphp
                                    <tr>
                                        <td>{{ $no }}</td>
                                        <td>{{ $bp->tgl_bayar_pembelian }}</td>
                                        <td>Rp.  {{ number_format($bp->uang_bayar)  }}</td>
                                        <td class="tc-center">
                                            <div class="btn-toolbar" role="toolbar">
                                                <div class="btn-group" role="group">
                                                    @if($bp->status == 'sukses')
                                                    <button class="btn btn-success btn-sm">Sukses</button>
                                                    @endif
                                                    @if($bp->status == 'pending')
                                                    <button class="btn btn-warning btn-sm ">Pending</button>
                                                    @endif
                                                    @if($bp->status == 'disetujui')
                                                    <a href="{{ url($url.'/'.$bp->no_bayar_pembelian. '/bayar') }}" class="btn btn-primary btn-sm" onclick="return confirm('Bayar Hutang Ini ?')">Disetujui, Bayar Hutang Ini ?</a>
                                                    @endif
                                                    @if($bp->status == 'cancel')
                                                    <button class="btn btn-danger btn-sm m-user-delete"> Cancel</button>
                                                    @endif
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    @endforeach


                                    <tr>
                                        <td colspan="2"><b>Total Hutang : </b></td>
                                        <td colspan="2">Rp. {{ number_format($data->sisa_hutang) }}</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"><b>Total Pembayaran : </b></td>
                                        <td colspan="2"><?php 
                                        echo "Rp. ".number_format($subtotal); ?>
                                        </td>
                                    @if($hutang > 0)
                                        <tr>
                                            <td colspan="2"><b>Sisa Yang Belum Di Bayar : </b></td>
                                            <td colspan="2"><?php echo "Rp. ".number_format($hutang); ?> </td>
                                        </tr>
                                    @else
                                        <tr>
                                            <td colspan="3"><label class=" label label-success" style="font-size: 15px;">Sudah Lunas</label></td>
                                            
                                        </tr>

                                        <tr>
                                            <td colspan="2"><b>Sisa Pembayaran Hutang : </b></td>
                                            <td colspan="2"><?php echo "Rp. ".number_format($data->sisa_hutang - $subtotal ); ?> </td>
                                        </tr>
                                    @endif
                                </table>
                            </div>

                        </div>
                    </div>
                </div>
            </div>    
        </div>    
    </div>


    <div class="row">
        <div class="col-md-12">
            <div class="box-widget widget-module">
                <div class="widget-head clearfix">
                    <span class="h-icon"><i class="fa fa-table"></i></span>
                    <h4>Detail Pembelian Barang</h4>
                </div>
                <div class="widget-container">
                    <div class="widget-block">
                        <div id="list-contain">
                            <table class="table table-striped table-responsive"  style="margin-top: -10px;" width="800" border="0" cellspacing="1" cellpadding="2">
                                <tr >
                                  <td width="29" ><strong>No</strong></td>
                                  <td width="85" ><strong>Kode</strong></td>
                                  <td width="432"><strong>Nama Barang </strong></td>
                                  <td width="85" align="right"><strong>Harga (Rp) </strong></td>
                                  <td width="60" align="right"><strong>Diskon (%)</strong></td>
                                  <td width="48" align="right"><strong>Jumlah</strong></td>
                                  <td width="100" align="right"><strong>Sub Total(Rp) </strong></td>
                                  <td width="22" align="center">&nbsp;</td>
                                </tr>
                            <?php $no = 1; 
                            $hargaDiskon= 0; 
                            $totalBayar = 0; 
                            $jumlahbarang   = 0;
                            ?>
                            @foreach($data->pembelian->detail as $dd)
                            <?php
                                
                                $hargaDiskon= $dd->harga_barang->harga_beli - ( $dd->harga_barang->harga_beli * $dd->diskon/100);
                                $subSotal   = $dd->jumlah * $hargaDiskon ;
                                $totalBayar = $totalBayar + $subSotal;
                                $jumlahbarang   = $jumlahbarang + $dd->jumlah;
                            ?>
                                <tr>
                                  <td><?php echo $no; ?></td>
                                  <td><?php echo $dd->harga_barang->barang->kd_barang; ?></b></td>
                                  <td><?php echo $dd->harga_barang->barang->nm_barang; ?></td>
                                  <td align="right"><?php echo number_format($dd->harga_barang->harga_beli); ?></td>
                                  <td align="right"><?php echo $dd->diskon; ?></td>
                                  <td align="right"><?php echo $dd->jumlah; ?></td>
                                  <td align="right"><?php echo number_format($subSotal); ?></td>
                                  <td></td>
                                </tr>
                                
                                <?php $no++; ?>
                            @endforeach
                                <tr>
                                  <td colspan="5" align="right" ><strong>TOTAL BELANJA  (Rp.) : </strong></td>
                                  <td align="right" ><b><?php echo $jumlahbarang; ?></b></td>
                                  <td align="right" ><b><?php echo number_format($totalBayar); ?></b></td>
                                  <td >&nbsp;</td>
                                </tr>
                                
                                <?php 
                                    $ppn = 0;
                                    if($data->pembelian->ppn == 1){
                                      $ppn = $totalBayar * 10/100;
                                    }
                                    
                                    $grandTotal = $totalBayar + $ppn;
                                 ?>
                                <tr>
                                  <td colspan="5" align="right" ><strong>PPN (10%) : </strong></td>
                                  <td align="right" ><b>&nbsp;</b></td>
                                  <td align="right" ><b>{{ number_format($ppn) }}</b></td>
                                  <td >&nbsp;</td>
                                </tr>
                                <tr>
                                  <td colspan="5" align="right" ><strong>Total (Rp.) : </strong></td>
                                  <td align="right" ><b>&nbsp;</b></td>
                                  <td align="right" ><b>{{ number_format($grandTotal) }}</b></td>
                                  <td >&nbsp;</td>
                                </tr>

                                <tr>
                                  <td colspan="5" align="right" ><strong>DP (Rp.) : </strong></td>
                                  <td align="right" ><b>&nbsp;</b></td>
                                  <td align="right" ><b>{{ number_format($data->dp) }}</b></td>
                                  <td >&nbsp;</td>
                                </tr>
                              </table>
                        </div>
                        
                    
                    </div>
                </div>
            </div>    
        </div>
        
    </div>

</div>
</div>

@endsection

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]