Esempio n. 1
0
 /**
  * Creates a reclamation PDF and puts it on the FTP
  * Returns true if operation succeds
  * @param int $nbr
  * @return boolean   
  */
 public function sendReclamation($nbr)
 {
     $foretag_id = $this->getId();
     try {
         $fileName = $this->createReclamationPDF($nbr);
         $localFile = FORETAGSFIL_LOCAL_PATH . "/" . $fileName;
         $serverFile = FORETAGSFIL_REMOTE_PATH . "/" . $fileName;
         if (Foretag::uploadFilesFTP('reclamation', $localFile, $serverFile)) {
             Misc::logMotiomera("Reclamation order, {$nbr} pedomerters,  foretag_id: {$foretag_id}", 'ok');
             return true;
         } else {
             return false;
         }
     } catch (Exception $e) {
         Misc::logMotiomera("Problem with reclamation order, {$nbr} pedomerters,  foretag_id: {$foretag_id} " . $e, 'error');
         return false;
     }
 }