Correct from frederic34
This commit is contained in:
parent
ad0f1aae6b
commit
c4d852ffd7
@ -20,6 +20,7 @@ ErrorLoanInterest=<font color=red>Annual interest</font> has to be numeric and g
|
|||||||
# Calc
|
# Calc
|
||||||
Totalsforyear=Totals for year
|
Totalsforyear=Totals for year
|
||||||
MonthlyPayment=Monthly Payment
|
MonthlyPayment=Monthly Payment
|
||||||
|
LoanCalcDesc=This <b>mortgage calculator</b> can be used to figure out monthly payments of a home mortgage loan, based on the home's sale price, the term of the loan desired, buyer's down payment percentage, and the loan's interest rate.<br> This calculator factors in PMI (Private Mortgage Insurance) for loans where less than 20% is put as a down payment. Also taken into consideration are the town property taxes, and their effect on the total monthly mortgage payment.<br>
|
||||||
# Admin
|
# Admin
|
||||||
ConfigLoan=Configuration of the module loan
|
ConfigLoan=Configuration of the module loan
|
||||||
LOAN_ACCOUNTING_ACCOUNT_CAPITAL=Accountancy code capital by default
|
LOAN_ACCOUNTING_ACCOUNT_CAPITAL=Accountancy code capital by default
|
||||||
|
|||||||
@ -121,10 +121,7 @@ if (! empty($errors)) {
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
echo "<font size='-1' color='#000000'>This <b>mortgage calculator</b> can be used to figure out monthly payments of a home mortgage loan,
|
print $langs->trans('LoanCalcDesc');
|
||||||
based on the home's sale price, the term of the loan desired, buyer's down payment percentage, and the loan's interest rate.
|
|
||||||
This calculator factors in PMI (Private Mortgage Insurance) for loans where less than 20% is put as a down payment. Also taken
|
|
||||||
into consideration are the town property taxes, and their effect on the total monthly mortgage payment.<br></font>";
|
|
||||||
|
|
||||||
print '<form method="GET" name="information" action="'.$_SERVER['PHP_SELF'].'">';
|
print '<form method="GET" name="information" action="'.$_SERVER['PHP_SELF'].'">';
|
||||||
print '<input type="hidden" name="form_complete" value="1">';
|
print '<input type="hidden" name="form_complete" value="1">';
|
||||||
@ -316,7 +313,7 @@ if ($form_complete && $show_progress) {
|
|||||||
$denom = pow((1 + $monthly_interest_rate), $power);
|
$denom = pow((1 + $monthly_interest_rate), $power);
|
||||||
$monthly_payment = $principal * ($monthly_interest_rate / (1 - $denom));
|
$monthly_payment = $principal * ($monthly_interest_rate / (1 - $denom));
|
||||||
|
|
||||||
print "<br><br><a name=\"amortization\"></a>Amortization For Monthly Payment: <b>" . number_format($monthly_payment, "2", ".", ",") . "</b> over " . $year_term . " years<br>\n");
|
print "<br><br><a name=\"amortization\"></a>Amortization For Monthly Payment: <b>" . number_format($monthly_payment, "2", ".", ",") . "</b> over " . $year_term . " years<br>\n";
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
|
|||||||
@ -69,7 +69,7 @@ class Loan extends CommonObject
|
|||||||
* Load object in memory from database
|
* Load object in memory from database
|
||||||
*
|
*
|
||||||
* @param int $id id object
|
* @param int $id id object
|
||||||
* @return void
|
* @return int <0 error , >=0 no error
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
function fetch($id)
|
||||||
{
|
{
|
||||||
@ -304,8 +304,12 @@ class Loan extends CommonObject
|
|||||||
$sql.= " paid = 1";
|
$sql.= " paid = 1";
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
$return = $this->db->query($sql);
|
$return = $this->db->query($sql);
|
||||||
if ($return) return 1;
|
if ($return) {
|
||||||
else return -1;
|
return 1;
|
||||||
|
} else {
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -423,7 +427,8 @@ class Loan extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return -1;
|
$this->error=$this->db->lasterror();
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,12 +469,19 @@ class Loan extends CommonObject
|
|||||||
$this->date_creation = $this->db->jdate($obj->datec);
|
$this->date_creation = $this->db->jdate($obj->datec);
|
||||||
if (empty($obj->fk_user_modif)) $obj->tms = "";
|
if (empty($obj->fk_user_modif)) $obj->tms = "";
|
||||||
$this->date_modification = $this->db->jdate($obj->tms);
|
$this->date_modification = $this->db->jdate($obj->tms);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
$this->error=$this->db->lasterror();
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -50,7 +50,8 @@ $search_label=GETPOST('search_label','alpha');
|
|||||||
$search_amount=GETPOST('search_amount','alpha');
|
$search_amount=GETPOST('search_amount','alpha');
|
||||||
$filtre=GETPOST("filtre");
|
$filtre=GETPOST("filtre");
|
||||||
|
|
||||||
if (GETPOST("button_removefilter"))
|
// Purge search criteria
|
||||||
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
$search_ref="";
|
$search_ref="";
|
||||||
$search_label="";
|
$search_label="";
|
||||||
@ -147,6 +148,6 @@ else
|
|||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
$db->close();
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@ -46,20 +46,25 @@ $result = restrictedArea($user, 'loan', $id, '','');
|
|||||||
$help_url='EN:Module_Loan|FR:Module_Emprunt';
|
$help_url='EN:Module_Loan|FR:Module_Emprunt';
|
||||||
llxHeader("",$langs->trans("Loan"),$help_url);
|
llxHeader("",$langs->trans("Loan"),$help_url);
|
||||||
|
|
||||||
$loan = new Loan($db);
|
if ($id > 0) {
|
||||||
$loan->fetch($id);
|
$loan = new Loan($db);
|
||||||
$loan->info($id);
|
$loan->fetch($id);
|
||||||
|
$loan->info($id);
|
||||||
|
|
||||||
$head = loan_prepare_head($loan);
|
$head = loan_prepare_head($loan);
|
||||||
|
|
||||||
dol_fiche_head($head, 'info', $langs->trans("Loan"), 0, 'bill');
|
dol_fiche_head($head, 'info', $langs->trans("Loan"), 0, 'bill');
|
||||||
|
|
||||||
|
print '<table width="100%"><tr><td>';
|
||||||
|
dol_print_object_info($loan);
|
||||||
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '<table width="100%"><tr><td>';
|
print '</div>';
|
||||||
dol_print_object_info($loan);
|
}
|
||||||
print '</td></tr></table>';
|
else
|
||||||
|
{
|
||||||
print '</div>';
|
// $id ?
|
||||||
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
|||||||
@ -133,7 +133,6 @@ dol_fiche_head($head, $hselected, $langs->trans("PaymentLoan"), 0, 'payment');
|
|||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
print $form->formconfirm('card.php?id='.$payment->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
|
print $form->formconfirm('card.php?id='.$payment->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -143,7 +142,6 @@ if ($action == 'valide')
|
|||||||
{
|
{
|
||||||
$facid = $_GET['facid'];
|
$facid = $_GET['facid'];
|
||||||
print $form->formconfirm('card.php?id='.$payment->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
|
print $form->formconfirm('card.php?id='.$payment->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -283,18 +281,15 @@ if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_GET['action'] == '')
|
if (empty($action) && ! empty($user->rights->loan->delete))
|
||||||
{
|
{
|
||||||
if ($user->rights->loan->delete)
|
if (! $disable_delete)
|
||||||
{
|
{
|
||||||
if (! $disable_delete)
|
print '<a class="butActionDelete" href="card.php?id='.$_GET['id'].'&action=delete">'.$langs->trans('Delete').'</a>';
|
||||||
{
|
}
|
||||||
print '<a class="butActionDelete" href="card.php?id='.$_GET['id'].'&action=delete">'.$langs->trans('Delete').'</a>';
|
else
|
||||||
}
|
{
|
||||||
else
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentWithOneInvoicePaid")).'">'.$langs->trans('Delete').'</a>';
|
||||||
{
|
|
||||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentWithOneInvoicePaid")).'">'.$langs->trans('Delete').'</a>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user