diff --git a/admin/history.php b/admin/history.php index 58c3675..31bf700 100644 --- a/admin/history.php +++ b/admin/history.php @@ -169,12 +169,13 @@ if ($filter > 0) { } $sql = "SELECT pp.rowid, pp.fk_product, pp.date_price, pp.price, pp.price_ttc, pp.tva_tx, pp.price_base_type,"; -$sql .= " p.ref, p.label as product_label,"; +$sql .= " p.ref, p.label as product_label, pe.preisbot_margin,"; $sql .= " (SELECT pp2.price FROM ".MAIN_DB_PREFIX."product_price pp2"; $sql .= " WHERE pp2.fk_product = pp.fk_product AND pp2.date_price < pp.date_price"; $sql .= " ORDER BY pp2.date_price DESC LIMIT 1) as old_price"; $sql .= " FROM ".MAIN_DB_PREFIX."product_price pp"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = pp.fk_product"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields pe ON pe.fk_object = pp.fk_product"; $sql .= " WHERE pp.price_label = 'Preisbot'"; $sql .= $sqlFilter; $sql .= " ORDER BY pp.date_price DESC"; @@ -190,6 +191,7 @@ if ($resql && $db->num_rows($resql) > 0) { print ''.$langs->trans("PreviousPrice").''; print ''.$langs->trans("NewPrice").''; print ''.$langs->trans("Diff").''; + print ''.$langs->trans("PreisBotMinMargin").''; print ''.$langs->trans("VAT").''; print ''; @@ -215,6 +217,7 @@ if ($resql && $db->num_rows($resql) > 0) { print ''.(!is_null($oldPrice) ? number_format($oldPrice, 2, ',', '.').' €' : '-').''; print ''.number_format($newPrice, 2, ',', '.').' €'; print ''.$diffStr.''; + print ''.(!is_null($obj->preisbot_margin) ? number_format((float)$obj->preisbot_margin, 0).' %' : '-').''; print ''.number_format((float)$obj->tva_tx, 0).' %'; print ''; }