Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getKartuPiutang()
- {
- $tgl = $this->input->post('tgl');
- $supplier = $this->input->post('id');
- $pecah = explode(" - ",$tgl);
- $tglawal = date_format(date_create($pecah[0]),"Y-m-d");
- $tglakhir = date_format(date_create($pecah[1]),"Y-m-d");
- $data = $this->M_pempers->kartupiutang($supplier,$tglawal,$tglakhir)->result();
- ?>
- <thead>
- <tr>
- <th colspan="2"><center>INVOICE</center></th><th colspan="2"><center>BUKTI</center></th><th colspan="2"></th>
- </tr>
- <tr class="success">
- <th><center>TGL</center></th><th><center>NO</center></th><th><center>TGL</center></th><th><center>NO</center></th>
- <th><center>PIUTANG</center></th><th><center>BAYAR</center></th>
- </tr>
- </thead>
- <tbody>
- <?php
- $dpp = 0;
- $diskon = 0;
- $ppn = 0;
- $invoice = 0;
- $piutang =0;
- foreach($data as $a)
- {
- $invoice = $a->invoice_value;
- $diskon = $invoice * $a->discount_value/100;
- $ppn = $invoice *$a->ppn/100;
- $dpp = $invoice - $disc;
- $piutang = $dpp+$ppn;
- ?>
- <tr>
- <td><?php echo $a->invoice_date;?></td>
- <td><?php echo $a->invoice_no;?></td>
- <td><?php echo $a->payment_date;?></td>
- <td><?php echo $a->reference_no;?></td>
- <td>Rp. <?php echo number_format($piutang);?></td>
- <td>Rp. <?php echo number_format($a->payment_invoice);?></td>
- </tr>
- <?php
- }?>
- </tbody>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment