Esempio n. 1
0
 /**
  * Get Ticket Caja No Cuadrada
  * @param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator
  * @param string $operacion
  * @param \Tesoreria\Models\Registracion $objRegistracion
  * @param \Siris\Models\$ticketSiris[] $ticketSiris
  * @return \Siris\Models\Ticket[]
  */
 public static function getTicketCajaNoCuadrada($serviceLocator, $operacion, $objRegistracion = null, $ticketSiris = null)
 {
     self::init($serviceLocator);
     $hash = chunk_split($objRegistracion->getHashControl(), 5, ' ');
     $detalleSobrante = self::$detRegistracionDao->getOneObject(array("reg_registracion" => $objRegistracion->getId(), "ma_ba_maestro" => Constants::MA_BA_SOBRANTE));
     $texto = $ticketSiris[0]->texto;
     if (!is_null($detalleSobrante)) {
         $valor = number_format($detalleSobrante->getValor(), 2, ",", ".");
         $texto[] = "";
         $texto[] = $operacion . " CON SOBRANTE:  " . $valor;
     } else {
         $detalleFaltante = self::$detRegistracionDao->getOneObject(array("reg_registracion" => $objRegistracion->getId(), "ma_ba_maestro" => Constants::MA_BA_FALTANTE));
         if (!is_null($detalleFaltante)) {
             $valor = number_format($detalleFaltante->getValor(), 2, ",", ".");
             $texto[] = "";
             $texto[] = $operacion . " CON FALTANTE:  " . $valor;
         }
     }
     $maestroSaldo = Constants::MA_BA_SALDO_APERTURA;
     if ($operacion == "CIERRE") {
         $maestroSaldo = Constants::MA_BA_SALDO_CIERRE;
     }
     $detalleSaldo = self::$detRegistracionDao->getOneObject(array("reg_registracion" => $objRegistracion->getId(), "ma_ba_maestro" => $maestroSaldo));
     $saldo = number_format($detalleSaldo->getValor(), 2, ",", ".");
     $texto[] = "";
     $texto[] = "SALDO " . $operacion . ":  " . $saldo;
     $texto[] = "";
     $texto[] = "Control:  " . $hash;
     $texto[] = "========================================";
     $ticket = new Ticket();
     $ticket->texto = $texto;
     return array($ticket);
 }