Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
790a82aa6f
@ -37,6 +37,8 @@
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_expeditiondet_batch MODIFY batch VARCHAR(30) CHARACTER SET utf8;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_expeditiondet_batch MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) CHARACTER SET utf8;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) CHARACTER SET utf8;
|
||||
|
||||
@ -27,8 +27,8 @@ require '../main.inc.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/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.'/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
|
||||
@ -550,11 +550,13 @@ if ($id > 0)
|
||||
print '</td></tr>';
|
||||
|
||||
// Accountancy account capital
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("LoanAccountancyCapitalCode");
|
||||
print '</td><td>';
|
||||
print '<tr>';
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<td class="nowrap fieldrequired">';
|
||||
print $langs->trans("LoanAccountancyCapitalCode");
|
||||
print '</td><td>';
|
||||
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
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 '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->accounting->enabled)) {
|
||||
print length_accountg($object->account_capital);
|
||||
print '<td class="nowrap">';
|
||||
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 {
|
||||
print $object->account_capital;
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</tr>';
|
||||
|
||||
// Accountancy account insurance
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("LoanAccountancyInsuranceCode");
|
||||
print '</td><td>';
|
||||
print '<tr>';
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<td class="nowrap fieldrequired">';
|
||||
print $langs->trans("LoanAccountancyInsuranceCode");
|
||||
print '</td><td>';
|
||||
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
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 '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->accounting->enabled)) {
|
||||
print length_accountg($object->account_insurance);
|
||||
print '<td class="nowrap">';
|
||||
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 {
|
||||
print $object->account_insurance;
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</tr>';
|
||||
|
||||
// Accountancy account interest
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("LoanAccountancyInterestCode");
|
||||
print '</td><td>';
|
||||
print '<tr>';
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<td class="nowrap fieldrequired">';
|
||||
print $langs->trans("LoanAccountancyInterestCode");
|
||||
print '</td><td>';
|
||||
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
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 '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->accounting->enabled)) {
|
||||
print length_accountg($object->account_interest);
|
||||
print '<td class="nowrap">';
|
||||
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 {
|
||||
print $object->account_interest;
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
@ -297,6 +297,9 @@ class Loan extends CommonObject
|
||||
$sql.= " capital='".price2num($this->db->escape($this->capital))."',";
|
||||
$sql.= " datestart='".$this->db->idate($this->datestart)."',";
|
||||
$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_user_modif = ".$user->id;
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
@ -275,7 +275,7 @@ class Tasks extends DolibarrApi
|
||||
throw new RestException(404, 'Task not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('task',$this->task->id)) {
|
||||
if( ! DolibarrApi::_checkAccessToResource('tasks',$this->task->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
@ -432,7 +432,7 @@ class Tasks extends DolibarrApi
|
||||
throw new RestException(404, 'Task not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('task',$this->project->id)) {
|
||||
if( ! DolibarrApi::_checkAccessToResource('tasks',$this->project->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
foreach($request_data as $field => $value) {
|
||||
@ -467,7 +467,7 @@ class Tasks extends DolibarrApi
|
||||
throw new RestException(404, 'Task not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('task',$this->project->id)) {
|
||||
if( ! DolibarrApi::_checkAccessToResource('tasks',$this->project->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user