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