1352 lines
38 KiB
PHP
1352 lines
38 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 ManageKasKeluar extends CI_Controller
|
|
{
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('ModelKasKeluar', 'MKK');
|
|
$this->load->model('ModelKas', 'MB');
|
|
$this->load->model('ModelKendaraan', 'MK');
|
|
$this->load->model('ModelKas', 'MKas');
|
|
$this->load->model('ModelKaryawan', 'MKy');
|
|
$this->load->model('ModelNeraca', 'MN');
|
|
$this->load->model('ModelPajak', 'MP');
|
|
$this->load->model('ModelPelanggan', 'MPe');
|
|
$this->load->model('ModelSupplier', 'MS');
|
|
$this->load->model('ModelTp', 'MT');
|
|
$this->load->library(['datatables', 'form_validation']);
|
|
$this->form_validation->set_error_delimiters('', '');
|
|
}
|
|
public function output_json($data, $encode = true)
|
|
{
|
|
if ($encode) $data = json_encode($data);
|
|
$this->output->set_content_type('application/json')->set_output($data);
|
|
}
|
|
public function index()
|
|
{
|
|
|
|
$datKasKeluar = $this->MKK->getDataKasKeluar();
|
|
$datKas = $this->MB->getDataKas();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'kaskeluar'=> $datKasKeluar,
|
|
'kas' => $datKas
|
|
];
|
|
|
|
$this->load->view('proses/KasKeluar', $data);
|
|
}
|
|
|
|
public function save()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id = $this->input->post('id_kaskeluar');
|
|
$id_kas = $this->input->post('id_kas');
|
|
$kredit_kaskeluar = $this->input->post('kredit_kaskeluar');
|
|
$kode_kaskeluar = $this->kodeKasKeluar();
|
|
|
|
$input = [
|
|
'KODE_KASKELUAR' => $kode_kaskeluar,
|
|
'KAS_ID' => $id_kas,
|
|
'KREDIT_KASKELUAR' => $kredit_kaskeluar,
|
|
'BLOCKCON' => '0'
|
|
];
|
|
|
|
$action = $this->MKK->create('kaskeluar', $input);
|
|
|
|
if ($action) {
|
|
$this->session->set_flashdata('flash', 'ditambah');
|
|
redirect('ManageKasKeluar');
|
|
} else {
|
|
$this->session->set_flashdata('flashgagal', 'ditambah');
|
|
redirect('ManageKasKeluar');
|
|
}
|
|
|
|
}
|
|
|
|
public function edit()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_kaskeluar = $this->input->post('id_kaskeluar');
|
|
$id_kas = $this->input->post('id_kased');
|
|
$kredit_kaskeluar = $this->input->post('kredit_kaskeluared');
|
|
|
|
$update = [
|
|
'KAS_ID' => $id_kas,
|
|
'KREDIT_KASKELUAR' => $kredit_kaskeluar
|
|
];
|
|
|
|
$update = $this->MKK->update('kaskeluar', $update, 'ID_KASKELUAR', $id_kaskeluar);
|
|
|
|
if ($update) {
|
|
$this->session->set_flashdata('flash', 'diedit');
|
|
redirect('ManageKasKeluar');
|
|
} else {
|
|
$this->session->set_flashdata('flashgagal', 'diedit');
|
|
redirect('ManageKasKeluar');
|
|
}
|
|
}
|
|
|
|
public function hapus()
|
|
{
|
|
$id = $this->input->post('id');
|
|
|
|
$actionkaskeluar = $this->MKK->delRelasi($id);
|
|
$action = $this->MKK->delete('kaskeluar',$id,'ID_KASKELUAR');
|
|
|
|
$this->session->set_flashdata('flash', 'dihapus');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
|
|
public function tambahRelasi($id)
|
|
{
|
|
$relasi = $this->MKK->getKasKeluarRelasi($id);
|
|
$title = $this->MKK->getKodeKreditKasKeluar($id);
|
|
$kredit = $this->MKK->getDebitTotal($id);
|
|
$neraca = $this->MN->getDataNeraca();
|
|
$neracabiaya = $this->MN->getDataNeracaBiaya();
|
|
$neracahutang = $this->MN->getDataNeracaHutang();
|
|
$neracapiutang = $this->MN->getDataNeracaPiutang();
|
|
$kas = $this->MB->getDataKas();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'relasi' => $relasi,
|
|
'id_kaskeluar' => $id,
|
|
'title1' => $title[0]['KODE_KASKELUAR'],
|
|
'title2' => $title[0]['DEBIT'],
|
|
'title3' => $title[0]['KREDIT'],
|
|
'neraca' => $neraca,
|
|
'nerbiaya' => $neracabiaya,
|
|
'nerhutang' => $neracahutang,
|
|
'nerpiutang' => $neracapiutang,
|
|
'kas' => $kas
|
|
];
|
|
|
|
$this->load->view('proses/Relasi', $data);
|
|
}
|
|
|
|
public function saverelasi()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_relasi = $this->input->post('id');
|
|
$id_kaskeluar = $this->input->post('id_kaskeluar');
|
|
$type_relasi = $this->input->post('type_relasi');
|
|
$kode_relasi = $this->kodeRelasi();
|
|
|
|
$inputrelasi = [
|
|
'KREDIT_ID' => $id_kaskeluar,
|
|
'TYPE_RELASI' => $type_relasi,
|
|
'TYPE_KASBANK' => "Kas Keluar",
|
|
'KODE_RELASI' => $kode_relasi
|
|
];
|
|
|
|
$actionrelasi = $this->MKK->create('relasi', $inputrelasi);
|
|
|
|
if ($actionrelasi) {
|
|
$this->session->set_flashdata('flashtyperelasi', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashtyperelasigagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
|
|
}
|
|
|
|
public function tambahbiaya()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_neraca = $this->input->post('id_neraca');
|
|
$debit_relasi = $this->input->post('debit_relasi');
|
|
$keterangan_relasi = $this->input->post('keterangan_relasi');
|
|
|
|
//Step Ambil Data Lama
|
|
$blockcon = $this->MKK->getBlockconKasKeluar($id_relasi);
|
|
$id_kaskeluar = $blockcon[0]['ID_KASKELUAR'];
|
|
$nominal = $blockcon[0]['BLOCKCON'];
|
|
$nominalbaru = $nominal+$debit_relasi;
|
|
$updatekaskeluar = [
|
|
'BLOCKCON' => $nominalbaru
|
|
];
|
|
$actionkaskeluar = $this->MKK->update('kaskeluar', $updatekaskeluar, 'ID_KASKELUAR', $id_kaskeluar);
|
|
|
|
//Step Update Data
|
|
$inputrelasi = [
|
|
'NERACA_ID' => $id_neraca,
|
|
'DEBIT_RELASI' => $debit_relasi,
|
|
'KETERANGAN_RELASI' => $keterangan_relasi
|
|
];
|
|
|
|
$actionrelasi = $this->MKK->update('relasi', $inputrelasi, 'ID_RELASI', $id_relasi);
|
|
|
|
if ($actionrelasi) {
|
|
$this->session->set_flashdata('flashrelasi', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashrelasigagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function tambahhutang()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_neraca = $this->input->post('id_neraca');
|
|
$debit_relasi = $this->input->post('debit_relasi');
|
|
$keterangan_relasi = $this->input->post('keterangan_relasi');
|
|
|
|
//Step Ambil Data Lama
|
|
$blockcon = $this->MBM->getBlockconKasKeluar($id_relasi);
|
|
$id_kaskeluar = $blockcon[0]['ID_KASMASUK'];
|
|
$nominal = $blockcon[0]['BLOCKCON'];
|
|
$nominalbaru = $nominal+$debit_relasi;
|
|
$updatekaskeluar = [
|
|
'BLOCKCON' => $nominalbaru
|
|
];
|
|
$actionkaskeluar = $this->MKK->update('kaskeluar', $updatekaskeluar, 'ID_KASKELUAR', $id_kaskeluar);
|
|
|
|
//Step Update Data
|
|
$inputrelasi = [
|
|
'NERACA_ID' => $id_neraca,
|
|
'DEBIT_RELASI' => $debit_relasi,
|
|
'KETERANGAN_RELASI' => $keterangan_relasi
|
|
];
|
|
|
|
$actionrelasi = $this->MKK->update('relasi', $inputrelasi, 'ID_RELASI', $id_relasi);
|
|
|
|
if ($actionrelasi) {
|
|
$this->session->set_flashdata('flashrelasi', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashrelasigagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function tambahpiutang()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_neraca = $this->input->post('id_neraca');
|
|
$debit_relasi = $this->input->post('debit_relasi');
|
|
$keterangan_relasi = $this->input->post('keterangan_relasi');
|
|
|
|
//Step Ambil Data Lama
|
|
$blockcon = $this->MBM->getBlockconKasKeluar($id_relasi);
|
|
$id_kaskeluar = $blockcon[0]['ID_KASKELUAR'];
|
|
$nominal = $blockcon[0]['BLOCKCON'];
|
|
$nominalbaru = $nominal+$debit_relasi;
|
|
$updatekaskeluar = [
|
|
'BLOCKCON' => $nominalbaru
|
|
];
|
|
$actionkaskeluar = $this->MKK->update('kaskeluar', $updatekaskeluar, 'ID_KASKELUAR', $id_kaskeluar);
|
|
|
|
//Step Update Data
|
|
$inputrelasi = [
|
|
'NERACA_ID' => $id_neraca,
|
|
'DEBIT_RELASI' => $debit_relasi,
|
|
'KETERANGAN_RELASI' => $keterangan_relasi
|
|
];
|
|
|
|
$actionrelasi = $this->MKK->update('relasi', $inputrelasi, 'ID_RELASI', $id_relasi);
|
|
|
|
if ($actionrelasi) {
|
|
$this->session->set_flashdata('flashrelasi', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashrelasigagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function editbiaya()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_neraca = $this->input->post('id_neracaed');
|
|
$debit_relasi = $this->input->post('debit_relasied');
|
|
$keterangan_relasi = $this->input->post('keterangan_relasied');
|
|
|
|
//Step Ambil Data Lama
|
|
$blockcon = $this->MBM->getBlockconKasKeluar($id_relasi);
|
|
$id_kaskeluar = $blockcon[0]['ID_KASKELUAR'];
|
|
$nominal = $blockcon[0]['BLOCKCON'];
|
|
$debit = $blockcon[0]['DEBIT_RELASI'];
|
|
$nominalbaru = $nominal-$debit;
|
|
$updatekaskeluar = [
|
|
'BLOCKCON' => $nominalbaru
|
|
];
|
|
$actionkaskeluar = $this->MKK->update('kaskeluar', $updatekaskeluar, 'ID_KASKELUAR', $id_kaskeluar);
|
|
$actionlink = $this->MKK->delLink($id_relasi);
|
|
|
|
//Step Ambil Data Baru
|
|
$blockcon = $this->MKK->getBlockconKasKeluar($id_relasi);
|
|
$id_kaskeluar = $blockcon[0]['ID_KASKELUAR'];
|
|
$nominal = $blockcon[0]['BLOCKCON'];
|
|
$nominalbaru = $nominal+$debit_relasi;
|
|
$updatekaskeluar= [
|
|
'BLOCKCON' => $nominalbaru
|
|
];
|
|
$actionkaskeluar = $this->MKK->update('kaskeluar', $updatekaskeluar, 'ID_KASKELUAR', $id_kaskeluar);
|
|
|
|
$updaterelasi = [
|
|
'NERACA_ID' => $id_neraca,
|
|
'DEBIT_RELASI' => $debit_relasi,
|
|
'KETERANGAN_RELASI' => $keterangan_relasi
|
|
];
|
|
|
|
$actionrelasi = $this->MKK->update('relasi', $updaterelasi, 'ID_RELASI', $id_relasi);
|
|
|
|
if ($actionrelasi) {
|
|
$this->session->set_flashdata('flashrelasi', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashrelasigagal', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function edithutang()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_neraca = $this->input->post('id_neracaed');
|
|
$debit_relasi = $this->input->post('debit_relasied');
|
|
$keterangan_relasi = $this->input->post('keterangan_relasied');
|
|
|
|
//Step Ambil Data Lama
|
|
$blockcon = $this->MBM->getBlockconKasKeluar($id_relasi);
|
|
$id_kaskeluar = $blockcon[0]['ID_KASKELUAR'];
|
|
$nominal = $blockcon[0]['BLOCKCON'];
|
|
$debit = $blockcon[0]['DEBIT_RELASI'];
|
|
$nominalbaru = $nominal-$debit;
|
|
$updatekaskeluar = [
|
|
'BLOCKCON' => $nominalbaru
|
|
];
|
|
$actionkaskeluar = $this->MKK->update('kaskeluar', $updatekaskeluar, 'ID_KASKELUAR', $id_kaskeluar);
|
|
$actionlink = $this->MKK->delLink($id_relasi);
|
|
|
|
//Step Ambil Data Baru
|
|
$blockcon = $this->MKK->getBlockconKasKeluar($id_relasi);
|
|
$id_kaskeluar = $blockcon[0]['ID_KASKELUAR'];
|
|
$nominal = $blockcon[0]['BLOCKCON'];
|
|
$nominalbaru = $nominal+$debit_relasi;
|
|
$updatekaskeluar = [
|
|
'BLOCKCON' => $nominalbaru
|
|
];
|
|
$actionkaskeluar = $this->MKK->update('kaskeluar', $updatekaskeluar, 'ID_KASKELUAR', $id_kaskeluar);
|
|
|
|
$updaterelasi = [
|
|
'NERACA_ID' => $id_neraca,
|
|
'DEBIT_RELASI' => $debit_relasi,
|
|
'KETERANGAN_RELASI' => $keterangan_relasi
|
|
];
|
|
|
|
$actionrelasi = $this->MKK->update('relasi', $updaterelasi, 'ID_RELASI', $id_relasi);
|
|
|
|
if ($actionrelasi) {
|
|
$this->session->set_flashdata('flashrelasi', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashrelasigagal', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function editpiutang()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_neraca = $this->input->post('id_neracaed');
|
|
$debit_relasi = $this->input->post('debit_relasied');
|
|
$keterangan_relasi = $this->input->post('keterangan_relasied');
|
|
|
|
//Step Ambil Data Lama
|
|
$blockcon = $this->MKK->getBlockconKasKeluar($id_relasi);
|
|
$id_kaskeluar = $blockcon[0]['ID_KASKELUAR'];
|
|
$nominal = $blockcon[0]['BLOCKCON'];
|
|
$debit = $blockcon[0]['DEBIT_RELASI'];
|
|
$nominalbaru = $nominal-$debit;
|
|
$updatekaskeluar = [
|
|
'BLOCKCON' => $nominalbaru
|
|
];
|
|
$actionkaskeluar = $this->MKK->update('kaskeluar', $updatekaskeluar, 'ID_KASKELUAR', $id_kaskeluar);
|
|
$actionlink = $this->MKK->delLink($id_relasi);
|
|
|
|
//Step Ambil Data Baru
|
|
$blockcon = $this->MKK->getBlockconKasKeluar($id_relasi);
|
|
$id_kaskeluar = $blockcon[0]['ID_KASKELUAR'];
|
|
$nominal = $blockcon[0]['BLOCKCON'];
|
|
$nominalbaru = $nominal+$debit_relasi;
|
|
$updatekaskeluar = [
|
|
'BLOCKCON' => $nominalbaru
|
|
];
|
|
$actionkaskeluar = $this->MKK->update('kaskeluar', $updatekaskeluar, 'ID_KASKELUAR', $id_kaskeluar);
|
|
|
|
$updaterelasi = [
|
|
'NERACA_ID' => $id_neraca,
|
|
'DEBIT_RELASI' => $debit_relasi,
|
|
'KETERANGAN_RELASI' => $keterangan_relasi
|
|
];
|
|
|
|
$actionrelasi = $this->MKK->update('relasi', $updaterelasi, 'ID_RELASI', $id_relasi);
|
|
|
|
if ($actionrelasi) {
|
|
$this->session->set_flashdata('flashrelasi', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashrelasigagal', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function hapusrelasi()
|
|
{
|
|
$id = $this->input->post('id');
|
|
|
|
//Step Ambil Data Lama
|
|
$blockcon = $this->MKK->getBlockconKasKeluar($id);
|
|
$id_kaskeluar = $blockcon[0]['ID_KASKELUAR'];
|
|
$nominal = $blockcon[0]['BLOCKCON'];
|
|
$debit = $blockcon[0]['DEBIT_RELASI'];
|
|
$nominalbaru = $nominal-$debit;
|
|
$updatekaskeluar = [
|
|
'BLOCKCON' => $nominalbaru
|
|
];
|
|
$actionkaskeluar = $this->MKK->update('kaskeluar', $updatekaskeluar, 'ID_KASKELUAR', $id_kaskeluar);
|
|
|
|
//Step Hapus Data
|
|
$actionrelasi = $this->MKK->delLink($id);
|
|
$action = $this->MKK->delete('relasi',$id,'ID_RELASI');
|
|
|
|
$this->session->set_flashdata('flashrelasi', 'dihapus');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
|
|
public function tambahLink($id)
|
|
{
|
|
$link = $this->MKK->getRelasiLink($id);
|
|
$title = $this->MKK->getKodeDebitRelasi($id);
|
|
$kas = $this->MB->getDataKas();
|
|
$karyawan = $this->MKy->getDataKaryawan();
|
|
$bank = $this->MB->getDataBank();
|
|
$kendaraan = $this->MK->getDataKendaraan();
|
|
$pajak = $this->MP->getDataPajak();
|
|
$pelanggan = $this->MPe->getDataPelanggan();
|
|
$tp = $this->MT->getDataTp();
|
|
$supplier = $this->MS->getDataSupplier();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'link' => $link,
|
|
'id_relasi' => $id,
|
|
'title1' => $title[0]['KODE_RELASI'],
|
|
'title2' => $title[0]['DEBIT'],
|
|
'title3' => $title[0]['TARGET1_ID'],
|
|
'bank' => $bank,
|
|
'karyawan' => $karyawan,
|
|
'kas' => $kas,
|
|
'kendaraan' => $kendaraan,
|
|
'pajak' => $pajak,
|
|
'pelanggan' => $pelanggan,
|
|
'tp' => $tp,
|
|
'supplier' => $supplier
|
|
];
|
|
|
|
$this->load->view('proses/Link', $data);
|
|
}
|
|
|
|
public function tambahLinkBank($id)
|
|
{
|
|
$link = $this->MKK->getRelasiLinkBank($id);
|
|
$title = $this->MKK->getKodeDebitRelasi($id);
|
|
$bank = $this->MB->getDataBank();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'link' => $link,
|
|
'id_relasi' => $id,
|
|
'title1' => $title[0]['KODE_RELASI'],
|
|
'title2' => $title[0]['DEBIT'],
|
|
'title3' => $title[0]['TARGET1_ID'],
|
|
'kas' => $kas
|
|
];
|
|
|
|
$this->load->view('proses/LinkKas', $data);
|
|
}
|
|
|
|
public function tambahLinkKaryawan($id)
|
|
{
|
|
$link = $this->MKK->getRelasiLinkKaryawan($id);
|
|
$title = $this->MKK->getKodeDebitRelasi($id);
|
|
$karyawan = $this->MKy->getDataKaryawan();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'link' => $link,
|
|
'id_relasi' => $id,
|
|
'title1' => $title[0]['KODE_RELASI'],
|
|
'title2' => $title[0]['DEBIT'],
|
|
'title3' => $title[0]['TARGET1_ID'],
|
|
'karyawan' => $karyawan
|
|
];
|
|
|
|
$this->load->view('proses/LinkKaryawan', $data);
|
|
}
|
|
|
|
public function tambahLinkKas($id)
|
|
{
|
|
$link = $this->MKK->getRelasiLinkKas($id);
|
|
$title = $this->MKK->getKodeDebitRelasi($id);
|
|
$kas = $this->MKas->getDataKas();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'link' => $link,
|
|
'id_relasi' => $id,
|
|
'title1' => $title[0]['KODE_RELASI'],
|
|
'title2' => $title[0]['DEBIT'],
|
|
'title3' => $title[0]['TARGET1_ID'],
|
|
'kas' => $kas
|
|
];
|
|
|
|
$this->load->view('proses/LinkKas', $data);
|
|
}
|
|
|
|
public function tambahLinkKendaraan($id)
|
|
{
|
|
$link = $this->MKK->getRelasiLinkKendaraan($id);
|
|
$title = $this->MKK->getKodeDebitRelasi($id);
|
|
$kendaraan = $this->MK->getDataKendaraan();
|
|
$karyawan = $this->MKy->getDataKaryawan();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'link' => $link,
|
|
'id_relasi' => $id,
|
|
'title1' => $title[0]['KODE_RELASI'],
|
|
'title2' => $title[0]['DEBIT'],
|
|
'title3' => $title[0]['TARGET1_ID'],
|
|
'kendaraan' => $kendaraan,
|
|
'karyawan' => $karyawan
|
|
];
|
|
|
|
$this->load->view('proses/LinkKendaraan', $data);
|
|
}
|
|
|
|
public function tambahLinkPajak($id)
|
|
{
|
|
$link = $this->MKK->getRelasiLinkPajak($id);
|
|
$title = $this->MKK->getKodeDebitRelasi($id);
|
|
$pajak = $this->MP->getDataPajak();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'link' => $link,
|
|
'id_relasi' => $id,
|
|
'title1' => $title[0]['KODE_RELASI'],
|
|
'title2' => $title[0]['DEBIT'],
|
|
'title3' => $title[0]['TARGET1_ID'],
|
|
'pajak' => $pajak
|
|
];
|
|
|
|
$this->load->view('proses/LinkPajak', $data);
|
|
}
|
|
|
|
public function tambahLinkPelanggan($id)
|
|
{
|
|
$link = $this->MKK->getRelasiLinkPelanggan($id);
|
|
$title = $this->MKK->getKodeDebitRelasi($id);
|
|
$pelanggan = $this->MPe->getDataPelanggan();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'link' => $link,
|
|
'id_relasi' => $id,
|
|
'title1' => $title[0]['KODE_RELASI'],
|
|
'title2' => $title[0]['DEBIT'],
|
|
'title3' => $title[0]['TARGET1_ID'],
|
|
'pelanggan' => $pelanggan
|
|
];
|
|
|
|
$this->load->view('proses/LinkPelanggan', $data);
|
|
}
|
|
|
|
public function tambahLinkPihakKe3($id)
|
|
{
|
|
$link = $this->MKK->getRelasiLinkPihakKe3($id);
|
|
$title = $this->MKK->getKodeDebitRelasi($id);
|
|
$tp = $this->MT->getDataTp();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'link' => $link,
|
|
'id_relasi' => $id,
|
|
'title1' => $title[0]['KODE_RELASI'],
|
|
'title2' => $title[0]['DEBIT'],
|
|
'title3' => $title[0]['TARGET1_ID'],
|
|
'tp' => $tp
|
|
];
|
|
|
|
$this->load->view('proses/LinkPihakKe3', $data);
|
|
}
|
|
|
|
public function tambahLinkSupplier($id)
|
|
{
|
|
$link = $this->MBM->getRelasiLinkSupplier($id);
|
|
$title = $this->MBM->getKodeDebitRelasi($id);
|
|
$supplier = $this->MS->getDataSupplier();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'link' => $link,
|
|
'id_relasi' => $id,
|
|
'title1' => $title[0]['KODE_RELASI'],
|
|
'title2' => $title[0]['DEBIT'],
|
|
'title3' => $title[0]['TARGET1_ID'],
|
|
'supplier' => $supplier
|
|
];
|
|
|
|
$this->load->view('proses/LinkSupplier', $data);
|
|
}
|
|
|
|
public function savelink()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$type_link = $this->input->post('type_link');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TYPE_LINK' => $type_link,
|
|
'KODE_LINK' => $kode_link
|
|
];
|
|
|
|
$actionlink = $this->MKK->create('link', $inputlink);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashtypelink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashtypelinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
|
|
}
|
|
|
|
public function tambahkas()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_kas = $this->input->post('id_kas');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_kas,
|
|
'KODE_LINK' => $kode_link,
|
|
'TYPE_LINK' => "Kas",
|
|
];
|
|
|
|
$actionlink = $this->MKK->create('link', $inputlink);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function tambahkaryawan()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_karyawan = $this->input->post('id_karyawan');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_karyawan,
|
|
'KODE_LINK' => $kode_link,
|
|
'TYPE_LINK' => "Karyawan",
|
|
];
|
|
|
|
$actionlink = $this->MKK->create('link', $inputlink);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function tambahkas()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_kas = $this->input->post('id_kas');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_kas,
|
|
'KODE_LINK' => $kode_link,
|
|
'TYPE_LINK' => "Kas",
|
|
];
|
|
|
|
$actionlink = $this->MKK->create('link', $inputlink);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function tambahkendaraan()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_kendaraan = $this->input->post('id_kendaraan');
|
|
$id_karyawan = $this->input->post('id_karyawan');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_kendaraan,
|
|
'TARGET2_ID' => $id_karyawan,
|
|
'KODE_LINK' => $kode_link,
|
|
'TYPE_LINK' => "Kendaraan",
|
|
];
|
|
|
|
$actionlink = $this->MKK->create('link', $inputlink);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function tambahpajak()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_pajak = $this->input->post('id_pajak');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_pajak,
|
|
'KODE_LINK' => $kode_link,
|
|
'TYPE_LINK' => "Pajak",
|
|
];
|
|
|
|
$actionlink = $this->MKK->create('link', $inputlink);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function tambahpelanggan()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_pelanggan = $this->input->post('id_pelanggan');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_pelanggan,
|
|
'KODE_LINK' => $kode_link,
|
|
'TYPE_LINK' => "Pelanggan",
|
|
];
|
|
|
|
$actionlink = $this->MKK->create('link', $inputlink);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function tambahpihakke3()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_tp = $this->input->post('id_tp');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_tp,
|
|
'KODE_LINK' => $kode_link,
|
|
'TYPE_LINK' => "Pihak Ke3",
|
|
];
|
|
|
|
$actionlink = $this->MKK->create('link', $inputlink);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function tambahsupplier()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_supplier = $this->input->post('id_supplier');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_supplier,
|
|
'KODE_LINK' => $kode_link,
|
|
'TYPE_LINK' => "Supplier",
|
|
];
|
|
|
|
$actionlink = $this->MKK->create('link', $inputlink);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function linkkas()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_kas = $this->input->post('id_kas');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_kas,
|
|
'KODE_LINK' => $kode_link
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $inputlink,'ID_LINK',$id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function linkkaryawan()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_karyawan = $this->input->post('id_karyawan');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_karyawan,
|
|
'KODE_LINK' => $kode_link
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $inputlink,'ID_LINK',$id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function linkkas()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_kas = $this->input->post('id_kas');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_kas,
|
|
'KODE_LINK' => $kode_link
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $inputlink,'ID_LINK',$id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function linkkendaraan()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_kendaraan = $this->input->post('id_kendaraan');
|
|
$id_karyawan = $this->input->post('id_karyawan');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_kendaraan,
|
|
'TARGET2_ID' => $id_karyawan,
|
|
'KODE_LINK' => $kode_link
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $inputlink,'ID_LINK',$id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function linkpajak()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_pajak = $this->input->post('id_pajak');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_pajak,
|
|
'KODE_LINK' => $kode_link
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $inputlink,'ID_LINK',$id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function linkpelanggan()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_pelanggan = $this->input->post('id_pelanggan');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_pelanggan,
|
|
'KODE_LINK' => $kode_link
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $inputlink,'ID_LINK',$id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function linkpihakke3()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_tp = $this->input->post('id_tp');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_tp,
|
|
'KODE_LINK' => $kode_link
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $inputlink,'ID_LINK',$id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function linksupplier()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_relasi = $this->input->post('id_relasi');
|
|
$id_supplier = $this->input->post('id_supplier');
|
|
$kode_link = $this->kodeLink();
|
|
|
|
$inputlink = [
|
|
'RELASI_ID' => $id_relasi,
|
|
'TARGET1_ID' => $id_supplier,
|
|
'KODE_LINK' => $kode_link
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $inputlink,'ID_LINK',$id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'ditambah');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function editkas()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_kas = $this->input->post('id_kased');
|
|
|
|
$updatelink = [
|
|
'TARGET1_ID' => $id_kas
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $updatelink, 'ID_LINK', $id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function editkaryawan()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_karyawan = $this->input->post('id_karyawaned');
|
|
|
|
$updatelink = [
|
|
'TARGET1_ID' => $id_karyawan
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $updatelink, 'ID_LINK', $id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function editkas()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_kas = $this->input->post('id_kased');
|
|
|
|
$updatelink = [
|
|
'TARGET1_ID' => $id_kas
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $updatelink, 'ID_LINK', $id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function editkendaraan()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_kendaraan = $this->input->post('id_kendaraaned');
|
|
$id_karyawan = $this->input->post('id_karyawaned');
|
|
|
|
$updatelink = [
|
|
'TARGET1_ID' => $id_kendaraan,
|
|
'TARGET2_ID' => $id_karyawan
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $updatelink, 'ID_LINK', $id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function editpajak()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_pajak = $this->input->post('id_pajaked');
|
|
|
|
$updatelink = [
|
|
'TARGET1_ID' => $id_pajak
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $updatelink, 'ID_LINK', $id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function editpelanggan()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_pelanggan = $this->input->post('id_pelangganed');
|
|
|
|
$updatelink = [
|
|
'TARGET1_ID' => $id_pelanggan
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $updatelink, 'ID_LINK', $id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function editpihakke3()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_tp = $this->input->post('id_tped');
|
|
|
|
$updatelink = [
|
|
'TARGET1_ID' => $id_tp
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $updatelink, 'ID_LINK', $id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function editsupplier()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_link = $this->input->post('id_link');
|
|
$id_supplier = $this->input->post('id_suppliered');
|
|
|
|
$updatelink = [
|
|
'TARGET1_ID' => $id_supplier
|
|
];
|
|
|
|
$actionlink = $this->MKK->update('link', $updatelink, 'ID_LINK', $id_link);
|
|
|
|
if ($actionlink) {
|
|
$this->session->set_flashdata('flashlink', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
} else {
|
|
$this->session->set_flashdata('flashlinkgagal', 'diedit');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
}
|
|
|
|
public function hapuslink()
|
|
{
|
|
$id = $this->input->post('id');
|
|
|
|
//Step Hapus Data
|
|
$action = $this->MKK->delete('link',$id,'ID_LINK');
|
|
|
|
$this->session->set_flashdata('flashlink', 'dihapus');
|
|
redirect($_SERVER['HTTP_REFERER']);
|
|
}
|
|
|
|
public function kodeKasKeluar()
|
|
{
|
|
$km = $this->MKK->getMaxKasKeluar();
|
|
$id_kaskeluar = $km[0]['ID_KASKELUAR'];
|
|
$kk = $this->MKK->getKodeKasKeluar($id_kaskeluar);
|
|
if (is_array($kk) || is_object($kk)) {
|
|
foreach ($kk as $row) {
|
|
if ($row['ID_KASMASUK'] == null) {
|
|
return "BKK/000001";
|
|
} else {
|
|
$str = (string) $row['KODE_KASKELUAR'];
|
|
$panjang = 6;
|
|
$data = substr($str, 4, $panjang);
|
|
|
|
$ko = (int) $data + 1;
|
|
$str = (string) $ko;
|
|
|
|
$panjang = 10 - strlen($str);
|
|
$data = "BKK/000000";
|
|
$data = substr($data, 0, $panjang) . $str;
|
|
return $data;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public function kodeRelasi()
|
|
{
|
|
$km = $this->MKK->getMaxRelasi();
|
|
$id_relasi = $km[0]['ID_RELASI'];
|
|
$kk = $this->MKK->getKodeRelasi($id_relasi);
|
|
if (is_array($kk) || is_object($kk)) {
|
|
foreach ($kk as $row) {
|
|
if ($row['KODE_RELASI'] == null) {
|
|
return "REL/000001";
|
|
} else {
|
|
$str = (string) $row['KODE_RELASI'];
|
|
$panjang = 6;
|
|
$data = substr($str, 4, $panjang);
|
|
|
|
$ko = (int) $data + 1;
|
|
$str = (string) $ko;
|
|
|
|
$panjang = 10 - strlen($str);
|
|
$data = "REL/000000";
|
|
$data = substr($data, 0, $panjang) . $str;
|
|
return $data;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public function kodeLink()
|
|
{
|
|
$km = $this->MKK->getMaxLink();
|
|
$id_link = $km[0]['ID_LINK'];
|
|
$kk = $this->MKK->getKodeLink($id_link);
|
|
if (is_array($kk) || is_object($kk)) {
|
|
foreach ($kk as $row) {
|
|
if ($row['KODE_LINK'] == null) {
|
|
return "LIN/000001";
|
|
} else {
|
|
$str = (string) $row['KODE_LINK'];
|
|
$panjang = 6;
|
|
$data = substr($str, 4, $panjang);
|
|
|
|
$ko = (int) $data + 1;
|
|
$str = (string) $ko;
|
|
|
|
$panjang = 10 - strlen($str);
|
|
$data = "LIN/000000";
|
|
$data = substr($data, 0, $panjang) . $str;
|
|
return $data;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public function konfirmasi()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_kaskeluar = $this->input->post('id_kaskeluar');
|
|
|
|
$update = [
|
|
'STATUS_KASKELUAR' => "KASBANK SUDAH PROSES"
|
|
];
|
|
|
|
$action = $this->MKK->update('kaskeluar', $update, 'ID_KASKELUAR', $id_kaskeluar);
|
|
|
|
if ($action) {
|
|
$this->session->set_flashdata('flash', 'dikonfirmasi');
|
|
redirect('ManageKasKeluar');
|
|
} else {
|
|
$this->session->set_flashdata('flashgagal', 'dikonfirmasi');
|
|
redirect('ManageKasKeluar');
|
|
}
|
|
|
|
}
|
|
|
|
}
|