Ejemplo n.º 1
0
 public function get_list()
 {
     if ($this->input->is_ajax_request() && $this->input->post()) {
         $data_post = $this->input->post();
         //      $search = $data_post['search'];
         $limit = $data_post['length'];
         $offset = $data_post['start'];
         $columns = $data_post['columns'];
         $order_arr = $data_post['order'];
         $order_direction = strtoupper($order_arr[0]['dir']);
         $order_column = $order_arr[0]['column'];
         $order_column = $columns[$order_column]['data'];
         $data = $this->journals_model->get_list($data_post, $order_column, $order_direction, $limit, $offset);
         $json['data'] = array();
         $i = $offset + 1;
         foreach ($data['rows'] as $row) {
             $journals_id = encode($row->journals_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);
             $edit_url = base_url("accounting/journals/edit/{$journals_id}");
             $row->action = "<button onclick='doEdit(\"{$edit_url}\")' title='Edit' class='btn btn-xs btn-success edit_btn')'><i class='fa fa-pencil'></i></button>\n          <button title='Hapus' class='btn btn-xs btn-default' onclick='doDelete(\"{$journals_id}\", \"{$row->account_name}\")'><i class='fa fa-remove'></i></button>";
             //        $row->invoice = anchor("journals/view/{$journals_id}", $row->invoice, 'title="Klik untuk lebih lengkap" target="_blank"');
             array_push($json['data'], $row);
         }
         $json['recordsTotal'] = $data['total'];
         $json['recordsFiltered'] = $data['total'];
         $json['draw'] = $data_post['draw'];
         echo json_encode($json);
     } else {
         echo 'Forbidden access!';
     }
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
$credit_total = 0;
foreach ($rows as $value) {
    echo "\n    <tr>\n      <td style='text-align:center'>{$no}</td>\n      <td>" . sql_to_human($value->journals_date) . "</td>\n      <td>{$value->transaction_id}</td>\n      <td>{$value->account_no}</td>\n      <td>{$value->account_name}</td>\n      <td>{$value->remark}</td>\n      <td style='text-align:right'>" . format_idr_currency($value->debit) . "</td>\n      <td style='text-align:right'>" . format_idr_currency($value->credit) . "</td>\n    </tr>\n    ";
    $no++;
    $debit_total += $value->debit;
    $credit_total += $value->credit;
}
?>
    <tr>
      <th colspan="6" class="right">Total</th>
      <th class="right"><?php 
echo format_idr_currency($debit_total);
?>
</th>
      <th class="right"><?php 
echo format_idr_currency($credit_total);
?>
</th>
    </tr>
  </table>
<!--  <page_footer> 
    <table style="width: 100%; font-size: 10px;" class="table_no_border">
      <tr>
        <td style="width: 33%"><?php 
echo $buying->invoice;
?>
</td>
        <td style="width: 34%" class="center"> [[page_cu]]/[[page_nb]] </td>
        <td style="width: 33%" class="right"><?php 
echo date('d M Y H:i:s');
?>
Ejemplo n.º 4
0
    echo "\n                    <tr>\n                      <td class='text-center'><button title='Hapus Baris' type='button' class='btn btn-xs btn-success' onclick='removeRow(this);'><i class='fa fa-minus'></i></button></td>\n                      <td>\n                        <select name='account_id[]' class='form-control account_id' onchange='changeAccount({$row_id})' id='account-id-{$row_id}'>\n                          <option value=''>- Pilih -</option>\n                          {$options}\n                        </select>\n                      </td>\n                      <td><input type='text' name='debit[]' id='debit-{$row_id}' class='form-control currency debit' onkeyup='doDebit({$row_id})' value='{$value->debit}'></td>\n                      <td><input type='text' name='credit[]' id='credit-{$row_id}' class='form-control currency credit' onkeyup='doCredit({$row_id})' value='{$value->credit}'></td>\n                    </tr>\n                    ";
    $row_id++;
    $total_debit += $value->debit;
    $total_credit += $value->credit;
}
?>
              </tbody>
              <tfoot>
                <tr>
                  <th colspan="2" class="text-right">Total</th>
                  <th class="text-right"><span id="debit-total"><?php 
echo format_idr_currency($total_debit);
?>
</span></th>
                  <th class="text-right"><span id="credit-total"><?php 
echo format_idr_currency($total_credit);
?>
</span></th>
                </tr>
              </tfoot>
            </table>
          </div>
        </div>
        <!--End table-->

      </div>
      <div class="box-footer text-right">
        <button type="submit" class="btn btn-success" id="save_btn" data-loading-text="<i class='fa fa-refresh fa-spin'></i> Menyimpan..."><i class="fa fa-check"></i> Simpan</button>
        <button type="button" class="btn btn-default" id="close_btn"><i class="fa fa-close"></i> Tutup</button>
      </div>
    </form>
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
 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');
 }
Ejemplo n.º 7
0
    </tr>
    <tr>
      <th style="text-align:right;" colspan="9"></th>
      <th style="text-align:right;"><?php 
echo format_idr_currency($total1);
?>
</th>
      <th style="text-align:right;"><?php 
echo format_idr_currency($total2);
?>
</th>
      <th style="text-align:right;"><?php 
echo format_idr_currency($total3);
?>
</th>
      <th style="text-align:right;"><?php 
echo format_idr_currency($total4);
?>
</th>
    </tr>
  </table>
<!--  <page_footer> 
    <hr>
    <div style="text-align: right;">
      <small><?php 
echo $company_address;
?>
</small>
    </div>
  </page_footer>-->
</page> 
Ejemplo n.º 8
0
      <th class="center">Diskon</th>
      <th class="center">Subtotal</th>
    </tr>
    <?php 
$no = 1;
$grand_total = 0;
foreach ($buying_item as $value) {
    echo "\n    <tr>\n      <td style='text-align:center; width: 5%;'>{$no}</td>\n      <td style='width: 10%;'>{$value->item_code}</td>\n      <td style='width: 40%'>{$value->item_name}</td>\n      <td style='text-align:right; width: 11%;'>" . format_idr_currency($value->cost) . "</td>\n      <td style='text-align:right; width: 11%;'>" . format_idr_currency($value->quantity) . "</td>\n      <td style='text-align:right; width: 11%;'>" . format_idr_currency($value->discount) . "</td>\n      <td style='text-align:right; width: 12%;'>" . format_idr_currency($value->total) . "</td>\n    </tr>\n    ";
    $no++;
    $grand_total += $value->total;
}
?>
    <tr>
      <th colspan="6" class="right">Total</th>
      <th class="right"><?php 
echo format_idr_currency($grand_total);
?>
</th>
    </tr>
  </table>
  <table class="table_no_border" style="width: 100%; margin-top: 50px">
    <tr>
      <td class="center" style="width: 30%">
        Penerima
        <br>
        <br>
        <br>
        <br>
        (________________)
      </td>
      <td style="width: 40%"></td>
Ejemplo n.º 9
0
 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);
 }