Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 4.0

This commit is contained in:
Laurent Destailleur 2016-10-16 11:42:57 +02:00
commit 4c58793587
8 changed files with 16 additions and 10 deletions

View File

@ -833,7 +833,7 @@ if ($id > 0 || ! empty($ref))
{ {
$loanstatic->label=$links[$key]['label']; $loanstatic->label=$links[$key]['label'];
} }
$loanstatic->ref=$loanstatic->label; $loanstatic->ref=$links[$key]['url_id'];
print $loanstatic->getLinkUrl(1,16); print $loanstatic->getLinkUrl(1,16);
} }
else if ($links[$key]['type']=='member') else if ($links[$key]['type']=='member')

View File

@ -767,6 +767,11 @@ if (! $sall)
$sql.= ' f.datec, f.tms,'; $sql.= ' f.datec, f.tms,';
$sql.= ' s.rowid, s.nom, s.town, s.zip, s.fk_pays, s.code_client, s.client, typent.code'; $sql.= ' s.rowid, s.nom, s.town, s.zip, s.fk_pays, s.code_client, s.client, typent.code';
$sql.= ' ,state.code_departement, state.nom'; $sql.= ' ,state.code_departement, state.nom';
foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by
{
$sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
}
} }
else else
{ {

View File

@ -4,6 +4,7 @@ Loans=Loans
NewLoan=New Loan NewLoan=New Loan
ShowLoan=Show Loan ShowLoan=Show Loan
PaymentLoan=Loan payment PaymentLoan=Loan payment
LoanPayment=Loan payment
ShowLoanPayment=Show Loan Payment ShowLoanPayment=Show Loan Payment
LoanCapital=Capital LoanCapital=Capital
Insurance=Insurance Insurance=Insurance

View File

@ -505,6 +505,7 @@ ReportPeriod=Report period
ReportDescription=Description ReportDescription=Description
Report=Report Report=Report
Keyword=Keyword Keyword=Keyword
Origin=Origin
Legend=Legend Legend=Legend
Fill=Fill Fill=Fill
Reset=Reset Reset=Reset

View File

@ -491,7 +491,6 @@ if ($id > 0)
print '<td align="center">'.$langs->trans("Insurance").'</td>'; print '<td align="center">'.$langs->trans("Insurance").'</td>';
print '<td align="center">'.$langs->trans("Interest").'</td>'; print '<td align="center">'.$langs->trans("Interest").'</td>';
print '<td align="center">'.$langs->trans("LoanCapital").'</td>'; print '<td align="center">'.$langs->trans("LoanCapital").'</td>';
print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
$var=True; $var=True;

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> /* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -385,6 +385,7 @@ class PaymentLoan extends CommonObject
* All payment properties must have been set first like after a call to create(). * All payment properties must have been set first like after a call to create().
* *
* @param User $user Object of user making payment * @param User $user Object of user making payment
* @param int $fk_loan Id of fk_loan to do link with this payment
* @param string $mode 'payment_loan' * @param string $mode 'payment_loan'
* @param string $label Label to use in bank record * @param string $label Label to use in bank record
* @param int $accountid Id of bank account to do link with * @param int $accountid Id of bank account to do link with
@ -392,7 +393,7 @@ class PaymentLoan extends CommonObject
* @param string $emetteur_banque Name of bank * @param string $emetteur_banque Name of bank
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) function addPaymentToBank($user, $fk_loan, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
{ {
global $conf; global $conf;
@ -445,11 +446,10 @@ class PaymentLoan extends CommonObject
} }
} }
// Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment) // Add link 'loan' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
//$linkaddedforthirdparty=array();
if ($mode == 'payment_loan') if ($mode == 'payment_loan')
{ {
$result=$acc->add_url_line($bank_line_id, $this->id, DOL_URL_ROOT.'/loan/card.php?id=', ($this->label?$this->label:''),'loan'); $result=$acc->add_url_line($bank_line_id, $fk_loan, DOL_URL_ROOT.'/loan/card.php?id=', ($this->label?$this->label:''),'loan');
if ($result <= 0) dol_print_error($this->db); if ($result <= 0) dol_print_error($this->db);
} }
} }

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> /* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -116,7 +116,7 @@ if ($action == 'add_payment')
if (! $error) if (! $error)
{ {
$result = $payment->addPaymentToBank($user, 'payment_loan', '(LoanPayment)', GETPOST('accountid', 'int'), '', ''); $result = $payment->addPaymentToBank($user, $chid, 'payment_loan', '(LoanPayment)', GETPOST('accountid', 'int'), '', '');
if (! $result > 0) if (! $result > 0)
{ {
setEventMessages($payment->error, $payment->errors, 'errors'); setEventMessages($payment->error, $payment->errors, 'errors');
@ -175,7 +175,7 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$loan->label."</td></tr>\n"; print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$loan->label."</td></tr>\n";
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="2">'.price($loan->capital,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>'; print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="2">'.price($loan->capital,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
$sql = "SELECT SUM(amount_capital + amount_insurance + amount_interest) as total"; $sql = "SELECT SUM(amount_capital) as total";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_loan"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_loan";
$sql.= " WHERE fk_loan = ".$chid; $sql.= " WHERE fk_loan = ".$chid;
$resql = $db->query($sql); $resql = $db->query($sql);