Commit 07be8b61 authored by Kulya's avatar Kulya 😊

Fix error for assingn number for new user

parent 7f5d0aca
......@@ -172,8 +172,8 @@ class AloVoiceActions
// var_dump(array(!empty($arPeer["cid_num"]), ($arPeer["cid_num"] > $frNumFrom), ($arPeer["cid_num"] < $frNumTo), !in_array($arPeer["cid_num"],$bxUserPhones)));
if(
(!empty($arPeer["cid_num"])) &&
($arPeer["cid_num"] > $frNumFrom) &&
($arPeer["cid_num"] < $frNumTo) &&
($arPeer["cid_num"] >= $frNumFrom) &&
($arPeer["cid_num"] <= $frNumTo) &&
!in_array($arPeer["cid_num"],$bxUserPhones)
){
return $arPeer["cid_num"];
......
......@@ -747,8 +747,13 @@ class AloVoiceConnector
return false;
}
$resTaxINN = self::requesTaxInn($tin);
if( strlen($tin)==14 ){
$resTaxINN = self::requesTaxInn($tin);
}
else {
$resTaxINN = self::requesTaxInn($tin);
}
self::eLog($resTaxINN,"------ Connector :: LEAD Tax INFOs (".$tin."):");
if(empty($resTaxINN)){
......@@ -3134,6 +3139,49 @@ CFU=';
// }
public function pnflFields(){
return [
"VATRegCode" => "Код налогоплательщика",
"VATRegStatus" => "Статус налогоплательщика",
"account" => "Счёт",
"accountant" => "Бухгалтер",
"address" => "Адрес",
"bankAccount" => "Банковский счёт",
"bankCode" => "Код банка",
"company" => "Компания",
"director" => "Директор",
"directorPinfl" => "ПНФЛ директора",
"directorTin" => "ИНН директора",
"districtId" => "Код региона и города",
"fullName" => "Полное имя",
"isBudget" => "Бюджетный-ли?",
"isItd" => "ИТД-ли?",
"mfo" => "МФО",
"na1Code" => "Код ОПФ",
"na1Name" => "ОПФ",
"name" => "ФИО",
"ns10Code" => "Код города",
"ns11Code" => "Код района",
"oked" => "ОКЭД",
"passIssueDate" => "Дата выдачи пасспорта",
"passNumber" => "Номер паспорта",
"passOrg" => "Организация выдавщий паспорт",
"passSeries" => "Серия паспорта",
"passport" => "Серия и номер паспорта",
"personalNum" => "ПНФЛ",
"privateNotary" => "Нотариально приватный",
"regCode" => "Код регистрации",
"regionId" => "Код региона",
"selfEmployment" => "Самозанятый-ли?",
"shortName" => "Имя",
"shortname" => "Имя Фамилия и отчество",
"statusCode" => "Код статуса",
"statusName" => "Статус",
"taxGap" => "ГАП Налог",
"tin" => "ИНН"
];
}
public function innTaxFields($fiz=false){
if($fiz){
return ["tin", "ns10Code", "ns10Name", "ns11Code", "ns11Name", "name", "nameFull", "address", "regNum", "regDate", "fund", "gdFullName", "gdTin", "gdTelWork", "gdTelHome", "gbFullName", "gbTin", "gbTelWork", "gbTelHome", "nc1Code", "nc1Name", "nc2Code", "nc2Name", "nc3Code", "nc3Name", "nc4Code", "nc4Name", "nc5Code", "nc5Name", "nc6Code", "nc6Name", "ns1Code", "ns1Name", "ns2Code", "ns2Name", "ns3Code", "ns3Name", "ns4Code", "ns4Name", "ns13Code", "ns13Name", "na1Code", "na1Name", "account", "dateTin", "stateCode", "stateName"];
......@@ -3209,6 +3257,44 @@ CFU=';
// }
// }
public function didox_pnfl($pnfl=false){
$frominn = '303903621';
$didoxTokenFile = __DIR__.'/didox.json';
$didoxToken = false;
$jsDidoxToken = file_get_contents($didoxTokenFile);
$timerz = 36000;
if(!empty($jsDidoxToken)){
$arDdxToken = json_decode($jsDidoxToken,true);
if(!empty($arDdxToken["time"]) && !empty($arDdxToken["token"])){
$ddxrz = time()-$arDdxToken["time"];
if($ddxrz<$timerz){
$didoxToken = $arDdxToken["token"];
}
}
}
if(empty($didoxToken)){
$ddxRes = self::didoxrequest(false,"user/".$frominn."/token",["password"=>"mteamgfhjkm"]);
if(!empty($ddxRes) && strlen($ddxRes)>20){
if(file_put_contents($didoxTokenFile,json_encode(["time"=>time(),"token"=>$ddxRes]))){
$didoxToken = $ddxRes;
}
}
// return $ddxRes;
}
if(!empty($didoxToken) && !empty($pnfl)){
$ddxPnflRes = self::didoxrequest($didoxToken,"info/".$pnfl);
$arPnflRes = json_decode($ddxPnflRes,true);
if(!empty($arPnflRes)){
return $arPnflRes;
}
}
return false;
}
public function didox_inn($inn=false){
$frominn = '303903621';
$didoxTokenFile = __DIR__.'/didox.json';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment