4423 lines
180 KiB
PHP
4423 lines
180 KiB
PHP
<?php
|
|
|
|
use Restserver\Libraries\REST_Controller;
|
|
|
|
defined('BASEPATH') or exit('No direct script access allowed');
|
|
require APPPATH . 'libraries/REST_Controller.php';
|
|
require APPPATH . 'libraries/Format.php';
|
|
|
|
class ManageInformasi extends CI_Controller
|
|
{
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('ModelInformasi', 'Informasi');
|
|
$this->load->model('ModelDashboard', 'Dashboard');
|
|
$this->load->model('AllModels', 'Amod');
|
|
$this->load->library(['datatables', 'form_validation']);
|
|
$this->form_validation->set_error_delimiters('', '');
|
|
$this->Dashboard->ceklogin();
|
|
}
|
|
|
|
public function output_json($data, $encode = true)
|
|
{
|
|
if ($encode) $data = json_encode($data);
|
|
$this->output->set_content_type('application/json')->set_output($data);
|
|
}
|
|
|
|
//Controller Untuk Persediaan
|
|
public function dataCheckSn_All_A1($id_snstock=null) { // Informasi = [1]
|
|
$datSnStock = $this->Informasi->getData_SnStock();
|
|
$level = $this->session->userdata('level');
|
|
|
|
if ($id_snstock==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$nama_snstock = NULL;
|
|
$datBarang = NULL;
|
|
$datHistoriSnBeli = NULL;
|
|
$datHistoriSnJual = NULL;
|
|
$countHsnJual = NULL;
|
|
$datSnKonsi = NULL;
|
|
$datSnIo = NULL;
|
|
$datSnMb = NULL;
|
|
$datSnRj = NULL;
|
|
$datSnService = NULL;
|
|
} else {
|
|
$dataSnStock = $this->Informasi->getData_SnStock_byID($id_snstock);
|
|
$nama_snstock = $dataSnStock[0]['NAMA_SNSTOCK'];
|
|
$title = $nama_snstock;
|
|
$datBarang = $this->Informasi->getData_SnStock_byNAMA($nama_snstock);
|
|
$datSnKonsi = $this->Informasi->getData_SnKonsi_byNAMA($nama_snstock);
|
|
$datSnMb = $this->Informasi->getData_SnMutasiBarang_byNAMA($nama_snstock);
|
|
$datSnRj = $this->Informasi->getData_SnReturJual_byNAMA($nama_snstock);
|
|
$datSnService = $this->Informasi->getData_SnService_byNAMA($nama_snstock);
|
|
$datSnIo = $this->Informasi->getData_SnIO_byNAMA_status0($nama_snstock);
|
|
$datHistoriSnBeli = $this->Informasi->getData_HistoriSn_bySNSTOCK_forPembelian($datBarang[0]['ID_SNSTOCK']);
|
|
$datHistoriSnJual = $this->Informasi->getData_HistoriSn_bySNSTOCK_forPenjualan($datBarang[0]['ID_SNSTOCK']);
|
|
$countHsnJual = count($datHistoriSnJual);
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'barang' => $datBarang,
|
|
'level' => $level,
|
|
'countHsnj' => $countHsnJual,
|
|
'hsnb' => $datHistoriSnBeli,
|
|
'hsnj' => $datHistoriSnJual,
|
|
'snkonsi' => $datSnKonsi,
|
|
'snmb' => $datSnMb,
|
|
'snrj' => $datSnRj,
|
|
'snio' => $datSnIo,
|
|
'snservice' => $datSnService,
|
|
'id_snstock' => $id_snstock,
|
|
'nama_snstock' => $nama_snstock,
|
|
'sn' => $datSnStock,
|
|
'title' => $title
|
|
];
|
|
|
|
$this->load->view('proses/InformasiCheckSn_All_A1', $data);
|
|
}
|
|
|
|
public function dataHistoriQty_All_A1() { // Informasi = [74]
|
|
$datJenis = $this->Informasi->getData_Jenis_Not2();
|
|
$datMerk = $this->Informasi->getData_Merk();
|
|
$datModel = $this->Informasi->getData_Model();
|
|
$tgl = date('d/m/Y');
|
|
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$level = $this->session->userdata('level');
|
|
$jabatan = $this->session->userdata('jabatan');
|
|
$username = $this->session->userdata('username');
|
|
$datShk = $this->Informasi->getData_SetHistoriKuantiti_byKARYAWAN($id_karyawan);
|
|
if ($datShk==FALSE) {
|
|
$id_jenis = 0;
|
|
$id_merk = 0;
|
|
$id_model = 0;
|
|
if ($level==0) {
|
|
$jenis_shk = 1;
|
|
} else if ($level==1) {
|
|
$jenis_shk = 2;
|
|
} else {
|
|
$jenis_shk = 1;
|
|
}
|
|
$nama_shk = NULL;
|
|
} else {
|
|
$id_jenis = $datShk[0]['JENIS_ID'];
|
|
$id_merk = $datShk[0]['MERK_ID'];
|
|
$id_model = $datShk[0]['MODEL_ID'];
|
|
$jenis_shk = $datShk[0]['JENIS_SHK'];
|
|
$nama_shk = $datShk[0]['NAMA_SHK'];
|
|
}
|
|
|
|
$datInformasi = $this->Informasi->getData_HistoriKuantiti_byJENIS_byMERK_byMODEL_byNAMA_allStatus($id_jenis, $id_merk, $id_model, $jenis_shk, $nama_shk);
|
|
$no = 0;
|
|
foreach ($datInformasi as $dat) {
|
|
$sumDo0 = $this->Informasi->getSum_DaftarOrder_byBARANG($dat['BARANG_ID'], 0);
|
|
$sumDo1 = $this->Informasi->getSum_DaftarOrder_byBARANG($dat['BARANG_ID'], 1);
|
|
|
|
$datInformasi[$no] += ['PROSESPCM' => $sumDo0[0]['PROSES']];
|
|
$datInformasi[$no++] += ['PROSESITP' => $sumDo1[0]['PROSES']];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'tgl' => $tgl,
|
|
'jabatan' => $jabatan,
|
|
'username' => $username,
|
|
'jenis' => $datJenis,
|
|
'merk' => $datMerk,
|
|
'model' => $datModel,
|
|
'id_jenis' => $id_jenis,
|
|
'id_merk' => $id_merk,
|
|
'id_model' => $id_model,
|
|
'jenis_shk' => $jenis_shk,
|
|
'nama_shk' => $nama_shk,
|
|
];
|
|
$this->load->view('proses/InformasiHistoriQty_All_A1', $data);
|
|
}
|
|
|
|
public function simpanset_AA1() {
|
|
$method = $this->input->post('method');
|
|
$id_jenis = $this->input->post('id_jenis');
|
|
$id_merk = $this->input->post('id_merk');
|
|
$id_model = $this->input->post('id_model');
|
|
$jenis_shk = $this->input->post('jenis_shk');
|
|
$nama_shk = $this->input->post('nama_shk');
|
|
$reset = $this->input->post('reset');
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$level = $this->session->userdata('level');
|
|
$tgl = date('Y-m-d H:i:s');
|
|
|
|
if ($reset==1) {
|
|
$id_jenis = 0;
|
|
$id_merk = 0;
|
|
$id_model = 0;
|
|
if ($level==0) {
|
|
$jenis_shk = 1;
|
|
} else if ($level==1) {
|
|
$jenis_shk = 2;
|
|
} else {
|
|
$jenis_shk = 1;
|
|
}
|
|
$nama_shk = "";
|
|
}
|
|
|
|
$datShk = $this->Informasi->getData_SetHistoriKuantiti_byKARYAWAN($id_karyawan);
|
|
if ($datShk==FALSE) {
|
|
$input = [
|
|
'JENIS_ID' => $id_jenis,
|
|
'MERK_ID' => $id_merk,
|
|
'MODEL_ID' => $id_model,
|
|
'JENIS_SHK' => $jenis_shk,
|
|
'NAMA_SHK' => $nama_shk,
|
|
'KARYAWAN_ID' => $id_karyawan,
|
|
'LAST_SHK' => $tgl,
|
|
];
|
|
$action = $this->Informasi->create('set_historikuantiti', $input);
|
|
$set = 1;
|
|
|
|
if ($reset==1) {
|
|
$set = 3;
|
|
}
|
|
} else {
|
|
$update = [
|
|
'JENIS_ID' => $id_jenis,
|
|
'MERK_ID' => $id_merk,
|
|
'MODEL_ID' => $id_model,
|
|
'JENIS_SHK' => $jenis_shk,
|
|
'NAMA_SHK' => $nama_shk,
|
|
'LAST_SHK' => $tgl,
|
|
];
|
|
$action = $this->Informasi->update('set_historikuantiti', $update, 'ID_SHK', $datShk[0]['ID_SHK']);
|
|
$set = 2;
|
|
|
|
if ($reset==1) {
|
|
$set = 3;
|
|
}
|
|
}
|
|
|
|
if ($set==1) {
|
|
$this->session->set_flashdata('success', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else if ($set==2) {
|
|
$this->session->set_flashdata('success', 'diperbaruhi');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else if ($set==3) {
|
|
$this->session->set_flashdata('success', 'set Default');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('failed', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
|
|
}
|
|
|
|
public function dataHistoriQty_All_A1_PCM() { // Informasi = [2]
|
|
$level = 0;
|
|
$jabatan = $this->session->userdata('jabatan');
|
|
$username = $this->session->userdata('username');
|
|
$status = 0;
|
|
$datInformasi = $this->Informasi->getData_HistoriKuantiti_byBARANG_TOTALLebih0($level);
|
|
|
|
$no = 0;
|
|
foreach ($datInformasi as $dat) {
|
|
$sumDo0 = $this->Informasi->getSum_DaftarOrder_byBARANG($dat['BARANG_ID'], 0);
|
|
$sumDo1 = $this->Informasi->getSum_DaftarOrder_byBARANG($dat['BARANG_ID'], 1);
|
|
|
|
$datInformasi[$no] += ['PROSESPCM' => $sumDo0[0]['PROSES']];
|
|
$datInformasi[$no++] += ['PROSESITP' => $sumDo1[0]['PROSES']];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'jabatan' => $jabatan,
|
|
'level' => $level,
|
|
'status' => $status,
|
|
'username' => $username
|
|
];
|
|
$this->load->view('proses/InformasiHistoriQty_All_A1', $data);
|
|
}
|
|
|
|
public function dataHistoriQty_All_A1_ITP() { // Informasi = [3]
|
|
$level = 1;
|
|
$jabatan = $this->session->userdata('jabatan');
|
|
$username = $this->session->userdata('username');
|
|
$status = 0;
|
|
$datInformasi = $this->Informasi->getData_HistoriKuantiti_byBARANG_TOTALLebih0($level);
|
|
|
|
$no = 0;
|
|
foreach ($datInformasi as $dat) {
|
|
$sumDo0 = $this->Informasi->getSum_DaftarOrder_byBARANG($dat['BARANG_ID'], 0);
|
|
$sumDo1 = $this->Informasi->getSum_DaftarOrder_byBARANG($dat['BARANG_ID'], 1);
|
|
|
|
$datInformasi[$no] += ['PROSESPCM' => $sumDo0[0]['PROSES']];
|
|
$datInformasi[$no++] += ['PROSESITP' => $sumDo1[0]['PROSES']];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'jabatan' => $jabatan,
|
|
'level' => $level,
|
|
'status' => $status,
|
|
'username' => $username
|
|
];
|
|
$this->load->view('proses/InformasiHistoriQty_All_A1', $data);
|
|
}
|
|
|
|
public function dataHistoriQty_All_A1_Full() { // Informasi = [4]
|
|
$jabatan = $this->session->userdata('jabatan');
|
|
$level = $this->session->userdata('level');
|
|
$username = $this->session->userdata('username');
|
|
$status = 1;
|
|
$datInformasi = $this->Informasi->getData_HistoriKuantiti_byBARANG();
|
|
|
|
$no = 0;
|
|
foreach ($datInformasi as $dat) {
|
|
$sumDo0 = $this->Informasi->getSum_DaftarOrder_byBARANG($dat['BARANG_ID'], 0);
|
|
$sumDo1 = $this->Informasi->getSum_DaftarOrder_byBARANG($dat['BARANG_ID'], 1);
|
|
|
|
$datInformasi[$no] += ['PROSESPCM' => $sumDo0[0]['PROSES']];
|
|
$datInformasi[$no++] += ['PROSESITP' => $sumDo1[0]['PROSES']];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'jabatan' => $jabatan,
|
|
'status' => $status,
|
|
'level' => $level,
|
|
'username' => $username
|
|
];
|
|
$this->load->view('proses/InformasiHistoriQty_All_A1', $data);
|
|
}
|
|
|
|
public function dataHistoriQty_All_A1_Not0() { // Informasi = [5]
|
|
$jabatan = $this->session->userdata('jabatan');
|
|
$level = $this->session->userdata('level');
|
|
$username = $this->session->userdata('username');
|
|
$status = 2;
|
|
$datInformasi = $this->Informasi->getData_HistoriKuantiti_byBARANG_TOTALLebih0($level, 1);
|
|
|
|
$no = 0;
|
|
foreach ($datInformasi as $dat) {
|
|
$sumDo0 = $this->Informasi->getSum_DaftarOrder_byBARANG($dat['BARANG_ID'], 0);
|
|
$sumDo1 = $this->Informasi->getSum_DaftarOrder_byBARANG($dat['BARANG_ID'], 1);
|
|
|
|
$datInformasi[$no] += ['PROSESPCM' => $sumDo0[0]['PROSES']];
|
|
$datInformasi[$no++] += ['PROSESITP' => $sumDo1[0]['PROSES']];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'jabatan' => $jabatan,
|
|
'level' => $level,
|
|
'status' => $status,
|
|
'username' => $username
|
|
];
|
|
$this->load->view('proses/InformasiHistoriQty_All_A1', $data);
|
|
}
|
|
|
|
public function dataHistoriQty_All_A2($id) { // Informasi = [6]
|
|
$datInformasi = $this->Informasi->getData_HistoriKuantiti_byBARANG($id);
|
|
$datBarang = $this->Informasi->getData_Barang_byID($id);
|
|
$datKuantiti = $this->Informasi->getData_Kuantiti_byID($id);
|
|
$tgl = date('d/m/Y');
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'kode_barang' => $datBarang[0]['KODE_BARANG'],
|
|
'global' => $datKuantiti[0]['GLOBAL_KUANTITI'],
|
|
'tgl' => $tgl
|
|
];
|
|
$this->load->view('proses/InformasiHistoriQty_All_A2', $data);
|
|
}
|
|
|
|
public function dataHistoriQty_All_A3($id) { // Informasi = [7]
|
|
$datInformasi = $this->Informasi->getData_SnStock_byBARANG($id);
|
|
$datBarang = $this->Informasi->getData_Barang_byID($id);
|
|
$datCorp = $this->Informasi->getData_Corp_byID();
|
|
$tgl = date('d/m/Y');
|
|
|
|
$no = 0;
|
|
foreach ($datInformasi as $key) {
|
|
$datHsn1 = $this->Informasi->getData_HistoriSn_bySNSTOCK_limit1($key['ID_SNSTOCK']);
|
|
$datHsn2 = $this->Informasi->getData_HistoriSn_bySNSTOCK_forPenjualan($key['ID_SNSTOCK']);
|
|
|
|
if ($datHsn2==FALSE) {
|
|
$corpid = NULL;
|
|
$invjual = NULL;
|
|
$tgljual = NULL;
|
|
$namapel = NULL;
|
|
$namakot = NULL;
|
|
} else {
|
|
$corpid = $datHsn2[0]['CORP_ID'];
|
|
$invjual = $datHsn2[0]['INV_HSN'];
|
|
$tgljual = $datHsn2[0]['TANGGAL'];
|
|
$namapel = $datHsn2[0]['NAMA_PELANGGAN'];
|
|
$namakot = $datHsn2[0]['NAMA_KOTA'];
|
|
}
|
|
|
|
$datInformasi[$no] += ['KODE_BUKTI' => $datHsn1[0]['KODE_BUKTI']];
|
|
$datInformasi[$no] += ['CORPID' => $corpid];
|
|
$datInformasi[$no] += ['INVJUAL' => $invjual];
|
|
$datInformasi[$no] += ['TGLJUAL' => $tgljual];
|
|
$datInformasi[$no] += ['NAMAPEL' => $namapel];
|
|
$datInformasi[$no++] += ['NAMAKOT' => $namakot];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'corp' => $datCorp,
|
|
'id_barang' => $id,
|
|
'kode_barang' => $datBarang[0]['KODE_BARANG'],
|
|
'tgl' => $tgl,
|
|
];
|
|
$this->load->view('proses/InformasiHistoriQty_All_A3', $data);
|
|
}
|
|
|
|
public function simpan_excel_sn() { // Informasi = [8]
|
|
$id_barang = $this->input->post('id_barang');
|
|
$id_corp = $this->input->post('id_corp');
|
|
$type_cetak = $this->input->post('type_cetak');
|
|
$dataExcel = $this->Informasi->getData_SnStock_byBARANG($id_barang, $type_cetak, $id_corp);
|
|
$datBarang = $this->Informasi->getData_Barang_byID($id_barang);
|
|
$tgl = date('d/m/Y');
|
|
|
|
$pilih_tabel = array('No', 'Serial Number', 'Status', 'Tanggal Nota' ,'Supplier', 'Nota');
|
|
|
|
if ($type_cetak==0) {
|
|
$set = "Semua Data";
|
|
} else if ($type_cetak==1) {
|
|
$set = "Ready Stok";
|
|
} else if ($type_cetak==2) {
|
|
$set = "Sudah Terjual";
|
|
} else if ($type_cetak==3) {
|
|
$set = "Gudang Lain";
|
|
}
|
|
|
|
$data = [
|
|
'title' => '',
|
|
'jumlah_kolom' => count($pilih_tabel),
|
|
'nama_tabel' => $pilih_tabel,
|
|
'laporan' => $dataExcel,
|
|
'tgl' => $tgl,
|
|
'set' => $set,
|
|
'kode_barang' => $datBarang[0]['KODE_BARANG'],
|
|
];
|
|
$this->load->view('cetak/excel_sn', $data);
|
|
}
|
|
|
|
public function dataHistoriQty_All_A4($id) { // Informasi = [9]
|
|
$datInformasi = $this->Informasi->getData_Kuantiti_byID($id);
|
|
$datBarang = $this->Informasi->getData_Barang_byID($id);
|
|
$tgl = date('d/m/Y');
|
|
$set = 0;
|
|
|
|
$sumDo0 = $this->Informasi->getSum_DaftarOrder_byBARANG($id, 0);
|
|
if ($sumDo0[0]['PROSES']==NULL) {
|
|
$soProsesPcm = 0;
|
|
} else {
|
|
$soProsesPcm = $sumDo0[0]['PROSES'];
|
|
}
|
|
|
|
$sumDo1 = $this->Informasi->getSum_DaftarOrder_byBARANG($id, 1);
|
|
if ($sumDo1[0]['PROSES']==NULL) {
|
|
$soProsesItp = 0;
|
|
} else {
|
|
$soProsesItp = $sumDo1[0]['PROSES'];
|
|
}
|
|
|
|
$datInformasi[0] += ['SOPCM' => $soProsesPcm];
|
|
$datInformasi[0] += ['SOITP' => $soProsesItp];
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'kode_barang' => $datBarang[0]['KODE_BARANG'],
|
|
'id' => $id,
|
|
'set' => $set,
|
|
'tgl' => $tgl,
|
|
];
|
|
$this->load->view('proses/InformasiHistoriQty_All_A4', $data);
|
|
}
|
|
|
|
public function dataHistoriQty_All_A4_View($id, $link) { // Informasi = [10]
|
|
$datInformasi = $this->Informasi->getData_Kuantiti_byID($id);
|
|
$datBarang = $this->Informasi->getData_Barang_byID($id);
|
|
$tgl = date('d/m/Y');
|
|
$set = 1;
|
|
|
|
$sumDo0 = $this->Informasi->getSum_DaftarOrder_byBARANG($id, 0);
|
|
if ($sumDo0[0]['PROSES']==NULL) {
|
|
$soProsesPcm = 0;
|
|
} else {
|
|
$soProsesPcm = $sumDo0[0]['PROSES'];
|
|
}
|
|
|
|
$sumDo1 = $this->Informasi->getSum_DaftarOrder_byBARANG($id, 1);
|
|
if ($sumDo1[0]['PROSES']==NULL) {
|
|
$soProsesItp = 0;
|
|
} else {
|
|
$soProsesItp = $sumDo1[0]['PROSES'];
|
|
}
|
|
|
|
$datInformasi[0] += ['SOPCM' => $soProsesPcm];
|
|
$datInformasi[0] += ['SOITP' => $soProsesItp];
|
|
|
|
if ($link==1) {
|
|
$datDo = $this->Informasi->getData_DaftarOrder_byBARANG_NotNull_Not1_Not5($id, 0);
|
|
$no = 0;
|
|
foreach ($datDo as $key) {
|
|
$datDo[$no] += ['SNA' => NULL];
|
|
$datDo[$no] += ['SNIO' => NULL];
|
|
$datDo[$no] += ['SNMB' => NULL];
|
|
$datDo[$no] += ['SNP' => NULL];
|
|
$datDo[$no] += ['SNS' => NULL];
|
|
$datDo[$no] += ['SNJ' => NULL];
|
|
$datDo[$no++] += ['SNSJ' => NULL];
|
|
}
|
|
$sel = NULL;
|
|
} else if ($link==2) {
|
|
$datDo = $this->Informasi->getData_DaftarOrder_byBARANG_NotNull_Not1_Not5($id, 1);
|
|
$no = 0;
|
|
foreach ($datDo as $key) {
|
|
$datDo[$no] += ['SNA' => NULL];
|
|
$datDo[$no] += ['SNIO' => NULL];
|
|
$datDo[$no] += ['SNMB' => NULL];
|
|
$datDo[$no] += ['SNP' => NULL];
|
|
$datDo[$no] += ['SNS' => NULL];
|
|
$datDo[$no] += ['SNJ' => NULL];
|
|
$datDo[$no++] += ['SNSJ' => NULL];
|
|
}
|
|
$sel = NULL;
|
|
} else if ($link==3) {
|
|
$datSjp = $this->Informasi->getData_DaftarSjParsial_byBARANG_3($id);
|
|
$datIo = $this->Informasi->getData_TransaksiStock_byBARANG_0_Null($id);
|
|
$datDfs = $this->Informasi->getData_DaftarService_byBARANG_0($id);
|
|
$datDo = $this->Informasi->getData_DaftarOrder_byBARANG_0_2($id);
|
|
|
|
$no = 0;
|
|
foreach ($datSjp as $key) {
|
|
$datSnSjParsial = $this->Informasi->getData_SnSjParsial_bySJP($key['ID_SJP']);
|
|
$datSjp[$no] += ['SNA' => NULL];
|
|
$datSjp[$no] += ['SNIO' => NULL];
|
|
$datSjp[$no] += ['SNMB' => NULL];
|
|
$datSjp[$no] += ['SNP' => NULL];
|
|
$datSjp[$no] += ['SNS' => NULL];
|
|
$datSjp[$no] += ['SNJ' => NULL];
|
|
$datSjp[$no++] += ['SNSJ' => $datSnSjParsial];
|
|
}
|
|
|
|
$no = 0;
|
|
foreach ($datIo as $key) {
|
|
$datSnIo = $this->Informasi->getData_SnIo_byIO_0($key['ID_IO']);
|
|
$datIo[$no] += ['SNA' => NULL];
|
|
$datIo[$no] += ['SNMB' => NULL];
|
|
$datIo[$no] += ['SNP' => NULL];
|
|
$datIo[$no] += ['SNS' => NULL];
|
|
$datIo[$no] += ['SNSJ' => NULL];
|
|
$datIo[$no] += ['SNJ' => NULL];
|
|
$datIo[$no++] += ['SNIO' => $datSnIo];
|
|
}
|
|
|
|
$no = 0;
|
|
foreach ($datDfs as $key) {
|
|
$datSnService = $this->Informasi->getData_SnService_byDFS($key['ID_DFS']);
|
|
$datDfs[$no] += ['SNA' => NULL];
|
|
$datDfs[$no] += ['SNMB' => NULL];
|
|
$datDfs[$no] += ['SNP' => NULL];
|
|
$datDfs[$no] += ['SNIO' => NULL];
|
|
$datDfs[$no] += ['SNSJ' => NULL];
|
|
$datDfs[$no] += ['SNJ' => NULL];
|
|
$datDfs[$no++] += ['SNS' => $datSnService];
|
|
}
|
|
|
|
$no = 0;
|
|
foreach ($datDo as $key) {
|
|
$datSnj = $this->Informasi->getData_SnJual_byDO($key['ID_DO']);
|
|
$datDo[$no] += ['SNA' => NULL];
|
|
$datDo[$no] += ['SNMB' => NULL];
|
|
$datDo[$no] += ['SNP' => NULL];
|
|
$datDo[$no] += ['SNIO' => NULL];
|
|
$datDo[$no] += ['SNSJ' => NULL];
|
|
$datDo[$no] += ['SNJ' => $datSnj];
|
|
$datDo[$no++] += ['SNS' => NULL];
|
|
}
|
|
|
|
foreach ($datIo as $key) {
|
|
$datSjp[count($datSjp)] = $key;
|
|
}
|
|
|
|
foreach ($datDfs as $key) {
|
|
$datSjp[count($datSjp)] = $key;
|
|
}
|
|
|
|
foreach ($datDo as $key) {
|
|
$datSjp[count($datSjp)] = $key;
|
|
}
|
|
|
|
$sel = $datSjp;
|
|
|
|
} else if ($link==4) {
|
|
$datDmb = $this->Informasi->getData_DaftarMutasiBarang_byBARANG_0($id);
|
|
$no = 0;
|
|
foreach ($datDmb as $key) {
|
|
$datSnMb = $this->Informasi->getData_SnMutasiBarang_byDMB($key['ID_DMB']);
|
|
$datDmb[$no] += ['SNA' => NULL];
|
|
$datDmb[$no] += ['SNIO' => NULL];
|
|
$datDmb[$no] += ['SNP' => NULL];
|
|
$datDmb[$no] += ['SNS' => NULL];
|
|
$datDmb[$no] += ['SNJ' => NULL];
|
|
$datDmb[$no] += ['SNSJ' => NULL];
|
|
$datDmb[$no++] += ['SNMB' => $datSnMb];
|
|
}
|
|
$sel = $datDmb;
|
|
} else if ($link==5) {
|
|
$datPending = $this->Informasi->getData_Pending_byBARANG_Null($id);
|
|
$no = 0;
|
|
foreach ($datPending as $key) {
|
|
$datPending[$no] += ['SNA' => NULL];
|
|
$datPending[$no] += ['SNIO' => NULL];
|
|
$datPending[$no] += ['SNMB' => NULL];
|
|
$datPending[$no] += ['SNP' => NULL];
|
|
$datPending[$no] += ['SNJ' => NULL];
|
|
$datPending[$no] += ['SNS' => NULL];
|
|
$datPending[$no++] += ['SNSJ' => NULL];
|
|
}
|
|
$sel = $datPending;
|
|
} else if ($link==6) {
|
|
$datDfk = $this->Informasi->getData_DaftarKonsi_byBARANG_groupPELANGGAN_0($id);
|
|
$no = 0;
|
|
foreach ($datDfk as $key) {
|
|
$datSnk = $this->Informasi->getData_SnKonsi_byBARANG_byPELANGGAN_Null($id, $key['PELANGGAN_ID']);
|
|
$datDpk = $this->Informasi->getData_DaftarPenarikanKonsi_byBARANG_byPELANGGAN_groupPELANGGAN_0($id, $key['PELANGGAN_ID']);
|
|
$datDpl = $this->Informasi->getData_DaftarPenarikanLaku_byBARANG_byPELANGGAN_groupPELANGGAN_0($id, $key['PELANGGAN_ID']);
|
|
$datDfk[$no] += ['QTY1' => $datDpk];
|
|
$datDfk[$no] += ['QTY2' => $datDpl];
|
|
$datDfk[$no++] += ['SNK' => $datSnk];
|
|
}
|
|
$sel = $datDfk;
|
|
} else if ($link==7) {
|
|
$datDfp = $this->Informasi->getData_DaftarPinjam_byBARANG_0($id);
|
|
$no = 0;
|
|
foreach ($datDfp as $key) {
|
|
$datSnp = $this->Informasi->getData_SnPinjam_byDFP($key['ID_DFP']);
|
|
$datDfp[$no] += ['SNA' => NULL];
|
|
$datDfp[$no] += ['SNIO' => NULL];
|
|
$datDfp[$no] += ['SNMB' => NULL];
|
|
$datDfp[$no] += ['SNS' => NULL];
|
|
$datDfp[$no] += ['SNJ' => NULL];
|
|
$datDfp[$no] += ['SNSJ' => NULL];
|
|
$datDfp[$no++] += ['SNP' => $datSnp];
|
|
}
|
|
$sel = $datDfp;
|
|
} else if ($link==8) {
|
|
$datDpr = $this->Informasi->getData_DaftarProyek_byBARANG_Null($id);
|
|
$no = 0;
|
|
foreach ($datDpr as $key) {
|
|
$datDpr[$no] += ['SNA' => NULL];
|
|
$datDpr[$no] += ['SNIO' => NULL];
|
|
$datDpr[$no] += ['SNMB' => NULL];
|
|
$datDpr[$no] += ['SNP' => NULL];
|
|
$datDpr[$no] += ['SNJ' => NULL];
|
|
$datDpr[$no] += ['SNS' => NULL];
|
|
$datDpr[$no++] += ['SNSJ' => NULL];
|
|
}
|
|
$sel = $datDpr;
|
|
} else if ($link==9) {
|
|
$datKuantiti = $this->Informasi->getData_Kuantiti_byID($id);
|
|
$datSnStock = $this->Informasi->getData_SnStock_byBARANG_9($id);
|
|
$datKuantiti[0] += ['QTY' => $datKuantiti[0]['SERVICE_KUANTITI']];
|
|
$datKuantiti[0] += ['SNA' => NULL];
|
|
$datKuantiti[0] += ['SNIO' => NULL];
|
|
$datKuantiti[0] += ['SNMB' => NULL];
|
|
$datKuantiti[0] += ['SNP' => NULL];
|
|
$datKuantiti[0] += ['SNJ' => NULL];
|
|
$datKuantiti[0] += ['SNS' => $datSnStock];
|
|
$datKuantiti[0] += ['SNSJ' => NULL];
|
|
$sel = $datKuantiti;
|
|
} else if ($link==10) {
|
|
$datKuantiti = $this->Informasi->getData_Kuantiti_byID($id);
|
|
$datSnStock = $this->Informasi->getData_SnStock_byBARANG_5($id);
|
|
$datKuantiti[0] += ['QTY' => $datKuantiti[0]['ANTIK_KUANTITI']];
|
|
$datKuantiti[0] += ['SNA' => $datSnStock];
|
|
$datKuantiti[0] += ['SNIO' => NULL];
|
|
$datKuantiti[0] += ['SNMB' => NULL];
|
|
$datKuantiti[0] += ['SNJ' => NULL];
|
|
$datKuantiti[0] += ['SNP' => NULL];
|
|
$datKuantiti[0] += ['SNS' => NULL];
|
|
$datKuantiti[0] += ['SNSJ' => NULL];
|
|
$sel = $datKuantiti;
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'kode_barang' => $datBarang[0]['KODE_BARANG'],
|
|
'id' => $id,
|
|
'link' => $link,
|
|
'sel' => $sel,
|
|
'set' => $set,
|
|
'tgl' => $tgl,
|
|
];
|
|
$this->load->view('proses/InformasiHistoriQty_All_A4', $data);
|
|
}
|
|
|
|
public function dataHistoriQty_All_A5($id) { // Informasi = [11]
|
|
$datInformasi = $this->Informasi->getData_HistoriKuantiti_byBARANG_MasukLebih0($id);
|
|
$datBarang = $this->Informasi->getData_Barang_byID($id);
|
|
$tgl = date('d/m/Y');
|
|
|
|
$no = 0;
|
|
$totkeluar = 0;
|
|
$totpersediaan = 0;
|
|
$hargaavglama = 0;
|
|
foreach ($datInformasi as $key) {
|
|
if (strpos($key['KODE_BUKTI'],"PB")!==FALSE) {
|
|
$datPembelian = $this->Informasi->getData_Pembelian_byPB_forJejakHarga($key['KODE_BUKTI']);
|
|
$datInformasi[$no] += ['SUPPLIER' => $datPembelian[0]['NAMA_SUPPLIER']];
|
|
$datInformasi[$no] += ['KOTA' => $datPembelian[0]['NAMA_KOTA']];
|
|
} else {
|
|
$datInformasi[$no] += ['SUPPLIER' => NULL];
|
|
$datInformasi[$no] += ['KOTA' => NULL];
|
|
}
|
|
|
|
//Kuantiti Sebelumnya
|
|
$sumHq = $this->Informasi->getSum_HistoriKuantiti_byBARANG_byHQ($key['BARANG_ID'], $key['ID_HQ']);
|
|
if ($totkeluar!=$sumHq[0]['KELUAR']) {
|
|
$totkeluar = $sumHq[0]['KELUAR'];
|
|
$datHq = $this->Informasi->getData_HistoriKuantiti_limitHQ($key['BARANG_ID'], $key['ID_HQ']);
|
|
$limit = $this->Informasi->getSum_HistoriKuantiti_byBARANG_byHQ1_byHQ2($key['BARANG_ID'], $key['ID_HQ'], $datHq[0]['ID_HQ']);
|
|
$keluar = $limit[0]['KELUAR'];
|
|
} else {
|
|
$keluar = 0;
|
|
$totkeluar = 0;
|
|
}
|
|
$datInformasi[$no] += ['KELUAR' => $keluar];
|
|
$datInformasi[$no] += ['AKHIR' => $sumHq[0]['TOTAL']];
|
|
|
|
//Harga Per Item, DPP
|
|
$harga = $key['NILAI_HQ'] / $key['MASUK_HQ'];
|
|
$dpp = number_format($harga, 2);
|
|
$datInformasi[$no] += ['DPP' => $dpp];
|
|
|
|
//Nilai Total Persediaan Akhir
|
|
$nilaiPersediaanKeluar = $hargaavglama * $keluar;
|
|
$totpersediaan = $totpersediaan + ($harga * $key['MASUK_HQ']) - $nilaiPersediaanKeluar;
|
|
$hppakhir = round(($totpersediaan/$sumHq[0]['TOTAL']),2);
|
|
|
|
$persediaan = number_format($totpersediaan,2);
|
|
$hppavgawal = number_format($hargaavglama,2);
|
|
$hppavgakhir = number_format($hppakhir,2);
|
|
|
|
$datInformasi[$no] += ['PERSEDIAAN' => $persediaan];
|
|
$datInformasi[$no] += ['HPPAVGAWAL' => $hppavgawal];
|
|
$datInformasi[$no++] += ['HPPAVGAKHIR' => $hppavgakhir];
|
|
$hargaavglama = $hppakhir;
|
|
}
|
|
|
|
$avgakhir = round($hargaavglama,2);
|
|
$avgakhir = number_format($avgakhir,2);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'kode_barang' => $datBarang[0]['KODE_BARANG'],
|
|
'tgl' => $tgl,
|
|
'avgakhir' => $avgakhir,
|
|
];
|
|
$this->load->view('proses/InformasiHistoriQty_All_A5', $data);
|
|
}
|
|
|
|
public function dataKeluarMasuk_Gudang_A1($kode_bukti=null) { // Informasi = [12]
|
|
$datIo = $this->Informasi->getData_TransaksiStock_NotNull();
|
|
|
|
if ($kode_bukti==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$io = NULL;
|
|
$nama_karyawan = NULL;
|
|
$jenis_io = NULL;
|
|
} else {
|
|
$io = $this->Informasi->getData_TransaksiStock_NotNull($kode_bukti);
|
|
$tanggal = $io[0]['TANGGAL'];
|
|
$nama_karyawan = $io[0]['NAMA_PANGGILAN_KARYAWAN'];
|
|
$jenis_io = $io[0]['JENIS_IO'];
|
|
$kode_bukti = $io[0]['KODE_BUKTI'];
|
|
$title = "$kode_bukti ($tanggal)";
|
|
$io = $this->Informasi->getData_TransaksiStock_byKODE($kode_bukti);
|
|
|
|
$no = 0;
|
|
foreach ($io as $key) {
|
|
$datSnIo = $this->Informasi->getData_SnIo_byIO($key['ID_IO']);
|
|
$io[$no++] += ['SN' => $datSnIo];
|
|
}
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'io' => $io,
|
|
'datIo' => $datIo,
|
|
'kode_bukti' => $kode_bukti,
|
|
'nama_karyawan' => $nama_karyawan,
|
|
'jenis_io' => $jenis_io,
|
|
'title' => $title
|
|
];
|
|
$this->load->view('proses/InformasiKeluarMasuk_Gudang_A1', $data);
|
|
|
|
}
|
|
|
|
public function dataKonsinyasi_Gudang_A1($id_konsinyasi=null) { // Informasi = [13]
|
|
$level = $this->session->userdata('level');
|
|
$konsinyasi = $this->Informasi->getData_Konsinyasi(NULL, $level);
|
|
|
|
if ($id_konsinyasi==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$datKonsinyasi = NULL;
|
|
$kode_konsinyasi = NULL;
|
|
$nama_panggilan_karyawan = NULL;
|
|
$nama_pelanggan = NULL;
|
|
$nama_kota = NULL;
|
|
$set = 0;
|
|
} else {
|
|
$dataKonsinyasi = $this->Informasi->getData_Konsinyasi($id_konsinyasi);
|
|
$tanggal = $dataKonsinyasi[0]['TANGGAL'];
|
|
$kode_konsinyasi = $dataKonsinyasi[0]['KODE_KONSINYASI'];
|
|
$nama_panggilan_karyawan = $dataKonsinyasi[0]['NAMA_PANGGILAN_KARYAWAN'];
|
|
$nama_pelanggan = $dataKonsinyasi[0]['NAMA_PELANGGAN'];
|
|
$nama_kota = $dataKonsinyasi[0]['NAMA_KOTA'];
|
|
$title = "$kode_konsinyasi | $tanggal";
|
|
$datKonsinyasi = $this->Informasi->getData_DaftarKonsi_byKONSINYASI($id_konsinyasi);
|
|
$set = 1;
|
|
|
|
$no = 0;
|
|
foreach ($datKonsinyasi as $key) {
|
|
$datSnk = $this->Informasi->getData_SnKonsi_byBARANG_byID($key['BARANG_ID'], $key['ID_DFK']);
|
|
$datKonsinyasi[$no++] += ['SN' => $datSnk];
|
|
}
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'konsinyasi' => $konsinyasi,
|
|
'datKonsinyasi' => $datKonsinyasi,
|
|
'id_konsinyasi' => $id_konsinyasi,
|
|
'kode_konsinyasi' => $kode_konsinyasi,
|
|
'karyawan' => $nama_panggilan_karyawan,
|
|
'pelanggan' => $nama_pelanggan,
|
|
'kota' => $nama_kota,
|
|
'set' => $set,
|
|
'title' => $title
|
|
];
|
|
$this->load->view('proses/InformasiKonsinyasi_Gudang_A1', $data);
|
|
}
|
|
|
|
public function dataTarikKonsi_Gudang_A1($id_pk=null) { // Informasi = [14]
|
|
$pk = $this->Informasi->getData_PenarikanKonsi();
|
|
|
|
if ($id_pk==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$datPk = NULL;
|
|
$kode_pk = NULL;
|
|
$nama_panggilan_karyawan = NULL;
|
|
$nama_pelanggan = NULL;
|
|
$nama_kota = NULL;
|
|
} else {
|
|
$dataPk = $this->Informasi->getData_PenarikanKonsi($id_pk);
|
|
$tanggal = $dataPk[0]['TANGGAL'];
|
|
$kode_pk = $dataPk[0]['KODE_PK'];
|
|
$nama_panggilan_karyawan = $dataPk[0]['NAMA_PANGGILAN_KARYAWAN'];
|
|
$nama_pelanggan = $dataPk[0]['NAMA_PELANGGAN'];
|
|
$nama_kota = $dataPk[0]['NAMA_KOTA'];
|
|
$title = "$kode_pk | $tanggal";
|
|
$datPk = $this->Informasi->getData_DaftarTarikKonsi_byPK($id_pk);
|
|
|
|
$no = 0;
|
|
foreach ($datPk as $key) {
|
|
$datSnk = $this->Informasi->getData_SnKonsi_byBARANG_byPK_1($key['BARANG_ID'],$key['ID_PK']);
|
|
$datPk[$no++] += ['SN' => $datSnk];
|
|
}
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'pk' => $pk,
|
|
'datPk' => $datPk,
|
|
'id_pk' => $id_pk,
|
|
'kode_pk' => $kode_pk,
|
|
'karyawan' => $nama_panggilan_karyawan,
|
|
'pelanggan' => $nama_pelanggan,
|
|
'kota' => $nama_kota,
|
|
'title' => $title
|
|
];
|
|
$this->load->view('proses/InformasiTarikKonsi_Gudang_A1', $data);
|
|
}
|
|
|
|
public function dataPendingStock_Sales_A1() { // Informasi = [15]
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$level = 0;
|
|
$datInformasi1 = $this->Informasi->getData_Pending_bySALES($id_karyawan, $level);
|
|
$datInformasi2 = $this->Informasi->getData_Pending_withoutSALES($id_karyawan, $level);
|
|
$datKaryawan = $this->Informasi->getData_Karyawan_byID($id_karyawan);
|
|
$tgl_now = date('Y-m-d');
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi1' => $datInformasi1,
|
|
'informasi2' => $datInformasi2,
|
|
'nama_karyawan' => $datKaryawan[0]['NAMA_PANGGILAN_KARYAWAN'],
|
|
'level' => $level,
|
|
'tgl_now' => $tgl_now
|
|
];
|
|
$this->load->view('proses/InformasiPendingStock_Sales_A1', $data);
|
|
}
|
|
|
|
public function dataPendingStock_Sales_B1() { // Informasi = [16]
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$level = 1;
|
|
$datInformasi1 = $this->Informasi->getData_Pending_bySALES($id_karyawan, $level);
|
|
$datInformasi2 = $this->Informasi->getData_Pending_withoutSALES($id_karyawan, $level);
|
|
$datKaryawan = $this->Informasi->getData_Karyawan_byID($id_karyawan);
|
|
$tgl_now = date('Y-m-d');
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi1' => $datInformasi1,
|
|
'informasi2' => $datInformasi2,
|
|
'nama_karyawan' => $datKaryawan[0]['NAMA_PANGGILAN_KARYAWAN'],
|
|
'level' => $level,
|
|
'tgl_now' => $tgl_now
|
|
];
|
|
$this->load->view('proses/InformasiPendingStock_Sales_A1', $data);
|
|
}
|
|
|
|
public function dataPeminjamanStock_All_A1() { // Informasi = [17]
|
|
$level = $this->session->userdata('level');
|
|
$datInformasi = $this->Informasi->getData_Peminjaman_forInformasi($level);
|
|
|
|
$no = 0;
|
|
foreach ($datInformasi as $key) {
|
|
$datDfp = $this->Informasi->getData_DaftarPinjam_byPEMINJAMAN($key['ID_PEMINJAMAN']);
|
|
$datInformasi[$no++] += ['BAR' => $datDfp];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'level' => $level
|
|
];
|
|
$this->load->view('proses/InformasiPeminjamanStock_All_A1', $data);
|
|
}
|
|
|
|
public function dataPeminjamanStock_All_A2($id) { // Informasi = [18]
|
|
$datInformasi = $this->Informasi->getData_DaftarPinjam_byPEMINJAMAN($id);
|
|
|
|
$no = 0;
|
|
foreach ($datInformasi as $key) {
|
|
$datSnp = $this->Informasi->getData_SnPinjam_byDFP($key['ID_DFP']);
|
|
$datInformasi[$no++] += ['SN' =>$datSnp];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'kode_peminjaman' => $datInformasi[0]['KODE_PEMINJAMAN']
|
|
];
|
|
$this->load->view('proses/InformasiPeminjamanStock_All_A2', $data);
|
|
}
|
|
|
|
public function dataStokOpname_Gudang_A1() { // Informasi = [19]
|
|
$kondisi = $this->input->post('kondisi');
|
|
$jenis_gudang = $this->input->post('jenis_gudang');
|
|
$id_jenis = $this->input->post('id_jenis');
|
|
$datJenis = $this->Informasi->getData_Jenis_Not2();
|
|
$tgl = date('d/m/Y');
|
|
|
|
$dataJenis = $this->Informasi->getData_Jenis_Not2($id_jenis);
|
|
if ($id_jenis=="") {
|
|
$jen = "Semua Jenis";
|
|
} else {
|
|
$nama_jenis = $dataJenis[0]['NAMA_JENIS'];
|
|
$jen = "$nama_jenis";
|
|
}
|
|
|
|
if ($kondisi==null){
|
|
$jenis_gudang = NULL;
|
|
$all = 0 ;
|
|
$title = "Belum Terpilih*";
|
|
} else if ($kondisi!=null AND $jenis_gudang=="") {
|
|
$jenis_gudang = NULL;
|
|
$title = "Semua Gudang ($jen)";
|
|
$all = 1;
|
|
} else {
|
|
$all = 2;
|
|
if ($jenis_gudang==NULL) {
|
|
$title = "";
|
|
} else if ($jenis_gudang=="1") {
|
|
$title = "Gudang Global ($jen)";
|
|
} else if ($jenis_gudang=="2") {
|
|
$title = "Gudang PCM ($jen)";
|
|
} else if ($jenis_gudang=="3") {
|
|
$title = "Gudang Konsinyasi ($jen)";
|
|
} else if ($jenis_gudang=="4") {
|
|
$title = "Gudang Peminjaman ($jen)";
|
|
} else if ($jenis_gudang=="5") {
|
|
$title = "Gudang Pending ($jen)";
|
|
} else if ($jenis_gudang=="6") {
|
|
$title = "Gudang Antik ($jen)";
|
|
} else if ($jenis_gudang=="7") {
|
|
$title = "Gudang Proyek ($jen)";
|
|
} else if ($jenis_gudang=="8") {
|
|
$title = "Gudang Service ($jen)";
|
|
} else if ($jenis_gudang=="9") {
|
|
$title = "Gudang ITP ($jen)";
|
|
}
|
|
}
|
|
|
|
$informasi = $this->Informasi->getData_StokKuantiti($all, $jenis_gudang, $id_jenis);
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $informasi,
|
|
'jenis' => $datJenis,
|
|
'id_jenis' => $id_jenis,
|
|
'tgl' => $tgl,
|
|
'title' => $title,
|
|
'all' => $all,
|
|
'jenis_gudang' => $jenis_gudang
|
|
];
|
|
$this->load->view('proses/InformasiStokOpname_Gudang_A1', $data);
|
|
}
|
|
|
|
public function simpan_excel_stokOpname() { // Informasi = [20]
|
|
$jenis_gudang = $this->input->post('jenis_gudang');
|
|
$id_jenis = $this->input->post('id_jenis');
|
|
$all = $this->input->post('all');
|
|
$username = $this->input->post('username');
|
|
$tgl = date('d/m/Y');
|
|
$dataInformasi = $this->Informasi->getData_StokKuantiti($all, $jenis_gudang, $id_jenis);
|
|
$pilih_tabel = array('No', 'Jenis', 'Kode Barang', 'Nama Barang', 'Kuantiti');
|
|
|
|
if ($jenis_gudang==NULL) {
|
|
$gudang = "";
|
|
} else if ($jenis_gudang=="1") {
|
|
$gudang = "Gudang Global";
|
|
} else if ($jenis_gudang=="2") {
|
|
$gudang = "Gudang PCM";
|
|
} else if ($jenis_gudang=="3") {
|
|
$gudang = "Gudang Konsinyasi";
|
|
} else if ($jenis_gudang=="4") {
|
|
$gudang = "Gudang Peminjaman";
|
|
} else if ($jenis_gudang=="5") {
|
|
$gudang = "Gudang Pending";
|
|
} else if ($jenis_gudang=="6") {
|
|
$gudang = "Gudang Antik";
|
|
} else if ($jenis_gudang=="7") {
|
|
$gudang = "Gudang Proyek";
|
|
} else if ($jenis_gudang=="8") {
|
|
$gudang = "Gudang Service";
|
|
} else if ($jenis_gudang=="9") {
|
|
$gudang = "Gudang ITP";
|
|
}
|
|
|
|
$data = [
|
|
'title' => '',
|
|
'jumlah_kolom' => count($pilih_tabel),
|
|
'nama_tabel' => $pilih_tabel,
|
|
'informasi' => $dataInformasi,
|
|
'tgl' => $tgl,
|
|
'gudang' => $gudang,
|
|
];
|
|
$this->load->view('cetak/excel_stokOpname', $data);
|
|
}
|
|
|
|
//Controller Untuk Pembelian
|
|
public function dataPembelian_Gudang_A1($id_pembelian=null) { // Informasi = [21]
|
|
$datPembelian = $this->Informasi->getData_Pembelian_byID();
|
|
|
|
if ($id_pembelian==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$set = 0;
|
|
$nama_corp = NULL;
|
|
$db = NULL;
|
|
$nama_supplier = NULL;
|
|
$nama_kota = NULL;
|
|
$kode_pembelian = NULL;
|
|
$status_pembelian = NULL;
|
|
$sj_pembelian = NULL;
|
|
} else {
|
|
$set = 1;
|
|
$datBeli = $this->Informasi->getData_Pembelian_byID($id_pembelian);
|
|
$sj_pembelian = $datBeli[0]['SJ_PEMBELIAN'];
|
|
$tanggal = $datBeli[0]['TANGGAL'];
|
|
$nama_supplier = $datBeli[0]['NAMA_SUPPLIER'];
|
|
$nama_kota = $datBeli[0]['NAMA_KOTA'];
|
|
$kode_pembelian = $datBeli[0]['KODE_PEMBELIAN'];
|
|
$status_pembelian = $datBeli[0]['STATUS_PEMBELIAN'];
|
|
$title = "$sj_pembelian ($tanggal)";
|
|
|
|
$id_corp = $datBeli[0]['CORP_ID'];
|
|
if ($id_corp==1) {
|
|
$nama_corp = "TMP";
|
|
} else if ($id_corp==2) {
|
|
$nama_corp = "DMT";
|
|
} else if ($id_corp==3) {
|
|
$nama_corp = "PCM";
|
|
} else if ($id_corp==4) {
|
|
$nama_corp = "SFTR";
|
|
} else if ($id_corp==5) {
|
|
$nama_corp = "ITP";
|
|
}
|
|
|
|
$db = $this->Informasi->getData_DaftarBeli_bySJ($sj_pembelian);
|
|
|
|
$no = 0;
|
|
foreach ($db as $key) {
|
|
$datSnBeli = $this->Informasi->getData_SnBeli_byBARANG_forSJPembelian($key['BARANG_ID'],$key['ID_DB']);
|
|
$db[$no++] += ['SN' => $datSnBeli];
|
|
|
|
}
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'db' => $db,
|
|
'sj' => $datPembelian,
|
|
'kode_pembelian' => $kode_pembelian,
|
|
'nama_supplier' => $nama_supplier,
|
|
'nama_kota' => $nama_kota,
|
|
'status_pembelian' => $status_pembelian,
|
|
'sj_pembelian' => $sj_pembelian,
|
|
'title' => $title,
|
|
'set' => $set,
|
|
'nama_corp' => $nama_corp,
|
|
'id_pembelian' => $id_pembelian
|
|
];
|
|
$this->load->view('proses/InformasiPembelian_Gudang_A1', $data);
|
|
}
|
|
|
|
public function simpan_excel_pembelian_sn_single() { // Informasi = [22]
|
|
$id_pembelian = $this->input->post('id_pembelian');
|
|
$pilih_tabel = array('No', 'Kode Barang', 'Nama Barang' ,'Serial Number');
|
|
$dataExcel = $this->Informasi->getData_SnBeli_byPEMBELIAN($id_pembelian);
|
|
$datPembelian = $this->Informasi->getData_Pembelian_byID($id_pembelian);
|
|
|
|
$data = [
|
|
'title' => '',
|
|
'jumlah_kolom' => count($pilih_tabel),
|
|
'nama_tabel' => $pilih_tabel,
|
|
'laporan' => $dataExcel,
|
|
'sj_pembelian' => $datPembelian[0]['SJ_PEMBELIAN'],
|
|
'nama_supplier' => $datPembelian[0]['NAMA_SUPPLIER'],
|
|
'nama_kota' => $datPembelian[0]['NAMA_KOTA'],
|
|
'tanggal_sj' => $datPembelian[0]['TANGGAL'],
|
|
];
|
|
$this->load->view('cetak/excel_pembelian_sn_single', $data);
|
|
}
|
|
|
|
public function dataReturBeli_Gudang_A1($id_rb=null) { // Informasi = [21]
|
|
$datRb = $this->Informasi->getData_ReturPembelian_byID();
|
|
|
|
if ($id_rb==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$set = 0;
|
|
$nama_corp = NULL;
|
|
$drb = NULL;
|
|
$nama_supplier = NULL;
|
|
$nama_kota = NULL;
|
|
$status_rb = NULL;
|
|
$kode_rb = NULL;
|
|
} else {
|
|
$set = 1;
|
|
$datBeli = $this->Informasi->getData_ReturPembelian_byID($id_rb);
|
|
$kode_rb = $datBeli[0]['KODE_RB'];
|
|
$tanggal = $datBeli[0]['TANGGAL'];
|
|
$nama_supplier = $datBeli[0]['NAMA_SUPPLIER'];
|
|
$nama_kota = $datBeli[0]['NAMA_KOTA'];
|
|
$status_rb = $datBeli[0]['STATUS_RB'];
|
|
$title = "$kode_rb ($tanggal)";
|
|
|
|
$id_corp = $datBeli[0]['CORP_ID'];
|
|
if ($id_corp==1) {
|
|
$nama_corp = "TMP";
|
|
} else if ($id_corp==2) {
|
|
$nama_corp = "DMT";
|
|
} else if ($id_corp==3) {
|
|
$nama_corp = "PCM";
|
|
} else if ($id_corp==4) {
|
|
$nama_corp = "SFTR";
|
|
} else if ($id_corp==5) {
|
|
$nama_corp = "ITP";
|
|
}
|
|
|
|
$drb = $this->Informasi->getData_DaftarReturBeli_byRB($kode_rb);
|
|
|
|
$no = 0;
|
|
foreach ($drb as $key) {
|
|
$datSnRb = $this->Informasi->getData_SnReturBeli_byBARANG_forKodeRB($key['BARANG_ID'],$key['ID_DRB']);
|
|
$drb[$no++] += ['SN' => $datSnRb];
|
|
|
|
}
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'drb' => $drb,
|
|
'rb' => $datRb,
|
|
'nama_supplier' => $nama_supplier,
|
|
'nama_kota' => $nama_kota,
|
|
'status_rb' => $status_rb,
|
|
'kode_rb' => $kode_rb,
|
|
'title' => $title,
|
|
'set' => $set,
|
|
'nama_corp' => $nama_corp,
|
|
'id_rb' => $id_rb
|
|
];
|
|
$this->load->view('proses/InformasiReturBeli_Gudang_A1', $data);
|
|
}
|
|
|
|
public function dataReturJual_Gudang_A1($id_rj=null) { // Informasi = [21]
|
|
$datRj = $this->Informasi->getData_ReturPenjualan_byID();
|
|
|
|
if ($id_rj==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$set = 0;
|
|
$nama_corp = NULL;
|
|
$drj = NULL;
|
|
$nama_pelanggan = NULL;
|
|
$nama_kota = NULL;
|
|
$status_rj = NULL;
|
|
$kode_rj = NULL;
|
|
} else {
|
|
$set = 1;
|
|
$dataRj = $this->Informasi->getData_ReturPenjualan_byID($id_rj);
|
|
$kode_rj = $dataRj[0]['KODE_RJ'];
|
|
$tanggal = $dataRj[0]['TANGGAL'];
|
|
$nama_pelanggan = $dataRj[0]['NAMA_PELANGGAN'];
|
|
$nama_kota = $dataRj[0]['NAMA_KOTA'];
|
|
$status_rj = $dataRj[0]['STATUS_RJ'];
|
|
$title = "$kode_rj ($tanggal)";
|
|
|
|
$id_corp = $dataRj[0]['KOP_ID'];
|
|
if ($id_corp==1) {
|
|
$nama_corp = "TMP";
|
|
} else if ($id_corp==2) {
|
|
$nama_corp = "DMT";
|
|
} else if ($id_corp==3) {
|
|
$nama_corp = "PCM";
|
|
} else if ($id_corp==4) {
|
|
$nama_corp = "SFTR";
|
|
} else if ($id_corp==5) {
|
|
$nama_corp = "ITP";
|
|
}
|
|
|
|
$drj = $this->Informasi->getData_DaftarReturJual_byRJ($kode_rj);
|
|
|
|
$no = 0;
|
|
foreach ($drj as $key) {
|
|
$datSnRj = $this->Informasi->getData_SnReturJual_byBARANG_forKodeRJ($key['BARANG_ID'],$key['ID_DRJ']);
|
|
$drj[$no++] += ['SN' => $datSnRj];
|
|
|
|
}
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'drj' => $drj,
|
|
'rj' => $datRj,
|
|
'nama_pelanggan' => $nama_pelanggan,
|
|
'nama_kota' => $nama_kota,
|
|
'status_rj' => $status_rj,
|
|
'kode_rj' => $kode_rj,
|
|
'title' => $title,
|
|
'set' => $set,
|
|
'nama_corp' => $nama_corp,
|
|
'id_rj' => $id_rj
|
|
];
|
|
$this->load->view('proses/InformasiReturJual_Gudang_A1', $data);
|
|
}
|
|
|
|
public function dataPembelian_Keuangan_A1($id_pembelian=null) { // Informasi = [23]
|
|
$datPembelian = $this->Informasi->getData_Pembelian_byID();
|
|
|
|
if ($id_pembelian==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$inv_pembelian = NULL;
|
|
$db = NULL;
|
|
$nama_corp = NULL;
|
|
$nama_supplier = NULL;
|
|
$nama_kota = NULL;
|
|
$kode_pembelian = NULL;
|
|
$status_pembelian = NULL;
|
|
$bruto = NULL;
|
|
$ppn_pembelian = NULL;
|
|
$set = 0;
|
|
} else {
|
|
$set = 1;
|
|
$datBeli = $this->Informasi->getData_Pembelian_byID($id_pembelian);
|
|
$inv_pembelian = $datBeli[0]['INV_PEMBELIAN'];
|
|
$tanggal = $datBeli[0]['TANGGAL'];
|
|
$nama_supplier = $datBeli[0]['NAMA_SUPPLIER'];
|
|
$nama_kota = $datBeli[0]['NAMA_KOTA'];
|
|
$kode_pembelian = $datBeli[0]['KODE_PEMBELIAN'];
|
|
$status_pembelian = $datBeli[0]['STATUS_PEMBELIAN'];
|
|
$ppn_pembelian = $datBeli[0]['PPN_PEMBELIAN'];
|
|
$title = "$inv_pembelian ($tanggal)";
|
|
|
|
$sumDb = $this->Informasi->getSum_DaftarBeli_byPEMBELIAN($id_pembelian);
|
|
$bruto = $sumDb[0]['TOTAL'];
|
|
|
|
$id_corp = $datBeli[0]['CORP_ID'];
|
|
if ($id_corp==1) {
|
|
$nama_corp = "TMP";
|
|
} else if ($id_corp==2) {
|
|
$nama_corp = "DMT";
|
|
} else if ($id_corp==3) {
|
|
$nama_corp = "PCM";
|
|
} else if ($id_corp==4) {
|
|
$nama_corp = "SFTR";
|
|
} else if ($id_corp==5) {
|
|
$nama_corp = "ITP";
|
|
}
|
|
|
|
$db = $this->Informasi->getData_DaftarBeli_byINV($inv_pembelian);
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'db' => $db,
|
|
'nota' => $datPembelian,
|
|
'kode_pembelian' => $kode_pembelian,
|
|
'nama_supplier' => $nama_supplier,
|
|
'nama_kota' => $nama_kota,
|
|
'status_pembelian' => $status_pembelian,
|
|
'inv_pembelian' => $inv_pembelian,
|
|
'ppn_pembelian' => $ppn_pembelian,
|
|
'title' => $title,
|
|
'set' => $set,
|
|
'bruto' => $bruto,
|
|
'nama_corp' => $nama_corp,
|
|
'id_pembelian' => $id_pembelian
|
|
];
|
|
$this->load->view('proses/InformasiPembelian_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataCekRelasiSo_All_A1($id_so=null) { // Informasi = [77]
|
|
$datSo = $this->Informasi->getData_SalesOrder_allStatus();
|
|
$tgl_now = date('d/m/Y');
|
|
|
|
if ($id_so==NULL) {
|
|
$title = "Belum terpilih*";
|
|
$datInformasi = NULL;
|
|
$status = NULL;
|
|
$nama_pelanggan = NULL;
|
|
} else {
|
|
$dataSo = $this->Informasi->getData_SalesOrder_byID($id_so);
|
|
$title = $dataSo[0]['KODE_SO'];
|
|
$status_so = $dataSo[0]['STATUS_SO'];
|
|
$nama_pelanggan = $dataSo[0]['NAMA_PELANGGAN'];
|
|
|
|
if ($status_so!=1) {
|
|
$datInformasi = NULL;
|
|
} else {
|
|
$datInformasi = $this->Informasi->getData_CetakDokumen_bySO($id_so);
|
|
}
|
|
|
|
if ($status_so==5) {
|
|
$status = "BATAL NOTA";
|
|
} else if ($status_so==3) {
|
|
$status = "PARSIAL, BELUM SELESAI";
|
|
} else if ($status_so==2) {
|
|
$status = "SIAP KIRIM";
|
|
} else if ($status_so==1) {
|
|
$status = "SELESAI PROSES";
|
|
} else if ($status_so==9) {
|
|
$status = "BATAL SO SALES";
|
|
} else if ($status_so==NULL) {
|
|
$status = "BELUM DIKUNCI SALES";
|
|
} else {
|
|
$status = "PROSES GUDANG";
|
|
}
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'so' => $datSo,
|
|
'title' => $title,
|
|
'tgl_now' => $tgl_now,
|
|
'id_so' => $id_so,
|
|
'nama_pelanggan' => $nama_pelanggan,
|
|
'status' => $status
|
|
];
|
|
$this->load->view('proses/InformasiCekRelasiSo_All_A1', $data);
|
|
}
|
|
|
|
//Controller Untuk Penjualan
|
|
public function dataPembayaran_Sales_A1() { // Informasi = [24]
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$tgl = date('d/m/Y');
|
|
$datInformasi = $this->Informasi->getData_SalesOrder_forInformasiSudahTerbayar($id_karyawan);
|
|
$datKaryawan = $this->Informasi->getData_Karyawan_byID($id_karyawan);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'tgl' => $tgl,
|
|
'nama_panggilan_karyawan' => $datKaryawan[0]['NAMA_PANGGILAN_KARYAWAN']
|
|
];
|
|
$this->load->view('proses/InformasiPembayaran_Sales_A1', $data);
|
|
}
|
|
|
|
public function dataPenjualan_Keuangan_A1($id_so=null) { // Informasi = [25]
|
|
$datPenjualan = $this->Informasi->getData_SalesOrder_Penjualan_forSearch();
|
|
|
|
if ($id_so==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$do = NULL;
|
|
$nama_pelanggan = NULL;
|
|
$nama_kota = NULL;
|
|
$nilai_so = NULL;
|
|
$status_so = NULL;
|
|
$status_gp = NULL;
|
|
$tgl_penjualan = NULL;
|
|
} else {
|
|
$datSales = $this->Informasi->getData_SalesOrder_byID($id_so);
|
|
$nama_pelanggan = $datSales[0]['NAMA_PELANGGAN'];
|
|
$nama_kota = $datSales[0]['NAMA_KOTA'];
|
|
$kode_so = $datSales[0]['KODE_SO'];
|
|
$inv_penjualan = $datSales[0]['INV_PENJUALAN'];
|
|
$tgl_penjualan = $datSales[0]['TANGGAL'];
|
|
$gp_so = $datSales[0]['GP_SO'];
|
|
$status_so = $datSales[0]['STATUS_SO'];
|
|
$nilai_so = $datSales[0]['NILAI_SO'];
|
|
$do = $this->Informasi->getData_DaftarOrder_bySO_forPenjualanView($id_so);
|
|
|
|
if ($gp_so=="0") {
|
|
$status_gp = "Non-GP";
|
|
} else if ($gp_so=="1") {
|
|
$status_gp = "Perhitungan GP";
|
|
}
|
|
|
|
if ($inv_penjualan==NULL) {
|
|
$title = "$kode_so";
|
|
} else {
|
|
$title = "$kode_so | $inv_penjualan | $tgl_penjualan";
|
|
}
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'do' => $do,
|
|
'penjualan' => $datPenjualan,
|
|
'id_so' => $id_so,
|
|
'nama_pelanggan' => $nama_pelanggan,
|
|
'nama_kota' => $nama_kota,
|
|
'nilai_so' => $nilai_so,
|
|
'status_so' => $status_so,
|
|
'status_gp' => $status_gp,
|
|
'title' => $title
|
|
];
|
|
$this->load->view('proses/InformasiPenjualan_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataPenjualan_Keuangan_A2($id) { // Informasi = [26]
|
|
$datPenjualan = $this->Informasi->getData_SalesOrder_byCORP($id);
|
|
$tgl = date('d/m/Y');
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'penjualan' => $datPenjualan,
|
|
'countPenjualan' => count($datPenjualan),
|
|
'id_corp' => $id,
|
|
'tgl' => $tgl,
|
|
];
|
|
$this->load->view('proses/InformasiPenjualan_Keuangan_A2', $data);
|
|
}
|
|
|
|
public function dataReturJual_Sales_A1() { // Informasi = [27]
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$tgl = date('d/m/Y');
|
|
$datInformasi = $this->Informasi->getData_SalesOrder_forInformasiReturJual($id_karyawan);
|
|
$datKaryawan = $this->Informasi->getData_Karyawan_byID($id_karyawan);
|
|
|
|
$no = 0;
|
|
foreach ($datInformasi as $key) {
|
|
$datPda = $this->Informasi->getData_PiutangDagang_byPENJUALAN_forRetur($key['PENJUALAN_ID']);
|
|
$datInformasi[$no++] += ['PDA' => $datPda];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'tgl' => $tgl,
|
|
'nama_panggilan_karyawan' => $datKaryawan[0]['NAMA_PANGGILAN_KARYAWAN']
|
|
];
|
|
$this->load->view('proses/InformasiReturJual_Sales_A1', $data);
|
|
}
|
|
|
|
public function dataSalesOrder_Gudang_A1($kode_so=null) { // Informasi = [28]
|
|
$datSo = $this->Informasi->getData_SalesOrder_forSOGudang();
|
|
|
|
if ($kode_so==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$do = NULL;
|
|
$nama_pelanggan = NULL;
|
|
$nama_kota = NULL;
|
|
$nama_sales = NULL;
|
|
$status_so = NULL;
|
|
$cabang = NULL;
|
|
$io = NULL;
|
|
} else {
|
|
$datSales = $this->Informasi->getData_SalesOrder_forSOGudang($kode_so);
|
|
$tanggal = $datSales[0]['TANGGAL'];
|
|
$nama_pelanggan = $datSales[0]['NAMA_PELANGGAN'];
|
|
$nama_kota = $datSales[0]['NAMA_KOTA'];
|
|
$nama_sales = $datSales[0]['NAMA_PANGGILAN_KARYAWAN'];
|
|
$status_so = $datSales[0]['STATUS_SO'];
|
|
if ($datSales[0]['CORP_ID']==1) { $cabang = "TMP"; } else if ($datSales[0]['CORP_ID']==2) { $cabang = "DMT"; }
|
|
else if ($datSales[0]['CORP_ID']==3) { $cabang = "PCM"; } else if ($datSales[0]['CORP_ID']==4) { $cabang = "SFTR"; }
|
|
else if ($datSales[0]['CORP_ID']==5) { $cabang = "ITP";
|
|
}
|
|
$title = "$kode_so ($tanggal)";
|
|
$do = $this->Informasi->getData_DaftarOrder_byKODESO($kode_so);
|
|
|
|
$no = 0;
|
|
foreach ($do as $key) {
|
|
$datSnJual = $this->Informasi->getData_SnJual_byBARANG_forSJPenjualan($key['BARANG_ID'],$key['ID_DO']);
|
|
$do[$no] += ['SN' => $datSnJual];
|
|
|
|
$datSnSjParsial = $this->Informasi->getData_SnParsial_byBARANG_forSJPenjualan($key['BARANG_ID'],$key['ID_DO']);
|
|
$do[$no++] += ['SNSJ' => $datSnSjParsial];
|
|
}
|
|
|
|
$io = $this->Informasi->getData_TransaksiStock_byKODE($kode_so);
|
|
$no = 0;
|
|
foreach ($io as $key) {
|
|
$datSnio = $this->Informasi->getData_SnIo_byIO($key['ID_IO']);
|
|
$io[$no++] += ['SN' => $datSnio];
|
|
}
|
|
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'do' => $do,
|
|
'so' => $datSo,
|
|
'kode_so' => $kode_so,
|
|
'nama_pelanggan' => $nama_pelanggan,
|
|
'nama_kota' => $nama_kota,
|
|
'sales' => $nama_sales,
|
|
'status_so' => $status_so,
|
|
'title' => $title,
|
|
'cabang' => $cabang,
|
|
'io' => $io
|
|
];
|
|
$this->load->view('proses/InformasiSalesOrder_Gudang_A1', $data);
|
|
}
|
|
|
|
public function dataSalesOrder_Gudang_A2($model=null) { // Informasi = [29]
|
|
$datSo = $this->Informasi->getData_SalesOrder_viewAll($model);
|
|
$tgl = date('d/m/Y');
|
|
|
|
$no = 0;
|
|
foreach ($datSo as $key) {
|
|
$datQc = $this->Informasi->getData_QualityControl_bySO($key['ID_SO']);
|
|
$datSo[$no] += ['QC' => $datQc];
|
|
|
|
$datJp = $this->Informasi->getData_JadwalPengiriman_bySO($key['ID_SO']);
|
|
$datSo[$no++] += ['KARYAWAN' => $datJp];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'so' => $datSo,
|
|
'count' => count($datSo),
|
|
'model' => $model,
|
|
'tgl' => $tgl,
|
|
];
|
|
$this->load->view('proses/InformasiSalesOrder_Gudang_A2', $data);
|
|
}
|
|
|
|
public function dataSalesOrder_Sales_A1() { // Informasi = [30]
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$tgl = date('d/m/Y');
|
|
$datSo = $this->Informasi->getData_SalesOrder_forInformasi_bySales($id_karyawan);
|
|
$count1 = $this->Informasi->getCount_SalesOrder_1($id_karyawan);
|
|
$countNot1 = $this->Informasi->getCount_SalesOrder_Not1_Not5_NotNull($id_karyawan);
|
|
|
|
$no = 0;
|
|
foreach ($datSo as $key) {
|
|
$datQc = $this->Informasi->getData_QualityControl_bySO($key['ID_SO']);
|
|
$datSo[$no] += ['QC' => $datQc];
|
|
|
|
$datJp = $this->Informasi->getData_JadwalPengiriman_bySO($key['ID_SO']);
|
|
$datSo[$no++] += ['KARYAWAN' => $datJp];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'so' => $datSo,
|
|
'count1' => $count1,
|
|
'countNot1' => $countNot1,
|
|
'tgl' => $tgl
|
|
];
|
|
$this->load->view('proses/InformasiSalesOrder_Sales_A1', $data);
|
|
}
|
|
|
|
public function print_all_SalesOrder($id) { // Informasi = [31]
|
|
$tgl = date('d/m/Y');
|
|
$dataSo = $this->Informasi->getData_SalesOrder_byID_forInformasi($id);
|
|
$datBarang = $this->Informasi->getData_DaftarOrder_bySOID($id);
|
|
$total = $this->Informasi->getSum_DaftarOrder_bySO_forSalesOrder($id);
|
|
|
|
$data = [
|
|
'so' => $dataSo,
|
|
'barang' => $datBarang,
|
|
'total' => $total,
|
|
'tgl' => $tgl
|
|
];
|
|
|
|
if ($dataSo[0]['CORP_ID']=="1") {
|
|
$this->load->view('cetak/Nota_SalesOrder_TMP', $data);
|
|
} else if ($dataSo[0]['CORP_ID']=="2") {
|
|
$this->load->view('cetak/Nota_SalesOrder_DMT', $data);
|
|
} else if ($dataSo[0]['CORP_ID']=="3") {
|
|
$this->load->view('cetak/Nota_SalesOrder_PCM', $data);
|
|
} else if ($dataSo[0]['CORP_ID']=="4") {
|
|
$this->load->view('cetak/Nota_SalesOrder_SFT', $data);
|
|
} else if ($dataSo[0]['CORP_ID']=="5") {
|
|
$this->load->view('cetak/Nota_SalesOrder_ITP', $data);
|
|
}
|
|
}
|
|
|
|
public function dataTagihan_Sales_A1() { // Informasi = [32]
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$tgl = date('d/m/Y');
|
|
$datInformasi = $this->Informasi->getData_SalesOrder_forInformasiTagihan($id_karyawan);
|
|
$datKaryawan = $this->Informasi->getData_Karyawan_byID($id_karyawan);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'tgl' => $tgl,
|
|
'nama_panggilan_karyawan' => $datKaryawan[0]['NAMA_PANGGILAN_KARYAWAN']
|
|
];
|
|
$this->load->view('proses/InformasiTagihan_Sales_A1', $data);
|
|
}
|
|
|
|
public function dataTagihan_Sales_B1() { // Informasi = [72]
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$tgl = date('d/m/Y');
|
|
$datInformasi = $this->Informasi->getData_SalesOrder_forInformasiTagihanBefore($id_karyawan);
|
|
$datKaryawan = $this->Informasi->getData_Karyawan_byID($id_karyawan);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'tgl' => $tgl,
|
|
'nama_panggilan_karyawan' => $datKaryawan[0]['NAMA_PANGGILAN_KARYAWAN']
|
|
];
|
|
$this->load->view('proses/InformasiTagihan_Sales_A1', $data);
|
|
}
|
|
|
|
public function dataTarget_Sales_A1() { // Informasi = [33]
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$tgl = date('d/m/Y');
|
|
$datInformasi = $this->Informasi->getData_Penjualan_forTarget($id_karyawan);
|
|
|
|
$no = 0;
|
|
foreach ($datInformasi as $key) {
|
|
$datPenjualan = $this->Informasi->getData_Penjualan_bySALES_byTGL($id_karyawan, $key['TGL_PENJUALAN']);
|
|
$datInformasi[$no++] += ['NOTA' => $datPenjualan];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'tgl' => $tgl,
|
|
];
|
|
$this->load->view('proses/InformasiTarget_Sales_A1', $data);
|
|
}
|
|
|
|
public function dataTarget_Sales_A2($id) { // Informasi = [34]
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$tgl = date_format(date_create($id), "d/m/Y");
|
|
$datInformasi = $this->Informasi->getData_Penjualan_byTANGGAL($id, $id_karyawan);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'tgl' => $tgl,
|
|
];
|
|
$this->load->view('proses/InformasiTarget_Sales_A2', $data);
|
|
}
|
|
|
|
//Controller Untuk Keuangan Umum
|
|
public function dataBiayaBensin_Keuangan_A1() { // Informasi = [35]
|
|
$datInformasi = $this->Informasi->getData_BiayaBensin_forInformasi();
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi
|
|
];
|
|
$this->load->view('proses/InformasiBiayaBensin_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataBiayaBensin_Keuangan_A2($id) { // Informasi = [36]
|
|
$datInformasi = $this->Informasi->getData_BiayaBensin_forInformasi($id);
|
|
$datKendaraan = $this->Informasi->getData_Kendaraan($id);
|
|
$datSumKas = $this->Informasi->getSum_BiayaBensin_forInformasi($id);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'nama_kendaraan' => $datKendaraan[0]['NAMA_KENDARAAN'],
|
|
'nopol_kendaraan' => $datKendaraan[0]['NOPOL_KENDARAAN'],
|
|
'total' => $datSumKas[0]['TOTAL'],
|
|
];
|
|
$this->load->view('proses/InformasiBiayaBensin_Keuangan_A2', $data);
|
|
}
|
|
|
|
public function dataBiayaServiceKendaraan_Keuangan_A1() { // Informasi = [37]
|
|
$datInformasi = $this->Informasi->getData_BiayaServiceKendaraan_forInformasi();
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi
|
|
];
|
|
$this->load->view('proses/InformasiBiayaServiceKendaraan_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataBiayaServiceKendaraan_Keuangan_A2($id) { // Informasi = [38]
|
|
$datInformasi = $this->Informasi->getData_BiayaServiceKendaraan_forInformasi($id);
|
|
$datKendaraan = $this->Informasi->getData_Kendaraan($id);
|
|
$datSumKas = $this->Informasi->getSum_BiayaServiceKendaraan_forInformasi($id);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'nama_kendaraan' => $datKendaraan[0]['NAMA_KENDARAAN'],
|
|
'nopol_kendaraan' => $datKendaraan[0]['NOPOL_KENDARAAN'],
|
|
'total' => $datSumKas[0]['TOTAL'],
|
|
];
|
|
$this->load->view('proses/InformasiBiayaServiceKendaraan_Keuangan_A2', $data);
|
|
}
|
|
|
|
public function dataFormKaryawan_All_A1($id_fk=null) { // Informasi = [39]
|
|
$datFk = $this->Informasi->getData_FormKaryawan_status1();
|
|
|
|
if ($id_fk==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$jenis_fk = NULL;
|
|
$dffk = NULL;
|
|
$nilai_fk = 0;
|
|
$nama_panggilan_karyawan = NULL;
|
|
} else {
|
|
$dataFk = $this->Informasi->getData_FormKaryawan_status1($id_fk);
|
|
$tanggal = $dataFk[0]['TANGGAL'];
|
|
$nama_panggilan_karyawan = $dataFk[0]['NAMA_PANGGILAN_KARYAWAN'];
|
|
$jenis_fk = $dataFk[0]['JENIS_FK'];
|
|
$kode_fk = $dataFk[0]['KODE_FK'];
|
|
$nilai_fk = $dataFk[0]['NILAI_FK'];
|
|
$title = "$kode_fk | $tanggal | $nama_panggilan_karyawan";
|
|
$dffk = $this->Informasi->getData_DaftarFormKaryawan_status1($id_fk);
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'dffk' => $dffk,
|
|
'fk' => $datFk,
|
|
'id_fk' => $id_fk,
|
|
'jenis_fk' => $jenis_fk,
|
|
'totalNilai' => $nilai_fk,
|
|
'title' => $title
|
|
];
|
|
$this->load->view('proses/InformasiFormKaryawan_All_A1', $data);
|
|
}
|
|
|
|
public function dataFormKaryawan_All_A2() { // Informasi = [40]
|
|
$datFk = $this->Informasi->getData_FormKaryawan_status1();
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'fk' => $datFk,
|
|
];
|
|
$this->load->view('proses/InformasiFormKaryawan_All_A2', $data);
|
|
}
|
|
|
|
public function dataFormFeePelanggan_Sales_A1($id_ffp=null) { // Informasi = [78]
|
|
$datFfp = $this->Informasi->getData_FormFeePelanggan_status1();
|
|
|
|
if ($id_ffp==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$nilai_ffp = 0;
|
|
$nama_panggilan_karyawan = NULL;
|
|
$jenis_ffp = NULL;
|
|
$nama_pelanggan = NULL;
|
|
$con_ffp_k = NULL;
|
|
$con_ffp_p = NULL;
|
|
} else {
|
|
$dataFfp = $this->Informasi->getData_FormFeePelanggan_status1($id_ffp);
|
|
$tanggal = $dataFfp[0]['TANGGAL'];
|
|
$nama_panggilan_karyawan = $dataFfp[0]['NAMA_PANGGILAN_KARYAWAN'];
|
|
$jenis_ffp = $dataFfp[0]['JENIS_FFP'];
|
|
$kode_ffp = $dataFfp[0]['KODE_FFP'];
|
|
$nilai_ffp = $dataFfp[0]['NILAI_FFP'];
|
|
$nama_pelanggan = $dataFfp[0]['NAMA_PELANGGAN'];
|
|
$con_ffp_k = $dataFfp[0]['CON_FFP_K'];
|
|
$con_ffp_p = $dataFfp[0]['CON_FFP_P'];
|
|
$title = "$kode_ffp | $tanggal | $nama_panggilan_karyawan";
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'ffp' => $datFfp,
|
|
'id_ffp' => $id_ffp,
|
|
'jenis_ffp' => $jenis_ffp,
|
|
'nama_pelanggan' => $nama_pelanggan,
|
|
'con_ffp_k' => $con_ffp_k,
|
|
'con_ffp_p' => $con_ffp_p,
|
|
'totalNilai' => $nilai_ffp,
|
|
'title' => $title
|
|
];
|
|
$this->load->view('proses/InformasiFormFeePelanggan_Sales_A1', $data);
|
|
}
|
|
|
|
public function dataFormFeePelanggan_Sales_A2() { // Informasi = [79]
|
|
$datFfp = $this->Informasi->getData_FormFeePelanggan_status1();
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'ffp' => $datFfp,
|
|
];
|
|
$this->load->view('proses/InformasiFormFeePelanggan_Sales_A2', $data);
|
|
}
|
|
|
|
//Controller Untuk Keuangan Khusus
|
|
public function dataBiayaFee_Keuangan_A1() { // Informasi = [41]
|
|
$level = $this->session->userdata('level');
|
|
$kondisi = $this->input->post('kondisi');
|
|
$datPelanggan = $this->Informasi->getData_Pelanggan_byID();
|
|
$datCorp = $this->Informasi->getData_Corp_byID();
|
|
|
|
if ($kondisi==null) {
|
|
$id_corp = NULL;
|
|
$id_pelanggan = NULL;
|
|
$tanggal_awal = NULL;
|
|
$tanggal_akhir = NULL;
|
|
$set = 0;
|
|
} else {
|
|
$tanggal_awal = $this->input->post('tanggal_awal');
|
|
$tanggal_akhir = $this->input->post('tanggal_akhir');
|
|
$id_pelanggan = $this->input->post('id_pelanggan');
|
|
$id_corp = $this->input->post('id_corp');
|
|
$set = 1;
|
|
}
|
|
|
|
$datInformasi = $this->Informasi->getData_SalesOrder_Fee_forInformasi($set, $id_pelanggan, $id_corp, $tanggal_awal, $tanggal_akhir);
|
|
$no = 0;
|
|
foreach ($datInformasi as $key) {
|
|
$datBiayaFee = $this->Informasi->getData_BiayaFee_byPENJUALAN($key['ID_PENJUALAN']);
|
|
$datInformasi[$no++] += ['BIAYAFEE' => $datBiayaFee];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'level' => $level,
|
|
'tanggal_awal' => $tanggal_awal,
|
|
'tanggal_akhir' => $tanggal_akhir,
|
|
'id_pelanggan' => $id_pelanggan,
|
|
'id_corp' => $id_corp,
|
|
'pelanggan' => $datPelanggan,
|
|
'corp' => $datCorp,
|
|
'set' => $set
|
|
];
|
|
$this->load->view('proses/InformasiBiayaFee_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataCekPembayaran_Keuangan_A1($id_so=null) { // Informasi = [75]
|
|
$datSo = $this->Informasi->getData_SalesOrder_status1_status5();
|
|
$tgl_now = date('d/m/Y');
|
|
|
|
if ($id_so==NULL) {
|
|
$title = "Belum terpilih*";
|
|
$datInformasi = NULL;
|
|
$status = NULL;
|
|
} else {
|
|
$dataSo = $this->Informasi->getData_SalesOrder_byID($id_so);
|
|
$title = $dataSo[0]['KODE_SO'];
|
|
$status_so = $dataSo[0]['STATUS_SO'];
|
|
|
|
if ($status_so==5) {
|
|
$datInformasi = NULL;
|
|
} else {
|
|
$datInformasi = $this->Informasi->getData_PiutangDagang_bySO($id_so);
|
|
}
|
|
|
|
$sumPda2 = $this->Informasi->getSum_PiutangDagang_bySO_status2($id_so);
|
|
if ($status_so==5) {
|
|
$status = "BATAL";
|
|
} else if ($sumPda2[0]['TOTAL']!=NULL) {
|
|
$status = "RETUR";
|
|
} else {
|
|
$sumPdaNot2 = $this->Informasi->getSum_PiutangDagang_bySO_not2($id_so);
|
|
if ($sumPdaNot2[0]['TOTAL']==0) {
|
|
$status = "LUNAS";
|
|
} else {
|
|
$status = "BELUM LUNAS";
|
|
}
|
|
}
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'so' => $datSo,
|
|
'title' => $title,
|
|
'tgl_now' => $tgl_now,
|
|
'id_so' => $id_so,
|
|
'status' => $status
|
|
];
|
|
$this->load->view('proses/InformasiCekPembayaran_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataDpPembelian_Keuangan_A1() { // Informasi = [42]
|
|
$datInformasi = $this->Informasi->getData_DpPembelian_forInformasi();
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi
|
|
];
|
|
$this->load->view('proses/InformasiDpPembelian_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataDpPembelian_Keuangan_A2($id) { // Informasi = [43]
|
|
$datInformasi = $this->Informasi->getData_DpPembelian_forInformasi($id);
|
|
$datSupplier = $this->Informasi->getData_Supplier_byID($id);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'nama_supplier' => $datSupplier[0]['NAMA_SUPPLIER'],
|
|
'nama_kota' => $datSupplier[0]['NAMA_KOTA']
|
|
];
|
|
$this->load->view('proses/InformasiDpPembelian_Keuangan_A2', $data);
|
|
}
|
|
|
|
public function dataDpPenjualan_Keuangan_A1() { // Informasi = [44]
|
|
$datInformasi = $this->Informasi->getData_DpPenjualan_forInformasi();
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi
|
|
];
|
|
$this->load->view('proses/InformasiDpPenjualan_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataDpPenjualan_Keuangan_A2($id) { // Informasi = [45]
|
|
$datInformasi = $this->Informasi->getData_DpPenjualan_forInformasi($id);
|
|
$datPelanggan = $this->Informasi->getData_Pelanggan_byID($id);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'nama_pelanggan' => $datPelanggan[0]['NAMA_PELANGGAN'],
|
|
'nama_kota' => $datPelanggan[0]['NAMA_KOTA']
|
|
];
|
|
$this->load->view('proses/InformasiDpPenjualan_Keuangan_A2', $data);
|
|
}
|
|
|
|
public function dataHutangDagang_Keuangan_A1() { // Informasi = [46]
|
|
$level = $this->session->userdata('level');
|
|
$datInformasi = $this->Informasi->getData_HutangDagang_forInformasi(NULL, $level);
|
|
$tgl = date('d/m/Y');
|
|
$tgl_now = date('Y-m-d');
|
|
|
|
$no = 0;
|
|
foreach ($datInformasi as $key) {
|
|
$datHda = $this->Informasi->getSum_HutangDagang_bySUPPLIER($key['SUPPLIER_ID'], $tgl_now);
|
|
$datInformasi[$no++] += ['HDA' => $datHda];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'level' => $level,
|
|
'tgl' => $tgl
|
|
];
|
|
$this->load->view('proses/InformasiHutangDagang_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataHutangDagang_Keuangan_A2($id) { // Informasi = [47]
|
|
$datInformasi = $this->Informasi->getData_HutangDagang_forInformasi($id);
|
|
$datSupplier = $this->Informasi->getData_Supplier_byID($id);
|
|
$tgl_now = date('m/d/Y');
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'nama_supplier' => $datSupplier[0]['NAMA_SUPPLIER'],
|
|
'nama_kota' => $datSupplier[0]['NAMA_KOTA'],
|
|
'tgl_now' => $tgl_now
|
|
];
|
|
$this->load->view('proses/InformasiHutangDagang_Keuangan_A2', $data);
|
|
}
|
|
|
|
public function dataHutangDagang_Keuangan_A3($id) { // Informasi = [48]
|
|
$datInformasi = $this->Informasi->getData_HutangDagang_byPEMBELIAN_forInformasi($id);
|
|
$datPembelian = $this->Informasi->getData_Pembelian_byID($id);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'inv_pembelian' => $datPembelian[0]['INV_PEMBELIAN'],
|
|
'id_supplier' => $datPembelian[0]['SUPPLIER_ID']
|
|
];
|
|
$this->load->view('proses/InformasiHutangDagang_Keuangan_A3', $data);
|
|
}
|
|
|
|
public function dataJurnalMemo_Keuangan_A1($id_jm=null) { // Informasi = [49]
|
|
$datJurnalMemo = $this->Informasi->getData_JurnalMemo_byKODE();
|
|
$tgl_now = date('d/m/Y');
|
|
|
|
if ($id_jm==NULL) {
|
|
$title = "Belum terpilih*";
|
|
} else {
|
|
$datJM = $this->Informasi->getData_JurnalMemo_byID($id_jm);
|
|
$title = $datJM[0]['KODE_JM'];
|
|
}
|
|
|
|
$datInformasi = $this->Informasi->getData_DaftarJurnalMemo_byJM($id_jm);
|
|
if ($datInformasi==NULL) {
|
|
$debet_djm = 0;
|
|
$kredit_djm = NULL;
|
|
} else {
|
|
$datSumDjm = $this->Informasi->getSum_DaftarJurnalMemo_byJM($id_jm);
|
|
$debet_djm = $datSumDjm[0]['DEBET'];
|
|
$kredit_djm = $datSumDjm[0]['KREDIT'];
|
|
$tgl_now = $datInformasi[0]['TANGGAL'];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'jurnal_memo' => $datJurnalMemo,
|
|
'debet_djm' => $debet_djm,
|
|
'kredit_djm' => $kredit_djm,
|
|
'title' => $title,
|
|
'tgl_now' => $tgl_now,
|
|
'id_jm' => $id_jm
|
|
];
|
|
$this->load->view('proses/InformasiJurnalMemo_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataKasbank_Keuangan_A1() { // Informasi = [50]
|
|
$tgl_now = date('d/m/Y');
|
|
$tgl = date('Y-m-d');
|
|
$kondisi = $this->input->post('kondisi');
|
|
$id_kb = $this->input->post('id_kb');
|
|
|
|
if ($kondisi==NULL) {
|
|
$id_kb = NULL;
|
|
$datKasbank = NULL;
|
|
$title = "Belum terpilih*";
|
|
$tanggal_awal = date('Y-m-d');
|
|
$tanggal_akhir = date('Y-m-d');
|
|
} else if ($kondisi=="settanggal") {
|
|
$id_kb = NULL;
|
|
$title = "Belum terpilih*";
|
|
$tanggal_awal = $this->input->post('tanggal_awal');
|
|
$tanggal_akhir = $this->input->post('tanggal_akhir');
|
|
$datKasbank = $this->Informasi->getData_Kasbank_byKODE($tanggal_awal, $tanggal_akhir);
|
|
} else {
|
|
$datKB = $this->Informasi->getData_Kasbank_byID($id_kb);
|
|
$title = $datKB[0]['KODE_KB'];
|
|
$tanggal_awal = $this->input->post('tanggal_awal');
|
|
$tanggal_akhir = $this->input->post('tanggal_akhir');
|
|
$datKasbank = $this->Informasi->getData_Kasbank_byKODE($tanggal_awal, $tanggal_akhir);
|
|
}
|
|
|
|
$datInformasi = $this->Informasi->getData_DaftarKasbank_byKB($id_kb);
|
|
if ($datInformasi==NULL) {
|
|
$debet_dkb = NULL;
|
|
$kredit_dkb = NULL;
|
|
} else {
|
|
$datSumDkb = $this->Informasi->getSum_DaftarKasbank_byKB($id_kb);
|
|
$debet_dkb = $datSumDkb[0]['DEBET'];
|
|
$kredit_dkb = $datSumDkb[0]['KREDIT'];
|
|
$tgl_now = $datInformasi[0]['TANGGAL'];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'kasbank' => $datKasbank,
|
|
'debet_dkb' => $debet_dkb,
|
|
'kredit_dkb' => $kredit_dkb,
|
|
'title' => $title,
|
|
'tgl_now' => $tgl_now,
|
|
'kondisi' => $kondisi,
|
|
'tanggal_awal' => $tanggal_awal,
|
|
'tanggal_akhir' => $tanggal_akhir,
|
|
'id_kb' => $id_kb
|
|
];
|
|
$this->load->view('proses/InformasiKasbank_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataPiutangDagang_Keuangan_A1() { // Informasi = [51]
|
|
$datKelompok = $this->Informasi->getData_Kelompok();
|
|
$level = $this->session->userdata('level');
|
|
$kondisi = $this->input->post('kondisi');
|
|
$id_kelompok = $this->input->post('id_kelompok');
|
|
$tgl = date('d/m/Y');
|
|
$tgl_now = date('Y-m-d');
|
|
|
|
if ($kondisi==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$id_kelompok = NULL;
|
|
$nama_kelompok = NULL;
|
|
} else {
|
|
$dataKelompok = $this->Informasi->getData_Kelompok($id_kelompok);
|
|
$nama_kelompok = $dataKelompok[0]['NAMA_KELOMPOK'];
|
|
$title = "$nama_kelompok";
|
|
}
|
|
|
|
$datInformasi = $this->Informasi->getData_PiutangDagang_forInformasi(NULL, $id_kelompok, $level);
|
|
$no = 0;
|
|
foreach ($datInformasi as $key) {
|
|
$datPda = $this->Informasi->getSum_PiutangDagang_byPELANGGAN($key['PID'], $tgl_now);
|
|
$datInformasi[$no++] += ['PDA' => $datPda];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'kelompok' => $datKelompok,
|
|
'id_kelompok' => $id_kelompok,
|
|
'tgl' => $tgl,
|
|
'title' => $title
|
|
];
|
|
$this->load->view('proses/InformasiPiutangDagang_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataPiutangDagang_Keuangan_A2($id) { // Informasi = [52]
|
|
$level = $this->session->userdata('level');
|
|
$datInformasi = $this->Informasi->getData_PiutangDagang_forInformasi($id, NULL, $level);
|
|
$datPelanggan = $this->Informasi->getData_Pelanggan_byID($id);
|
|
$tgl_now = date('m/d/Y');
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'nama_pelanggan' => $datPelanggan[0]['NAMA_PELANGGAN'],
|
|
'nama_kota' => $datPelanggan[0]['NAMA_KOTA'],
|
|
'tgl_now' => $tgl_now
|
|
];
|
|
$this->load->view('proses/InformasiPiutangDagang_Keuangan_A2', $data);
|
|
}
|
|
|
|
public function dataPiutangDagang_Keuangan_A3($id) { // Informasi = [53]
|
|
$datInformasi = $this->Informasi->getData_PiutangDagang_byPENJUALAN_forInformasi($id);
|
|
$datPda = $this->Informasi->getData_PiutangDagang_byID($id);
|
|
$tgl_now = date('m/d/Y');
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'inv_penjualan' => $datPda[0]['INV_PENJUALAN'],
|
|
'tgl_now' => $tgl_now,
|
|
'id_pelanggan' => $datPda[0]['PELANGGAN_ID']
|
|
];
|
|
$this->load->view('proses/InformasiPiutangDagang_Keuangan_A3', $data);
|
|
}
|
|
|
|
public function dataPiutangKaryawan_Keuangan_A1() { // Informasi = [54]
|
|
$datInformasi = $this->Informasi->getData_PiutangKaryawan_forInformasi();
|
|
$tgl = date('d/m/Y');
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'tgl' => $tgl
|
|
];
|
|
$this->load->view('proses/InformasiPiutangKaryawan_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataPiutangKaryawan_Keuangan_A2($id) { // Informasi = [55]
|
|
$datInformasi = $this->Informasi->getData_PiutangKaryawan_forInformasi($id);
|
|
$datKaryawan = $this->Informasi->getData_Karyawan_byID($id);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'nama_karyawan' => $datKaryawan[0]['NAMA_KARYAWAN']
|
|
];
|
|
$this->load->view('proses/InformasiPiutangKaryawan_Keuangan_A2', $data);
|
|
}
|
|
|
|
public function dataPiutangPihakke3_Keuangan_A1() { // Informasi = [56]
|
|
$datInformasi = $this->Informasi->getData_PiutangPihakke3_forInformasi();
|
|
$tgl = date('d/m/Y');
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'tgl' => $tgl
|
|
];
|
|
$this->load->view('proses/InformasiPiutangPihakke3_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataPiutangPihakke3_Keuangan_A2($id) { // Informasi = [57]
|
|
$datInformasi = $this->Informasi->getData_PiutangPihakke3_forInformasi($id);
|
|
$datPihakke3 = $this->Informasi->getData_Pihakke3_byID($id);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'nama_pihakke3' => $datPihakke3[0]['NAMA_PIHAKKE3'],
|
|
'nama_kota' => $datPihakke3[0]['NAMA_KOTA']
|
|
];
|
|
$this->load->view('proses/InformasiPiutangPihakke3_Keuangan_A2', $data);
|
|
}
|
|
|
|
public function dataSaldoBank_Keuangan_A1() { // Informasi = [58]
|
|
$level = $this->session->userdata('level');
|
|
$tgl = date('d/m/Y');
|
|
$datInformasi = $this->Informasi->getData_SaldoBank_forInformasi(NULL, $level);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'tgl' => $tgl
|
|
];
|
|
$this->load->view('proses/InformasiSaldoBank_Keuangan_A1', $data);
|
|
}
|
|
|
|
public function dataSaldoBank_Keuangan_A2($id) { // Informasi = [59]
|
|
$datInformasi = $this->Informasi->getData_SaldoBank_forInformasi($id);
|
|
$datBank = $this->Informasi->getData_Bank_byID($id);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'kode_bank' => $datBank[0]['KODE_BANK']
|
|
];
|
|
$this->load->view('proses/InformasiSaldoBank_Keuangan_A2', $data);
|
|
}
|
|
|
|
public function dataSaldoKas_Keuangan_A1() { // Informasi = [60]
|
|
$level = $this->session->userdata('level');
|
|
$datInformasi = $this->Informasi->getData_SaldoKas_forInformasi($level+1);
|
|
$datSumKas = $this->Informasi->getSum_SaldoKas_forInformasi($level+1);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'level' => $level,
|
|
'total' => $datSumKas[0]['TOTAL']
|
|
];
|
|
$this->load->view('proses/InformasiSaldoKas_Keuangan_A1', $data);
|
|
}
|
|
|
|
//Controller Untuk Keuangan Neraca dan Laba Rugi
|
|
public function get_count_neraca() { // Informasi = [61]
|
|
$id_setdata = $this->Informasi->getID_SetdataMax();
|
|
$id_setdata = $id_setdata[0]['ID_SETDATA'];
|
|
|
|
$datSetdata = $this->Informasi->getData_Setdata_byID($id_setdata);
|
|
$month = date_format(date_create($datSetdata[0]['TGL_SETDATA']), "m");
|
|
$year = date_format(date_create($datSetdata[0]['TGL_SETDATA']), "Y");
|
|
|
|
//Aktiva Lancar
|
|
$nilaiNeraca1_1 = $this->Informasi->getSum_SaldoKas_byDKB_forNeraca($month, $year);
|
|
$nilaiNeraca1_2 = $this->Informasi->getSum_SaldoKas_byDJM_forNeraca($month, $year);
|
|
$nilaiNeraca1 = $nilaiNeraca1_1[0]['TOTALNERACA']+$nilaiNeraca1_2[0]['TOTALNERACA'];
|
|
|
|
$nilaiNeraca2_1 = $this->Informasi->getSum_SaldoBank_byDKB_forNeraca($month, $year);
|
|
$nilaiNeraca2_2 = $this->Informasi->getSum_SaldoBank_byDJM_forNeraca($month, $year);
|
|
$nilaiNeraca2 = $nilaiNeraca2_1[0]['TOTALNERACA']+$nilaiNeraca2_2[0]['TOTALNERACA'];
|
|
|
|
$nilaiNeraca3 = $this->Informasi->getSum_PiutangDagang_forNeraca($month, $year);
|
|
|
|
$persediaan = $this->Informasi->getSum_HistoriKuantiti_groupBARANG_forNeraca($month, $year);
|
|
$nilaiNeraca4 = 0;
|
|
foreach ($persediaan as $dat) {
|
|
$datHq = $this->Informasi->getData_HistoriKuantiti_byBARANG_MasukLebih0($dat['BARANG_ID'], $month, $year);
|
|
$no = 0;
|
|
$totkeluar = 0;
|
|
$totpersediaan = 0;
|
|
$hargaavglama = 0;
|
|
foreach ($datHq as $key) {
|
|
$sumHq = $this->Informasi->getSum_HistoriKuantiti_byBARANG_byHQ($key['BARANG_ID'], $key['ID_HQ']);
|
|
if ($totkeluar!=$sumHq[0]['KELUAR']) {
|
|
$totkeluar = $sumHq[0]['KELUAR'];
|
|
$datHqLim = $this->Informasi->getData_HistoriKuantiti_limitHQ($key['BARANG_ID'], $key['ID_HQ']);
|
|
$limit = $this->Informasi->getSum_HistoriKuantiti_byBARANG_byHQ1_byHQ2($key['BARANG_ID'], $key['ID_HQ'], $datHqLim[0]['ID_HQ']);
|
|
$keluar = $limit[0]['KELUAR'];
|
|
} else {
|
|
$keluar = 0;
|
|
$totkeluar = 0;
|
|
}
|
|
|
|
//Harga Per Item, DPP
|
|
$harga = $key['NILAI_HQ'] / $key['MASUK_HQ'];
|
|
|
|
//Nilai Total Persediaan Akhir
|
|
$nilaiPersediaanKeluar = $hargaavglama * $keluar;
|
|
$totpersediaan = $totpersediaan + ($harga * $key['MASUK_HQ']) - $nilaiPersediaanKeluar;
|
|
$hppakhir = $totpersediaan/$sumHq[0]['TOTAL'];
|
|
|
|
$hargaavglama = $hppakhir;
|
|
}
|
|
//Tambahkan Nilai Terakhir Persediaan per Kode Barang
|
|
|
|
$subtotal = $hppakhir*$dat['TOTAL'];
|
|
$nilaiNeraca4 = $nilaiNeraca4 + $subtotal;
|
|
}
|
|
|
|
$nilaiNeraca5 = $this->Informasi->getSum_PiutangKaryawan_forNeraca($month, $year);
|
|
$nilaiNeraca6 = $this->Informasi->getSum_PiutangPihakke3_forNeraca($month, $year);
|
|
$nilaiNeraca7 = $this->Informasi->getSum_DpPembelian_forNeraca($month, $year);
|
|
$nilaiNeraca8_1 = $this->Informasi->getSum_PajakDibayarDimuka_byDKB_forNeraca($month, $year);
|
|
$nilaiNeraca8_2 = $this->Informasi->getSum_PajakDibayarDimuka_byDJM_forNeraca($month, $year);
|
|
$nilaiNeraca8 = $nilaiNeraca8_1[0]['TOTALNERACA']-$nilaiNeraca8_2[0]['TOTALNERACA'];
|
|
|
|
//Rumus Ambil Data Pajak Masukan Periode Ini
|
|
$tgl_awal = date_format(date_create($datSetdata[0]['TGL_SETDATA']), "Y-m-01");
|
|
|
|
$tgl_lock = $this->Informasi->addTempoMonth($tgl_awal,1);
|
|
$tgl_lock = $this->Informasi->subTempoDay($tgl_lock,1);
|
|
|
|
$datPembelian = $this->Informasi->getData_PajakMasukan_Pembelian($tgl_awal, $tgl_lock);
|
|
$datRb = $this->Informasi->getData_PajakMasukan_ReturBeli($tgl_awal, $tgl_lock);
|
|
foreach ($datRb as $key) {
|
|
$datPembelian[count($datPembelian)] = $key;
|
|
}
|
|
asort($datPembelian);
|
|
|
|
$total_pajakmasukan = 0;
|
|
foreach ($datPembelian as $key) {
|
|
$subtotal = $key['TOTAL']-$key['TOTALDPP'];
|
|
if (strpos($key['KODEBUKTI'],"PB")!==FALSE) {
|
|
$total_pajakmasukan = $total_pajakmasukan+$subtotal;
|
|
} else if (strpos($key['KODEBUKTI'],"RB")!==FALSE) {
|
|
$total_pajakmasukan = $total_pajakmasukan-$subtotal;
|
|
}
|
|
}
|
|
|
|
$nilaiNeraca82_1 = $this->Informasi->getSum_PajakMasukanKasbank_forNeraca($month, $year);
|
|
$nilaiNeraca82_2 = $this->Informasi->getSum_PajakMasukanJurnalMemo_forNeraca($month, $year);
|
|
$nilaiNeraca82 = $nilaiNeraca82_1[0]['TOTALNERACA']+$nilaiNeraca82_2[0]['TOTALNERACA']+$total_pajakmasukan;
|
|
|
|
//Aktiva Tetap
|
|
$nilaiNeraca9 = $this->Informasi->getSum_InventarisKantor_forNeraca($month, $year);
|
|
$nilaiNeraca10 = $this->Informasi->getSum_PenyusutanInventarisKantor_forNeraca($month, $year);
|
|
$sisainventaris = $nilaiNeraca9[0]['TOTALNERACA']-$nilaiNeraca10[0]['TOTALNERACA'];
|
|
|
|
$nilaiNeraca11 = $this->Informasi->getSum_Ruko_forNeraca($month, $year);
|
|
$nilaiNeraca12 = $this->Informasi->getSum_PenyusutanRuko_forNeraca($month, $year);
|
|
$sisabangunan = $nilaiNeraca11[0]['TOTALNERACA']-$nilaiNeraca12[0]['TOTALNERACA'];
|
|
|
|
$nilaiNeraca13 = $this->Informasi->getSum_Kendaraan_forNeraca($month, $year);
|
|
$nilaiNeraca14 = $this->Informasi->getSum_PenyusutanKendaraan_forNeraca($month, $year);
|
|
$sisakendaraan = $nilaiNeraca13[0]['TOTALNERACA']-$nilaiNeraca14[0]['TOTALNERACA'];
|
|
|
|
//Kewajiban Lancar
|
|
$nilaiNeraca15 = $this->Informasi->getSum_HutangDagang_forNeraca($month, $year);
|
|
$nilaiNeraca17 = $this->Informasi->getSum_HutangBank_forNeraca($month, $year);
|
|
$nilaiNeraca18 = $this->Informasi->getSum_HutangAktiva_forNeraca($month, $year);
|
|
$nilaiNeraca19 = $this->Informasi->getSum_DpPenjualan_forNeraca($month, $year);
|
|
|
|
$nilaiNeraca16_1 = $this->Informasi->getSum_HutangPajak_byDKB_forNeraca($month, $year);
|
|
$nilaiNeraca16_2 = $this->Informasi->getSum_HutangPajak_byDJM_forNeraca($month, $year);
|
|
$nilaiNeraca16 = $nilaiNeraca16_1[0]['TOTALNERACA']+$nilaiNeraca16_2[0]['TOTALNERACA'];
|
|
|
|
//Jurnal Otomatis, Pajak Keluaran
|
|
$datPenjualan = $this->Informasi->getData_PajakKeluaran_Penjualan($tgl_awal, $tgl_lock);
|
|
$datRj = $this->Informasi->getData_PajakKeluaran_ReturJual($tgl_awal, $tgl_lock);
|
|
foreach ($datRj as $key) {
|
|
$datPenjualan[count($datPenjualan)] = $key;
|
|
}
|
|
asort($datPenjualan);
|
|
|
|
$total_pajakkeluaran = 0;
|
|
foreach ($datPenjualan as $key) {
|
|
$subtotal = $key['TOTAL']-$key['TOTALDPP'];
|
|
if (strpos($key['KODEBUKTI'],"PJ")!==FALSE) {
|
|
$total_pajakkeluaran = $total_pajakkeluaran+$subtotal;
|
|
} else if (strpos($key['KODEBUKTI'],"RJ")!==FALSE) {
|
|
$total_pajakkeluaran = $total_pajakkeluaran-$subtotal;
|
|
}
|
|
}
|
|
|
|
$nilaiNeraca83_1 = $this->Informasi->getSum_PajakKeluaranKasbank_forNeraca($month, $year);
|
|
$nilaiNeraca83_2 = $this->Informasi->getSum_PajakKeluaranJurnalMemo_forNeraca($month, $year);
|
|
$nilaiNeraca83 = $nilaiNeraca83_1[0]['TOTALNERACA']+$nilaiNeraca83_2[0]['TOTALNERACA']+$total_pajakkeluaran;
|
|
|
|
//Modal
|
|
$nilaiNeraca20 = $this->Informasi->getSum_Modal_forNeraca($month, $year);
|
|
$nilaiNeraca21 = $this->Informasi->getSum_AkumulasiLabaDitahan_forNeraca($month, $year);
|
|
|
|
//Total Semua Penjualan
|
|
$nilaiNeraca23 = $this->Informasi->getSum_Penjualan_forNeraca($month, $year);
|
|
$nilaiNeraca24 = $this->Informasi->getSum_ReturPenjualan_forNeraca($month, $year);
|
|
$nilaiNeraca25 = $this->Informasi->getSum_PotonganDiskonPenjualan_forNeraca($month, $year);
|
|
|
|
//Total Semua Pembelian
|
|
$nilaiNeraca26 = $this->Informasi->getSum_PersediaanAwal_forNeraca($month, $year);
|
|
$nilaiNeraca27 = $this->Informasi->getSum_Pembelian_forNeraca($month, $year);
|
|
$nilaiNeraca28 = $this->Informasi->getSum_ReturPembelian_forNeraca($month, $year);
|
|
$nilaiNeraca29 = $this->Informasi->getSum_PotonganDiskonPembelian_forNeraca($month, $year);
|
|
|
|
//Total Semua Biaya Penjualan
|
|
$nilaiNeraca31 = $this->Informasi->getSum_BiayaOperasional_forNeraca($month, $year);
|
|
$nilaiNeraca32 = $this->Informasi->getSum_BiayaPengiriman_forNeraca($month, $year);
|
|
$nilaiNeraca33 = $this->Informasi->getSum_BiayaServiceKendaraan_forNeraca($month, $year);
|
|
$nilaiNeraca34 = $this->Informasi->getSum_BiayaBensin_forNeraca($month, $year);
|
|
$nilaiNeraca35 = $this->Informasi->getSum_BiayaParkirUmum_forNeraca($month, $year);
|
|
$nilaiNeraca36 = $this->Informasi->getSum_BiayaSparepart_forNeraca($month, $year);
|
|
$nilaiNeraca37 = $this->Informasi->getSum_BiayaKebutuhanService_forNeraca($month, $year);
|
|
|
|
//Total Semua Biaya Umum Administrasi
|
|
$nilaiNeraca38 = $this->Informasi->getSum_BiayaGajiTHR_forNeraca($month, $year);
|
|
$nilaiNeraca39_1 = $this->Informasi->getSum_BiayaPajakPPHPsl21_forNeraca_DKB($month, $year);
|
|
$nilaiNeraca39_2 = $this->Informasi->getSum_BiayaPajakPPHPsl21_forNeraca_DJM($month, $year);
|
|
$nilaiNeraca39 = $nilaiNeraca39_1[0]['TOTALNERACA']+$nilaiNeraca39_2[0]['TOTALNERACA'];
|
|
$nilaiNeraca40 = $this->Informasi->getSum_BiayaIncentive_forNeraca($month, $year);
|
|
$nilaiNeraca41 = $this->Informasi->getSum_BiayaPLN_forNeraca($month, $year);
|
|
$nilaiNeraca42 = $this->Informasi->getSum_BiayaTelepon_forNeraca($month, $year);
|
|
$nilaiNeraca43 = $this->Informasi->getSum_BiayaInternet_forNeraca($month, $year);
|
|
$nilaiNeraca44 = $this->Informasi->getSum_BiayaPDAM_forNeraca($month, $year);
|
|
$nilaiNeraca45 = $this->Informasi->getSum_BiayaServiceChargeManggaDua_forNeraca($month, $year);
|
|
$nilaiNeraca46 = $this->Informasi->getSum_BiayaParkirKaryawan_forNeraca($month, $year);
|
|
$nilaiNeraca47 = $this->Informasi->getSum_BiayaKonsultanPajak_forNeraca($month, $year);
|
|
$nilaiNeraca48 = $this->Informasi->getSum_BiayaATK_forNeraca($month, $year);
|
|
$nilaiNeraca49 = $this->Informasi->getSum_BiayaMaterai_forNeraca($month, $year);
|
|
$nilaiNeraca50 = $this->Informasi->getSum_BiayaFotocopy_forNeraca($month, $year);
|
|
$nilaiNeraca51 = $this->Informasi->getSum_BiayaMajalahKomputer_forNeraca($month, $year);
|
|
$nilaiNeraca52 = $this->Informasi->getSum_BiayaCetak_forNeraca($month, $year);
|
|
$nilaiNeraca53 = $this->Informasi->getSum_BiayaSuratReferensi_forNeraca($month, $year);
|
|
$nilaiNeraca54 = $this->Informasi->getSum_BiayaKebutuhanKantor_forNeraca($month, $year);
|
|
$nilaiNeraca55 = $this->Informasi->getSum_BiayaServiceLuar_forNeraca($month, $year);
|
|
$nilaiNeraca56 = $this->Informasi->getSum_BiayaTol_forNeraca($month, $year);
|
|
$nilaiNeraca57 = $this->Informasi->getSum_BiayaServiceAC_forNeraca($month, $year);
|
|
$nilaiNeraca58 = $this->Informasi->getSum_BiayaPajakKendaraan_forNeraca($month, $year);
|
|
$nilaiNeraca59 = $this->Informasi->getSum_BiayaSumbangan_forNeraca($month, $year);
|
|
$nilaiNeraca60 = $this->Informasi->getSum_BiayaEntertain_forNeraca($month, $year);
|
|
$nilaiNeraca61 = $this->Informasi->getSum_BiayaBPJS_forNeraca($month, $year);
|
|
$nilaiNeraca62 = $this->Informasi->getSum_BiayaAssKaryawan_forNeraca($month, $year);
|
|
$nilaiNeraca63 = $this->Informasi->getSum_BiayaTraining_forNeraca($month, $year);
|
|
$nilaiNeraca64_1 = $this->Informasi->getSum_BiayaFee_byDKB_forNeraca($month, $year);
|
|
$nilaiNeraca64_2 = $this->Informasi->getSum_BiayaFee_byDJM_forNeraca($month, $year);
|
|
$nilaiNeraca64 = $nilaiNeraca64_1[0]['TOTALNERACA']+$nilaiNeraca64_2[0]['TOTALNERACA'];
|
|
$nilaiNeraca65 = $this->Informasi->getSum_BiayaDinasLuar_forNeraca($month, $year);
|
|
$nilaiNeraca66 = $this->Informasi->getSum_BiayaPajakPPHPsl25_forNeraca($month, $year);
|
|
if ($id_setdata==2) {
|
|
$nilaiNeraca67 = 0;
|
|
} else {
|
|
$nilaiNeraca67 = $this->Informasi->getSum_BiayaPenyusutan_forNeraca($month, $year);
|
|
$nilaiNeraca67 = $nilaiNeraca67[0]['TOTALNERACA'];
|
|
}
|
|
$nilaiNeraca68 = $this->Informasi->getSum_BiayaKegiatanKaryawan_forNeraca($month, $year);
|
|
$nilaiNeraca69 = $this->Informasi->getSum_BiayaRekreasiKaryawan_forNeraca($month, $year);
|
|
$nilaiNeraca70 = $this->Informasi->getSum_BiayaPengeluaranProject_forNeraca($month, $year);
|
|
$nilaiNeraca71 = $this->Informasi->getSum_BiayaBungaKredit_forNeraca($month, $year);
|
|
$nilaiNeraca72 = $this->Informasi->getSum_BiayaKreditBank_forNeraca($month, $year);
|
|
$nilaiNeraca73 = $this->Informasi->getSum_BiayaPerawatanPerbaikanGedung_forNeraca($month, $year);
|
|
$nilaiNeraca74 = $this->Informasi->getSum_BiayaLainLain_forNeraca($month, $year);
|
|
|
|
//Total Semua Laba Bersih Sebelum Pajak
|
|
$nilaiNeraca75 = $this->Informasi->getSum_PendapatanDiluarUsaha_forNeraca($month, $year);
|
|
$nilaiNeraca76 = $this->Informasi->getSum_PendapatanJasaGiro_forNeraca($month, $year);
|
|
$nilaiNeraca77 = $this->Informasi->getSum_AdminBank_forNeraca($month, $year);
|
|
$nilaiNeraca78 = $this->Informasi->getSum_PajakGiro_forNeraca($month, $year);
|
|
$nilaiNeraca87 = $this->Informasi->getSum_BebanSelisihNilai_forNeraca($month, $year);
|
|
|
|
//Total Semua Laba Bersih Setelah Pajak
|
|
$nilaiNeraca79 = $this->Informasi->getSum_BiayaPajakPenghasilan_forNeraca($month, $year);
|
|
|
|
//Total Kode Perkiraan Tambahan u/ITC IT Point, yang terpakai Hanya Neraca 80 dan 86
|
|
$nilaiNeraca80 = $this->Informasi->getSum_BiayaPengeluaranItc_forNeraca($month, $year);
|
|
$nilaiNeraca81 = $this->Informasi->getSum_BiayaParkirKarITC_forNeraca($month, $year);
|
|
$nilaiNeraca84 = $this->Informasi->getSum_BiayaListrikITC_forNeraca($month, $year);
|
|
$nilaiNeraca85 = $this->Informasi->getSum_BiayaSewaStand_forNeraca($month, $year);
|
|
$nilaiNeraca86 = $this->Informasi->getSum_BiayaPajakLainnya_forNeraca($month, $year);
|
|
|
|
//Subtotal untuk Pajak Masukan dan Keluaran, mencari Selisih
|
|
if ($nilaiNeraca82>$nilaiNeraca83) {
|
|
$nilaiNeraca82 = $nilaiNeraca82-$nilaiNeraca83;
|
|
$nilaiNeraca83 = 0;
|
|
} else if ($nilaiNeraca82==$nilaiNeraca83) {
|
|
$nilaiNeraca82 = 0;
|
|
$nilaiNeraca83 = 0;
|
|
} else if ($nilaiNeraca82<$nilaiNeraca83) {
|
|
$nilaiNeraca83 = $nilaiNeraca83-$nilaiNeraca82;
|
|
$nilaiNeraca82 = 0;
|
|
}
|
|
|
|
//Subtotal Perhitungan
|
|
$aktivaLancar = $nilaiNeraca1+$nilaiNeraca2+$nilaiNeraca3[0]['TOTALNERACA']+$nilaiNeraca4
|
|
+$nilaiNeraca5[0]['TOTALNERACA']+$nilaiNeraca6[0]['TOTALNERACA']+$nilaiNeraca7[0]['TOTALNERACA']+$nilaiNeraca8
|
|
+$nilaiNeraca82;
|
|
$kewajibanLancar = $nilaiNeraca15[0]['TOTALNERACA']+$nilaiNeraca16+$nilaiNeraca17[0]['TOTALNERACA']+$nilaiNeraca18[0]['TOTALNERACA']+$nilaiNeraca19[0]['TOTALNERACA']
|
|
+$nilaiNeraca83;
|
|
$aktivaTetap = $sisainventaris+$sisabangunan+$sisakendaraan;
|
|
$totalPenjualan = $nilaiNeraca23[0]['TOTALNERACA']-$nilaiNeraca24[0]['TOTALNERACA']-$nilaiNeraca25[0]['TOTALNERACA'];
|
|
$totalPembelian = $nilaiNeraca26[0]['TOTALNERACA']+$nilaiNeraca27[0]['TOTALNERACA']-$nilaiNeraca28[0]['TOTALNERACA']-$nilaiNeraca29[0]['TOTALNERACA'];
|
|
$hargaPokokPenjualan = $totalPembelian-$nilaiNeraca4;
|
|
$labaKotor = $totalPenjualan-$hargaPokokPenjualan;
|
|
$totalBiayaPenjualan = $nilaiNeraca31[0]['TOTALNERACA']+$nilaiNeraca32[0]['TOTALNERACA']+$nilaiNeraca33[0]['TOTALNERACA']+$nilaiNeraca34[0]['TOTALNERACA']
|
|
+$nilaiNeraca35[0]['TOTALNERACA']+$nilaiNeraca36[0]['TOTALNERACA']+$nilaiNeraca37[0]['TOTALNERACA'];
|
|
$totalBiayaUmumAdministrasi = $nilaiNeraca38[0]['TOTALNERACA']+$nilaiNeraca39+$nilaiNeraca40[0]['TOTALNERACA']+$nilaiNeraca41[0]['TOTALNERACA']+$nilaiNeraca42[0]['TOTALNERACA']+$nilaiNeraca43[0]['TOTALNERACA']
|
|
+$nilaiNeraca44[0]['TOTALNERACA']+$nilaiNeraca45[0]['TOTALNERACA']+$nilaiNeraca46[0]['TOTALNERACA']+$nilaiNeraca47[0]['TOTALNERACA']+$nilaiNeraca48[0]['TOTALNERACA']+$nilaiNeraca49[0]['TOTALNERACA']
|
|
+$nilaiNeraca50[0]['TOTALNERACA']+$nilaiNeraca51[0]['TOTALNERACA']+$nilaiNeraca52[0]['TOTALNERACA']+$nilaiNeraca53[0]['TOTALNERACA']+$nilaiNeraca54[0]['TOTALNERACA']+$nilaiNeraca55[0]['TOTALNERACA']
|
|
+$nilaiNeraca56[0]['TOTALNERACA']+$nilaiNeraca57[0]['TOTALNERACA']+$nilaiNeraca58[0]['TOTALNERACA']+$nilaiNeraca59[0]['TOTALNERACA']+$nilaiNeraca60[0]['TOTALNERACA']+$nilaiNeraca61[0]['TOTALNERACA']
|
|
+$nilaiNeraca62[0]['TOTALNERACA']+$nilaiNeraca63[0]['TOTALNERACA']+$nilaiNeraca64+$nilaiNeraca65[0]['TOTALNERACA']+$nilaiNeraca66[0]['TOTALNERACA']+$nilaiNeraca67+$nilaiNeraca68[0]['TOTALNERACA']
|
|
+$nilaiNeraca69[0]['TOTALNERACA']+$nilaiNeraca70[0]['TOTALNERACA']+$nilaiNeraca71[0]['TOTALNERACA']+$nilaiNeraca72[0]['TOTALNERACA']+$nilaiNeraca73[0]['TOTALNERACA']+$nilaiNeraca74[0]['TOTALNERACA']
|
|
+$nilaiNeraca80[0]['TOTALNERACA']+$nilaiNeraca81[0]['TOTALNERACA']+$nilaiNeraca84[0]['TOTALNERACA']+$nilaiNeraca85[0]['TOTALNERACA']+$nilaiNeraca86[0]['TOTALNERACA'];
|
|
$totalBiayaBiaya = $totalBiayaPenjualan+$totalBiayaUmumAdministrasi;
|
|
$labaUsaha = $labaKotor-$totalBiayaBiaya;
|
|
$subPendapatan = $nilaiNeraca75[0]['TOTALNERACA']+$nilaiNeraca76[0]['TOTALNERACA'];
|
|
$subBeban = $nilaiNeraca77[0]['TOTALNERACA']+$nilaiNeraca78[0]['TOTALNERACA']+$nilaiNeraca87[0]['TOTALNERACA'];
|
|
$totalPendapatan = $nilaiNeraca75[0]['TOTALNERACA']+$nilaiNeraca76[0]['TOTALNERACA']-$nilaiNeraca77[0]['TOTALNERACA']-$nilaiNeraca78[0]['TOTALNERACA'];
|
|
$labaBersihSebelumPajak = $labaUsaha+$totalPendapatan;
|
|
$labaBersihSetelahPajak = $labaBersihSebelumPajak-$nilaiNeraca79[0]['TOTALNERACA'];
|
|
$nilaiNeraca22 = $labaBersihSetelahPajak;
|
|
|
|
$modal = $nilaiNeraca20[0]['TOTALNERACA']+$nilaiNeraca21[0]['TOTALNERACA']+$labaBersihSetelahPajak;
|
|
$totalAktiva = $aktivaLancar+$aktivaTetap;
|
|
$totalPassiva = $kewajibanLancar+$modal;
|
|
|
|
//Set Nilai untuk Proses Kunci Neraca
|
|
$nil1 = round($nilaiNeraca1,2); $nil11 = round($nilaiNeraca11[0]['TOTALNERACA'],2); $nil21 = round($nilaiNeraca21[0]['TOTALNERACA'],2);
|
|
$nil2 = round($nilaiNeraca2,2); $nil12 = round($nilaiNeraca12[0]['TOTALNERACA'],2); $nil22 = round($nilaiNeraca22,2);
|
|
$nil3 = round($nilaiNeraca3[0]['TOTALNERACA'],2); $nil13 = round($nilaiNeraca13[0]['TOTALNERACA'],2); $nil23 = round($nilaiNeraca23[0]['TOTALNERACA'],2);
|
|
$nil4 = round($nilaiNeraca4,2); $nil14 = round($nilaiNeraca14[0]['TOTALNERACA'],2); $nil24 = round($nilaiNeraca24[0]['TOTALNERACA'],2);
|
|
$nil5 = round($nilaiNeraca5[0]['TOTALNERACA'],2); $nil15 = round($nilaiNeraca15[0]['TOTALNERACA'],2); $nil25 = round($nilaiNeraca25[0]['TOTALNERACA'],2);
|
|
$nil6 = round($nilaiNeraca6[0]['TOTALNERACA'],2); $nil16 = round($nilaiNeraca16,2); $nil26 = round($nilaiNeraca26[0]['TOTALNERACA'],2);
|
|
$nil7 = round($nilaiNeraca7[0]['TOTALNERACA'],2); $nil17 = round($nilaiNeraca17[0]['TOTALNERACA'],2); $nil27 = round($nilaiNeraca27[0]['TOTALNERACA'],2);
|
|
$nil8 = round($nilaiNeraca8,2); $nil18 = round($nilaiNeraca18[0]['TOTALNERACA'],2); $nil28 = round($nilaiNeraca28[0]['TOTALNERACA'],2);
|
|
$nil9 = round($nilaiNeraca9[0]['TOTALNERACA'],2); $nil19 = round($nilaiNeraca19[0]['TOTALNERACA'],2); $nil29 = round($nilaiNeraca29[0]['TOTALNERACA'],2);
|
|
$nil10 = round($nilaiNeraca10[0]['TOTALNERACA'],2); $nil20 = round($nilaiNeraca20[0]['TOTALNERACA'],2); $nil30 = round($nilaiNeraca4,2);
|
|
|
|
$nil31 = round($nilaiNeraca31[0]['TOTALNERACA'],2); $nil41 = round($nilaiNeraca41[0]['TOTALNERACA'],2); $nil51 = round($nilaiNeraca51[0]['TOTALNERACA'],2);
|
|
$nil32 = round($nilaiNeraca32[0]['TOTALNERACA'],2); $nil42 = round($nilaiNeraca42[0]['TOTALNERACA'],2); $nil52 = round($nilaiNeraca52[0]['TOTALNERACA'],2);
|
|
$nil33 = round($nilaiNeraca33[0]['TOTALNERACA'],2); $nil43 = round($nilaiNeraca43[0]['TOTALNERACA'],2); $nil53 = round($nilaiNeraca53[0]['TOTALNERACA'],2);
|
|
$nil34 = round($nilaiNeraca34[0]['TOTALNERACA'],2); $nil44 = round($nilaiNeraca44[0]['TOTALNERACA'],2); $nil54 = round($nilaiNeraca54[0]['TOTALNERACA'],2);
|
|
$nil35 = round($nilaiNeraca35[0]['TOTALNERACA'],2); $nil45 = round($nilaiNeraca45[0]['TOTALNERACA'],2); $nil55 = round($nilaiNeraca55[0]['TOTALNERACA'],2);
|
|
$nil36 = round($nilaiNeraca36[0]['TOTALNERACA'],2); $nil46 = round($nilaiNeraca46[0]['TOTALNERACA'],2); $nil56 = round($nilaiNeraca56[0]['TOTALNERACA'],2);
|
|
$nil37 = round($nilaiNeraca37[0]['TOTALNERACA'],2); $nil47 = round($nilaiNeraca47[0]['TOTALNERACA'],2); $nil57 = round($nilaiNeraca57[0]['TOTALNERACA'],2);
|
|
$nil38 = round($nilaiNeraca38[0]['TOTALNERACA'],2); $nil48 = round($nilaiNeraca48[0]['TOTALNERACA'],2); $nil58 = round($nilaiNeraca58[0]['TOTALNERACA'],2);
|
|
$nil39 = round($nilaiNeraca39,2); $nil49 = round($nilaiNeraca49[0]['TOTALNERACA'],2); $nil59 = round($nilaiNeraca59[0]['TOTALNERACA'],2);
|
|
$nil40 = round($nilaiNeraca40[0]['TOTALNERACA'],2); $nil50 = round($nilaiNeraca50[0]['TOTALNERACA'],2); $nil60 = round($nilaiNeraca60[0]['TOTALNERACA'],2);
|
|
|
|
$nil61 = round($nilaiNeraca61[0]['TOTALNERACA'],2); $nil71 = round($nilaiNeraca71[0]['TOTALNERACA'],2); $nil81 = round($nilaiNeraca81[0]['TOTALNERACA'],2);
|
|
$nil62 = round($nilaiNeraca62[0]['TOTALNERACA'],2); $nil72 = round($nilaiNeraca72[0]['TOTALNERACA'],2); $nil82 = round($nilaiNeraca82,2);
|
|
$nil63 = round($nilaiNeraca63[0]['TOTALNERACA'],2); $nil73 = round($nilaiNeraca73[0]['TOTALNERACA'],2); $nil83 = round($nilaiNeraca83,2);
|
|
$nil64 = round($nilaiNeraca64,2); $nil74 = round($nilaiNeraca74[0]['TOTALNERACA'],2); $nil84 = round($nilaiNeraca84[0]['TOTALNERACA'],2);
|
|
$nil65 = round($nilaiNeraca65[0]['TOTALNERACA'],2); $nil75 = round($nilaiNeraca75[0]['TOTALNERACA'],2); $nil85 = round($nilaiNeraca85[0]['TOTALNERACA'],2);
|
|
$nil66 = round($nilaiNeraca66[0]['TOTALNERACA'],2); $nil76 = round($nilaiNeraca76[0]['TOTALNERACA'],2); $nil86 = round($nilaiNeraca86[0]['TOTALNERACA'],2);
|
|
$nil67 = round($nilaiNeraca67,2); $nil77 = round($nilaiNeraca77[0]['TOTALNERACA'],2); $nil87 = round($nilaiNeraca87[0]['TOTALNERACA'],2);
|
|
$nil68 = round($nilaiNeraca68[0]['TOTALNERACA'],2); $nil78 = round($nilaiNeraca78[0]['TOTALNERACA'],2);
|
|
$nil69 = round($nilaiNeraca69[0]['TOTALNERACA'],2); $nil79 = round($nilaiNeraca79[0]['TOTALNERACA'],2);
|
|
$nil70 = round($nilaiNeraca70[0]['TOTALNERACA'],2); $nil80 = round($nilaiNeraca80[0]['TOTALNERACA'],2);
|
|
|
|
//Set Data Null menjadi 0.00 Neraca Berjalan
|
|
if ($nilaiNeraca1==NULL) { $nilaiNeraca1 = "0.00"; } else { $nilaiNeraca1 = number_format($nilaiNeraca1,2); }
|
|
if ($nilaiNeraca2==NULL) { $nilaiNeraca2 = "0.00"; } else { $nilaiNeraca2 = number_format($nilaiNeraca2,2); }
|
|
if ($nilaiNeraca3==NULL) { $nilaiNeraca3 = "0.00"; } else { $nilaiNeraca3 = number_format($nilaiNeraca3[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca4==NULL) { $nilaiNeraca4 = "0.00"; } else { $nilaiNeraca4 = number_format($nilaiNeraca4,2); }
|
|
if ($nilaiNeraca5==NULL) { $nilaiNeraca5 = "0.00"; } else { $nilaiNeraca5 = number_format($nilaiNeraca5[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca6==NULL) { $nilaiNeraca6 = "0.00"; } else { $nilaiNeraca6 = number_format($nilaiNeraca6[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca7==NULL) { $nilaiNeraca7 = "0.00"; } else { $nilaiNeraca7 = number_format($nilaiNeraca7[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca8==NULL) { $nilaiNeraca8 = "0.00"; } else { $nilaiNeraca8 = number_format($nilaiNeraca8,2); }
|
|
if ($nilaiNeraca9==NULL) { $nilaiNeraca9 = "0.00"; } else { $nilaiNeraca9 = number_format($nilaiNeraca9[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca10==NULL) { $nilaiNeraca10 = "0.00"; } else { $nilaiNeraca10 = number_format($nilaiNeraca10[0]['TOTALNERACA'],2); }
|
|
if ($sisainventaris==NULL) { $sisainventaris = "0.00"; } else { $sisainventaris = number_format($sisainventaris,2); }
|
|
if ($nilaiNeraca11==NULL) { $nilaiNeraca11 = "0.00"; } else { $nilaiNeraca11 = number_format($nilaiNeraca11[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca12==NULL) { $nilaiNeraca12 = "0.00"; } else { $nilaiNeraca12 = number_format($nilaiNeraca12[0]['TOTALNERACA'],2); }
|
|
if ($sisabangunan==NULL) { $sisabangunan = "0.00"; } else { $sisabangunan = number_format($sisabangunan,2); }
|
|
if ($nilaiNeraca13==NULL) { $nilaiNeraca13 = "0.00"; } else { $nilaiNeraca13 = number_format($nilaiNeraca13[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca14==NULL) { $nilaiNeraca14 = "0.00"; } else { $nilaiNeraca14 = number_format($nilaiNeraca14[0]['TOTALNERACA'],2); }
|
|
if ($sisakendaraan==NULL) { $sisakendaraan = "0.00"; } else { $sisakendaraan = number_format($sisakendaraan,2); }
|
|
if ($nilaiNeraca15==NULL) { $nilaiNeraca15 = "0.00"; } else { $nilaiNeraca15 = number_format($nilaiNeraca15[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca16==NULL) { $nilaiNeraca16 = "0.00"; } else { $nilaiNeraca16 = number_format($nilaiNeraca16,2); }
|
|
if ($nilaiNeraca17==NULL) { $nilaiNeraca17 = "0.00"; } else { $nilaiNeraca17 = number_format($nilaiNeraca17[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca18==NULL) { $nilaiNeraca18 = "0.00"; } else { $nilaiNeraca18 = number_format($nilaiNeraca18[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca19==NULL) { $nilaiNeraca19 = "0.00"; } else { $nilaiNeraca19 = number_format($nilaiNeraca19[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca20==NULL) { $nilaiNeraca20 = "0.00"; } else { $nilaiNeraca20 = number_format($nilaiNeraca20[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca21==NULL) { $nilaiNeraca21 = "0.00"; } else { $nilaiNeraca21 = number_format($nilaiNeraca21[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca22==NULL) { $nilaiNeraca22 = "0.00"; } else { $nilaiNeraca22 = number_format($nilaiNeraca22,2); }
|
|
|
|
//Set Data Null menjadi 0.00 Laba Rugi Berjalan
|
|
if ($nilaiNeraca23==NULL) { $nilaiNeraca23 = "0.00"; } else { $nilaiNeraca23 = number_format($nilaiNeraca23[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca24==NULL) { $nilaiNeraca24 = "0.00"; } else { $nilaiNeraca24 = number_format($nilaiNeraca24[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca25==NULL) { $nilaiNeraca25 = "0.00"; } else { $nilaiNeraca25 = number_format($nilaiNeraca25[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca26==NULL) { $nilaiNeraca26 = "0.00"; } else { $nilaiNeraca26 = number_format($nilaiNeraca26[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca27==NULL) { $nilaiNeraca27 = "0.00"; } else { $nilaiNeraca27 = number_format($nilaiNeraca27[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca28==NULL) { $nilaiNeraca28 = "0.00"; } else { $nilaiNeraca28 = number_format($nilaiNeraca28[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca29==NULL) { $nilaiNeraca29 = "0.00"; } else { $nilaiNeraca29 = number_format($nilaiNeraca29[0]['TOTALNERACA'],2); }
|
|
|
|
$nilaiNeraca30 = $nilaiNeraca4;
|
|
|
|
if ($nilaiNeraca31==NULL) { $nilaiNeraca31 = "0.00"; } else { $nilaiNeraca31 = number_format($nilaiNeraca31[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca32==NULL) { $nilaiNeraca32 = "0.00"; } else { $nilaiNeraca32 = number_format($nilaiNeraca32[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca33==NULL) { $nilaiNeraca33 = "0.00"; } else { $nilaiNeraca33 = number_format($nilaiNeraca33[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca34==NULL) { $nilaiNeraca34 = "0.00"; } else { $nilaiNeraca34 = number_format($nilaiNeraca34[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca35==NULL) { $nilaiNeraca35 = "0.00"; } else { $nilaiNeraca35 = number_format($nilaiNeraca35[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca36==NULL) { $nilaiNeraca36 = "0.00"; } else { $nilaiNeraca36 = number_format($nilaiNeraca36[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca37==NULL) { $nilaiNeraca37 = "0.00"; } else { $nilaiNeraca37 = number_format($nilaiNeraca37[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca38==NULL) { $nilaiNeraca38 = "0.00"; } else { $nilaiNeraca38 = number_format($nilaiNeraca38[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca39==NULL) { $nilaiNeraca39 = "0.00"; } else { $nilaiNeraca39 = number_format($nilaiNeraca39,2); }
|
|
if ($nilaiNeraca40==NULL) { $nilaiNeraca40 = "0.00"; } else { $nilaiNeraca40 = number_format($nilaiNeraca40[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca41==NULL) { $nilaiNeraca41 = "0.00"; } else { $nilaiNeraca41 = number_format($nilaiNeraca41[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca42==NULL) { $nilaiNeraca42 = "0.00"; } else { $nilaiNeraca42 = number_format($nilaiNeraca42[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca43==NULL) { $nilaiNeraca43 = "0.00"; } else { $nilaiNeraca43 = number_format($nilaiNeraca43[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca44==NULL) { $nilaiNeraca44 = "0.00"; } else { $nilaiNeraca44 = number_format($nilaiNeraca44[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca45==NULL) { $nilaiNeraca45 = "0.00"; } else { $nilaiNeraca45 = number_format($nilaiNeraca45[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca46==NULL) { $nilaiNeraca46 = "0.00"; } else { $nilaiNeraca46 = number_format($nilaiNeraca46[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca47==NULL) { $nilaiNeraca47 = "0.00"; } else { $nilaiNeraca47 = number_format($nilaiNeraca47[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca48==NULL) { $nilaiNeraca48 = "0.00"; } else { $nilaiNeraca48 = number_format($nilaiNeraca48[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca49==NULL) { $nilaiNeraca49 = "0.00"; } else { $nilaiNeraca49 = number_format($nilaiNeraca49[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca50==NULL) { $nilaiNeraca50 = "0.00"; } else { $nilaiNeraca50 = number_format($nilaiNeraca50[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca51==NULL) { $nilaiNeraca51 = "0.00"; } else { $nilaiNeraca51 = number_format($nilaiNeraca51[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca52==NULL) { $nilaiNeraca52 = "0.00"; } else { $nilaiNeraca52 = number_format($nilaiNeraca52[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca53==NULL) { $nilaiNeraca53 = "0.00"; } else { $nilaiNeraca53 = number_format($nilaiNeraca53[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca54==NULL) { $nilaiNeraca54 = "0.00"; } else { $nilaiNeraca54 = number_format($nilaiNeraca54[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca55==NULL) { $nilaiNeraca55 = "0.00"; } else { $nilaiNeraca55 = number_format($nilaiNeraca55[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca56==NULL) { $nilaiNeraca56 = "0.00"; } else { $nilaiNeraca56 = number_format($nilaiNeraca56[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca57==NULL) { $nilaiNeraca57 = "0.00"; } else { $nilaiNeraca57 = number_format($nilaiNeraca57[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca58==NULL) { $nilaiNeraca58 = "0.00"; } else { $nilaiNeraca58 = number_format($nilaiNeraca58[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca59==NULL) { $nilaiNeraca59 = "0.00"; } else { $nilaiNeraca59 = number_format($nilaiNeraca59[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca60==NULL) { $nilaiNeraca60 = "0.00"; } else { $nilaiNeraca60 = number_format($nilaiNeraca60[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca61==NULL) { $nilaiNeraca61 = "0.00"; } else { $nilaiNeraca61 = number_format($nilaiNeraca61[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca62==NULL) { $nilaiNeraca62 = "0.00"; } else { $nilaiNeraca62 = number_format($nilaiNeraca62[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca63==NULL) { $nilaiNeraca63 = "0.00"; } else { $nilaiNeraca63 = number_format($nilaiNeraca63[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca64==NULL) { $nilaiNeraca64 = "0.00"; } else { $nilaiNeraca64 = number_format($nilaiNeraca64,2); }
|
|
if ($nilaiNeraca65==NULL) { $nilaiNeraca65 = "0.00"; } else { $nilaiNeraca65 = number_format($nilaiNeraca65[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca66==NULL) { $nilaiNeraca66 = "0.00"; } else { $nilaiNeraca66 = number_format($nilaiNeraca66[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca67==NULL) { $nilaiNeraca67 = "0.00"; } else { $nilaiNeraca67 = number_format($nilaiNeraca67,2); }
|
|
if ($nilaiNeraca68==NULL) { $nilaiNeraca68 = "0.00"; } else { $nilaiNeraca68 = number_format($nilaiNeraca68[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca69==NULL) { $nilaiNeraca69 = "0.00"; } else { $nilaiNeraca69 = number_format($nilaiNeraca69[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca70==NULL) { $nilaiNeraca70 = "0.00"; } else { $nilaiNeraca70 = number_format($nilaiNeraca70[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca71==NULL) { $nilaiNeraca71 = "0.00"; } else { $nilaiNeraca71 = number_format($nilaiNeraca71[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca72==NULL) { $nilaiNeraca72 = "0.00"; } else { $nilaiNeraca72 = number_format($nilaiNeraca72[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca73==NULL) { $nilaiNeraca73 = "0.00"; } else { $nilaiNeraca73 = number_format($nilaiNeraca73[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca74==NULL) { $nilaiNeraca74 = "0.00"; } else { $nilaiNeraca74 = number_format($nilaiNeraca74[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca75==NULL) { $nilaiNeraca75 = "0.00"; } else { $nilaiNeraca75 = number_format($nilaiNeraca75[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca76==NULL) { $nilaiNeraca76 = "0.00"; } else { $nilaiNeraca76 = number_format($nilaiNeraca76[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca77==NULL) { $nilaiNeraca77 = "0.00"; } else { $nilaiNeraca77 = number_format($nilaiNeraca77[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca78==NULL) { $nilaiNeraca78 = "0.00"; } else { $nilaiNeraca78 = number_format($nilaiNeraca78[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca79==NULL) { $nilaiNeraca79 = "0.00"; } else { $nilaiNeraca79 = number_format($nilaiNeraca79[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca80==NULL) { $nilaiNeraca80 = "0.00"; } else { $nilaiNeraca80 = number_format($nilaiNeraca80[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca81==NULL) { $nilaiNeraca81 = "0.00"; } else { $nilaiNeraca81 = number_format($nilaiNeraca81[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca82==NULL) { $nilaiNeraca82 = "0.00"; } else { $nilaiNeraca82 = number_format($nilaiNeraca82,2); }
|
|
if ($nilaiNeraca83==NULL) { $nilaiNeraca83 = "0.00"; } else { $nilaiNeraca83 = number_format($nilaiNeraca83,2); }
|
|
if ($nilaiNeraca84==NULL) { $nilaiNeraca84 = "0.00"; } else { $nilaiNeraca84 = number_format($nilaiNeraca84[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca85==NULL) { $nilaiNeraca85 = "0.00"; } else { $nilaiNeraca85 = number_format($nilaiNeraca85[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca86==NULL) { $nilaiNeraca86 = "0.00"; } else { $nilaiNeraca86 = number_format($nilaiNeraca86[0]['TOTALNERACA'],2); }
|
|
if ($nilaiNeraca87==NULL) { $nilaiNeraca87 = "0.00"; } else { $nilaiNeraca87 = number_format($nilaiNeraca87[0]['TOTALNERACA'],2); }
|
|
|
|
$aktivaLancar = number_format($aktivaLancar,2);
|
|
$kewajibanLancar = number_format($kewajibanLancar,2);
|
|
$aktivaTetap = number_format($aktivaTetap,2);
|
|
$modal = number_format($modal,2);
|
|
$totalPenjualan = number_format($totalPenjualan,2);
|
|
$totalPembelian = number_format($totalPembelian,2);
|
|
$hargaPokokPenjualan = number_format($hargaPokokPenjualan,2);
|
|
$labaKotor = number_format($labaKotor,2);
|
|
$totalBiayaPenjualan = number_format($totalBiayaPenjualan,2);
|
|
$totalBiayaUmumAdministrasi = number_format($totalBiayaUmumAdministrasi,2);
|
|
$totalBiayaBiaya = number_format($totalBiayaBiaya,2);
|
|
$labaUsaha = number_format($labaUsaha,2);
|
|
$subPendapatan = number_format($subPendapatan,2);
|
|
$subBeban = number_format($subBeban,2);
|
|
$totalPendapatan = number_format($totalPendapatan,2);
|
|
$labaBersihSebelumPajak = number_format($labaBersihSebelumPajak,2);
|
|
$labaBersihSetelahPajak = number_format($labaBersihSetelahPajak,2);
|
|
$totalAktiva = number_format($totalAktiva,2);
|
|
$totalPassiva = number_format($totalPassiva,2);
|
|
|
|
$data = array(
|
|
//Value untuk Neraca Berjalan
|
|
'val1' => $nilaiNeraca1, 'val2' => $nilaiNeraca2, 'val3' => $nilaiNeraca3, 'val4' => $nilaiNeraca4, 'val5' => $nilaiNeraca5,
|
|
'val6' => $nilaiNeraca6, 'val7' => $nilaiNeraca7, 'val8' => $nilaiNeraca8, 'val10' => $sisainventaris, 'val12' => $sisabangunan,
|
|
'val14' => $sisakendaraan, 'val15' => $nilaiNeraca15, 'val16' => $nilaiNeraca16, 'val17' => $nilaiNeraca17, 'val18' => $nilaiNeraca18,
|
|
'val19' => $nilaiNeraca19, 'val20' => $nilaiNeraca20, 'val21' => $nilaiNeraca21, 'val22' => $nilaiNeraca22,
|
|
|
|
//Value untuk Laba Rugi Berjalan
|
|
'val23' => $nilaiNeraca23, 'val31' => $nilaiNeraca31, 'val41' => $nilaiNeraca41, 'val51' => $nilaiNeraca51, 'val61' => $nilaiNeraca61, 'val71' => $nilaiNeraca71, 'val81' => $nilaiNeraca81,
|
|
'val24' => $nilaiNeraca24, 'val32' => $nilaiNeraca32, 'val42' => $nilaiNeraca42, 'val52' => $nilaiNeraca52, 'val62' => $nilaiNeraca62, 'val72' => $nilaiNeraca72, 'val82' => $nilaiNeraca82,
|
|
'val25' => $nilaiNeraca25, 'val33' => $nilaiNeraca33, 'val43' => $nilaiNeraca43, 'val53' => $nilaiNeraca53, 'val63' => $nilaiNeraca63, 'val73' => $nilaiNeraca73, 'val83' => $nilaiNeraca83,
|
|
'val26' => $nilaiNeraca26, 'val34' => $nilaiNeraca34, 'val44' => $nilaiNeraca44, 'val54' => $nilaiNeraca54, 'val64' => $nilaiNeraca64, 'val74' => $nilaiNeraca74, 'val84' => $nilaiNeraca84,
|
|
'val27' => $nilaiNeraca27, 'val35' => $nilaiNeraca35, 'val45' => $nilaiNeraca45, 'val55' => $nilaiNeraca55, 'val65' => $nilaiNeraca65, 'val75' => $nilaiNeraca75, 'val85' => $nilaiNeraca85,
|
|
'val28' => $nilaiNeraca28, 'val36' => $nilaiNeraca36, 'val46' => $nilaiNeraca46, 'val56' => $nilaiNeraca56, 'val66' => $nilaiNeraca66, 'val76' => $nilaiNeraca76, 'val86' => $nilaiNeraca86,
|
|
'val29' => $nilaiNeraca29, 'val37' => $nilaiNeraca37, 'val47' => $nilaiNeraca47, 'val57' => $nilaiNeraca57, 'val67' => $nilaiNeraca67, 'val77' => $nilaiNeraca77, 'val87' => $nilaiNeraca87,
|
|
'val30' => $nilaiNeraca30, 'val38' => $nilaiNeraca38, 'val48' => $nilaiNeraca48, 'val58' => $nilaiNeraca58, 'val68' => $nilaiNeraca68, 'val78' => $nilaiNeraca78,
|
|
'val39' => $nilaiNeraca39, 'val49' => $nilaiNeraca49, 'val59' => $nilaiNeraca59, 'val69' => $nilaiNeraca69, 'val79' => $nilaiNeraca79,
|
|
'val40' => $nilaiNeraca40, 'val50' => $nilaiNeraca50, 'val60' => $nilaiNeraca60, 'val70' => $nilaiNeraca70, 'val80' => $nilaiNeraca80,
|
|
|
|
'nil1' => $nil1, 'nil11' => $nil11, 'nil21' => $nil21, 'nil31' => $nil31, 'nil41' => $nil41, 'nil51' => $nil51, 'nil61' => $nil61, 'nil71' => $nil71, 'nil81' => $nil81,
|
|
'nil2' => $nil2, 'nil12' => $nil12, 'nil22' => $nil22, 'nil32' => $nil32, 'nil42' => $nil42, 'nil52' => $nil52, 'nil62' => $nil62, 'nil72' => $nil72, 'nil82' => $nil82,
|
|
'nil3' => $nil3, 'nil13' => $nil13, 'nil23' => $nil23, 'nil33' => $nil33, 'nil43' => $nil43, 'nil53' => $nil53, 'nil63' => $nil63, 'nil73' => $nil73, 'nil83' => $nil83,
|
|
'nil4' => $nil4, 'nil14' => $nil14, 'nil24' => $nil24, 'nil34' => $nil34, 'nil44' => $nil44, 'nil54' => $nil54, 'nil64' => $nil64, 'nil74' => $nil74, 'nil84' => $nil84,
|
|
'nil5' => $nil5, 'nil15' => $nil15, 'nil25' => $nil25, 'nil35' => $nil35, 'nil45' => $nil45, 'nil55' => $nil55, 'nil65' => $nil65, 'nil75' => $nil75, 'nil85' => $nil85,
|
|
'nil6' => $nil6, 'nil16' => $nil16, 'nil26' => $nil26, 'nil36' => $nil36, 'nil46' => $nil46, 'nil56' => $nil56, 'nil66' => $nil66, 'nil76' => $nil76, 'nil86' => $nil86,
|
|
'nil7' => $nil7, 'nil17' => $nil17, 'nil27' => $nil27, 'nil37' => $nil37, 'nil47' => $nil47, 'nil57' => $nil57, 'nil67' => $nil67, 'nil77' => $nil77, 'nil87' => $nil87,
|
|
'nil8' => $nil8, 'nil18' => $nil18, 'nil28' => $nil28, 'nil38' => $nil38, 'nil48' => $nil48, 'nil58' => $nil58, 'nil68' => $nil68, 'nil78' => $nil78,
|
|
'nil9' => $nil9, 'nil19' => $nil19, 'nil29' => $nil29, 'nil39' => $nil39, 'nil49' => $nil49, 'nil59' => $nil59, 'nil69' => $nil69, 'nil79' => $nil79,
|
|
'nil10' => $nil10, 'nil20' => $nil20, 'nil30' => $nil30, 'nil40' => $nil40, 'nil50' => $nil50, 'nil60' => $nil60, 'nil70' => $nil70, 'nil80' => $nil80,
|
|
|
|
'aktivaLancar' => $aktivaLancar, 'kewajibanLancar' => $kewajibanLancar, 'aktivaTetap' => $aktivaTetap, 'modal' => $modal, 'totalPenjualan' => $totalPenjualan,
|
|
'totalPembelian' => $totalPembelian, 'hargaPokokPenjualan' => $hargaPokokPenjualan, 'labaKotor' => $labaKotor, 'totalBiayaPenjualan' => $totalBiayaPenjualan,
|
|
'totalBiayaUmumAdministrasi' => $totalBiayaUmumAdministrasi, 'totalBiayaBiaya' => $totalBiayaBiaya, 'labaUsaha' => $labaUsaha, 'subPendapatan' => $subPendapatan,
|
|
'subBeban' => $subBeban, 'totalPendapatan' => $totalPendapatan, 'labaBersihSebelumPajak' => $labaBersihSebelumPajak, 'labaBersihSetelahPajak' => $labaBersihSetelahPajak,
|
|
|
|
'totalAktiva' => $totalAktiva, 'totalPassiva' => $totalPassiva,
|
|
);
|
|
$this->output_json($data);
|
|
}
|
|
|
|
public function dataNeracaBerjalan_Admin_A1() { // Informasi = [62]
|
|
$id_setdata = $this->Informasi->getID_SetdataMax();
|
|
$id_setdata = $id_setdata[0]['ID_SETDATA'];
|
|
|
|
$datSetdata = $this->Informasi->getData_Setdata_byID($id_setdata);
|
|
$month = date_format(date_create($datSetdata[0]['TGL_SETDATA']), "m");
|
|
$year = date_format(date_create($datSetdata[0]['TGL_SETDATA']), "Y");
|
|
|
|
if ($month=="01") { $namaBulan = "Januari"; } else if ($month=="02") { $namaBulan = "Februari"; } else if ($month=="03") { $namaBulan = "Maret";
|
|
} else if ($month=="04") { $namaBulan = "April"; } else if ($month=="05") { $namaBulan = "Mei"; } else if ($month=="06") { $namaBulan = "Juni";
|
|
} else if ($month=="07") { $namaBulan = "Juli"; } else if ($month=="08") { $namaBulan = "Agustus"; } else if ($month=="09") { $namaBulan = "September";
|
|
} else if ($month=="10") { $namaBulan = "Oktober"; } else if ($month=="11") { $namaBulan = "November"; } else if ($month=="12") { $namaBulan = "Desember"; }
|
|
|
|
$tanggal_sekarang = "$namaBulan $year";
|
|
|
|
$nextMonth = $this->Informasi->addTempoMonth($datSetdata[0]['TGL_SETDATA'],1);
|
|
$month = date_format(date_create($nextMonth), "m");
|
|
$year = date_format(date_create($nextMonth), "Y");
|
|
|
|
if ($month=="01") { $namaBulan = "Januari"; } else if ($month=="02") { $namaBulan = "Februari"; } else if ($month=="03") { $namaBulan = "Maret";
|
|
} else if ($month=="04") { $namaBulan = "April"; } else if ($month=="05") { $namaBulan = "Mei"; } else if ($month=="06") { $namaBulan = "Juni";
|
|
} else if ($month=="07") { $namaBulan = "Juli"; } else if ($month=="08") { $namaBulan = "Agustus"; } else if ($month=="09") { $namaBulan = "September";
|
|
} else if ($month=="10") { $namaBulan = "Oktober"; } else if ($month=="11") { $namaBulan = "November"; } else if ($month=="12") { $namaBulan = "Desember"; }
|
|
|
|
$tanggal_next = "$namaBulan $year";
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'tanggal_sekarang' => $tanggal_sekarang,
|
|
'tanggal_next' => $tanggal_next
|
|
];
|
|
$this->load->view('proses/InformasiNeracaBerjalan_Admin_A1', $data);
|
|
}
|
|
|
|
public function kodeSetdata() { // Informasi = [63]
|
|
$id_setdata = $this->Informasi->getID_SetdataMax();
|
|
$datSetdata = $this->Informasi->getData_Setdata_byID($id_setdata[0]['ID_SETDATA']);
|
|
$tgl_before = $datSetdata[0]['TGL_SETDATA'];
|
|
$tgl_after = $this->Informasi->addTempoMonth($tgl_before, 1);
|
|
$tgl = date_format(date_create($tgl_after), "y");
|
|
|
|
$kk = $this->Informasi->getKode_Setdata();
|
|
if (is_array($kk) || is_object($kk)) {
|
|
foreach ($kk as $row) {
|
|
if ($row['KODE'] == null) {
|
|
return "SD".$tgl."-0001";
|
|
} else {
|
|
$str = (string) $row['KODE'];
|
|
$tgl_lama = substr($str, 2, -5);
|
|
if ($tgl_lama!=$tgl) {
|
|
return "SD".$tgl."-0001";
|
|
} else {
|
|
$panjang = 4;
|
|
$data = substr($str, 5, $panjang);
|
|
$ko = (int) $data + 1;
|
|
$str = (string) $ko;
|
|
$panjang = 9 - strlen($str);
|
|
$data = "SD".$tgl."-0000";
|
|
$data = substr($data, 0, $panjang) . $str;
|
|
return $data;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public function kuncitotalneraca_AA1() { // Informasi = [64]
|
|
$method = $this->input->post('method');
|
|
$nilaiNeraca1 = $this->input->post('nilaiNeraca1');
|
|
$nilaiNeraca2 = $this->input->post('nilaiNeraca2');
|
|
$nilaiNeraca3 = $this->input->post('nilaiNeraca3');
|
|
$nilaiNeraca4 = $this->input->post('nilaiNeraca4');
|
|
$nilaiNeraca5 = $this->input->post('nilaiNeraca5');
|
|
$nilaiNeraca6 = $this->input->post('nilaiNeraca6');
|
|
$nilaiNeraca7 = $this->input->post('nilaiNeraca7');
|
|
$nilaiNeraca8 = $this->input->post('nilaiNeraca8');
|
|
$nilaiNeraca9 = $this->input->post('nilaiNeraca9');
|
|
$nilaiNeraca10 = $this->input->post('nilaiNeraca10');
|
|
$nilaiNeraca11 = $this->input->post('nilaiNeraca11');
|
|
$nilaiNeraca12 = $this->input->post('nilaiNeraca12');
|
|
$nilaiNeraca13 = $this->input->post('nilaiNeraca13');
|
|
$nilaiNeraca14 = $this->input->post('nilaiNeraca14');
|
|
$nilaiNeraca15 = $this->input->post('nilaiNeraca15');
|
|
$nilaiNeraca16 = $this->input->post('nilaiNeraca16');
|
|
$nilaiNeraca17 = $this->input->post('nilaiNeraca17');
|
|
$nilaiNeraca18 = $this->input->post('nilaiNeraca18');
|
|
$nilaiNeraca19 = $this->input->post('nilaiNeraca19');
|
|
$nilaiNeraca20 = $this->input->post('nilaiNeraca20');
|
|
$nilaiNeraca21 = $this->input->post('nilaiNeraca21');
|
|
$nilaiNeraca22 = $this->input->post('nilaiNeraca22');
|
|
$nilaiNeraca23 = $this->input->post('nilaiNeraca23');
|
|
$nilaiNeraca24 = $this->input->post('nilaiNeraca24');
|
|
$nilaiNeraca25 = $this->input->post('nilaiNeraca25');
|
|
$nilaiNeraca26 = $this->input->post('nilaiNeraca26');
|
|
$nilaiNeraca27 = $this->input->post('nilaiNeraca27');
|
|
$nilaiNeraca28 = $this->input->post('nilaiNeraca28');
|
|
$nilaiNeraca29 = $this->input->post('nilaiNeraca29');
|
|
$nilaiNeraca30 = $this->input->post('nilaiNeraca30');
|
|
$nilaiNeraca31 = $this->input->post('nilaiNeraca31');
|
|
$nilaiNeraca32 = $this->input->post('nilaiNeraca32');
|
|
$nilaiNeraca33 = $this->input->post('nilaiNeraca33');
|
|
$nilaiNeraca34 = $this->input->post('nilaiNeraca34');
|
|
$nilaiNeraca35 = $this->input->post('nilaiNeraca35');
|
|
$nilaiNeraca36 = $this->input->post('nilaiNeraca36');
|
|
$nilaiNeraca37 = $this->input->post('nilaiNeraca37');
|
|
$nilaiNeraca38 = $this->input->post('nilaiNeraca38');
|
|
$nilaiNeraca39 = $this->input->post('nilaiNeraca39');
|
|
$nilaiNeraca40 = $this->input->post('nilaiNeraca40');
|
|
$nilaiNeraca41 = $this->input->post('nilaiNeraca41');
|
|
$nilaiNeraca42 = $this->input->post('nilaiNeraca42');
|
|
$nilaiNeraca43 = $this->input->post('nilaiNeraca43');
|
|
$nilaiNeraca44 = $this->input->post('nilaiNeraca44');
|
|
$nilaiNeraca45 = $this->input->post('nilaiNeraca45');
|
|
$nilaiNeraca46 = $this->input->post('nilaiNeraca46');
|
|
$nilaiNeraca47 = $this->input->post('nilaiNeraca47');
|
|
$nilaiNeraca48 = $this->input->post('nilaiNeraca48');
|
|
$nilaiNeraca49 = $this->input->post('nilaiNeraca49');
|
|
$nilaiNeraca50 = $this->input->post('nilaiNeraca50');
|
|
$nilaiNeraca51 = $this->input->post('nilaiNeraca51');
|
|
$nilaiNeraca52 = $this->input->post('nilaiNeraca52');
|
|
$nilaiNeraca53 = $this->input->post('nilaiNeraca53');
|
|
$nilaiNeraca54 = $this->input->post('nilaiNeraca54');
|
|
$nilaiNeraca55 = $this->input->post('nilaiNeraca55');
|
|
$nilaiNeraca56 = $this->input->post('nilaiNeraca56');
|
|
$nilaiNeraca57 = $this->input->post('nilaiNeraca57');
|
|
$nilaiNeraca58 = $this->input->post('nilaiNeraca58');
|
|
$nilaiNeraca59 = $this->input->post('nilaiNeraca59');
|
|
$nilaiNeraca60 = $this->input->post('nilaiNeraca60');
|
|
$nilaiNeraca61 = $this->input->post('nilaiNeraca61');
|
|
$nilaiNeraca62 = $this->input->post('nilaiNeraca62');
|
|
$nilaiNeraca63 = $this->input->post('nilaiNeraca63');
|
|
$nilaiNeraca64 = $this->input->post('nilaiNeraca64');
|
|
$nilaiNeraca65 = $this->input->post('nilaiNeraca65');
|
|
$nilaiNeraca66 = $this->input->post('nilaiNeraca66');
|
|
$nilaiNeraca67 = $this->input->post('nilaiNeraca67');
|
|
$nilaiNeraca68 = $this->input->post('nilaiNeraca68');
|
|
$nilaiNeraca69 = $this->input->post('nilaiNeraca69');
|
|
$nilaiNeraca70 = $this->input->post('nilaiNeraca70');
|
|
$nilaiNeraca71 = $this->input->post('nilaiNeraca71');
|
|
$nilaiNeraca72 = $this->input->post('nilaiNeraca72');
|
|
$nilaiNeraca73 = $this->input->post('nilaiNeraca73');
|
|
$nilaiNeraca74 = $this->input->post('nilaiNeraca74');
|
|
$nilaiNeraca75 = $this->input->post('nilaiNeraca75');
|
|
$nilaiNeraca76 = $this->input->post('nilaiNeraca76');
|
|
$nilaiNeraca77 = $this->input->post('nilaiNeraca77');
|
|
$nilaiNeraca78 = $this->input->post('nilaiNeraca78');
|
|
$nilaiNeraca79 = $this->input->post('nilaiNeraca79');
|
|
$nilaiNeraca80 = $this->input->post('nilaiNeraca80');
|
|
$nilaiNeraca81 = $this->input->post('nilaiNeraca81');
|
|
$nilaiNeraca82 = $this->input->post('nilaiNeraca82');
|
|
$nilaiNeraca83 = $this->input->post('nilaiNeraca83');
|
|
$nilaiNeraca84 = $this->input->post('nilaiNeraca84');
|
|
$nilaiNeraca85 = $this->input->post('nilaiNeraca85');
|
|
$nilaiNeraca86 = $this->input->post('nilaiNeraca86');
|
|
$nilaiNeraca87 = $this->input->post('nilaiNeraca87');
|
|
|
|
$id_setdata = $this->Informasi->getID_SetdataMax();
|
|
$id_setdata = $id_setdata[0]['ID_SETDATA'];
|
|
|
|
$datSetdata = $this->Informasi->getData_Setdata_byID($id_setdata);
|
|
|
|
$tgl_now = date('Y-m-d');
|
|
$tgl_limit = $this->Informasi->addTempoMonth($datSetdata[0]['TGL_SETDATA'],1);
|
|
$tgl_limit = $this->Informasi->subTempoDay($tgl_limit,1);
|
|
|
|
if (strtotime($tgl_now)<strtotime($tgl_limit)) {
|
|
$this->session->set_flashdata('lock_date', 'error');
|
|
redirect('Authority');
|
|
}
|
|
|
|
//Aktiva Lancar
|
|
$pembelian = $this->Informasi->getCount_Pembelian_Not1($datSetdata[0]['TGL_SETDATA']);
|
|
$kasbank = $this->Informasi->getCount_Kasbank_Null($datSetdata[0]['TGL_SETDATA']);
|
|
|
|
if ($pembelian>0) {
|
|
$this->session->set_flashdata('lock_pembelian', 'error');
|
|
redirect('Authority');
|
|
}
|
|
|
|
if ($kasbank>0) {
|
|
$this->session->set_flashdata('lock_kasbank', 'error');
|
|
redirect('Authority');
|
|
}
|
|
|
|
for ($no=1; $no<=87 ; $no++) {
|
|
$datNeraca = $this->Informasi->getData_Neraca_bySETDATA_byPERKIRAAN($id_setdata, $no);
|
|
$input[$no] = [
|
|
'ID_NERACA' => $datNeraca[0]['ID_NERACA']
|
|
];
|
|
}
|
|
|
|
$no = 1;
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca1
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca2
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca3
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca4
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca5
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca6
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca7
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca8
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca9
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca10
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca11
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca12
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca13
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca14
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca15
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca16
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca17
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca18
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca19
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca20
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca21
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca22
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca23
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca24
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca25
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca26
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca27
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca28
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca29
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca30
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca31
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca32
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca33
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca34
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca35
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca36
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca37
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca38
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca39
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca40
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca41
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca42
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca43
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca44
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca45
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca46
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca47
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca48
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca49
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca50
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca51
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca52
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca53
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca54
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca55
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca56
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca57
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca58
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca59
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca60
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca61
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca62
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca63
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca64
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca65
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca66
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca67
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca68
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca69
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca70
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca71
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca72
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca73
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca74
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca75
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca76
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca77
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca78
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca79
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca80
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca81
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca82
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca83
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca84
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca85
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca86
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $nilaiNeraca87
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $input[$no++]['ID_NERACA']);
|
|
|
|
$datSetdata = $this->Informasi->getData_Setdata_byID($id_setdata);
|
|
$day = date_format(date_create($datSetdata[0]['TGL_SETDATA']), "d");
|
|
|
|
if ($day!="01") {
|
|
$tgl_new = date_format(date_create($datSetdata[0]['TGL_SETDATA']), "Y-m-01");
|
|
$tgl_new = $this->Informasi->addTempoMonth($tgl_new,1);
|
|
} else {
|
|
$tgl_new = $this->Informasi->addTempoMonth($datSetdata[0]['TGL_SETDATA'],1);
|
|
}
|
|
|
|
$tgl_lock = $this->Informasi->subTempoDay($tgl_new,1);
|
|
|
|
$update = [
|
|
'STATUS_SETDATA' => '0',
|
|
'TGL_KUNCI' => $tgl_lock
|
|
];
|
|
$action = $this->Informasi->update('setdata', $update, 'ID_SETDATA', $id_setdata);
|
|
|
|
$kode_setdata = $this->kodeSetdata();
|
|
$input = [
|
|
'KODE_SETDATA' => $kode_setdata,
|
|
'TGL_SETDATA' => $tgl_new
|
|
];
|
|
$action = $this->Informasi->create('setdata', $input);
|
|
|
|
$id_setdata = $this->Informasi->getID_SetdataMax();
|
|
$id_setdata = $id_setdata[0]['ID_SETDATA'];
|
|
|
|
for ($loop = 1; $loop<=87; $loop++) {
|
|
$input = [
|
|
'SETDATA_ID' => $id_setdata,
|
|
'PERKIRAAN_ID' => $loop,
|
|
'NILAI_NERACA' => '0'
|
|
];
|
|
$action = $this->Informasi->create('neraca', $input);
|
|
}
|
|
|
|
//Setdata Baru u/ Neraca selanjutnya
|
|
$id_neraca21 = $this->Informasi->getData_Neraca_AkumulasiLaba_forSetdata($id_setdata);
|
|
$id_neraca21 = $id_neraca21[0]['ID_NERACA'];
|
|
|
|
$id_neraca26 = $this->Informasi->getData_Neraca_PersediaanAwal_forSetdata($id_setdata);
|
|
$id_neraca26 = $id_neraca26[0]['ID_NERACA'];
|
|
|
|
$akumulasiLaba = $nilaiNeraca21+$nilaiNeraca22;
|
|
$persediaanAwal = $nilaiNeraca4;
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $akumulasiLaba
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $id_neraca21);
|
|
|
|
$update = [
|
|
'NILAI_NERACA' => $persediaanAwal
|
|
];
|
|
$action = $this->Informasi->update('neraca', $update, 'ID_NERACA', $id_neraca26);
|
|
|
|
$tgl_jm = date_format(date_create($tgl_lock), "y/m");
|
|
$kode_jm = "BSD/$tgl_jm/00001";
|
|
|
|
$input = [
|
|
'TGL_JM' => $tgl_lock,
|
|
'KODE_JM' => $kode_jm,
|
|
'JENIS_JM' => '0'
|
|
];
|
|
$action = $this->Informasi->create('jurnal_memo', $input);
|
|
|
|
$id_jm = $this->Informasi->getID_JurnalMemoMax();
|
|
$id_jm = $id_jm[0]['ID_JM'];
|
|
|
|
$id_setdatabefore = $id_setdata-1;
|
|
$kode_setdatabefore = $datSetdata[0]['KODE_SETDATA'];
|
|
$tgl_awal = date_format(date_create($tgl_lock), "Y-m-01");
|
|
|
|
//Jurnal Otomatis, Persediaan
|
|
if ($nilaiNeraca26==$nilaiNeraca30) {
|
|
$debet_djm = 0;
|
|
$kredit_djm = 0;
|
|
} else if ($nilaiNeraca26<$nilaiNeraca30) {
|
|
$debet_djm = $nilaiNeraca30-$nilaiNeraca26;
|
|
$kredit_djm = 0;
|
|
} else if ($nilaiNeraca26>$nilaiNeraca30) {
|
|
$debet_djm = 0;
|
|
$kredit_djm = $nilaiNeraca26-$nilaiNeraca30;
|
|
}
|
|
|
|
$input = [
|
|
'SETDATA_ID' => $id_setdatabefore,
|
|
'TGL_DJM' => $tgl_lock,
|
|
'JM_ID' => $id_jm,
|
|
'PERKIRAAN_ID' => '4',
|
|
'DEBET_DJM' => $debet_djm,
|
|
'KREDIT_DJM' => $kredit_djm,
|
|
'KET_DJM' => "Jurnal Otomatis u/ Perkiraan [1140 | Persediaan | $kode_setdatabefore]",
|
|
];
|
|
$action = $this->Informasi->create('daftar_jurnalmemo', $input);
|
|
|
|
//Jurnal Otomatis, Akumulasi Laba Ditahan
|
|
if ($nilaiNeraca21==$akumulasiLaba) {
|
|
$debet_djm = 0;
|
|
$kredit_djm = 0;
|
|
} else if ($nilaiNeraca21<$akumulasiLaba) {
|
|
$debet_djm = 0;
|
|
$kredit_djm = $akumulasiLaba-$nilaiNeraca21;
|
|
} else if ($nilaiNeraca21>$akumulasiLaba) {
|
|
$debet_djm = $nilaiNeraca21-$akumulasiLaba;
|
|
$kredit_djm = 0;
|
|
}
|
|
|
|
$input = [
|
|
'SETDATA_ID' => $id_setdatabefore,
|
|
'TGL_DJM' => $tgl_lock,
|
|
'JM_ID' => $id_jm,
|
|
'PERKIRAAN_ID' => '21',
|
|
'DEBET_DJM' => $debet_djm,
|
|
'KREDIT_DJM' => $kredit_djm,
|
|
'KET_DJM' => "Jurnal Otomatis u/ Perkiraan [3200 | Akumulasi Laba Ditahan | $kode_setdatabefore]",
|
|
];
|
|
$action = $this->Informasi->create('daftar_jurnalmemo', $input);
|
|
|
|
//Jurnal Otomatis, Pajak Masukan
|
|
$datPembelian = $this->Informasi->getData_PajakMasukan_Pembelian($tgl_awal, $tgl_lock);
|
|
$datRb = $this->Informasi->getData_PajakMasukan_ReturBeli($tgl_awal, $tgl_lock);
|
|
foreach ($datRb as $key) {
|
|
$datPembelian[count($datPembelian)] = $key;
|
|
}
|
|
asort($datPembelian);
|
|
|
|
$total_pajakmasukan = 0;
|
|
foreach ($datPembelian as $key) {
|
|
$subtotal = $key['TOTAL']-$key['TOTALDPP'];
|
|
if (strpos($key['KODEBUKTI'],"PB")!==FALSE) {
|
|
$total_pajakmasukan = $total_pajakmasukan+$subtotal;
|
|
} else if (strpos($key['KODEBUKTI'],"RB")!==FALSE) {
|
|
$total_pajakmasukan = $total_pajakmasukan-$subtotal;
|
|
}
|
|
}
|
|
|
|
$input = [
|
|
'SETDATA_ID' => $id_setdatabefore,
|
|
'TGL_DJM' => $tgl_lock,
|
|
'JM_ID' => $id_jm,
|
|
'PERKIRAAN_ID' => '82',
|
|
'DEBET_DJM' => $total_pajakmasukan,
|
|
'KREDIT_DJM' => '0',
|
|
'KET_DJM' => "Jurnal Otomatis u/ Perkiraan [1190 | Pajak Masukan | $kode_setdatabefore]",
|
|
];
|
|
$action = $this->Informasi->create('daftar_jurnalmemo', $input);
|
|
|
|
//Jurnal Otomatis, Pajak Keluaran
|
|
$datPenjualan = $this->Informasi->getData_PajakKeluaran_Penjualan($tgl_awal, $tgl_lock);
|
|
$datRj = $this->Informasi->getData_PajakKeluaran_ReturJual($tgl_awal, $tgl_lock);
|
|
foreach ($datRj as $key) {
|
|
$datPenjualan[count($datPenjualan)] = $key;
|
|
}
|
|
asort($datPenjualan);
|
|
|
|
$total_pajakkeluaran = 0;
|
|
foreach ($datPenjualan as $key) {
|
|
$subtotal = $key['TOTAL']-$key['TOTALDPP'];
|
|
if (strpos($key['KODEBUKTI'],"PJ")!==FALSE) {
|
|
$total_pajakkeluaran = $total_pajakkeluaran+$subtotal;
|
|
} else if (strpos($key['KODEBUKTI'],"RJ")!==FALSE) {
|
|
$total_pajakkeluaran = $total_pajakkeluaran-$subtotal;
|
|
}
|
|
}
|
|
|
|
$input = [
|
|
'SETDATA_ID' => $id_setdatabefore,
|
|
'TGL_DJM' => $tgl_lock,
|
|
'JM_ID' => $id_jm,
|
|
'PERKIRAAN_ID' => '83',
|
|
'DEBET_DJM' => '0',
|
|
'KREDIT_DJM' => $total_pajakkeluaran,
|
|
'KET_DJM' => "Jurnal Otomatis u/ Perkiraan [2160 | Pajak Keluaran | $kode_setdatabefore]",
|
|
];
|
|
$action = $this->Informasi->create('daftar_jurnalmemo', $input);
|
|
|
|
//Mencari nilai apa yang akan dimasukkan ke Jurnal Memo agar angkanya bisa dilihat lewat Laporan Perkiraan
|
|
|
|
if ($action) {
|
|
$this->session->set_flashdata('data_lock', 'dikunci');
|
|
redirect('authority');
|
|
} else {
|
|
$this->session->set_flashdata('failed', 'dikunci');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
|
|
}
|
|
|
|
public function dataLabaRugiBerjalan_Admin_A1() { // Informasi = [65]
|
|
$id_setdata = $this->Informasi->getID_SetdataMax();
|
|
$id_setdata = $id_setdata[0]['ID_SETDATA'];
|
|
|
|
$datSetdata = $this->Informasi->getData_Setdata_byID($id_setdata);
|
|
$month = date_format(date_create($datSetdata[0]['TGL_SETDATA']), "m");
|
|
$year = date_format(date_create($datSetdata[0]['TGL_SETDATA']), "Y");
|
|
|
|
if ($month=="01") {
|
|
$namaBulan = "Januari";
|
|
} else if ($month=="02") {
|
|
$namaBulan = "Februari";
|
|
} else if ($month=="03") {
|
|
$namaBulan = "Maret";
|
|
} else if ($month=="04") {
|
|
$namaBulan = "April";
|
|
} else if ($month=="05") {
|
|
$namaBulan = "Mei";
|
|
} else if ($month=="06") {
|
|
$namaBulan = "Juni";
|
|
} else if ($month=="07") {
|
|
$namaBulan = "Juli";
|
|
} else if ($month=="08") {
|
|
$namaBulan = "Agustus";
|
|
} else if ($month=="09") {
|
|
$namaBulan = "September";
|
|
} else if ($month=="10") {
|
|
$namaBulan = "Oktober";
|
|
} else if ($month=="11") {
|
|
$namaBulan = "November";
|
|
} else if ($month=="12") {
|
|
$namaBulan = "Desember";
|
|
}
|
|
$tanggal_sekarang = "$namaBulan $year";
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'tanggal_sekarang' => $tanggal_sekarang,
|
|
];
|
|
$this->load->view('proses/InformasiLabaRugiBerjalan_Admin_A1', $data);
|
|
}
|
|
|
|
public function dataNeraca_Admin_A1($id_setdata=null) { // Informasi = [66]
|
|
$datSetdata = $this->Informasi->getData_Setdata_0();
|
|
|
|
if ($id_setdata==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$tgl_awal = NULL;
|
|
$tgl_akhir = NULL;
|
|
$set = 0;
|
|
$nilaiNeraca1 = 0;
|
|
$nilaiNeraca2 = 0;
|
|
$nilaiNeraca3 = 0;
|
|
$nilaiNeraca4 = 0;
|
|
$nilaiNeraca5 = 0;
|
|
$nilaiNeraca6 = 0;
|
|
$nilaiNeraca7 = 0;
|
|
$nilaiNeraca8 = 0;
|
|
$nilaiNeraca9 = 0;
|
|
$nilaiNeraca10 = 0;
|
|
$nilaiNeraca11 = 0;
|
|
$nilaiNeraca12 = 0;
|
|
$nilaiNeraca13 = 0;
|
|
$nilaiNeraca14 = 0;
|
|
$nilaiNeraca15 = 0;
|
|
$nilaiNeraca16 = 0;
|
|
$nilaiNeraca17 = 0;
|
|
$nilaiNeraca18 = 0;
|
|
$nilaiNeraca19 = 0;
|
|
$nilaiNeraca20 = 0;
|
|
$nilaiNeraca21 = 0;
|
|
$nilaiNeraca22 = 0;
|
|
$nilaiNeraca82 = 0;
|
|
$nilaiNeraca83 = 0;
|
|
} else {
|
|
$dataSetdata = $this->Informasi->getData_Setdata_byID($id_setdata);
|
|
$kode_setdata = $dataSetdata[0]['KODE_SETDATA'];
|
|
$tgl_awal = $dataSetdata[0]['TGLSTART'];
|
|
$tgl_akhir = $dataSetdata[0]['TGLEND'];
|
|
$title = "$kode_setdata";
|
|
$set = 1;
|
|
|
|
$datNeraca = $this->Informasi->getData_Neraca_bySETDATA($id_setdata);
|
|
$nilaiNeraca1 = $datNeraca[0]['NILAI_NERACA'];
|
|
$nilaiNeraca2 = $datNeraca[1]['NILAI_NERACA'];
|
|
$nilaiNeraca3 = $datNeraca[2]['NILAI_NERACA'];
|
|
$nilaiNeraca4 = $datNeraca[3]['NILAI_NERACA'];
|
|
$nilaiNeraca5 = $datNeraca[4]['NILAI_NERACA'];
|
|
$nilaiNeraca6 = $datNeraca[5]['NILAI_NERACA'];
|
|
$nilaiNeraca7 = $datNeraca[6]['NILAI_NERACA'];
|
|
$nilaiNeraca8 = $datNeraca[7]['NILAI_NERACA'];
|
|
$nilaiNeraca9 = $datNeraca[8]['NILAI_NERACA'];
|
|
$nilaiNeraca10 = $datNeraca[9]['NILAI_NERACA'];
|
|
$nilaiNeraca11 = $datNeraca[10]['NILAI_NERACA'];
|
|
$nilaiNeraca12 = $datNeraca[11]['NILAI_NERACA'];
|
|
$nilaiNeraca13 = $datNeraca[12]['NILAI_NERACA'];
|
|
$nilaiNeraca14 = $datNeraca[13]['NILAI_NERACA'];
|
|
$nilaiNeraca15 = $datNeraca[14]['NILAI_NERACA'];
|
|
$nilaiNeraca16 = $datNeraca[15]['NILAI_NERACA'];
|
|
$nilaiNeraca17 = $datNeraca[16]['NILAI_NERACA'];
|
|
$nilaiNeraca18 = $datNeraca[17]['NILAI_NERACA'];
|
|
$nilaiNeraca19 = $datNeraca[18]['NILAI_NERACA'];
|
|
$nilaiNeraca20 = $datNeraca[19]['NILAI_NERACA'];
|
|
$nilaiNeraca21 = $datNeraca[20]['NILAI_NERACA'];
|
|
$nilaiNeraca22 = $datNeraca[21]['NILAI_NERACA'];
|
|
$nilaiNeraca82 = $datNeraca[81]['NILAI_NERACA'];
|
|
$nilaiNeraca83 = $datNeraca[82]['NILAI_NERACA'];
|
|
}
|
|
|
|
//Subtotal Sisa Aktiva Tetap
|
|
$sisainventaris = $nilaiNeraca9-$nilaiNeraca10;
|
|
$sisabangunan = $nilaiNeraca11-$nilaiNeraca12;
|
|
$sisakendaraan = $nilaiNeraca13-$nilaiNeraca14;
|
|
|
|
//Subtotal Aktiva Pasiva
|
|
$aktivaLancar = $nilaiNeraca1+$nilaiNeraca2+$nilaiNeraca3+$nilaiNeraca4+$nilaiNeraca5+$nilaiNeraca6+$nilaiNeraca7+$nilaiNeraca8+$nilaiNeraca82;
|
|
$kewajibanLancar = $nilaiNeraca15+$nilaiNeraca16+$nilaiNeraca17+$nilaiNeraca18+$nilaiNeraca19+$nilaiNeraca83;
|
|
$aktivaTetap = $sisainventaris+$sisabangunan+$sisakendaraan;
|
|
$modal = $nilaiNeraca20+$nilaiNeraca21+$nilaiNeraca22;
|
|
$totalAktiva = $aktivaLancar+$aktivaTetap;
|
|
$totalPassiva = $kewajibanLancar+$modal;
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'nilai_perkiraan1' => $nilaiNeraca1,
|
|
'nilai_perkiraan2' => $nilaiNeraca2,
|
|
'nilai_perkiraan3' => $nilaiNeraca3,
|
|
'nilai_perkiraan4' => $nilaiNeraca4,
|
|
'nilai_perkiraan5' => $nilaiNeraca5,
|
|
'nilai_perkiraan6' => $nilaiNeraca6,
|
|
'nilai_perkiraan7' => $nilaiNeraca7,
|
|
'nilai_perkiraan8' => $nilaiNeraca8,
|
|
'nilai_perkiraan82' => $nilaiNeraca82,
|
|
'aktivaLancar' => $aktivaLancar,
|
|
'sisainventaris' => $sisainventaris,
|
|
'sisabangunan' => $sisabangunan,
|
|
'sisakendaraan' => $sisakendaraan,
|
|
'aktivaTetap' => $aktivaTetap,
|
|
'nilai_perkiraan15' => $nilaiNeraca15,
|
|
'nilai_perkiraan16' => $nilaiNeraca16,
|
|
'nilai_perkiraan17' => $nilaiNeraca17,
|
|
'nilai_perkiraan18' => $nilaiNeraca18,
|
|
'nilai_perkiraan19' => $nilaiNeraca19,
|
|
'nilai_perkiraan83' => $nilaiNeraca83,
|
|
'kewajibanLancar' => $kewajibanLancar,
|
|
'nilai_perkiraan20' => $nilaiNeraca20,
|
|
'nilai_perkiraan21' => $nilaiNeraca21,
|
|
'nilai_perkiraan22' => $nilaiNeraca22,
|
|
'modal' => $modal,
|
|
'totalAktiva' => $totalAktiva,
|
|
'totalPassiva' => $totalPassiva,
|
|
'id_setdata' => $id_setdata,
|
|
'title' => $title,
|
|
'setdata' => $datSetdata,
|
|
'tgl_awal' => $tgl_awal,
|
|
'tgl_akhir' => $tgl_akhir,
|
|
'set' => $set
|
|
];
|
|
$this->load->view('proses/InformasiNeracaPeriode_Admin_A1', $data);
|
|
}
|
|
|
|
public function dataLabaRugi_Admin_A1($id_setdata=null) { // Informasi = [67]
|
|
$datSetdata = $this->Informasi->getData_Setdata_0();
|
|
|
|
if ($id_setdata==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$tgl_awal = NULL;
|
|
$tgl_akhir = NULL;
|
|
$set = 0;
|
|
|
|
$nilaiNeraca4 = 0; $nilaiNeraca23 = 0; $nilaiNeraca24 = 0; $nilaiNeraca25 = 0;
|
|
$nilaiNeraca26 = 0; $nilaiNeraca27 = 0; $nilaiNeraca28 = 0; $nilaiNeraca29 = 0; $nilaiNeraca30 = 0;
|
|
$nilaiNeraca31 = 0; $nilaiNeraca32 = 0; $nilaiNeraca33 = 0; $nilaiNeraca34 = 0; $nilaiNeraca35 = 0;
|
|
$nilaiNeraca36 = 0; $nilaiNeraca37 = 0; $nilaiNeraca38 = 0; $nilaiNeraca39 = 0; $nilaiNeraca40 = 0;
|
|
$nilaiNeraca41 = 0; $nilaiNeraca42 = 0; $nilaiNeraca43 = 0; $nilaiNeraca44 = 0; $nilaiNeraca45 = 0;
|
|
$nilaiNeraca46 = 0; $nilaiNeraca47 = 0; $nilaiNeraca48 = 0; $nilaiNeraca49 = 0; $nilaiNeraca50 = 0;
|
|
$nilaiNeraca51 = 0; $nilaiNeraca52 = 0; $nilaiNeraca53 = 0; $nilaiNeraca54 = 0; $nilaiNeraca55 = 0;
|
|
$nilaiNeraca56 = 0; $nilaiNeraca57 = 0; $nilaiNeraca58 = 0; $nilaiNeraca59 = 0; $nilaiNeraca60 = 0;
|
|
$nilaiNeraca61 = 0; $nilaiNeraca62 = 0; $nilaiNeraca63 = 0; $nilaiNeraca64 = 0; $nilaiNeraca65 = 0;
|
|
$nilaiNeraca66 = 0; $nilaiNeraca67 = 0; $nilaiNeraca68 = 0; $nilaiNeraca69 = 0; $nilaiNeraca70 = 0;
|
|
$nilaiNeraca71 = 0; $nilaiNeraca72 = 0; $nilaiNeraca73 = 0; $nilaiNeraca74 = 0; $nilaiNeraca75 = 0;
|
|
$nilaiNeraca76 = 0; $nilaiNeraca77 = 0; $nilaiNeraca78 = 0; $nilaiNeraca79 = 0; $nilaiNeraca80 = 0;
|
|
$nilaiNeraca81 = 0; $nilaiNeraca84 = 0; $nilaiNeraca85 = 0; $nilaiNeraca86 = 0; $nilaiNeraca87 = 0;
|
|
} else {
|
|
$dataSetdata = $this->Informasi->getData_Setdata_byID($id_setdata);
|
|
$kode_setdata = $dataSetdata[0]['KODE_SETDATA'];
|
|
$tgl_awal = $dataSetdata[0]['TGLSTART'];
|
|
$tgl_akhir = $dataSetdata[0]['TGLEND'];
|
|
$title = "$kode_setdata";
|
|
$set = 1;
|
|
|
|
$datNeraca = $this->Informasi->getData_Neraca_bySETDATA($id_setdata);
|
|
|
|
$no = 22;
|
|
$nilaiNeraca4 = $datNeraca[3]['NILAI_NERACA'];
|
|
$nilaiNeraca23 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca24 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca25 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca26 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca27 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca28 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca29 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca30 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca31 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca32 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca33 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca34 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca35 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca36 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca37 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca38 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca39 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca40 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca41 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca42 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca43 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca44 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca45 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca46 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca47 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca48 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca49 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca50 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca51 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca52 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca53 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca54 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca55 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca56 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca57 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca58 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca59 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca60 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca61 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca62 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca63 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca64 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca65 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca66 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca67 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca68 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca69 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca70 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca71 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca72 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca73 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca74 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca75 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca76 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca77 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca78 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca79 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca80 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca81 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca84 = $datNeraca[83]['NILAI_NERACA'];
|
|
$nilaiNeraca85 = $datNeraca[84]['NILAI_NERACA'];
|
|
$nilaiNeraca86 = $datNeraca[85]['NILAI_NERACA'];
|
|
$nilaiNeraca87 = $datNeraca[86]['NILAI_NERACA'];
|
|
}
|
|
|
|
$totalPenjualan = $nilaiNeraca23-$nilaiNeraca24-$nilaiNeraca25;
|
|
$totalPembelian = $nilaiNeraca26+$nilaiNeraca27-$nilaiNeraca28-$nilaiNeraca29;
|
|
|
|
if ($id_setdata == "1") {
|
|
$hargaPokokPenjualan = 0;
|
|
} else {
|
|
$hargaPokokPenjualan = $totalPembelian-$nilaiNeraca4;
|
|
}
|
|
|
|
$labaKotor = $totalPenjualan-$hargaPokokPenjualan;
|
|
$totalBiayaPenjualan = $nilaiNeraca31+$nilaiNeraca32+$nilaiNeraca33+$nilaiNeraca34+$nilaiNeraca35+$nilaiNeraca36+$nilaiNeraca37;
|
|
$totalBiayaUmumAdministrasi = $nilaiNeraca38+$nilaiNeraca39+$nilaiNeraca40+$nilaiNeraca41+$nilaiNeraca42+$nilaiNeraca43+$nilaiNeraca44+$nilaiNeraca45+
|
|
$nilaiNeraca46+$nilaiNeraca47+$nilaiNeraca48+$nilaiNeraca49+$nilaiNeraca50+$nilaiNeraca51+$nilaiNeraca52+$nilaiNeraca53+
|
|
$nilaiNeraca54+$nilaiNeraca55+$nilaiNeraca56+$nilaiNeraca57+$nilaiNeraca58+$nilaiNeraca59+$nilaiNeraca60+$nilaiNeraca61+
|
|
$nilaiNeraca62+$nilaiNeraca63+$nilaiNeraca64+$nilaiNeraca65+$nilaiNeraca66+$nilaiNeraca67+$nilaiNeraca68+$nilaiNeraca69+
|
|
$nilaiNeraca70+$nilaiNeraca71+$nilaiNeraca72+$nilaiNeraca73+$nilaiNeraca74+$nilaiNeraca80+$nilaiNeraca81+$nilaiNeraca84+
|
|
$nilaiNeraca85+$nilaiNeraca86;
|
|
$totalBiayaBiaya = $totalBiayaPenjualan+$totalBiayaUmumAdministrasi;
|
|
$labaUsaha = $labaKotor-$totalBiayaBiaya;
|
|
$totalPendapatan = $nilaiNeraca75+$nilaiNeraca76-$nilaiNeraca77-$nilaiNeraca78-$nilaiNeraca87;
|
|
$labaBersihSebelumPajak = $labaUsaha+$totalPendapatan;
|
|
$labaBersihSetelahPajak = $labaBersihSebelumPajak-$nilaiNeraca79;
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'nilai_perkiraan23' => $nilaiNeraca23,
|
|
'nilai_perkiraan24' => $nilaiNeraca24,
|
|
'nilai_perkiraan25' => $nilaiNeraca25,
|
|
'nilai_perkiraan26' => $nilaiNeraca26,
|
|
'nilai_perkiraan27' => $nilaiNeraca27,
|
|
'nilai_perkiraan28' => $nilaiNeraca28,
|
|
'nilai_perkiraan29' => $nilaiNeraca29,
|
|
'nilai_perkiraan30' => $nilaiNeraca30,
|
|
'nilai_perkiraan31' => $nilaiNeraca31,
|
|
'nilai_perkiraan32' => $nilaiNeraca32,
|
|
'nilai_perkiraan33' => $nilaiNeraca33,
|
|
'nilai_perkiraan34' => $nilaiNeraca34,
|
|
'nilai_perkiraan35' => $nilaiNeraca35,
|
|
'nilai_perkiraan36' => $nilaiNeraca36,
|
|
'nilai_perkiraan37' => $nilaiNeraca37,
|
|
'nilai_perkiraan38' => $nilaiNeraca38,
|
|
'nilai_perkiraan39' => $nilaiNeraca39,
|
|
'nilai_perkiraan40' => $nilaiNeraca40,
|
|
'nilai_perkiraan41' => $nilaiNeraca41,
|
|
'nilai_perkiraan42' => $nilaiNeraca42,
|
|
'nilai_perkiraan43' => $nilaiNeraca43,
|
|
'nilai_perkiraan44' => $nilaiNeraca44,
|
|
'nilai_perkiraan45' => $nilaiNeraca45,
|
|
'nilai_perkiraan46' => $nilaiNeraca46,
|
|
'nilai_perkiraan47' => $nilaiNeraca47,
|
|
'nilai_perkiraan48' => $nilaiNeraca48,
|
|
'nilai_perkiraan49' => $nilaiNeraca49,
|
|
'nilai_perkiraan50' => $nilaiNeraca50,
|
|
'nilai_perkiraan51' => $nilaiNeraca51,
|
|
'nilai_perkiraan52' => $nilaiNeraca52,
|
|
'nilai_perkiraan53' => $nilaiNeraca53,
|
|
'nilai_perkiraan54' => $nilaiNeraca54,
|
|
'nilai_perkiraan55' => $nilaiNeraca55,
|
|
'nilai_perkiraan56' => $nilaiNeraca56,
|
|
'nilai_perkiraan57' => $nilaiNeraca57,
|
|
'nilai_perkiraan58' => $nilaiNeraca58,
|
|
'nilai_perkiraan59' => $nilaiNeraca59,
|
|
'nilai_perkiraan60' => $nilaiNeraca60,
|
|
'nilai_perkiraan61' => $nilaiNeraca61,
|
|
'nilai_perkiraan62' => $nilaiNeraca62,
|
|
'nilai_perkiraan63' => $nilaiNeraca63,
|
|
'nilai_perkiraan64' => $nilaiNeraca64,
|
|
'nilai_perkiraan65' => $nilaiNeraca65,
|
|
'nilai_perkiraan66' => $nilaiNeraca66,
|
|
'nilai_perkiraan67' => $nilaiNeraca67,
|
|
'nilai_perkiraan68' => $nilaiNeraca68,
|
|
'nilai_perkiraan69' => $nilaiNeraca69,
|
|
'nilai_perkiraan70' => $nilaiNeraca70,
|
|
'nilai_perkiraan71' => $nilaiNeraca71,
|
|
'nilai_perkiraan72' => $nilaiNeraca72,
|
|
'nilai_perkiraan73' => $nilaiNeraca73,
|
|
'nilai_perkiraan74' => $nilaiNeraca74,
|
|
'nilai_perkiraan75' => $nilaiNeraca75,
|
|
'nilai_perkiraan76' => $nilaiNeraca76,
|
|
'nilai_perkiraan77' => $nilaiNeraca77,
|
|
'nilai_perkiraan78' => $nilaiNeraca78,
|
|
'nilai_perkiraan79' => $nilaiNeraca79,
|
|
'nilai_perkiraan80' => $nilaiNeraca80,
|
|
'nilai_perkiraan81' => $nilaiNeraca81,
|
|
'nilai_perkiraan84' => $nilaiNeraca84,
|
|
'nilai_perkiraan85' => $nilaiNeraca85,
|
|
'nilai_perkiraan86' => $nilaiNeraca86,
|
|
'nilai_perkiraan87' => $nilaiNeraca87,
|
|
'set' => $set,
|
|
'id_setdata' => $id_setdata,
|
|
'title' => $title,
|
|
'setdata' => $datSetdata,
|
|
'tgl_awal' => $tgl_awal,
|
|
'tgl_akhir' => $tgl_akhir,
|
|
'totalPenjualan' => $totalPenjualan,
|
|
'totalPembelian' => $totalPembelian,
|
|
'hargaPokokPenjualan' => $hargaPokokPenjualan,
|
|
'labaKotor' => $labaKotor,
|
|
'totalBiayaPenjualan' => $totalBiayaPenjualan,
|
|
'totalBiayaUmumAdministrasi' => $totalBiayaUmumAdministrasi,
|
|
'totalBiayaBiaya' => $totalBiayaBiaya,
|
|
'labaUsaha' => $labaUsaha,
|
|
'totalPendapatan' => $totalPendapatan,
|
|
'labaBersihSebelumPajak' => $labaBersihSebelumPajak,
|
|
'labaBersihSetelahPajak' => $labaBersihSetelahPajak,
|
|
];
|
|
$this->load->view('proses/InformasiLabaRugiPeriode_Admin_A1', $data);
|
|
}
|
|
|
|
public function dataPersediaan_Admin_A1($id_setdata=null) { // Informasi = [68]
|
|
$datSetdata = $this->Informasi->getData_Setdata_0();
|
|
|
|
if ($id_setdata==NULL) {
|
|
$title = "Belum Terpilih*";
|
|
$persediaan = NULL;
|
|
$tgl_awal = NULL;
|
|
$tgl_akhir = NULL;
|
|
$set = 0;
|
|
$nilaiNeraca4 = 0;
|
|
} else {
|
|
$dataSetdata = $this->Informasi->getData_Setdata_byID($id_setdata);
|
|
$kode_setdata = $dataSetdata[0]['KODE_SETDATA'];
|
|
$tgl_awal = $dataSetdata[0]['TGLSTART'];
|
|
$tgl_akhir = $dataSetdata[0]['TGLEND'];
|
|
$title = "$kode_setdata";
|
|
$set = 1;
|
|
$month = date_format(date_create($dataSetdata[0]['TGL_SETDATA']), "m");
|
|
$year = date_format(date_create($dataSetdata[0]['TGL_SETDATA']), "Y");
|
|
$persediaan = $this->Informasi->getSum_HistoriKuantiti_groupBARANG_forNeraca($month, $year);
|
|
|
|
$nilaiNeraca4 = 0;
|
|
$no = 0;
|
|
foreach ($persediaan as $dat) {
|
|
$datHq = $this->Informasi->getData_HistoriKuantiti_byBARANG_MasukLebih0($dat['BARANG_ID'], $month, $year);
|
|
$totkeluar = 0;
|
|
$totpersediaan = 0;
|
|
$hargaavglama = 0;
|
|
foreach ($datHq as $key) {
|
|
$sumHq = $this->Informasi->getSum_HistoriKuantiti_byBARANG_byHQ($key['BARANG_ID'], $key['ID_HQ']);
|
|
if ($totkeluar!=$sumHq[0]['KELUAR']) {
|
|
$totkeluar = $sumHq[0]['KELUAR'];
|
|
$datHqLim = $this->Informasi->getData_HistoriKuantiti_limitHQ($key['BARANG_ID'], $key['ID_HQ']);
|
|
$limit = $this->Informasi->getSum_HistoriKuantiti_byBARANG_byHQ1_byHQ2($key['BARANG_ID'], $key['ID_HQ'], $datHqLim[0]['ID_HQ']);
|
|
$keluar = $limit[0]['KELUAR'];
|
|
} else {
|
|
$keluar = 0;
|
|
$totkeluar = 0;
|
|
}
|
|
|
|
//Harga Per Item, DPP
|
|
$harga = $key['NILAI_HQ'] / $key['MASUK_HQ'];
|
|
|
|
//Nilai Total Persediaan Akhir
|
|
$nilaiPersediaanKeluar = $hargaavglama * $keluar;
|
|
$totpersediaan = $totpersediaan + ($harga * $key['MASUK_HQ']) - $nilaiPersediaanKeluar;
|
|
$hppakhir = $totpersediaan/$sumHq[0]['TOTAL'];
|
|
|
|
$hargaavglama = $hppakhir;
|
|
}
|
|
//Hitung Persediaan Akhir yang Tersisi
|
|
$subtotal = $hppakhir*$dat['TOTAL'];
|
|
|
|
//Tambahkan Data Total Persediaan, dan HPP Terakhir
|
|
$viewHargaAvg = number_format($hppakhir,2);
|
|
$viewSubtotal = number_format($subtotal,2);
|
|
|
|
$persediaan[$no] += ['TOTALPERSEDIAAN' => $viewSubtotal];
|
|
$persediaan[$no++] += ['AVG' => $viewHargaAvg];
|
|
|
|
//Tambahkan Nilai Terakhir Persediaan per Kode Barang
|
|
$nilaiNeraca4 = $nilaiNeraca4 + $subtotal;
|
|
}
|
|
$nilaiNeraca4 = number_format($nilaiNeraca4,2);
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'persediaan' => $persediaan,
|
|
'id_setdata' => $id_setdata,
|
|
'title' => $title,
|
|
'setdata' => $datSetdata,
|
|
'tgl_awal' => $tgl_awal,
|
|
'tgl_akhir' => $tgl_akhir,
|
|
'nilaiNeraca4' => $nilaiNeraca4
|
|
];
|
|
$this->load->view('proses/InformasiPersediaanPeriode_Admin_A1', $data);
|
|
}
|
|
|
|
public function simpan_excel_neraca() { // Informasi = [69]
|
|
$id_setdata = $this->input->post('id_setdata');
|
|
|
|
$dataSetdata = $this->Informasi->getData_Setdata_byID($id_setdata);
|
|
$tgl_awal = $dataSetdata[0]['TGLSTART'];
|
|
$tgl_akhir = $dataSetdata[0]['TGLEND'];
|
|
$judul = "Periode $tgl_awal s/d $tgl_akhir";
|
|
|
|
$datNeraca = $this->Informasi->getData_Neraca_bySETDATA($id_setdata);
|
|
$nilaiNeraca1 = $datNeraca[0]['NILAI_NERACA'];
|
|
$nilaiNeraca2 = $datNeraca[1]['NILAI_NERACA'];
|
|
$nilaiNeraca3 = $datNeraca[2]['NILAI_NERACA'];
|
|
$nilaiNeraca4 = $datNeraca[3]['NILAI_NERACA'];
|
|
$nilaiNeraca5 = $datNeraca[4]['NILAI_NERACA'];
|
|
$nilaiNeraca6 = $datNeraca[5]['NILAI_NERACA'];
|
|
$nilaiNeraca7 = $datNeraca[6]['NILAI_NERACA'];
|
|
$nilaiNeraca8 = $datNeraca[7]['NILAI_NERACA'];
|
|
$nilaiNeraca9 = $datNeraca[8]['NILAI_NERACA'];
|
|
$nilaiNeraca10 = $datNeraca[9]['NILAI_NERACA'];
|
|
$nilaiNeraca11 = $datNeraca[10]['NILAI_NERACA'];
|
|
$nilaiNeraca12 = $datNeraca[11]['NILAI_NERACA'];
|
|
$nilaiNeraca13 = $datNeraca[12]['NILAI_NERACA'];
|
|
$nilaiNeraca14 = $datNeraca[13]['NILAI_NERACA'];
|
|
$nilaiNeraca15 = $datNeraca[14]['NILAI_NERACA'];
|
|
$nilaiNeraca16 = $datNeraca[15]['NILAI_NERACA'];
|
|
$nilaiNeraca17 = $datNeraca[16]['NILAI_NERACA'];
|
|
$nilaiNeraca18 = $datNeraca[17]['NILAI_NERACA'];
|
|
$nilaiNeraca19 = $datNeraca[18]['NILAI_NERACA'];
|
|
$nilaiNeraca20 = $datNeraca[19]['NILAI_NERACA'];
|
|
$nilaiNeraca21 = $datNeraca[20]['NILAI_NERACA'];
|
|
$nilaiNeraca22 = $datNeraca[21]['NILAI_NERACA'];
|
|
$nilaiNeraca82 = $datNeraca[81]['NILAI_NERACA'];
|
|
$nilaiNeraca83 = $datNeraca[82]['NILAI_NERACA'];
|
|
|
|
//Subtotal Sisa Aktiva Tetap
|
|
$sisainventaris = $nilaiNeraca9-$nilaiNeraca10;
|
|
$sisabangunan = $nilaiNeraca11-$nilaiNeraca12;
|
|
$sisakendaraan = $nilaiNeraca13-$nilaiNeraca14;
|
|
|
|
//Subtotal Aktiva Pasiva
|
|
$aktivaLancar = $nilaiNeraca1+$nilaiNeraca2+$nilaiNeraca3+$nilaiNeraca4+$nilaiNeraca5+$nilaiNeraca6+$nilaiNeraca7+$nilaiNeraca8+$nilaiNeraca82;
|
|
$kewajibanLancar = $nilaiNeraca15+$nilaiNeraca16+$nilaiNeraca17+$nilaiNeraca18+$nilaiNeraca19+$nilaiNeraca83;
|
|
$aktivaTetap = $sisainventaris+$sisabangunan+$sisakendaraan;
|
|
$modal = $nilaiNeraca20+$nilaiNeraca21+$nilaiNeraca22;
|
|
$totalAktiva = $aktivaLancar+$aktivaTetap;
|
|
$totalPassiva = $kewajibanLancar+$modal;
|
|
|
|
$a1 = number_format($nilaiNeraca1,2); $p1 = number_format($nilaiNeraca15,2); $a10 = number_format($sisainventaris,2);
|
|
$a2 = number_format($nilaiNeraca2,2); $p2 = number_format($nilaiNeraca16,2); $a11 = number_format($sisabangunan,2);
|
|
$a3 = number_format($nilaiNeraca3,2); $p3 = number_format($nilaiNeraca17,2); $a12 = number_format($sisakendaraan,2);
|
|
$a4 = number_format($nilaiNeraca4,2); $p4 = number_format($nilaiNeraca18,2); $sub1 = number_format($aktivaLancar,2);
|
|
$a5 = number_format($nilaiNeraca5,2); $p5 = number_format($nilaiNeraca19,2); $sub2 = number_format($kewajibanLancar,2);
|
|
$a6 = number_format($nilaiNeraca6,2); $p6 = number_format($nilaiNeraca83,2); $sub3 = number_format($aktivaTetap,2);
|
|
$a7 = number_format($nilaiNeraca7,2); $p7 = number_format($nilaiNeraca20,2); $sub4 = number_format($modal,2);
|
|
$a8 = number_format($nilaiNeraca8,2); $p8 = number_format($nilaiNeraca21,2); $sub5 = number_format($totalAktiva,2);
|
|
$a9 = number_format($nilaiNeraca82,2); $p9 = number_format($nilaiNeraca22,2); $sub6 = number_format($totalPassiva,2);
|
|
|
|
$data = [
|
|
'title' => '', 'p1' => $p1, 'sub6' => $sub6,
|
|
'judul' => $judul, 'p2' => $p2,
|
|
'a1' => $a1, 'p3' => $p3,
|
|
'a2' => $a2, 'p4' => $p4,
|
|
'a3' => $a3, 'p5' => $p5,
|
|
'a4' => $a4, 'p6' => $p6,
|
|
'a5' => $a5, 'p7' => $p7,
|
|
'a6' => $a6, 'p8' => $p8,
|
|
'a7' => $a7, 'p9' => $p9,
|
|
'a8' => $a8, 'sub1' => $sub1,
|
|
'a9' => $a9, 'sub2' => $sub2,
|
|
'a10' => $a10, 'sub3' => $sub3,
|
|
'a11' => $a11, 'sub4' => $sub4,
|
|
'a12' => $a12, 'sub5' => $sub5,
|
|
];
|
|
$this->load->view('cetak/excel_neraca', $data);
|
|
}
|
|
|
|
public function simpan_excel_labarugi() { // Informasi = [70]
|
|
$id_setdata = $this->input->post('id_setdata');
|
|
|
|
$dataSetdata = $this->Informasi->getData_Setdata_byID($id_setdata);
|
|
$tgl_awal = $dataSetdata[0]['TGLSTART'];
|
|
$tgl_akhir = $dataSetdata[0]['TGLEND'];
|
|
$judul = "Periode $tgl_awal s/d $tgl_akhir";
|
|
|
|
$datNeraca = $this->Informasi->getData_Neraca_bySETDATA($id_setdata);
|
|
|
|
$no = 22;
|
|
$nilaiNeraca4 = $datNeraca[3]['NILAI_NERACA'];
|
|
$nilaiNeraca23 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca24 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca25 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca26 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca27 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca28 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca29 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca30 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca31 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca32 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca33 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca34 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca35 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca36 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca37 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca38 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca39 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca40 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca41 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca42 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca43 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca44 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca45 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca46 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca47 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca48 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca49 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca50 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca51 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca52 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca53 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca54 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca55 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca56 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca57 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca58 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca59 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca60 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca61 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca62 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca63 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca64 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca65 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca66 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca67 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca68 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca69 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca70 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca71 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca72 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca73 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca74 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca75 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca76 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca77 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca78 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca79 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca80 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca81 = $datNeraca[$no++]['NILAI_NERACA'];
|
|
$nilaiNeraca84 = $datNeraca[83]['NILAI_NERACA'];
|
|
$nilaiNeraca85 = $datNeraca[84]['NILAI_NERACA'];
|
|
$nilaiNeraca86 = $datNeraca[85]['NILAI_NERACA'];
|
|
$nilaiNeraca87 = $datNeraca[86]['NILAI_NERACA'];
|
|
|
|
$totalPenjualan = $nilaiNeraca23-$nilaiNeraca24-$nilaiNeraca25;
|
|
$totalPembelian = $nilaiNeraca26+$nilaiNeraca27-$nilaiNeraca28-$nilaiNeraca29;
|
|
|
|
if ($id_setdata == "1") {
|
|
$hargaPokokPenjualan = 0;
|
|
} else {
|
|
$hargaPokokPenjualan = $totalPembelian-$nilaiNeraca4;
|
|
}
|
|
|
|
$labaKotor = $totalPenjualan-$hargaPokokPenjualan;
|
|
$totalBiayaPenjualan = $nilaiNeraca31+$nilaiNeraca32+$nilaiNeraca33+$nilaiNeraca34+$nilaiNeraca35+$nilaiNeraca36+$nilaiNeraca37;
|
|
$totalBiayaUmumAdministrasi = $nilaiNeraca38+$nilaiNeraca39+$nilaiNeraca40+$nilaiNeraca41+$nilaiNeraca42+$nilaiNeraca43+$nilaiNeraca44+$nilaiNeraca45+
|
|
$nilaiNeraca46+$nilaiNeraca47+$nilaiNeraca48+$nilaiNeraca49+$nilaiNeraca50+$nilaiNeraca51+$nilaiNeraca52+$nilaiNeraca53+
|
|
$nilaiNeraca54+$nilaiNeraca55+$nilaiNeraca56+$nilaiNeraca57+$nilaiNeraca58+$nilaiNeraca59+$nilaiNeraca60+$nilaiNeraca61+
|
|
$nilaiNeraca62+$nilaiNeraca63+$nilaiNeraca64+$nilaiNeraca65+$nilaiNeraca66+$nilaiNeraca67+$nilaiNeraca68+$nilaiNeraca69+
|
|
$nilaiNeraca70+$nilaiNeraca71+$nilaiNeraca72+$nilaiNeraca73+$nilaiNeraca74+$nilaiNeraca80+$nilaiNeraca81+$nilaiNeraca84+
|
|
$nilaiNeraca85+$nilaiNeraca86;
|
|
$totalBiayaBiaya = $totalBiayaPenjualan+$totalBiayaUmumAdministrasi;
|
|
$labaUsaha = $labaKotor-$totalBiayaBiaya;
|
|
$totalPendapatan1 = $nilaiNeraca75+$nilaiNeraca76;
|
|
$totalPendapatan2 = $nilaiNeraca77+$nilaiNeraca78+$nilaiNeraca87;
|
|
$totalPendapatan = $totalPendapatan1-$totalPendapatan2;
|
|
$labaBersihSebelumPajak = $labaUsaha+$totalPendapatan;
|
|
$labaBersihSetelahPajak = $labaBersihSebelumPajak-$nilaiNeraca79;
|
|
|
|
$l1 = number_format($nilaiNeraca23,2); $l11 = number_format($nilaiNeraca33,2); $l21 = number_format($nilaiNeraca43,2);
|
|
$l2 = number_format($nilaiNeraca24,2); $l12 = number_format($nilaiNeraca34,2); $l22 = number_format($nilaiNeraca44,2);
|
|
$l3 = number_format($nilaiNeraca25,2); $l13 = number_format($nilaiNeraca35,2); $l23 = number_format($nilaiNeraca45,2);
|
|
$l4 = number_format($nilaiNeraca26,2); $l14 = number_format($nilaiNeraca36,2); $l24 = number_format($nilaiNeraca46,2);
|
|
$l5 = number_format($nilaiNeraca27,2); $l15 = number_format($nilaiNeraca37,2); $l25 = number_format($nilaiNeraca47,2);
|
|
$l6 = number_format($nilaiNeraca28,2); $l16 = number_format($nilaiNeraca38,2); $l26 = number_format($nilaiNeraca48,2);
|
|
$l7 = number_format($nilaiNeraca29,2); $l17 = number_format($nilaiNeraca39,2); $l27 = number_format($nilaiNeraca49,2);
|
|
$l8 = number_format($nilaiNeraca30,2); $l18 = number_format($nilaiNeraca40,2); $l28 = number_format($nilaiNeraca50,2);
|
|
$l9 = number_format($nilaiNeraca31,2); $l19 = number_format($nilaiNeraca41,2); $l29 = number_format($nilaiNeraca51,2);
|
|
$l10 = number_format($nilaiNeraca32,2); $l20 = number_format($nilaiNeraca42,2); $l30 = number_format($nilaiNeraca52,2);
|
|
|
|
$l31 = number_format($nilaiNeraca53,2); $l41 = number_format($nilaiNeraca63,2); $l51 = number_format($nilaiNeraca73,2);
|
|
$l32 = number_format($nilaiNeraca54,2); $l42 = number_format($nilaiNeraca64,2); $l52 = number_format($nilaiNeraca74,2);
|
|
$l33 = number_format($nilaiNeraca55,2); $l43 = number_format($nilaiNeraca65,2); $l53 = number_format($nilaiNeraca75,2);
|
|
$l34 = number_format($nilaiNeraca56,2); $l44 = number_format($nilaiNeraca66,2); $l54 = number_format($nilaiNeraca76,2);
|
|
$l35 = number_format($nilaiNeraca57,2); $l45 = number_format($nilaiNeraca67,2); $l55 = number_format($nilaiNeraca77,2);
|
|
$l36 = number_format($nilaiNeraca58,2); $l46 = number_format($nilaiNeraca68,2); $l56 = number_format($nilaiNeraca78,2);
|
|
$l37 = number_format($nilaiNeraca59,2); $l47 = number_format($nilaiNeraca69,2); $l57 = number_format($nilaiNeraca79,2);
|
|
$l38 = number_format($nilaiNeraca60,2); $l48 = number_format($nilaiNeraca70,2); $l58 = number_format($nilaiNeraca80,2);
|
|
$l39 = number_format($nilaiNeraca61,2); $l49 = number_format($nilaiNeraca71,2); $l59 = number_format($nilaiNeraca81,2);
|
|
$l40 = number_format($nilaiNeraca62,2); $l50 = number_format($nilaiNeraca72,2); $l60 = number_format($nilaiNeraca84,2);
|
|
|
|
$l61 = number_format($nilaiNeraca85,2); $sub9 = number_format($totalPendapatan1,2);
|
|
$l62 = number_format($nilaiNeraca86,2);
|
|
$l63 = number_format($nilaiNeraca87,2); $sub10 = number_format($totalPendapatan2,2);
|
|
$sub1 = number_format($totalPenjualan,2); $sub11 = number_format($totalPendapatan,2);
|
|
$sub2 = number_format($totalPembelian,2); $sub12 = number_format($labaBersihSebelumPajak,2);
|
|
$sub3 = number_format($hargaPokokPenjualan,2); $sub13 = number_format($labaBersihSetelahPajak,2);
|
|
$sub4 = number_format($labaKotor,2);
|
|
$sub5 = number_format($totalBiayaPenjualan,2);
|
|
$sub6 = number_format($totalBiayaUmumAdministrasi,2);
|
|
$sub7 = number_format($totalBiayaBiaya,2);
|
|
$sub8 = number_format($labaUsaha,2);
|
|
|
|
$data = [
|
|
'title' => '', 'l21' => $l21, 'l43' => $l43, 'sub3' => $sub3,
|
|
'judul' => $judul, 'l22' => $l22, 'l44' => $l44, 'sub4' => $sub4,
|
|
'l1' => $l1, 'l23' => $l23, 'l45' => $l45, 'sub5' => $sub5,
|
|
'l2' => $l2, 'l24' => $l24, 'l46' => $l46, 'sub6' => $sub6,
|
|
'l3' => $l3, 'l25' => $l25, 'l47' => $l47, 'sub7' => $sub7,
|
|
'l4' => $l4, 'l26' => $l26, 'l48' => $l48, 'sub8' => $sub8,
|
|
'l5' => $l5, 'l27' => $l27, 'l49' => $l49, 'sub9' => $sub9,
|
|
'l6' => $l6, 'l28' => $l28, 'l50' => $l50, 'sub10' => $sub10,
|
|
'l7' => $l7, 'l29' => $l29, 'l51' => $l51, 'sub11' => $sub11,
|
|
'l8' => $l8, 'l30' => $l30, 'l52' => $l52, 'sub12' => $sub12,
|
|
'l9' => $l9, 'l31' => $l31, 'l53' => $l53, 'sub13' => $sub13,
|
|
'l10' => $l10, 'l32' => $l32, 'l54' => $l54, 'l63' => $l63,
|
|
'l11' => $l11, 'l33' => $l33, 'l55' => $l55,
|
|
'l12' => $l12, 'l34' => $l34, 'l56' => $l56,
|
|
'l13' => $l13, 'l35' => $l35, 'l57' => $l57,
|
|
'l14' => $l14, 'l36' => $l36, 'l58' => $l58,
|
|
'l15' => $l15, 'l37' => $l37, 'l59' => $l59,
|
|
'l16' => $l16, 'l38' => $l38, 'l60' => $l60,
|
|
'l17' => $l17, 'l39' => $l39, 'l61' => $l61,
|
|
'l18' => $l18, 'l40' => $l40, 'l62' => $l62,
|
|
'l19' => $l19, 'l41' => $l41, 'sub1' => $sub1,
|
|
'l20' => $l20, 'l42' => $l42, 'sub2' => $sub2,
|
|
];
|
|
$this->load->view('cetak/excel_labarugi', $data);
|
|
}
|
|
|
|
public function get_count_kuncineraca() { // Informasi = [71]
|
|
$id_setdata = $this->Informasi->getID_SetdataMax();
|
|
$id_setdata = $id_setdata[0]['ID_SETDATA'];
|
|
|
|
$datSetdata = $this->Informasi->getData_Setdata_byID($id_setdata);
|
|
|
|
//Aktiva Lancar
|
|
$pembelian = $this->Informasi->getCount_Pembelian_Not1($datSetdata[0]['TGL_SETDATA']);
|
|
$kasbank = $this->Informasi->getCount_Kasbank_Null($datSetdata[0]['TGL_SETDATA']);
|
|
|
|
$data = array(
|
|
'pem' => $pembelian,
|
|
'kb' => $kasbank,
|
|
);
|
|
$this->output_json($data);
|
|
}
|
|
|
|
//Controller Untuk Absensi Karyawan
|
|
public function dataAbsensi_All_A1() { // Informasi = [73]
|
|
$datKaryawan = $this->Informasi->getData_Karyawan_byID();
|
|
$kondisi = $this->input->post('kondisi');
|
|
|
|
if ($kondisi==NULL) {
|
|
$all = 0;
|
|
$absensi = NULL;
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$dataKaryawan = $this->Informasi->getData_Karyawan_byID($id_karyawan);
|
|
$nama_panggilan = $dataKaryawan[0]['NAMA_PANGGILAN_KARYAWAN'];
|
|
$title = "$nama_panggilan";
|
|
$datPab = $this->Informasi->getData_PeriodeAbsensi_orderDESC_limit1();
|
|
$awal = $datPab[1]['AWAL_PAB'];
|
|
$akhir = $datPab[1]['AKHIR_PAB'];
|
|
$tgl_awal = date_format(date_create($awal), "d/m/Y");
|
|
$tgl_akhir = date_format(date_create($akhir), "d/m/Y");
|
|
} else {
|
|
$all = 1;
|
|
$id_karyawan = $this->input->post('id_karyawan');
|
|
$awal = $this->input->post('awal');
|
|
$akhir = $this->input->post('akhir');
|
|
if ($awal<"2022-12-26") {
|
|
$awal = "2022-12-26";
|
|
}
|
|
if ($akhir<"2022-12-26") {
|
|
$akhir = "2022-12-26";
|
|
}
|
|
$tgl_awal = date_format(date_create($awal), "d/m/Y");
|
|
$tgl_akhir = date_format(date_create($akhir), "d/m/Y");
|
|
$dataKaryawan = $this->Informasi->getData_Karyawan_byID($id_karyawan);
|
|
$nama_panggilan = $dataKaryawan[0]['NAMA_PANGGILAN_KARYAWAN'];
|
|
$title = "$nama_panggilan";
|
|
}
|
|
|
|
$diffawal = new DateTime($awal);
|
|
$diffakhir = new DateTime($akhir);
|
|
$diff = date_diff($diffawal, $diffakhir);
|
|
$diff = $diff->format("%a");
|
|
|
|
$tgl_check = $awal;
|
|
$count8 = 0;
|
|
$count9 = 0;
|
|
$absensi = [];
|
|
for ($i=0; $i<=$diff; $i++) {
|
|
//Cek Bukan Hari Minggu
|
|
$day_check = date_format(date_create($tgl_check), "l");
|
|
|
|
//Cek Bukan Hari Libur
|
|
$datShl = $this->Informasi->getData_SetHariLibur_byTGL($tgl_check);
|
|
|
|
if ($day_check=="Sunday") {
|
|
$tgl_check = $this->Informasi->addTempoDay($tgl_check, 1);
|
|
} else if (strtotime($tgl_check)>=strtotime($awal) AND strtotime($tgl_check)<=strtotime($akhir) AND $datShl==FALSE) {
|
|
$datAbsensi = $this->Informasi->getData_Absensi_byKARYAWAN_byTGL($id_karyawan, $tgl_check);
|
|
if ($datAbsensi==NULL) {
|
|
$absensi[$i] = [
|
|
'TGL' => $tgl_check,
|
|
'TANGGAL' => date_format(date_create($tgl_check), "d/m/Y"),
|
|
'LIBUR' => '0',
|
|
'SHL' => NULL,
|
|
'JAM_MASUK' => NULL,
|
|
'JAM_KELUAR' => NULL,
|
|
'TELAT' => '8',
|
|
];
|
|
$tgl_check = $this->Informasi->addTempoDay($tgl_check, 1);
|
|
$count8++;
|
|
} else {
|
|
$absensi[$i] = [
|
|
'TGL' => $tgl_check,
|
|
'TANGGAL' => date_format(date_create($tgl_check), "d/m/Y"),
|
|
'LIBUR' => '0',
|
|
'SHL' => NULL,
|
|
'JAM_MASUK' => $datAbsensi[0]['JAM_MASUK'],
|
|
'JAM_KELUAR' => $datAbsensi[0]['JAM_KELUAR'],
|
|
'TELAT' => $datAbsensi[0]['TELAT'],
|
|
];
|
|
$tgl_check = $this->Informasi->addTempoDay($tgl_check, 1);
|
|
}
|
|
} else if (strtotime($tgl_check)>=strtotime($awal) AND strtotime($tgl_check)<=strtotime($akhir) AND $datShl==TRUE) {
|
|
$absensi[$i] = [
|
|
'TGL' => $tgl_check,
|
|
'TANGGAL' => date_format(date_create($tgl_check), "d/m/Y"),
|
|
'LIBUR' => '1',
|
|
'SHL' => $datShl[0]['NAMA_SHL'],
|
|
'JAM_MASUK' => NULL,
|
|
'JAM_KELUAR' => NULL,
|
|
'TELAT' => '9',
|
|
];
|
|
$tgl_check = $this->Informasi->addTempoDay($tgl_check, 1);
|
|
$count9++;
|
|
}
|
|
}
|
|
|
|
$count1 = $this->Informasi->getCount_Absensi_byKARYAWAN_status1($id_karyawan, $awal, $akhir);
|
|
$count2 = $this->Informasi->getCount_Absensi_byKARYAWAN_status2($id_karyawan, $awal, $akhir);
|
|
$count3 = $this->Informasi->getCount_Absensi_byKARYAWAN_status3($id_karyawan, $awal, $akhir);
|
|
$count4 = $this->Informasi->getCount_Absensi_byKARYAWAN_status4($id_karyawan, $awal, $akhir);
|
|
$count5 = $this->Informasi->getCount_Absensi_byKARYAWAN_status5($id_karyawan, $awal, $akhir);
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'absensi' => $absensi,
|
|
'karyawan' => $datKaryawan,
|
|
'title' => $title,
|
|
'all' => $all,
|
|
'id_karyawan' => $id_karyawan,
|
|
'awal' => $awal,
|
|
'akhir' => $akhir,
|
|
'tgl_awal' => $tgl_awal,
|
|
'tgl_akhir' => $tgl_akhir,
|
|
'count1' => $count1,
|
|
'count2' => $count2,
|
|
'count3' => $count3,
|
|
'count4' => $count4,
|
|
'count5' => $count5,
|
|
'count8' => $count8,
|
|
'count9' => $count9
|
|
];
|
|
$this->load->view('proses/InformasiAbsensi_All_A1', $data);
|
|
}
|
|
|
|
public function dataStokDatang_All_A1() { // Informasi = [76]
|
|
$tgl_akhir = date('Y-m-d');
|
|
$tgl_awal = $this->Informasi->subTempoDay($tgl_akhir, 14);
|
|
$awal = date_format(date_create($tgl_awal), "d/m/Y");
|
|
$akhir = date_format(date_create($tgl_akhir), "d/m/Y");
|
|
|
|
$datInformasi = $this->Informasi->getData_HistoriKuantiti_PembelianOnly($tgl_awal, $tgl_akhir);
|
|
|
|
$no = 0;
|
|
foreach ($datInformasi as $key) {
|
|
$datHq = $this->Informasi->getData_HistoriKuantiti_byKODEBUKTI($key['KODE_BUKTI']);
|
|
$datInformasi[$no++] += ['HQ' => $datHq];
|
|
}
|
|
|
|
$data = [
|
|
'sidebar' => "dashboard",
|
|
'navChild' => "",
|
|
'informasi' => $datInformasi,
|
|
'awal' => $awal,
|
|
'akhir' => $akhir,
|
|
];
|
|
$this->load->view('proses/InformasiStokDatang_All_A1', $data);
|
|
}
|
|
|
|
} |