Strict Standards: Declaration of action_plugin_blog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/blog/action.php on line 13

Strict Standards: Declaration of action_plugin_indexmenu::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/indexmenu/action.php on line 13

Strict Standards: Declaration of action_plugin_importoldchangelog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/importoldchangelog/action.php on line 8

Strict Standards: Declaration of action_plugin_importoldindex::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/importoldindex/action.php on line 8

Strict Standards: Declaration of action_plugin_include::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/include/action.php on line 19

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 208

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 211

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 421

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 594

Strict Standards: Declaration of cache_instructions::retrieveCache() should be compatible with cache::retrieveCache($clean = true) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/cache.php on line 291

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/auth.php on line 154

Strict Standards: Only variables should be passed by reference in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/doku.php on line 73
利息excel [開発チーム]
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/data/cache/a/aa913f6a079488c0e1e52982f4b90f01.code failed
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/data/cache/c/c4bec28da1c3e8751dfebfd7606ab90e.code failed
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/data/cache/d/d711646680e8f1a3fefc577b68ec8b37.code failed

未払利息

http://kabarai.navi-lookup.com/s/tmp/simulator/

=IF($B11=0,0,IF($D11<$G11+$H10,$G11+$H10-$D11,0))
 
if($B11 == 0){
	echo 0;
}else{
	if($D11 < $G11+$H10){
		echo $G11+$H10-$D11;
	}else{
		echo 0;
	}
}

残元金

=IF($B10=0,0,IF($I9<=0,IF($C10>=-($J10+$K9),$I9+$C10+$J10+$K9-$D10,$I9-$D10),IF($D10>=$G10+$H9,$I9+$C10+$G10+$H9-$D10,$I9+$C10)))
 
 
if($B10 == 0){
	echo 0;
}else{
	if($I9 <= 0){
		if($C10 >= -($J10+$K9)){
			echo $I9+$C10+$J10+$K9-$D10;
		}else{
			echo $I9-$D10;
		}
	}else{
		if($D10 >= $G10+$H9){
			echo $I9+$C10+$G10+$H9-$D10;
		}else{
			echo $I9+$C10;
		}
	}
}

利息

=IF(ISERROR(IF($I10<=0,0,TRUNC($I10*$E10*$N11+$I10*$E10*$X11))),0,IF($I10<=0,0,TRUNC($I10*$E10*$N11+$I10*$E10*$X11)))
 
 
if(isError()){
	return 0;
}else{
	if($I10 <= 0){
		echo 0;
	}else{
		//TRUNC($I10*$E10*$N11+$I10*$E10*$X11);	//小数部分を切り捨て
		echo (int)($I10*$E10*$N11+$I10*$E10*$X11);
	}
)
 
 
 
function isError(){
 
/*
	ここで
	$I10
	$E10
	$N11
	$I10
	$E10
	$X11
	を入力チェック
*/
	return false;
 
}

最低入力データ

 
$利率 = 0.18;
$過払利率 = 6;
$初日算入 = 0;
 
$input_data = array(
	array(
		'年月日' => 'H21.3.9',
		'借入金額' => '5000000',
		'弁済額' => 100000,
                '利率' => 0.18;
	),
);
 
<?php
 
 
//ゼロは意味があるので、未入力は空文字で
 
$syojitu = 1;	//1:有効、2:無効
$kabarai_ritu = 6;
 
//入力値
$data = array(
	array(
		'hiduke' => '2009-03-09',
		'syakunyu' => 5000000,
		'hensai' => 100000,
		'riritu' => 0.18,
	),
	array(
		'hiduke' => '2009-03-10',
		'syakunyu' => '',
		'hensai' => 200000,
		'riritu' => '',
	),
);
 
//出力項目
//$output_data = array(
//	array(
//		'hiduke' => '2009-03-09',
//		'syakunyu' => 5000000,
//		'hensai' => 100000,
//		'riritu' => 0.18,
//		'day' => 0,
//		'risoku' =>0,
//		'mibarai_risoku' => 0,
//		'zan' => 0,
//		'kabarai' => 0,
//		'kabarai_zan' => 0,
//	),
//);
 
 
$kk = kabaraiKeisan();
$kk->keisan($syojitu, $kabarai_ritu, $data);
 
 
 
class kabaraiKeisan {
 
	const SYOJITU_ON = 1;	//1:有効
	const SYOJITU_OFF = 2;	//2:無効
 
