bonjour j'ai trouvé un bug sur le total du poids et du volume dans les bons de livraison.
(problème d'unité et de valeur)
| Code: |
--- /dolibarr/htdocs/expedition/fiche.php 2008-08-21 09:39:38.000000000 +0200
+++ /newdolibarr/htdocs/expedition/fiche.php 2008-10-27 16:06:50.000000000 +0100
@@ -511,13 +540,26 @@
//TODO: ajouter conversion pour le poids et le volume et selection de l'unité de mesure la plus utilisée
$totalWeight = '';
$totalVolume = '';
+ $weightUnit=-20;
+ $volumeUnit=-20;
for ($i = 0 ; $i < $num_prod ; $i++)
{
- $totalWeight += $lignes[$i]->weight*$lignes[$i]->qty_shipped;
+ if ( $lignes[$i]->weight_units > $weightUnit)
+ {
$weightUnit = $lignes[$i]->weight_units;
- $totalVolume += $lignes[$i]->volume*$lignes[$i]->qty_shipped;
+ }
+ $trueWeightUnit=pow(10,$lignes[$i]->weight_units);
+ $totalWeight += $lignes[$i]->weight*$lignes[$i]->qty_shipped*$trueWeightUnit;
+
+ if ( $lignes[$i]->volume_units > $volumeUnit)
+ {
$volumeUnit = $lignes[$i]->volume_units;
}
+ $trueVolumeUnit=pow(10,$lignes[$i]->volume_units);
+ $totalVolume += $lignes[$i]->volume*$lignes[$i]->qty_shipped*$trueVolumeUnit;
+ }
+ $totalVolume=$totalVolume*pow(10,3);
print '<table class="border" width="100%">'; |
oups post a déplacer dans bug