debug checkbox + use textfields in the to order column

This commit is contained in:
Cédric Salvador 2013-07-05 11:17:53 +02:00
parent 6bf95db95e
commit 9ff183d432
2 changed files with 9 additions and 9 deletions

View File

@ -308,7 +308,7 @@ if ($resql) {
$sortfield,
$sortorder
);
print_liste_field_titre($langs->trans('StockToBuy'),
print_liste_field_titre($langs->trans('Ordered'),
'replenish.php',
'',
$param,
@ -317,7 +317,7 @@ if ($resql) {
$sortfield,
$sortorder
);
print_liste_field_titre($langs->trans('Ordered'),
print_liste_field_titre($langs->trans('StockToBuy'),
'replenish.php',
'',
$param,
@ -419,11 +419,11 @@ if ($resql) {
}
//depending on conf, use either physical stock or
//virtual stock to compute the stock to buy value
$stocktobuy = $objp->desiredstock - $stock;
if($ordered) {
$stocktobuy = max($objp->desiredstock - $stock - $ordered, 0);
$disabled = '';
if($ordered > 0) {
$picto = img_picto('','tick');
if($ordered >= $stocktobuy) {
if($ordered + $stock >= $objp->desiredstock) {
$disabled = 'disabled="disabled"';
}
} else {
@ -456,11 +456,12 @@ if ($resql) {
'<td align="right">',
$stock,
'</td>',
'<td align="right">', $warning, $stocktobuy , '</td>',
'<input type="hidden" name="tobuy' . $i . '" value="' . $stocktobuy . '" >',
'<td align="right">',
$ordered, ' ', $picto,
'</td>',
'<td align="right">', $warning,
'<input type="text" name="tobuy' . $i . '" value="' . $stocktobuy . '" ' . $disabled . '>',
'</td>',
'<td align="right">',
$form->select_product_fourn_price($prod->id,
'fourn' . $i,

View File

@ -90,7 +90,6 @@ $sql .= ') LEFT JOIN ' . MAIN_DB_PREFIX . 'user as u ';
$sql .= 'ON cf.fk_user_author = u.rowid';
$sql .= ' WHERE cf.fk_soc = s.rowid ';
$sql .= ' AND cf.entity = ' . $conf->entity;
$sql .= ' AND cf.source = 42';
if ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) {
$sql .= ' AND cf.fk_statut < 3';