Exemplo n.º 1
0
						var r_hari_telat = 0;
				    	}else{
				    	var difference_ms = Math.abs(date1_ms - date2_ms);
						var r_hari_telat = Math.round(difference_ms/ONE_DAY);
						}
						var valtelat = Math.round(r_hari_telat/30);
						//Dengan kondisi jika (Bulan Catat - Bulan Jatuh Tempo) > 24 maka 24 else (Bulan Catat - Bulan Jatuh Tempo) 									
						if (valtelat>24){
							valtelat = 24;
						}
						//alert("TELAT "+valtelat+" BULAN");
						var dasar = parseFloat($('#dasar').autoNumeric('get'));
						var tarif = parseFloat($('#tarif').autoNumeric('get'));
						var denda = parseFloat($('#denda').autoNumeric('get'));
						var pad_bunga = <?php 
echo pad_bunga();
?>
 ;
						var denda = valtelat*(pad_bunga/100) * (dasar * tarif);																										
																						
						//$('#denda').autoNumeric('set', denda);
						$('#denda').autoNumeric('set', 0); //jangan muncul
						var pesantelat = 'Terlambat : ' + valtelat+' Bulan ( ' + pad_bunga*valtelat + ' % )';
						$('#pesantelat').html(pesantelat);
			 break;
		}
	}

	function set_jatuh_tempo() {
		var masadari = masadari_dtp.date;
		//var masasd = masasd_dtp.date;
Exemplo n.º 2
0
 function cetak()
 {
     $type = $this->uri->segment(4);
     $qs = urldecode($_SERVER['QUERY_STRING']);
     parse_str($qs, $qs_data);
     $params = array();
     // foreach ($qs_data as $key => $val)
     // $params[$key] = $val;
     $sptpd = $this->load->model('sptpd_model')->get($this->input->get('id'));
     $sspd = $this->load->model('sspd_model')->get_by_spt($this->input->get('id'));
     $cu = $this->load->model('objek_pajak_model')->get($sptpd->customer_usaha_id);
     $report = $this->load->model('report_model')->get_report($cu->usaha_id, $sptpd->type_id);
     // $bayar = $sptpd->pajak_terhutang+$sspd->bunga;
     // $bayar = ($sptpd->pajak_terhutang-$sptpd->bunga)+$sspd->bunga;
     $bayar = $sspd->jml_bayar;
     switch ($this->input->get('rpt')) {
         case 'sspd':
             $rpt = $report->sspdnm;
             $params = array('spt_id' => intval($sptpd->id));
             break;
         case 'validasi':
             $rpt = 'validasi_00';
             $params = array('spt_id' => intval($sptpd->id));
             break;
     }
     $params = array_merge($params, array("alamat" => pad_pemda_alamat(), "telp" => pad_pemda_telp(), "fax" => pad_pemda_fax(), "website" => pad_pemda_website(), "email" => pad_pemda_email(), "alamat_lengkap" => pad_pemda_alamat_lengkap(), "terbilang" => strtoupper(terbilang($bayar)), "pad_bunga" => (double) pad_bunga(), "daerah" => pad_pemda_daerah(), "dinas" => pad_pemda_nama(), "logo" => base_url('assets/img/logorpt__.jpg')));
     $rpt = $rpt;
     // $rpt = $this->module.'/'.$rpt;
     $jasper = $this->load->library('Jasper');
     echo $jasper->cetak($rpt, $params, $type, false);
 }
Exemplo n.º 3
0
 public function proses_sspd_old()
 {
     $this->load_auth();
     if (!$this->module_auth->create) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_create);
         redirect(active_module_url($this->controller));
     }
     $spt_id = $this->uri->segment(4);
     $prosestgl = $this->uri->segment(5);
     if ($spt_id && ($sptpd = $this->sptpd_model->get($spt_id))) {
         //koreksi dari AA supaya pajak_terhutang - bunga (menghindari bunga berbunga)
         $pajak = (int) $sptpd->pajak_terhutang;
         $pokok = $pajak - (int) $sptpd->bunga;
         $denda = hit_denda($pokok, pad_bunga() * 100, $sptpd->jatuhtempotgl, $prosestgl);
         $bunga = round($denda->denda + $sptpd->bunga);
         $nbln = $denda->bulan;
         $jml_bayar = $pokok + $bunga;
         date_default_timezone_set("Asia/Jakarta");
         $sspdno = $this->sspd_model->generate_sspdno(pad_tahun_anggaran());
         $post_data = array('spt_id' => $spt_id, 'sspdno' => $sspdno, 'tahun' => pad_tahun_anggaran(), 'sspdtgl' => date('Y-m-d', strtotime($prosestgl)), 'sspdjam' => date('H:i:s'), 'jml_bayar' => $jml_bayar, 'bunga' => $bunga, 'bulan_telat' => (int) $nbln, 'is_valid' => 1, 'enabled' => 1, 'created' => date('Y-m-d'), 'create_uid' => sipkd_user_id());
         if ($this->sspd_model->save($post_data)) {
             // update stat pembayaran spt
             $this->db->where('id', $spt_id);
             $this->db->update('pad_spt', array('status_pembayaran' => 1));
         }
         echo "ok";
     } else {
         echo "hmm";
     }
 }
Exemplo n.º 4
0
		selisih_masa = bulan_sekarang - month;
	    }
	    else if(selisih_tahun == 1){
		selisih_masa = bulan_sekarang + (12-month);
	    }
	    else if(selisih_tahun == 2){
		selisih_masa = bulan_sekarang + (12-month) + 12;
	    }
	    else {
		selisih_masa = bulan_sekarang + (12-month) + 24;
	    }

		var pajak      = parseFloat($('#pajak_calculated').autoNumeric('get'));
		if(selisih_masa>=24){selisih_masa=24;};
		var bunga = <?php 
echo pad_bunga() / 100;
?>
;
		denda=pajak*bunga*selisih_masa;
		//document.getElementById('denda').value = denda
		$('#denda').autoNumeric('set', denda);
		$('#pesandenda').html('(Terlambat ' + selisih_masa + ' Bulan)');
		$('#pajak').autoNumeric('set', pajak + denda);
		//hitung_pajak() ;
		//var denda      = parseFloat($('#denda').autoNumeric('get'));
		//total_bayar	= denda + pajak  ;
		//$('#total_bayar').autoNumeric('set', total_bayar);
	}


function get_pajak(cu_id) {
Exemplo n.º 5
0
 public function post()
 {
     if (!$this->module_auth->create) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_create);
         redirect(active_module_url('penerimaan'));
     }
     $spt_id = $this->uri->segment(4);
     $terima_id = $this->uri->segment(5);
     $sptpd = $this->sptpd_model->get($spt_id);
     if ($terima_id && $spt_id && $sptpd) {
         // hitung bunga (telat bayar)
         $tgl_proses = new DateTime(Date('Y-m-d'));
         $tgl_jtempo = new DateTime(Date('Y-m-d', strtotime($sptpd->jatuhtempotgl)));
         $diff = $tgl_proses->diff($tgl_jtempo);
         $nbln = $diff->format('%y') * 12 + $diff->format('%m');
         $nbln = $tgl_proses <= $tgl_jtempo ? 0 : $nbln;
         $nbln = $nbln > 24 ? 24 : $nbln;
         $pajak = $sptpd->pajak_terhutang;
         $bunga = (double) $pajak * (int) $nbln * (double) pad_bunga() + (double) $sptpd->bunga;
         // end hitung bunga
         $terimano = $this->penerimaan_model->max_terimano(pad_tahun_anggaran());
         $jmlterima = (double) $sptpd->pajak_terhutang + (double) $bunga;
         // terima line - rek pajak
         $update_data = array('terima_id' => $terima_id, 'spt_id' => $spt_id, 'rekening_id' => $sptpd->rekening_id, 'pajak_id' => $sptpd->pajak_id, 'amount' => $sptpd->pajak_terhutang, 'enabled' => 1, 'created' => date('Y-m-d'), 'create_uid' => sipkd_user_id());
         $this->penerimaan_model->save2($update_data);
         // terima line - rek denda (bunga)
         if ($bunga > 0) {
             $update_data = array('terima_id' => $terima_id, 'spt_id' => $spt_id, 'rekening_id' => $this->load->model('pajak_model')->get_rek_denda($sptpd->pajak_id), 'pajak_id' => $sptpd->pajak_id, 'amount' => $bunga, 'enabled' => 1, 'created' => date('Y-m-d'), 'create_uid' => sipkd_user_id());
             $this->penerimaan_model->save2($update_data);
         }
         // update setoran
         $terima_id = $this->penerimaan_model->get_terima_id_by_spt($spt_id);
         $new_setoran = $this->penerimaan_model->update_setoran($terima_id);
         echo $new_setoran;
     } else {
         echo "hmm";
     }
 }
