Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.45k stars 2.79k forks source link

Bug: list of last modified products, price incl. tax never shown #9678

Closed torvista closed 4 years ago

torvista commented 6 years ago

Bug

When a product price has its base as TTC/incl. tax, this is never shown in the last modified list, it is always shown as HT/excl.tax.

Steps to reproduce the behavior

Edit a product for price with tax. Edit a product with a price without tax. Compare in list. https://.../htdocs/product/index.php?mainmenu=products&leftmenu=

Suggested Correction

The code for this is: htdocs/product/index.php

if (isset($objp->price_base_type) && $objp->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC");
                else print price($objp->price).' '.$langs->trans("HT");

But $objp->price_base_type and $objp->price_ttc are never set.

Suggest

$max=15;
$sql = "SELECT p.rowid, p.label, p.price, p.price_ttc, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.tobatch, p.fk_price_expression,";
$sql.= " p.entity,";

is changed to

$max=15;
$sql = "SELECT p.rowid, p.label, p.price, p.price_ttc, p.price_base_type, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.tobatch, p.fk_price_expression,";
$sql.= " p.entity,";

Also, just prior to the output code block

if (isset($objp->price_base_type) && $objp->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC");)

is some code for price with expresssion. This may also need to be considered.

Environment

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. Without comment, this issue will be closed automatically by stale bot in 15 days.

R0drig0V1 commented 3 years ago

Dear @eldy,

This has not been repaired :c