Merge pull request #7956 from aspangaro/7.0-b5
FIX : Edit accountancy in loan
This commit is contained in:
commit
ecb782f0b4
@ -27,8 +27,8 @@ require '../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
|
||||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||||
|
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||||
|
|
||||||
@ -550,11 +550,13 @@ if ($id > 0)
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Accountancy account capital
|
// Accountancy account capital
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr>';
|
||||||
print $langs->trans("LoanAccountancyCapitalCode");
|
|
||||||
print '</td><td>';
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
|
print '<td class="nowrap fieldrequired">';
|
||||||
|
print $langs->trans("LoanAccountancyCapitalCode");
|
||||||
|
print '</td><td>';
|
||||||
|
|
||||||
if (! empty($conf->accounting->enabled))
|
if (! empty($conf->accounting->enabled))
|
||||||
{
|
{
|
||||||
print $formaccounting->select_account($object->account_capital, 'accountancy_account_capital', 1, '', 1, 1);
|
print $formaccounting->select_account($object->account_capital, 'accountancy_account_capital', 1, '', 1, 1);
|
||||||
@ -563,23 +565,36 @@ if ($id > 0)
|
|||||||
{
|
{
|
||||||
print '<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.'">';
|
print '<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.'">';
|
||||||
}
|
}
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! empty($conf->accounting->enabled)) {
|
print '<td class="nowrap">';
|
||||||
print length_accountg($object->account_capital);
|
print $langs->trans("LoanAccountancyCapitalCode");
|
||||||
|
print '</td><td>';
|
||||||
|
|
||||||
|
if (! empty($conf->accounting->enabled))
|
||||||
|
{
|
||||||
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
$accountingaccount->fetch('',$object->account_capital, 1);
|
||||||
|
|
||||||
|
print $accountingaccount->getNomUrl(0,1,1,'',1);
|
||||||
} else {
|
} else {
|
||||||
print $object->account_capital;
|
print $object->account_capital;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Accountancy account insurance
|
// Accountancy account insurance
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr>';
|
||||||
print $langs->trans("LoanAccountancyInsuranceCode");
|
|
||||||
print '</td><td>';
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
|
print '<td class="nowrap fieldrequired">';
|
||||||
|
print $langs->trans("LoanAccountancyInsuranceCode");
|
||||||
|
print '</td><td>';
|
||||||
|
|
||||||
if (! empty($conf->accounting->enabled))
|
if (! empty($conf->accounting->enabled))
|
||||||
{
|
{
|
||||||
print $formaccounting->select_account($object->account_insurance, 'accountancy_account_insurance', 1, '', 1, 1);
|
print $formaccounting->select_account($object->account_insurance, 'accountancy_account_insurance', 1, '', 1, 1);
|
||||||
@ -588,23 +603,36 @@ if ($id > 0)
|
|||||||
{
|
{
|
||||||
print '<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.'">';
|
print '<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.'">';
|
||||||
}
|
}
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! empty($conf->accounting->enabled)) {
|
print '<td class="nowrap">';
|
||||||
print length_accountg($object->account_insurance);
|
print $langs->trans("LoanAccountancyCapitalCode");
|
||||||
|
print '</td><td>';
|
||||||
|
|
||||||
|
if (! empty($conf->accounting->enabled))
|
||||||
|
{
|
||||||
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
$accountingaccount->fetch('',$object->account_insurance, 1);
|
||||||
|
|
||||||
|
print $accountingaccount->getNomUrl(0,1,1,'',1);
|
||||||
} else {
|
} else {
|
||||||
print $object->account_insurance;
|
print $object->account_insurance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Accountancy account interest
|
// Accountancy account interest
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr>';
|
||||||
print $langs->trans("LoanAccountancyInterestCode");
|
|
||||||
print '</td><td>';
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
|
print '<td class="nowrap fieldrequired">';
|
||||||
|
print $langs->trans("LoanAccountancyInterestCode");
|
||||||
|
print '</td><td>';
|
||||||
|
|
||||||
if (! empty($conf->accounting->enabled))
|
if (! empty($conf->accounting->enabled))
|
||||||
{
|
{
|
||||||
print $formaccounting->select_account($object->account_interest, 'accountancy_account_interest', 1, '', 1, 1);
|
print $formaccounting->select_account($object->account_interest, 'accountancy_account_interest', 1, '', 1, 1);
|
||||||
@ -613,16 +641,27 @@ if ($id > 0)
|
|||||||
{
|
{
|
||||||
print '<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.'">';
|
print '<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.'">';
|
||||||
}
|
}
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! empty($conf->accounting->enabled)) {
|
print '<td class="nowrap">';
|
||||||
print length_accountg($object->account_interest);
|
print $langs->trans("LoanAccountancyInterestCode");
|
||||||
|
print '</td><td>';
|
||||||
|
|
||||||
|
if (! empty($conf->accounting->enabled))
|
||||||
|
{
|
||||||
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
$accountingaccount->fetch('',$object->account_interest, 1);
|
||||||
|
|
||||||
|
print $accountingaccount->getNomUrl(0,1,1,'',1);
|
||||||
} else {
|
} else {
|
||||||
print $object->account_interest;
|
print $object->account_interest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|||||||
@ -297,6 +297,9 @@ class Loan extends CommonObject
|
|||||||
$sql.= " capital='".price2num($this->db->escape($this->capital))."',";
|
$sql.= " capital='".price2num($this->db->escape($this->capital))."',";
|
||||||
$sql.= " datestart='".$this->db->idate($this->datestart)."',";
|
$sql.= " datestart='".$this->db->idate($this->datestart)."',";
|
||||||
$sql.= " dateend='".$this->db->idate($this->dateend)."',";
|
$sql.= " dateend='".$this->db->idate($this->dateend)."',";
|
||||||
|
$sql.= " accountancy_account_capital = '".$this->db->escape($this->account_capital)."',";
|
||||||
|
$sql.= " accountancy_account_insurance = '".$this->db->escape($this->account_insurance)."',";
|
||||||
|
$sql.= " accountancy_account_interest = '".$this->db->escape($this->account_interest)."',";
|
||||||
$sql.= " fk_projet=".(empty($this->fk_project)?'NULL':$this->fk_project).",";
|
$sql.= " fk_projet=".(empty($this->fk_project)?'NULL':$this->fk_project).",";
|
||||||
$sql.= " fk_user_modif = ".$user->id;
|
$sql.= " fk_user_modif = ".$user->id;
|
||||||
$sql.= " WHERE rowid=".$this->id;
|
$sql.= " WHERE rowid=".$this->id;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user