FIX - totalarray
This commit is contained in:
parent
0880893319
commit
1fc644572d
@ -1415,8 +1415,11 @@ if ($resql) {
|
|||||||
// Détail commande
|
// Détail commande
|
||||||
$totalqty = 0;
|
$totalqty = 0;
|
||||||
|
|
||||||
|
$totalarray = array();
|
||||||
|
$totalarray['nbfield'] = 0;
|
||||||
|
$totalarray['val']['cdet.total_tva'] = 0;
|
||||||
|
$totalarray['val']['cdet.total_ttc'] = 0;
|
||||||
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||||
$last_num = min($num, $limit);
|
|
||||||
while ($i < $imaxinloop) {
|
while ($i < $imaxinloop) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
@ -1517,9 +1520,6 @@ if ($resql) {
|
|||||||
// Product QtyOrdered
|
// Product QtyOrdered
|
||||||
if (!empty($arrayfields['cdet.qty']['checked'])) {
|
if (!empty($arrayfields['cdet.qty']['checked'])) {
|
||||||
print '<td class="nowrap tdoverflowmax200">'.$obj->qty.'</td>';
|
print '<td class="nowrap tdoverflowmax200">'.$obj->qty.'</td>';
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['pos'][$totalarray['nbfield']] = 'cdet.qty';
|
$totalarray['pos'][$totalarray['nbfield']] = 'cdet.qty';
|
||||||
}
|
}
|
||||||
@ -1528,6 +1528,9 @@ if ($resql) {
|
|||||||
} else {
|
} else {
|
||||||
$totalarray['val']['cdet.qty'] = $obj->qty;
|
$totalarray['val']['cdet.qty'] = $obj->qty;
|
||||||
}
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
@ -1898,7 +1901,7 @@ if ($resql) {
|
|||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['pos'][$totalarray['nbfield']] = 'total_mark_rate';
|
$totalarray['pos'][$totalarray['nbfield']] = 'total_mark_rate';
|
||||||
}
|
}
|
||||||
if ($i >= $last_num - 1) {
|
if ($i >= $imaxinloop - 1) {
|
||||||
if (!empty($total_ht)) {
|
if (!empty($total_ht)) {
|
||||||
$totalarray['val']['total_mark_rate'] = price2num($total_margin * 100 / $total_ht, 'MT');
|
$totalarray['val']['total_mark_rate'] = price2num($total_margin * 100 / $total_ht, 'MT');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user