diff --git a/ChangeLog b/ChangeLog index 290ef468085..63d2f79b531 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,10 @@ Dolibarr 4.0 should be compatible with PHP 7 but more feedbacks are still expect Following changes may create regression for some external modules, but were necessary to make Dolibarr better: - Method select_type_comptes_financiers() has been renamed into selectTypeOfBankAccount() +- File '/core/tpl/document_actions_pre_headers.tpl.php' were renamed into '/core/actions_linkedfiles.inc.php'. +So if you included it into your module, change your code like this to be compatible with all version: + $res=@include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; + if (! $res) include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 0c154e031d8..6078d871f3f 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -199,8 +199,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'accountancy', '', 2210__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'accountancy', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/index.php?leftmenu=tax_loan&mainmenu=accountancy', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/card.php?leftmenu=tax_loan&action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/index.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/calc.php?leftmenu=tax_loan', 'Calculator', 2, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); +--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/calc.php?leftmenu=tax_loan', 'Calculator', 2, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'accountancy', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/index.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/sociales/charges.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index bcbcf3b154e..d4d396cf892 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -876,8 +876,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $langs->load("loan"); $newmenu->add("/loan/index.php?leftmenu=tax_loan&mainmenu=accountancy",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan'); if (empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create",$langs->trans("NewLoan"),2,$user->rights->loan->write); - if (empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/index.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); - if (empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/calc.php?leftmenu=tax_loan",$langs->trans("Calculator"),2,$user->rights->loan->calc); + //if (empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); + if ((empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) && ! empty($conf->global->LOAN_SHOW_CALCULATOR)) $newmenu->add("/loan/calc.php?leftmenu=tax_loan",$langs->trans("Calculator"),2,$user->rights->loan->calc); } // Social contributions diff --git a/htdocs/core/modules/modLoan.class.php b/htdocs/core/modules/modLoan.class.php index 25f1b7cf2c2..b7e7f822bbc 100644 --- a/htdocs/core/modules/modLoan.class.php +++ b/htdocs/core/modules/modLoan.class.php @@ -51,7 +51,7 @@ class modLoan extends DolibarrModules $this->description = "Loans management"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = 'experimental'; + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 0; diff --git a/htdocs/langs/en_US/loan.lang b/htdocs/langs/en_US/loan.lang index e082f166959..35060e134dc 100644 --- a/htdocs/langs/en_US/loan.lang +++ b/htdocs/langs/en_US/loan.lang @@ -25,7 +25,7 @@ LoanCalc=Bank Loans Calculator PurchaseFinanceInfo=Purchase & Financing Information SalePriceOfAsset=Sale Price of Asset PercentageDown=Percentage Down -LengthOfMortgage=Length of Mortgage +LengthOfMortgage=Duration of loan AnnualInterestRate=Annual Interest Rate ExplainCalculations=Explain Calculations ShowMeCalculationsAndAmortization=Show me the calculations and amortization @@ -42,10 +42,10 @@ AmountFinanced=Amount Financed AmortizationMonthlyPaymentOverYears=Amortization For Monthly Payment: %s over %s years Totalsforyear=Totals for year MonthlyPayment=Monthly Payment -LoanCalcDesc=This mortgage calculator 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.
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.
+LoanCalcDesc=This mortgage calculator can be used to figure out monthly payments of a loaning, based on the amount borrowed, the term of the loan desired and the interest rate.
This calculator includes also 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.
GoToInterest=%s will go towards INTEREST GoToPrincipal=%s will go towards PRINCIPAL -YouWillSpend=You will spend %s on your house in year %s +YouWillSpend=You will spend %s in year %s # Admin ConfigLoan=Configuration of the module loan LOAN_ACCOUNTING_ACCOUNT_CAPITAL=Accountancy code capital by default diff --git a/htdocs/loan/calc.php b/htdocs/loan/calc.php index 5dee07411f8..0a384c1c859 100644 --- a/htdocs/loan/calc.php +++ b/htdocs/loan/calc.php @@ -149,7 +149,7 @@ print ''.$langs->trans('LengthOfMortgage').':'; -print 'years'; +print ' '.$langs->trans("years").''; print ''; print ''; print ''.$langs->trans('AnnualInterestRate').':'; @@ -201,7 +201,7 @@ if ($form_complete && $monthly_payment) { $pmi_per_month = 55 * ($financing_price / 100000); - print ''; + /*print ''; print ' '; print ''; print '
'; @@ -210,7 +210,7 @@ if ($form_complete && $monthly_payment) to be about $55 per month for every $100,000 financed (until you have paid off 20% of your loan). This could add '."\$" . number_format($pmi_per_month, "2", ".", ",").' to your monthly payment.'; print ''; - print ''; + print '';*/ print ''; print ''.$langs->trans('MonthlyPayment').':'; print '' . number_format(($monthly_payment + $pmi_per_month), "2", ".", ",") . $langs->trans("Currency".$conf->currency) . '
'; @@ -218,10 +218,10 @@ if ($form_complete && $monthly_payment) print ''; } - print ''; + /*print ''; print ' '; print ''; - print '
'; + print '
';*/ $assessed_price = ($sale_price * .85); $residential_yearly_tax = ($assessed_price / 1000) * 14; @@ -229,23 +229,23 @@ if ($form_complete && $monthly_payment) if ($pmi_per_month) { - $pmi_text = "PMI and "; + $pmi_text = "PMI"; } - - echo "Residential (or Property) Taxes are a little harder to figure out... In Massachusetts, the average resedential tax rate seems - to be around $14 per year for every $1,000 of your property's assessed value."; - - print '

'; - print "Let's say that your property's assessed value is 85% of what you actually paid for it - "; - print number_format($assessed_price, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . 'This would mean that your yearly residential taxes will be around'; + /*echo "Residential (or Property) Taxes are a little harder to figure out... In Massachusetts, the average resedential tax rate seems + to be around $14 per year for every $1,000 of your property's assessed value.";*/ + //print '

'; + //print "Let's say that your property's assessed value is 85% of what you actually paid for it - "; + /*print number_format($assessed_price, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . 'This would mean that your yearly residential taxes will be around'; print number_format($residential_yearly_tax, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency); print 'This could add ' . number_format($residential_monthly_tax, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . 'to your monthly payment'; print ''; print ''; + */ + print ''; print 'TOTAL Monthly Payment:'; print '' . number_format(($monthly_payment + $pmi_per_month + $residential_monthly_tax), "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '
'; - print '(including '.$pmi_text.' residential tax)'; + print '(including '.$pmi_text.')
'; print ''; } diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index ee799284ea7..116de7c561d 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -196,13 +196,13 @@ if ($action == 'create') print ''; // Label - print ''; + print ''; // Bank account if (! empty($conf->banque->enabled)) { print ''; } else @@ -238,7 +238,7 @@ if ($action == 'create') print ''; print ''; @@ -247,48 +247,34 @@ if ($action == 'create') print ''; print ''; print ''; print '
'.$langs->trans("Label").'
'.$langs->trans("Label").'
'.$langs->trans("Account").''; - $form->select_comptes($GETPOST["accountid"],"accountid",0,"courant=1",1); // Show list of bank account with courant + $form->select_comptes(GETPOST("accountid"),"accountid",0,"courant=1",1); // Show list of bank account with courant print '
'.$langs->trans('NotePrivate').''; - $doleditor = new DolEditor('note_private', GETPOST('note_private', 'alpha'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, 100); + $doleditor = new DolEditor('note_private', GETPOST('note_private', 'alpha'), '', 160, 'dolibarr_notes', 'In', false, true, true, ROWS_6, 100); print $doleditor->Create(1); print '
'.$langs->trans('NotePublic').''; - $doleditor = new DolEditor('note_public', GETPOST('note_public', 'alpha'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, 100); + $doleditor = new DolEditor('note_public', GETPOST('note_public', 'alpha'), '', 160, 'dolibarr_notes', 'In', false, true, true, ROWS_6, 100); print $doleditor->Create(1); print '
'; - print '
'; - - // Accountancy - print ''; - + // Accountancy if ($conf->accounting->enabled) { - print ''; - print ''; - - print ''; - print ''; - - print ''; - print ''; + print '
'; + + print '
'.$langs->trans("LoanAccountancyCapitalCode").''; - print '
'.$langs->trans("LoanAccountancyInsuranceCode").''; - print '
'.$langs->trans("LoanAccountancyInterestCode").''; - print '
'; + + print ''; + print ''; + + print ''; + print ''; + + print ''; + print ''; + + print '
'.$langs->trans("LoanAccountancyCapitalCode").''; + print '
'.$langs->trans("LoanAccountancyInsuranceCode").''; + print '
'.$langs->trans("LoanAccountancyInterestCode").''; + print '
'; } - else - { - print ''.$langs->trans("LoanAccountancyCapitalCode").''; - print ''; - print ''; - - print ''.$langs->trans("LoanAccountancyInsuranceCode").''; - print ''; - print ''; - - print ''.$langs->trans("LoanAccountancyInterestCode").''; - print ''; - print ''; - } - - print ''; - + dol_fiche_end(); print '
     '; @@ -306,8 +292,6 @@ if ($id > 0) { $head=loan_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("Loan"),0,'bill'); - // Confirm for loan if ($action == 'paid') { @@ -329,10 +313,12 @@ if ($id > 0) print ''; } + dol_fiche_head($head, 'card', $langs->trans("Loan"), 0, 'bill'); + print ''; // Ref - print '"; @@ -394,18 +380,19 @@ if ($id > 0) print '
'.$langs->trans("Ref").''; + print '
'.$langs->trans("Ref").''; print $form->showrefnav($object,'id'); print "
'; + dol_fiche_end(); + + if ($action == 'edit') { - print '
'; + print '
'; print ''; print '   '; print ''; print '
'; - print ''; + print '

'; } - - dol_fiche_end(); - + print ''; print '
'; diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 18b51c86fee..969d5ecb436 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -66,7 +66,7 @@ if ($id > 0) $head = loan_prepare_head($object); - dol_fiche_head($head, 'note', $langs->trans("Loan"),0,'loan'); + dol_fiche_head($head, 'note', $langs->trans("Loan"), 0, 'bill'); print '
'; @@ -75,19 +75,20 @@ if ($id > 0) print ''; // Ref - print ''; + print ''; print ''; // Name - print ''; + print ''; print ''; print "
'.$langs->trans('Ref').'
'.$langs->trans('Ref').''; - print $form->showrefnav($object,'id','','','rowid','ref'); + print $form->showrefnav($object,'id','',1,'rowid','ref'); print '
'.$langs->trans("Name").'
'.$langs->trans("Name").''.$object->label.'
"; print '
'; - $colwidth='25'; + //$colwidth='25'; + $cssclass='titlefield'; $permission = $user->rights->loan->write; // Used by the include of notes.tpl.php include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';