public function testNuevaCuentaSeaAfectablePadreNoAfectable()
 {
     $id_catalogo_cuentas = self::NuevoCatalogoCuentas();
     $randmon_str = self::RandomString(15, FALSE, FALSE, FALSE) . " Padre " . time();
     $id_nueva_cuenta = ContabilidadController::NuevaCuenta(0, 1, 'Activo Circulante', 1, 0, $id_catalogo_cuentas, "Deudora", $randmon_str, "Balance", $id_cuenta_padre = "");
     $padre = ContabilidadController::DetalleCuenta($id_nueva_cuenta['id_cuenta_contable']);
     $this->assertEquals($padre["afectable"], 1);
     $randmon_str = self::RandomString(15, FALSE, FALSE, FALSE) . " Hija " . time();
     $id_nueva_cuenta2 = ContabilidadController::NuevaCuenta(0, 1, 'Activo Circulante', 1, 0, $id_catalogo_cuentas, "Deudora", $randmon_str, "Balance", $id_nueva_cuenta['id_cuenta_contable']);
     $hija = ContabilidadController::DetalleCuenta($id_nueva_cuenta2['id_cuenta_contable']);
     //se vuelve a trar a cuenta padre para obtener el valor actualzado
     $padre = ContabilidadController::DetalleCuenta($id_nueva_cuenta['id_cuenta_contable']);
     $this->assertEquals($hija["afectable"], 1);
     $this->assertEquals($padre["afectable"], 0);
 }
Exemple #2
0
 protected function GenerateResponse()
 {
     try {
         $this->response = ContabilidadController::DetalleCuenta(isset($_POST['id_cuenta_contable']) ? $_POST['id_cuenta_contable'] : null);
     } catch (Exception $e) {
         //Logger::error($e);
         throw new ApiException($this->error_dispatcher->invalidDatabaseOperation($e->getMessage()));
     }
 }