diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index 9310962c5bd..7e96496118f 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -35,7 +35,7 @@ if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php')
if (!$user->rights->fournisseur->facture->lire)
- accessforbidden();
+accessforbidden();
$langs->load('bills');
$langs->load('suppliers');
@@ -87,7 +87,7 @@ if ($_REQUEST['action'] == 'confirm_valid' && $_REQUEST['confirm'] == 'yes' && $
{
$facturefourn=new FactureFournisseur($db);
$facturefourn->fetch($_GET['facid']);
- $result = $facturefourn->set_valid($user);
+ $result = $facturefourn->set_valid($user);
}
if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes')
@@ -111,20 +111,20 @@ if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes')
if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'yes')
{
- if ($user->rights->fournisseur->facture->creer)
- {
- $facturefourn = new FactureFournisseur($db);
- $facturefourn->fetch($_GET['facid']);
- $facturefourn->deleteline($_GET['ligne_id']);
+ if ($user->rights->fournisseur->facture->creer)
+ {
+ $facturefourn = new FactureFournisseur($db);
+ $facturefourn->fetch($_GET['facid']);
+ $facturefourn->deleteline($_GET['ligne_id']);
$_GET['action'] = '';
- }
+ }
}
if ($_REQUEST['action'] == 'confirm_payed' && $_REQUEST['confirm'] == 'yes' && $user->rights->fournisseur->facture->creer)
{
$facturefourn=new FactureFournisseur($db);
$facturefourn->fetch($_GET['facid']);
- $facturefourn->set_payed($user);
+ $facturefourn->set_payed($user);
}
if($_GET['action'] == 'deletepaiement')
@@ -268,9 +268,9 @@ if ($_REQUEST['action'] == 'update_line')
$price_base_type='TTC';
}
- if ($_POST['idprod'])
- {
- $prod = new Product($db);
+ if ($_POST['idprod'])
+ {
+ $prod = new Product($db);
$prod->fetch($_POST['idprod']);
$label = $prod->libelle;
}
@@ -356,8 +356,8 @@ if ($_POST['action'] == 'classin')
/*
-* View
-*/
+ * View
+ */
llxHeader('','','');
@@ -504,7 +504,7 @@ else
print '
| '.$langs->trans('DateEcheance').' | ';
$html->select_date($fac->date_echeance,'ech','','','',"update");
- if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
+ if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
print ' |
';
print '| '.$langs->trans('AmountHT').' | '.price($fac->total_ht).' |
';
@@ -557,7 +557,7 @@ else
print '';
}
- print '';
+ print '';
}
else
{
@@ -573,8 +573,8 @@ else
// Confirmation de la suppression d'une ligne produit
if ($_GET['action'] == 'confirm_delete_line')
{
- $html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
- print '
';
+ $html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
+ print '
';
}
// Clone confirmation
@@ -605,8 +605,8 @@ else
}
/*
- * Confirmation de la suppression de la facture fournisseur
- */
+ * Confirmation de la suppression de la facture fournisseur
+ */
if ($_GET['action'] == 'delete')
{
$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete');
@@ -621,17 +621,17 @@ else
*/
print '';
- // Ref
- print '| '.$langs->trans("Ref").' | ';
+ // Ref
+ print ' |
| '.$langs->trans("Ref").' | ';
print $html->showrefnav($fac,'facid','',1,'rowid','ref',$morehtmlref);
- print ' | ';
- print "
\n";
+ print '';
+ print "\n";
- // Ref supplier
- print '| '.$langs->trans("RefSupplier").' | '.$fac->ref_supplier.' | ';
- print "
\n";
+ // Ref supplier
+ print '| '.$langs->trans("RefSupplier").' | '.$fac->ref_supplier.' | ';
+ print "
\n";
- // Societe
+ // Societe
print '| '.$langs->trans('Company').' | '.$societe->getNomUrl(1).' | ';
print ''.$langs->trans('OtherBills').' | ';
print '
';
@@ -647,7 +647,7 @@ else
print '';
print '| '.$langs->trans('DateEcheance').' | ';
print dol_print_date($fac->date_echeance,'daytext');
- if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
+ if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
print ' |
';
// Status
@@ -776,7 +776,7 @@ else
/*
* Lines of invoice
*/
- print '
';
+ print '
';
print '';
$var=1;
for ($i = 0 ; $i < sizeof($fac->lignes) ; $i++)
@@ -915,9 +915,16 @@ else
}
+ /*
+ * Form to add new line
+ */
+
if ($fac->statut == 0 && $_GET['action'] != 'mod_ligne')
{
- print '| '.$langs->trans('Label').' | ';
+ print '
';
+ print '| ';
+ print ''; // ancre
+ print $langs->trans('AddNewLine').' - '.$langs->trans("FreeZone").' | ';
print ''.$langs->trans('VAT').' | ';
print ''.$langs->trans('PriceUHT').' | ';
print ''.$langs->trans('PriceUTTC').' | ';
@@ -928,17 +935,35 @@ else
print ' | ';
print '
';
- /* Nouvelle ligne */
- $var=!$var;
+ // Add free products/services form
print '';
- // Ajout de produits/services predefinis
- if ($conf->produit->enabled)
- {
- print '';
- }
+ // Ajout de produits/services predefinis
+ if ($conf->produit->enabled)
+ {
+ print '';
+ print '| ';
+ print $langs->trans("AddNewLine").' - ';
+ if ($conf->service->enabled)
+ {
+ print $langs->trans('RecordedProductsAndServices');
+ }
+ else
+ {
+ print $langs->trans('RecordedProducts');
+ }
+ print ' | ';
+ print ''.$langs->trans('Qty').' | ';
+ print ' | ';
+ print ' | ';
+ print '
';
+
+ print '';
+ }
}
print '
';