Merge pull request #20080 from Easya-Solutions/new-total-mark-rate-in-list
NEW total mark rate in list
This commit is contained in:
commit
ab2d3460d7
@ -1486,8 +1486,11 @@ if ($resql) {
|
|||||||
) {
|
) {
|
||||||
$with_margin_info = true;
|
$with_margin_info = true;
|
||||||
}
|
}
|
||||||
|
$total_ht = 0;
|
||||||
|
$total_margin = 0;
|
||||||
|
|
||||||
while ($i < min($num, $limit)) {
|
$last_num = min($num, $limit);
|
||||||
|
while ($i < $last_num) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$objectstatic->id = $obj->rowid;
|
$objectstatic->id = $obj->rowid;
|
||||||
@ -1541,6 +1544,8 @@ if ($resql) {
|
|||||||
if ($with_margin_info === true) {
|
if ($with_margin_info === true) {
|
||||||
$objectstatic->fetch_lines();
|
$objectstatic->fetch_lines();
|
||||||
$marginInfo = $formmargin->getMarginInfosArray($objectstatic);
|
$marginInfo = $formmargin->getMarginInfosArray($objectstatic);
|
||||||
|
$total_ht += $obj->total_ht;
|
||||||
|
$total_margin += $marginInfo['total_margin'];
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -1959,7 +1964,7 @@ if ($resql) {
|
|||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['pos'][$totalarray['nbfield']] = 'total_margin';
|
$totalarray['pos'][$totalarray['nbfield']] = 'total_margin';
|
||||||
}
|
}
|
||||||
$totalarray['val']['total_margin'] += $marginInfo['total_margin'];
|
$totalarray['val']['total_margin'] = $total_margin;
|
||||||
}
|
}
|
||||||
// Total margin rate
|
// Total margin rate
|
||||||
if (!empty($arrayfields['total_margin_rate']['checked'])) {
|
if (!empty($arrayfields['total_margin_rate']['checked'])) {
|
||||||
@ -1974,6 +1979,16 @@ if ($resql) {
|
|||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['pos'][$totalarray['nbfield']] = 'total_mark_rate';
|
||||||
|
}
|
||||||
|
if ($i >= $last_num - 1) {
|
||||||
|
if (!empty($total_ht)) {
|
||||||
|
$totalarray['val']['total_mark_rate'] = price2num($total_margin * 100 / $total_ht, 'MT');
|
||||||
|
} else {
|
||||||
|
$totalarray['val']['total_mark_rate'] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
|
|||||||
@ -1463,8 +1463,11 @@ if ($resql) {
|
|||||||
) {
|
) {
|
||||||
$with_margin_info = true;
|
$with_margin_info = true;
|
||||||
}
|
}
|
||||||
|
$total_ht = 0;
|
||||||
|
$total_margin = 0;
|
||||||
|
|
||||||
while ($i < min($num, $limit)) {
|
$last_num = min($num, $limit);
|
||||||
|
while ($i < $last_num) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$notshippable = 0;
|
$notshippable = 0;
|
||||||
@ -1510,6 +1513,8 @@ if ($resql) {
|
|||||||
if ($with_margin_info === true) {
|
if ($with_margin_info === true) {
|
||||||
$generic_commande->fetch_lines();
|
$generic_commande->fetch_lines();
|
||||||
$marginInfo = $formmargin->getMarginInfosArray($generic_commande);
|
$marginInfo = $formmargin->getMarginInfosArray($generic_commande);
|
||||||
|
$total_ht += $obj->total_ht;
|
||||||
|
$total_margin += $marginInfo['total_margin'];
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -1879,6 +1884,16 @@ if ($resql) {
|
|||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['pos'][$totalarray['nbfield']] = 'total_mark_rate';
|
||||||
|
}
|
||||||
|
if ($i >= $last_num - 1) {
|
||||||
|
if (!empty($total_ht)) {
|
||||||
|
$totalarray['val']['total_mark_rate'] = price2num($total_margin * 100 / $total_ht, 'MT');
|
||||||
|
} else {
|
||||||
|
$totalarray['val']['total_mark_rate'] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
|
|||||||
@ -1651,8 +1651,11 @@ if ($resql) {
|
|||||||
) {
|
) {
|
||||||
$with_margin_info = true;
|
$with_margin_info = true;
|
||||||
}
|
}
|
||||||
|
$total_ht = 0;
|
||||||
|
$total_margin = 0;
|
||||||
|
|
||||||
while ($i < min($num, $limit)) {
|
$last_num = min($num, $limit);
|
||||||
|
while ($i < $last_num) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$datelimit = $db->jdate($obj->datelimite);
|
$datelimit = $db->jdate($obj->datelimite);
|
||||||
@ -1740,6 +1743,8 @@ if ($resql) {
|
|||||||
if ($with_margin_info === true) {
|
if ($with_margin_info === true) {
|
||||||
$facturestatic->fetch_lines();
|
$facturestatic->fetch_lines();
|
||||||
$marginInfo = $formmargin->getMarginInfosArray($facturestatic);
|
$marginInfo = $formmargin->getMarginInfosArray($facturestatic);
|
||||||
|
$total_ht += $obj->total_ht;
|
||||||
|
$total_margin += $marginInfo['total_margin'];
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven"';
|
print '<tr class="oddeven"';
|
||||||
@ -2231,6 +2236,16 @@ if ($resql) {
|
|||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['pos'][$totalarray['nbfield']] = 'total_mark_rate';
|
||||||
|
}
|
||||||
|
if ($i >= $last_num - 1) {
|
||||||
|
if (!empty($total_ht)) {
|
||||||
|
$totalarray['val']['total_mark_rate'] = price2num($total_margin * 100 / $total_ht, 'MT');
|
||||||
|
} else {
|
||||||
|
$totalarray['val']['total_mark_rate'] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user