ShoppinPal / StockUp

StockUp [try it out at https://stockup-staging.shoppinpal.com] is the only open source product that delivers 100% automated replenishment, integrations with leading POS and ERPs, and a smooth web application that can be used by your entire Ops crew and external suppliers. Our customers have saved countless hours that would be otherwise lost in grappling with Excel, along with huge increase in accountability. Feel free to clone the project and write to us at stockup@shoppinpal.com with what you'd like to achieve and how we can help!
GNU General Public License v2.0
57 stars 22 forks source link

Beta Test - Week 3 - Feedback #164

Open pulkitsinghal opened 8 years ago

pulkitsinghal commented 8 years ago

These are in no particular order:

pulkitsinghal commented 8 years ago

[1:35 PM] Brandon Lehman: Glitch in fulfillment: [1:37 PM] Brandon Lehman: So, @pulkit, after removing via "Delete" button in Fulfillment, looking at items in box, then going back to remaining items; all deleted items are back in "remaining".

pulkitsinghal commented 8 years ago

@elbrando - here is the rough script to start deleting reports:

// (1) remove the relevant lineitems based on report name which STARTS_WITH_THIS_PREFIX
db.getCollection('ReportModel')
.find({
    name: {$regex: /^STARTS_WITH_THIS_PREFIX/i}
})
.forEach(function(elem){
    //printjson(elem);
    print(
        'before delete, total # of lineitems for "' + elem.name + '": ' +
        db.getCollection('StockOrderLineitemModel').count({"reportId":elem._id})
    )
    db.getCollection('StockOrderLineitemModel').remove({"reportId":elem._id});
    print(
        'after delete, total # of lineitems for "' + elem.name + '": ' +
        db.getCollection('StockOrderLineitemModel').count({"reportId":elem._id})
    )
});

// (2) remove the report itself which STARTS_WITH_THIS_PREFIX
db.getCollection('ReportModel')
.remove({
    name: {$regex: /^STARTS_WITH_THIS_PREFIX/i}
});

If you want to remove by id then instead of matching on: name: {$regex: /^STARTS_WITH_THIS_PREFIX/i} ... just match on: _id: ObjectId('YOUR_REPORT_ID')

You can also substitute name: {$exists:false} to find all reports that do NOT have a name and just get rid of them and their corresponding lineitems. We can run this together if you'd like.

pulkitsinghal commented 8 years ago

Ran this for you via robomongo:

// (1)
db.getCollection('ReportModel')
.find({
    name: {$exists:false}
})
.forEach(function(row){
    //printjson(row);
    print(
        'before delete, total # of lineitems for "' + row.name + '": ' +
        db.getCollection('StockOrderLineitemModel').count({"reportId":row._id})
    )
    db.getCollection('StockOrderLineitemModel').remove({"reportId":row._id});
    print(
        'after delete, total # of lineitems for "' + row.name + '": ' +
        db.getCollection('StockOrderLineitemModel').count({"reportId":row._id})
    )
});
// (2)
db.getCollection('ReportModel')
.remove({
    name: {$exists:false}
});
pulkitsinghal commented 8 years ago

@elbrando - adding your comments here:

[Aug-3 9:05 AM] Brandon Lehman: 1) addon products to existing order. 2) separate supplies order. Newish UI methodology. This is for future reference

pulkitsinghal commented 8 years ago

[9:11 AM] Brandon Lehman: 2 notes from receiving: 1) Tracking "variance" 2) Clerk login per store (clerks do most of stocking shipment)