Пример #1
0
// ------------------------------- Sales Order Entry -------------------------------
// Sales
// Get Sales Header and Details
$rest->get('/sales/:trans_no/:trans_type', function ($trans_no, $trans_type) use($rest) {
    include_once API_ROOT . "/sales.inc";
    sales_get($trans_no, $trans_type);
});
// Insert Sales
$rest->post('/sales/', function () use($rest) {
    include_once API_ROOT . "/sales.inc";
    sales_add();
});
// Edit Sales
$rest->put('/sales/:trans_no/:trans_type', function ($trans_no, $trans_type) use($rest) {
    include_once API_ROOT . "/sales.inc";
    sales_edit($trans_no, $trans_type);
});
// Cancel Sales
$rest->delete('/sales/:branch_id/:uuid', function ($branch_id, $uuid) use($rest) {
    include_once API_ROOT . "/sales.inc";
    sales_cancel($branch_id, $uuid);
});
// All Sales
$rest->get('/sales/:trans_type/', function ($trans_type) use($rest) {
    global $req;
    include_once API_ROOT . "/sales.inc";
    $page = $req->get("page");
    if ($page == null) {
        sales_all($trans_type);
    } else {
        // If page = 1 the value will be 0, if page = 2 the value will be 1, ...
Пример #2
0
 public function put($rest, $trans_no, $trans_type)
 {
     include_once API_ROOT . "/sales.inc";
     sales_edit($trans_no, $trans_type);
 }