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.
29 lines
970 B
29 lines
970 B
3 years ago
|
<?php
|
||
|
|
||
|
include "ISPIntegrator.php";
|
||
|
$isp = new ISPIntegrator();
|
||
|
|
||
|
$codcli = $isp->agi()->get_variable('CODCLI', true);
|
||
|
$nomenclatura = $isp->agi()->get_variable('NOMENCLATURA', true);
|
||
|
$clienteInfo = $isp->clienteInformacoes($codcli)['data']['results'][0];
|
||
|
$pendente=false;
|
||
|
|
||
|
$dataBusca = date('d-m-Y', strtotime('-2 month', time()));
|
||
|
$faturas = $isp->faturasClienteJson($codcli, $dataBusca)['data']['results'];
|
||
|
foreach ($faturas as $fatura) {
|
||
|
if($fatura['Saldo'] != "0.00"){
|
||
|
$pendente = true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if ($pendente) {
|
||
|
$redirecionamento_dados = $isp->db()->redirectUraDestino("REDIR_CONSULTA_PENDENCIA", "SUCESSO", $nomenclatura); //PENDENTE
|
||
|
} else {
|
||
|
$redirecionamento_dados = $isp->db()->redirectUraDestino("REDIR_CONSULTA_PENDENCIA", "FALHA", $nomenclatura); //OK
|
||
|
}
|
||
|
|
||
|
$isp->executarFluxo($redirecionamento_dados["TIPO"], $redirecionamento_dados["NOME"]);
|
||
|
|
||
|
?>
|
||
|
|
||
|
|