当前位置: 首页>>代码示例>>PHP>>正文


PHP Application_Model_DbTable_DbGlobal::getNextDateById方法代码示例

本文整理汇总了PHP中Application_Model_DbTable_DbGlobal::getNextDateById方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_DbTable_DbGlobal::getNextDateById方法的具体用法?PHP Application_Model_DbTable_DbGlobal::getNextDateById怎么用?PHP Application_Model_DbTable_DbGlobal::getNextDateById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Application_Model_DbTable_DbGlobal的用法示例。


在下文中一共展示了Application_Model_DbTable_DbGlobal::getNextDateById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: upDateLoanDisburse


//.........这里部分代码省略.........
    					'semi'=>$data['amount_collect_pricipal']
    			);
    			 
    			$member_id = $this->insert($datamember);//add member loan
    			unset($datamember);
    			$old_remain_principal = 0;
    			$old_pri_permonth = 0;
    			$old_interest_paymonth = 0;
    			$old_amount_day = 0;
    			$amount_collect = 1;
    			$ispay_principal=2;//for payment type = 5;
    			$is_subremain = 2;
    			$remain_principal = $data['debt_amount'.$i];
    			 
    			 
    			$this->_name='ln_loanmember_funddetail';
    			 
    			$borrow_term = $dbtable->getSubDaysByPaymentTerm($data['pay_every'],null);//return amount day for payterm
    			$amount_borrow_term = $borrow_term*$data['period'];//amount of borrow
    			 
    			$fund_term = $dbtable->getSubDaysByPaymentTerm($data['collect_termtype'],null);//return amount day for payterm
    			$amount_fund_term = $fund_term*$data['amount_collect'];
    			 
    			$loop_payment = ($amount_borrow_term)/($amount_fund_term);
    			$payment_method = $data['repayment_method'];
    			
    			$this->_name='ln_loanmember_funddetail';
    			for($j=1;$j<=$loop_payment;$j++){
    				//return amount next day collection
    				$amount_collect = $data['amount_collect'];
    				$day_perterm = $dbtable->getSubDaysByPaymentTerm($data['collect_termtype'],$amount_collect);//return amount day for payterm
    
    				//$day_perterm = $dbtable->getSubDaysByPaymentTerm($data['pay_every'],$amount_collect);//return amount day for payterm
    				$str_next = $dbtable->getNextDateById($data['collect_termtype'],$data['amount_collect']);//for next,day,week,month;
    
    				if($payment_method==1){//decline//completed
    					//     					$pri_permonth = ($data['debt_amount'.$j]/($data['period']-$data['graice_pariod'])*$amount_collect);
    					$pri_permonth = $data['debt_amount'.$i]/(($amount_borrow_term-($data['graice_pariod']*$borrow_term))/$amount_fund_term);
    					$pri_permonth = $this->round_up_currency($curr_type, $pri_permonth);
    						
    					if($j*$amount_collect<=$data['graice_pariod']){//check here//for graice period
    						$pri_permonth = 0;
    					}
    					if($j!=1){
    						if($data['graice_pariod']!=0){//if collect =1 not other check
    							if($j*$amount_collect>$data['graice_pariod']+$amount_collect){//not wright
    								$remain_principal = $remain_principal-$pri_permonth;
    							}else{
    
    							}
    						}else{
    							$remain_principal = $remain_principal-$pri_permonth;//OSប្រាក់ដើមគ្រា}
    						}
    						if($j==$loop_payment){//check condition here//for end of record only
    							$pri_permonth = $data['debt_amount'.$i]-$pri_permonth*($j-(($data['graice_pariod']/$amount_collect)+1));//code error here
    						}
    						$start_date = $next_payment;
    						$next_payment = $dbtable->getNextPayment($str_next, $next_payment, $data['amount_collect'],$data['every_payamount']);
    						$amount_day = $dbtable->CountDayByDate($start_date,$next_payment);
    						$interest_paymonth = $remain_principal*((($amount_fund_term*$data['interest_rate'])/$borrow_term)/100)*($amount_day/$day_perterm);
    							
    					}else{
    						$next_payment = $data['first_payment'];
    						$amount_day = $dbtable->CountDayByDate($start_date,$next_payment);
    						$interest_paymonth = ($data['debt_amount'.$i])*((($amount_fund_term*$data['interest_rate'])/$borrow_term)/100)*($amount_day/$day_perterm);
    					}
开发者ID:samlanh,项目名称:lnms,代码行数:67,代码来源:CopyOfDbLoanGroup.php

示例2: addNewLoanILTest

 public function addNewLoanILTest($data){
 	$db = $this->getAdapter();
 	$db->beginTransaction();
 	try{
 		
 		$datagroup = array(
 				'group_id'=>$data['member'],
 				'co_id'=>$data['co_id'],
 				'zone_id'=>$data['zone'],
 				'level'=>$data['level'],
 				'date_release'=>$data['release_date'],
 				'date_line'=>$data['date_line'],
 				'create_date'=>date("Y-m-d"),
 				'branch_id'=>$data['branch_id'],
 				'total_duration'=>$data['period'],
 				'first_payment'=>$data['first_payment'],
 				'time_collect'=>$data['time'],
 				'pay_term'=>$data['pay_every'],
 				'payment_method'=>$data['repayment_method'],
 				'holiday'=>$data['every_payamount'],
 				'is_renew'=>0,
 				'loan_type'=>1,
 				'collect_typeterm'=>$data['collect_termtype']
 		);
 		
 		$g_id = $this->insert($datagroup);//add group loan
 		
 		unset($datagroup);
 		if(empty($data['loan_code'])){
 			$data['loan_code']=$data['get_laonnumber'];
 		}
 		$datamember = array(
 				'group_id'=>$g_id,
 				'loan_number'=>$data['loan_code'],
 				'client_id'=>$data['member'],
 				'payment_method'=>$data['repayment_method'],
 				'currency_type'=>$data['currency_type'],
 				'total_capital'=>$data['total_amount'],//$data[''],
 				'admin_fee'=>$data['loan_fee'],
 				'other_fee'=>$data['other_fee'],
 				'interest_rate'=>$data['interest_rate'],
 				'status'=>1,
 				'is_completed'=>0,
 				'branch_id'=>$data['branch_id'],
 				//'pay_before'=>$data['pay_before'],
 				'pay_after'=>$data['pay_late'],
 				'graice_period'=>$data['graice_pariod'],
 				'amount_collect_principal'=>$data['amount_collect'],
 				'collect_typeterm'=>$data['collect_termtype'],
 				'loan_number'=>$data['loan_code'],
 				'semi'=>$data['amount_collect_pricipal']
 		);
 		$this->_name='ln_test_loan_member';
 		$member_id = $this->insert($datamember);//add member loan
 		unset($datamember);
 		 
 		$remain_principal = $data['total_amount'];
 		$next_payment = $data['first_payment'];
 		$start_date = $data['release_date'];//loan release;
 		//     			$next_payment = $start_date;
 		
 		 
 		$old_remain_principal = 0;
 		$old_pri_permonth = 0;
 		$old_interest_paymonth = 0;
 		$old_amount_day = 0;
 		$amount_collect = 1;
 		$ispay_principal=2;//for payment type = 5;
 		$is_subremain = 2;
 		$curr_type = $data['currency_type'];
 		
 		//for IRR method
 		if($data['repayment_method']==6){
 		$term_install = $data['period'];
 		$loan_amount = $data['total_amount'];
 		$total_loan_amount = $loan_amount+($loan_amount*$data['interest_rate']/100*$term_install);
 		$irr_interest = $this->calCulateIRR($total_loan_amount,$loan_amount,$term_install,$curr_type);
 		//end of IRR
 		}
 		
 		$this->_name='ln_test_loanmember_funddetail';
 		$dbtable = new Application_Model_DbTable_DbGlobal();
 		$borrow_term = $dbtable->getSubDaysByPaymentTerm($data['pay_every'],null);//return amount day for payterm
 		$amount_borrow_term = $borrow_term*$data['period'];//amount of borrow
 		 
 		$fund_term = $dbtable->getSubDaysByPaymentTerm($data['collect_termtype'],null);//return amount day for payterm
 		$amount_fund_term = $fund_term*$data['amount_collect'];
 		 
 		$loop_payment = ($amount_borrow_term)/($amount_fund_term);
 		$payment_method = $data['repayment_method'];
 		//     			for($i=1;$i<=($data['period']/$data['amount_collect']);$i++){
 		for($i=1;$i<=$loop_payment;$i++){
 			$amount_collect = $data['amount_collect'];
 			$day_perterm = $dbtable->getSubDaysByPaymentTerm($data['collect_termtype'],$amount_collect);//return amount day for payterm
 			$str_next = $dbtable->getNextDateById($data['collect_termtype'],$data['amount_collect']);//for next,day,week,month;
 		
 			if($payment_method==1){//decline//completed
 				//     					$pri_permonth = ($data['total_amount']/($data['period']-$data['graice_pariod'])*$amount_collect);
 				$pri_permonth = $data['total_amount']/(($amount_borrow_term-($data['graice_pariod']*$borrow_term))/$amount_fund_term);
 				$pri_permonth = $this->round_up_currency($curr_type, $pri_permonth);
//.........这里部分代码省略.........
开发者ID:sarankh80,项目名称:lnms,代码行数:101,代码来源:DbLoanILtest.php

示例3: updateLoanById


//.........这里部分代码省略.........
    		$next_payment = $data['first_payment'];
    		$start_date = $data['release_date'];//loan release;
    		$from_date = $data['release_date'];
    		 
    		$old_remain_principal = 0;
    		$old_pri_permonth = 0;
    		$old_interest_paymonth = 0;
    		$old_amount_day = 0;
    		$amount_collect = 1;
    		$ispay_principal=2;//for payment type = 5;
    		$is_subremain = 2;
    		$curr_type = $data['currency_type'];
    		
    		//for IRR method
    		$term_install = $data['period'];
    		$loan_amount = $data['total_amount'];
    		$total_loan_amount = $loan_amount+($loan_amount*$data['interest_rate']/100*$term_install);
    		$irr_interest = $this->calCulateIRR($total_loan_amount,$loan_amount,$term_install,$curr_type);
    		//end of IRR
    		 
    		$this->_name='ln_loanmember_funddetail';
    		$dbtable = new Application_Model_DbTable_DbGlobal();
    		$borrow_term = $dbtable->getSubDaysByPaymentTerm($data['pay_every'],null);//return amount day for payterm
    		$amount_borrow_term = $borrow_term*$data['period'];//amount of borrow
    		 
    		$fund_term = $dbtable->getSubDaysByPaymentTerm($data['collect_termtype'],null);//return amount day for payterm
    		$amount_fund_term = $fund_term*$data['amount_collect'];
    		 
    		$loop_payment = ($amount_borrow_term)/($amount_fund_term);
    		$payment_method = $data['repayment_method'];
    		//     			for($i=1;$i<=($data['period']/$data['amount_collect']);$i++){
    		for($i=1;$i<=$loop_payment;$i++){
    			$amount_collect = $data['amount_collect'];
    			$str_next = $dbtable->getNextDateById($data['collect_termtype'],$data['amount_collect']);//for next,day,week,month;
    	
    			if($payment_method==1){//decline//completed
    				//     					$pri_permonth = ($data['total_amount']/($data['period']-$data['graice_pariod'])*$amount_collect);
    				$pri_permonth = $data['total_amount']/(($amount_borrow_term-($data['graice_pariod']*$borrow_term))/$amount_fund_term);
    				$pri_permonth = $this->round_up_currency($curr_type, $pri_permonth);
    				if($i*$amount_collect<=$data['graice_pariod']){//check here//for graice period
    					$pri_permonth = 0;
    				}
    				if($i!=1){
    					if($data['graice_pariod']!=0){//if collect =1 not other check
    						if($i*$amount_collect>$data['graice_pariod']+$amount_collect){//not wright
    							$remain_principal = $remain_principal-$pri_permonth;
    						}else{
    				
    						}
    					}else{
    						$remain_principal = $remain_principal-$pri_permonth;//OSប្រាក់ដើមគ្រា}
    					}
    					if($i==$loop_payment){//check condition here//for end of record only
    						$pri_permonth = $data['total_amount']-$pri_permonth*($i-(($data['graice_pariod']/$amount_collect)+1));//code error here
    					}
    					$start_date = $next_payment;
    					$next_payment = $dbtable->getNextPayment($str_next, $next_payment, $data['amount_collect'],$data['every_payamount'],$data['first_payment']);
    					$amount_day = $dbtable->CountDayByDate($from_date,$next_payment);
    					$interest_paymonth = $remain_principal*($data['interest_rate']/100/$borrow_term)*$amount_day;
    				
    				}else{
    					$next_payment = $data['first_payment'];
    					$next_payment = $dbtable->checkFirstHoliday($next_payment,$data['every_payamount']);
    					$amount_day = $dbtable->CountDayByDate($from_date,$next_payment);
    					$interest_paymonth = $remain_principal*($data['interest_rate']/100/$borrow_term)*$amount_day;
    				}
开发者ID:samlanh,项目名称:lnms,代码行数:67,代码来源:DbLoanIL.php


注:本文中的Application_Model_DbTable_DbGlobal::getNextDateById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。