Skip to content
Snippets Groups Projects
Commit 4f1c3f77 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: Add more information on stock values.

parent 678a64c5
No related branches found
No related tags found
No related merge requests found
...@@ -464,7 +464,8 @@ $resql=$db->query($sql); ...@@ -464,7 +464,8 @@ $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i=0; $total=0; $var=false; $total=$totalwithpmp;
$i=0; $var=false;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
...@@ -474,8 +475,8 @@ if ($resql) ...@@ -474,8 +475,8 @@ if ($resql)
print '<td>'.$entrepotstatic->getNomUrl(1).'</td>'; print '<td>'.$entrepotstatic->getNomUrl(1).'</td>';
print '<td align="right">'.$obj->reel.($obj->reel<0?' '.img_warning():'').'</td>'; print '<td align="right">'.$obj->reel.($obj->reel<0?' '.img_warning():'').'</td>';
// PMP // PMP
print '<td align="right">'.price2num(($obj->pmp > 0 ? $obj->pmp : $product->pmp),'MU').'</td>'; // Ditto : Show PMP from movement or from product print '<td align="right">'.(price2num($obj->pmp)?price2num($obj->pmp,'MU'):'').'</td>'; // Ditto : Show PMP from movement or from product
print '<td align="right">'.price(price2num(($obj->pmp > 0 ? $obj->pmp : $product->pmp)*$obj->reel,'MT')).'</td>'; // Ditto : Show PMP from movement or from product print '<td align="right">'.(price2num($obj->pmp)?price(price2num($obj->pmp*$obj->reel,'MT')):'').'</td>'; // Ditto : Show PMP from movement or from product
// Sell price // Sell price
print '<td align="right">'; print '<td align="right">';
if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print price(price2num($product->price,'MU')); if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print price(price2num($product->price,'MU'));
...@@ -485,9 +486,10 @@ if ($resql) ...@@ -485,9 +486,10 @@ if ($resql)
if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print price(price2num($product->price*$obj->reel,'MT')).'</td>'; // Ditto : Show PMP from movement or from product if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print price(price2num($product->price*$obj->reel,'MT')).'</td>'; // Ditto : Show PMP from movement or from product
else print $langs->trans("Variable"); else print $langs->trans("Variable");
print '</tr>'; ; print '</tr>'; ;
$total = $total + $obj->reel; $total += $obj->reel;
$totalvalue = $totalvalue + price2num(($obj->pmp > 0 ? $obj->pmp : $product->pmp)*$obj->reel,'MT'); // Ditto : Show PMP from movement or from product if (price2num($obj->pmp)) $totalwithpmp += $obj->reel;
$totalvaluesell = $totalvaluesell + price2num($product->price*$obj->reel,'MT'); // Ditto : Show PMP from movement or from product $totalvalue = $totalvalue + price2num($obj->pmp*$obj->reel,'MU'); // Ditto : Show PMP from movement or from product
$totalvaluesell = $totalvaluesell + price2num($product->price*$obj->reel,'MU'); // Ditto : Show PMP from movement or from product
$i++; $i++;
$var=!$var; $var=!$var;
} }
...@@ -496,17 +498,17 @@ else dol_print_error($db); ...@@ -496,17 +498,17 @@ else dol_print_error($db);
print '<tr class="liste_total"><td align="right" class="liste_total">'.$langs->trans("Total").':</td>'; print '<tr class="liste_total"><td align="right" class="liste_total">'.$langs->trans("Total").':</td>';
print '<td class="liste_total" align="right">'.$total.'</td>'; print '<td class="liste_total" align="right">'.$total.'</td>';
print '<td class="liste_total" align="right">'; print '<td class="liste_total" align="right">';
print ($total?price($totalvalue/$total):'&nbsp;'); print ($totalwithpmp?price($totalvalue/$totalwithpmp):'&nbsp;');
print '</td>'; print '</td>';
print '<td class="liste_total" align="right">'; print '<td class="liste_total" align="right">';
print price($totalvalue); print price(price2num($totalvalue,'MT'));
print '</td>'; print '</td>';
print '<td class="liste_total" align="right">'; print '<td class="liste_total" align="right">';
if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print ($total?price($totalvaluesell/$total):'&nbsp;'); if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print ($total?price($totalvaluesell/$total):'&nbsp;');
else print $langs->trans("Variable"); else print $langs->trans("Variable");
print '</td>'; print '</td>';
print '<td class="liste_total" align="right">'; print '<td class="liste_total" align="right">';
if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print price($totalvaluesell); if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print price(price2num($totalvaluesell,'MT'));
else print $langs->trans("Variable"); else print $langs->trans("Variable");
print '</td>'; print '</td>';
print "</tr>"; print "</tr>";
......
...@@ -110,7 +110,8 @@ if ($result) ...@@ -110,7 +110,8 @@ if ($result)
print '<td>'.$objp->lieu.'</td>'; print '<td>'.$objp->lieu.'</td>';
// PMP value // PMP value
print '<td align="right">'; print '<td align="right">';
print price(price2num($objp->estimatedvalue,'MT')); if (price2num($objp->estimatedvalue,'MT')) print price(price2num($objp->estimatedvalue,'MT'));
else print '';
print '</td>'; print '</td>';
// Selling value // Selling value
print '<td align="right">'; print '<td align="right">';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment