forked from Claudio/integracao
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.4 KiB
42 lines
1.4 KiB
<?php |
|
|
|
require_once 'TopSapp.php'; |
|
|
|
$registros = array( |
|
"id" => '', |
|
"reg_ura" => $ura, |
|
"reg_tronco" => $tronco, |
|
"reg_uniqueid" => $uid, |
|
"reg_id_metodo" => $idMetodo, |
|
"reg_uniqueid" => $uid, |
|
"reg_uniqueid_old" => $uidOld, |
|
"reg_fone" => $numero, |
|
"reg_status_exec" => '1', |
|
"reg_inicio" => date()); |
|
|
|
|
|
$tsap = new TopSapp(); |
|
$tsap->db()->setRegistros($registros); |
|
|
|
if (CONF_AUDIO_ERROR) { |
|
$tsap->db()->setIdAudioError(CONF_AUDIO_ERROR); |
|
} |
|
|
|
$cliente = $tsap->ObterClientes($tsap->agi()->get_variable('DOCUMENTO', true)); |
|
$invoice = $tsap->ObterDocReceber($cliente['dados'][0]['id']); |
|
$retorno = $tsap->EnviarDocReceberEmail($cliente['dados'][0]['id'], $invoice['dados'][0]['id'], $cliente['dados'][0]['email'], CONF_EMAIL_TITLE_INVOICE, CONF_EMAIL_SUBTITLE_INVOICE); |
|
|
|
$itgcTela = array( |
|
"NOME" => $tsap->agi()->get_variable('NOME', true), |
|
"DOCUMENTO" => $tsap->agi()->get_variable('DOCUMENTO', true), |
|
"ENDERECO" => $tsap->agi()->get_variable('ENDERECO', true) |
|
); |
|
$tsap->integracaoAgente($itgcTela, array('NOME', 'DOCUMENTO', 'ENDERECO')); |
|
|
|
if ($retorno['status']) { |
|
$tsap->agi()->exec_goto($tsap->db()->getAnuncio('INT_TP_BOLETO_ENVIADO')); |
|
} else { |
|
$tsap->agi()->exec_goto($tsap->db()->getAnuncio('INT_TP_BOLETO_FALHA')); |
|
} |
|
|
|
$tsap->db()->atualizaIntegracao(); |