Uniformisation lignes de commande, propal, facture

This commit is contained in:
Laurent Destailleur 2005-08-14 03:02:34 +00:00
parent 1f1e49204c
commit 95239fcd48
2 changed files with 70 additions and 56 deletions

View File

@ -600,7 +600,7 @@ if ($_GET['propalid'])
* Lignes de propale * Lignes de propale
* *
*/ */
$sql = 'SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice,"; $sql = 'SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice,';
$sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid'; $sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid';
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt'; $sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid';

View File

@ -622,7 +622,7 @@ else
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
// Update ligne de propale // Affiche ligne de commande en mode non edit
if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid) if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid)
{ {
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
@ -673,17 +673,31 @@ else
print '</tr>'; print '</tr>';
} }
// Update ligne de commande // Affiche ligne de commande en mode non edit
if ($_GET["action"] == 'editline' && $_GET["rowid"] == $objp->rowid) if ($_GET["action"] == 'editline' && $_GET["rowid"] == $objp->rowid)
{ {
print "<form action=\"fiche.php?id=$id\" method=\"post\">"; print "<form action=\"fiche.php?id=$id\" method=\"post\">";
print '<input type="hidden" name="action" value="updateligne">'; print '<input type="hidden" name="action" value="updateligne">';
print '<input type="hidden" name="elrowid" value="'.$_GET["rowid"].'">'; print '<input type="hidden" name="elrowid" value="'.$_GET["rowid"].'">';
print '<tr '.$bc[$var].'>'; print "<tr $bc[$var]>";
print '<td colspan="2"><textarea name="eldesc" cols="60" rows="2">'.stripslashes($objp->description).'</textarea></td>'; print '<td>';
print '<td align="right"><input size="7" type="text" class="flat" name="elprice" value="'.price($objp->subprice).'"></td>'; if ($objp->fk_product > 0)
print '<td align="right"><input size="4" type="text" class="flat" name="elqty" value="'.$objp->qty.'"></td>'; {
print '<td align="right"><input size="3" type="text" class="flat" name="elremise_percent" value="'.$objp->remise_percent.'">%</td>'; print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
if ($objp->fk_product_type) print img_object($langs->trans('ShowService'),'service');
else print img_object($langs->trans('ShowProduct'),'product');
print ' '.$objp->ref.'</a>';
print ' - '.stripslashes(nl2br($objp->product));
print '<br>';
}
print '<textarea name="eldesc" cols="50" rows="1">'.stripslashes($objp->description).'</textarea></td>';
print '<td align="right">';
//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 '</td>';
print '<td align="right"><input size="5" type="text" class="flat" name="elprice" value="'.price($objp->subprice).'"></td>';
print '<td align="right"><input size="2" type="text" class="flat" name="elqty" value="'.$objp->qty.'"></td>';
print '<td align="right" nowrap><input size="1" type="text" class="flat" name="elremise_percent" value="'.$objp->remise_percent.'">%</td>';
print '<td align="center" colspan="3"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td>'; print '<td align="center" colspan="3"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td>';
print '</tr>'; print '</tr>';
print '</form>'; print '</form>';