	function keisan($syojitu, $kabarai_ritu, $data){
 
		if(!count($data)){
			die('データがないよ');
		}
 
 
		//初期値
		$first = current($data);
		$mae_riritu = $first['riritu'];
		$mae_timestump = $first['hiduke'];
 
		$output_data = array();
		foreach ($data as $value ) {
 
			//strtotimeがうまく動けばそっちでもOK
			list($y, $m, $d) = split('-', $value['hiduke']);
			$timestump = mktime(0,0,0,$m,$d,$y);
 
			//利率
			if($value['riritu'] == ""){
				$value['riritu'] = $mae_riritu;
			}
 
			//日数
			$value['day'] = getNissu($timestump, $mae_timestump, $syojitu);
 
			//利息
 
			//未払利息
 
			//残元金
 
			//過払利息
 
			//過払利息残額
 
 
 
			//1つ前ストック
			$mae_timestump = $timestump;
			$mae_riritu = $value['riritu'];
			$mae_day = $value['day'];
 
 
 
			$output_data[] = $value;
 
		}
	}
 
}
 
 
#####################################
	# 日数
	function getDateData($sql_date1,$sql_date2){
 
		$result = strtotime( $sql_date2) - strtotime( $sql_date1);
		$result = intval( $result / ( 24 * 60 * 60));
 
		return $result;
	}
 
	# 利息(日)
	function getLisi($sql_date2,$I9,$C10){
		$y = date("Y",strtotime( $sql_date2));
		$m = 2;
		$d = 29;
		if(checkdate($m, $d, $y)){
			$kinnri_hi = ($I9 * 0.18 + $C10 * 0.18) / 366;
		}else{
			$kinnri_hi = ($I9 * 0.18 + $C10 * 0.18) / 365;
		}
 
		return $kinnri_hi;
	}
 
	# 未払利息
	function getMibaraiLisi($D11,$G11,$H10){
		if($D11 < $G11+$H10){
			return $G11+$H10-$D11;
		}else{
			return 0;
		}
	}

最新 18:32

<?php
 
 
//ゼロは意味があるので、未入力は空文字で
 
$syojitu = 2;	//1:有効、2:無効
$kabarai_ritu = 6;
 
//入力値
$data = array(
	array(
		'hiduke' => '2009-03-09',
		'syakunyu' => 5000000,
		'hensai' => 100000,
		'riritu' => 0.18,
	),
	array(
		'hiduke' => '2009-03-10',
		'syakunyu' => '',
		'hensai' => 200000,
		'riritu' => '',
	),
);
 
//出力項目
//$output_data = array(
//	array(
//		'hiduke' => '2009-03-09',
//		'syakunyu' => 5000000,
//		'hensai' => 100000,
//		'riritu' => 0.18,
//		'day' => 0,
//		'risoku' =>0,
//		'mibarai_risoku' => 0,
//		'zan' => 0,
//		'kabarai' => 0,
//		'kabarai_zan' => 0,
//	),
//);
 
 
$kk = new kabaraiKeisan();
$output = $kk->keisan($syojitu, $kabarai_ritu, $data);
print_r($output);
 
 
class kabaraiKeisan {
 
	const SYOJITU_ON = 1;	//1:有効
	const SYOJITU_OFF = 2;	//2:無効
 
	function keisan($syojitu, $kabarai_ritu, $data){
 
		if(!count($data)){
			die('データがないよ');
		}
 
 
		//初期値
		$first = current($data);
		$mae_riritu = $first['riritu'];
		$mae_timestump = $this->toTimestump($first['hiduke']);
 
		$output = array();
		foreach ($data as $value ) {
 
			$timestump = $this->toTimestump($value['hiduke']);
                        $syanyuukinn = $value['syakunyu'];
			//利率
			if($value['riritu'] == ""){
				$value['riritu'] = $mae_riritu;
			}
 
			//日数
			if($syojitu == self::SYOJITU_ON){
				$value['day'] = $this->getDateData($timestump, $mae_timestump, 1);
			}else{
				$value['day'] = $this->getDateData($timestump, $mae_timestump, 0);
			}
 
			//利息
                        //利息
            $value['rishi'] = $value['day'] * $this->getLisi($timestump,$zan,$value['hiduke']);
 
 
			//未払利息
 
			//残元金
			$value['zan'] = $this->getZanki($timestump,$zan,$syanyuukinn,$J10 = 0,$K9 = 0,$value["hensai"],$value['rishi'],$H9 = 0);
 
 
			//過払利息
 
			//過払利息残額
 
 
 
			//1つ前ストック
			$mae_timestump = $timestump;
			$mae_riritu = $value['riritu'];
			$mae_day = $value['day'];
                        $zan = $value['zan'];
 
			$syojitu = self::SYOJITU_OFF;
 
			$output[] = $value;
 
		}
 
 
		return $output;
	}
 
 
	function toTimestump($dt){
		//strtotimeがうまく動けばそっちでもOK
		list($y, $m, $d) = split('-', $dt);
		return mktime(0,0,0,$m,$d,$y);
	}
 
