Ejemplo n.º 1
0
    glaccounttypes_all();
});
// ------------------------------- GL Accounts -------------------------------
// ------------------------------- Currencies -------------------------------
// Currencies
// Get All Currencies
$rest->get('/currencies/', function () use($rest) {
    global $req;
    include_once API_ROOT . "/currencies.inc";
    $page = $req->get("page");
    if ($page == null) {
        currencies_all();
    } else {
        // If page = 1 the value will be 0, if page = 2 the value will be 1, ...
        $from = --$page * RESULTS_PER_PAGE;
        currencies_all($from);
    }
});
// Get Specific Currency
$rest->get('/currencies/:id', function ($id) use($rest) {
    include_once API_ROOT . "/currencies.inc";
    currencies_get($id);
});
// Get Last Exchange Rate
$rest->get('/exrates/:curr_abrev', function ($curr_abrev) use($rest) {
    include_once API_ROOT . "/currencies.inc";
    currencies_last_exrate($curr_abrev);
});
// ------------------------------- Currencies -------------------------------
// ------------------------------- Inventory Costs -------------------------------
// Inventory Costs
Ejemplo n.º 2
0
    glaccounts_get($id);
});
// Get GL Account Types
$rest->get('/glaccounttypes/', function () use($rest) {
    global $path_to_root;
    include_once $path_to_root . "/modules/api/glaccounts.inc";
    glaccounttypes_all();
});
// ------------------------------- GL Accounts -------------------------------
// ------------------------------- Currencies -------------------------------
// Currencies
// Get All Currencies
$rest->get('/currencies/', function () use($rest) {
    global $path_to_root;
    include_once $path_to_root . "/modules/api/currencies.inc";
    currencies_all();
});
// Get Specific Currency
$rest->get('/currencies/:id', function ($id) use($rest) {
    global $path_to_root;
    include_once $path_to_root . "/modules/api/currencies.inc";
    currencies_get($id);
});
// Get Last Exchange Rate
$rest->get('/exrates/:curr_abrev', function ($curr_abrev) use($rest) {
    global $path_to_root;
    include_once $path_to_root . "/modules/api/currencies.inc";
    currencies_last_exrate($curr_abrev);
});
// ------------------------------- Currencies -------------------------------
// ------------------------------- Inventory Costs -------------------------------