Created
June 21, 2016 19:48
-
-
Save cesarAugusto1994/bc86f49621fb28ae12a293ed02946179 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dbStore = new Db_sqldados_Store(); | |
$dbStore->setNo($this->DadosAtendimento[0]['storeno']); | |
$dadosEstorno = [ | |
'f_int_tipo' => PDV_BancoSaidaValor::TIPO_ESTORNO_CREDIARIO, | |
'f_int_valor_movimento' => $arrMetodoPagamento['valor_recebido'], | |
'f_int_storeno' => $this->DadosAtendimento[0]['storeno'], | |
'f_int_bankno' => $dbStore->getBankno(), | |
'f_int_data_movimento' => date('Ymd'), | |
'f_int_status' => PDV_BancoSaidaValor::STATUS_ESTORNADO, | |
'f_str_obs' => $arrDados['f_str_descricao'], | |
]; | |
$bancoSaidaValor = new PDV_BancoSaidaValor(); | |
var_dump($dadosEstorno); | |
//throw new Exception('Passou'); | |
$metodosPagamento = ['0', '6', '7']; | |
if (in_array($arrMetodoPagamento['xatype'], $metodosPagamento)) { | |
$bancoSaidaValor->gerarDadosParaSaida($dadosEstorno); | |
if ('7' == $arrMetodoPagamento['xatype']) { | |
// Deleto o cheque da tabela cpav | |
$strQuery = " /* " . __METHOD__ ." */ | |
DELETE FROM " . g_str_saci_retaguarda . ".cpav | |
#SET status = 37 | |
WHERE checkno = " . $arrMetodoPagamento['checkno'] . " | |
AND serie = '" . $arrMetodoPagamento['serie'] . "' | |
AND branch = " . $arrMetodoPagamento['branch'] . " | |
AND bankno = " . $arrMetodoPagamento['bankno'] . " | |
AND custno = " . $this->DadosAtendimento[0]['custno'] . " | |
AND cpf_cgc = '" . $arrMetodoPagamento['cpf_cgc'] . "' "; | |
$arrUpdateCpav = g_arr_executa_query($strQuery, 'update'); | |
if (false == $arrUpdateCpav['bln']) | |
return array('classe' => 'erro', 'bln' => true, 'msg' => 'Erro ao excluir CPAV. ' . $arrUpdateCpav['erro']); | |
} | |
elseif ('6' == $arrMetodoPagamento['xatype']) { | |
// Deleto o cheque da tabela cpav | |
$strQuery = " /* " . __METHOD__ ." */ | |
DELETE FROM " . g_str_saci_retaguarda . ".cpdue | |
#SET status = 37 | |
WHERE checkno = " . $arrMetodoPagamento['checkno'] . " | |
AND serie = '" . $arrMetodoPagamento['serie'] . "' | |
AND branch = " . $arrMetodoPagamento['branch'] . " | |
AND bankno = " . $arrMetodoPagamento['bankno'] . " | |
AND custno = " . $this->DadosAtendimento[0]['custno'] . " | |
AND cpf_cgc = '" . $arrMetodoPagamento['cpf_cgc'] . "' "; | |
$arrUpdateCpav = g_arr_executa_query($strQuery, 'update'); | |
if (false == $arrUpdateCpav['bln']) | |
return array('classe' => 'erro', 'bln' => true, 'msg' => 'Erro ao excluir CPDUE. ' . $arrUpdateCpav['erro']); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment