Fix: On a not configured personalized accounting group, the group code would be used in the formula.
This commit is contained in:
parent
25e4a3bd7c
commit
30ce816c0c
@ -405,6 +405,9 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
|
|
||||||
// Set $cpts with array of accounts in the category/group
|
// Set $cpts with array of accounts in the category/group
|
||||||
$cpts = $AccCat->getCptsCat($cat['rowid']);
|
$cpts = $AccCat->getCptsCat($cat['rowid']);
|
||||||
|
// We should loop over empty $cpts array, else the category _code_ is used in the formula, which leads to wrong result if the code is a number.
|
||||||
|
if (empty($cpts)) $cpts[] = array();
|
||||||
|
|
||||||
|
|
||||||
$arrayofaccountforfilter = array();
|
$arrayofaccountforfilter = array();
|
||||||
foreach ($cpts as $i => $cpt) { // Loop on each account.
|
foreach ($cpts as $i => $cpt) { // Loop on each account.
|
||||||
@ -477,7 +480,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
// Label of group
|
// Label of group
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print dol_escape_htmltag($cat['label']);
|
print dol_escape_htmltag($cat['label']);
|
||||||
if (count($cpts) > 0) { // Show example of 5 first accounting accounts
|
if (count($cpts) > 0 && !empty($cpts[0])) { // Show example of 5 first accounting accounts
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($cpts as $cpt) {
|
foreach ($cpts as $cpt) {
|
||||||
if ($i > 5) {
|
if ($i > 5) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user