include_once API_ROOT . "/inventory.inc";
    stock_adjustment_add();
});
// ------------------------------- Stock Adjustments -------------------------------
// ------------------------------- Item Categories -------------------------------
// Get Items Categories
$rest->get('/category/', function () use($rest) {
    global $req;
    include_once API_ROOT . "/category.inc";
    $page = $req->get("page");
    if ($page == null) {
        category_all(null);
    } else {
        // If page = 1 the value will be 0, if page = 2 the value will be 1, ...
        $from = --$page * RESULTS_PER_PAGE;
        category_all($from);
    }
});
// Get Specific Item Category
$rest->get('/category/:id', function ($id) use($rest) {
    include_once API_ROOT . "/category.inc";
    category_get($id);
});
// Add Item Category
$rest->post('/category/', function () use($rest) {
    include_once API_ROOT . "/category.inc";
    category_add();
});
// Edit Item Category
$rest->put('/category/:id', function ($id) use($rest) {
    include_once API_ROOT . "/category.inc";
Beispiel #2
0
});
// ------------------------------- Inventory Locations -------------------------------
// ------------------------------- Stock Adjustments -------------------------------
// Add Stock Adjustment
$rest->post('/stock/', function () use($rest) {
    global $path_to_root;
    include_once $path_to_root . "/modules/api/inventory.inc";
    stock_adjustment_add();
});
// ------------------------------- Stock Adjustments -------------------------------
// ------------------------------- Item Categories -------------------------------
// Get Items Categories
$rest->get('/category/', function () use($rest) {
    global $path_to_root;
    include_once $path_to_root . "/modules/api/category.inc";
    category_all();
});
// Get Specific Item Category
$rest->get('/category/:id', function ($id) use($rest) {
    global $path_to_root;
    include_once $path_to_root . "/modules/api/category.inc";
    category_get($id);
});
// Add Item Category
$rest->post('/category/', function () use($rest) {
    global $path_to_root;
    include_once $path_to_root . "/modules/api/category.inc";
    category_add();
});
// Edit Item Category
$rest->put('/category/:id', function ($id) use($rest) {