bug fix in ippanel sms service and sell invoice
This commit is contained in:
parent
87c081b387
commit
70b21f13a6
|
@ -104,7 +104,8 @@ class BuyController extends AbstractController
|
||||||
'code' => $params['update'],
|
'code' => $params['update'],
|
||||||
'money' => $acc['money']
|
'money' => $acc['money']
|
||||||
]);
|
]);
|
||||||
if (!$doc) return $this->json($extractor->notFound());
|
if (!$doc)
|
||||||
|
return $this->json($extractor->notFound());
|
||||||
|
|
||||||
$rows = $entityManager->getRepository(HesabdariRow::class)->findBy([
|
$rows = $entityManager->getRepository(HesabdariRow::class)->findBy([
|
||||||
'doc' => $doc
|
'doc' => $doc
|
||||||
|
@ -239,7 +240,8 @@ class BuyController extends AbstractController
|
||||||
'code' => $params['label']['code'],
|
'code' => $params['label']['code'],
|
||||||
'type' => 'buy'
|
'type' => 'buy'
|
||||||
]);
|
]);
|
||||||
if (!$label) return $this->json($extractor->notFound());
|
if (!$label)
|
||||||
|
return $this->json($extractor->notFound());
|
||||||
}
|
}
|
||||||
foreach ($params['items'] as $item) {
|
foreach ($params['items'] as $item) {
|
||||||
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
||||||
|
@ -248,7 +250,8 @@ class BuyController extends AbstractController
|
||||||
'code' => $item['code'],
|
'code' => $item['code'],
|
||||||
'money' => $acc['money']
|
'money' => $acc['money']
|
||||||
]);
|
]);
|
||||||
if (!$doc) return $this->json($extractor->notFound());
|
if (!$doc)
|
||||||
|
return $this->json($extractor->notFound());
|
||||||
if ($params['label'] != 'clear') {
|
if ($params['label'] != 'clear') {
|
||||||
$doc->setInvoiceLabel($label);
|
$doc->setInvoiceLabel($label);
|
||||||
$entityManager->persist($doc);
|
$entityManager->persist($doc);
|
||||||
|
@ -327,15 +330,22 @@ class BuyController extends AbstractController
|
||||||
}
|
}
|
||||||
$temp['relatedDocsPays'] = $pays;
|
$temp['relatedDocsPays'] = $pays;
|
||||||
|
|
||||||
|
$temp['commodities'] = [];
|
||||||
foreach ($item->getHesabdariRows() as $item) {
|
foreach ($item->getHesabdariRows() as $item) {
|
||||||
if ($item->getRef()->getCode() == '104') {
|
if ($item->getRef()->getCode() == '104') {
|
||||||
$temp['discountAll'] = $item->getBd();
|
$temp['discountAll'] = $item->getBd();
|
||||||
} elseif ($item->getRef()->getCode() == '90') {
|
} elseif ($item->getRef()->getCode() == '90') {
|
||||||
$temp['transferCost'] = $item->getBs();
|
$temp['transferCost'] = $item->getBs();
|
||||||
}
|
}
|
||||||
|
if ($item->getCommodity()) {
|
||||||
|
$temp['commodities'][] = Explore::ExploreCommodity($item->getCommodity(), $item->getCommdityCount());
|
||||||
}
|
}
|
||||||
if(!array_key_exists('discountAll',$temp)) $temp['discountAll'] = 0;
|
}
|
||||||
if(!array_key_exists('transferCost',$temp)) $temp['transferCost'] = 0;
|
if (!array_key_exists('discountAll', $temp))
|
||||||
|
$temp['discountAll'] = 0;
|
||||||
|
if (!array_key_exists('transferCost', $temp))
|
||||||
|
$temp['transferCost'] = 0;
|
||||||
|
|
||||||
$dataTemp[] = $temp;
|
$dataTemp[] = $temp;
|
||||||
}
|
}
|
||||||
return $this->json($dataTemp);
|
return $this->json($dataTemp);
|
||||||
|
@ -350,14 +360,16 @@ class BuyController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
$acc = $access->hasRole('buy');
|
$acc = $access->hasRole('buy');
|
||||||
if (!$acc) throw $this->createAccessDeniedException();
|
if (!$acc)
|
||||||
|
throw $this->createAccessDeniedException();
|
||||||
|
|
||||||
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
||||||
'bid' => $acc['bid'],
|
'bid' => $acc['bid'],
|
||||||
'code' => $params['code'],
|
'code' => $params['code'],
|
||||||
'money' => $acc['money']
|
'money' => $acc['money']
|
||||||
]);
|
]);
|
||||||
if (!$doc) throw $this->createNotFoundException();
|
if (!$doc)
|
||||||
|
throw $this->createNotFoundException();
|
||||||
$pdfPid = 0;
|
$pdfPid = 0;
|
||||||
if ($params['pdf']) {
|
if ($params['pdf']) {
|
||||||
$pdfPid = $provider->createPrint(
|
$pdfPid = $provider->createPrint(
|
||||||
|
@ -414,14 +426,16 @@ class BuyController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
$acc = $access->hasRole('buy');
|
$acc = $access->hasRole('buy');
|
||||||
if (!$acc) throw $this->createAccessDeniedException();
|
if (!$acc)
|
||||||
|
throw $this->createAccessDeniedException();
|
||||||
|
|
||||||
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
||||||
'bid' => $acc['bid'],
|
'bid' => $acc['bid'],
|
||||||
'code' => $params['code'],
|
'code' => $params['code'],
|
||||||
'money' => $acc['money']
|
'money' => $acc['money']
|
||||||
]);
|
]);
|
||||||
if (!$doc) throw $this->createNotFoundException();
|
if (!$doc)
|
||||||
|
throw $this->createNotFoundException();
|
||||||
$person = null;
|
$person = null;
|
||||||
$discount = 0;
|
$discount = 0;
|
||||||
$transfer = 0;
|
$transfer = 0;
|
||||||
|
@ -466,7 +480,9 @@ class BuyController extends AbstractController
|
||||||
}
|
}
|
||||||
$note = '';
|
$note = '';
|
||||||
$printSettings = $entityManager->getRepository(PrintOptions::class)->findOneBy(['bid' => $acc['bid']]);
|
$printSettings = $entityManager->getRepository(PrintOptions::class)->findOneBy(['bid' => $acc['bid']]);
|
||||||
if($printSettings){$note = $printSettings->getBuyNoteString();}
|
if ($printSettings) {
|
||||||
|
$note = $printSettings->getBuyNoteString();
|
||||||
|
}
|
||||||
$pdfPid = $provider->createPrint(
|
$pdfPid = $provider->createPrint(
|
||||||
$acc['bid'],
|
$acc['bid'],
|
||||||
$this->getUser(),
|
$this->getUser(),
|
||||||
|
|
|
@ -35,7 +35,7 @@ class PrintersController extends AbstractController
|
||||||
#[Route('/api/printers/options/info', name: 'app_printers_options_info')]
|
#[Route('/api/printers/options/info', name: 'app_printers_options_info')]
|
||||||
public function app_printers_options_info(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
public function app_printers_options_info(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||||
{
|
{
|
||||||
$acc = $access->hasRole('settings');
|
$acc = $access->hasRole('join');
|
||||||
if (!$acc)
|
if (!$acc)
|
||||||
throw $this->createAccessDeniedException();
|
throw $this->createAccessDeniedException();
|
||||||
$settings = $entityManager->getRepository(PrintOptions::class)->findOneBy(['bid' => $acc['bid']]);
|
$settings = $entityManager->getRepository(PrintOptions::class)->findOneBy(['bid' => $acc['bid']]);
|
||||||
|
|
|
@ -65,8 +65,8 @@ class SMS
|
||||||
$password = $this->registryMGR->get('sms', 'password');
|
$password = $this->registryMGR->get('sms', 'password');
|
||||||
$from = $this->registryMGR->get('sms', 'fromNum');
|
$from = $this->registryMGR->get('sms', 'fromNum');
|
||||||
$input_data = [];
|
$input_data = [];
|
||||||
foreach ($params as $param) {
|
foreach ($params as $key=>$param) {
|
||||||
$input_data['%p' . strval(array_search($param, $params)) . '%'] = $param;
|
$input_data['p' . strval(array_search($param, $params))] = $param;
|
||||||
}
|
}
|
||||||
$url = "https://ippanel.com/patterns/pattern?username=" . $username . "&password=" . urlencode($password) . "&from=$from&to=" . json_encode($toArray) . "&input_data=" . urlencode(json_encode($input_data)) . "&pattern_code=$bodyID";
|
$url = "https://ippanel.com/patterns/pattern?username=" . $username . "&password=" . urlencode($password) . "&from=$from&to=" . json_encode($toArray) . "&input_data=" . urlencode(json_encode($input_data)) . "&pattern_code=$bodyID";
|
||||||
$handler = curl_init($url);
|
$handler = curl_init($url);
|
||||||
|
|
Loading…
Reference in a new issue