diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index a69f2a6231b..fc24e7f29b0 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2636,7 +2636,7 @@ else /* - * Lignes de factures + * Lines of invoice */ $sql = 'SELECT l.fk_product, l.product_type, l.description, l.qty, l.rowid, l.tva_taux,'; $sql.= ' l.fk_remise_except,'; @@ -2644,6 +2644,7 @@ else $sql.= ' l.total_ht, l.total_tva, l.total_ttc,'; $sql.= ' '.$db->pdate('l.date_start').' as date_start,'; $sql.= ' '.$db->pdate('l.date_end').' as date_end,'; + $sql.= ' l.product_type,'; $sql.= ' p.ref, p.fk_product_type, p.label as product,'; $sql.= ' p.description as product_desc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; @@ -2657,11 +2658,12 @@ else $num_lignes = $db->num_rows($resql); $i = 0; $total = 0; + $product_static=new Product($db); + print '
| '.$langs->trans('Description').' | '; print ''.$langs->trans('VAT').' | '; @@ -2671,7 +2673,6 @@ else print ''.$langs->trans('TotalHT').' | '; print ''; print " | ';
print ''; // ancre pour retourner sur la ligne
- // Affiche ligne produit
- $text = '';
- if ($objp->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
- else $text.= img_object($langs->trans('ShowProduct'),'product');
- $text.= ' '.$objp->ref.'';
+ // Show product and description
+ $product_static->type=$objp->fk_product_type;
+ $product_static->id=$objp->fk_product;
+ $product_static->ref=$objp->ref;
+ $product_static->libelle=$objp->product;
+ $text=$product_static->getNomUrl(1);
$text.= ' - '.$objp->product;
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description));
- //print $description;
print $html->textwithtooltip($text,$description,3,'','',$i);
+
+ // Show range
print_date_range($objp->date_start,$objp->date_end);
- if ($conf->global->PRODUIT_DESC_IN_FORM)
- {
- print ($objp->description && $objp->description!=$objp->product)?' '.dol_htmlentitiesbr($objp->description):''; - } + + // Add description in form + if ($conf->global->PRODUIT_DESC_IN_FORM) print ($objp->description && $objp->description!=$objp->product)?' '.dol_htmlentitiesbr($objp->description):''; print ' | ';
}
@@ -2737,9 +2746,11 @@ else
}
else
{
- if ($objp->fk_product_type==1) $text = img_object($langs->trans('Service'),'service');
+ if ($type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
print $text.' '.nl2br($objp->description);
+
+ // Show range
print_date_range($objp->date_start,$objp->date_end);
}
print "\n";
@@ -2824,17 +2835,27 @@ else
print '|||||
| ';
print ''; // ancre pour retourner sur la ligne
+
+ // Show product and description
if ($objp->fk_product > 0)
{
print '';
- print '';
- if ($objp->fk_product_type==1) print img_object($langs->trans('ShowService'),'service');
- else print img_object($langs->trans('ShowProduct'),'product');
- print ' '.$objp->ref.'';
- print ' - '.nl2br($objp->product);
+ $product_static->type=$objp->fk_product_type;
+ $product_static->id=$objp->fk_product;
+ $product_static->ref=$objp->ref;
+ $product_static->libelle=$objp->product;
+ $text=$product_static->getNomUrl(1);
+ $text.= ' - '.$objp->product;
+ print $text;
print ' '; } - // éditeur wysiwyg + else + { + // TODO Select type (service or product) + + } + + // Description - Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) { require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); @@ -2849,10 +2870,16 @@ else print ''; } print ' | ';
+
+ // VAT
print ''; print $html->select_tva('tva_tx',$objp->tva_taux,$mysoc,$soc,'',$objp->info_bits); print ' | '; + + // Unit price print ''; + + print ' | '; if (($objp->info_bits & 2) != 2) { @@ -2860,6 +2887,7 @@ else } else print ' '; print ' | '; + print ''; if (($objp->info_bits & 2) != 2) { @@ -2867,6 +2895,7 @@ else } else print ' '; print ' | '; + print '';
print ' | ';
print ''; print "\n"; - // Ajout produit produits/services personalisés + // Add free products/services form print ' | |||