Fix Bug : repository (stock) the delta was rounded

This commit is contained in:
sparkyx 2025-09-10 10:25:59 +02:00
parent 95a79ae252
commit e9535840c1
5 changed files with 15 additions and 6 deletions

View file

@ -252,7 +252,14 @@ class Stock extends Stock_Sql
return $sql . $clause;
}
/**
* @brief Display the status of the repository : nb of item IN / OUT and Difference
* @global $cn (Database) Db connexion
* @global $g_user (Noalyss_User) connected user
* @param $p_array (array)
* - [state_exercice] => 2025-12-31 date
- [present] => L type of presentation T table, L listing
*/
function summary($p_array)
{
global $cn, $g_user;

View file

@ -78,7 +78,7 @@ for ($r=0;$r<count($a_repo);$r++) {
$export->add($a);
$export->add($a_stock[$s]['qin'],"number");
$export->add($a_stock[$s]['qout'],"number");
$export->add(bcsub($a_stock[$s]['qin'],$a_stock[$s]['qout']),"number");
$export->add(bcsub($a_stock[$s]['qin'],$a_stock[$s]['qout'],4),"number");
$export->write();
}
}

View file

@ -28,6 +28,8 @@
if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
global $cn,$g_parameter,$g_user;
$http=new HttpInput();
// Show the form
// Get by exercice
// Get type = table or list
@ -38,14 +40,14 @@ $per->load();
$date_limit=$per->limit_year($per->p_exercice);
$last_day=$per->last_day($date_limit['end']);
$last_day=format_date($last_day,'DD.MM.YYYY','YYYY-MM-DD');
$iexercice->selected=(isset($_GET['state_exercice']))?$_GET['state_exercice']:$last_day;
$iexercice->selected=$http->get('state_exercice',"string",$last_day);
$presentation=new ISelect("present");
$presentation->value=array (
array("value"=>"T","label"=>"Tableau récapitulatif"),
array("value"=>"L","label"=>"Liste")
);
$presentation->selected=(isset($_GET['present']))?$_GET['present']:"T";
$presentation->selected=$http->get("present","string","T");
require_once NOALYSS_TEMPLATE.'/stock_state_search.php';
$stock=new Stock($cn);

View file

@ -95,7 +95,7 @@ $a_repo=$cn->get_array("select distinct t.r_id,r_name,r_adress,r_city,r_country,
</td>
<td class="num">
<?php echo nbm(bcsub($a_stock[$s]['qin'],$a_stock[$s]['qout']))?>
<?php echo nbm(bcsub($a_stock[$s]['qin'],$a_stock[$s]['qout'],4))?>
</td>
</tr>
<?php endfor; ?>

View file

@ -89,7 +89,7 @@
<?php echo _("DIFF")?> :
</td>
<td class="num">
<?php echo nbm((bcsub($array[0]['s_qin']??0,$array[0]['s_qout']??0)))?>
<?php echo nbm((bcsub($array[0]['s_qin']??0,$array[0]['s_qout']??0,4)))?>
</td>
</tr>
</table>