Exemplo n.º 1
0
 /**
  * Report Harian Detail
  * @return array Nilai-nilai yang diperlukan untuk report harian
  */
 public function reportHarianDetail()
 {
     $date = isset($this->tanggal) ? date_format(date_create_from_format('d-m-Y', $this->tanggal), 'Y-m-d') : NULL;
     $laporanHarian = LaporanHarian::model()->find('tanggal=:tanggal', array(':tanggal' => $date));
     if (is_null($laporanHarian)) {
         /* Object, tidak untuk disimpan, hanya untuk mencari nilai per tanggal */
         $laporanHarian = new LaporanHarian();
         $laporanHarian->tanggal = date_format(date_create_from_format('d-m-Y', $this->tanggal), 'Y-m-d');
     } else {
         /* fixme: ganti afterFind() */
         $laporanHarian->tanggal = date_format(date_create_from_format('d-m-Y', $laporanHarian->tanggal), 'Y-m-d');
     }
     /* laporannya bisa digrup per nama profil */
     $laporanHarian->groupByProfil = $this->groupByProfil;
     return array('saldoAwal' => $laporanHarian->saldoAwal(), 'saldoAkhir' => $laporanHarian->saldoAkhir(), 'saldoAkhirAsli' => $laporanHarian->saldo_akhir, 'keterangan' => $laporanHarian->keterangan, 'penjualanTunai' => $laporanHarian->penjualanTunai(), 'totalPenjualanTunai' => $laporanHarian->totalPenjualanTunai(), 'penjualanPiutang' => $laporanHarian->penjualanPiutang(), 'totalPenjualanPiutang' => $laporanHarian->totalPenjualanPiutang(), 'penjualanBayar' => $laporanHarian->penjualanBayar(), 'totalPenjualanBayar' => $laporanHarian->totalPenjualanBayar(), 'margin' => $laporanHarian->marginPenjualanTunai(), 'totalMargin' => $laporanHarian->totalMarginPenjualanTunai(), 'totalMarginPenjualan' => $laporanHarian->totalMarginPenjualan(), 'pembelianTunai' => $laporanHarian->pembelianTunai(), 'totalPembelianTunai' => $laporanHarian->totalPembelianTunai(), 'pembelianHutang' => $laporanHarian->pembelianHutang(), 'totalPembelianHutang' => $laporanHarian->totalPembelianHutang(), 'pembelianBayar' => $laporanHarian->pembelianBayar(), 'totalPembelianBayar' => $laporanHarian->totalPembelianBayar(), 'itemPengeluaran' => $laporanHarian->itemPengeluaran(), 'itemPenerimaan' => $laporanHarian->itemPenerimaan(), 'returBeliTunai' => $laporanHarian->returBeliTunai(), 'totalReturBeliTunai' => $laporanHarian->totalReturBeliTunai(), 'returBeliPiutang' => $laporanHarian->returBeliPiutang(), 'totalReturBeliPiutang' => $laporanHarian->totalReturBeliPiutang(), 'returBeliBayar' => $laporanHarian->returBeliBayar(), 'totalReturBeliBayar' => $laporanHarian->totalReturBeliBayar(), 'returJualTunai' => $laporanHarian->returJualTunai(), 'totalReturJualTunai' => $laporanHarian->totalReturJualTunai(), 'returJualHutang' => $laporanHarian->returJualHutang(), 'totalReturJualHutang' => $laporanHarian->totalReturJualHutang(), 'returJualBayar' => $laporanHarian->returJualBayar(), 'totalReturJualBayar' => $laporanHarian->totalReturJualBayar());
 }