Merge pull request #22408 from Quentin-Seekness/patch-3
Stock at date estimated value calculation
This commit is contained in:
commit
8715d484bf
@ -243,7 +243,7 @@ $num = 0;
|
|||||||
|
|
||||||
$title = $langs->trans('StockAtDate');
|
$title = $langs->trans('StockAtDate');
|
||||||
|
|
||||||
$sql = 'SELECT p.rowid, p.ref, p.label, p.description, p.price,';
|
$sql = 'SELECT p.rowid, p.ref, p.label, p.description, p.price, p.pmp,';
|
||||||
$sql .= ' p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,';
|
$sql .= ' p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,';
|
||||||
$sql .= ' p.tms as datem, p.duration, p.tobuy, p.stock, ';
|
$sql .= ' p.tms as datem, p.duration, p.tobuy, p.stock, ';
|
||||||
if ($fk_warehouse > 0) {
|
if ($fk_warehouse > 0) {
|
||||||
@ -565,12 +565,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||||||
|
|
||||||
// PMP value
|
// PMP value
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if (price2num($objp->estimatedvalue, 'MT')) {
|
if (price2num($stock * $objp->pmp, 'MT')) {
|
||||||
print '<span class="amount">'.price(price2num($objp->estimatedvalue, 'MT'), 1).'</span>';
|
print '<span class="amount">'.price(price2num($stock * $objp->pmp, 'MT'), 1).'</span>';
|
||||||
} else {
|
} else {
|
||||||
print '';
|
print '';
|
||||||
}
|
}
|
||||||
$totalbuyingprice += $objp->estimatedvalue;
|
$totalbuyingprice += $stock * $objp->pmp;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Selling value
|
// Selling value
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user