Skip to content

Commit

Permalink
Fixed new loan with processing
Browse files Browse the repository at this point in the history
  • Loading branch information
jongravois committed May 20, 2015
1 parent 7e0424e commit 1c5b5a1
Show file tree
Hide file tree
Showing 17 changed files with 515 additions and 346 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ bootstrap/environment.php
.env.*.php
.env.php
public/angular/constants/constants.js

public/angular/loans/services/app.factory.js
7 changes: 6 additions & 1 deletion app/Acme/Transformers/FarmerTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public function transform($arr)

$dtToday = Carbon::now();
$dtDOB = $arr['dob'];
if(!$dtDOB){
$dob = null;
} else {
$dob = $arr['dob']->format('m/d/Y');
}
$age_of_farmer = $dtToday->diffInYears($dtDOB);

return [
Expand All @@ -23,7 +28,7 @@ public function transform($arr)
'email' => $arr['email'],
'phone' => $arr['phone'],
'ssn' => $arr['ssn'],
'dob' => $arr['dob']->format('m/d/Y'),
'dob' => $dob,
'age' => $age_of_farmer,
'first_year_farmer' => $arr['first_year_farmer'],
'farm_exp' => $arr['farm_exp'],
Expand Down
7 changes: 4 additions & 3 deletions app/Acme/financials.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ function processFinancials($loan)
'int_arm' => calcInterest(calcPrincipal($arm_commit, $srvcFee, $procFee), $fins['int_percent_arm']),
'int_dist' => calcInterest(calcPrincipal($dist_commit, 0, 0), (double)$fins['int_percent_other']),
'int_other' => calcInterest(calcPrincipal($other_commit, 0, 0), (double)$fins['int_percent_other']),
'cash_flow' => 999999,
'risk' => 999999,
'adjusted_risk' => 999999

/* THESE MAY NOT BE NEEDED */
//'prod' => calcCropValue(getLoanTotalAcres($loan['id']), prod_share, prod_yield, price),
Expand All @@ -77,9 +80,7 @@ function processFinancials($loan)
//'disc_ins' => (double)$fins['disc_ins'],
//'total_revenue' => (double)$fins['total_revenue'],
//'total_balance' => (double)$fins['total_balance'],
//'remaining_balance' => (double)$fins['remaining_balance'],
//'cash_flow' => (double)$fins['cash_flow'],
//'risk' => (double)$fins['risk']
//'remaining_balance' => (double)$fins['remaining_balance']
];
}

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/ApplicantsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function store()
} // end if

$arr = Input::all();
$DOB = date("Y-m-d", strtotime($arr['dob']));
$arr['dob'] = $DOB;
//$DOB = date("m/d/Y", strtotime($arr['dob']));
//$arr['dob'] = $DOB;
$applicant = Applicant::create($arr);

return $this->respondCreated($applicant->id);
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/FarmersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ public function store()
} // end if

$arr = Input::all();
//$DOB = date("Y-m-d", strtotime($arr['dob']));
//$arr['dob'] = $DOB;
$farmer = Farmer::create($arr);
//Add systemic
$newInfo = [
Expand Down
Loading

0 comments on commit 1c5b5a1

Please sign in to comment.