Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
74f3bc5ef5
6 changed files with 31 additions and 11 deletions
|
|
@ -328,6 +328,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') { // delete
|
|||
|
||||
// activate
|
||||
if ($action == $acts[0]) {
|
||||
$sql = '';
|
||||
$rowidcol = "rowid";
|
||||
|
||||
if ($rowid) {
|
||||
|
|
@ -346,6 +347,7 @@ if ($action == $acts[0]) {
|
|||
|
||||
// disable
|
||||
if ($action == $acts[1]) {
|
||||
$sql = '';
|
||||
$rowidcol = "rowid";
|
||||
|
||||
if ($rowid) {
|
||||
|
|
@ -364,6 +366,7 @@ if ($action == $acts[1]) {
|
|||
|
||||
// favorite
|
||||
if ($action == 'activate_favorite') {
|
||||
$sql = '';
|
||||
$rowidcol = "rowid";
|
||||
|
||||
if ($rowid) {
|
||||
|
|
@ -382,6 +385,7 @@ if ($action == 'activate_favorite') {
|
|||
|
||||
// disable favorite
|
||||
if ($action == 'disable_favorite') {
|
||||
$sql = '';
|
||||
$rowidcol = "rowid";
|
||||
|
||||
if ($rowid) {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ $list_account_main = array(
|
|||
'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT',
|
||||
);
|
||||
|
||||
if (isModEnabled('expensereport')) {
|
||||
$list_account_main[] = 'ACCOUNTING_ACCOUNT_EXPENSEREPORT';
|
||||
}
|
||||
|
||||
$list_account = array();
|
||||
|
||||
$list_account[] = '---Product---';
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ if ($result) {
|
|||
$account_supplier = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER', 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_customer = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER', 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_employee = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT', 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_expensereport = getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT', 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_pay_vat = getDolGlobalString('ACCOUNTING_VAT_PAY_ACCOUNT', 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_pay_donation = getDolGlobalString('DONATION_ACCOUNTINGACCOUNT', 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_pay_subscription = getDolGlobalString('ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT', 'NotDefined'); // NotDefined is a reserved word
|
||||
|
|
@ -625,6 +626,9 @@ if (!$error && $action == 'writebookkeeping') {
|
|||
$accountingaccountpayment = new AccountingAccount($db);
|
||||
$accountingaccountpayment->fetch(null, getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'), true);
|
||||
|
||||
$accountingaccountexpensereport = new AccountingAccount($db);
|
||||
$accountingaccountexpensereport->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_EXPENSEREPORT, true);
|
||||
|
||||
$accountingaccountsuspense = new AccountingAccount($db);
|
||||
$accountingaccountsuspense->fetch(null, getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'), true);
|
||||
|
||||
|
|
@ -757,8 +761,8 @@ if (!$error && $action == 'writebookkeeping') {
|
|||
} elseif ($tabtype[$key] == 'payment_expensereport') {
|
||||
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||
$bookkeeping->numero_compte = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT');
|
||||
$bookkeeping->label_compte = $accountingaccountpayment->label;
|
||||
$bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT');
|
||||
$bookkeeping->label_compte = $accountingaccountexpensereport->label;
|
||||
} elseif ($tabtype[$key] == 'payment_salary') {
|
||||
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||
|
|
@ -1013,7 +1017,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||
} elseif ($tabtype[$key] == 'payment') {
|
||||
print '"'.getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER').'"'.$sep;
|
||||
} elseif ($tabtype[$key] == 'payment_expensereport') {
|
||||
print '"'.getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT').'"'.$sep;
|
||||
print '"'.getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT').'"'.$sep;
|
||||
} elseif ($tabtype[$key] == 'payment_salary') {
|
||||
print '"'.getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT').'"'.$sep;
|
||||
} else {
|
||||
|
|
@ -1135,7 +1139,8 @@ if (empty($action) || $action == 'view') {
|
|||
// Button to write into Ledger
|
||||
if (getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == '-1'
|
||||
|| getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == '-1'
|
||||
|| getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == "" || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == '-1') {
|
||||
|| getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == "" || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == '-1'
|
||||
|| getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSERERPORT') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSERERPORT') == '-1') {
|
||||
print($desc ? '' : '<br>').'<div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
$desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}');
|
||||
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>', $desc);
|
||||
|
|
@ -1294,7 +1299,7 @@ if (empty($action) || $action == 'view') {
|
|||
$account_ledger = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER');
|
||||
}
|
||||
if ($tabtype[$key] == 'payment_expensereport') {
|
||||
$account_ledger = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT');
|
||||
$account_ledger = getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT');
|
||||
}
|
||||
if ($tabtype[$key] == 'payment_salary') {
|
||||
$account_ledger = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT');
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ if ($result) {
|
|||
$num = $db->num_rows($result);
|
||||
|
||||
// Variables
|
||||
$account_salary = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT', 'NotDefined');
|
||||
$account_salary = getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT', 'NotDefined');
|
||||
$account_vat = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT', 'NotDefined');
|
||||
|
||||
$i = 0;
|
||||
|
|
@ -247,7 +247,7 @@ if ($action == 'writebookkeeping' && !$error) {
|
|||
$error = 0;
|
||||
|
||||
$accountingaccountexpense = new AccountingAccount($db);
|
||||
$accountingaccountexpense->fetch(null, getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'), true);
|
||||
$accountingaccountexpense->fetch(null, getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT'), true);
|
||||
|
||||
foreach ($taber as $key => $val) { // Loop on each expense report
|
||||
$errorforline = 0;
|
||||
|
|
@ -279,7 +279,7 @@ if ($action == 'writebookkeeping' && !$error) {
|
|||
$bookkeeping->subledger_account = $tabuser[$key]['user_accountancy_code'];
|
||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||
|
||||
$bookkeeping->numero_compte = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT');
|
||||
$bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT');
|
||||
$bookkeeping->label_compte = $accountingaccountexpense->label;
|
||||
|
||||
$bookkeeping->label_operation = $tabuser[$key]['name'];
|
||||
|
|
@ -590,7 +590,7 @@ if (empty($action) || $action == 'view') {
|
|||
}
|
||||
|
||||
// Button to write into Ledger
|
||||
if (!getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == '-1') {
|
||||
if (!getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT') || getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT') == '-1') {
|
||||
print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
$desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}');
|
||||
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>', $desc);
|
||||
|
|
@ -602,7 +602,7 @@ if (empty($action) || $action == 'view') {
|
|||
if (getDolGlobalString('ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL') && $in_bookkeeping == 'notyet') {
|
||||
print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
}
|
||||
if (!getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == '-1') {
|
||||
if (!getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT') || getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT') == '-1') {
|
||||
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
|
||||
} else {
|
||||
if ($in_bookkeeping == 'notyet') {
|
||||
|
|
@ -726,7 +726,7 @@ if (empty($action) || $action == 'view') {
|
|||
print "<td>".$expensereportstatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg(getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'));
|
||||
$accountoshow = length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT'));
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
||||
print '<span class="error">'.$langs->trans("MainAccountForUsersNotDefined").'</span>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020-2022 Open-Dsi <support@open-dsi.fr>
|
||||
* Copyright (C) 2024 Charlene Benke <charlene@patas-monkey.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -2130,6 +2131,11 @@ if ($id > 0) {
|
|||
$canbemodified = 1;
|
||||
}
|
||||
|
||||
if ($tabname[$id] == "c_product_nature" && in_array($obj->code, array(0, 1))) {
|
||||
$canbedisabled = 0;
|
||||
$canbemodified = 0;
|
||||
$iserasable = 0;
|
||||
}
|
||||
// Build Url. The table is id=, the id of line is rowid=
|
||||
$rowidcol = empty($tabrowid[$id]) ? 'rowid' : $tabrowid[$id];
|
||||
// If rowidcol not defined
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ ACCOUNTING_SELL_JOURNAL=Sales journal - sales and returns
|
|||
ACCOUNTING_PURCHASE_JOURNAL=Purchase journal - purchase and returns
|
||||
ACCOUNTING_BANK_JOURNAL=Cash journal - receipts and disbursements
|
||||
ACCOUNTING_EXPENSEREPORT_JOURNAL=Expense report journal
|
||||
ACCOUNTING_ACCOUNT_EXPENSEREPORT=Default accounting account for "expense reports"
|
||||
ACCOUNTING_MISCELLANEOUS_JOURNAL=General journal
|
||||
ACCOUNTING_HAS_NEW_JOURNAL=Has new Journal
|
||||
ACCOUNTING_INVENTORY_JOURNAL=Inventory journal
|
||||
|
|
|
|||
Loading…
Reference in a new issue