public function processcancellation()
 {
     $db = PDOQuery::getInstance();
     $db->connect();
     $query = $this->getcancellationType();
     $sqlIN = "INSERT INTO sales \t\n\t\t\t\t\t\t(id_product, id_product_related, id_category, id_employee, id_payment_type, id_sale_type, id_shop_session, id_shop, quantity, \n\t\t\t\t\t\t price ,amount, invoice, date_sale, note, position)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t(:id_product, :id_product_related, :id_category, :id_employee, :id_payment_type, \n\t\t\t\t\t\t\t:id_sale_type, :id_shop_session, :id_shop,\n\t\t\t\t\t\t\t:quantity, :price , :amount,\n\t\t\t\t\t\t\t:invoice, " . time() . ", :note, :product_position)";
     $stmt1 = $db->prepareQuery($sqlIN);
     $stmt1->execute(array(':id_product' => $this->id_product, ':id_product_related' => $this->id_product_related, ':id_category' => $this->id_category, ':id_employee' => $this->id_employee, ':id_payment_type' => $this->id_payment_type, ':id_sale_type' => $this->id_sale_type, ':id_shop_session' => $this->shop_session_id, ':id_shop' => $_SESSION['id_shop'], ':quantity' => $this->quantity, ':price' => $this->price, ':amount' => $this->amount, ':invoice' => $this->invoice, ':note' => $this->note, ':product_position' => Product::getProductPosition($this->shop_session_id)));
     $sqlUP = "UPDATE stock_available\n\t\t\t\t\t" . $query . "\n\t\t\t\t\tWHERE id_shop =  :id_shop\n\t\t\t\t\tAND id_product IN (:id_product, :id_product_related)";
     $stmt2 = $db->prepareQuery($sqlUP);
     $stmt2->execute(array(':id_shop' => $this->id_shop, ':id_product' => $this->id_product, ':id_product_related' => $this->id_product_related));
     $db->close();
     if ($stmt1 && $stmt2) {
         header('Location: cancel.php?success=true');
         exit;
     }
     return false;
 }