diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index e079cea3a35..608749dea83 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -179,7 +179,7 @@ if ($action == 'create') while ($i < $num) { $objp = $db->fetch_object( $i); - $opt .= "\n"; + $opt .= "\n"; $i++; } } @@ -193,11 +193,12 @@ if ($action == 'create') print_titre("Services/Produits"); print '
| Produit | Quan. | Remise |
| '; - print ' | '; + print ' | % | '; } print "
| Réf | Produit | "; - print 'Prix | Tva | Qté. | '; + print 'Tva | Qté. | Remise | P.U. | '; if ($propal->statut == 0) { print ""; } print " |
| [$objp->ref] | \n"; + print "[$objp->ref] | \n"; print ''.$objp->product.' | '; - print "".price($objp->price)." | "; print ''.$objp->tva_tx.' % | '; print "".$objp->qty." | \n"; + print ''.$objp->remise_percent.' % | '; + print ''.price($objp->subprice).' | '; if ($obj->statut == 0 && $user->rights->propale->creer) { print 'Supprimer | '; @@ -389,11 +382,10 @@ if ($propalid) } } - $sql = "SELECT pt.rowid, pt.description, pt.price, pt.qty, pt.tva_tx"; + $sql = "SELECT pt.rowid, pt.description, pt.price, pt.qty, pt.tva_tx, pt.remise_percent"; $sql .= " FROM llx_propaldet as pt WHERE pt.fk_propal = $propalid AND pt.fk_product = 0"; - $result = $db->query($sql); - if ($result) + if ($db->query($sql)) { $num = $db->num_rows(); $i = 0; @@ -403,9 +395,10 @@ if ($propalid) $var=!$var; print "|
| \n"; print ' | '.$objp->description.' | '; - print "".price($objp->price)." | "; print ''.$objp->tva_tx.' % | '; print "".$objp->qty." | \n"; + print ''.$objp->remise_percent.' % | '; + print "".price($objp->price)." | "; if ($obj->statut == 0 && $user->rights->propale->creer) { print 'Supprimer | '; @@ -432,7 +425,7 @@ if ($propalid) while ($i < $num) { $objp = $db->fetch_object( $i); - $opt .= "\n"; + $opt .= "\n"; $i++; } } @@ -444,7 +437,7 @@ if ($propalid) } /* - * Produits génériques + * Produits * */ $var=!$var; @@ -453,17 +446,25 @@ if ($propalid) print '||
| '; print ' | '; - print ' | '; + print ' | '; print $html->select_tva("np_tva_tx") . ' | '; print ''; + print ' | % | '; + print ''; print ' | '; print ' |
| Numéro : | |||||||||
| Numéro : | Provisoire | ||||||||
| Conditions de réglement : | "; $sql = "SELECT rowid, libelle FROM llx_cond_reglement ORDER BY sortorder"; $result = $db->query($sql); @@ -624,8 +628,8 @@ else * */ - $sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux"; - $sql .= " FROM llx_facturedet as l WHERE l.fk_facture = $facid"; + $sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.remise_percent, l.subprice"; + $sql .= " FROM llx_facturedet as l WHERE l.fk_facture = $facid ORDER BY l.rowid"; $result = $db->query($sql); if ($result) @@ -637,10 +641,11 @@ else if ($num) { print " | ||||||||
| Description | '; - print 'Tva Tx | '; + print 'Description | '; + print 'Tva | '; print 'Quantité | '; - print 'Montant | '; + print 'Remise | '; + print 'P.U. | '; print ''; print " | '.$objp->tva_taux.' % | '; print ''.$objp->qty.' | '; - print ''.price($objp->price)." | \n"; + if ($objp->remise_percent > 0) + { + print ''.$objp->remise_percent." % | \n"; + } + else + { + print ''; + } + print ' | '.price($objp->subprice)." | \n"; if ($fac->statut == 0) { print 'del | '; @@ -678,9 +691,10 @@ else print ''; print ''; print "
| '; + print ' | '; print ' | '; - print ' | '; + print ' | % | '; + print ''; print ' | '; print ' | |||