Atualização companies_budgets_form.php
This commit is contained in:
parent
6889e9d9f8
commit
12b7baf2d5
1 changed files with 10 additions and 10 deletions
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
/** Importação de classes */
|
||||
use vendor\controller\api_sicoob\ApiSicoob;
|
||||
use vendor\controller\clients\ClientsValidate;
|
||||
use vendor\model\Clients;
|
||||
use vendor\controller\companies\CompaniesValidate;
|
||||
use vendor\model\Companies;
|
||||
|
||||
try{
|
||||
|
||||
|
|
@ -10,24 +10,24 @@ try{
|
|||
if($Main->verifyToken()){
|
||||
|
||||
/** Instânciamento de classes */
|
||||
$ClientsValidate = new ClientsValidate();
|
||||
$CompaniesValidate = new CompaniesValidate();
|
||||
$ApiSicoob = new ApiSicoob();
|
||||
$Clients = new Clients();
|
||||
$Companies = new Companies();
|
||||
|
||||
/** Parametros de entrada */
|
||||
$clientsId = isset($_POST['clients_id']) ? (int)filter_input(INPUT_POST,'clients_id', FILTER_SANITIZE_NUMBER_INT) : 0;
|
||||
$companyId = isset($_POST['company_id']) ? (int)filter_input(INPUT_POST,'company_id', FILTER_SANITIZE_NUMBER_INT) : 0;
|
||||
|
||||
/** Validando os campos de entrada */
|
||||
$ClientsValidate->setClientsId($clientsId);
|
||||
$CompaniesValidate->setCompanyId($companyId);
|
||||
|
||||
/** Verifico a existência de erros */
|
||||
if (empty($ClientsValidate->getErrors())) {
|
||||
if (empty($CompaniesValidate->getErrors())) {
|
||||
|
||||
/** Consulta os dados do cliente */
|
||||
$ClientsResult = $Clients->Get($ClientsValidate->getClientsId());
|
||||
$CompaniesResult = $Companies->Get($CompaniesValidate->getCompanyId());
|
||||
|
||||
/** Parametros a serem enviados */
|
||||
$params = $Main->ClearDoc($ClientsResult->document);
|
||||
$params = $Main->ClearDoc($CompaniesResult->document);
|
||||
$params .= '?numeroContrato='.$Main->LoadConfigPublic()->app->ticket->numero_contrato;
|
||||
$params .= '&codigoSituacao=1';
|
||||
$params .= '&dataInicio='.date("Y-m-01");
|
||||
|
|
@ -136,7 +136,7 @@ try{
|
|||
} else {
|
||||
|
||||
/** Retorna a mensagem com seu respectivo erro **/
|
||||
throw new InvalidArgumentException($ClientsValidate->getErrors(), 0);
|
||||
throw new InvalidArgumentException($CompaniesValidate->getErrors(), 0);
|
||||
}
|
||||
|
||||
/** Caso o token de acesso seja inválido, informo */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue