Esempio n. 1
0
    print_error('[x][po001]Invalid PO number');
    exit;
}
switch ($po_action) {
    case 'deletepo':
        //check user permission, and this function is for office
        if (!require_office()) {
            print_error('[x][er003]Permission Deny for Retail Shop');
        }
        //get po detail
        if (!$po_no) {
            print_error('[x][po002]No PO number');
            exit;
        }
        $po = new po($po_no);
        if ($po->get_errmsg()) {
            print_error($po->get_errmsg());
            exit;
        }
        $po_data = $po->get_po();
        //print_object(unserialize($po_data_sered));
        switch ($po_data->postate_no) {
            //after get po data, check the poState_no is = 1, is mean 開啟 -- 等待到貨, with can delete it directly
            case 1:
                //save the data to db and delete the record
                $serialize_po = '';
                $serialize_po = $po->get_serialize_po();
                if (!empty($serialize_po)) {
                    $insert_obj = new stdClass();
                    $insert_obj->receipttype = 'po';
                    $insert_obj->receiptno = $po_data->po_no;