	// 日数
	function getDateData($timestump, $mae_timestump, $syojitu){
		//86400 = 60*60*24
		return (($timestump - $mae_timestump) / 86400) + $syojitu;
 
	}
        //  $B10 = 1; // 日数
//	$I9 = 4502465; //借入残金 I9
//	$C10 = 0; //借入金額 c10
//	$J10 = 0; //過払利息  j10
//	$K9 = 0;  //過払利息残額  K9 
//	$D10 = 500000;  //弁済額  d10 
//	$G10 = 2465;  //利息  G10
//	$H9 = 0;  //未払利息  H9
       # 残元金
	function getZanki($B10,$I9,$C10,$J10,$K9,$D10,$G10,$H9){
		if($B10 != 0){
			if($I9 <= 0){
 
				if($C10 >= -($J10+$K9)){
					return $I9+$C10+$J10+$K9-$D10;
				}else{
					return $I9-$D10;
				}
 
			}else{
 
				if($D10 >= $G10+$H9){
					return $I9+$C10+$G10+$H9-$D10;
				}else{
					return $I9+$C10;
				}
 
			}
		}		
	}
 
       # 利息(日)
	function getLisi($sql_date2,$I9,$C10){
		$y = date("Y",strtotime( $sql_date2));
		$m = 2;
		$d = 29;
		if(checkdate($m, $d, $y)){
			$kinnri_hi = ($I9 * 0.18 + $C10 * 0.18) / 366;
		}else{
			$kinnri_hi = ($I9 * 0.18 + $C10 * 0.18) / 365;
		}
 
		return $kinnri_hi;
	}
 
}

21:27

<?php
//入力値
$data = array(
	array(
		'hiduke' => '2009-03-09',
		'syakunyu' => 5000000,
		'hensai' => 100000,
	),
	array(
		'hiduke' => '2009-03-10',
		'syakunyu' => '',
		'hensai' => 200000,
	),
);
 
 
$kk = new kabaraiKeisan();
$output = $kk->keisan($data);
print_r($output);
 
 
class kabaraiKeisan {
 
	const SYOJITU_ON = 1;	//1:有効
	const SYOJITU_OFF = 0;	//2:無効
 
	const RIRITU = 0.18;	//利率
 
	function keisan($data){
 
		if(!count($data)){
			die('データがないよ');
		}
 
 
		//初期値
		$first = current($data);
		$mae_riritu = self::RIRITU;
		$mae_timestump = $this->toTimestump($first['hiduke']);
		$mae_zan = 0;
		$mae_hotei = 0;
		$mae_risoku = 0;
 
		$output = array();
		$firstline = true;
		foreach ($data as $value ) {
 
			$timestump = $this->toTimestump($value['hiduke']);
 
			//日数(日)
			if($firstline){
				$value['day'] = '';
			}else{
				$value['day'] = $this->getDay($timestump, $mae_timestump);
			}
 
			//年内(日)
			if(!$firstline){
				$value['nennai_hi'] = '';
			}else{
				$value['nennai_hi'] = $this->getNennai($timestump, $mae_timestump);
			}
 
			//年明(日)
			if(!$firstline){
				$value['tosiake_hi'] = '';
			}else{
				$value['tosiake_hi'] = $this->getTosiake($timestump, $mae_timestump);
			}
 
			//利率(年%)
			if(!$firstline){
				$value['riritu'] = '';
			}else{
				$value['riritu'] = $this->getRiritu($mae_zan);
			}
 
			//年内(円)
			if(!$firstline){
				$value['nennai_en'] = '';
			}else{
				$value['nennai_en'] = $this->getNennaiEn($timestump,
														$mae_timestump,
														$mae_zan,
														$value['nennai_hi'],
														$value['riritu']);
			}
 
			//年内(円)
			if(!$firstline){
				$value['tosiake_en'] = '';
			}else{
				$value['tosiake_en'] = $this->getTosiakeEn($timestump,
														$mae_zan,
														$value['nennai_hi'],
														$value['riritu']);
			}
 
			//金額(円)
			if(!$firstline){
				$value['kingaku'] = '';
			}else{
				$value['kingaku'] = $this->getKingaku($value['nennai_en'],$value['tosiake_en']);
			}
 
			//利息累積
			if(!$firstline){
				$value['risoku'] = 0;
			}else{
				$value['risoku'] = $this->getRisoku($mae_hotei, $mae_risoku, $value['kingaku']);
			}
 
			//元本への法定充当額
			if(!$firstline){
				$value['hotei'] = 0;
			}else{
				$value['hotei'] = $this->getHotei($timestump, $value['hensai'], $value['syakunyu']);
			}
 
			if(!$firstline){
				//=IF(C7="","",C7)
				if($value['hensai'] == ''){
					$value['zan'] = '';
				}else{
					$value['zan'] = '';
				}
			}else{
				$value['zan'] = $this->getZan($timestump, $mae_zan, $value['hotei'], $value['syakunyu']);
			}
 
 
			//1つ前ストック
			$mae_timestump = $timestump;
			$mae_zan = $value['zan'];
			$mae_risoku = $value['risoku'];
			$mae_hotei = $value['hotei'];
 
 
			$firstline = false;
 
			$output[] = $value;
 
		}
 
 
		return $output;
	}
 
 
	//timestumpへ変換
	function toTimestump($dt){
		//strtotimeがうまく動けばそっちでもOK
		list($y, $m, $d) = split('-', $dt);
		return mktime(0,0,0,$m,$d,$y);
	}
 
