copy dari repo om Irfan
This commit is contained in:
@@ -0,0 +1,643 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelBankKeluar extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Step One, Input Bank Keluar
|
||||
public function getDataBankKeluar($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bk c','c.BANKKELUAR_ID=a.ID_BANKKELUAR','left');
|
||||
$this->db->group_by('a.ID_BANKKELUAR');
|
||||
$this->db->where('a.STATUS_BANKKELUAR is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bk c','c.BANKKELUAR_ID=a.ID_BANKKELUAR','left');
|
||||
$this->db->group_by('a.ID_BANKKELUAR');
|
||||
$this->db->where('a.STATUS_BANKKELUAR is NULL');
|
||||
$this->db->where(['a.ID_BANKKELUAR' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBankKeluarRev($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKKELUAR,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bk c','c.BANKKELUAR_ID=a.ID_BANKKELUAR','left');
|
||||
$this->db->group_by('a.ID_BANKKELUAR');
|
||||
$this->db->where('a.STATUS_BANKKELUAR="0"');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKKELUAR,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bk c','c.BANKKELUAR_ID=a.ID_BANKKELUAR','left');
|
||||
$this->db->group_by('a.ID_BANKKELUAR');
|
||||
$this->db->where('a.STATUS_BANKKELUAR="0"');
|
||||
$this->db->where(['a.ID_BANKKELUAR' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeBankKeluar() {
|
||||
$this->db->select('MAX(KODE_BANKKELUAR) AS KODE');
|
||||
$this->db->from('bankkeluar');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function hapusKasbankBK($id){
|
||||
$this->db->where(['BANKKELUAR_ID' => $id]);
|
||||
$this->db->delete('kasbank_bk');
|
||||
}
|
||||
|
||||
//Step Two, Input Transaksi
|
||||
public function getDataKasbankBK($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKKELUAR,2)) as DEBITALL,CONCAT("Rp ",FORMAT(c.NOMINAL_KBBK,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bk c','c.BANKKELUAR_ID=a.ID_BANKKELUAR');
|
||||
$this->db->join('perkiraan d','d.ID_PERKIRAAN=c.PERKIRAAN_ID','left');
|
||||
$this->db->group_by('c.ID_KBBK');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKKELUAR,2)) as DEBITALL,CONCAT("Rp ",FORMAT(c.NOMINAL_KBBK,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bk c','c.BANKKELUAR_ID=a.ID_BANKKELUAR');
|
||||
$this->db->join('perkiraan d','d.ID_PERKIRAAN=c.PERKIRAAN_ID','left');
|
||||
$this->db->where(['a.ID_BANKKELUAR' => $id]);
|
||||
$this->db->group_by('c.ID_KBBK');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleBK($id) {
|
||||
$this->db->select('KODE_BANKKELUAR,CONCAT("Rp ",FORMAT(DEBIT_BANKKELUAR,2)) as DEBIT,CONCAT("Rp ",FORMAT(KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar');
|
||||
$this->db->where(['ID_BANKKELUAR' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeKasbankBK() {
|
||||
$this->db->select('MAX(KODE_KBBK) AS KODE');
|
||||
$this->db->from('kasbank_bk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getID_KBBK() {
|
||||
$this->db->select('MAX(ID_KBBK) AS KODE');
|
||||
$this->db->from('kasbank_bk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDebitData($id) {
|
||||
$this->db->select('a.DEBIT_BANKKELUAR,a.ID_BANKKELUAR,b.NOMINAL_KBBK');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('kasbank_bk b','b.BANKKELUAR_ID=a.ID_BANKKELUAR');
|
||||
$this->db->where(['b.ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Three, Input Detail
|
||||
public function getTitleKBBK($id) {
|
||||
$this->db->select('KODE_KBBK,BANKKELUAR_ID,CONCAT("Rp ",FORMAT(NOMINAL_KBBK,2)) as DEBIT');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKBBK($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, KAS
|
||||
public function getSaldoKAS($id) {
|
||||
$this->db->select('SALDO_KAS');
|
||||
$this->db->from('kas');
|
||||
$this->db->where(['ID_KAS' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKAS($id) {
|
||||
$this->db->select('b.SALDO_KAS,b.ID_KAS');
|
||||
$this->db->from('detail_kas a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->where(['ID_DKAS' => $id]);
|
||||
$this->db->group_by('ID_DKAS');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailKAS() {
|
||||
$this->db->select('MAX(KODE_DKAS) AS KODE');
|
||||
$this->db->from('detail_kas');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDKAS() {
|
||||
$this->db->select_max('ID_DKAS');
|
||||
$this->db->from('detail_kas');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDKASID($id) {
|
||||
$this->db->select('DKAS_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, BANK
|
||||
public function getSaldoBANK($id) {
|
||||
$this->db->select('SALDO_BANK');
|
||||
$this->db->from('bank');
|
||||
$this->db->where(['ID_BANK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBANK($id) {
|
||||
$this->db->select('b.SALDO_BANK,b.ID_BANK');
|
||||
$this->db->from('detail_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->where(['ID_DBANK' => $id]);
|
||||
$this->db->group_by('ID_DBANK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailBANK() {
|
||||
$this->db->select('MAX(KODE_DBANK) AS KODE');
|
||||
$this->db->from('detail_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBANK() {
|
||||
$this->db->select_max('ID_DBANK');
|
||||
$this->db->from('detail_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBANKID($id) {
|
||||
$this->db->select('DBANK_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, DP Pembelian
|
||||
public function getSaldoDPB($id) {
|
||||
$this->db->select('SALDO_SUPPLIER');
|
||||
$this->db->from('supplier');
|
||||
$this->db->where(['ID_SUPPLIER' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataSUP($id) {
|
||||
$this->db->select('b.SALDO_SUPPLIER,b.ID_SUPPLIER');
|
||||
$this->db->from('dp_pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->where(['ID_DPB' => $id]);
|
||||
$this->db->group_by('ID_DPB');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDPB() {
|
||||
$this->db->select('MAX(KODE_DPB) AS KODE');
|
||||
$this->db->from('dp_pembelian');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPB() {
|
||||
$this->db->select_max('ID_DPB');
|
||||
$this->db->from('dp_pembelian');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPBID($id) {
|
||||
$this->db->select('DPB_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, DP Pajak
|
||||
public function getSaldoDPP($id) {
|
||||
$this->db->select('SALDO_PAJAK');
|
||||
$this->db->from('pajak');
|
||||
$this->db->where(['ID_PAJAK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPAJ($id) {
|
||||
$this->db->select('b.SALDO_PAJAK,b.ID_PAJAK');
|
||||
$this->db->from('dp_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->where(['ID_DPP' => $id]);
|
||||
$this->db->group_by('ID_DPP');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDPP() {
|
||||
$this->db->select('MAX(KODE_DPP) AS KODE');
|
||||
$this->db->from('dp_pajak');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPP() {
|
||||
$this->db->select_max('ID_DPP');
|
||||
$this->db->from('dp_pajak');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPPID($id) {
|
||||
$this->db->select('DPP_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Piutang Karyawan
|
||||
public function getKodePiutangKARYAWAN() {
|
||||
$this->db->select('MAX(KODE_PKAR) AS KODE');
|
||||
$this->db->from('piutang_karyawan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPiutangKARYAWAN($id) {
|
||||
$this->db->select('HUTANG_KARYAWAN');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDPKAR() {
|
||||
$this->db->select_max('ID_PKAR');
|
||||
$this->db->from('piutang_karyawan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPKAR($id) {
|
||||
$this->db->select('b.HUTANG_KARYAWAN,b.ID_KARYAWAN');
|
||||
$this->db->from('piutang_karyawan a');
|
||||
$this->db->join('karyawan b','b.ID_KARYAWAN=a.KARYAWAN_ID','left');
|
||||
$this->db->where(['ID_PKAR' => $id]);
|
||||
$this->db->group_by('ID_PKAR');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPKARID($id) {
|
||||
$this->db->select('PKAR_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Piutang Pihak Ke3
|
||||
public function getKodePiutangPIHAKKE3() {
|
||||
$this->db->select('MAX(KODE_PPI) AS KODE');
|
||||
$this->db->from('piutang_pihakke3');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPiutangPIHAKKE3($id) {
|
||||
$this->db->select('HUTANG_PIHAKKE3');
|
||||
$this->db->from('pihakke3');
|
||||
$this->db->where(['ID_PIHAKKE3' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDPPI() {
|
||||
$this->db->select_max('ID_PPI');
|
||||
$this->db->from('piutang_pihakke3');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPPI($id) {
|
||||
$this->db->select('b.HUTANG_PIHAKKE3,b.ID_PIHAKKE3');
|
||||
$this->db->from('piutang_pihakke3 a');
|
||||
$this->db->join('pihakke3 b','b.ID_PIHAKKE3=a.PIHAKKE3_ID','left');
|
||||
$this->db->where(['ID_PPI' => $id]);
|
||||
$this->db->group_by('ID_PPI');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPPIID($id) {
|
||||
$this->db->select('PPI_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Hutang Dagang
|
||||
public function getKodeDetailHDA() {
|
||||
$this->db->select('MAX(KODE_DHDA) AS KODE');
|
||||
$this->db->from('detail_hda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHDA() {
|
||||
$this->db->select_max('ID_DHDA');
|
||||
$this->db->from('detail_hda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconHDA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('hutang_dagang');
|
||||
$this->db->where(['ID_HDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDHDAID($id) {
|
||||
$this->db->select('DHDA_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHDA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_HDA,a.KREDIT_DHDA,d.PIUTANG_SUPPLIER,d.ID_SUPPLIER');
|
||||
$this->db->from('detail_hda a');
|
||||
$this->db->join('hutang_dagang b','b.ID_HDA=a.HDA_ID','left');
|
||||
$this->db->join('pembelian c','c.ID_PEMBELIAN=b.PEMBELIAN_ID','left');
|
||||
$this->db->join('supplier d','d.ID_SUPPLIER=c.SUPPLIER_ID','left');
|
||||
$this->db->where(['a.ID_DHDA' => $id]);
|
||||
$this->db->group_by('a.ID_DHDA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Hutang Pajak
|
||||
public function getKodeDetailHPA() {
|
||||
$this->db->select('MAX(KODE_DHPA) AS KODE');
|
||||
$this->db->from('detail_hpa');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHPA() {
|
||||
$this->db->select_max('ID_DHPA');
|
||||
$this->db->from('detail_hpa');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconHPA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('hutang_pajak');
|
||||
$this->db->where(['ID_HPA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDHPAID($id) {
|
||||
$this->db->select('DHPA_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHPA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_HPA,a.KREDIT_DHPA,c.HUTANG_PAJAK,c.ID_PAJAK');
|
||||
$this->db->from('detail_hpa a');
|
||||
$this->db->join('hutang_pajak b','b.ID_HPA=a.HPA_ID','left');
|
||||
$this->db->join('pajak c','c.ID_PAJAK=b.PAJAK_ID','left');
|
||||
$this->db->where(['a.ID_DHPA' => $id]);
|
||||
$this->db->group_by('a.ID_DHPA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Hutang Bank
|
||||
public function getKodeDetailHBA() {
|
||||
$this->db->select('MAX(KODE_DHBA) AS KODE');
|
||||
$this->db->from('detail_hba');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHBA() {
|
||||
$this->db->select_max('ID_DHBA');
|
||||
$this->db->from('detail_hba');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconHBA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('hutang_bank');
|
||||
$this->db->where(['ID_HBA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDHBAID($id) {
|
||||
$this->db->select('DHBA_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHBA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_HBA,a.KREDIT_DHBA,c.HUTANG_BANK,c.SALDO_BANK,c.ID_BANK');
|
||||
$this->db->from('detail_hba a');
|
||||
$this->db->join('hutang_bank b','b.ID_HBA=a.HBA_ID','left');
|
||||
$this->db->join('bank c','c.ID_BANK=b.BANK_ID','left');
|
||||
$this->db->where(['a.ID_DHBA' => $id]);
|
||||
$this->db->group_by('a.ID_DHBA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Hutang Lain
|
||||
public function getKodeDetailHLA() {
|
||||
$this->db->select('MAX(KODE_DHLA) AS KODE');
|
||||
$this->db->from('detail_hla');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHLA() {
|
||||
$this->db->select_max('ID_DHLA');
|
||||
$this->db->from('detail_hla');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconHLA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('hutang_lain');
|
||||
$this->db->where(['ID_HLA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDHLAID($id) {
|
||||
$this->db->select('DHLA_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHLA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_HLA,a.KREDIT_DHLA');
|
||||
$this->db->from('detail_hla a');
|
||||
$this->db->join('hutang_lain b','b.ID_HLA=a.HLA_ID','left');
|
||||
$this->db->where(['a.ID_DHLA' => $id]);
|
||||
$this->db->group_by('a.ID_DHLA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Biaya Fee
|
||||
public function getKodeDetailBF() {
|
||||
$this->db->select('MAX(KODE_DBF) AS KODE');
|
||||
$this->db->from('detail_bf');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBF() {
|
||||
$this->db->select_max('ID_DBF');
|
||||
$this->db->from('detail_bf');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconBF($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('biaya_fee');
|
||||
$this->db->where(['ID_BF' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBFID($id) {
|
||||
$this->db->select('DBF_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBF($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_BF,a.KREDIT_DBF');
|
||||
$this->db->from('detail_bf a');
|
||||
$this->db->join('biaya_fee b','b.ID_BF=a.BF_ID','left');
|
||||
$this->db->where(['a.ID_DBF' => $id]);
|
||||
$this->db->group_by('a.ID_DBF');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Biaya Pengiriman
|
||||
public function getKodeDetailBP() {
|
||||
$this->db->select('MAX(KODE_DBP) AS KODE');
|
||||
$this->db->from('detail_bp');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBP() {
|
||||
$this->db->select_max('ID_DBP');
|
||||
$this->db->from('detail_bp');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockkreBP($id) {
|
||||
$this->db->select('BLOCKKRE_BP');
|
||||
$this->db->from('biaya_pengiriman');
|
||||
$this->db->where(['ID_BP' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBPID($id) {
|
||||
$this->db->select('DBP_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBP($id) {
|
||||
$this->db->select('a.KODE_BP,a.ID_BP,b.ID_PENJUALAN,a.NOMINAL_BP,a.BLOCKDEB_BP,a.BLOCKKRE_BP,c.KREDIT_DBP');
|
||||
$this->db->from('biaya_pengiriman a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('detail_bp c','c.BP_ID=a.ID_BP','left');
|
||||
$this->db->where(['c.ID_DBP' => $id]);
|
||||
$this->db->group_by('a.ID_BP');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Biaya Service Kendaraan
|
||||
public function getKodeDetailBSK() {
|
||||
$this->db->select('MAX(KODE_DBSK) AS KODE');
|
||||
$this->db->from('detail_bsk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBSK() {
|
||||
$this->db->select_max('ID_DBSK');
|
||||
$this->db->from('detail_bsk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBSKID($id) {
|
||||
$this->db->select('DBSK_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBSK($id) {
|
||||
$this->db->select('a.KODE_BSK,a.ID_BSK,b.ID_KENDARAAN,a.NOMINAL_BSK');
|
||||
$this->db->from('biaya_sk a');
|
||||
$this->db->join('kendaraan b','b.ID_KENDARAAN=a.KENDARAAN_ID','left');
|
||||
$this->db->where(['a.ID_BSK' => $id]);
|
||||
$this->db->group_by('a.ID_BSK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Biaya Bensin
|
||||
public function getKodeDetailBB() {
|
||||
$this->db->select('MAX(KODE_DBB) AS KODE');
|
||||
$this->db->from('detail_bb');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBB() {
|
||||
$this->db->select_max('ID_DBB');
|
||||
$this->db->from('detail_bb');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBBID($id) {
|
||||
$this->db->select('DBB_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBB($id) {
|
||||
$this->db->select('a.KODE_BB,a.ID_BB,b.ID_KENDARAAN,c.ID_KARYAWAN,a.NOMINAL_BB');
|
||||
$this->db->from('biaya_bensin a');
|
||||
$this->db->join('kendaraan b','b.ID_KENDARAAN=a.KENDARAAN_ID','left');
|
||||
$this->db->join('karyawan c','c.ID_KARYAWAN=a.KARYAWAN_ID','left');
|
||||
$this->db->where(['a.ID_BB' => $id]);
|
||||
$this->db->group_by('a.ID_BB');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user