public function gen_kode($value = '') { $sql = "SELECT MAX(`order`) AS `order` FROM `atombizz_facility` WHERE `type` = ?"; $query = $this->db->query($sql, $value); $max = $query->row(); $total = !empty($max->order) ? $max->order + 1 : 0 + 1; $code = $value . '-' . complete_zero($total, 3); $arr_data = array('code' => $code, 'order' => $total); return $arr_data; }
public function gen_kode($value = '') { $sql = "SELECT MAX(`urut`) AS `order` FROM `atombizz_accounting_buku_besar` WHERE `kode` = ?"; $query = $this->db->query($sql, $value); $max = $query->row(); $total = !empty($max->order) ? $max->order + 1 : 0 + 1; $today = date('Y-m-d'); $code = $value . '.' . $today . '.' . complete_zero($total, 3); $arr_data = array('code' => $code, 'order' => $total); return $arr_data; }
public function gen_kode($param = '') { $tgl = $param['date']; $kode_tgl = date('ymd', strtotime($tgl)); $kode = $param['code']; $urut = $this->max('atombizz_accounting_buku_besar', 'urut', array('kode' => $param['code'], 'tanggal' => $param['date'])); $num = !empty($urut[0]->urut) ? $urut[0]->urut + 1 : 1; $faktur = $kode . '.' . $kode_tgl . '.' . complete_zero($num, 3); $result = array('code' => $faktur, 'order' => $num); return $result; }
function faktur_retur_out($param = '') { // $param = $this->input->post(); $tgl = $param['date']; $kode_tgl = date('ymd', strtotime($tgl)); $kode = 'FRO'; $urut = $this->max('atombizz_retur_out', 'urut', array('supplier_code' => $param['code'], 'date' => $param['date'])); $num = !empty($urut[0]->urut) ? $urut[0]->urut + 1 : 1; $faktur = $kode . '.' . $param['code'] . '.' . $kode_tgl . '.' . complete_zero($num, 2); $result = array('kode' => $kode, 'faktur' => $faktur, 'urut_faktur' => $num, 'tanggal' => TanggalIndo($tgl)); return $result; }
function faktur_retur_in($param = '') { $tgl = $param['date']; $kode_tgl = date('ymd', strtotime($tgl)); $kode = 'FRI'; $urut = $this->max('atombizz_retur_in', 'urut', array('date' => $param['date'])); $num = !empty($urut[0]->urut) ? $urut[0]->urut + 1 : 1; $faktur = $kode . '.' . $param['user'] . '.' . $kode_tgl . '.' . complete_zero($num, 2); $result = array('kode' => $kode, 'faktur' => $faktur, 'urut_faktur' => $num, 'tanggal' => TanggalIndo($tgl)); // print_r($result);exit; return $result; }
function faktur_opname($param = '') { // $param = $this->input->post(); $tgl = $param['date']; $kode_tgl = date('ymd', strtotime($tgl)); $kode = 'STO'; $basmalah = $this->config->item('astro'); $urut = $this->max('atombizz_stock_opname', 'urut', array('date' => $param['date'])); $num = !empty($urut[0]->urut) ? $urut[0]->urut + 1 : 1; $faktur = $kode . '.' . $basmalah['bas_code_dept'] . '.' . $kode_tgl . '.' . complete_zero($num, 2); $result = array('kode' => $kode, 'faktur' => $faktur, 'urut_faktur' => $num, 'tanggal' => $tgl); return $result; }
public function get_cashdraw() { $date = date('Y-m-d'); $kode = 'CASH'; $sql = "SELECT COUNT(id) as total FROM atombizz_cashdraw WHERE `date`='{$date}'"; $result = $this->db->query($sql); $fetch = $result->result(); $total = $fetch[0]->total; $koder = $total + 1; $bln = date('dmy'); $urut = complete_zero($koder, 2); $reference = $kode . $urut . '/' . $bln; return $reference; }
public function table_stock_minimum() { $data = $this->ms->min_stock(); $table = ''; $i = 1; foreach ($data as $key => $value) { $table .= '<tr> <td width="50px" style="text-align:center;">' . complete_zero($i, 3) . '</td> <td width="100px">' . $value->product_code . '</td> <td width="100px">' . $value->product_name . '</td> <td width="100px">' . $value->rak_name . '</td> <td width="100px" style="text-align:right;">' . $value->saldo . '</td> <td width="100px" style="text-align:right;">' . $value->minimal . '</td> </tr>'; $i++; } echo $table; }
public function table_stock_detail() { $cost = 0; $unit = 0; $qty = 0; $data = $this->mi->get_incoming_detail($this->input->post('reference')); $table = '<thead> <tr> <th width="50px" style="text-align:center;">No.</th> <th style="text-align:center;">Faktur</th> <th style="text-align:center;">Kode Produk</th> <th style="text-align:center;">Nama Produk</th> <th style="text-align:center;">Nama Rak</th> <th style="text-align:center;">Jumlah</th> <th style="text-align:center;">Harga Unit</th> <th style="text-align:center;">Total Harga</th> </tr> </thead> <tbody id="daftar_list_stock">'; $i = 1; foreach ($data as $key => $value) { $table .= '<tr> <td width="50px" style="text-align:center;">' . complete_zero($i, 3) . '</td> <td width="75px">' . $value->reference . '</td> <td width="50px">' . $value->code . '</td> <td width="100px">' . $value->name . '</td> <td width="50px">' . $value->rak . '</td> <td width="50px" style="text-align:right;">' . $value->qty . '</td> <td width="75px" style="text-align:right;">' . format_rupiah($value->cost) . '</td> <td width="100px" style="text-align:right;">' . format_rupiah($value->harga) . '</td> </tr>'; $i++; $cost += $value->harga; } $table .= '<tr> <td style="text-align:center;" colspan="7"><strong>TOTAL HARGA</strong></td> <td style="text-align:right;"><strong>' . format_rupiah($cost) . '</strong></td> </tr>'; echo $table . "</tbody>"; }
</tr> <tr id="jam"> <td>Jam</td> <td>:</td> <td> <select name="m-jam" id="m-jam" class="form-control select2me" data-placeholder="Pilih jam..."> <option value=""></option> <?php for ($j = 00; $j <= 24; $j++) { for ($i = 00; $i <= 60; $i += 5) { ?> <option value="<?php echo complete_zero($j, 2) . ':' . complete_zero($i, 2); ?> "><?php echo complete_zero($j, 2) . ':' . complete_zero($i, 2); ?> </option> <?php } } ?> </select> </td> </tr> <tr id="meja"> <td>Meja</td> <td>:</td> <td> <select name="m-meja" id="m-meja" class="form-control select2me" data-placeholder="Pilih meja..."> <option value=""></option>
public function get_code() { $post = $this->input->post(); if (empty($post['classification'])) { echo "0|"; exit; } $order = $this->msp->get_order($post['classification']); if (empty($order[0]->urut)) { echo '1|S' . $post['classification'] . '-' . complete_zero(1, 3); } else { $newOrder = $order[0]->urut + 1; echo $newOrder . '|S' . $post['classification'] . '-' . complete_zero($newOrder, 3); } }
public function get_code() { $param = $this->input->post(); $max = $this->mp->max('atombizz_rack', 'urut', array('jenis' => $param['jenis'])); $total = !empty($max[0]->urut) ? $max[0]->urut + 1 : 0 + 1; echo $param['jenis'] . '-' . complete_zero($total, 3); }
public function request_invoice($param = '') { $user = $this->session->userdata('astrosession'); $nota = $param['kas']; $astro = $this->config->item('astro'); $urut_selling = $this->max('atombizz_selling', 'urut', array('cashdraw_no' => $nota)); // echo $this->db->last_query();exit; $urut_tmp = $this->max('atombizz_tmp_detail_jual', 'urut', array('cashdraw' => $nota)); $num_selling = !empty($urut_selling[0]->urut) ? $urut_selling[0]->urut + 1 : 1; $num_tmp = !empty($urut_tmp[0]->urut) ? $urut_tmp[0]->urut + 1 : 1; if ($num_selling > $num_tmp) { $urut = $num_selling; } else { $urut = $num_tmp; } $kode = 'INV'; // $cabang = $astro['bas_code_dept']; $username = $user[0]->uname; $tgl = date('ymd'); $reference = $kode . '.' . $username . '.' . $tgl . '.' . complete_zero($urut, 4); return $reference . '|' . $urut; }