dolibarr  13.0.2
calcmens.php
Go to the documentation of this file.
1 <?php
2 /* TVI
3  * Copyright (C) 2015 Florian HENRY <florian.henry@open-concept.pro>
4  * Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  */
20 
27 if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal
28 if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
29 if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
30 
31 require '../main.inc.php';
32 require DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php';
33 
34 $mens = GETPOST('mens');
35 $capital = GETPOST('capital');
36 $rate = GETPOST('rate');
37 $echance = GETPOST('echeance');
38 $nbterm = GETPOST('nbterm');
39 
40 top_httphead();
41 
42 $output = array();
43 
44 $output = loanCalcMonthlyPayment($mens, $capital, $rate, $echance, $nbterm);
45 
46 echo json_encode($output);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
loanCalcMonthlyPayment($mens, $capital, $rate, $echance, $nbterm)
Calculate remaining loan mensuality and interests.
Definition: loan.lib.php:96
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype= 'text/html', $forcenocache=0)
Show HTTP header.
Definition: main.inc.php:1214