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; $insert_obj->staffno = $_SESSION['staff_no']; $insert_obj->date = time(); $insert_obj->staffid = $_SESSION['staff_id']; $insert_obj->data = $po->get_serialize_po();