$key is overwriting a variable from outer foreach loop
This commit is contained in:
parent
5cb014435b
commit
36bb4eece9
@ -253,10 +253,11 @@ if ($resql) {
|
||||
$paymentstatic->fetch($links[$key]['url_id']);
|
||||
$tmparray = $paymentstatic->getBillsArray('');
|
||||
if (is_array($tmparray)) {
|
||||
foreach ($tmparray as $key => $val) {
|
||||
$invoicestatic->fetch($val);
|
||||
if ($accountelem)
|
||||
foreach ($tmparray as $tmpkey => $tmpval) {
|
||||
$invoicestatic->fetch($tmpval);
|
||||
if ($accountelem) {
|
||||
$accountelem .= ', ';
|
||||
}
|
||||
$accountelem .= $invoicestatic->ref;
|
||||
}
|
||||
}
|
||||
@ -264,28 +265,32 @@ if ($resql) {
|
||||
$paymentsupplierstatic->fetch($links[$key]['url_id']);
|
||||
$tmparray = $paymentsupplierstatic->getBillsArray('');
|
||||
if (is_array($tmparray)) {
|
||||
foreach ($tmparray as $key => $val) {
|
||||
$invoicesupplierstatic->fetch($val);
|
||||
if ($accountelem)
|
||||
foreach ($tmparray as $tmpkey => $tmpval) {
|
||||
$invoicesupplierstatic->fetch($tmpval);
|
||||
if ($accountelem) {
|
||||
$accountelem .= ', ';
|
||||
}
|
||||
$accountelem .= $invoicesupplierstatic->ref;
|
||||
}
|
||||
}
|
||||
} elseif ($links[$key]['type'] == 'payment_sc') {
|
||||
$paymentsocialcontributionstatic->fetch($links[$key]['url_id']);
|
||||
if ($accountelem)
|
||||
if ($accountelem) {
|
||||
$accountelem .= ', ';
|
||||
}
|
||||
$accountelem .= $langs->transnoentitiesnoconv("SocialContribution") . ' ' . $paymentsocialcontributionstatic->ref;
|
||||
} elseif ($links[$key]['type'] == 'payment_vat') {
|
||||
$paymentvatstatic->fetch($links[$key]['url_id']);
|
||||
if ($accountelem)
|
||||
if ($accountelem) {
|
||||
$accountelem .= ', ';
|
||||
}
|
||||
$accountelem .= $langs->transnoentitiesnoconv("VATPayments") . ' ' . $paymentvatstatic->ref;
|
||||
} elseif ($links[$key]['type'] == 'banktransfert') {
|
||||
$comment = $outputlangs->transnoentitiesnoconv("Transfer");
|
||||
if ($objp->amount > 0) {
|
||||
if ($comment)
|
||||
if ($comment) {
|
||||
$comment .= ' ';
|
||||
}
|
||||
$banklinestatic->fetch($links[$key]['url_id']);
|
||||
$bankstatic->id = $banklinestatic->fk_account;
|
||||
$bankstatic->label = $banklinestatic->bank_account_label;
|
||||
@ -297,8 +302,9 @@ if ($resql) {
|
||||
$comment .= $bankstatic->getNomUrl(1, '');
|
||||
$comment .= ')';
|
||||
} else {
|
||||
if ($comment)
|
||||
if ($comment) {
|
||||
$comment .= ' ';
|
||||
}
|
||||
$bankstatic->id = $objp->bankid;
|
||||
$bankstatic->label = $objp->bankref;
|
||||
$comment .= ' (' . $langs->transnoentitiesnoconv("from") . ' ';
|
||||
@ -311,13 +317,15 @@ if ($resql) {
|
||||
$comment .= ')';
|
||||
}
|
||||
} elseif ($links[$key]['type'] == 'company') {
|
||||
if ($thirdparty)
|
||||
if ($thirdparty) {
|
||||
$thirdparty .= ', ';
|
||||
}
|
||||
$thirdparty .= dol_trunc($links[$key]['label'], 24);
|
||||
$newline = 0;
|
||||
} elseif ($links[$key]['type'] == 'member') {
|
||||
if ($thirdparty)
|
||||
if ($thirdparty) {
|
||||
$accountelem .= ', ';
|
||||
}
|
||||
$thirdparty .= $links[$key]['label'];
|
||||
$newline = 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user