Code Duplication    Length = 21-22 lines in 2 locations

app/Controller/LancamentoVendasController.php 2 locations

@@ 19-40 (lines=22) @@
16
		return true;
17
 	}
18
19
 	public function cancelar($id_venda, $id_cliente) {
20
 		$response = $this->LancamentoVenda->find('first', array(
21
    			'conditions' => array(
22
    				'LancamentoVenda.venda_id' => $id_venda
23
    			)
24
    		)
25
    	);
26
27
 		$this->LancamentoVenda->id = $response['LancamentoVenda']['id'];
28
29
 		$this->LancamentoVenda->save(
30
 			['valor_pago' => 0]
31
 		);
32
33
 		echo json_encode(
34
 			[
35
 				'valor' => $response['LancamentoVenda']['valor']
36
 			]
37
 		);
38
 		exit;
39
40
 	}
41
42
 	public function aprovar($id_venda, $id_cliente) {
43
 		$response = $this->LancamentoVenda->find('first', array(
@@ 42-62 (lines=21) @@
39
40
 	}
41
42
 	public function aprovar($id_venda, $id_cliente) {
43
 		$response = $this->LancamentoVenda->find('first', array(
44
    			'conditions' => array(
45
    				'LancamentoVenda.venda_id' => $id_venda
46
    			)
47
    		)
48
    	);
49
50
 		$this->LancamentoVenda->id = $response['LancamentoVenda']['id'];
51
52
 		$this->LancamentoVenda->save(
53
 			['valor_pago' => $response['LancamentoVenda']['valor']]
54
 		);
55
 		
56
 		echo json_encode(
57
 			[
58
 				'valor' => $response['LancamentoVenda']['valor']
59
 			]
60
 		);
61
 		exit;
62
 	}
63
64
}