jmueller17 / Aixada

Aixada helps self-managed consumption cooperatives to organize their flow of products, money, and information.
Other
33 stars 37 forks source link

Orderable products without stock should not be visible in shop_and_order #231

Closed dmanubens-zz closed 5 years ago

dmanubens-zz commented 6 years ago

When using the direct shoping tab for stock products, the user is allowed to pick any of the prodcuts from any provider, regardless they are only orderable. Maybe I missunderstood the logic, but I think orderable products should be disabled in that tab. Am I right?

I have tested following change in https://github.com/jmueller17/Aixada/blob/master/shop_and_order.php#L436:

if (orderType == 2 || (preventOutofStock == true && orderType == 1 && stockActual <=0)) {
    $(row).addClass('dim60');
    $('td', row).addClass('ui-state-highlight');
    $('input', row).attr('disabled','disabled');
    $('td:eq(1)', row).empty().append("<?php echo $Text['no_stock']; ?>");
}

and effectively orderable items appear out of stock. Is this ok? @jorix

jorix commented 6 years ago

Pues lo he probado ahora y funciona...

NOTA: Este control es poco sofisticado. No evita comprar más cantidad de lo que hay en estoc, ni que haya otras compras pendientes de validar que sumadas superen el estoc. En definitiva no impide que el estoc quede en negativo si se da alguna de las dos circunstancias mencionadas.

dmanubens-zz commented 6 years ago

Si, prevent_out_of_stock es true, y utilizamos lacistella-master. En realidad para que me funcione he cambiado la condicion mencionada por if ((orderType == 2 && what=="Shop")) || ...

Quizas no me explicado bien, pero lo que quiero evitar es que en 'Compra avui' aparezca producto de 'Comanda directa', solo quiero que se vea producto de 'Estoc'.

jorix commented 6 years ago

@dmanubens : si, entiendo, y es lógico
(disculpa hice una lectura "rápida").

Prueba solo con eb78a69368bbdf83839e4aff133224a97567ce98 , así solo se muestra los productos de estoc. (evita que se muestran productos de pedido)

Comunicad si os funciona, y lo propondré como una opción de configuración $use_shop = 'only_stock';

dmanubens-zz commented 5 years ago

@jorix funciona! muchas gracias

jorix commented 5 years ago

Resuelto con #232 que ya está en master