Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX : Display the real_PMP on inventory when its value is equal to 0 #22291

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FIX : PR Returns
  • Loading branch information
atm-adrien committed Jun 13, 2024
commit a50f66441954c102e650cbb70fc83007a0ded1a0
2 changes: 1 addition & 1 deletion htdocs/product/inventory/inventory.php
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ function barcodeserialforproduct(tabproduct,index,element,barcodeproductqty,sele
print '<td class="right">';


if ($obj->pmp_real >= 0) $pmp_real = $obj->pmp_real;
if (! empty($obj->pmp_real) || $obj->pmp_real == 0) $pmp_real = $obj->pmp_real;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If ( $obj->pmp_real) is null (never set), $obj->pmp_real == 0 will return true when we want false.
May be you want to do
if (! empty($obj->pmp_real) || (string) $obj->pmp_real === '0')

else $pmp_real = $product_static->pmp;
$pmp_valuation_real = $pmp_real * $qty_view;
print '<input type="text" class="maxwidth75 right realpmp'.$obj->fk_product.'" name="realpmp_'.$obj->rowid.'" id="id_'.$obj->rowid.'_input_pmp" value="'.price2num($pmp_real).'">';
Expand Down