Merge pull request #22408 from Quentin-Seekness/patch-3

Stock at date estimated value calculation
This commit is contained in:
Laurent Destailleur 2022-10-06 12:12:39 +02:00 committed by GitHub
commit 8715d484bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,7 +243,7 @@ $num = 0;
$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.tms as datem, p.duration, p.tobuy, p.stock, ';
if ($fk_warehouse > 0) {
@ -565,12 +565,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
// PMP value
print '<td class="right">';
if (price2num($objp->estimatedvalue, 'MT')) {
print '<span class="amount">'.price(price2num($objp->estimatedvalue, 'MT'), 1).'</span>';
if (price2num($stock * $objp->pmp, 'MT')) {
print '<span class="amount">'.price(price2num($stock * $objp->pmp, 'MT'), 1).'</span>';
} else {
print '';
}
$totalbuyingprice += $objp->estimatedvalue;
$totalbuyingprice += $stock * $objp->pmp;
print '</td>';
// Selling value