} }); // ------------------------------- Tax Types ------------------------------- // ------------------------------- Tax Groups ------------------------------- // Tax Groups // Get All Tax Groups $rest->get('/taxgroups/', function () use($rest) { global $req; include_once API_ROOT . "/taxgroups.inc"; $page = $req->get("page"); if ($page == null) { taxgroups_all(); } else { // If page = 1 the value will be 0, if page = 2 the value will be 1, ... $from = --$page * RESULTS_PER_PAGE; taxgroups_all($from); } }); // ------------------------------- Tax Groups ------------------------------- // ------------------------------- Customers ------------------------------- // Customers // Get Customer General Info $rest->get('/customers/:id', function ($id) use($rest) { include_once API_ROOT . "/customers.inc"; customer_get($id); }); // All Customers $rest->get('/customers/', function () use($rest) { global $req; include_once API_ROOT . "/customers.inc"; $page = $req->get("page");
// ------------------------------- Tax Types ------------------------------- // Tax Types // Get All Item Tax Types $rest->get('/taxtypes/', function () use($rest) { global $path_to_root; include_once $path_to_root . "/modules/api/taxtypes.inc"; taxtypes_all(); }); // ------------------------------- Tax Types ------------------------------- // ------------------------------- Tax Groups ------------------------------- // Tax Groups // Get All Tax Groups $rest->get('/taxgroups/', function () use($rest) { global $path_to_root; include_once $path_to_root . "/modules/api/taxgroups.inc"; taxgroups_all(); }); // ------------------------------- Tax Groups ------------------------------- // ------------------------------- Customers ------------------------------- // Customers // Get Customer General Info $rest->get('/customers/:id', function ($id) use($rest) { global $path_to_root; include_once $path_to_root . "/modules/api/customers.inc"; customer_get($id); }); // Add Customer $rest->post('/customers/', function ($id) use($rest) { global $path_to_root; include_once $path_to_root . "/modules/api/customers.inc"; customer_add();