コード例 #1
0
 public function testEditarCliente()
 {
     $nombre = self::RandomString(15, FALSE, FALSE, FALSE) . " - " . time();
     $denominacion = "Denominacion - " . time();
     $descuento = 10;
     $limite_credito = 1000;
     $pass = "******";
     $sitio = "myweb.com";
     //se crea el cliente que despues será editado
     $nuevo_cliente = ClientesController::nuevo($nombre, $clasificacion_cliente = null, $codigo_cliente = null, $cuenta_de_mensajeria = null, $curp = null, $denominacion_comercial = $denominacion, $descuento_general = $descuento, $direcciones = null, $email = null, $id_cliente_padre = null, $id_moneda = 1, $id_tarifa_compra = null, $id_tarifa_venta = null, $limite_credito = $limite_credito, $password = $pass, $representante_legal = null, $rfc = null, $sitio_web = $sitio, $telefono_personal1 = null, $telefono_personal2 = null);
     //se edita el cliente recien ingresado
     ClientesController::Editar($nuevo_cliente['id_cliente'], $clasificacion_cliente = null, $codigo_cliente = null, $cuenta_de_mensajeria = null, $curp = null, $denominacion_comercial = $denominacion . "-123", $descuento_general = 0, $direcciones = null, $email = null, $id_cliente_padre = null, $id_moneda = null, $id_tarifa_compra = null, $id_tarifa_venta = null, $limite_credito = 1500, $password = "******", $password_anterior = "hola123", $razon_social = null, $representante_legal = null, $rfc = null, $sitio_web = $sitio . ".mx", $telefono_personal1 = null, $telefono_personal2 = null);
     $array_datos_cliente = ClientesController::Detalle($nuevo_cliente['id_cliente']);
     $this->assertNotEquals($denominacion, $array_datos_cliente[0]->getDenominacionComercial(), "---- 'testEditarCliente' LA DENOMINACION NO SE ACTUALIZÓ");
     $this->assertNotEquals(10, $array_datos_cliente[0]->getDescuento(), "---- 'testEditarCliente' EL DESCUENTO GENERAL NO SE ACTUALIZÓ");
     $this->assertNotEquals(1000, $array_datos_cliente[0]->getLimiteCredito(), "---- 'testEditarCliente' LIMINTE DE CREDITO NO SE ACTUALIZÓ");
     $this->assertNotEquals("hola123", $array_datos_cliente[0]->getPassword(), "---- 'testEditarCliente' PASSWORD NO SE ACTUALIZÓ");
     $this->assertNotEquals($sitio, $array_datos_cliente[0]->getPaginaWeb(), "---- 'testEditarCliente' SITIO WEB NO SE ACTUALIZÓ");
 }
コード例 #2
0
ファイル: ApiLoader.php プロジェクト: kailIII/pos-erp
 protected function GenerateResponse()
 {
     try {
         $this->response = ClientesController::Editar(isset($_POST['id_cliente']) ? $_POST['id_cliente'] : null, isset($_POST['clasificacion_cliente']) ? $_POST['clasificacion_cliente'] : null, isset($_POST['codigo_cliente']) ? $_POST['codigo_cliente'] : null, isset($_POST['cuenta_de_mensajeria']) ? $_POST['cuenta_de_mensajeria'] : null, isset($_POST['curp']) ? $_POST['curp'] : null, isset($_POST['denominacion_comercial']) ? $_POST['denominacion_comercial'] : null, isset($_POST['descuento_general']) ? $_POST['descuento_general'] : null, isset($_POST['direcciones']) ? json_decode($_POST['direcciones']) : null, isset($_POST['email']) ? $_POST['email'] : null, isset($_POST['extra_params']) ? json_decode($_POST['extra_params']) : null, isset($_POST['id_cliente_padre']) ? $_POST['id_cliente_padre'] : null, isset($_POST['id_moneda']) ? $_POST['id_moneda'] : null, isset($_POST['id_tarifa_compra']) ? $_POST['id_tarifa_compra'] : null, isset($_POST['id_tarifa_venta']) ? $_POST['id_tarifa_venta'] : null, isset($_POST['limite_credito']) ? $_POST['limite_credito'] : null, isset($_POST['password']) ? $_POST['password'] : null, isset($_POST['password_anterior']) ? $_POST['password_anterior'] : null, isset($_POST['razon_social']) ? $_POST['razon_social'] : null, isset($_POST['representante_legal']) ? $_POST['representante_legal'] : null, isset($_POST['rfc']) ? $_POST['rfc'] : null, isset($_POST['sitio_web']) ? $_POST['sitio_web'] : null, isset($_POST['telefono_personal1']) ? $_POST['telefono_personal1'] : null, isset($_POST['telefono_personal2']) ? $_POST['telefono_personal2'] : null);
     } catch (Exception $e) {
         //Logger::error($e);
         throw new ApiException($this->error_dispatcher->invalidDatabaseOperation($e->getMessage()));
     }
 }