How to use the warehouse.name function in warehouse

To help you get started, we’ve selected a few warehouse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github EasyERP / EasyERP_open_source / handlers / stockTransactions.js View on Github external
var filterMapper = new FilterMapper();

        var keys;
        var sort;
        var options;

        obj.$and = [];
        obj.$and.push({_type: 'stockTransactions'});

        if (data && data.filter) {
            obj.$and.push(filterMapper.mapFilter(data.filter, 'stockTransactions'));
        }

        if (quickSearch) {
            regExp = new RegExp(quickSearch, 'ig');
            matchObject['warehouse.name'] = {
                $regex: regExp
            };
        }

        if (data.sort) {
            keys = Object.keys(data.sort)[0];
            data.sort[keys] = parseInt(data.sort[keys], 10);
            sort = data.sort;
        } else {
            sort = {'createdBy.date': -1};
        }

        options = {
            match      : obj,
            matchObject: matchObject,
            sort       : sort,