diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index fc24e7f29b0..a5cf9fe059e 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2755,7 +2755,11 @@ else
}
print "\n";
}
+
+ // VAT
print '
'.vatrate($objp->tva_taux,'%',$objp->info_bits).' | ';
+
+ // Unit price
print ''.price($objp->subprice)." | \n";
print '';
if (($objp->info_bits & 2) != 2)
diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index 6d7d9ca4fe3..9310962c5bd 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -795,72 +795,121 @@ else
print '';
}
+ // Show product and description
+ $type=$fac->lignes[$i]->product_type?$fac->lignes[$i]->product_type:$fac->lignes[$i]->fk_product_type;
+ // Try to enhance type detection using date_start and date_end for free lines where type
+ // was not saved.
+ if (! empty($fac->lignes[$i]->date_start)) $type=1;
+ if (! empty($fac->lignes[$i]->date_end)) $type=1;
+
$var=!$var;
- // Ligne en modification
+
+ // Edit line
if ($fac->statut == 0 && $_GET['action'] == 'mod_ligne' && $_GET['etat'] == '0' && $_GET['ligne_id'] == $fac->lignes[$i]->rowid)
{
print '';
}
else // Affichage simple de la ligne
{
print ' | ';
+
+ // Show product and description
print '';
if ($fac->lignes[$i]->fk_product)
{
- $productstatic->id=$fac->lignes[$i]->fk_product;
- $productstatic->type=$fac->lignes[$i]->product_type;
- //$productstatic->ref=$fac->lignes[$i]->ref;
- //print $productstatic->getNomUrl(1).' ('.$fac->lignes[$i]->ref_fourn.') - '.$fac->lignes[$i]->libelle;
- $productstatic->ref=$fac->lignes[$i]->libelle;
- print $productstatic->getNomUrl(1);
+ $product_static=new ProductFournisseur($db);
+ $product_static->fetch($fac->lignes[$i]->fk_product);
+ $text=$product_static->getNomUrl(1);
+ $text.= ' - '.$product_static->libelle;
+ print $text;
+ print ' ';
}
- else
+
+ // Description - Editor wysiwyg
+ if (! $fac->lignes[$i]->fk_product)
{
- print nl2br($fac->lignes[$i]->description);
+ if ($type==1) $text = img_object($langs->trans('Service'),'service');
+ else $text = img_object($langs->trans('Product'),'product');
+ print $text.' '.nl2br($fac->lignes[$i]->description);
+
+ // Show range
+ print_date_range($fac->lignes[$i]->date_start,$fac->lignes[$i]->date_end);
}
print ' | ';
+
+ // VAT
print ''.vatrate($fac->lignes[$i]->tva_taux).'% | ';
+
+ // Unit price
print ''.price($fac->lignes[$i]->pu_ht,'MU').' | ';
+
print ''.($fac->lignes[$i]->pu_ttc?price($fac->lignes[$i]->pu_ttc,'MU'):' ').' | ';
+
print ''.$fac->lignes[$i]->qty.' | ';
+
print ''.price($fac->lignes[$i]->total_ht).' | ';
+
print ''.price($fac->lignes[$i]->total_ttc).' | ';
+
print '';
if ($fac->statut == 0) print ''.img_edit().'';
else print ' ';
print ' | ';
+
print '';
if ($fac->statut == 0) print ''.img_delete().'';
else print ' ';
print ' | ';
+
print '
';
}