Beispiel #1
0
 public function consultarPrecioOfertaPorClienteHueso($cliente_id, $usuario_id, $marcacion_sec, $oferta_producto_id, $oferta_variedad_id, $oferta_grado_id, $oferta_tallos_x_bunch, $oferta_tipo_caja_id, $oferta_nro_caja)
 {
     $GrupoPrecioDetDAO = new GrupoPrecioDetDAO();
     $GrupoPrecioOfertaDAO = new GrupoPrecioOfertaDAO();
     $GrupoPrecioDetDAO->setEntityManager($this->getEntityManager());
     $GrupoPrecioOfertaDAO->setEntityManager($this->getEntityManager());
     //Nos permite identificar el grupo_precio_cab_id en que se encuentra el cliente para poder saber con que precio va a trabajar
     $reg_grupo_precio_det = $GrupoPrecioDetDAO->consultarPorUsuarioIdPorVariedadIdPorGradoId($usuario_id, $oferta_producto_id, $oferta_variedad_id, $oferta_grado_id, $oferta_tallos_x_bunch);
     //Se obtiene los registros HUESO (EL COMBO), de acuerdo a la CARNE
     $rs_precio_oferta = $GrupoPrecioOfertaDAO->consultarPorGrupoPrecioCabPorVariedadIdPorGradoId($reg_grupo_precio_det['grupo_precio_cab_id'], $oferta_producto_id, $oferta_variedad_id, $oferta_grado_id, $oferta_tallos_x_bunch);
     //Se pregunta registro por registro la disponibilidad y la conversion de las cajas
     $result_hueso = null;
     foreach ($rs_precio_oferta as $reg_precio_oferta) {
         $rs_dispo_precio_oferta = $this->getDispo($cliente_id, $usuario_id, $marcacion_sec, $oferta_tipo_caja_id, $reg_precio_oferta['variedad_combo_id'], $reg_precio_oferta['grado_combo_id'], false, true, false, $oferta_producto_id, $oferta_tallos_x_bunch);
         if ($rs_dispo_precio_oferta) {
             if (array_key_exists('result_dispo', $rs_dispo_precio_oferta)) {
                 $reg_dispo_precio_oferta = $rs_dispo_precio_oferta['result_dispo'][0];
                 $hueso_cajas_minima = $reg_precio_oferta['factor_combo'] * $oferta_nro_caja;
                 if ($reg_dispo_precio_oferta['nro_cajas'] >= $hueso_cajas_minima) {
                     $reg_hueso = array();
                     $reg_hueso['producto_id'] = $reg_dispo_precio_oferta['producto_id'];
                     $reg_hueso['variedad_id'] = $reg_dispo_precio_oferta['variedad_id'];
                     $reg_hueso['variedad_nombre'] = $reg_dispo_precio_oferta['variedad_nombre'];
                     $reg_hueso['grado_id'] = $reg_dispo_precio_oferta['grado_id'];
                     $reg_hueso['tallos_x_bunch'] = $reg_dispo_precio_oferta['tallos_x_bunch'];
                     $reg_hueso['tipo_caja_id'] = $reg_dispo_precio_oferta['tipo_caja_id'];
                     $reg_hueso['precio'] = $reg_dispo_precio_oferta['precio'];
                     $reg_hueso['nro_cajas'] = $reg_dispo_precio_oferta['nro_cajas'];
                     $reg_hueso['nro_cajas_requeridas'] = $hueso_cajas_minima;
                     $result_hueso[] = $reg_hueso;
                 }
                 //end if
             }
             //end if
         }
         //end if
     }
     //end foreach
     return $result_hueso;
 }
 /**
  * 
  * @param string $producto_id
  * @param string $variedad_id
  * @param int $grupo_precio_cab_id
  * @param string $texto_1er_elemento
  * @param string $color_1er_elemento
  * @return string
  */
 function getComboVariedad($producto_id, $variedad_id, $grupo_precio_cab_id, $texto_1er_elemento = "<Seleccione>", $color_1er_elemento = "#FFFFAA")
 {
     $GrupoPrecioDetDAO = new GrupoPrecioDetDAO();
     $GrupoPrecioDetDAO->setEntityManager($this->getEntityManager());
     $result = $GrupoPrecioDetDAO->consultarPorVariedad($producto_id, $grupo_precio_cab_id);
     $opciones = \Application\Classes\Combo::getComboDataResultset($result, 'variedad_id', 'variedad_nombre', $variedad_id, $texto_1er_elemento, $color_1er_elemento);
     return $opciones;
 }