update code
This commit is contained in:
parent
4ecceb1fd0
commit
94a646103d
@ -57,7 +57,7 @@ if (isModEnabled('project')) {
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
|
||||
}
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
}
|
||||
|
||||
@ -3322,7 +3322,7 @@ if ($action == 'create') {
|
||||
$bankaccountstatic->label = $objp->baref;
|
||||
$bankaccountstatic->number = $objp->banumber;
|
||||
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
$bankaccountstatic->account_number = $objp->account_number;
|
||||
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
|
||||
@ -28,10 +28,10 @@ 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)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
}
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
@ -244,7 +244,7 @@ if (empty($reshook)) {
|
||||
|
||||
$form = new Form($db);
|
||||
$formproject = new FormProjets($db);
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
$formaccounting = new FormAccounting($db);
|
||||
}
|
||||
|
||||
@ -341,7 +341,7 @@ if ($action == 'create') {
|
||||
print '</td></tr>';
|
||||
|
||||
// Accountancy
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
// Accountancy_account_capital
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("LoanAccountancyCapitalCode").'</td>';
|
||||
print '<td>';
|
||||
@ -532,7 +532,7 @@ if ($id > 0) {
|
||||
print $langs->trans("LoanAccountancyCapitalCode");
|
||||
print '</td><td>';
|
||||
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
print $formaccounting->select_account($object->account_capital, 'accountancy_account_capital', 1, '', 1, 1);
|
||||
} else {
|
||||
print '<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.'">';
|
||||
@ -543,7 +543,7 @@ if ($id > 0) {
|
||||
print $langs->trans("LoanAccountancyCapitalCode");
|
||||
print '</td><td>';
|
||||
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('', $object->account_capital, 1);
|
||||
|
||||
@ -563,7 +563,7 @@ if ($id > 0) {
|
||||
print $langs->trans("LoanAccountancyInsuranceCode");
|
||||
print '</td><td>';
|
||||
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
print $formaccounting->select_account($object->account_insurance, 'accountancy_account_insurance', 1, '', 1, 1);
|
||||
} else {
|
||||
print '<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.'">';
|
||||
@ -574,7 +574,7 @@ if ($id > 0) {
|
||||
print $langs->trans("LoanAccountancyInsuranceCode");
|
||||
print '</td><td>';
|
||||
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('', $object->account_insurance, 1);
|
||||
|
||||
@ -594,7 +594,7 @@ if ($id > 0) {
|
||||
print $langs->trans("LoanAccountancyInterestCode");
|
||||
print '</td><td>';
|
||||
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
print $formaccounting->select_account($object->account_interest, 'accountancy_account_interest', 1, '', 1, 1);
|
||||
} else {
|
||||
print '<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.'">';
|
||||
@ -605,7 +605,7 @@ if ($id > 0) {
|
||||
print $langs->trans("LoanAccountancyInterestCode");
|
||||
print '</td><td>';
|
||||
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('', $object->account_interest, 1);
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ if (isModEnabled('facture')) {
|
||||
if (isModEnabled('commande')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
}
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
@ -1202,7 +1202,7 @@ $form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
$formproduct = new FormProduct($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
$formaccounting = new FormAccounting($db);
|
||||
}
|
||||
|
||||
@ -1672,7 +1672,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) {
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
// Accountancy_code_sell
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
||||
print '<td>';
|
||||
@ -2186,7 +2186,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) {
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
// Accountancy_code_sell
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
||||
print '<td>';
|
||||
@ -2387,7 +2387,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("ProductAccountancySellCode");
|
||||
print '</td><td>';
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
if (!empty($object->accountancy_code_sell)) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('', $object->accountancy_code_sell, 1);
|
||||
@ -2404,7 +2404,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("ProductAccountancySellIntraCode");
|
||||
print '</td><td>';
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
if (!empty($object->accountancy_code_sell_intra)) {
|
||||
$accountingaccount2 = new AccountingAccount($db);
|
||||
$accountingaccount2->fetch('', $object->accountancy_code_sell_intra, 1);
|
||||
@ -2421,7 +2421,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("ProductAccountancySellExportCode");
|
||||
print '</td><td>';
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
if (!empty($object->accountancy_code_sell_export)) {
|
||||
$accountingaccount3 = new AccountingAccount($db);
|
||||
$accountingaccount3->fetch('', $object->accountancy_code_sell_export, 1);
|
||||
@ -2437,7 +2437,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("ProductAccountancyBuyCode");
|
||||
print '</td><td>';
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
if (!empty($object->accountancy_code_buy)) {
|
||||
$accountingaccount4 = new AccountingAccount($db);
|
||||
$accountingaccount4->fetch('', $object->accountancy_code_buy, 1);
|
||||
@ -2454,7 +2454,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("ProductAccountancyBuyIntraCode");
|
||||
print '</td><td>';
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
if (!empty($object->accountancy_code_buy_intra)) {
|
||||
$accountingaccount5 = new AccountingAccount($db);
|
||||
$accountingaccount5->fetch('', $object->accountancy_code_buy_intra, 1);
|
||||
@ -2471,7 +2471,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("ProductAccountancyBuyExportCode");
|
||||
print '</td><td>';
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
if (!empty($object->accountancy_code_buy_export)) {
|
||||
$accountingaccount6 = new AccountingAccount($db);
|
||||
$accountingaccount6->fetch('', $object->accountancy_code_buy_export, 1);
|
||||
|
||||
@ -4985,7 +4985,7 @@ class Product extends CommonObject
|
||||
$label .= "<br><b>".$langs->trans("PMPValue").'</b>: '.price($this->pmp, 0, '', 1, -1, -1, $conf->currency);
|
||||
}
|
||||
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
if ($this->status && isset($this->accountancy_code_sell)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
$label .= '<br>';
|
||||
|
||||
@ -1291,7 +1291,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
|
||||
// Accounting Report
|
||||
/*
|
||||
$accouting_module_activated = !empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled);
|
||||
$accouting_module_activated = !empty($conf->comptabilite->enabled) || isModEnabled('accounting');
|
||||
if ($accouting_module_activated && $object->statut != Project::STATUS_DRAFT) {
|
||||
$start = dol_getdate((int) $object->date_start);
|
||||
$end = dol_getdate((int) $object->date_end);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user