public function print_report() { // error_reporting(0); $label_account = ''; if ($this->input->get('account_id') == '0') { //all acount $view = 'ledger/print_all'; $rows = $this->ledger_model->get_report($this->input->get('month'), $this->input->get('year')); } else { //per account $view = 'ledger/print'; $rows = $this->ledger_model->get_report($this->input->get('month'), $this->input->get('year'), $this->input->get('account_id')); $label_account = "{$rows[0]->account_no} {$rows[0]->account_name}"; } if (count($rows) == 0) { echo "<script>alert('Tidak ada data!');close();</script>"; exit; } $saldo = 0; $data['rows'] = array(); $i = 1; $current_account_id = 0; foreach ($rows as $row) { if ($current_account_id != $row->account_id) { $i = 1; $saldo = 0; } $current_account_id = $row->account_id; $row->no = $i++; $row->journals_date = sql_to_human($row->journals_date); $row->debit_txt = format_idr_currency($row->debit); $row->credit_txt = format_idr_currency($row->credit); $row->saldo_debit = '0'; $row->saldo_credit = '0'; $saldo = $saldo + $row->debit - $row->credit; if ($saldo > 0) { $row->saldo_debit = format_idr_currency($saldo); } else { if ($saldo < 0) { $row->saldo_credit = format_idr_currency(abs($saldo)); } } array_push($data['rows'], $row); } $data['company_name'] = $this->_get_company_name(); $data['company_address'] = $this->_get_company_address(); $month = month_indo($this->input->get('month')); $data['period'] = $month . ' ' . $this->input->get('year'); $html = $this->load->view($view, $data, true); $this->load->library('tumbaspdf'); $title = "Buku Besar {$label_account} {$data['period']}"; $this->tumbaspdf->set_author("{$data['company_name']} - {$this->_user_name}"); $this->tumbaspdf->generate_pdf($html, $title); }
public function print_report() { // error_reporting(0); $rows = $this->trial_balance_model->get_list($this->input->get()); if (count($rows) == 0) { echo "<script>alert('Tidak ada data!');close();</script>"; exit; } $data['rows'] = array(); $i = 1; foreach ($rows as $row) { $row->no = $i++; $row->debit_txt = '0'; $row->credit_txt = '0'; $saldo = $row->debit - $row->credit; if ($saldo > 0) { $row->debit_txt = format_idr_currency($saldo); $row->debit = $saldo; $row->credit = 0; } else { if ($saldo < 0) { $row->credit_txt = format_idr_currency(abs($saldo)); $row->debit = 0; $row->credit = abs($saldo); } else { $row->debit = 0; $row->credit = 0; } } array_push($data['rows'], $row); } $data['company_name'] = $this->_get_company_name(); $data['company_address'] = $this->_get_company_address(); $month = month_indo($this->input->get('month')); $data['period'] = $month . ' ' . $this->input->get('year'); $html = $this->load->view('trial_balance/print', $data, true); $this->load->library('tumbaspdf'); $title = "Neraca Saldo {$data['period']}"; $this->tumbaspdf->set_author("{$data['company_name']} - {$this->_user_name}"); $this->tumbaspdf->generate_pdf($html, $title); }
public function print_report() { // error_reporting(0); $data['company_name'] = $this->_get_company_name(); $data['company_address'] = $this->_get_company_address(); $month = month_indo($this->input->get('month')); $data['period'] = $month . ' ' . $this->input->get('year'); $data['rows'] = $this->journals_model->get_report($this->input->get('month'), $this->input->get('year')); if (count($data['rows']) == 0) { echo "<script>alert('Tidak ada data!');close();</script>"; exit; } $html = $this->load->view('journals/print', $data, true); $this->load->library('tumbaspdf'); $title = "Jurnal Umum {$data['period']}"; $this->tumbaspdf->set_author("{$data['company_name']} - {$this->_user_name}"); $this->tumbaspdf->generate_pdf($html, $title); }
public function print_report() { // error_reporting(0); $rows = $this->worksheet_model->get_list($this->input->get()); if (count($rows) == 0) { echo "<script>alert('Tidak ada data!');close();</script>"; exit; } $data['rows'] = array(); $i = 1; foreach ($rows as $row) { $row->no = $i++; //Neraca Saldo $row->debit1_txt = '0'; $row->credit1_txt = '0'; if ($row->saldo1 > 0) { $row->debit1_txt = format_idr_currency($row->saldo1); $row->debit1 = $row->saldo1; $row->credit1 = 0; } else { if ($row->saldo1 < 0) { $row->credit1_txt = format_idr_currency(abs($row->saldo1)); $row->credit1 = abs($row->saldo1); $row->debit1 = 0; } else { $row->debit1 = 0; $row->credit1 = 0; } } //Penyesuaian $row->debit2_txt = '0'; $row->credit2_txt = '0'; if ($row->saldo2 > 0) { $row->debit2_txt = format_idr_currency($row->saldo2); $row->debit2 = $row->saldo2; $row->credit2 = 0; } else { if ($row->saldo2 < 0) { $row->credit2_txt = format_idr_currency(abs($row->saldo2)); $row->credit2 = abs($row->saldo2); $row->debit2 = 0; } else { $row->debit2 = 0; $row->credit2 = 0; } } //Neraca saldo setelah penyesuaian $row->debit3_txt = '0'; $row->credit3_txt = '0'; if ($row->saldo3 > 0) { $row->debit3_txt = format_idr_currency($row->saldo3); $row->debit3 = $row->saldo3; $row->credit3 = 0; } else { if ($row->saldo3 < 0) { $row->credit3_txt = format_idr_currency(abs($row->saldo3)); $row->credit3 = abs($row->saldo3); $row->debit3 = 0; } else { $row->debit3 = 0; $row->credit3 = 0; } } //Laba rugi $row->debit4_txt = '0'; $row->credit4_txt = '0'; if ($row->saldo4 > 0) { $row->debit4_txt = format_idr_currency($row->saldo4); $row->debit4 = $row->saldo4; $row->credit4 = 0; } else { if ($row->saldo4 < 0) { $row->credit4_txt = format_idr_currency(abs($row->saldo4)); $row->credit4 = abs($row->saldo4); $row->debit4 = 0; } else { $row->debit4 = 0; $row->credit4 = 0; } } //Neraca $row->debit5_txt = '0'; $row->credit5_txt = '0'; if ($row->saldo5 > 0) { $row->debit5_txt = format_idr_currency($row->saldo5); $row->debit5 = $row->saldo5; $row->credit5 = 0; } else { if ($row->saldo5 < 0) { $row->credit5_txt = format_idr_currency(abs($row->saldo5)); $row->credit5 = abs($row->saldo5); $row->debit5 = 0; } else { $row->debit5 = 0; $row->credit5 = 0; } } array_push($data['rows'], $row); } $data['company_name'] = $this->_get_company_name(); $data['company_address'] = $this->_get_company_address(); $month = month_indo($this->input->get('month')); $data['period'] = $month . ' ' . $this->input->get('year'); $html = $this->load->view('worksheet/print', $data, true); // $this->load->view('worksheet/print', $data); // die('nih lagiiiii'); $this->load->library('tumbaspdf'); $title = "Neraca Lajur {$data['period']}"; $this->tumbaspdf->set_author("{$data['company_name']} - {$this->_user_name}"); $this->tumbaspdf->generate_pdf($html, $title, 'L'); }
public function print_report() { // error_reporting(0); $data = $this->input->get(); // $data['month_now'] = date('m'); // $data['year_now'] = date('Y'); //loss profit $rows = $this->financial_report_model->get_loss_profit_list($data['month'], $data['year']); $data['loss_profit'] = array(); $i = 1; foreach ($rows as $row) { $row->no = $i++; $row->debit_txt = '0'; $row->credit_txt = '0'; $saldo = $row->debit - $row->credit; if ($saldo > 0) { $row->debit_txt = format_idr_currency($saldo); $row->debit = $saldo; $row->credit = 0; } else { if ($saldo < 0) { $row->credit_txt = format_idr_currency(abs($saldo)); $row->debit = 0; $row->credit = abs($saldo); } else { $row->debit = 0; $row->credit = 0; } } array_push($data['loss_profit'], $row); } //capital change $rows = $this->financial_report_model->get_capital_changes_list($data['month'], $data['year']); $data['capital_changes'] = array(); $i = 1; foreach ($rows as $row) { $row->no = $i++; $row->debit_txt = '0'; $row->credit_txt = '0'; $saldo = $row->debit - $row->credit; if ($saldo > 0) { $row->debit_txt = format_idr_currency($saldo); $row->debit = $saldo; $row->credit = 0; } else { if ($saldo < 0) { $row->credit_txt = format_idr_currency(abs($saldo)); $row->debit = 0; $row->credit = abs($saldo); } else { $row->debit = 0; $row->credit = 0; } } array_push($data['capital_changes'], $row); } // $data['loss_profit_balance'] = $this->financial_report_model->get_loss_profit_balance($data['month_now'], $data['year_now']); // $data['loss_profit_label'] = ($data['loss_profit_balance'] > 0) ? 'Laba Bersih' : 'Rugi Bersih'; $rows = $this->financial_report_model->get_balance_list($data['month'], $data['year']); $data['balance'] = array(); $i = 1; foreach ($rows as $row) { $row->no = $i++; $row->debit_txt = '0'; $row->credit_txt = '0'; $saldo = $row->debit - $row->credit; if ($saldo > 0) { $row->debit_txt = format_idr_currency($saldo); $row->debit = $saldo; $row->credit = 0; } else { if ($saldo < 0) { $row->credit_txt = format_idr_currency(abs($saldo)); $row->debit = 0; $row->credit = abs($saldo); } else { $row->debit = 0; $row->credit = 0; } } array_push($data['balance'], $row); } if (count($data['loss_profit']) == 0) { echo "<script>alert('Tidak ada data!');close();</script>"; exit; } // $data['rows'] = array(); // $i = 1; // foreach ($rows as $row) { // $row->no = $i++; // $row->debit_txt = '0'; // $row->credit_txt = '0'; // $saldo = $row->debit - $row->credit; // if ($saldo > 0) { // $row->debit_txt = format_idr_currency($saldo); // $row->debit = $saldo; // $row->credit = 0; // } else if ($saldo < 0) { // $row->credit_txt = format_idr_currency(abs($saldo)); // $row->debit = 0; // $row->credit = abs($saldo); // } else { // $row->debit = 0; // $row->credit = 0; // } // // array_push($data['rows'], $row); // } $data['company_name'] = $this->_get_company_name(); $data['company_address'] = $this->_get_company_address(); $month = month_indo($this->input->get('month')); $data['period'] = $month . ' ' . $this->input->get('year'); $html = $this->load->view('financial_report/print', $data, true); $this->load->library('tumbaspdf'); $title = "Laporan Keuangan {$data['period']}"; $this->tumbaspdf->set_author("{$data['company_name']} - {$this->_user_name}"); $this->tumbaspdf->generate_pdf($html, $title); }