Exemplo n.º 6
0
 public function get_validasi()
 {
     $this->load_auth();
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     $this->session->set_userdata('mode', 'edit');
     $p_usaha_id = $this->uri->segment(4);
     $p_type_id = $this->uri->segment(5);
     $p_id = $this->uri->segment(6);
     $this->session->set_userdata('usaha_id', $p_usaha_id);
     $sptpd = $this->sptpd_model->get($p_id);
     $tglinput = date('Y-m-d', strtotime($sptpd->created));
     /*
     if ($tglinput < date('Y-m-d')) {
         $this->session->set_flashdata('msg_warning', 'Aktivitas Edit diperbolehkan hanya dalam waktu 1 hari');
         redirect(active_module_url($this->controller));
     }
     */
     $data['current'] = $this->module;
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("{$this->controller}/update/{$p_usaha_id}/{$p_type_id}/{$p_id}");
     if ($p_id && ($get = $this->sptpd_model->get($p_id))) {
         $data['dt']['id'] = $get->id;
         $data['dt']['customer_usaha_id'] = $get->customer_usaha_id;
         $data['dt']['pajak_id'] = $get->pajak_id;
         $data['dt']['tahun'] = $get->tahun;
         $data['dt']['sptno'] = $get->sptno;
         $data['dt']['terimanip'] = $get->terimanip;
         $data['dt']['terimatgl'] = date('d-m-Y', strtotime($get->terimatgl));
         $data['dt']['kirimtgl'] = date('d-m-Y', strtotime($get->kirimtgl));
         $data['dt']['type_id'] = $get->type_id;
         $data['dt']['so'] = $get->so;
         $data['dt']['masadari'] = date('d-m-Y', strtotime($get->masadari));
         $data['dt']['masapajak_bulan'] = date('M-Y', strtotime($get->masadari));
         $masapajak_bulan = date('M-Y', strtotime($get->masadari));
         $data['dt']['jatuhtempotgl'] = date('d-m-Y', strtotime('-1 day', strtotime($data['dt']['masadari'])));
         $data['dt']['masasd'] = date('d-m-Y', strtotime($get->masasd));
         $data['dt']['minimal_omset'] = $get->minimal_omset;
         $data['dt']['dasar'] = $get->dasar;
         $data['dt']['pajak'] = $get->pajak_terhutang;
         $data['dt']['tarif'] = $get->tarif;
         if ($p_usaha_id == pad_air_tanah_id() || $p_usaha_id == pad_reklame_id()) {
             $data['dt']['denda'] = $get->denda;
             $data['dt']['bunga'] = $get->bunga;
         } else {
             $data['dt']['denda'] = 0;
             $data['dt']['bunga'] = 0;
         }
         $data['dt']['setoran'] = $get->setoran;
         $data['dt']['kenaikan'] = $get->kenaikan;
         $data['dt']['kompensasi'] = $get->kompensasi;
         $data['dt']['lain2'] = $get->lain2;
         $data['dt']['air_manfaat_id'] = $get->air_manfaat_id;
         $data['dt']['air_zona_id'] = $get->air_zona_id;
         $data['dt']['meteran_awal'] = $get->meteran_awal;
         $data['dt']['meteran_akhir'] = $get->meteran_akhir;
         $data['dt']['r_bayarid'] = $get->r_bayarid;
         $data['dt']['r_tarifid'] = $get->r_tarifid;
         $data['dt']['enabled'] = $get->enabled;
         $data['dt']['unit_id'] = $get->unit_id;
         $data['dt']['customer_id'] = $get->customer_id;
         $data['dt']['isprint_dc'] = $get->isprint_dc;
         $data['dt']['notes'] = $get->notes;
         $data['dt']['rekening_id'] = $get->rekening_id;
         $data['dt']['cara_bayar'] = $get->cara_bayar;
         $bulan_telat = $get->bulan_telat;
         if (wp_login()) {
             // data tambahan
             //
         }
         $data['dt']['nopd'] = $this->load->model('objek_pajak_model')->get_nopd($get->customer_usaha_id);
         $options = array();
         $js = 'id="customer_usaha_id" class="input-xlarge" ';
         $data['select_usaha'] = form_dropdown('customer_usaha_id', $options, null, $js);
         $select_data = $this->load->model('pajak_model')->get_select($get->pajak_id);
         $options = array();
         foreach ($select_data as $rows) {
             $options[$rows->id] = $rows->nama;
             if ($rows->id == $get->pajak_id) {
                 $nama_pajak = $rows->nama;
             }
         }
         $js = 'id="pajak_id" class="input-xxlarge"';
         $data['select_pajak'] = form_dropdown('pajak_id', $options, $get->pajak_id, $js);
         $select_data = $this->load->model('sptpd_type_model')->get_select();
         $options = array();
         foreach ($select_data as $rows) {
             $options[$rows->id] = $rows->typenm;
         }
         $js = 'id="type_id" class="input-small" onChange="void(0);"';
         $data['select_sptpd_type'] = form_dropdown('type_id', $options, $get->type_id, $js);
         $select_data = array((object) array('id' => 2, 'cara_bayar' => 'ATM / TELLER'), (object) array('id' => 1, 'cara_bayar' => 'TRANSFER'));
         $cara_bayar = '';
         if ($select_data) {
             foreach ($select_data as $row) {
                 if ($row->id == $data['dt']['cara_bayar']) {
                     $cara_bayar .= "<option value={$row->id} selected >{$row->cara_bayar}</option>";
                 } else {
                     $cara_bayar .= "<option value={$row->id}>{$row->cara_bayar}</option>";
                 }
             }
         }
         $trmtgl = (new DateTime($data['dt']['terimatgl']))->format('Y-m-d');
         $masadari = (new DateTime($data['dt']['masadari']))->format('Y-m-d');
         $jtptgl = (new DateTime($data['dt']['jatuhtempotgl']))->format('Y-m-d');
         $val_data = $this->sptpd_model->get($p_id);
         $val_data->id = $data['dt']['id'];
         $val_data->masapajak_bulan = $masapajak_bulan;
         $val_data->nama_pajak = $nama_pajak;
         $val_data->cara_bayar = $cara_bayar;
         $val_data->pajak = $data['dt']['pajak'];
         $val_data->ijintgl_view = $data['dt']['terimatgl'];
         $val_data->persen_bunga = pad_bunga();
         $val_data->jatuhtempotgl_view = date('d-m-Y', strtotime($data['dt']['jatuhtempotgl']));
         $val_data->terimatgl_view = date('d-m-Y', strtotime($data['dt']['terimatgl']));
         $val_data->masadari_view = date('d-m-Y', strtotime($data['dt']['masadari']));
         if ($p_usaha_id == pad_reklame_id()) {
             if (strtotime($trmtgl) > strtotime($jtptgl)) {
                 $query = $this->db->query("select hit_jdendarek_real('{$val_data->jatuhtempotgl_view}','{$val_data->terimatgl_view}') as bulan_telat");
                 foreach ($query->result() as $row) {
                     $val_data->bulan_telat = $row->bulan_telat;
                     $bulan_telat_real = $row->bulan_telat;
                 }
                 //cari interval
                 $query = $this->db->query("SELECT date '{$jtptgl}' + interval '{$bulan_telat_real} months' as jatuhtempo_rek_new");
                 foreach ($query->result() as $row) {
                     $newjtp = $row->jatuhtempo_rek_new;
                 }
                 $val_data->jatuhtempotgl_rek = $newjtp;
                 $val_data->jatuhtempotgl_rek_view = date('d-m-Y', strtotime($newjtp));
                 if ($bulan_telat_real > 24) {
                     $val_data->bulan_telat = 24;
                 }
                 $val_data->new_denda = round($val_data->dasar * $val_data->tarif * (pad_bunga() / 100) * $val_data->bulan_telat);
                 $val_data->pajak = round($val_data->dasar * $val_data->tarif + $val_data->new_denda);
             } else {
                 $val_data->jatuhtempotgl_rek = $data['dt']['jatuhtempotgl'];
                 $val_data->jatuhtempotgl_rek_view = date('d-m-Y', strtotime($data['dt']['jatuhtempotgl']));
                 $val_data->bulan_telat = 0;
                 $val_data->new_denda = 0;
                 $val_data->pajak = round($val_data->dasar * $val_data->tarif + $val_data->new_denda);
             }
             $this->session->set_userdata('masadari_temp', $masadari);
         } else {
             if ($p_usaha_id == pad_air_tanah_id()) {
                 $query = $this->db->query("select hit_jdendaat('{$val_data->masadari_view}','{$val_data->terimatgl_view}') as bulan_telat");
                 foreach ($query->result() as $row) {
                     $val_data->bulan_telat = $row->bulan_telat;
                 }
                 $val_data->new_denda = round($val_data->dasar * $val_data->tarif * (pad_bunga() / 100) * $val_data->bulan_telat);
                 $val_data->pajak = round($val_data->dasar * $val_data->tarif + $val_data->new_denda);
                 $this->session->set_userdata('masadari_temp', $masadari);
             }
         }
         echo json_encode($val_data);
         $pajak_detail = $this->load->model('pad_model');
         if ($row = $pajak_detail->sptpd_get_pajak_detail($get->pajak_id, $get->terimatgl, 0)) {
             $data['dt']['rekening_id'] = $row->rekening_id;
             $data['dt']['kode'] = $row->kode;
             $data['dt']['jatuhtempo'] = $row->jatuhtempo;
             $data['dt']['multiple'] = $row->multiple;
         }
         if ($p_usaha_id == pad_reklame_id() && $p_type_id == pad_dok_office_id()) {
             //
         } else {
             if ($p_usaha_id == pad_air_tanah_id() && $p_type_id == pad_dok_office_id()) {
                 //
             } else {
             }
         }
     } else {
         show_404();
     }
 }
