diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 1144d5e0..c101e828 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -177,6 +177,27 @@ PO todo todo: restock required feature dialog? See notes case 3849 + +Create a view for this: + +Query: +create view arestock_required as select apartwarehouse.name, apartstocklevel.minimumquantity, apart.partnumber, vpartinventorynow.balance, apurchaseorderitem.quantityordered, +apartstocklevel.minimumquantity - (coalesce(vpartinventorynow.balance, 0) + (coalesce(apurchaseorderitem.quantityordered, 0))) as requiredquantity +from +vpartinventorynow +left join apart on vpartinventorynow.partid=apart.id +left join apartwarehouse on vpartinventorynow.partwarehouseid = apartwarehouse.id +left join apartstocklevel on vpartinventorynow.partid=apartstocklevel.partid and vpartinventorynow.partwarehouseid=apartstocklevel.partwarehouseid +left join apurchaseorderitem on vpartinventorynow.partid=apurchaseorderitem.partid and vpartinventorynow.partwarehouseid=apurchaseorderitem.partwarehouseid +where apartstocklevel.minimumquantity is not null + +Then apply where clause to view at runtime to select vendor: +select * from arestock_required where apart.wholesalerid=8 or apart.manufacturerid=8 or apart.alternativewholesalerid=8 + + + + + todo: MIGRATE_OUTSTANDING note for part requests feature maybe add UI button etc for it even with no actual list / form or whatever todo: can edit po number but if I set an existing po number 4 to 23 for example and the last autogenerated is 22 it will happily make another 23 so there are now two