diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index 40452a4bab6..5652bf0e589 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -216,7 +216,7 @@ if ($_GET["action"] == 'create') for ($i = 1 ; $i <= PROPALE_NEW_FORM_NB_PRODUCT ; $i++) { print '
| '.$langs->trans('Description').' | '; print ''.$langs->trans('VAT').' | '; print ''.$langs->trans('PriceUHT').' | '; print ''.$langs->trans('Qty').' | '; print ''.$langs->trans('Discount').' | '; print ''.$langs->trans('AmountHT').' | '; - print ''; - print " | '; + print "\n"; + } + $var=true; + while ($i < $num) + { + $objp = $db->fetch_object($resql); + $var=!$var; + // Affiche ligne de commande en mode non edit if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid) { print ' | ||||||||||||||
| ';
if ($objp->fk_product_type) print img_object($langs->trans('ShowService'),'service');
else print img_object($langs->trans('ShowProduct'),'product');
print ' '.$objp->ref.' - '.stripslashes(nl2br($objp->product));
print ($objp->description && $objp->description!=$objp->product)?' '.$objp->description:''; print ' | ';
- }
- else
- {
- print ''.stripslashes(nl2br($objp->description)); - print " | \n"; - } - print ''.$objp->tva_tx.'% | '; - - print ''.price($objp->subprice)." | \n"; - - print ''.$objp->qty.' | '; - - if ($objp->remise_percent > 0) - { - print ''.$objp->remise_percent."% | \n"; - } - else - { - print ''; - } + } + else + { + print ' | '.stripslashes(nl2br($objp->description)); + print " | \n"; + } + print ''.$objp->tva_tx.'% | '; + + print ''.price($objp->subprice)." | \n"; + + print ''.$objp->qty.' | '; + + if ($objp->remise_percent > 0) + { + print ''.$objp->remise_percent."% | \n"; + } + else + { + print ''; + } print ' | '.price($objp->subprice*$objp->qty*(100-$objp->remise_percent)/100)." | \n"; - + // Icone d'edition et suppression - if ($commande->statut == 0 && $user->rights->commande->creer && $_GET["action"] == '') - { - print ''; - print img_edit(); - print ' | '; - print ''; - print img_delete(); - print ' | '; - } - else - { - print ''; - } + if ($commande->statut == 0 && $user->rights->commande->creer && $_GET["action"] == '') + { + print ' | '; + print img_edit(); + print ' | '; + print ''; + print img_delete(); + print ' | '; + } + else + { + print ''; + } print ' | ||
| ';
- if ($objp->fk_product > 0)
- {
- print '';
- if ($objp->fk_product_type) print img_object($langs->trans('ShowService'),'service');
- else print img_object($langs->trans('ShowProduct'),'product');
- print ' '.$objp->ref.'';
- print ' - '.stripslashes(nl2br($objp->product));
- print ' '; - } - print ' | ';
- print ''; - //print $html->select_tva("tva_tx",$objp->tva_taux); - print $objp->tva_tx."%"; // Taux tva dépend du produit, donc on ne doit pas pouvoir le changer ici - print ' | '; - print ''; - print ' | '; - print ' | % | '; - print ''; + if ($_GET["action"] == 'editline' && $_GET["rowid"] == $objp->rowid) + { + print " | ||||||||||||||||
| ';
+ if ($objp->fk_product > 0)
+ {
+ print '';
+ if ($objp->fk_product_type) print img_object($langs->trans('ShowService'),'service');
+ else print img_object($langs->trans('ShowProduct'),'product');
+ print ' '.$objp->ref.'';
+ print ' - '.stripslashes(nl2br($objp->product));
+ print ' '; + } + print ' | ';
+ print ''; + //print $html->select_tva("tva_tx",$objp->tva_taux); + print $objp->tva_tx."%"; // Taux tva dépend du produit, donc on ne doit pas pouvoir le changer ici + print ' | '; + print ''; + print ' | '; + print ' | % | '; + print ''; print ' | ||||||||||||||||
| '.$langs->trans('Description').' | '; print ''.$langs->trans('VAT').' | '; @@ -728,32 +728,32 @@ else print ''; print ' | '; print " | ||||||||||||||||||
| '; - print ' | '; - print $html->select_tva("tva_tx",$conf->defaulttx); - print ' | '; - print ''; - print ' | '; - print ' | % | '; - print ''; - print ' | '; + print $html->select_tva("tva_tx",$conf->defaulttx); + print ' | '; + print ''; + print ' | '; + print ' | % | '; + print ''; + print ''; + print ' | |||||||||||
| '; $html->select_produits('','p_idprod','',20); @@ -761,188 +761,188 @@ else print ''; print ' | '; print ''; - print ' | '; - print ' | % | '; - print ''; + print ' | % | '; + print ''; + print "\n"; + print ' | |||||||||||||||
';
-
- /*
- * Documents générés
- *
- */
- $file = $conf->commande->dir_output . "/" . $commande->ref . "/" . $commande->ref . ".pdf";
- $relativepath = $commande->ref."/".$commande->ref.".pdf";
-
- $var=true;
-
- if (file_exists($file))
- {
-
- print_titre($langs->trans("Documents"));
- print '
'; - } - - /* - * Liste des factures - */ - $sql = "SELECT f.rowid,f.facnumber, f.total_ttc, ".$db->pdate("f.datef")." as df"; - $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."co_fa as cf"; - $sql .= " WHERE f.rowid = cf.fk_facture AND cf.fk_commande = ". $commande->id; - - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - if ($num) - { - print_titre($langs->trans("RelatedBills")); - $i = 0; $total = 0; - print '
| ';
-
- /*
- * Liste des expéditions
- */
- $sql = "SELECT e.rowid,e.ref,".$db->pdate("e.date_expedition")." as de";
- $sql .= " FROM ".MAIN_DB_PREFIX."expedition as e";
- $sql .= " WHERE e.fk_commande = ". $commande->id;
-
- $result = $db->query($sql);
- if ($result)
- {
- $num = $db->num_rows($result);
- if ($num)
- {
- print_titre($langs->trans("Sendings"));
- $i = 0; $total = 0;
- print '
|
';
+
+ /*
+ * Documents générés
+ *
+ */
+ $file = $conf->commande->dir_output . "/" . $commande->ref . "/" . $commande->ref . ".pdf";
+ $relativepath = $commande->ref."/".$commande->ref.".pdf";
+
+ $var=true;
+
+ if (file_exists($file))
+ {
+
+ print_titre($langs->trans("Documents"));
+ print '
'; + } + + /* + * Liste des factures + */ + $sql = "SELECT f.rowid,f.facnumber, f.total_ttc, ".$db->pdate("f.datef")." as df"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."co_fa as cf"; + $sql .= " WHERE f.rowid = cf.fk_facture AND cf.fk_commande = ". $commande->id; + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + if ($num) + { + print_titre($langs->trans("RelatedBills")); + $i = 0; $total = 0; + print '
| ';
+
+ /*
+ * Liste des expéditions
+ */
+ $sql = "SELECT e.rowid,e.ref,".$db->pdate("e.date_expedition")." as de";
+ $sql .= " FROM ".MAIN_DB_PREFIX."expedition as e";
+ $sql .= " WHERE e.fk_commande = ". $commande->id;
+
+ $result = $db->query($sql);
+ if ($result)
+ {
+ $num = $db->num_rows($result);
+ if ($num)
+ {
+ print_titre($langs->trans("Sendings"));
+ $i = 0; $total = 0;
+ print '
|