Exemplo n.º 7
0
 public function proses_stpd()
 {
     $this->load_auth();
     if (!$this->module_auth->create) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_create);
         redirect(active_module_url($this->controller));
     }
     $spt_id = $this->uri->segment(4);
     $petugas_id = $this->uri->segment(5);
     $pejabat_id = $this->uri->segment(6);
     if ($spt_id && ($sptpd = $this->sptpd_model->get($spt_id))) {
         // hitung bunga (telat bayar)
         $tgl_proses = new DateTime(Date('Y-m-d'));
         $tgl_jtempo = new DateTime(Date('Y-m-d', strtotime($sptpd->jatuhtempotgl)));
         $new_tgl_jtempo = $tgl_jtempo;
         $diff = $tgl_proses->diff($tgl_jtempo);
         $nbln = $diff->format('%y') * 12 + $diff->format('%m');
         $nbln = $tgl_proses <= $tgl_jtempo ? 0 : $nbln;
         $nbln = $nbln > 24 ? 24 : $nbln;
         $pajak = $sptpd->pajak_terhutang;
         $bunga = (double) $pajak * (int) $nbln * (double) pad_bunga() + (double) $sptpd->bunga;
         // end hitung bunga
         $usaha_id = $this->load->model('pad_model')->sptpd_get_usaha_id($sptpd->customer_usaha_id);
         $jth_tempo = $this->load->model('pajak_model')->get_jatuhtempo($usaha_id);
         if ($nbln > 0) {
             if ($jth_tempo > 0) {
                 $new_tgl_jtempo = $tgl_jtempo->modify("+{$nbln} month");
             } else {
                 $xbln = 2 + (int) $nbln;
                 $new_tgl_jtempo = $tgl_jtempo->modify("+{$xbln} month");
                 $new_tgl_jtempo = $new_tgl_jtempo->modify("-1 day");
             }
         } else {
             if ($jth_tempo > 0) {
                 $new_tgl_jtempo = $tgl_jtempo->modify("+30 day");
             } else {
                 $xbln = 2;
                 $new_tgl_jtempo = $tgl_jtempo->modify("+{$xbln} month");
                 $new_tgl_jtempo = $new_tgl_jtempo->modify("-1 day");
             }
         }
         while ($new_tgl_jtempo <= $tgl_proses) {
             if ($jth_tempo > 0) {
                 $new_tgl_jtempo = $tgl_jtempo->modify("+30 day");
             } else {
                 $xbln = 2;
                 $new_tgl_jtempo = $tgl_jtempo->modify("+{$xbln} month");
                 $new_tgl_jtempo = $new_tgl_jtempo->modify("-1 day");
             }
         }
         $stpdno = $this->stpd_model->generate_stpdno(pad_tahun_anggaran());
         $update_data = array('stpdno' => $stpdno, 'tahun' => pad_tahun_anggaran(), 'stpdtgl' => date_format($tgl_proses, 'Y-m-d'), 'jatuhtempotgl' => date_format($new_tgl_jtempo, 'Y-m-d'), 'stpdcount' => $nbln + 1, 'bunga' => $this->session->userdata('denda'), 'spt_id' => $spt_id, 'petugas_id' => $petugas_id, 'pejabat_id' => $pejabat_id, 'enabled' => 1, 'created' => date('Y-m-d h:i:s'), 'create_uid' => sipkd_user_id());
         $this->stpd_model->save($update_data);
         //$this->db->query("update pad_invoice set status_bayar = 3 where id=$spt_id");
         //$this->db->query("update pad_invoice set status_bayar = 2 where id=$spt_id");
         echo "ok";
         $this->session->set_userdata('denda', 0);
     } else {
         echo "hmm";
         $this->session->set_userdata('denda', 0);
     }
 }