Esempio n. 1
0
    bankaccounts_get($id);
});
// ------------------------------- Bank Accounts -------------------------------
// ------------------------------- GL Accounts -------------------------------
// GL Accounts
// Get GL Accounts
$rest->get('/glaccounts/', function () use($rest) {
    global $req;
    include_once API_ROOT . "/glaccounts.inc";
    $page = $req->get("page");
    if ($page == null) {
        glaccounts_all();
    } else {
        // If page = 1 the value will be 0, if page = 2 the value will be 1, ...
        $from = --$page * RESULTS_PER_PAGE;
        glaccounts_all($from);
    }
});
// Get Specific GL Account
$rest->get('/glaccounts/:id', function ($id) use($rest) {
    include_once API_ROOT . "/glaccounts.inc";
    glaccounts_get($id);
});
// Get GL Account Types
$rest->get('/glaccounttypes/', function () use($rest) {
    include_once API_ROOT . "/glaccounts.inc";
    glaccounttypes_all();
});
// ------------------------------- GL Accounts -------------------------------
// ------------------------------- Currencies -------------------------------
// Currencies
Esempio n. 2
0
    bankaccounts_all();
});
// Get Specific Bank Account
$rest->get('/bankaccounts/:id', function ($id) use($rest) {
    global $path_to_root;
    include_once $path_to_root . "/modules/api/bankaccounts.inc";
    bankaccounts_get($id);
});
// ------------------------------- Bank Accounts -------------------------------
// ------------------------------- GL Accounts -------------------------------
// GL Accounts
// Get GL Accounts
$rest->get('/glaccounts/', function () use($rest) {
    global $path_to_root;
    include_once $path_to_root . "/modules/api/glaccounts.inc";
    glaccounts_all();
});
// Get Specific GL Account
$rest->get('/glaccounts/:id', function ($id) use($rest) {
    global $path_to_root;
    include_once $path_to_root . "/modules/api/glaccounts.inc";
    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 -------------------------------