function generateReqItem($parReqId, $parUserType) { $parDate = date("Y-m-d H:i:s"); $nM = searchMedia($this->bd, $matMedia, $this->media); $parStatus = 'B'; // $this->price = $this->price - $matMedia[0]->getPrice(); // trim media price (occasionally) embedded in image price // when evaluating cart item price. $userType = $parUserType; if (($this->price or $matMedia[0]->getPrice()) and $userType != 1) { $parStatus = 'Q'; } // Manager (UserType =1) // doesn't need allowance; // Q is the Request Item Status // correspondin to Quality Contro Test - priced items only $objReqI = new RequestItem($this->bd); $objReqI->fill($parReqId, $this->sceneId, $this->productId, $this->bands, $this->sceneShift, $this->corretion, $this->orientation, $this->resampling, $this->datum, $this->projection, $this->longOrigin, $this->latOrigin, $this->stdLat1, $this->stdLat2, $this->format, $this->inter, $this->media, $this->price, $parDate, $parStatus, $parDate, $this->restoration); if (!$objReqI->insert()) { //Deletar todos os pedidos e itens // Modificar o estado do pedido e dos demais itens do cart return false; } return true; }