本文整理汇总了PHP中Application_Model_DbTable_DbGlobal::getSubDaysByPaymentTerm方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_DbTable_DbGlobal::getSubDaysByPaymentTerm方法的具体用法?PHP Application_Model_DbTable_DbGlobal::getSubDaysByPaymentTerm怎么用?PHP Application_Model_DbTable_DbGlobal::getSubDaysByPaymentTerm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application_Model_DbTable_DbGlobal
的用法示例。
在下文中一共展示了Application_Model_DbTable_DbGlobal::getSubDaysByPaymentTerm方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upDateLoanDisburse
public function upDateLoanDisburse($data){
$db = $this->getAdapter();
// $db->beginTransaction();
// try{
$datagroup = array(
'group_id'=>$data['group_id'],
'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'=>2,
'collect_typeterm'=>$data['collect_termtype']
);
$g_id = $data['id'];//add group loan
$where = $db->quoteInto('g_id=?', $g_id);
$this->update($datagroup, $where);
unset($datagroup);
$this->_name='ln_loan_member';//update member
$arr =array('status'=>0);
$where = $db->quoteInto('group_id=?', $g_id);
$this->update($arr, $where);
$rows= $this->getAllMemberLoanById($g_id);
$s_where = array();
$where = '';
foreach ($rows as $id => $row){
$s_where[] = "`member_id` = ".$row['member_id'];
}
$where .= implode(' OR ',$s_where);
$this->_name='ln_loanmember_funddetail';//update schedule detail of member
$this->update($arr, $where);
$this->_name='ln_loan_member';//update member
$next_payment = $data['first_payment'];
$start_date = $data['release_date'];//loan release;
$curr_type = $data['currency_type'];
$tranlist = explode(',',$data['record_row']);
$dbtable = new Application_Model_DbTable_DbGlobal();
foreach ($tranlist as $i) {
$this->_name='ln_loan_member';//update member
$loan_number = $dbtable->getLoanNumber();
$datamember = array(
'group_id'=>$g_id,
'loan_number'=>$loan_number,
'client_id'=>$data['member_id'.$i],
'payment_method'=>$data['repayment_method'],
'currency_type'=>$data['currency_type'],
'admin_fee'=>$data['admin_fee'.$i],
'total_capital'=>$data['debt_amount'.$i],//$data[''],
'interest_rate'=>$data['interest_rate'],
'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_purpose'=>$data['note'.$i],
'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'];
//.........这里部分代码省略.........
示例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);
//.........这里部分代码省略.........
示例3: updateLoanById
//.........这里部分代码省略.........
$where .= implode(' OR ',$s_where);
$where.=" AND status=1 AND is_completed=0 ";
$arr = array(
'status'=>0
);
$this->_name='ln_loanmember_funddetail';
// $where = $db->quoteInto('member_id=?', $data['id']);
$this->delete($where);
$remain_principal = $data['total_amount'];
$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
}