	//日数(日)
	//=IF(B8="","",DATEDIF(B7,B8,"D"))
	function getDay($timestump, $mae_timestump){
		//86400 = 60*60*24
		return (($timestump - $mae_timestump) / 86400);
	}
 
	//年内(日)
	//=IF(P7=P8,DATEDIF(B7,B8,"d"),DATEDIF(B7,DATE(O7,12,31),"d"))
	function getNennai($timestump, $mae_timestump){
		$y = date('Y', $timestump);
		$mae_y = date('Y', $mae_timestump);
 
		if($y == $mae_y){
			return $this->getDay($timestump, $mae_timestump);
		}else{
			$m = date('m', $timestump);
			$d = date('d', $timestump);
			return $this->getDay(mktime(0,0,0,$m,$d,$y), $mae_timestump);
		}
	}
 
	//年明(日)
	//=IF(P7=P8,"0",DATEDIF(DATE(O7,12,31),B8,"d"))
	function getTosiake($timestump, $mae_timestump){
 
		$y = date('Y', $timestump);
		$mae_y = date('Y', $mae_timestump);
 
		if($y == $mae_y){
			return 0;
		}else{
			$m = date('m', $timestump);
			$d = date('d', $timestump);
			return $this->getDay($timestump, mktime(0,0,0,$m,$d,$y));
		}
 
	}
 
	//利率(年%)
	//=IF(N7="","",IF(N7<100000,0.2,IF(N7>=1000000,0.15,0.18)))
	function getRiritu($mae_zan){
		if($mae_zan == ''){
			return '';
		}elseif($mae_zan < 100000){
			return 0.2;
		}elseif($mae_zan >= 1000000){
			return 0.15;
		}else{
			return 0.18;
		}
	}
 
	//年内(円)
	//=IF(B8="","",IF(N7<0,0,TRUNC(N7*F8*H8/P7)))
	function getNennaiEn($timestump, $mae_timestump, $mae_zan, $nennai_hi, $riritu){
 
		if($timestump == ''){
			return '';
		}else{
			if($mae_zan < 0){
				return 0;
			}else{
				$year_suu = $this->getYearSuu($mae_timestump);
				return $mae_zan * $nennai_hi * $riritu / $year_suu;
			}
		}
 
	}
 
	//年明(円)
	//=IF(B8="","",IF(N7<0,0,TRUNC(N7*G8*H8/P8)))
	function getTosiakeEn($timestump, $mae_timestump, $mae_zan, $tosiake_hi, $riritu){
		if($timestump == ''){
			return '';
		}else{
			if($mae_zan < 0){
				return 0;
			}else{
				$year_suu = $this->getYearSuu($timestump);
				return $mae_zan * $tosiake_hi * $riritu / $year_suu;
			}
		}
	}
 
	//金額(円)
	//=SUM(I8:J8)
	function getKingaku($nennai_en, $tosiake_en){
		return $nennai_en + $tosiake_en;
	}
 
 
	//利息累積
	//=IF(M7=0,L7+K8,K8)
	function getRisoku($mae_hotei, $mae_risoku, $kingaku){
		if($mae_hotei == 0){
			$mae_risoku + $kingaku;
		}else{
			$kingaku;
		}
	}
 
	//元本への法定充当額
	//=IF(B8="","",IF(D8="",0,D8-L8))
	function getHotei($timestump, $siharai, $syakunyu){
		if($timestump == ''){
			return '';
		}else{
			if($siharai == ""){
				return 0;
			}else{
				return $siharai - $syakunyu;
			}
		}
	}
 
	//残元本債務額
	//=IF(B8="","",N7-M8+C8)
	function getZan($timestump, $mae_zan, $hotei, $syakunyu){
		if($timestump == ''){
			return '';
		}else{
			return $mae_zan - $hotei + $syakunyu;
		}
	}
 
 
	//年の日数を返す。365 か 366
	function getYearSuu($timestump){
		$y = date('Y',$timestump);
		$m = 2;
		$d = 29;
		if(checkdate($m, $d, $y)){
			return 366;
		}else{
			return 365;
		}
	}
 
 
 
 
}
利息excel.txt · 最終更新: 2010/07/27 15:46 (外部編集)
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0

Strict Standards: Only variables should be passed by reference in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/doku.php on line 81