(05-24-2016, 11:04 AM)TurboPT Wrote: [ -> ]You could try this:
PHP Code:
$items = count($last3);
// format each entry first:
for ( $x = 0; $x < $items; $x++ ) {
$last3[$x] = locale_number_format($last3[$x], $OrderLine->DecimalPlaces);
}
// ...and THEN use the implode:
<td class="number">' . implode ("<br>", $last3) . '</td>
Thanks for the help I tried and it removes all the formatting here is what i have
------------------------------------------------------------------------------
$last3sql = "SELECT unitprice
FROM salesorderdetails
INNER JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno
WHERE salesorderdetails.stkcode= '" . $OrderLine->StockID . "'
AND salesorders.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'
ORDER by salesorders.orddate DESC LIMIT 3";
$ErrMsg = _('The details for the last 3 prices cannot be retrieved');
$DbgMsg = _('SQL used to retrieve the details was') . ':<br />' . $last3sql;
$last3result =DB_query($last3sql,$db,$ErrMsg,$DbgMsg);
$last3=array();
while ($mylast3=DB_fetch_array($last3result)) {
$last3[]=$mylast3['unitprice'];
}
$prices = count($last3);
for ( $x = 0; $x < $prices; $x++ ) {
$last3[$x] = locale_number_format($last3[$x], $OrderLine->DecimalPlaces);
}
echo $RowStarter;
echo '<td>';
/* if($_SESSION['Items'.$identifier]->DefaultPOLine ==1){ //show the input field only if required*/
if($ShowPOLine) {// Show the input field only if required.
echo '<input maxlength="20" name="POLine_' . $OrderLine->LineNumber . '" size="20" title="' . _('Enter the customer\'s purchase order reference if required by the customer') . '" type="text" value="' . $OrderLine->POLine . '" /></td><td>';
} else {
echo '<input name="POLine_' . $OrderLine->LineNumber . '" type="hidden" value="" />';
}
echo '<a href="' . $RootPath . '/StockStatus.php?identifier='.$identifier . '&StockID=' . $OrderLine->StockID . '&DebtorNo=' . $_SESSION['Items'.$identifier]->DebtorNo . '" target="_blank">' . $OrderLine->StockID . '</a></td>
<td title="' . $OrderLine->LongDescription . '">' . $OrderLine->ItemDescription . '</td>';
echo '<td><input class="number" maxlength="8" name="Quantity_' . $OrderLine->LineNumber . '" required="required" size="6" title="' . _('Enter the quantity of this item ordered by the customer') . '" type="text" value="' . locale_number_format($OrderLine->Quantity,$OrderLine->DecimalPlaces) . '" />';
if ($QtyRemain != $QtyOrdered){
echo '<br />' . locale_number_format($OrderLine->QtyInv,$OrderLine->DecimalPlaces) .' ' . _('of') . ' ' . locale_number_format($OrderLine->Quantity,$OrderLine->DecimalPlaces).' ' . _('invoiced');
}
echo '</td>
<td class="number">' . locale_number_format($OrderLine->QOHatLoc,$OrderLine->DecimalPlaces) . '</td>
<td>' . $OrderLine->Units . '</td>';
/*OK to display with discount if it is an internal user with appropriate permissions */
/* if (in_array($_SESSION['PageSecurityArray']['OrderEntryDiscountPricing'], $_SESSION['AllowedPageSecurityTokens'])){*/
if ($ShowDiscountGP){
echo '<td><input class="number" maxlength="16" name="Price_' . $OrderLine->LineNumber . '" required="required" size="16" title="' . _('Enter the price to charge the customer for this item') . '" type="text" value="' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '" /></td>
<td class="number">' . implode ("<br>", $last3) . '</td>
------------------------------------------------------------------------------