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, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre($langs->trans('StockToBuy'), print_liste_field_titre($langs->trans('Ordered'),
'replenish.php', 'replenish.php',
'', '',
$param, $param,
@ -317,7 +317,7 @@ if ($resql) {
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre($langs->trans('Ordered'), print_liste_field_titre($langs->trans('StockToBuy'),
'replenish.php', 'replenish.php',
'', '',
$param, $param,
@ -419,11 +419,11 @@ if ($resql) {
} }
//depending on conf, use either physical stock or //depending on conf, use either physical stock or
//virtual stock to compute the stock to buy value //virtual stock to compute the stock to buy value
$stocktobuy = $objp->desiredstock - $stock; $stocktobuy = max($objp->desiredstock - $stock - $ordered, 0);
$disabled = '';
if($ordered) { if($ordered > 0) {
$picto = img_picto('','tick'); $picto = img_picto('','tick');
if($ordered >= $stocktobuy) { if($ordered + $stock >= $objp->desiredstock) {
$disabled = 'disabled="disabled"'; $disabled = 'disabled="disabled"';
} }
} else { } else {
@ -456,11 +456,12 @@ if ($resql) {
'<td align="right">', '<td align="right">',
$stock, $stock,
'</td>', '</td>',
'<td align="right">', $warning, $stocktobuy , '</td>',
'<input type="hidden" name="tobuy' . $i . '" value="' . $stocktobuy . '" >',
'<td align="right">', '<td align="right">',
$ordered, ' ', $picto, $ordered, ' ', $picto,
'</td>', '</td>',
'<td align="right">', $warning,
'<input type="text" name="tobuy' . $i . '" value="' . $stocktobuy . '" ' . $disabled . '>',
'</td>',
'<td align="right">', '<td align="right">',
$form->select_product_fourn_price($prod->id, $form->select_product_fourn_price($prod->id,
'fourn' . $i, '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 .= 'ON cf.fk_user_author = u.rowid';
$sql .= ' WHERE cf.fk_soc = s.rowid '; $sql .= ' WHERE cf.fk_soc = s.rowid ';
$sql .= ' AND cf.entity = ' . $conf->entity; $sql .= ' AND cf.entity = ' . $conf->entity;
$sql .= ' AND cf.source = 42';
if ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) { if ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) {
$sql .= ' AND cf.fk_statut < 3'; $sql .= ' AND cf.fk_statut < 3';