diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 62fe55c7214..b50ac788322 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -766,7 +766,7 @@ else print "".strftime("%A %d %B %Y",$fac->date)."\n"; print "Date limite de réglement : " . strftime("%d %B %Y",$fac->date_lim_reglement) .""; - print 'Projet'; + print 'Projet'; if ($fac->projetid > 0) { $projet = New Project($db); @@ -777,15 +777,14 @@ else { print 'Classer la facture'; } - print " Paiements"; + print " "; - print "Auteur$author->fullname"; - - print ''; + print ''; /* * Paiements */ + print 'Paiements :
'; $sql = "SELECT ".$db->pdate("datep")." as dp, pf.amount,"; $sql .= "c.libelle as paiement_type, p.num_paiement, p.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as c, ".MAIN_DB_PREFIX."paiement_facture as pf"; @@ -806,11 +805,11 @@ else { $objp = $db->fetch_object( $i); $var=!$var; - print ""; + print ""; print ''.img_file().''; - print " ".strftime("%d %B %Y",$objp->dp)."\n"; - print "$objp->paiement_type $objp->num_paiement\n"; - print ''.price($objp->amount)."$_MONNAIE\n"; + print " ".strftime("%d %B %Y",$objp->dp)."\n"; + print "$objp->paiement_type $objp->num_paiement\n"; + print ''.price($objp->amount)."".MAIN_MONNAIE."\n"; print ""; $totalpaye += $objp->amount; $i++; @@ -818,13 +817,13 @@ else if ($fac->paye == 0) { - print "Total payé:".price($totalpaye)."$_MONNAIE\n"; - print "Facturé :".price($fac->total_ttc)."$_MONNAIE\n"; + print "Total déjà payé:".price($totalpaye)."".MAIN_MONNAIE."\n"; + print "Facturé :".price($fac->total_ttc)."".MAIN_MONNAIE."\n"; $resteapayer = $fac->total_ttc - $totalpaye; print "Reste à payer :"; - print "".price($resteapayer)."$_MONNAIE\n"; + print "".price($resteapayer)."".MAIN_MONNAIE."\n"; } print ""; $db->free(); @@ -834,23 +833,28 @@ else print ""; - print 'Remise globale'; + print "Auteur$author->fullname"; + + print 'Remise globale'; print ''.$fac->remise_percent.''; print '%'; - print 'Montant HT'; + print 'Montant HT'; print ''.price($fac->total_ht).''; print ''.MAIN_MONNAIE.' HT'; - print 'TVA'.price($fac->total_tva).''; + print 'TVA'.price($fac->total_tva).''; print ''.MAIN_MONNAIE.''; - print 'Montant TTC'.price($fac->total_ttc).''; + print 'Montant TTC'.price($fac->total_ttc).''; print ''.MAIN_MONNAIE.' TTC'; - print 'Statut'.($fac->get_libstatut()).''; + print 'Statut'.($fac->get_libstatut()).''; if ($fac->note) { - print 'Note : '.nl2br($fac->note).""; + print 'Note : '.nl2br($fac->note).""; } + else { + print ' '; + } print "
"; diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index a9725fbdc89..841dd3b0d8c 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -40,16 +40,16 @@ if ($action == 'add') { $product = new Product($db); - $product->ref = $HTTP_POST_VARS["ref"]; - $product->libelle = $HTTP_POST_VARS["libelle"]; - $product->price = $HTTP_POST_VARS["price"]; - $product->tva_tx = $HTTP_POST_VARS["tva_tx"]; - $product->type = $HTTP_POST_VARS["type"]; - $product->envente = $HTTP_POST_VARS["statut"]; - $product->description = $HTTP_POST_VARS["desc"]; - $product->duration_value = $HTTP_POST_VARS["duration_value"]; - $product->duration_unit = $HTTP_POST_VARS["duration_unit"]; - $product->seuil_stock_alerte = $HTTP_POST_VARS["seuil_stock_alerte"]; + $product->ref = $_POST["ref"]; + $product->libelle = $_POST["libelle"]; + $product->price = $_POST["price"]; + $product->tva_tx = $_POST["tva_tx"]; + $product->type = $_POST["type"]; + $product->envente = $_POST["statut"]; + $product->description = $_POST["desc"]; + $product->duration_value = $_POST["duration_value"]; + $product->duration_unit = $_POST["duration_unit"]; + $product->seuil_stock_alerte = $_POST["seuil_stock_alerte"]; $id = $product->create($user); $action = ''; @@ -59,8 +59,8 @@ if ($action == 'addinpropal') { $propal = New Propal($db); - $propal->fetch($HTTP_POST_VARS["propalid"]); - $result = $propal->insert_product($id, $HTTP_POST_VARS["qty"], $HTTP_POST_VARS["remise_percent"]); + $propal->fetch($_POST["propalid"]); + $result = $propal->insert_product($id, $_POST["qty"], $_POST["remise_percent"]); if ( $result < 0) { $mesg = "erreur $result"; @@ -73,7 +73,7 @@ if ($action == 'addinpropal') $action = ''; } -if ($HTTP_POST_VARS["action"] == 'addinfacture' && +if ($_POST["action"] == 'addinfacture' && ( $user->rights->facture->modifier || $user->rights->facture->creer)) { $product = new Product($db); @@ -81,11 +81,11 @@ if ($HTTP_POST_VARS["action"] == 'addinfacture' && $facture = New Facture($db); - $facture->fetch($HTTP_POST_VARS["factureid"]); - $facture->addline($HTTP_POST_VARS["factureid"], + $facture->fetch($_POST["factureid"]); + $facture->addline($_POST["factureid"], addslashes($product->libelle), $product->price, - $HTTP_POST_VARS["qty"], + $_POST["qty"], $product->tva_tx, $id); $action = ''; @@ -93,12 +93,12 @@ if ($HTTP_POST_VARS["action"] == 'addinfacture' && $mesg .= ''.$facture->ref.''; } -if ($HTTP_POST_VARS["action"] == 'add_fourn' && $cancel <> 'Annuler') +if ($_POST["action"] == 'add_fourn' && $cancel <> 'Annuler') { $product = new Product($db); if( $product->fetch($id) ) { - if ($product->add_fournisseur($user, $HTTP_POST_VARS["id_fourn"], $HTTP_POST_VARS["ref_fourn"]) > 0) + if ($product->add_fournisseur($user, $_POST["id_fourn"], $_POST["ref_fourn"]) > 0) { $action = ''; $mesg = 'Founisseur ajouté'; @@ -112,7 +112,7 @@ if ($HTTP_POST_VARS["action"] == 'add_fourn' && $cancel <> 'Annuler') } -if ($HTTP_POST_VARS["action"] == 'update' && +if ($_POST["action"] == 'update' && $cancel <> 'Annuler' && ( $user->rights->produit->modifier || $user->rights->produit->creer)) { @@ -120,15 +120,15 @@ if ($HTTP_POST_VARS["action"] == 'update' && if ($product->fetch($id)) { - $product->ref = $HTTP_POST_VARS["ref"]; - $product->libelle = $HTTP_POST_VARS["libelle"]; - $product->price = $HTTP_POST_VARS["price"]; - $product->tva_tx = $HTTP_POST_VARS["tva_tx"]; - $product->description = $HTTP_POST_VARS["desc"]; - $product->envente = $HTTP_POST_VARS["statut"]; - $product->seuil_stock_alerte = $HTTP_POST_VARS["seuil_stock_alerte"]; - $product->duration_value = $HTTP_POST_VARS["duration_value"]; - $product->duration_unit = $HTTP_POST_VARS["duration_unit"]; + $product->ref = $_POST["ref"]; + $product->libelle = $_POST["libelle"]; + $product->price = $_POST["price"]; + $product->tva_tx = $_POST["tva_tx"]; + $product->description = $_POST["desc"]; + $product->envente = $_POST["statut"]; + $product->seuil_stock_alerte = $_POST["seuil_stock_alerte"]; + $product->duration_value = $_POST["duration_value"]; + $product->duration_unit = $_POST["duration_unit"]; if ($product->check()) { @@ -151,13 +151,13 @@ if ($HTTP_POST_VARS["action"] == 'update' && } } -if ($HTTP_POST_VARS["action"] == 'update_price' && +if ($_POST["action"] == 'update_price' && $cancel <> 'Annuler' && ( $user->rights->produit->modifier || $user->rights->produit->creer)) { $product = new Product($db); $result = $product->fetch($id); - $product->price = $HTTP_POST_VARS["price"]; + $product->price = $_POST["price"]; if ( $product->update_price($id, $user) > 0 ) { @@ -219,7 +219,7 @@ if ($action == 'create') print ""; if ($_GET["type"] == 1) { - print "".'Durée'; + print "".'Durée  '; print 'jour '; print 'semaine '; print 'mois '; @@ -245,17 +245,30 @@ else { if ($action <> 'edit' && $action <> 're-edit') { + /* + * Fiche en visu + */ + + // Zone recherche print ''; print ''; - print '
'; + print '
'; print 'Réf :  '; - print '
'; + print '
'; print 'Libellé :  '; - print ' 
'; + print ''; + print '
'; + + print($mesg); + $head[0][0] = DOL_URL_ROOT."$PHP_SELF?id=".$id; + $head[0][1] = 'Fiche '.$types[$product->type].' : '.$product->ref; + $h = 1; + $a = 0; + + dolibarr_fiche_head($head, $a); - print_fiche_titre('Fiche '.$types[$product->type].' : '.$product->ref, $mesg); - + print ''; print ""; print ''; @@ -355,9 +368,11 @@ else print "
Référence'.$product->ref.'
"; } + print "
\n"; + if ($action == 'edit_price' && $user->rights->produit->creer) { - print '
Nouveau prix
'; + print '
Nouveau prix
'; print "
\n"; print ''; print ''; @@ -367,13 +382,14 @@ else print '
'; print '
'; } + /* * Ajouter un fournisseur * */ if ($action == 'ajout_fourn' && $user->rights->produit->creer) { - print_titre ("Ajouter un founisseur"); + print_titre ("Ajouter un fournisseur"); print "
\n"; print ''; print ''; @@ -389,7 +405,7 @@ else while ($i < $num) { $obj = $db->fetch_object( $i); - print '